From 177979bc529902ad40e2ca1fe3c9cca33c88425b Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Fri, 14 May 2010 13:56:16 +0000
Subject: [PATCH] add my_content_type field in Base_viewCRMFieldLibrary replace
 text_format by content_type

Keep my_text_format to not break ProxyField Dependency

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35352 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_crm/Base_viewCRMFieldLibrary.xml     |  1 +
 .../my_content_type.xml                       | 93 +++++++++++++++++++
 ...Event_getTextContentCorrespondToFormat.xml |  6 +-
 .../portal_skins/erp5_crm/Event_view.xml      |  2 +-
 ...my_text_format.xml => my_content_type.xml} | 12 +--
 .../portal_skins/erp5_crm/Ticket_init.xml     |  2 +-
 bt5/erp5_crm/bt/revision                      |  2 +-
 7 files changed, 103 insertions(+), 15 deletions(-)
 create mode 100644 bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary/my_content_type.xml
 rename bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/{my_text_format.xml => my_content_type.xml} (88%)

diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary.xml
index a62c29887c..4c70b0f61a 100644
--- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary.xml
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary.xml
@@ -147,6 +147,7 @@
                         <string>my_destination_project_title</string>
                         <string>my_source_project_title</string>
                         <string>your_format</string>
+                        <string>my_content_type</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary/my_content_type.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary/my_content_type.xml
new file mode 100644
index 0000000000..31b5e8f9e2
--- /dev/null
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_viewCRMFieldLibrary/my_content_type.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_content_type</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>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_content_type</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getTextContentCorrespondToFormat.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getTextContentCorrespondToFormat.xml
index e6ab4ecc49..56e18e65eb 100644
--- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getTextContentCorrespondToFormat.xml
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getTextContentCorrespondToFormat.xml
@@ -58,9 +58,9 @@ from Products.ERP5Type.Log import log\n
 \n
 log("Event_getTextContentCorrespondToFormat is deprecated, use Event_getEditorFieldTextContent instead", level=100) # WARNING\n
 \n
-text_format = context.getTextFormat()\n
+content_type = context.getContentType()\n
 \n
-if text_format == \'text/html\' and context.hasFile():\n
+if content_type == \'text/html\' and context.hasFile():\n
   return context.asStrippedHTML()\n
 else:\n
   value = context.getTextContent()\n
@@ -111,7 +111,7 @@ else:\n
                             <string>log</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>text_format</string>
+                            <string>content_type</string>
                             <string>value</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view.xml
index c0ab7a8a58..ff7c177dea 100644
--- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view.xml
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view.xml
@@ -83,7 +83,7 @@
                         <string>my_description</string>
                         <string>my_aggregate_title_list</string>
                         <string>attachment_list</string>
-                        <string>my_text_format</string>
+                        <string>my_content_type</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/my_text_format.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/my_content_type.xml
similarity index 88%
rename from bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/my_text_format.xml
rename to bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/my_content_type.xml
index 9e48d911ac..9557650a03 100644
--- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/my_text_format.xml
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_view/my_content_type.xml
@@ -12,14 +12,12 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list>
-                <string>title</string>
-              </list>
+              <list/>
             </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>my_text_format</string> </value>
+            <value> <string>my_content_type</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -76,7 +74,7 @@
               <dictionary>
                 <item>
                     <key> <string>field_id</string> </key>
-                    <value> <string>my_text_format</string> </value>
+                    <value> <string>my_content_type</string> </value>
                 </item>
                 <item>
                     <key> <string>form_id</string> </key>
@@ -86,10 +84,6 @@
                     <key> <string>target</string> </key>
                     <value> <string>Click to edit the target</string> </value>
                 </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string>Content format</string> </value>
-                </item>
               </dictionary>
             </value>
         </item>
diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_init.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_init.xml
index efbb9bdd2e..6060bc1055 100644
--- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_init.xml
+++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Ticket_init.xml
@@ -54,7 +54,7 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string># Set preferred text format\n
-context.edit(text_format = context.portal_preferences.getPreferredTextFormat())\n
+context.edit(content_type=context.portal_preferences.getPreferredTextFormat())\n
 </string> </value>
         </item>
         <item>
diff --git a/bt5/erp5_crm/bt/revision b/bt5/erp5_crm/bt/revision
index 88101bccd4..4c9bbbfa9a 100644
--- a/bt5/erp5_crm/bt/revision
+++ b/bt5/erp5_crm/bt/revision
@@ -1 +1 @@
-465
\ No newline at end of file
+468
\ No newline at end of file
-- 
2.30.9