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>
......@@ -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