コード例 #1
0
ファイル: collaboration.py プロジェクト: sylvestre/indico
 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)
コード例 #2
0
ファイル: collaboration.py プロジェクト: sylvestre/indico
 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)
コード例 #3
0
ファイル: collaboration.py プロジェクト: sylvestre/indico
 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)
コード例 #4
0
ファイル: collaboration.py プロジェクト: sylvestre/indico
    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)
コード例 #5
0
ファイル: collaboration.py プロジェクト: sylvestre/indico
    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)
コード例 #6
0
ファイル: collaboration.py プロジェクト: sylvestre/indico
    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)
コード例 #7
0
    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)
コード例 #8
0
    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)
コード例 #9
0
                """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(