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": talkInfo = getCommonTalkInformation(self._conference) text = ["""The user chose "All webcast-able Talks". List of webcast-able talks:"""] webcastableTalks = talkInfo[3] if webcastableTalks: text.extend(MailTools.talkListText(self._conference, webcastableTalks)) text.append("<strong>Important note:</strong> room is only shown if different from event.") else: text.append("(This event has no webcast-able talks)") return "<br />".join(text) 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 getVars(self): vars=WCSPageTemplateBase.getVars( self ) vars["Conference"] = self._conf vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginName)._allowMultiple isLecture = self._conf.getType() == 'simple_event' vars["IsLecture"] = isLecture underTheLimit = self._conf.getNumberOfContributions() <= self._WebcastRequestOptions["contributionLoadLimit"].getValue() booking = self._conf.getCSBookingManager().getSingleBooking('WebcastRequest') initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose' initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose) vars["DisplayTalks"] = initialDisplay vars["InitialChoose"] = initialChoose talks, webcastCapableRooms, webcastAbleTalks = getCommonTalkInformation(self._conf) nTalks = len(talks) nWebcastCapable = len(webcastAbleTalks) vars["HasWebcastCapableTalks"] = nWebcastCapable > 0 vars["NTalks"] = nTalks #list of "locationName:roomName" strings vars["WebcastCapableRooms"] = webcastCapableRooms vars["NWebcastCapableContributions"] = nWebcastCapable #we see if the event itself is webcast capable (depends on event's room) confLocation = self._conf.getLocation() confRoom = self._conf.getRoom() if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in webcastCapableRooms): topLevelWebcastCapable = True else: topLevelWebcastCapable = False #Finally, this event is webcast capable if the event itself or one of its talks are vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0 if initialDisplay: webcastAbleTalks.sort(key = Contribution.contributionStartDateForSort) vars["Contributions"] = fossilize(webcastAbleTalks, IContributionWithSpeakersFossil, tz = self._conf.getTimezone(), units = '(hours)_minutes', truncate = True) else: vars["Contributions"] = [] vars["LectureOptions"] = lectureOptions vars["TypesOfEvents"] = typeOfEvents vars["PostingUrgency"] = postingUrgency vars["WebcastPurpose"] = webcastPurpose vars["IntendedAudience"] = intendedAudience vars["SubjectMatter"] = subjectMatter vars["ConsentFormURL"] = self._WebcastRequestOptions["ConsentFormURL"].getValue() return vars
def getVars(self): vars=WCSPageTemplateBase.getVars( self ) vars["Conference"] = self._conf vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple isLecture = self._conf.getType() == 'simple_event' vars["IsLecture"] = isLecture underTheLimit = self._conf.getNumberOfContributions() <= self._WebcastRequestOptions["contributionLoadLimit"].getValue() manager = self._conf.getCSBookingManager() user = self._rh._getUser() isManager = user.isAdmin() or RCCollaborationAdmin.hasRights(user=user) or RCCollaborationPluginAdmin.hasRights(user=user, plugins=['WebcastRequest']) booking = manager.getSingleBooking('WebcastRequest') initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose' initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose) vars["DisplayTalks"] = initialDisplay vars["InitialChoose"] = initialChoose vars["isManager"] = isManager talks, wcRoomFullNames, wcRoomNames, webcastAbleTalks, webcastUnableTalks = getCommonTalkInformation(self._conf) nWebcastCapable = len(webcastAbleTalks) vars["HasWebcastCapableTalks"] = nWebcastCapable > 0 vars["NTalks"] = len(talks) # list of "locationName:roomName" strings vars["WebcastCapableRooms"] = wcRoomFullNames vars["NWebcastCapableContributions"] = nWebcastCapable # we see if the event itself is webcast capable (depends on event's room) confLocation = self._conf.getLocation() confRoom = self._conf.getRoom() if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in wcRoomNames): topLevelWebcastCapable = True else: topLevelWebcastCapable = False # Finally, this event is webcast capable if the event itself or # or one of its talks are capable or user is admin, collaboration # manager or webcast plugin manager vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0 or isManager webcastAbleTalks.sort(key = Contribution.contributionStartDateForSort) fossil_args = dict(tz=self._conf.getTimezone(), units='(hours)_minutes', truncate=True) vars["Contributions"] = fossilize(talks, IContributionWRFossil, **fossil_args) vars["ContributionsAble"] = fossilize(webcastAbleTalks, IContributionWRFossil, **fossil_args) vars["ContributionsUnable"] = fossilize(webcastUnableTalks, IContributionWRFossil, **fossil_args) vars["Audiences"] = CollaborationTools.getOptionValue('WebcastRequest', "webcastAudiences") vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf) vars["agreementName"] = CollaborationTools.getOptionValue("WebcastRequest", "AgreementName") return vars
def _getAnswer(self): talkInfo = getCommonTalkInformation(self._conf) webcastAbleTalks = talkInfo[3] webcastAbleTalks.sort(key = Contribution.contributionStartDateForSort) return fossilize(webcastAbleTalks, IContributionWithSpeakersFossil, tz = self._conf.getTimezone(), units = '(hours)_minutes', truncate = True)
def _getAnswer(self): talkInfo = getCommonTalkInformation(self._conf) webcastAbleTalks = talkInfo[2] webcastAbleTalks.sort(key = Contribution.contributionStartDateForSort) return fossilize(webcastAbleTalks, IContributionWithSpeakersFossil, tz = self._conf.getTimezone(), units = '(hours)_minutes', truncate = True)
def getVars(self): vars=WCSPageTemplateBase.getVars( self ) vars["Conference"] = self._conf vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple isLecture = self._conf.getType() == 'simple_event' vars["IsLecture"] = isLecture underTheLimit = self._conf.getNumberOfContributions() <= self._WebcastRequestOptions["contributionLoadLimit"].getValue() manager = self._conf.getCSBookingManager() user = self._rh._getUser() isManager = user.isAdmin() or RCCollaborationAdmin.hasRights(user=user) or RCCollaborationPluginAdmin.hasRights(user=user, plugins=['WebcastRequest']) booking = manager.getSingleBooking('WebcastRequest') initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose' initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose) vars["DisplayTalks"] = initialDisplay vars["InitialChoose"] = initialChoose vars["isManager"] = isManager talks, wcRoomFullNames, wcRoomNames, webcastAbleTalks, webcastUnableTalks = getCommonTalkInformation(self._conf) nWebcastCapable = len(webcastAbleTalks) vars["HasWebcastCapableTalks"] = nWebcastCapable > 0 vars["NTalks"] = len(talks) # list of "locationName:roomName" strings vars["WebcastCapableRooms"] = wcRoomFullNames vars["NWebcastCapableContributions"] = nWebcastCapable # we see if the event itself is webcast capable (depends on event's room) confLocation = self._conf.getLocation() confRoom = self._conf.getRoom() if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in wcRoomNames): topLevelWebcastCapable = True else: topLevelWebcastCapable = False # Finally, this event is webcast capable if the event itself or # or one of its talks are capable or user is admin, collaboration # manager or webcast plugin manager vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0 or isManager if initialDisplay: webcastAbleTalks.sort(key = Contribution.contributionStartDateForSort) fossil_args = dict(tz=self._conf.getTimezone(), units='(hours)_minutes', truncate=True) vars["Contributions"] = fossilize(talks, IContributionWRFossil, **fossil_args) vars["ContributionsAble"] = fossilize(webcastAbleTalks, IContributionWRFossil, **fossil_args) vars["ContributionsUnable"] = fossilize(webcastUnableTalks, IContributionWRFossil, **fossil_args) else: vars["Contributions"] = [] vars["ContributionsAble"] = [] vars["ContributionsUnable"] = [] vars["Audiences"] = CollaborationTools.getOptionValue('WebcastRequest', "webcastAudiences") vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf) vars["agreementName"] = CollaborationTools.getOptionValue("WebcastRequest", "AgreementName") return vars
def getVars(self): vars = WCSPageTemplateBase.getVars(self) vars["Conference"] = self._conf vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass( self._pluginName)._allowMultiple isLecture = self._conf.getType() == 'simple_event' vars["IsLecture"] = isLecture underTheLimit = self._conf.getNumberOfContributions( ) <= self._WebcastRequestOptions["contributionLoadLimit"].getValue() booking = self._conf.getCSBookingManager().getSingleBooking( 'WebcastRequest') initialChoose = booking is not None and booking._bookingParams[ 'talks'] == 'choose' initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose) vars["DisplayTalks"] = initialDisplay vars["InitialChoose"] = initialChoose talks, webcastCapableRooms, webcastAbleTalks = getCommonTalkInformation( self._conf) nTalks = len(talks) nWebcastCapable = len(webcastAbleTalks) vars["HasWebcastCapableTalks"] = nWebcastCapable > 0 vars["NTalks"] = nTalks #list of "locationName:roomName" strings vars["WebcastCapableRooms"] = webcastCapableRooms vars["NWebcastCapableContributions"] = nWebcastCapable #we see if the event itself is webcast capable (depends on event's room) confLocation = self._conf.getLocation() confRoom = self._conf.getRoom() if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in webcastCapableRooms): topLevelWebcastCapable = True else: topLevelWebcastCapable = False #Finally, this event is webcast capable if the event itself or one of its talks are vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0 if initialDisplay: webcastAbleTalks.sort( key=Contribution.contributionStartDateForSort) vars["Contributions"] = fossilize(webcastAbleTalks, IContributionWithSpeakersFossil, tz=self._conf.getTimezone(), units='(hours)_minutes', truncate=True) else: vars["Contributions"] = [] vars["LectureOptions"] = lectureOptions vars["TypesOfEvents"] = typeOfEvents vars["PostingUrgency"] = postingUrgency vars["WebcastPurpose"] = webcastPurpose vars["IntendedAudience"] = intendedAudience vars["SubjectMatter"] = subjectMatter vars["ConsentFormURL"] = self._WebcastRequestOptions[ "ConsentFormURL"].getValue() return vars