[Erp5-report] r28936 - in /erp5/trunk/bt5/erp5_crm: SkinTemplateItem/portal_skins/erp5_crm/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Sep 11 12:06:13 CEST 2009
Author: jp
Date: Fri Sep 11 12:06:09 2009
New Revision: 28936
URL: http://svn.erp5.org?rev=28936&view=rev
Log:
Move the TALES expressions related to Event display to more readable Python scripts and configure text_content to use such scripts.
Added:
erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml
erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml
Modified:
erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml
erp5/trunk/bt5/erp5_crm/bt/revision
Added: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml?rev=28936&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml (added)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml [utf8] Fri Sep 11 12:06:09 2009
@@ -1,0 +1,138 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </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>"""\n
+ Returns the HTML content which must be displayed by the Editor Field.\n
+\n
+ Unlike other fields (which should never try to generate HTML), Editor\n
+ Field expects to be provided valid HTML. It is therefore the responsibility\n
+ of the Default value script to provide this valid HTML.\n
+"""\n
+# If content is editable, nothing to do\n
+if context.Event_isTextContentEditable():\n
+ return context.getTextContent()\n
+\n
+# If content is HTML, nothing to do\n
+if context.getTextFormat() == \'text/html\':\n
+ return context.getTextContent()\n
+\n
+# If not, convert it\n
+return context.asStrippedHTML()\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string></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>0</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>_getattr_</string>
+ <string>context</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>Event_getEditorFieldTextContent</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml?rev=28936&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml (added)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml [utf8] Fri Sep 11 12:06:09 2009
@@ -1,0 +1,132 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </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>"""\n
+ Returns true if the text content of this Event is editable.\n
+\n
+ The underlying idea is that once the content of an event has\n
+ been placed in a MIME envelope and set as the default file\n
+ of the Event, the event is considered as frozen and can not \n
+ be modified.\n
+"""\n
+return getattr(context, \'hasFile\', None) is not None and not context.hasFile()\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string></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>0</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>getattr</string>
+ <string>context</string>
+ <string>None</string>
+ <string>_getattr_</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>Event_isTextContentEditable</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml?rev=28936&r1=28935&r2=28936&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml [utf8] Fri Sep 11 12:06:09 2009
@@ -12,7 +12,11 @@
<item>
<key> <string>delegated_list</string> </key>
<value>
- <list/>
+ <list>
+ <string>css_class</string>
+ <string>default</string>
+ <string>editable</string>
+ </list>
</value>
</item>
<item>
@@ -54,6 +58,24 @@
<value>
<dictionary>
<item>
+ <key> <string>css_class</string> </key>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+ </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+ </value>
+ </item>
+ <item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
@@ -73,6 +95,18 @@
<value>
<dictionary>
<item>
+ <key> <string>css_class</string> </key>
+ <value> <string>page</string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
<key> <string>field_id</string> </key>
<value> <string>my_text_content</string> </value>
</item>
@@ -90,4 +124,52 @@
</dictionary>
</pickle>
</record>
+ <record id="2" aka="AAAAAAAAAAI=">
+ <pickle>
+ <tuple>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string>python:(not here.Event_isTextContentEditable() and \'page\') or \'\'</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="3" aka="AAAAAAAAAAM=">
+ <pickle>
+ <tuple>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string>here/Event_getEditorFieldTextContent</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="4" aka="AAAAAAAAAAQ=">
+ <pickle>
+ <tuple>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string>here/Event_isTextContentEditable</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
</ZopeData>
Modified: erp5/trunk/bt5/erp5_crm/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_crm/bt/revision?rev=28936&r1=28935&r2=28936&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_crm/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_crm/bt/revision [utf8] Fri Sep 11 12:06:09 2009
@@ -1,1 +1,1 @@
-433
+434
More information about the Erp5-report
mailing list