예제 #1
0
파일: pages.py 프로젝트: arturodr/indico
    def getVars(self):
        vars = WCSPageTemplateBase.getVars(self)

        resultGetOrphans = getOrphans()
        if resultGetOrphans["success"] == True:
            orphans = resultGetOrphans["result"]
        else:
            raise RecordingManagerException(resultGetOrphans["result"])

        vars["Orphans"] = orphans
        talks = getTalks(self._conf, sort=True)
        vars["Talks"] = talks
        vars["Conference"] = self._conf
        previewURL = CollaborationTools.getOptionValue("RecordingManager",
                                                       "micalaPreviewURL")
        if self._rh.use_https():
            previewURL = previewURL.replace("http", "https")
        vars["PreviewURL"] = previewURL

        langPrimary = CollaborationTools.getOptionValue(
            "RecordingManager", "languageCodePrimary")
        langSecondary = CollaborationTools.getOptionValue(
            "RecordingManager", "languageCodeSecondary")
        langDict = CollaborationTools.getOptionValue("RecordingManager",
                                                     "languageDictionary")
        (vars["FlagLanguageDataOK"], vars["LanguageErrorMessages"]) = \
            self._checkLanguageData(langPrimary, langSecondary, langDict)
        vars["LanguageCodePrimary"] = langPrimary
        vars["LanguageCodeSecondary"] = langSecondary
        vars["LanguageDictionary"] = langDict
        vars["LanguageCodes"] = sorted(
            CollaborationTools.getOptionValue("RecordingManager",
                                              "languageDictionary").keys())

        return vars
예제 #2
0
    def getVars(self):
        vars = WCSPageTemplateBase.getVars( self )

        resultGetOrphans = getOrphans()
        if resultGetOrphans["success"] == True:
            orphans = resultGetOrphans["result"]
        else:
            raise RecordingManagerException(resultGetOrphans["result"])

        vars["Orphans"] = orphans
        talks = getTalks(self._conf, sort = True)
        vars["Talks"] = talks
        vars["Conference"] = self._conf
        previewURL = CollaborationTools.getOptionValue("RecordingManager", "micalaPreviewURL")
        if self._rh.use_https():
            previewURL = previewURL.replace("http","https")
        vars["PreviewURL"] = previewURL

        langPrimary = CollaborationTools.getOptionValue("RecordingManager", "languageCodePrimary")
        langSecondary = CollaborationTools.getOptionValue("RecordingManager", "languageCodeSecondary")
        langDict = CollaborationTools.getOptionValue("RecordingManager", "languageDictionary")
        (vars["FlagLanguageDataOK"], vars["LanguageErrorMessages"]) = \
            self._checkLanguageData(langPrimary, langSecondary, langDict)
        vars["LanguageCodePrimary"]   = langPrimary
        vars["LanguageCodeSecondary"] = langSecondary
        vars["LanguageDictionary"]    = langDict
        vars["LanguageCodes"]         = sorted(CollaborationTools.getOptionValue("RecordingManager", "languageDictionary").keys())

        return vars
예제 #3
0
    def getVars(self):
        vars = WCSPageTemplateBase.getVars( self )

        vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple
        vars["Conference"] = self._conf

        isLecture = self._conf.getType() == 'simple_event'
        vars["IsLecture"] = isLecture

        underTheLimit = self._conf.getNumberOfContributions() <= self._RecordingRequestOptions["contributionLoadLimit"].getValue()
        manager = self._conf.getCSBookingManager()
        user = self._rh._getUser()
        isManager = user.isAdmin() or RCCollaborationAdmin.hasRights(user=user) or RCCollaborationPluginAdmin.hasRights(user=user, plugins=['RecordingRequest'])
        booking = manager.getSingleBooking('RecordingRequest')
        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["InitialChoose"] = initialChoose
        vars["DisplayTalks"] = initialDisplay
        vars["isManager"] = isManager

        talks, rRoomFullNames, rRoomNames, recordingAbleTalks, recordingUnableTalks = getCommonTalkInformation(self._conf)
        nRecordingCapable = len(recordingAbleTalks)

        vars["HasRecordingCapableTalks"] = nRecordingCapable > 0
        vars["NTalks"] = len(talks)

        # list of "locationName:roomName" strings
        vars["RecordingCapableRooms"] = rRoomFullNames
        vars["NRecordingCapableContributions"] = nRecordingCapable

        # we check if the event itself is recoring capable (depends on event's room)
        confLocation = self._conf.getLocation()
        confRoom = self._conf.getRoom()
        if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in rRoomNames):
            topLevelRecordingCapable = True
        else:
            topLevelRecordingCapable = False

        # Finally, this event is recoring capable if the event itself
        # or one of its talks are capable or user is admin, collaboration
        # manager or recording plugin manager
        vars["RecordingCapable"] = topLevelRecordingCapable or nRecordingCapable > 0 or isManager

        recordingAbleTalks.sort(key = Contribution.contributionStartDateForSort)
        talks.sort(key = Contribution.contributionStartDateForSort)

        fossil_args = dict(tz=self._conf.getTimezone(),
                           units='(hours)_minutes',
                           truncate=True)

        vars["Contributions"] = fossilize(talks, IContributionRRFossil, **fossil_args)
        vars["ContributionsAble"] = fossilize(recordingAbleTalks, IContributionRRFossil, **fossil_args)
        vars["ContributionsUnable"] = fossilize(recordingUnableTalks, IContributionRRFossil, **fossil_args)

        vars["PostingUrgency"] = postingUrgency
        vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf)
        vars["agreementName"] = CollaborationTools.getOptionValue("RecordingRequest", "AgreementName")
        return vars
예제 #4
0
파일: pages.py 프로젝트: bubbas/indico
    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()
        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, wcRoomFullNames, wcRoomNames, webcastAbleTalks = getCommonTalkInformation(self._conf)
        nTalks = len(talks)
        nWebcastCapable = len(webcastAbleTalks)

        vars["HasWebcastCapableTalks"] = nWebcastCapable > 0
        vars["NTalks"] = nTalks

        #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 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["Audiences"] = CollaborationTools.getOptionValue('WebcastRequest', "webcastAudiences")
        vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf)
        vars["agreementName"] = CollaborationTools.getOptionValue("WebcastRequest", "AgreementName")
        return vars
예제 #5
0
 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
예제 #6
0
class IContributionRRFossil(IContributionWithSpeakersFossil):
    """ This fossil is ready for when we add subcontribution granularity to contributions
        and to provide an example for a plugin-specific fossil
    """
    def getSubContributionList(self):
        pass

    getSubContributionList.result = ISubContributionWithSpeakersFossil

    def getRecordingCapable(self):
        pass

    getRecordingCapable.produce = lambda self: CollaborationTools.isAbleToBeWebcastOrRecorded(
        self, "RecordingRequest")
예제 #7
0
    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
예제 #8
0
파일: pages.py 프로젝트: arturodr/indico
    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
예제 #9
0
    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