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

Merge remote-tracking branch 'upstream/master' into zope4py2

parents 93aeddb0 b8e27caf
......@@ -31,10 +31,51 @@ from Products.Formulator.TALESField import TALESMethod
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Form.Form import field_value_cache
class TestProxify(ERP5TypeTestCase):
def getTitle(self):
return "Proxify"
class TestERP5Form(ERP5TypeTestCase):
def afterSetUp(self):
self.portal.portal_skins.custom.manage_addProduct[
'PageTemplates'].manage_addPageTemplate(
'Base_viewTestRenderer', 'Base_viewTestRenderer')
self.page_template = self.portal.portal_skins.custom.Base_viewTestRenderer
self.page_template.write('''
<html>
<form>
<tal:block tal:repeat="field form/get_fields">
<tal:block tal:replace="structure field/render" />
</tal:block>
</form>
</html>
''')
self.portal.portal_skins.custom.manage_addProduct['ERP5Form'].addERP5Form(
'Base_viewTest', 'Test')
self.form = self.portal.portal_skins.custom.Base_viewTest
self.form.manage_addField('my_string_field', 'String Field', 'StringField')
self.form.my_string_field.values['default'] = "test string field"
self.form.pt = self.page_template.getId()
def beforeTearDown(self):
self.abort()
for custom_skin in (self.form.getId(), self.page_template.getId(),):
if custom_skin in self.portal.portal_skins.custom.objectIds():
self.portal.portal_skins.custom.manage_delObjects([custom_skin])
self.commit()
def test_call(self):
html = self.form()
self.assertIn("test string field", html)
def test_zmi(self):
# minimal tests for custom ZMI views
self.assertTrue(self.form.formProxify())
self.assertTrue(self.form.formUnProxify())
self.assertTrue(self.form.formShowRelatedProxyFields())
class TestProxify(ERP5TypeTestCase):
def afterSetUp(self):
# base field library
......
......@@ -8,15 +8,21 @@
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testProxify</string> </value>
<value> <string>testERP5Form</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testProxify</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testProxify</string> </value>
<value> <string>test.erp5.testERP5Form</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
test.erp5.testAccessTab
test.erp5.testSequence
test.erp5.testActivityTool
test.erp5.testAlarm
test.erp5.testArrow
......@@ -8,8 +7,8 @@ test.erp5.testAutoLogout
test.erp5.testBase
test.erp5.testBusinessTemplate
test.erp5.testCache
test.erp5.testCacheTool
test.erp5.testCachedSkinsTool
test.erp5.testCacheTool
test.erp5.testConstraint
test.erp5.testContributionRegistryTool
test.erp5.testCookieCrumbler
......@@ -20,6 +19,7 @@ test.erp5.testERP5Catalog
test.erp5.testERP5Category
test.erp5.testERP5Coordinate
test.erp5.testERP5Core
test.erp5.testERP5Form
test.erp5.testERP5Type
test.erp5.testERP5TypeInterfaces
test.erp5.testERP5Workflow
......@@ -42,11 +42,11 @@ test.erp5.testPerson
test.erp5.testPredicate
test.erp5.testPreferences
test.erp5.testPropertyRecordable
test.erp5.testProxify
test.erp5.testProxyField
test.erp5.testQueryModule
test.erp5.testRestrictedPythonSecurity
test.erp5.testSelectionTool
test.erp5.testSequence
test.erp5.testSessionTool
test.erp5.testTimeout
test.erp5.testTimerService
......
......@@ -5613,13 +5613,19 @@ Business Template is a set of definitions, such as skins, portal types and categ
'template_action_path_list',
'template_base_category_list',
'template_catalog_method_id_list',
'template_constraint_id_list',
'template_document_id_list',
'template_extension_id_list',
'template_interface_id_list',
'template_keep_last_workflow_history_only_path_list',
'template_keep_path_list',
'template_keep_workflow_path_list',
'template_local_role_list',
'template_message_translation_list',
'template_mixin_id_list',
'template_module_component_id_list',
'template_module_id_list',
'template_path_list',
'template_keep_path_list',
'template_keep_workflow_path_list',
'template_keep_last_workflow_history_only_path_list',
'template_portal_type_allowed_content_type_list',
'template_portal_type_base_category_list',
'template_portal_type_hidden_content_type_list',
......@@ -5628,9 +5634,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
'template_portal_type_role_list',
'template_portal_type_workflow_chain_list',
'template_preference_list',
'template_property_sheet_id_list',
'template_registered_skin_selection_list',
'template_registered_version_priority_selection_list',
'template_skin_id_list',
'template_test_id_list',
'template_tool_component_id_list',
'template_tool_id_list',
'template_workflow_id_list',
):
......
......@@ -71,10 +71,10 @@
<value>
<list>
<string>interaction_listbox_trigger_method_id_list</string>
<string>interaction_listbox_after_script_id_list</string>
<string>interaction_listbox_before_script_id_list</string>
<string>interaction_listbox_before_commit_script_id_list</string>
<string>interaction_listbox_activate_script_id_list</string>
<string>interaction_listbox_after_script_reference_list</string>
<string>interaction_listbox_before_script_reference_list</string>
<string>interaction_listbox_before_commit_script_reference_list</string>
<string>interaction_listbox_activate_script_reference_list</string>
<string>interaction_listbox_guard_role_list</string>
</list>
</value>
......
......@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>all_columns</string>
<string>columns</string>
<string>portal_types</string>
<string>selection_name</string>
......@@ -75,6 +76,41 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>all_columns</string> </key>
<value>
<list>
<tuple>
<string>guard_expression</string>
<string>Guard Expression</string>
</tuple>
<tuple>
<string>guard_group_list</string>
<string>Guard Group</string>
</tuple>
<tuple>
<string>guard_permission_list</string>
<string>Guard Permission</string>
</tuple>
<tuple>
<string>portal_type_filter_list</string>
<string>Portal Type Filter</string>
</tuple>
<tuple>
<string>portal_type_filter_group_list</string>
<string>Portal Type Group Filter</string>
</tuple>
<tuple>
<string>temporary_document_disallowed</string>
<string>Do not Trigger on a Temporary Document</string>
</tuple>
<tuple>
<string>trigger_once_per_transaction</string>
<string>Trigger once per Transaction</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>columns</string> </key>
<value>
......@@ -96,19 +132,19 @@
<string>Required Roles</string>
</tuple>
<tuple>
<string>before_script_id_list</string>
<string>before_script_reference_list</string>
<string>Before Script</string>
</tuple>
<tuple>
<string>after_script_id_list</string>
<string>after_script_reference_list</string>
<string>After Script</string>
</tuple>
<tuple>
<string>before_commit_script_id_list</string>
<string>before_commit_script_reference_list</string>
<string>Script (End of Transaction)</string>
</tuple>
<tuple>
<string>activate_script_id_list</string>
<string>activate_script_reference_list</string>
<string>Activities (Later)</string>
</tuple>
<tuple>
......
......@@ -9,14 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_listbox_activate_script_id_list</string> </value>
<value> <string>interaction_listbox_activate_script_reference_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getActivateScriptIdList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,14 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_after_script_list</string> </value>
<value> <string>interaction_listbox_after_script_reference_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getAfterScriptReferenceList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,14 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_listbox_before_commit_script_id_list</string> </value>
<value> <string>interaction_listbox_before_commit_script_reference_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getBeforeCommitScriptIdList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,14 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_before_script_list</string> </value>
<value> <string>interaction_listbox_before_script_reference_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getBeforeScriptReferenceList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,9 +9,7 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getGuardRoleList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,9 +9,7 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getTriggerMethodIdList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -10,6 +10,7 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>all_columns</string>
<string>columns</string>
<string>title</string>
</list>
......@@ -72,6 +73,65 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>all_columns</string> </key>
<value>
<list>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>elementary_type</string>
<string>Property Type</string>
</tuple>
<tuple>
<string>multivalued</string>
<string>Multivalued</string>
</tuple>
<tuple>
<string>preference</string>
<string>Preference</string>
</tuple>
<tuple>
<string>property_default</string>
<string>Property Default</string>
</tuple>
<tuple>
<string>range</string>
<string>Range</string>
</tuple>
<tuple>
<string>read_permission</string>
<string>Read Permission</string>
</tuple>
<tuple>
<string>storage_id</string>
<string>Storage ID</string>
</tuple>
<tuple>
<string>translatable</string>
<string>Translatable</string>
</tuple>
<tuple>
<string>translation_domain</string>
<string>Translation Domain</string>
</tuple>
<tuple>
<string>owner_title</string>
<string>Owner</string>
</tuple>
<tuple>
<string>creation_date</string>
<string>Creation Date</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>Modification Date</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>columns</string> </key>
<value>
......
......@@ -9,9 +9,7 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getDestinationTitleList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -81,8 +81,8 @@
<list>
<string>listbox_trigger_type</string>
<string>listbox_guard_role_list</string>
<string>listbox_before_script_list</string>
<string>listbox_after_script_list</string>
<string>listbox_before_script_reference_list</string>
<string>listbox_after_script_reference_list</string>
</list>
</value>
</item>
......
......@@ -101,11 +101,11 @@
<string>Guard Roles</string>
</tuple>
<tuple>
<string>before_script_list</string>
<string>before_script_reference_list</string>
<string>Before Script</string>
</tuple>
<tuple>
<string>after_script_list</string>
<string>after_script_reference_list</string>
<string>After Script</string>
</tuple>
</list>
......
......@@ -9,14 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_listbox_after_script_id_list</string> </value>
<value> <string>listbox_after_script_reference_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getAfterScriptIdList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,14 +9,12 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_listbox_before_script_id_list</string> </value>
<value> <string>listbox_before_script_reference_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getBeforeScriptIdList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -9,9 +9,7 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -48,12 +46,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
......@@ -69,13 +61,9 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_lines_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -87,17 +75,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: \', \'.join(cell.getGuardRoleList())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -760,66 +760,9 @@ class ERP5Form(Base, ZMIForm, ZopePageTemplate):
raise FormValidationError(errors, result)
return result
security.declareProtected('View', 'hash_validated_data')
def hash_validated_data(self, validated_data):
return hashlib.sha256(
"".join(
str(validated_data[key])
for key in sorted(validated_data.keys())
if isinstance(validated_data[key], (six.text_type, six.binary_type, float, DateTime) + six.integer_types))
).hexdigest()
# FTP/DAV Access
manage_FTPget = ZMIForm.get_xml
def PUT(self, REQUEST, RESPONSE):
"""Handle HTTP PUT requests."""
self.dav__init(REQUEST, RESPONSE)
self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
if REQUEST.environ['REQUEST_METHOD'] != 'PUT':
raise Forbidden('REQUEST_METHOD should be PUT.')
body=REQUEST.get('BODY', '')
# Empty the form (XMLToForm is unable to empty things before reopening)
for k in self.get_field_ids():
try:
self._delObject(k)
except AttributeError:
pass
self.groups = {}
self.group_list = []
# And reimport
XMLToForm(body, self)
self.ZCacheable_invalidate()
RESPONSE.setStatus(204)
return RESPONSE
manage_FTPput = PUT
security.declarePrivate('getSimilarSkinFolderIdList')
def getSimilarSkinFolderIdList(self):
"""
Find other skins id installed in the same time
"""
portal = self.getPortalObject()
folder_id = self.aq_parent.id
# Find a business template which manages the context skin folder.
folder_id_set = {folder_id}
for template in portal.portal_templates.getInstalledBusinessTemplateList():
template_skin_id_list = template.getTemplateSkinIdList()
if folder_id in template_skin_id_list:
folder_id_set.update(template_skin_id_list)
# Find folders which can be surcharged by this skin folder
if '_' in folder_id:
surcharged_folder_id = 'erp5_%s' % folder_id.split('_')[-1]
if (surcharged_folder_id != folder_id) and \
(getattr(portal.portal_skins, surcharged_folder_id, None) \
is not None):
folder_id_set.add(surcharged_folder_id)
break
return list(folder_id_set)
#Methods for Proxify tab.
security.declareProtected('View management screens', 'getFormFieldList')
def getFormFieldList(self):
......
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