Пример #1
0
    def _mapFromParams(self, params):
        self.title = params.get("title", "").strip()
        self._otherFields = {}
        for f in self._afm.getFields():
            fid = f.getId()
            value = params.get("f_%s" % fid, "").strip()
            self._otherFields[fid] = value
        self.type = params.get("type", None)
        self.tracks = normaliseListParam(params.get("tracks", []))

        if self._displayValues:
            # the call comes from modifying an existing abstract, we want to display the current content in the abstract form
            self._prAuthorsListParam = params.get("prAuthors", [])
            self._coAuthorsListParam = params.get("coAuthors", [])
            self._setExistingAuthors()
        else:
            # the call comes from submitting a new abstract or modifying an existing abstract
            from MaKaC.services.interface.rpc import json
            self._prAuthorsListParam = json.decode(params.get("prAuthors", "[]"))
            self._coAuthorsListParam = json.decode(params.get("coAuthors", "[]"))
            self._setNewAuthors()
        self.comments = params.get("comments", "")
        self.origin = params.get("origin", "display")
        self.files = normaliseListParam(params.get("file", []))
        self.existingFiles = normaliseListParam(params.get("existingFile", []))
Пример #2
0
    def _getPersons(self):
        cpAvatars, cpNewUsers, cpEditedAvatars , auAvatars, auNewUsers, auEditedAvatars = [], [], [] , [] , [] , []
        from MaKaC.services.interface.rpc import json
        chairpersonDict = json.decode(self._params.get("chairperson") or "[]") or []
        allowedUsersDict = json.decode(self._params.get("allowedUsers") or "[]") or []
        if chairpersonDict:
            cpAvatars, cpNewUsers, cpEditedAvatars = UserListModificationBase.retrieveUsers({"userList":chairpersonDict})
        if allowedUsersDict :
            auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"userList":allowedUsersDict})

        return cpAvatars, cpNewUsers, cpEditedAvatars, auAvatars
Пример #3
0
 def _getPersons(self):
     cpAvatars, cpNewUsers, auAvatars = [], [], []
     from MaKaC.services.interface.rpc import json
     chairpersonDict = json.decode(self._params.get("chairperson"))
     allowedUsersDict = json.decode(self._params.get("allowedUsers"))
     if chairpersonDict:
         cpAvatars, cpNewUsers, cpEditedAvatars = UserListModificationBase.retrieveUsers({"userList":chairpersonDict})
     if allowedUsersDict :
         auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"userList":allowedUsersDict})
     #raise "avt: %s, newusers: %s, edited: %s"%(map(lambda x:x.getFullName(),avatars), newUsers, editedAvatars)
     return cpAvatars, cpNewUsers, auAvatars
Пример #4
0
    def _getPersons(self):
        cpAvatars, cpNewUsers, cpEditedAvatars , auAvatars, auNewUsers, auEditedAvatars = [], [], [] , [] , [] , []
        from MaKaC.services.interface.rpc import json
        chairpersonDict = json.decode(self._params.get("chairperson", "")) or []
        allowedUsersDict = json.decode(self._params.get("allowedUsers", "")) or []
        if chairpersonDict:
            cpAvatars, cpNewUsers, cpEditedAvatars = UserListModificationBase.retrieveUsers({"userList":chairpersonDict})
        if allowedUsersDict :
            auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"userList":allowedUsersDict})

        return cpAvatars, cpNewUsers, cpEditedAvatars, auAvatars
Пример #5
0
    def _getPersons(self):
        cpAvatars, cpNewUsers, auAvatars = [], [], []
        from MaKaC.services.interface.rpc import json
        chairpersonDict = json.decode(self._params.get("chairperson", []))
        allowedUsersDict = json.decode(self._params.get("allowedUsers", []))
        if chairpersonDict:
            cpAvatars, cpNewUsers, cpEditedAvatars = UserListModificationBase.retrieveUsers({"userList":chairpersonDict})
        if allowedUsersDict :
            auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"userList":allowedUsersDict})
        #raise "avt: %s, newusers: %s, edited: %s"%(map(lambda x:x.getFullName(),avatars), newUsers, editedAvatars)

        return cpAvatars, cpNewUsers, auAvatars
    def _checkParams_POST(self):
        defaultArrivalOffset = [-2, 0]
        defaultDepartureOffset = [1, 3]

        post_pm = ParameterManager(decode(request.data))
        self._arrivalOffsetDates = post_pm.extract(
            'arrivalOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultArrivalOffset)
        self._departureOffsetDates = post_pm.extract(
            'departureOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultDepartureOffset)
        self._items = post_pm.extract('items', pType=list, allowEmpty=False)

        if (len(self._arrivalOffsetDates) != 2 or
                self._arrivalOffsetDates[0] == '' or
                self._arrivalOffsetDates[1] == ''):
            self._arrivalOffsetDates = defaultArrivalOffset
        if (len(self._departureOffsetDates) != 2 or
                self._departureOffsetDates[0] == '' or
                self._departureOffsetDates[1] == ''):
            self._departureOffsetDates = defaultDepartureOffset
Пример #7
0
    def _checkParams_POST(self):
        defaultArrivalOffset = [-2, 0]
        defaultDepartureOffset = [1, 3]

        post_pm = ParameterManager(decode(request.data))
        self._arrivalOffsetDates = post_pm.extract(
            'arrivalOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultArrivalOffset)
        self._departureOffsetDates = post_pm.extract(
            'departureOffsetDates',
            pType=list,
            allowEmpty=False,
            defaultValue=defaultDepartureOffset)
        self._items = post_pm.extract('items', pType=list, allowEmpty=False)

        if (len(self._arrivalOffsetDates) != 2
                or self._arrivalOffsetDates[0] == ''
                or self._arrivalOffsetDates[1] == ''):
            self._arrivalOffsetDates = defaultArrivalOffset
        if (len(self._departureOffsetDates) != 2
                or self._departureOffsetDates[0] == ''
                or self._departureOffsetDates[1] == ''):
            self._departureOffsetDates = defaultDepartureOffset
Пример #8
0
    def _getAllowedUsers(self, params):

        auAvatars = []
        from MaKaC.services.interface.rpc import json
        allowedUsersDict = json.decode(params.get("allowedUsers"))
        if allowedUsersDict :
            auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"allowedUserList":allowedUsersDict}, "allowedUserList")

        return auAvatars
Пример #9
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionHeader = {}
     self._sectionHeader["title"] = post_pm.extract('title',
                                                    pType=str,
                                                    allowEmpty=False)
     self._sectionHeader["description"] = post_pm.extract('description',
                                                          pType=str,
                                                          allowEmpty=True)
Пример #10
0
    def _getAllowedUsers(self, params):

        auAvatars = []
        from MaKaC.services.interface.rpc import json
        allowedUsersDict = json.decode(params.get("allowedUsers"))
        if allowedUsersDict :
            auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"allowedUserList":allowedUsersDict}, "allowedUserList")

        return auAvatars
Пример #11
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._introSentence = post_pm.extract('introSentence',
                                           pType=str,
                                           allowEmpty=False)
     self._selectionType = post_pm.extract('selectionType',
                                           pType=str,
                                           allowEmpty=False)
     self._items = post_pm.extract('items', pType=list, allowEmpty=False)
     self._mandatory = post_pm.extract('mandatory', pType=bool)
Пример #12
0
    def _process(self):

        params = self._getRequestParams()

        from MaKaC.services.interface.rpc import json

        presenters = json.decode(params.get("presenters", "[]"))

        sc = self._target
        """self._target - contribution owning new subcontribution"""

        if "ok" in params:
            sc = self._target.newSubContribution()
            sc.setTitle(params.get("title", ""))
            sc.setDescription(params.get("description", ""))
            sc.setKeywords(params.get("keywords", ""))
            try:
                durationHours = int(params.get("durationHours", ""))
            except ValueError:
                raise FormValuesError(_("Please specify a valid hour format (0-23)."))
            try:
                durationMinutes = int(params.get("durationMinutes", ""))
            except ValueError:
                raise FormValuesError(_("Please specify a valid minutes format (0-59)."))

            sc.setDuration(durationHours, durationMinutes)
            sc.setSpeakerText(params.get("speakers", ""))
            sc.setParent(self._target)

            for presenter in presenters:
                spk = self._newSpeaker(presenter)
                sc.newSpeaker(spk)

            self._target.getConference().log(
                EventLogRealm.management,
                EventLogKind.positive,
                u"Timetable",
                u"Created new subcontribution: {}".format(to_unicode(sc.getTitle())),
                session.user,
                data=sc.getLogInfo(),
            )
            self._redirect(urlHandlers.UHContribModifSubCont.getURL(self._target))
        else:
            self._redirect(urlHandlers.UHContribModifSubCont.getURL(self._target))
Пример #13
0
    def _process(self):

        params = self._getRequestParams()

        from MaKaC.services.interface.rpc import json
        presenters = json.decode(params.get("presenters", "[]"))

        sc = self._target
        """self._target - contribution owning new subcontribution"""

        if ("ok" in params):
            sc = self._target.newSubContribution()
            sc.setTitle(params.get("title", ""))
            sc.setDescription(params.get("description", ""))
            sc.setKeywords(params.get("keywords", ""))
            try:
                durationHours = int(params.get("durationHours", ""))
            except ValueError:
                raise FormValuesError(
                    _("Please specify a valid hour format (0-23)."))
            try:
                durationMinutes = int(params.get("durationMinutes", ""))
            except ValueError:
                raise FormValuesError(
                    _("Please specify a valid minutes format (0-59)."))

            sc.setDuration(durationHours, durationMinutes)
            sc.setSpeakerText(params.get("speakers", ""))
            sc.setParent(self._target)

            for presenter in presenters:
                spk = self._newSpeaker(presenter)
                sc.newSpeaker(spk)

            logInfo = sc.getLogInfo()
            logInfo[
                "subject"] = "Created new subcontribution: %s" % sc.getTitle()
            self._target.getConference().getLogHandler().logAction(
                logInfo, log.ModuleNames.TIMETABLE)
            self._redirect(
                urlHandlers.UHContribModifSubCont.getURL(self._target))
        else:
            self._redirect(
                urlHandlers.UHContribModifSubCont.getURL(self._target))
Пример #14
0
    def _process(self):

        params = self._getRequestParams()

        from MaKaC.services.interface.rpc import json
        presenters = json.decode(params.get("presenters", "[]"))

        sc = self._target
        """self._target - contribution owning new subcontribution"""

        if ("ok" in params):
            sc = self._target.newSubContribution()
            sc.setTitle( params.get("title", "") )
            sc.setDescription( params.get("description", "") )
            sc.setKeywords( params.get("keywords", "") )
            try:
                durationHours = int(params.get("durationHours",""))
            except ValueError:
                raise FormValuesError(_("Please specify a valid hour format (0-23)."))
            try:
                durationMinutes = int(params.get("durationMinutes",""))
            except ValueError:
                raise FormValuesError(_("Please specify a valid minutes format (0-59)."))

            sc.setDuration( durationHours, durationMinutes )
            sc.setSpeakerText( params.get("speakers", "") )
            sc.setParent(self._target)

            for presenter in presenters:
                spk = self._newSpeaker(presenter)
                sc.newSpeaker(spk)

            logInfo = sc.getLogInfo()
            logInfo["subject"] = "Created new subcontribution: %s" %sc.getTitle()
            self._target.getConference().getLogHandler().logAction(logInfo,
                                                       log.ModuleNames.TIMETABLE)
            self._redirect(urlHandlers.UHContribModifSubCont.getURL(self._target))
        else:
            self._redirect(urlHandlers.UHContribModifSubCont.getURL(self._target))
Пример #15
0
    def _process(self):

        params = self._getRequestParams()

        from MaKaC.services.interface.rpc import json
        presenters = json.decode(params.get("presenters", "[]"))

        sc = self._target
        """self._target - contribution owning new subcontribution"""

        if ("ok" in params):
            sc = self._target.newSubContribution()
            sc.setTitle( params.get("title", "") )
            sc.setDescription( params.get("description", "") )
            sc.setKeywords( params.get("keywords", "") )
            try:
                durationHours = int(params.get("durationHours",""))
            except ValueError:
                raise FormValuesError(_("Please specify a valid hour format (0-23)."))
            try:
                durationMinutes = int(params.get("durationMinutes",""))
            except ValueError:
                raise FormValuesError(_("Please specify a valid minutes format (0-59)."))

            sc.setDuration( durationHours, durationMinutes )
            sc.setSpeakerText( params.get("speakers", "") )
            sc.setParent(self._target)

            for presenter in presenters:
                spk = self._newSpeaker(presenter)
                sc.newSpeaker(spk)

            self._target.getConference().log(EventLogRealm.management, EventLogKind.positive, u'Timetable',
                                             u'Created new subcontribution: {}'.format(to_unicode(sc.getTitle())),
                                             session.user, data=sc.getLogInfo())
            self._redirect(urlHandlers.UHContribModifSubCont.getURL(self._target))
        else:
            self._redirect(urlHandlers.UHContribModifSubCont.getURL(self._target))
Пример #16
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionDescription = post_pm.extract('description',
                                                pType=str,
                                                allowEmpty=True)
Пример #17
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._type = post_pm.extract('type', pType=str, allowEmpty=False)
     self._items = post_pm.extract('items', pType=list, allowEmpty=False)
Пример #18
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._content = post_pm.extract('content', pType=str, allowEmpty=True)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionHeader = {}
     self._sectionHeader["title"] = post_pm.extract('title', pType=str, allowEmpty=False)
     self._sectionHeader["description"] = post_pm.extract('description', pType=str, allowEmpty=True)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionEndPos = post_pm.extract('endPos', pType=int, allowEmpty=False)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._type = post_pm.extract('type', pType=str, allowEmpty=False)
     self._items = post_pm.extract('items', pType=list, allowEmpty=False)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._fieldData = post_pm.extract('fieldData', pType=dict, allowEmpty=False)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._content = post_pm.extract('content', pType=str, allowEmpty=True)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._introSentence = post_pm.extract('introSentence', pType=str, allowEmpty=False)
     self._selectionType = post_pm.extract('selectionType', pType=str, allowEmpty=False)
     self._items = post_pm.extract('items', pType=list, allowEmpty=False)
     self._mandatory = post_pm.extract('mandatory', pType=bool)
Пример #25
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._fieldData = post_pm.extract('fieldData',
                                       pType=dict,
                                       allowEmpty=False)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionDescription = post_pm.extract('description', pType=str, allowEmpty=True)
Пример #27
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._updateFieldData = post_pm.extract('fieldData',
                                             pType=dict,
                                             allowEmpty=False)
     self._updateFieldData['input'] = self._field.getInput().getId()
Пример #28
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionTitle = post_pm.extract('title',
                                          pType=str,
                                          allowEmpty=False)
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._updateFieldData = post_pm.extract('fieldData', pType=dict, allowEmpty=False)
     self._updateFieldData['input'] = self._field.getInput().getId()
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionTitle = post_pm.extract('title', pType=str, allowEmpty=False)
Пример #31
0
 def _checkParams_POST(self):
     post_pm = ParameterManager(decode(request.data))
     self._sectionEndPos = post_pm.extract('endPos',
                                           pType=int,
                                           allowEmpty=False)