def renderNextPrevYearControls(self, month,year): "render the urls needed for next and previous years" format = '<a href="%s?%s">%s</a>' currentUrl = self.REQUEST.URL queryString = self.REQUEST.environ.get('QUERY_STRING', '') query = utility.updateQueryString(queryString, {'year:int': year+1, 'month:int':month}) nextYear = format % (currentUrl,query,'>>') query = utility.updateQueryString(queryString, {'year:int': year-1, 'month:int':month}) prevYear = format % (currentUrl,query,'<<') return prevYear,nextYear
def renderPreviousMonthControl(self, monthPreviousYear,monthPrevious): "render the urls needed for next and previous year and month" format = '<a href="%s?%s">%s</a>' currentUrl = self.REQUEST.URL queryString = self.REQUEST.environ.get('QUERY_STRING', '') query = utility.updateQueryString(queryString, {'year:int': monthPreviousYear, 'month:int':monthPrevious}) return format % (currentUrl,query,'<')
def renderNextPrevYearControls(self, month, year): "render the urls needed for next and previous years" format = '<a href="%s?%s">%s</a>' currentUrl = self.REQUEST.URL queryString = self.REQUEST.environ.get('QUERY_STRING', '') query = utility.updateQueryString(queryString, { 'year:int': year + 1, 'month:int': month }) nextYear = format % (currentUrl, query, '>>') query = utility.updateQueryString(queryString, { 'year:int': year - 1, 'month:int': month }) prevYear = format % (currentUrl, query, '<<') return prevYear, nextYear
def renderPreviousMonthControl(self, monthPreviousYear, monthPrevious): "render the urls needed for next and previous year and month" format = '<a href="%s?%s">%s</a>' currentUrl = self.REQUEST.URL queryString = self.REQUEST.environ.get('QUERY_STRING', '') query = utility.updateQueryString(queryString, { 'year:int': monthPreviousYear, 'month:int': monthPrevious }) return format % (currentUrl, query, '<')
def setSelectedDocument(self, selected): "set the selected document to redirect to" baseURL = self.REQUEST.other['URL'] queryString = self.REQUEST.environ.get('QUERY_STRING', '') if selected: url = baseURL + '?' + utility.updateQueryString(queryString, {'selectedDocument': selected}) else: url = baseURL + '?' + queryString urlFrom = self.REQUEST.other.get('HTTP_REFERRER', '') if urlFrom != url: self.REQUEST.other['redirectTo'] = url