From b2ba8483c1861b484ab007e3dc835921dfa30374 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Tue, 5 Mar 2013 11:45:12 +0100
Subject: [PATCH] Allow to configure regularisation's resource.

---
 ...gularisation_request_resource_property.xml |  65 +++++++++
 ...ed_regularisation_request_use_property.xml |  36 +++++
 .../SystemPreference_viewSlapOSCRM.xml        |   5 +-
 ...ferred_regularisation_request_resource.xml | 126 ++++++++++++++++++
 ...ferred_regularisation_request_use_list.xml | 126 ++++++++++++++++++
 master/bt5/slapos_crm/bt/revision             |   2 +-
 6 files changed, 358 insertions(+), 2 deletions(-)
 create mode 100644 master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_resource_property.xml
 create mode 100644 master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_use_property.xml
 create mode 100644 master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_resource.xml
 create mode 100644 master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_use_list.xml

diff --git a/master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_resource_property.xml b/master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_resource_property.xml
new file mode 100644
index 000000000..3280ad77f
--- /dev/null
+++ b/master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_resource_property.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Standard Property" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_local_properties</string> </key>
+            <value>
+              <tuple>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>mode</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>string</string> </value>
+                  </item>
+                </dictionary>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>elementary_type/lines</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Preferred resource value for Regularisation Requets</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>preferred_regularisation_request_resource_property</string> </value>
+        </item>
+        <item>
+            <key> <string>mode</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Standard Property</string> </value>
+        </item>
+        <item>
+            <key> <string>preference</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>property_default</string> </key>
+            <value> <string>python: []</string> </value>
+        </item>
+        <item>
+            <key> <string>write_permission</string> </key>
+            <value> <string>Manage properties</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_use_property.xml b/master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_use_property.xml
new file mode 100644
index 000000000..c87e27779
--- /dev/null
+++ b/master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSCRMSystemPreference/preferred_regularisation_request_use_property.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Standard Property" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>elementary_type/lines</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Use values to filter list of resource for Regularisation Requests</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>preferred_regularisation_request_use_property</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Standard Property</string> </value>
+        </item>
+        <item>
+            <key> <string>preference</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM.xml b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM.xml
index 890c851e9..765229000 100644
--- a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM.xml
+++ b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM.xml
@@ -103,7 +103,10 @@
                 <item>
                     <key> <string>right</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <string>my_preferred_regularisation_request_use_list</string>
+                        <string>my_preferred_regularisation_request_resource</string>
+                      </list>
                     </value>
                 </item>
               </dictionary>
diff --git a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_resource.xml b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_resource.xml
new file mode 100644
index 000000000..a137e2b84
--- /dev/null
+++ b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_resource.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>items</string>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_preferred_regularisation_request_resource</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>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</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_list_field</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Preferred Resource for Regularisation Requests</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </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: [(\'\', \'\')] + [(resource.getTitle(), resource.getRelativeUrl()) for resource in here.getPortalObject().portal_catalog(portal_type=here.getPortalObject().getPortalResourceTypeList(), validation_state=\'validated\', use_uid=here.getPortalObject().portal_categories.getCategoryUid(here.getPreference(field.getId().replace(\'my_\', \'\').replace(\'_resource\', \'_use\')), base_category=\'use\'))]</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_use_list.xml b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_use_list.xml
new file mode 100644
index 000000000..8308d752d
--- /dev/null
+++ b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/SystemPreference_viewSlapOSCRM/my_preferred_regularisation_request_use_list.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>items</string>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_preferred_regularisation_request_use_list</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>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</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_multi_list_field</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Regularisation Request Uses</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </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: getattr(here.portal_categories.use, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/master/bt5/slapos_crm/bt/revision b/master/bt5/slapos_crm/bt/revision
index c7930257d..301160a93 100644
--- a/master/bt5/slapos_crm/bt/revision
+++ b/master/bt5/slapos_crm/bt/revision
@@ -1 +1 @@
-7
\ No newline at end of file
+8
\ No newline at end of file
-- 
2.30.9