[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 774
  • Last Modified:

National holidays in calendar

How can I get Notes calendar to mark all national holidays (christmas day, etc.) for a particular country, say Sweden?
0
AndreasHagglund
Asked:
AndreasHagglund
1 Solution
 
capperCommented:
You don't specify whether you are running r4.x or r5. In r5 there is a setting in the Domino Directory that will automatically populate entered holidays in the Notes calendars that are assigned to that setup profile.

For r4.x you need to get the users to add the calendar entries. We've written a script that will do just that. I've attached the script code. Put this is a button on an email and have the send it to all users. The script adds a Profile document so that the user can't add the holidays again and again. It also deletes the email when it's done.

I use this script to add the corporation's holidays to the user's calendar.

Sub Click(Source As Button)
      
      Dim session As New notessession
      
      Set db = session.currentdatabase
      
      Set docprofile =db.GetProfileDocument("Holiday Update",session.username)
      
      stringholiday2000 = docprofile.profileholiday2000(0)
      
      If stringholiday2000 = "" Then
            
            docprofile.profileholiday2000 = "Done"
            docprofile.save True, True
            
' Initialize the pop up box message to :            
            msg = "The following days have been added to your Notes Calendar : " & Chr(13) & Chr(13)
            
          'Good Friday
            AddHoliday "Good Friday" ,"04/21/2000" ,148
            
              'Victoria Day
            AddHoliday "Victoria Day" ,"05/22/2000",115
            
              'Canada Day
            AddHoliday "Canada Day" ,"07/3/2000",159
            
              'Civic Holiday
            AddHoliday "Civic Holiday / Simcoe Day" ,"08/7/2000",115
            
              'Labour Day
            AddHoliday "Labour Day" ,"09/4/2000",115
            
              'Thanksgiving Day
            AddHoliday "Thanksgiving Day" ,"10/9/2000",115
            
                 'Boxing Day
            AddHoliday "Boxing Day" ,"12/26/2000",85
            
              'Christmas Day
            AddHoliday "Christmas Day" ,"12/25/2000",146
            
               'New Years Day
            AddHoliday "New Year's Day Holiday" ,"01/1/2001",85
            
            
            msg = msg & Chr(13) &_
            "The 2000 floating stat day is to be taken at the employee's discretion with Manager approval" & Chr(13) &_
            "prior to December 31,2000" & Chr(13)
            
            Messagebox msg
            
            
      Else
            Messagebox "Dates already set!"
            
      End If
      
     'Delete the document now..
      
      Dim workspace As New notesuiworkspace
      Dim uidoc As notesuidocument
      Set uidoc = workspace.currentdocument
      Call uidoc.deletedocument
      
End Sub

Sub AddHoliday(hName ,d1 As String,icon As Integer)
      
      Dim session As New notessession
      Dim d2,d3 As String
      
      d2 = d1 & " 11:59:59 PM"
      d3 = d1 & " 12:01:01 AM"
      d1 = d3
      
      Set doc = New notesdocument(db)
      
      Set datetime1 = New notesdatetime(d1)
      Set datetime2 = New notesdatetime(d2)
      Set datetime = New notesdatetime(d3)
      
      doc.subject = hName
      doc.form = "Appointment"
      doc.appointmenttype = "2"
      Set doc.calendardatetime = datetime1
      Set doc.startdatetime = datetime1
      Set doc.startdate = datetime1
      doc.chair = session.username
      doc.duration = 1
      Set doc.enddatetime = datetime2
      doc.from = session.username
      doc.excludefromview = "D"
      doc.ORGTABLE = "P0"
      doc.broadcast = ""
      doc.Categories = ""
      Call doc.appenditemvalue ("_Viewicon", icon)
      doc.bookfreetime = ""
      Call doc.appenditemvalue ("$Busyname",session.username )  
      Call doc.appenditemvalue ("$BusyPriority", "1")
      Call doc.appenditemvalue ("$NoPurge", datetime1)
      Call doc.appenditemvalue ("$Publicaccess", "1")
      doc.save True, True
      
'            Append the holiday to the pop up box message
      msg = msg & hName & " " & Format$(d1,"mmmm d, yyyy") & Chr(13)
      
End Sub
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now