def _getTalks(self): if self._isLecture: return """(This event is a lecture. Therefore, it has no talks)""" else: #"all" "choose" "neither" if self._bp["talks"] == "all": text = ["""The user chose "All Talks". List of talks:"""] allTalks = getTalks(self._conference) if allTalks: text.extend(MailTools.talkListText(self._conference, allTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(This event has no talks)") return "<br />".join(text) elif self._bp["talks"] == "neither": return """Please see the talk selection comments""" else: text = ["""The user chose the following talks:"""] selectedTalks = [self._conference.getContributionById(contribId) for contribId in self._bp["talkSelection"]] if selectedTalks: text.extend(MailTools.talkListText(self._conference, selectedTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(User did not choose any talks)") return "<br />".join(text)
def _getAnswer(self): talks = getTalks(self._conf, sort=True) return fossilize(talks, IContributionWithSpeakersFossil, tz=self._conf.getTimezone(), units='(hours)_minutes', truncate=True)
def getVars(self): vars = WCSPageTemplateBase.getVars( self ) vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginName)._allowMultiple vars["Conference"] = self._conf isLecture = self._conf.getType() == 'simple_event' vars["IsLecture"] = isLecture location = self._conf.getLocation() room = self._conf.getRoom() if location and location.getName() and location.getName().strip() and \ room and room.getName() and room.getName().strip(): vars["HasRoom"] = True else: vars["HasRoom"] = False booking = self._conf.getCSBookingManager().getSingleBooking('RecordingRequest') initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose' vars["InitialChoose"] = initialChoose contributions = [] if not isLecture and self._conf.getNumberOfContributions() > 0: underTheLimit = self._conf.getNumberOfContributions() <= self._RecordingRequestOptions["contributionLoadLimit"].getValue() initialDisplay = underTheLimit or (booking is not None and initialChoose) vars["DisplayTalks"] = initialDisplay #a talk is defined as a non-poster contribution talks = getTalks(self._conf, oneIsEnough = not initialDisplay) nTalks = len(talks) vars["HasTalks"] = nTalks > 0 if initialDisplay: talks.sort(key = Contribution.contributionStartDateForSort) contributions = fossilize(talks, IContributionWithSpeakersFossil, tz = self._conf.getTimezone(), units = '(hours)_minutes', truncate = True) else: vars["DisplayTalks"] = booking is not None and initialChoose vars["HasTalks"] = False vars["Contributions"] = contributions vars["ConsentFormURL"] = self._RecordingRequestOptions["ConsentFormURL"].getValue() vars["LectureOptions"] = lectureOptions vars["TypesOfEvents"] = typeOfEvents vars["PostingUrgency"] = postingUrgency vars["RecordingPurpose"] = recordingPurpose vars["IntendedAudience"] = intendedAudience vars["SubjectMatter"] = subjectMatter return vars
def _getTalks(self): if self._isLecture: return """(This event is a lecture. Therefore, it has no talks)""" else: #"all" "choose" "neither" if self._bp["talks"] == "all": text = ["""The user chose "All Talks". List of talks:"""] allTalks = getTalks(self._conference) if allTalks: text.extend( MailTools.talkListText(self._conference, allTalks)) text.append( "<strong>Important note:</strong> room is only shown if different from event." ) else: text.append("(This event has no talks)") return "<br />".join(text) elif self._bp["talks"] == "neither": return """Please see the talk selection comments""" else: text = ["""The user chose the following talks:"""] selectedTalks = [ self._conference.getContributionById(contribId) for contribId in self._bp["talkSelection"] ] if selectedTalks: text.extend( MailTools.talkListText(self._conference, selectedTalks)) text.append( "<strong>Important note:</strong> room is only shown if different from event." ) else: text.append("(User did not choose any talks)") return "<br />".join(text)
def _getAnswer(self): talks = getTalks(self._conf, sort = True) return fossilize(talks, IContributionWithSpeakersFossil, tz = self._conf.getTimezone(), units = '(hours)_minutes', truncate = True)