Commit 59cd86c0 authored by Aurel's avatar Aurel

get uid from selection when installing bt thus we can use listbox with multiple pages

and when installing multiple bt at a time, do not check dependencies again at preinstall as it has already been made before

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12015 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 46f67fa3
......@@ -71,9 +71,11 @@
<value> <string>REQUEST = container.REQUEST\n
RESPONSE = REQUEST.RESPONSE\n
\n
uids = getattr(REQUEST, \'uids\', ())\n
selection_name = kw[\'list_selection_name\']\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
\n
ret_url = \'/\'.join([context.absolute_url(), REQUEST.get(\'form_id\', \'view\')])\n
#return repr(len(uids))\n
\n
if len(uids) == 0:\n
RESPONSE.redirect("%s?portal_status_message=No+Business+Template+Specified" % ret_url)\n
return\n
......@@ -139,9 +141,10 @@ RESPONSE.redirect("%s?portal_status_message=Business+Templates+Downloaded+As:+%s
<string>container</string>
<string>REQUEST</string>
<string>RESPONSE</string>
<string>getattr</string>
<string>uids</string>
<string>_getitem_</string>
<string>selection_name</string>
<string>context</string>
<string>uids</string>
<string>ret_url</string>
<string>len</string>
<string>id_list</string>
......
......@@ -70,15 +70,21 @@
<key> <string>_body</string> </key>
<value> <string>REQUEST = container.REQUEST\n
\n
\n
bt_id_list = getattr(REQUEST, \'bt_list\', ())\n
if len(bt_id_list) == 0:\n
bt_id_list = kw.get(\'bt_list\', ())\n
\n
if \'MultiInstallationDialog\' in getattr(REQUEST, \'current_form_id\', \'\'):\n
check_dependencies = 0\n
else:\n
check_dependencies = 1\n
\n
from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Cache import CachingMethod\n
\n
def getModifiedObjectList(bt):\n
return bt.preinstall()\n
return bt.preinstall(check_dependencies = check_dependencies)\n
\n
getModifiedObjectList = CachingMethod(getModifiedObjectList, id=\'BusinessTemplate_getModifiedObjectList\', cache_duration=36000)\n
\n
......@@ -174,6 +180,7 @@ return object_list\n
<string>getattr</string>
<string>bt_id_list</string>
<string>len</string>
<string>check_dependencies</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>Products.ERP5Type.Cache</string>
......
......@@ -74,8 +74,9 @@ from ZTUtils import make_query\n
\n
REQUEST = container.REQUEST\n
RESPONSE = REQUEST.RESPONSE\n
selection_name = kw[\'list_selection_name\']\n
\n
uids = getattr(REQUEST, \'uids\', ())\n
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
\n
if len(uids) == 0:\n
return context.REQUEST.RESPONSE.redirect(\'%s/TemplateTool_viewInstallRepositoryBusinessTemplateListDialog?portal_status_message=%s\'%(context.absolute_url(), context.urlQuote(\'No Business Template specified.\')))\n
......@@ -123,6 +124,8 @@ for uid in uids:\n
tuple_list.append(context.decodeRepositoryBusinessTemplateUid(uid))\n
tuple_list = context.sortBusinessTemplateList(tuple_list)\n
\n
context.log(\'uids = %s\' %(uids,), \'tuple list = %s\' %(tuple_list,))\n
\n
bt_list = []\n
for repository, id in tuple_list:\n
bt = context.download(\'/\'.join([repository, id]))\n
......@@ -187,10 +190,11 @@ RESPONSE.redirect(\'%s/TemplateTool_viewMultiInstallationDialog?%s&form_id=Busin
<string>container</string>
<string>REQUEST</string>
<string>RESPONSE</string>
<string>getattr</string>
<string>_getitem_</string>
<string>selection_name</string>
<string>context</string>
<string>uids</string>
<string>len</string>
<string>context</string>
<string>id_list</string>
<string>portal_status_message</string>
<string>current_uid_list</string>
......
235
\ No newline at end of file
238
\ 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