def _getAnswer(self): spkWrapper = None manager = self._conf.getCSBookingManager() for sw in manager.getSpeakerWrapperList(): if sw.getUniqueIdHash() == self.authKey: spkWrapper = sw if spkWrapper: spkWrapper.setStatus(SpeakerStatusEnum.REFUSED) spkWrapper.setRejectReason(self.reason) spkWrapper.triggerNotification() if manager.notifyElectronicAgreementAnswer(): subject = """[Indico] Electronic Agreement Rejected: '%s'""" % ( self._conf.getTitle()) content = _(self.MESSAGE_REJECT).format( speaker=spkWrapper.getObject().getDirectFullName(), title=self._conf.getTitle(), reason=self.reason, url=self._conf.getURL()) emailToList = [self._conf.getCreator().getEmail()] for event_manager in self._conf.getManagerList(): emailToList.append(event_manager.getEmail()) notification = ElectronicAgreementOrganiserNotification( emailToList, Config.getInstance().getNoReplyEmail(), content, subject) GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME)
def _sendMail(self, operation): """ Overloads _sendMail behavior for EVO """ if operation == 'new': #notification to admin try: notification = notifications.NewVidyoPublicRoomNotificationAdmin(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('Vidyo').error( """Could not send NewVidyoPublicRoomNotificationAdmin for booking with id %s of event with id %s, exception: %s""" % (self.getId(), self.getConference().getId(), str(e))) #notification to owner if isinstance(self.getOwnerObject(), Avatar): try: notification = notifications.VidyoOwnerChosenNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('Vidyo').error( """Could not send VidyoOwnerChosenNotification for booking with id %s of event with id %s, exception: %s""" % (self.getId(), self.getConference().getId(), str(e)))
def sendNotificationEmail(self, withdrawn = False): """ Sends an email to the contribution's submitters when the referee, editor or reviewer pass a judgement on the contribution and only if the manager has enabled the option in 'Automatic e-mails' section. """ review_manager = self.getReviewManager() authorList = review_manager.contribution.submitters referee = self.getReviewManager().getReferee() for author in authorList: if (isinstance(self, RefereeJudgement) and self.getConfPaperReview().getEnableRefereeJudgementEmailNotif()) \ or (isinstance(self, EditorJudgement) and (self._review.getConference().getConfPaperReview().getChoice() == ConferencePaperReview.LAYOUT_REVIEWING or not self.getJudgement() in ["Accept", "Reject"]) and self.getConfPaperReview().getEnableEditorJudgementEmailNotif()) \ or (isinstance(self, ReviewerJudgement) and not self.getJudgement() in ["Accept", "Reject"] and self.getConfPaperReview().getEnableReviewerJudgementEmailNotif()): if withdrawn: notification = ContributionReviewingJudgementWithdrawalNotification(author, self, self.getReviewManager().contribution) else: notification = ContributionReviewingJudgementNotification(author, self, self.getReviewManager().contribution) GenericMailer.sendAndLog(notification, self._review.getConference(), 'Paper Reviewing') # We send an email to the Referee if the layout or the content reviewer has sent a judgement if (self.getConfPaperReview().getChoice() == 4 and isinstance(self, EditorJudgement) \ and self.getConfPaperReview().getEnableEditorSubmittedRefereeEmailNotif()) \ or ((self.getConfPaperReview().getChoice() == 2 or self.getConfPaperReview().getChoice() == 4) and isinstance(self, ReviewerJudgement) \ and self.getConfPaperReview().getEnableReviewerSubmittedRefereeEmailNotif()): if withdrawn: notification = ContributionReviewingJudgementRefereeWithdrawalNotification(referee, self, self.getReviewManager().contribution) else: notification = ContributionReviewingJudgementRefereeNotification(referee, self, self.getReviewManager().contribution) GenericMailer.sendAndLog(notification, self._review.getConference(), 'Paper Reviewing')
def _getAnswer(self): report = "" i = 0 for email in self.emailToList: i += 1 if i != len(self.emailToList): report += "%s, " % email else: report += "%s." % email #{url} and {talkTitle} are mandatory to send the EA link if self.content.find('{url}') == -1: report = "url_error" elif self.content.find('{talkTitle}') == -1: report = "talkTitle_error" else: manager = self._conf.getCSBookingManager() for uniqueId in self.uniqueIdList: sw = manager.getSpeakerWrapperByUniqueId(uniqueId) if sw.getStatus() not in [ SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE ]: sw.setStatus(SpeakerStatusEnum.PENDING) subject = """[Indico] Electronic Agreement: '%s'""" % ( self._conf.getTitle()) notification = ElectronicAgreementNotification( [sw.getObject().getEmail()], self.cc, self.fromEmail, self.fromName, self.processContent(sw), subject) GenericMailer.sendAndLog( notification, self._conf, "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py", None) return report
def _getAnswer(self): spkWrapper = None manager = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId()) for sw in manager.getSpeakerWrapperList(): if sw.getUniqueIdHash() == self.authKey: spkWrapper = sw if spkWrapper: spkWrapper.setStatus(SpeakerStatusEnum.REFUSED) spkWrapper.setRejectReason(self.reason) spkWrapper.triggerNotification() if manager.notifyElectronicAgreementAnswer(): subject = """[Indico] Electronic Agreement Rejected: '%s'""" % (self._conf.getTitle()) content = _(self.MESSAGE_REJECT).format( speaker=spkWrapper.getObject().getDirectFullName(), title=self._conf.getTitle(), reason=self.reason, url=self._conf.getURL()) emailToList = [self._conf.getCreator().getEmail()] for event_manager in self._conf.getManagerList(): emailToList.append(event_manager.getEmail()) notification = ElectronicAgreementOrganiserNotification(emailToList, Config.getInstance().getNoReplyEmail(), content, subject) GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME)
def _getAnswer(self): report = ", ".join(self.emailToList) + "." # {url} and {talkTitle} are mandatory to send the EA link if self.content.find("{url}") == -1: report = "url_error" elif self.content.find("{talkTitle}") == -1: report = "talkTitle_error" else: manager = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId()) for uniqueId in self.uniqueIdList: sw = manager.getSpeakerWrapperByUniqueId(uniqueId) if sw.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]: sw.setStatus(SpeakerStatusEnum.PENDING) subject = """[Indico] Electronic Agreement: '%s'""" % (self._conf.getTitle()) notification = ElectronicAgreementNotification( [sw.getObject().getEmail()], self.cc, self.fromEmail, self.fromName, self.processContent(sw), subject, ) GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME) return report
def _getAnswer(self): report = ', '.join(self.emailToList) + '.' #{url} and {talkTitle} are mandatory to send the EA link if self.content.find('{url}') == -1: report = "url_error" elif self.content.find('{talkTitle}') == -1: report = "talkTitle_error" else: manager = Catalog.getIdx("cs_bookingmanager_conference").get( self._conf.getId()) for uniqueId in self.uniqueIdList: sw = manager.getSpeakerWrapperByUniqueId(uniqueId) if sw.getStatus() not in [ SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE ]: sw.setStatus(SpeakerStatusEnum.PENDING) subject = """[Indico] Electronic Agreement: '%s'""" % ( self._conf.getTitle()) notification = ElectronicAgreementNotification( [sw.getObject().getEmail()], self.cc, self.fromEmail, self.fromName, self.processContent(sw), subject) GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME) return report
def _sendMail(self, operation): """ Overloads _sendMail behavior for EVO """ if operation == 'new': #notification to admin try: notification = notifications.NewVidyoPublicRoomNotificationAdmin( self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/Vidyo/collaboration.py", self.getConference().getCreator()) except Exception, e: Logger.get('Vidyo').error( """Could not send NewVidyoPublicRoomNotificationAdmin for booking with id %s of event with id %s, exception: %s""" % (self.getId(), self.getConference().getId(), str(e))) #notification to owner if isinstance(self.getOwnerObject(), Avatar): try: notification = notifications.VidyoOwnerChosenNotification( self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/Vidyo/collaboration.py", self.getConference().getCreator()) except Exception, e: Logger.get('Vidyo').error( """Could not send VidyoOwnerChosenNotification for booking with id %s of event with id %s, exception: %s""" % (self.getId(), self.getConference().getId(), str(e)))
def _getAnswer(self): spkWrapper = None manager = self._conf.getCSBookingManager() for sw in manager.getSpeakerWrapperList(): if sw.getUniqueIdHash() == self.authKey: spkWrapper = sw if spkWrapper: spkWrapper.setStatus(SpeakerStatusEnum.SIGNED, self._req.get_remote_ip()) spkWrapper.triggerNotification() if manager.notifyElectronicAgreementAnswer(): subject = """[Indico] Electronic Agreement Accepted: '%s'""" % ( self._conf.getTitle()) content = _(self.MESSAGE_ACCEPT).format( speaker=spkWrapper.getObject().getDirectFullName(), title=self._conf.getTitle(), url=self._conf.getURL()) emailToList = [self._conf.getCreator().getEmail()] for event_manager in self._conf.getManagerList(): emailToList.append(event_manager.getEmail()) notification = ElectronicAgreementOrganiserNotification( emailToList, Config.getInstance().getNoReplyEmail(), content, subject) GenericMailer.sendAndLog( notification, self._conf, "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py", None)
def _getAnswer(self): spkWrapper = None manager = Catalog.getIdx("cs_bookingmanager_conference").get( self._conf.getId()) for sw in manager.getSpeakerWrapperList(): if sw.getUniqueIdHash() == self.authKey: spkWrapper = sw if spkWrapper: spkWrapper.setStatus(SpeakerStatusEnum.SIGNED, request.remote_addr) spkWrapper.triggerNotification() if manager.notifyElectronicAgreementAnswer(): subject = """[Indico] Electronic Agreement Accepted: '%s'""" % ( self._conf.getTitle()) content = _(self.MESSAGE_ACCEPT).format( speaker=spkWrapper.getObject().getDirectFullName(), title=self._conf.getTitle(), url=self._conf.getURL()) emailToList = [self._conf.getCreator().getEmail()] for event_manager in self._conf.getManagerList(): emailToList.append(event_manager.getEmail()) notification = ElectronicAgreementOrganiserNotification( emailToList, Config.getInstance().getNoReplyEmail(), content, subject) GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME)
def addReviewer(self, reviewer): """ Adds a reviewer to this contribution. reviewer has to be an Avatar object. """ if reviewer in self.getReviewersList(): raise MaKaCError( "This contribution is already assigned to the chosen reviewer") elif self.hasReferee(): self._reviewersList.append(reviewer) self.notifyModification() reviewer.linkTo(self._contribution, "reviewer") self.getConfReview().addReviewerContribution( reviewer, self._contribution) self.getLastReview().setReviewerDueDate( self.getConfReview().getDefaultReviewerDueDate()) if self.getLastReview().getAdviceFrom(reviewer) is None: self.getLastReview().addReviewerJudgement(reviewer) notification = ContributionReviewingNotification( reviewer, 'Reviewer', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", reviewer) else: raise MaKaCError( "Please choose a referee before assigning a reviewer")
def _getAnswer(self): report = "" i = 0 for email in self.emailToList: i += 1 if i != len(self.emailToList): report += "%s, " % email else: report += "%s." % email # {url} and {talkTitle} are mandatory to send the EA link if self.content.find("{url}") == -1: report = "url_error" elif self.content.find("{talkTitle}") == -1: report = "talkTitle_error" else: manager = self._conf.getCSBookingManager() for uniqueId in self.uniqueIdList: sw = manager.getSpeakerWrapperByUniqueId(uniqueId) sw.setStatus(SpeakerStatusEnum.PENDING) subject = """[Indico] Electronic Agreement: %s (event id: %s)""" % ( self._conf.getTitle(), self._conf.getId(), ) notification = ElectroniAgreementNotification( [sw.getObject().getEmail()], self.fromEmail, self.processContent(sw), subject ) GenericMailer.sendAndLog( notification, self._conf, "MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py", None ) return report
def removePaperReviewManager(self, paperReviewManager): """ Remove a paper review manager from the conference. paperReviewManager has to be an Avatar object. The paper review manager is sent a mail notification. """ if paperReviewManager in self._paperReviewManagersList: if self._userCompetences.has_key(paperReviewManager): if not ((paperReviewManager in self._editorsList) or \ (paperReviewManager in self._reviewersList) or \ (paperReviewManager in self._refereesList)): self.clearUserCompetences(paperReviewManager) del (self._userCompetences[paperReviewManager]) self._paperReviewManagersList.remove(paperReviewManager) paperReviewManager.unlinkTo(self._conference, "paperReviewManager") self.notifyModification() if self._enablePRMEmailNotif == True: notification = ConferenceReviewingRemoveNotification( paperReviewManager, 'Paper Review Manager', self._conference) GenericMailer.sendAndLog(notification, self._conference, 'Paper Reviewing') else: raise MaKaCError( "Cannot remove a paper review manager who is not yet paper review manager" )
def _getAnswer(self): report = "" i = 0 for email in self.emailToList: i += 1 if i != len(self.emailToList): report += "%s, "%email else: report += "%s."%email #{url} and {talkTitle} are mandatory to send the EA link if self.content.find('{url}') == -1: report = "url_error" elif self.content.find('{talkTitle}') == -1: report = "talkTitle_error" else: manager = self._conf.getCSBookingManager() for uniqueId in self.uniqueIdList: sw = manager.getSpeakerWrapperByUniqueId(uniqueId) if sw.getStatus() not in [SpeakerStatusEnum.SIGNED, SpeakerStatusEnum.FROMFILE]: sw.setStatus(SpeakerStatusEnum.PENDING) subject = """[Indico] Electronic Agreement: '%s'"""%(self._conf.getTitle()) notification = ElectronicAgreementNotification([sw.getObject().getEmail()], self.cc, self.fromEmail, self.fromName, self.processContent(sw), subject) GenericMailer.sendAndLog(notification, self._conf, MODULE_NAME) return report
def removeEditor(self): """ Removes the editor for this contribution. There is no 'editor' argument because there is only 1 editor by contribution. The ex-editor is notified by an email. """ self._editor.unlinkTo(self._contribution, "editor") self.getConfReview().removeEditorContribution(self._editor, self._contribution) notification = ContributionReviewingRemoveNotification(self._editor, 'Editor', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", self._editor) self._editor = None
def removeAllReviewers(self): """ Removes all the reviewers for this contribution """ for reviewer in self._reviewersList: reviewer.unlinkTo(self._contribution, "reviewer") self.getConfReview().removeReviewerContribution(reviewer, self._contribution) self.notifyModification() notification = ContributionReviewingRemoveNotification(reviewer, 'Reviewer', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", reviewer) del(self._reviewersList[:])
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): if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRelocatedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) 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 WebcastRequestError('edit', e)
def removeReferee(self): """ Removes the referee for this contribution. There is no 'referee' argument because there is only 1 referee by contribution. The ex-referee is notified by an email. """ self._referee.unlinkTo(self._contribution, "referee") self.getConfReview().removeRefereeContribution(self._referee, self._contribution) notification = ContributionReviewingRemoveNotification(self._referee, 'Referee', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", self._referee) self._referee = None
def sendNotificationEmail(self, widthdrawn = False): """ Sends an email to the contribution's authors when the referee, editor or reviewer pass a judgement on the contribution. """ authorList = self.getReviewManager().getContribution().getAuthorList() for author in authorList: if widthdrawn: notification = ContributionReviewingJudgementWithdrawalNotification(author, self, self.getReviewManager().getContribution()) else: notification = ContributionReviewingJudgementNotification(author, self, self.getReviewManager().getContribution()) GenericMailer.sendAndLog(notification, self._review.getConference(), "MaKaC/reviewing.py", author)
def removeEditor(self): """ Removes the editor for this contribution. There is no 'editor' argument because there is only 1 editor by contribution. The ex-editor is notified by an email. """ editor = self.getEditor() self.getConfPaperReview().removeEditorContribution(editor, self.contribution) #e-mail notification will be send when editor is removed from contribution only if the manager enable the option in 'Automatic e-mails' section if self.getConfPaperReview().getEnableEditorEmailNotifForContribution(): notification = ContributionReviewingRemoveNotification(editor.user, 'Layout Reviewer', self.contribution) GenericMailer.sendAndLog(notification, self.contribution.event_new.as_legacy, 'Paper Reviewing') self._editor = None
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 _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 _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 notifyEventDateChanges(self, oldStartDate, newStartDate, oldEndDate, newEndDate): manager = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId()) manager._changeConfStartDateInIndex(self, oldStartDate, newStartDate) if MailTools.needToSendEmails('WebcastRequest'): 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 WebcastRequestError('edit', e)
def notifyLocationChange(self): self.unindex_instances() self.index_instances() if MailTools.needToSendEmails('WebcastRequest'): 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 WebcastRequestError('edit', e)
def removeAllReviewers(self): """ Removes all the reviewers for this contribution """ for reviewer in self._reviewersList: self.getConfPaperReview().removeReviewerContribution(reviewer, self.contribution) self.notifyModification() #e-mail notification will be send when reviewers are removed from contribution only if the manager enable the option in 'Automatic e-mails' section if self.getConfPaperReview().getEnableReviewerEmailNotifForContribution(): notification = ContributionReviewingRemoveNotification(reviewer.user, 'Content Reviewer', self.contribution) GenericMailer.sendAndLog(notification, self.contribution.event_new.as_legacy, 'Paper Reviewing') del(self._reviewersList[:])
def _create(self): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('RecordingRequest'): try: notification = NewRequestNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) 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)
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 _reject(self): self._statusMessage = _("Request rejected by responsible") self._statusClass = "statusMessageError" try: notification = RequestRejectedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", None) 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 WebcastRequestError('reject', e)
def _delete(self): if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestDeletedNotification(self) GenericMailer.sendAndLog( notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) 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 WebcastRequestError('remove', e)
def removeReviewer(self, reviewer): """ Removes the reviewer for this contribution. The ex-reviewer is notified by an email. """ if reviewer in self._reviewersList: reviewer.unlinkTo(self._contribution, "reviewer") self.getConfReview().removeReviewerContribution(reviewer, self._contribution) self._reviewersList.remove(reviewer) self.notifyModification() notification = ContributionReviewingRemoveNotification(reviewer, 'Reviewer', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", reviewer) else: raise MaKaCError("Cannot remove a reviewer who is not yet assigned to this contribution")
def notifyEventDateChanges(self, oldStartDate, newStartDate, oldEndDate, newEndDate): manager = self._conf.getCSBookingManager() manager._changeConfStartDateInIndex(self, oldStartDate, newStartDate) if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRescheduledNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) 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 WebcastRequestError('edit', e)
def _sendNotificationToOldNewOwner(self, oldOwner): #notification to new owner if isinstance(self.getOwnerObject(), Avatar): try: notification = notifications.VidyoOwnerChosenNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), self.getPlugin().getName()) except Exception, e: Logger.get('Vidyo').error( """Could not send VidyoOwnerChosenNotification for booking with id %s of event with id %s, exception: %s""" % (self.getId(), self.getConference().getId(), str(e)))
def _modify(self, oldBookingParams): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('WebcastRequest'): 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 WebcastRequestError('edit', 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 _delete(self): import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().delForthcomingWebcast(self._conf) if MailTools.needToSendEmails('WebcastRequest'): 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 WebcastRequestError('remove', e)
def notifyLocationChange(self): self.unindex_instances() self.index_instances() if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestRelocatedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) 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 WebcastRequestError('edit', e)
def removeReviewer(self, reviewer): """ Removes the reviewer for this contribution. The ex-reviewer is notified by an email. """ reviewer_list = self.getReviewersList() if reviewer in reviewer_list: self.getConfPaperReview().removeReviewerContribution(reviewer, self.contribution) self.notifyModification() #e-mail notification will be send when reviewer is removed from contribution only if the manager enable the option in 'Automatic e-mails' section if self.getConfPaperReview().getEnableReviewerEmailNotifForContribution(): notification = ContributionReviewingRemoveNotification(reviewer.user, 'Content Reviewer', self.contribution) GenericMailer.sendAndLog(notification, self.contribution.event_new.as_legacy, 'Paper Reviewing')
def removeEditor(self): """ Removes the editor for this contribution. There is no 'editor' argument because there is only 1 editor by contribution. The ex-editor is notified by an email. """ self._editor.unlinkTo(self._contribution, "editor") self.getConfReview().removeEditorContribution(self._editor, self._contribution) notification = ContributionReviewingRemoveNotification( self._editor, 'Editor', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", self._editor) self._editor = None
def _modify(self): self._statusMessage = _("Request successfully sent") self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('WebcastRequest'): try: notification = RequestModifiedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", self.getConference().getCreator()) 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 WebcastRequestError('edit', e)
def _reject(self): self._statusMessage = "Request rejected by responsible" self._statusClass = "statusMessageError" import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().delForthcomingWebcast(self._conf) 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 WebcastRequestError('reject', e)
def _accept(self, user = None): self._statusMessage = "Request accepted" self._statusClass = "statusMessageOK" import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().addForthcomingWebcast(self._conf, self._bookingParams.get("audience", "")) 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 WebcastRequestError('accept', e)
def _create(self): self._statusMessage = "Request successfully sent" self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('WebcastRequest'): try: notification = NewRequestNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/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 WebcastRequestError('create', e)
def removeAllReviewers(self): """ Removes all the reviewers for this contribution """ for reviewer in self._reviewersList: reviewer.unlinkTo(self._contribution, "reviewer") self.getConfReview().removeReviewerContribution( reviewer, self._contribution) self.notifyModification() notification = ContributionReviewingRemoveNotification( reviewer, 'Reviewer', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", reviewer) del (self._reviewersList[:])
def removeReferee(self): """ Removes the referee for this contribution. There is no 'referee' argument because there is only 1 referee by contribution. The ex-referee is notified by an email. """ self._referee.unlinkTo(self._contribution, "referee") self.getConfReview().removeRefereeContribution(self._referee, self._contribution) notification = ContributionReviewingRemoveNotification( self._referee, 'Referee', self._contribution) GenericMailer.sendAndLog(notification, self._contribution.getConference(), "MaKaC/reviewing.py", self._referee) self._referee = None
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 _accept(self, user = None): self._statusMessage = "Request accepted" self._statusClass = "statusMessageOK" import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().addForthcomingWebcast(self._conf, self._bookingParams.get("audience", "")) try: notification = RequestAcceptedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/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 WebcastRequestError('accept', e)
def _delete(self): import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance( ).delForthcomingWebcast(self._conf) if MailTools.needToSendEmails('WebcastRequest'): 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 WebcastRequestError('remove', e)
def _reject(self): self._statusMessage = "Request rejected by responsible" self._statusClass = "statusMessageError" import MaKaC.webcast as webcast webcast.HelperWebcastManager.getWebcastManagerInstance().delForthcomingWebcast(self._conf) try: notification = RequestRejectedNotification(self) GenericMailer.sendAndLog(notification, self.getConference(), "MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py", None) 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 WebcastRequestError('reject', e)
def _modify(self): self._statusMessage = _("Request successfully sent") self._statusClass = "statusMessageOther" if MailTools.needToSendEmails('RecordingRequest'): try: notification = RequestModifiedNotification(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 RequestModifiedNotification for request with id %s of event %s, exception: %s""" % (self._id, self.getConference().getId(), str(e))) return RecordingRequestError('edit', e)