Commit 84249e89 authored by Jean-Paul Smets's avatar Jean-Paul Smets

initial import


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1336 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0e26e416
##############################################################################
#
# Copyright (c) 2002-2003 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from Accessor import Accessor as Method
from Products.CMFCore.utils import getToolByName
# Creation of default constructor
class func_code: pass
class Getter(Method):
"""
Gets an attribute value. A default value can be
provided if needed
"""
_need__name__=1
# Generic Definition of Method Object
# This is required to call the method form the Web
func_code = func_code()
func_code.co_varnames = ('self',)
func_code.co_argcount = 1
func_defaults = ()
def __init__(self, id, key):
self._id = id
self.__name__ = id
self._key = key
def __call__(self, instance):
portal_workflow = getToolByName(instance, 'portal_workflow')
wf = portal_workflow.getWorkflowById(self._key)
return wf._getWorkflowStateOf(instance, id_only=1)
<dtml-let form_title="'Actions'">
<dtml-if manage_page_header>
<dtml-var manage_page_header>
<dtml-else>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>&dtml-form_title;</title>
</head>
<body bgcolor="#FFFFFF" link="#000099" vlink="#555555">
<h3>&dtml-form_title;</h3>
</dtml-if>
</dtml-let>
<dtml-var manage_tabs>
<form action="&dtml-absolute_url;" method="POST">
<dtml-if actions>
<table>
<dtml-in actions mapping>
<dtml-let index=sequence-index>
<tr>
<td>
<div class="form-element">
<input type="checkbox" name="selections:list" value="&dtml-index;" />
</div>
</td>
<td>
<div class="form-label">
Name
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="name_&dtml-index;" value="&dtml-name;" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Id
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="id_&dtml-index;" value="&dtml-id;" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Action
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="action_&dtml-index;" value="&dtml-action;" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Permission
</div>
</td>
<td>
<div class="form-element">
<select name="permission_&dtml-index;">
<dtml-let selected="(not permission) and 'selected' or ' '">
<option value="" &dtml-selected;>(none)</option>
</dtml-let>
<dtml-in possible_permissions sort>
<dtml-let selected="(permission == _['sequence-item'])
and 'selected' or ' '">
<option value="&dtml-sequence-item;" &dtml-selected;>&dtml-sequence-item;</option>
</dtml-let>
</dtml-in>
</select>
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Category
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="category_&dtml-index;" value="&dtml-category;" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Visible?
</div>
</td>
<td>
<div class="form-element">
<input type="hidden" name="visible_&dtml-index;:int:default"
value="0" />
<dtml-let chk="visible and 'checked' or ''">
<input type="checkbox" name="visible_&dtml-index;:boolean"
&dtml-chk; value="1" />
</dtml-let>
</div>
</td>
</tr>
</dtml-let>
<tr><td colspan="3">
<hr />
</td></tr>
</dtml-in>
</table>
<div class="form-element">
<table>
<tr>
<td><input type="submit" name="changeActions:method" value="Save" /></td>
<td><input type="submit" name="deleteActions:method" value="Delete" /></td>
<td><input type="submit" name="moveUpActions:method" value="Move up" /></td>
<td><input type="submit" name="moveDownActions:method" value="Move down" /></td>
</tr>
</table>
</div>
</dtml-if>
<h3 class="form-help">
Add an action
</h3>
<table>
<tr>
<td></td>
<td>
<div class="form-label">
Name
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="name" value="" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Id
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="id" value="" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Action
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="action" value="" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Permission
</div>
</td>
<td>
<div class="form-element">
<select name="permission">
<option value="">(none)</option>
<dtml-in possible_permissions sort>
<option value="&dtml-sequence-item;">&dtml-sequence-item;</option>
</dtml-in>
</select>
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Category
</div>
</td>
<td>
<div class="form-element">
<input type="text" name="category" value="" />
</div>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="form-label">
Visible?
</div>
</td>
<td>
<div class="form-element">
<input type="hidden" name="visible:int:default"
value="0" />
<input type="checkbox" name="visible:boolean" checked value="1"/>
</div>
</td>
</tr>
</table>
<div class="form-element">
<input type="submit" name="addAction:method" value="Add" />
</div>
</form>
<dtml-if manage_page_footer>
<dtml-var manage_page_footer>
<dtml-else>
</body></html>
</dtml-if>
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