def UpdateEventParticipants(self, eventID, charsToAdd, charsToRemove): if eventID is not None: if len(charsToAdd) > 0: util.CSPAChargedAction('CSPACalendarCheck', self.calendarMgr, 'UpdateEventParticipants', eventID, charsToAdd, charsToRemove) elif len(charsToRemove) > 0: self.calendarMgr.UpdateEventParticipants(eventID, charsToAdd, charsToRemove) self.objectCaching.InvalidateCachedMethodCall('calendarMgr', 'GetResponsesToEvent', eventID, session.charid)
def CreateNewEvent(self, dateTime, duration, title, description, eventTag, important=0, invitees=[]): if not title.strip(): raise UserError('CalendarEventMustSpecifyTitle') year, month, wd, day, hour, min, sec, ms = blue.os.GetTimeParts( dateTime) if self.IsTooFarInFuture(year, month): raise UserError('CalendarTooFarIntoFuture', {'numMonths': const.calendarViewRangeInMonths}) if len(title) > const.calendarMaxTitleSize: raise UserError('CalendarTitleTooLong') newEventID = None if eventTag == const.calendarTagPersonal: if invitees: newEventID = util.CSPAChargedAction('CSPACalendarCheck', self.calendarMgr, 'CreatePersonalEvent', dateTime, duration, title, description, important, invitees) else: newEventID = self.calendarMgr.CreatePersonalEvent( dateTime, duration, title, description, important, invitees) if newEventID is not None: self.OnNewCalendarEvent(eventID=newEventID, ownerID=session.charid, eventDateTime=dateTime, eventDuration=duration, eventTitle=title, importance=important) if self.eventResponses is not None: self.eventResponses[ newEventID] = const.eventResponseAccepted elif eventTag == const.calendarTagCorp: newEventID = self.calendarMgr.CreateCorporationEvent( dateTime, duration, title, description, important) elif eventTag == const.calendarTagAlliance: newEventID = self.calendarMgr.CreateAllianceEvent( dateTime, duration, title, description, important)