Commit fb566030 authored by Ivan Tyagov's avatar Ivan Tyagov

Do use catalog when switching between different tabs to avoid having to deal...

Do use catalog when switching between different tabs to avoid having to deal with objectValues / contentValues API. Avoid use cases when a Pad may contains many Boxes.
parent 284f5dbf
...@@ -66,11 +66,12 @@ context.ERP5Site_toggleActiveKnowledgePad(pad_relative_url, mode, redirect=False ...@@ -66,11 +66,12 @@ context.ERP5Site_toggleActiveKnowledgePad(pad_relative_url, mode, redirect=False
\n \n
# generate needed JavaScript code\n # generate needed JavaScript code\n
javascript_list = []\n javascript_list = []\n
for box in pad.objectValues():\n for box in pad.searchFolder(portal_type=\'Knowledge Box\',\n
validation_state=[\'visible\', \'invisible\']):\n
box = box.getObject()\n
gadget = box.getSpecialiseValue()\n gadget = box.getSpecialiseValue()\n
gadget_type = gadget.getRenderType()\n gadget_type = gadget.getRenderType()\n
if box.getValidationState() in [\'visible\', \'invisible\'] \\\n if gadget_type==\'asynchronous\' and gadget.getValidationState()!=\'invisible\':\n
and gadget_type==\'asynchronous\' and gadget.getValidationState()!=\'invisible\':\n
edit_form_id=gadget.getEditFormId()\n edit_form_id=gadget.getEditFormId()\n
view_form_id=gadget.getViewFormId()\n view_form_id=gadget.getViewFormId()\n
base_url = \'%s/%s\' %(context.absolute_url(), view_form_id) \n base_url = \'%s/%s\' %(context.absolute_url(), view_form_id) \n
......
749 750
\ No newline at end of file \ 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