From a217409088b64203b72d0b107f56a81927658659 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Wed, 1 Feb 2006 10:25:07 +0000
Subject: [PATCH] take 'your_' field into account

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5486 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_core/Base_callDialogMethod.xml       | 21 +++++++++++-------
 .../erp5_core/Base_callViewDialogMethod.xml   | 22 ++++++++++++++-----
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callDialogMethod.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callDialogMethod.xml
index 8c1d636f0e..50c330bdd9 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callDialogMethod.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callDialogMethod.xml
@@ -114,15 +114,18 @@ try:\n
     k = f.id\n
     v = getattr(request, k, MARKER)\n
     if v is not MARKER:\n
-      if k[0:3] == \'my_\':\n
-        k = k[3:]\n
-        kw[k] = v\n
-        if v in (None, [], ()) or hasattr(v, \'read\') :\n
+      for prefix in (\'my_\', \'your_\'):\n
+        if k.startswith(prefix):\n
+          k = k[len(prefix):]\n
+          kw[k] = v\n
+          if v in (None, [], ()) or hasattr(v, \'read\') :\n
+            must_redirect = 1\n
+          break\n
+      else:\n
+        if k in (\'import_file\', \'listbox\'):\n
+          if f.meta_type == \'ListBox\': has_listbox = 1\n
           must_redirect = 1\n
-      elif k in (\'import_file\', \'listbox\'):\n
-        if f.meta_type == \'ListBox\': has_listbox = 1\n
-        must_redirect = 1\n
-        kw[k] = v\n
+          kw[k] = v\n
   # Add some properties required by UI\n
   md5_object_uid_list = getattr(request,\'md5_object_uid_list\',None)\n
   kw[\'md5_object_uid_list\'] = md5_object_uid_list\n
@@ -253,7 +256,9 @@ return request.RESPONSE.redirect( redirect_url )\n
                             <string>f</string>
                             <string>k</string>
                             <string>v</string>
+                            <string>prefix</string>
                             <string>_getitem_</string>
+                            <string>len</string>
                             <string>_write_</string>
                             <string>hasattr</string>
                             <string>md5_object_uid_list</string>
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callViewDialogMethod.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callViewDialogMethod.xml
index a5aae0da53..5321359cc1 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callViewDialogMethod.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_callViewDialogMethod.xml
@@ -118,12 +118,18 @@ try:\n
     k = f.id\n
     v = getattr(request,k, MARKER)\n
     if v is not MARKER:\n
-      if k[0:3] == \'my_\':\n
-        k = k[3:]\n
-        kw[k] = v\n
-      elif k in (\'import_file\', \'listbox\'):\n
-        if f.meta_type == \'ListBox\': has_listbox = 1\n
-        kw[k] = v\n
+      for prefix in (\'my_\', \'your_\'):\n
+        if k.startswith(prefix):\n
+          k = k[len(prefix):]\n
+          kw[k] = v\n
+          if v in (None, [], ()) or hasattr(v, \'read\') :\n
+            must_redirect = 1\n
+          break\n
+      else:\n
+        if k in (\'import_file\', \'listbox\'):\n
+          if f.meta_type == \'ListBox\': has_listbox = 1\n
+          must_redirect = 1\n
+          kw[k] = v\n
   # Add some properties required by UI\n
   kw[\'cancel_url\'] = cancel_url\n
   # Redirect if possible, or call directly else\n
@@ -247,8 +253,12 @@ return request.RESPONSE.redirect( redirect_url )\n
                             <string>f</string>
                             <string>k</string>
                             <string>v</string>
+                            <string>prefix</string>
                             <string>_getitem_</string>
+                            <string>len</string>
                             <string>_write_</string>
+                            <string>hasattr</string>
+                            <string>must_redirect</string>
                             <string>import_file</string>
                             <string>_apply_</string>
                             <string>listbox_line_list</string>
-- 
2.30.9