[Erp5-report] r15421 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 2 17:10:30 CEST 2007


Author: jerome
Date: Thu Aug  2 17:10:30 2007
New Revision: 15421

URL: http://svn.erp5.org?rev=15421&view=rev
Log:
If no document are found in Base_jumpToRelatedObject, keep selection_name, selection_index and form_id while redirecting to the current document

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

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=15421&r1=15420&r2=15421&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 Aug  2 17:10:30 2007
@@ -84,6 +84,7 @@
 if same_type(portal_type, \'\'):\n
   portal_type = [portal_type]\n
 \n
+relation_found = 0\n
 if len(related_list) == 0:\n
   url = context.absolute_url()\n
   message = N_(\'No %s Related\' % portal_type[0],\n
@@ -91,6 +92,7 @@
       mapping = { \'portal_type\': N_(portal_type[0])}), \'utf8\'))\n
 \n
 elif len(related_list) == 1:\n
+  relation_found = 1\n
   related_object = context.restrictedTraverse(related_list[0], None)\n
   if related_object is None:\n
     # this might be a category\n
@@ -110,6 +112,7 @@
   else :\n
     url = context.absolute_url()\n
     message = N_("You are not authorized to view the related document.")\n
+    relation_found = 0\n
 else :\n
   # compute the list of objects we are actually authorized to view\n
   related_object_list = []\n
@@ -125,6 +128,7 @@
   if len(related_object_list) == 0 :\n
     url = context.absolute_url()\n
     message = N_("You are not authorized to view any related document.")\n
+    relation_found = 0\n
   else :\n
     request=context.REQUEST\n
     selection_uid_list = [x.getUid() for x in related_object_list]\n
@@ -136,7 +140,15 @@
     return context.Base_jumpToRelatedObjectList(\n
                       uids=selection_uid_list, REQUEST=request)\n
 \n
-redirect_url = \'%s/%s?%s\' % (url, \'view\', make_query({\'portal_status_message\': message}))\n
+query_params = dict(portal_status_message=message)\n
+if selection_name and not relation_found:\n
+  query_params[\'selection_name\'] = selection_name\n
+  query_params[\'selection_index\'] = selection_index\n
+\n
+if relation_found:\n
+  form_id = \'view\'\n
+\n
+redirect_url = \'%s/%s?%s\' % (url, form_id, make_query(query_params))\n
 return context.REQUEST[ \'RESPONSE\' ].redirect(redirect_url)\n
 </string> </value>
         </item>
@@ -154,7 +166,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>base_category, portal_type=(), related=1</string> </value>
+            <value> <string>base_category, portal_type=(), related=1, selection_name="", selection_index=0, form_id=\'view\'</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -174,7 +186,7 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>3</int> </value>
+                        <value> <int>6</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
@@ -183,6 +195,9 @@
                             <string>base_category</string>
                             <string>portal_type</string>
                             <string>related</string>
+                            <string>selection_name</string>
+                            <string>selection_index</string>
+                            <string>form_id</string>
                             <string>ZTUtils</string>
                             <string>make_query</string>
                             <string>_getattr_</string>
@@ -198,6 +213,7 @@
                             <string>search_method</string>
                             <string>related_list</string>
                             <string>same_type</string>
+                            <string>relation_found</string>
                             <string>len</string>
                             <string>url</string>
                             <string>_getitem_</string>
@@ -211,6 +227,9 @@
                             <string>request</string>
                             <string>selection_uid_list</string>
                             <string>kw</string>
+                            <string>dict</string>
+                            <string>query_params</string>
+                            <string>_write_</string>
                             <string>redirect_url</string>
                           </tuple>
                         </value>
@@ -226,6 +245,9 @@
               <tuple>
                 <tuple/>
                 <int>1</int>
+                <string></string>
+                <int>0</int>
+                <string>view</string>
               </tuple>
             </value>
         </item>
@@ -235,7 +257,7 @@
         </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <value>                 <string></string> </value>
         </item>
         <item>
             <key> <string>warnings</string> </key>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=15421&r1=15420&r2=15421&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Thu Aug  2 17:10:30 2007
@@ -1,1 +1,1 @@
-379
+381




More information about the Erp5-report mailing list