From 4a2d900a0ec2ccd182ebd3926e8124498ce690de Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 30 Mar 2007 11:57:44 +0000
Subject: [PATCH] use selection_name instead of selection.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13823 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountModule_getMirrorAccountUrl.xml           |  2 ++
 .../AccountModule_getTransactionListUrl.xml         |  2 ++
 .../erp5_pdm/Transformation_getTotalDuration.xml    | 12 +++++++-----
 .../erp5_pdm/Transformation_getTotalPrice.xml       | 12 +++++++-----
 .../erp5_core/Alarm_getDescriptionUrl.xml           |  4 ----
 .../portal_skins/erp5_core/File_getDownloadUrl.xml  | 13 +++++++------
 6 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getMirrorAccountUrl.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getMirrorAccountUrl.xml
index f748c8b8fd..c28e311cfa 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getMirrorAccountUrl.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getMirrorAccountUrl.xml
@@ -127,6 +127,7 @@ return url\n
                             <string>selection</string>
                             <string>_getattr_</string>
                             <string>index</string>
+                            <string>context</string>
                             <string>object</string>
                             <string>None</string>
                             <string>url</string>
@@ -144,6 +145,7 @@ return url\n
               <tuple>
                 <none/>
                 <none/>
+                <none/>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTransactionListUrl.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTransactionListUrl.xml
index 0a081b0ee0..f8ef7d3bde 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTransactionListUrl.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getTransactionListUrl.xml
@@ -133,6 +133,7 @@ return object.getPath() + \'/\' + method + \'?\' + make_query(kw)\n
                             <string>make_query</string>
                             <string>_getattr_</string>
                             <string>index</string>
+                            <string>context</string>
                             <string>object</string>
                             <string>method</string>
                             <string>str</string>
@@ -151,6 +152,7 @@ return object.getPath() + \'/\' + method + \'?\' + make_query(kw)\n
               <tuple>
                 <none/>
                 <none/>
+                <none/>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalDuration.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalDuration.xml
index 577ce77e9f..627d52b25e 100644
--- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalDuration.xml
+++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalDuration.xml
@@ -68,9 +68,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>if selection!=None:\n
+            <value> <string>if selection_name is not None:\n
 \n
-  reference_variation_category_list = selection.getParams()[\'reference_variation_category_list\' ]\n
+  reference_variation_category_list = context.portal_selections.getSelectionParamsFor(selection_name)[\'reference_variation_category_list\']\n
   request = context.REQUEST\n
   request.other[\'categories\'] = reference_variation_category_list\n
   tmp_context = context.asContext(context=context, REQUEST=request)\n
@@ -105,7 +105,7 @@ else:\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>selection=None</string> </value>
+            <value> <string>selection=None, selection_name=None</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -125,18 +125,19 @@ else:\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>2</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
                             <string>selection</string>
+                            <string>selection_name</string>
                             <string>None</string>
                             <string>_getitem_</string>
                             <string>_getattr_</string>
-                            <string>reference_variation_category_list</string>
                             <string>context</string>
+                            <string>reference_variation_category_list</string>
                             <string>request</string>
                             <string>_write_</string>
                             <string>tmp_context</string>
@@ -155,6 +156,7 @@ else:\n
             <value>
               <tuple>
                 <none/>
+                <none/>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalPrice.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalPrice.xml
index a21d92cd1c..fa638f7727 100644
--- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalPrice.xml
+++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Transformation_getTotalPrice.xml
@@ -68,9 +68,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>if selection!=None:\n
+            <value> <string>if selection_name is not None:\n
 \n
-  reference_variation_category_list = selection.getParams()[\'reference_variation_category_list\' ]\n
+  reference_variation_category_list = context.portal_selections.getSelectionParamsFor(selection_name)[\'reference_variation_category_list\']\n
   request = context.REQUEST\n
   request.other[\'categories\'] = reference_variation_category_list\n
   tmp_context = context.asContext(context=context, REQUEST=request)\n
@@ -105,7 +105,7 @@ else:\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>selection=None</string> </value>
+            <value> <string>selection=None, selection_name=None</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -125,18 +125,19 @@ else:\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>2</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
                             <string>selection</string>
+                            <string>selection_name</string>
                             <string>None</string>
                             <string>_getitem_</string>
                             <string>_getattr_</string>
-                            <string>reference_variation_category_list</string>
                             <string>context</string>
+                            <string>reference_variation_category_list</string>
                             <string>request</string>
                             <string>_write_</string>
                             <string>tmp_context</string>
@@ -155,6 +156,7 @@ else:\n
             <value>
               <tuple>
                 <none/>
+                <none/>
               </tuple>
             </value>
         </item>
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_getDescriptionUrl.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_getDescriptionUrl.xml
index 1b77294a71..80b14f84ad 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_getDescriptionUrl.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_getDescriptionUrl.xml
@@ -70,8 +70,6 @@
             <key> <string>_body</string> </key>
             <value> <string>from ZTUtils import make_query\n
 \n
-index = selection.getIndex()\n
-name = selection.getName()\n
 object = brain.getObject()\n
 if object is None:\n
   return None\n
@@ -131,8 +129,6 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
                             <string>ZTUtils</string>
                             <string>make_query</string>
                             <string>_getattr_</string>
-                            <string>index</string>
-                            <string>name</string>
                             <string>object</string>
                             <string>None</string>
                             <string>url</string>
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/File_getDownloadUrl.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/File_getDownloadUrl.xml
index 488e3fcb4c..f1f56ff571 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/File_getDownloadUrl.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/File_getDownloadUrl.xml
@@ -70,8 +70,7 @@
             <key> <string>_body</string> </key>
             <value> <string>from ZTUtils import make_query\n
 \n
-index = selection.getIndex()\n
-name = selection.getName()\n
+index = context.portal_selections.getSelectionIndexFor(selection_name)\n
 object = brain.getObject()\n
 if object is None:\n
   return None\n
@@ -79,7 +78,7 @@ if object is None:\n
 url = object.absolute_url()\n
 method = \'Base_download\'\n
 kw = { \n
-      \'selection_name\' : selection.getName() ,\n
+      \'selection_name\' : selection_name,\n
       \'selection_index\' : index,\n
      }\n
 \n
@@ -100,7 +99,7 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>brain=None, selection=None</string> </value>
+            <value> <string>brain=None, selection=None, selection_name=None</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -120,7 +119,7 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>2</int> </value>
+                        <value> <int>3</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
@@ -128,11 +127,12 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
                           <tuple>
                             <string>brain</string>
                             <string>selection</string>
+                            <string>selection_name</string>
                             <string>ZTUtils</string>
                             <string>make_query</string>
                             <string>_getattr_</string>
+                            <string>context</string>
                             <string>index</string>
-                            <string>name</string>
                             <string>object</string>
                             <string>None</string>
                             <string>url</string>
@@ -152,6 +152,7 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
               <tuple>
                 <none/>
                 <none/>
+                <none/>
               </tuple>
             </value>
         </item>
-- 
2.30.9