def _checkParams(self, params): RHRegistrantsDisplayBase._checkParams(self, params) regForm = self._conf.getRegistrationForm() # ---- FILTERING ---- if params.has_key("firstChoice"): self._sessionFilterName = "sessionfirstpriority" else: self._sessionFilterName = "session" filterUsed = params.has_key("OK") filter = {} sessform = regForm.getSessionsForm() sesstypes = sessform.getSessionList() lsessions = [] if not filterUsed: for sess in sesstypes: lsessions.append(sess.getId()) filter[self._sessionFilterName] = self._normaliseListParam( params.get("session", lsessions)) self._filterCrit = regFilters.RegFilterCrit(self._conf, filter) sessionShowNoValue = True if filterUsed: sessionShowNoValue = params.has_key("sessionShowNoValue") self._filterCrit.getField( self._sessionFilterName).setShowNoValue(sessionShowNoValue) # ---- SORTING ---- self._sortingCrit = regFilters.SortingCriteria( [params.get("sortBy", "Name").strip()]) self._order = params.get("order", "down")
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",[]))
def _getBody(self, params): from MaKaC.webinterface.rh.registrantsDisplay import RHRegistrantsList from MaKaC.webinterface.common import regFilters sortingCrit = regFilters.SortingCriteria( [params.get("sortBy", "Name").strip()]) filterCrit = RHRegistrantsList.create_filter(self._conf, params) wc = WConfRegistrantsList(self._conf, filterCrit, sortingCrit, None, "session") return wc.getHTML()
def _checkParams(self, params): RHRegistrantsDisplayBase._checkParams(self, params) # ---- FILTERING ---- if params.has_key("firstChoice"): self._sessionFilterName = "sessionfirstpriority" else: self._sessionFilterName = "session" filterUsed = params.has_key("OK") self._filterCrit = self.create_filter(self._conf, params, filterUsed, self._sessionFilterName) sessionShowNoValue = True if filterUsed: sessionShowNoValue = params.has_key("sessionShowNoValue") self._filterCrit.getField( self._sessionFilterName).setShowNoValue(sessionShowNoValue) # ---- SORTING ---- self._sortingCrit = regFilters.SortingCriteria( [params.get("sortBy", "Name").strip()]) self._order = params.get("order", "down")
def _checkParams(self, params): RHRegistrantListModifBase._checkParams(self, params) regForm = self._conf.getRegistrationForm() websession = self._getSession() dict = websession.getVar("registrantsFilterAndSortingConf%s" % self._conf.getId()) noMemory = False if not dict: noMemory = True dict = {} else: dict = dict.copy() if not noMemory and params.has_key("disp"): if "accommShowNoValue" in dict: del dict["accommShowNoValue"] if "eventShowNoValue" in dict: del dict["eventShowNoValue"] if "sessionShowNoValue" in dict: del dict["sessionShowNoValue"] if not params.has_key("event") and "event" in dict: del dict["event"] if not params.has_key("session") and "session" in dict: del dict["session"] if not params.has_key("accomm") and "accomm" in dict: del dict["accomm"] dict.update(params) self._display = dict.get("disp", []) if not isinstance(self._display, list): self._display = [self._display] if dict.has_key("firstChoice"): self._sessionFilterName = "sessionfirstpriority" else: self._sessionFilterName = "session" filterUsed = False if not noMemory: filterUsed = True filter = {} laccomm = [] accommform = regForm.getAccommodationForm() accommtypes = accommform.getAccommodationTypesList() if not filterUsed: for accomm in accommtypes: laccomm.append(accomm.getId()) filter["accomm"] = dict.get("accomm", laccomm) sessform = regForm.getSessionsForm() sesstypes = sessform.getSessionList() lsessions = [] if not filterUsed: for sess in sesstypes: lsessions.append(sess.getId()) filter[self._sessionFilterName] = dict.get("session", lsessions) eventForm = regForm.getSocialEventForm() events = eventForm.getSocialEventList() levents = [] if not filterUsed: for event in events: levents.append(event.getId()) filter["event"] = dict.get("event", levents) self._filterCrit = regFilters.RegFilterCrit(self._conf, filter) accommShowNoValue = True sessionShowNoValue = True eventShowNoValue = True if filterUsed or dict.has_key("disp"): accommShowNoValue = dict.has_key("accommShowNoValue") sessionShowNoValue = dict.has_key("sessionShowNoValue") eventShowNoValue = dict.has_key("eventShowNoValue") self._filterCrit.getField("accomm").setShowNoValue(accommShowNoValue) self._filterCrit.getField( self._sessionFilterName).setShowNoValue(sessionShowNoValue) self._filterCrit.getField("event").setShowNoValue(eventShowNoValue) self._sortingCrit = regFilters.SortingCriteria( [dict.get("sortBy", "Name").strip()]) self._order = dict.get("order", "down") self._menuStatus = websession.getVar("RegistrantListMenuStatus")