Commit c953b90d authored by Jean-Paul Smets's avatar Jean-Paul Smets

2007-01-03 Improved erp5_web support

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11886 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b80c75d
......@@ -106,8 +106,8 @@ if dialog_method == \'Workflow_statusModify\':\n
value = context.Workflow_statusModify(form_id=kw[\'form_id\'],\n
dialog_id=dialog_id)\n
# XXX: This test is related to erp5_web and should not be present in configuration where it is not installed.\n
if not(getattr(context.REQUEST, \'ignore_layout\', 0)) and context.getApplicableLayout() :\n
context.REQUEST.RESPONSE.redirect(context.WebSite_getDocumentPhysicalPath())\n
#if not(getattr(context.REQUEST, \'ignore_layout\', 0)) and context.getApplicableLayout() :\n
# context.REQUEST.RESPONSE.redirect(context.WebSite_getDocumentPhysicalPath())\n
return value\n
# Exception for edit relation\n
if dialog_method == \'Base_editRelation\':\n
......@@ -149,7 +149,14 @@ else:\n
form = getattr(form_context, dialog_id)\n
# Validate the form\n
try:\n
# It is necessary to force editable_mode before validating\n
# data. Otherwise, field appears as non editable.\n
# This is the pending of form_dialog.\n
request = context.REQUEST\n
editable_mode = request.get(\'editable_mode\', 1)\n
request.set(\'editable_mode\', 1)\n
form.validate_all_to_request(context.REQUEST)\n
request.set(\'editable_mode\', editable_mode)\n
except FormValidationError, validation_errors:\n
# Pack errors into the request\n
field_errors = form.ErrorFields(validation_errors)\n
......@@ -323,11 +330,13 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n
<string>error_message</string>
<string>_getitem_</string>
<string>value</string>
<string>getattr</string>
<string>None</string>
<string>_apply_</string>
<string>form_context</string>
<string>getattr</string>
<string>form</string>
<string>request</string>
<string>editable_mode</string>
<string>validation_errors</string>
<string>field_errors</string>
<string>can_redirect</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.Base_redirect(\'Base_viewSearchResultList\',\n
keep_items=dict(SearchableText=field_your_search_text, reset=1,\n
your_search_text=field_your_search_text))\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>field_your_search_text</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>field_your_search_text</string>
<string>_getattr_</string>
<string>context</string>
<string>dict</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_searchResultList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>StringField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>url</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>80</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>url</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/absolute_url_path</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -235,6 +235,10 @@
<string>price</string>
<string>price</string>
</tuple>
<tuple>
<string>portal_type</string>
<string>portal_type</string>
</tuple>
</list>
</value>
</item>
......
......@@ -79,7 +79,13 @@ form = getattr(context, dialog_id)\n
\n
# Validate the form\n
try:\n
# It is necessary to force editable_mode before validating\n
# data. Otherwise, field appears as non editable.\n
# This is the pending of form_dialog.\n
editable_mode = request.get(\'editable_mode\', 1)\n
request.set(\'editable_mode\', 1)\n
form.validate_all_to_request(request)\n
request.set(\'editable_mode\', editable_mode)\n
except FormValidationError, validation_errors:\n
# Pack errors into the request\n
field_errors = form.ErrorFields(validation_errors)\n
......@@ -196,6 +202,7 @@ return context.ERP5Site_redirect(\n
<string>request</string>
<string>getattr</string>
<string>form</string>
<string>editable_mode</string>
<string>validation_errors</string>
<string>field_errors</string>
<string>doaction_param_list</string>
......
......@@ -87,7 +87,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
right_group python: form.get_fields_in_group(\'right\');\n
center_group python: form.get_fields_in_group(\'center\');\n
dialog_actions python: actions.get(dialog_category, []);\n
field_render here/field_render/macros/field_render">\n
field_render here/field_render/macros/field_render;\n
editable_mode python: True;\n
dummy python: request.set(\'editable_mode\', editable_mode)">\n
<tal:block tal:condition="preferred_html_style_developper_mode">\n
<tal:block metal:use-macro="developper_shortcut_render/macros/form" />\n
</tal:block>\n
......
......@@ -132,8 +132,8 @@
</span>\n
<span class="separator"></span>\n
<span id="search">\n
<input type="text" name="SearchableText" />\n
<button type="submit" name="Base_viewSearchResultList:method" title="Search"\n
<input type="text" name="field_your_search_text"/>\n
<button type="submit" name="Base_searchResultList:method" title="Search"\n
i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n
<span class="description"\n
......
......@@ -122,9 +122,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
<input type="hidden" name="form_action" value=""\n
tal:attributes="value form_action"/>\n
<input type="hidden" name="edit_document_url" value=""\n
tal:attributes="value python:here.WebSite_getDocumentUrl(form_id=form_id, ignore_reference=1)"/>\n
tal:attributes="value python:\'%s/%s\' % (here.absolute_url(), form_id)"/>\n
<input type="hidden" name="view_document_url" value=""\n
tal:attributes="value python:here.WebSite_getDocumentUrl(form_id=\'view\', ignore_reference=1)"/>\n
tal:attributes="value python:\'%s/%s\' % (here.absolute_url(), \'view\')"/>\n
<button type="submit" class="saveView" title="Save &amp; View"\n
name="Base_editAndViewAsWeb:method"\n
i18n:attributes="title" i18n:domain="ui">\n
......
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