Exemple #1
0
    def _updateFilters(self, sessionData, params):
        """
        Updates the filter parameters in the websession with those
        coming from the HTTP request
        """

        sessionData['event'] = []
        sessionData['accomm'] = []
        sessionData['statuses'] = []

        sessionData.update(params)
        sessionData['session'] = utils.normalizeToList(
            params.get('session', []))

        # update these elements in the session so that the parameters that are
        # passed are always taken into account (sessionData.update is not
        # enough, since the elements that are ommitted in params would just be
        # ignored

        sessionData['accommShowNoValue'] = params.has_key('accommShowNoValue')
        sessionData['eventShowNoValue'] = params.has_key('eventShowNoValue')
        sessionData['sessionShowNoValue'] = params.has_key(
            'sessionShowNoValue')
        sessionData['firstChoice'] = params.has_key("firstChoice")

        return sessionData
Exemple #2
0
    def _checkParams( self, params ):
        """
        Main parameter checking routine
        """

        RHRegistrantListModifBase._checkParams(self, params)

        operationType = params.get('operationType')

        # session data
        websession = self._getSession()
        sessionData = websession.getVar("registrantsFilterAndSortingConf%s"%self._conf.getId())

        # check if there is information already
        # set in the session variables
        if sessionData:
            # work on a copy
            sessionData = sessionData.copy()
            filtersActive =  sessionData['filtersActive']
        else:
            # set a default, empty dict
            sessionData = {}
            filtersActive = False

        if params.has_key("resetFilters"):
            operation =  'resetFilters'
        elif operationType ==  'filter':
            operation =  'setFilters'
        elif operationType ==  'display':
            operation =  'setDisplay'
        else:
            operation = None

        # the filter name will be different, depending
        # on whether only  the first choice for the session
        # is taken into account

        if params.has_key("firstChoice"):
            self._sessionFilterName="sessionfirstpriority"
        else:
            self._sessionFilterName="session"

        isBookmark = params.has_key("isBookmark")
        sessionData = self._checkAction(params, filtersActive, sessionData, operation, isBookmark)

        # Maintain the state abotu filter usage
        sessionData['filtersActive'] = self._filterUsed;

        # Save the web session
        websession.setVar("registrantsFilterAndSortingConf%s"%self._conf.getId(), sessionData)

        self._filterCrit = self._buildFilteringCriteria(sessionData)

        self._sortingCrit = regFilters.SortingCriteria( [sessionData.get( "sortBy", "Name" ).strip()] )

        self._order = sessionData.get("order","down")

        self._display = utils.normalizeToList(sessionData.get("disp",[]))
Exemple #3
0
    def _checkParams( self, params ):
        """
        Main parameter checking routine
        """

        RHRegistrantListModifBase._checkParams(self, params)

        operationType = params.get('operationType')

        # session data
        websession = self._getSession()
        sessionData = websession.getVar("registrantsFilterAndSortingConf%s"%self._conf.getId())

        # check if there is information already
        # set in the session variables
        if sessionData:
            # work on a copy
            sessionData = sessionData.copy()
            filtersActive =  sessionData['filtersActive']
        else:
            # set a default, empty dict
            sessionData = {}
            filtersActive = False

        if params.has_key("resetFilters"):
            operation =  'resetFilters'
        elif operationType ==  'filter':
            operation =  'setFilters'
        elif operationType ==  'display':
            operation =  'setDisplay'
        else:
            operation = None

        # the filter name will be different, depending
        # on whether only  the first choice for the session
        # is taken into account

        if params.has_key("firstChoice"):
            self._sessionFilterName="sessionfirstpriority"
        else:
            self._sessionFilterName="session"

        isBookmark = params.has_key("isBookmark")
        sessionData = self._checkAction(params, filtersActive, sessionData, operation, isBookmark)

        # Maintain the state abotu filter usage
        sessionData['filtersActive'] = self._filterUsed;

        # Save the web session
        websession.setVar("registrantsFilterAndSortingConf%s"%self._conf.getId(), sessionData)

        self._filterCrit = self._buildFilteringCriteria(sessionData)

        self._sortingCrit = regFilters.SortingCriteria( [sessionData.get( "sortBy", "Name" ).strip()] )

        self._order = sessionData.get("order","down")

        self._display = utils.normalizeToList(sessionData.get("disp",[]))
Exemple #4
0
    def _updateFilters( self, sessionData, params ):
        """
        Updates the filter parameters in the websession with those
        coming from the HTTP request
        """

        sessionData['event'] = []
        sessionData['accomm'] = []
        sessionData['statuses'] = []

        sessionData.update(params)
        sessionData['session'] = utils.normalizeToList(params.get('session',[]))

        # update these elements in the session so that the parameters that are
        # passed are always taken into account (sessionData.update is not
        # enough, since the elements that are ommitted in params would just be
        # ignored

        sessionData['accommShowNoValue'] = params.has_key('accommShowNoValue')
        sessionData['eventShowNoValue'] = params.has_key('eventShowNoValue')
        sessionData['sessionShowNoValue'] = params.has_key('sessionShowNoValue')
        sessionData['firstChoice'] = params.has_key("firstChoice")

        return sessionData