[Erp5-report] r7177 - /erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu May 11 02:19:59 CEST 2006


Author: jerome
Date: Thu May 11 02:19:55 2006
New Revision: 7177

URL: http://svn.erp5.org?rev=7177&view=rev
Log:
merge Base_jumpToRelationObject and Base_jumpToRelatedObject implementation

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelationObject.xml

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.xml?rev=7177&r1=7176&r2=7177&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelatedObject.xml Thu May 11 02:19:55 2006
@@ -70,10 +70,15 @@
 N_ = context.Base_translateString\n
 checkPerm = context.portal_membership.checkPermission\n
 \n
-search_method = getattr(context, \'get%sRelatedList\' %\n
+if related:\n
+  search_method = getattr(context, \'get%sRelatedList\' %\n
           string.join([string.capitalize(x) for x in base_category.split(\'_\')], \'\'))\n
+else:\n
+  search_method = getattr(context, \'get%sList\' %\n
+          string.join([string.capitalize(x) for x in base_category.split(\'_\')], \'\'))\n
+\n
 related_list = search_method(portal_type = portal_type)\n
-    \n
+\n
 if same_type(portal_type, \'\'):\n
   portal_type = [portal_type]\n
 \n
@@ -120,7 +125,7 @@
                       uids=selection_uid_list, REQUEST=request)\n
 \n
 redirect_url = \'%s/%s?%s\' % (url, \'view\', make_query({\'portal_status_message\': message}))\n
-context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n
+return context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n
 </string> </value>
         </item>
         <item>
@@ -141,7 +146,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>base_category, portal_type=()</string> </value>
+            <value> <string>base_category, portal_type=(), related=1</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -161,7 +166,7 @@
                   <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>
@@ -169,6 +174,7 @@
                           <tuple>
                             <string>base_category</string>
                             <string>portal_type</string>
+                            <string>related</string>
                             <string>ZTUtils</string>
                             <string>make_query</string>
                             <string>_getattr_</string>
@@ -211,6 +217,7 @@
             <value>
               <tuple>
                 <tuple/>
+                <int>1</int>
               </tuple>
             </value>
         </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelationObject.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelationObject.xml?rev=7177&r1=7176&r2=7177&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelationObject.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_jumpToRelationObject.xml Thu May 11 02:19:55 2006
@@ -66,32 +66,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>search_method = getattr(context, \'get%sValueList\' %\n
-          string.join([string.capitalize(x) for x in base_category.split(\'_\')], \'\'))\n
-related_object_list = search_method(portal_type=portal_type)\n
-\n
-if len(related_object_list)==0:\n
-  url = context.absolute_url()\n
-  message = \'No+%s+related.\' % portal_type.replace(\' \', \'+\')\n
-\n
-elif len(related_object_list)==1:\n
-  url = related_object_list[0].absolute_url()\n
-  message = \'%s+related+to+%s:+%s.\' %\\\n
-            (portal_type.replace(\' \', \'+\'),\n
-             context.getPortalType().replace(\' \', \'+\'), \n
-             context.getTitleOrId())\n
-\n
-else:\n
-  request=context.REQUEST\n
-  selection_uid_list = [x.getUid() for x in related_object_list]\n
-  kw = {\'uid\': selection_uid_list}\n
-  context.portal_selections.setSelectionParamsFor(\'Base_jumpToRelatedObjectList\', kw)\n
-  request.set(\'object_uid\', context.getUid())\n
-  request.set(\'uids\', selection_uid_list)\n
-  return context.Base_jumpToRelatedObjectList(uids=selection_uid_list, REQUEST=request)\n
-\n
-redirect_url = \'%s/%s?%s\' % (url, \'view\', \'portal_status_message=%s\' % message)\n
-context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n
+            <value> <string>return context.Base_jumpToRelatedObject(base_category, portal_type=portal_type, related=0)\n
 </string> </value>
         </item>
         <item>
@@ -140,24 +115,8 @@
                           <tuple>
                             <string>base_category</string>
                             <string>portal_type</string>
-                            <string>getattr</string>
-<string>context</string>
                             <string>_getattr_</string>
-                            <string>string</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>_getiter_</string>
-                            <string>x</string>
-                            <string>search_method</string>
-                            <string>related_object_list</string>
-                            <string>len</string>
-                            <string>url</string>
-                            <string>message</string>
-                            <string>_getitem_</string>
-                            <string>request</string>
-                            <string>selection_uid_list</string>
-                            <string>kw</string>
-                            <string>redirect_url</string>
+                            <string>context</string>
                           </tuple>
                         </value>
                     </item>




More information about the Erp5-report mailing list