def _delete(self): if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestDeletedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestDeletedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('remove', e)
def notifyLocationChange(self): self.unindex_instances() self.index_instances() if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestRelocatedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRelocatedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('edit', e)
def notifyEventDateChanges(self, oldStartDate, newStartDate, oldEndDate, newEndDate): manager = self._conf.getCSBookingManager() manager._changeConfStartDateInIndex(self, oldStartDate, newStartDate) if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestRescheduledNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRescheduledNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('edit', e)
def _reject(self): self._statusMessage = "Request rejected by responsible" self._statusClass = "statusMessageError" try: notification = RequestRejectedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestRejectedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('reject', e)
def _accept(self, user = None): self._statusMessage = "Request accepted" self._statusClass = "statusMessageOK" try: notification = RequestAcceptedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('accept', e)
def _modify(self, oldBookingParams): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestModifiedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception,e: Logger.get('RecReq').exception( """Could not send RequestModifiedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('edit', e)
def _accept(self): self._statusMessage = _("Request accepted") self._statusClass = "statusMessageOK" try: notification = RequestAcceptedNotification(self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py", None) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('accept', e)
def _create(self): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('RecordingRequest'): try: notification = NewRequestNotification(self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py", self.getConference().getCreator()) except Exception, e: Logger.get('RecReq').exception( """Could not send NewRequestNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('create', e)
"""Could not send RequestAcceptedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('accept', e) if MailTools.needToSendEmails('RecordingRequest'): try: notificationAdmin = RequestAcceptedNotificationAdmin( self, user) GenericMailer.sendAndLog(notificationAdmin, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception( """Could not send RequestAcceptedNotificationAdmin for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('accept', e) manager = Catalog.getIdx("cs_bookingmanager_conference").get( self._conf.getId()) manager.notifyInfoChange() def _reject(self): self._statusMessage = "Request rejected by responsible" self._statusClass = "statusMessageError" try: notification = RequestRejectedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('RecReq').exception(