From: Graeme M. <ma...@us...> - 2005-06-27 12:21:46
|
Update of /cvsroot/mailmanager/mailmanager/Extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16392/Extensions Modified Files: Tag: RELENG_2_0 TicketPluggableBrain.py Log Message: Show/hide HTML. (1227265) Index: TicketPluggableBrain.py =================================================================== RCS file: /cvsroot/mailmanager/mailmanager/Extensions/TicketPluggableBrain.py,v retrieving revision 1.2.2.24 retrieving revision 1.2.2.25 diff -u -d -r1.2.2.24 -r1.2.2.25 --- TicketPluggableBrain.py 24 Jun 2005 14:03:37 -0000 1.2.2.24 +++ TicketPluggableBrain.py 27 Jun 2005 12:21:37 -0000 1.2.2.25 @@ -163,6 +163,25 @@ REQUEST.SESSION.set('show_headers', True) return self.ticket_index_html(self, REQUEST) + security.declareProtected('MailManager Manage Tickets', 'showHTML') + def showHTML(self, REQUEST): + """Should html_body be displayed?""" + show_html = REQUEST.SESSION.get('show_html') + if show_html is None: + return 0 + return show_html.get(self.absolute_url(), 0) + + security.declareProtected('MailManager Manage Tickets', 'toggleShowHTML') + def toggleShowHTML(self, REQUEST): + """Change whether html_body is displayed.""" + show_html = REQUEST.SESSION.get('show_html', {}) + if not show_html: + REQUEST.SESSION.set('show_html', show_html) + url = self.absolute_url() + show_html[url] = not show_html.get(url, 0) + REQUEST.RESPONSE.redirect(self.absolute_url() + '/ticket/' + str(self.id)) + + security.declareProtected('MailManager Manage Tickets', 'export') def export(self, RESPONSE): """Export all of a ticket's messages in mbox format. TODO: export |