par Dorothée » 30 Oct 2003 à 16:36
Hello,J'ai développé une base qui permet de poser ses congés payés. Si ta demande a été acceptée alors l'agent qui tourne chaque nuit va t'inscrire ton congé dans ton agenda.Attention, ceci est le code pour un agenda en V5 (different de la V4!). J'ai été obligée de spécifier tous ces champs pour que cela soit compatible avec les palms des utilisateurs, mais seulement la moitié suffisent pour l'agenda notes seul.Voici:doc=> la demande de congéseventdoc=> l'evenement dans la boite mail de la personne qui a fait la demande.Set eventdoc=New notesdocument(dbevent)Set Form = New notesitem(eventdoc,"Form","Appointment")Form.IsSummary =TrueSet busyname = New notesitem(eventdoc,"$BusyName",doc.RequesterName(0),NAMES)busyname.IsSummary =TrueSet busypriority = New notesitem(eventdoc,"$BusyPriority","1")busypriority.IsSummary=Truebusypriority.IsNames=TrueSet altprincipal = New notesitem(eventdoc,"$AltPrincipal",doc.RequesterName(0))altprincipal.IsSummary=TrueSet csversion = New notesitem(eventdoc,"$CSVersion","2")csversion.IsSummary=TrueSet langchair = New notesitem(eventdoc,"$LangChair","")langchair.IsSummary=TrueSet langprincipal = New notesitem(eventdoc,"$LangPrincipal","")langprincipal.IsSummary=TrueSet smtp = New notesitem(eventdoc,"$SMTPKeepNotesItems","1")smtp.IsSummary=TrueSet webflags = New notesitem(eventdoc,"$WebFlags","J")webflags.IsSummary=TrueSet alarm = New notesitem(eventdoc,"Alarms","")alarm.IsSummary=TrueSet expandgroup = New notesitem(eventdoc,"$ExpandGroups","3")expandgroup.IsSummary = TrueSet PublicAccess = New notesitem(eventdoc,"$PublicAccess","1")PublicAccess.IsSummary= TrueverifFin= doc.End_Date(0)+" 20:00:00"Set NoPurge = New notesitem(eventdoc,"$NoPurge",Cdat(veriffin))NoPurge.IsSummary= TrueSet BookFreeTime = New notesitem(eventdoc,"BookFreeTime","")BookFreeTime.IsSummary= TrueSet Location = New notesitem(eventdoc,"Location","")Location.IsSummary= TrueSet Categories = New notesitem(eventdoc,"Categories","")Categories.IsSummary= TrueSet CopyTo = New notesitem(eventdoc,"CopyTo","")CopyTo.IsSummary= TrueCopyTo.IsNames= TrueSet Encrypt = New notesitem(eventdoc,"Encrypt ","0")encrypt.IsSummary= TrueSet OrgConfidential = New notesitem(eventdoc,"OrgConfidential","")OrgConfidential.IsSummary= TrueSet SendTo = New notesitem(eventdoc,"SendTo","",NAMES)SendTo.IsSummary= TrueSet CHAIR = New notesitem(eventdoc,"CHAIR",doc.RequesterName(0))CHAIR.IsSummary= TrueSet itemFrom=New notesitem(eventdoc,"From",doc.RequesterName(0))itemFrom.IsSummary = TrueitemFrom.IsAuthors=TrueSet Principal=New notesitem(eventdoc,"Principal",doc.RequesterName(0))Principal.IsSummary = TrueSet AppointmentType=New notesitem(eventdoc,"AppointmentType","2")AppointmentType.IsSummary = TrueSet Repeats=New notesitem(eventdoc,"Repeats","")Repeats.IsSummary = TrueSet Ressources=New notesitem(eventdoc,"Ressources","")Ressources.IsSummary = TrueRessources.IsNames = TrueSet RoomToReserve=New notesitem(eventdoc,"RoomToReserve","")RoomToReserve.IsSummary = TrueRoomToReserve.IsNames = TrueSet SaveOptions=New notesitem(eventdoc,"SaveOptions","")SaveOptions.IsSummary = TrueSet I_Body=New notesitem(eventdoc,"Body",doc.Comments(0))I_Body.IsEncrypted = TrueSet blindcopyto = New notesitem(eventdoc,"BlindCopyTo","")blindcopyto.IsSummary=Trueblindcopyto.IsNames=TrueSet EndDate = New notesitem(eventdoc,"EndDate",doc.End_Date(0))EndDate.IsSummary=TrueSet EndTime = New notesitem(eventdoc,"EndTime",Cdat(doc.End_Date(0)+" 20:00:00"))EndTime.IsSummary=TrueSet EnterCopyTo = New notesitem(eventdoc,"EnterCopyTo","")EnterCopyTo.IsSummary=TrueEnterCopyTo.IsNames = TrueSet EnterBlindCopyTo = New notesitem(eventdoc,"EnterBlindCopyTo","")EnterBlindCopyTo.IsSummary=TrueEnterBlindCopyTo.IsNames=TrueSet EnterSendTo = New notesitem(eventdoc,"EnterSendTo","")EnterSendTo.IsSummary=TrueEnterSendTo.IsNames=TrueDim nombre As Integernombre%=doc.Days_Elapsed(0)nombre% = nombre% - 1Redim myList(nombre%) As VariantDim verifDeb6 As New NotesDateTime ("")Set verifDeb6=New notesdatetime(doc.Start_Date(0))mylist(0)=Datevalue(doc.Start_Date(0)) For counter% = 1 To nombre%Call verifDeb6.AdjustDay(1)mylist(counter%) =Datevalue(verifDeb6.dateonly)Next Set notesItem1 = New notesitem(eventdoc,"CalendarDateTime",mylist)notesitem1.IsSummary=TrueverifFin= doc.End_Date(0)+" 20:00:00"Dim dateTime4 As NotesDateTimeSet dateTime4 = New NotesDateTime( "20:00:00")Set notesItem4 = New notesitem(eventdoc,"appendEndTime",dateTime4)notesItem4.IsSummary=Trueverifdeb=doc.Start_Date(0) + " 04:00:00"Dim dateTime5 As NotesDateTimeSet dateTime5 = New NotesDateTime( "04:00:00")Set notesItem5 = New notesitem(eventdoc,"appendStartTime",dateTime5)notesItem5.IsSummary = TrueverifFin= doc.End_Date(0)+" 20:00:00"Set date2 = New notesitem(eventdoc,"EndDateTime",Cdat(verifFin))date2.IsSummary = TrueSet exclude=New notesitem(eventdoc,"ExcludeFromView","D")Call exclude.appendtotextlist("S") exclude.IsSummary = TrueSet ViewIcon = New NotesItem(eventdoc, "_ViewIcon", 9)ViewIcon.IsSummary = TrueSet ORGTABLE = New NotesItem(eventdoc, "ORGTABLE", "P0")ORGTABLE.IsSummary = Trueverifdeb=doc.Start_Date(0)+" 04:00:00"Set StartDate = New NotesItem(eventdoc, "StartDate", Cdat(verifdeb))StartDate.IsSummary = TrueSet StartDateTime = New NotesItem(eventdoc, "StartDateTime", Cdat(verifdeb))StartDateTime.IsSummary = TrueSet Subject = New NotesItem(eventdoc, "Subject", "Congés")Subject.IsSummary = TrueSet AtlChair = New notesitem(eventdoc,"AltChair",doc.RequesterName(0))AtlChair.IsSummary=TrueSet Logo = New notesitem(eventdoc,"Logo","stdNotesLtr0")Logo.IsSummary=TrueSet MailFirstPass = New notesitem(eventdoc,"MailFirstPass","1")MailFirstPass.IsSummary=TrueSet MailOptions = New notesitem(eventdoc,"MailOptions","0")MailOptions.IsSummary=TrueSet Sequencenum = New notesitem(eventdoc,"Sequencenum",1)Sequencenum.IsSummary=TrueSet tmpNoActionBar = New notesitem(eventdoc,"tmpNoActionBar","")tmpNoActionBar.IsSummary=TrueSet tmpOEMClient = New notesitem(eventdoc,"tmpOEMClient","")tmpOEMClient.IsSummary=TrueSet Sign = New notesitem(eventdoc,"Sign","0")Sign.IsSummary=TrueSet StartTime = New notesitem(eventdoc,"StartTime",Cdat(doc.Start_Date(0)+" 04:00:00"))StartTime.IsSummary=TrueSet tmpOwnerHW = New notesitem(eventdoc,"tmpOwnerHW","1")tmpOwnerHW.IsSummary=TrueSet WebCategory = New notesitem(eventdoc,"WebCategory","")WebCategory.IsSummary=TrueSet WebDateTimeInit = New notesitem(eventdoc,"WebDateTimeInit","1")WebDateTimeInit.IsSummary=TrueCall eventdoc.save(True,False)Print "envoi event"