Commit b8d4f39c authored by Jérome Perrin's avatar Jérome Perrin

Add management pages for selection tool


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3573 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 774f3bff
...@@ -73,15 +73,34 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -73,15 +73,34 @@ class SelectionTool( UniqueObject, SimpleItem ):
# #
manage_options = ( ( { 'label' : 'Overview' manage_options = ( ( { 'label' : 'Overview'
, 'action' : 'manage_overview' , 'action' : 'manage_overview'
} },
, { 'label' : 'View Selections'
) , 'action' : 'manage_view_selections'
) } ))
security.declareProtected( ERP5Permissions.ManagePortal security.declareProtected( ERP5Permissions.ManagePortal
, 'manage_overview' ) , 'manage_overview' )
manage_overview = DTMLFile( 'explainCategoryTool', _dtmldir ) manage_overview = DTMLFile( 'explainSelectionTool', _dtmldir )
security.declareProtected( ERP5Permissions.ManagePortal
, 'manage_view_selections' )
manage_view_selections = DTMLFile( 'SelectionTool_manageViewSelections', _dtmldir )
security.declareProtected(ERP5Permissions.View, 'getSelectionNames')
def getSelectionNames(self, context=None, REQUEST=None):
if context is None: context = self
if not REQUEST:
REQUEST = get_request()
if hasattr(self, 'selection_data'):
user_id = self.portal_membership.getAuthenticatedMember().getUserName()
if user_id is not None and self.selection_data.has_key(user_id):
return self.selection_data[user_id].keys()
return ()
security.declarePublic("debugMonTruc")
def debugMonTruc(self) :
return "<&"
security.declareProtected(ERP5Permissions.View, 'callSelectionFor') security.declareProtected(ERP5Permissions.View, 'callSelectionFor')
def callSelectionFor(self, selection_name, context=None, REQUEST=None): def callSelectionFor(self, selection_name, context=None, REQUEST=None):
if context is None: context = self if context is None: context = self
......
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<dtml-var "manage_form_title(this(), _,
form_title='View Selections',
help_product='ERP5Form',
)">
<p class="form-help">
This page show the active selections for the current user.
It is only usefull for debug purposes.
</p>
<table cellspacing="0" cellpadding="2" border="1">
<tr>
<th> Selection Name </th>
<th> Selection Parameters </th>
</tr>
<dtml-in getSelectionNames>
<tr>
<td> <dtml-var sequence-item></td>
<td> <dtml-var
expr="getSelectionParams(_['sequence-item'])" html_quote></td>
</tr>
</dtml-in>
</table>
<dtml-var manage_page_footer>
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<h3> <code>portal_selection</code> Tool </h3>
<p> This tool allows to manage persistant selections for listbox in ERP5.
</p>
<dtml-var manage_page_footer>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment