diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml new file mode 100644 index 0000000000000000000000000000000000000000..399bc738cbcc93fdc8b173a2c3ee7d89dad59c7c --- /dev/null +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getEditorFieldTextContent.xml @@ -0,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> diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml new file mode 100644 index 0000000000000000000000000000000000000000..30474476fd949d76fa13b01b365c9090191bc6e0 --- /dev/null +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_isTextContentEditable.xml @@ -0,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> diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml index ca29dff8a42220386d3c667cffa7b30b3f98e825..4b02cbfe1c1498e327af3e615cdc873163270731 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_viewFieldLibrary/my_text_content.xml @@ -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> @@ -53,6 +57,24 @@ <key> <string>tales</string> </key> <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> @@ -72,6 +94,18 @@ <key> <string>values</string> </key> <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> @@ -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> diff --git a/bt5/erp5_crm/bt/revision b/bt5/erp5_crm/bt/revision index af40ff6b882b7bd2455294febc16e3d08cd17de9..1fde7522a771ec6f5d8c6237abe49bac75f547c8 100644 --- a/bt5/erp5_crm/bt/revision +++ b/bt5/erp5_crm/bt/revision @@ -1 +1 @@ -433 \ No newline at end of file +434 \ No newline at end of file