Commit 31af1bb0 authored by Jérome Perrin's avatar Jérome Perrin

Add a domain on ticket modules showing uses and services

parent 50f5f9b8
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Domain" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateTicketUseDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ticket_use_domain</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Ticket Use Domain</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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 encoding="cdata"><![CDATA[
portal = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
\n
here = request[\'here\']\n
portal_type = here.getPortalType().replace(\' Module\', \'\')\n
\n
preference_id = \'preferred_%s_use\' % \'_\'.join(token.lower() for token in portal_type.split(\' \'))\n
preferred_use = portal.portal_preferences.getPreference(preference_id)\n
if not preferred_use:\n
return ()\n
\n
use = portal.portal_categories.use.restrictedTraverse(preferred_use)\n
sub_use_list = use.contentValues()\n
\n
max_depth = 0\n
if sub_use_list:\n
max_depth = 1\n
if depth > max_depth:\n
return ()\n
\n
if sub_use_list:\n
if depth == 0:\n
for sub_use in sub_use_list:\n
domain = parent.generateTempDomain(id = \'new_%s\' % sub_use.getProperty(\'uid\'))\n
domain.edit(title=sub_use.getTranslatedTitle(),\n
membership_criterion_category=(sub_use.getRelativeUrl(),),\n
domain_generator_method_id=script.id,\n
uid=use.getUid())\n
domain.setCriterionPropertyList([\'related_resource_from_use_category_uid\'])\n
domain.setCriterion(\'related_resource_from_use_category_uid\', identity=sub_use.getUid())\n
domain_list.append(domain)\n
return domain_list\n
else:\n
use = portal.portal_categories.use.restrictedTraverse(parent.getMembershipCriterionCategory())\n
\n
sql_kw = { \'portal_type\': portal.getPortalResourceTypeList(),\n
\'use_uid\': use.getUid(),\n
\'validation_state\': \'validated\',\n
\'sort_on\': \'title\'}\n
\n
for service in portal.portal_catalog(**sql_kw):\n
domain = parent.generateTempDomain(id = \'new_%s\' % service.getProperty(\'uid\'))\n
domain.edit(title=service.getTranslatedTitle(),\n
membership_criterion_base_category=(\'resource\', ),\n
membership_criterion_category=(\'resource/%s\' % service.getRelativeUrl(),),\n
domain_generator_method_id=script.id,\n
uid=service.getUid())\n
domain_list.append(domain)\n
\n
return domain_list\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateTicketUseDomain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -485,6 +485,10 @@
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -496,14 +500,25 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>ticket_use_domain</string>
<string>Type</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>domain_tree</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
......@@ -538,6 +553,10 @@
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
......@@ -566,6 +585,10 @@
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
......@@ -784,6 +807,12 @@
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Tickets</string> </value>
......@@ -856,10 +885,7 @@
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
......@@ -872,10 +898,7 @@
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
......
portal_alarms/upgrader_migrate_event_workflow_history
portal_contribution_registry/crm_ingestion
\ No newline at end of file
portal_contribution_registry/crm_ingestion
portal_domains/ticket_use_domain
\ No newline at end of file
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