Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
cad87037
Commit
cad87037
authored
Sep 15, 2011
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable deferred listbox rendering for list report_mode
parent
fd724f79
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
304 additions
and
20 deletions
+304
-20
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.xml
...tal_skins/erp5_deferred_style/Base_activateSimpleView.xml
+20
-9
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_finaliseDeferredListBox.xml
...erp5_deferred_style_core/Base_finaliseDeferredListBox.xml
+98
-0
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_renderSimpleView.xml
..._skins/erp5_deferred_style_core/Base_renderSimpleView.xml
+1
-10
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_sendReportByEmail.xml
...skins/erp5_deferred_style_core/Base_sendReportByEmail.xml
+83
-0
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_storeListBoxPage.xml
..._skins/erp5_deferred_style_core/Base_storeListBoxPage.xml
+101
-0
bt5/erp5_deferred_style/bt/revision
bt5/erp5_deferred_style/bt/revision
+1
-1
No files found.
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.xml
View file @
cad87037
...
...
@@ -108,15 +108,26 @@ if hasattr(form, \'ZScriptHTML_tryParams\'):\n
else:\n
params[\'format\'] = format\n
\n
activity_context.activate(\n
activity=\'SQLQueue\', tag=tag, priority=priority).Base_renderSimpleView(\n
localizer_language=localizer_language,\n
skin_name=skin_name,\n
request_form=request_form,\n
deferred_style_dialog_method=deferred_style_dialog_method,\n
user_name=user_name,\n
params=params,\n
)\n
if \'form_id\' in params:\n
list_form = getattr(context, params[\'form_id\'], None)\n
else:\n
list_form = form\n
if params.get(\'print_mode\') == \'list\' and getattr(list_form, \'listbox\', None) is not None: # XXX harcoded id\n
# If a listbox is present in form, use deferred renderer\n
tag = list_form.listbox.initDeferredRendering(user_name=user_name,\n
skin_name=skin_name,\n
format=format,\n
**params)\n
else:\n
activity_context.activate(\n
activity=\'SQLQueue\', tag=tag, priority=priority).Base_renderSimpleView(\n
localizer_language=localizer_language,\n
skin_name=skin_name,\n
request_form=request_form,\n
deferred_style_dialog_method=deferred_style_dialog_method,\n
user_name=user_name,\n
params=params,\n
)\n
\n
context.activate(activity=\'SQLQueue\', after_tag=tag).getTitle()\n
\n
...
...
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_finaliseDeferredListBox.xml
0 → 100644
View file @
cad87037
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
active_process = portal.restrictedTraverse(active_process_path)\n
listbox = portal.restrictedTraverse(listbox_path)\n
portal.changeSkin(skin_name)\n
request = container.REQUEST\n
request.set(\'portal_skin\', skin_name)\n
\n
parameter_dict = dict(active_process_path=active_process_path)\n
if format:\n
parameter_dict[\'format\'] = format\n
report_data = listbox.aq_parent(**parameter_dict) # call the form\n
context.getPortalObject().portal_skins.changeSkin(None)\n
request.set(\'portal_skin\', None)\n
\n
attachment_name_list = [x[len(\' filename=\'):] for x in (request.RESPONSE.getHeader(\n
\'content-disposition\') or \'\').split(\';\')\n
if x.startswith(\' filename=\')]\n
if attachment_name_list:\n
attachment_name = attachment_name_list[0]\n
else:\n
attachment_name = context.getTranslatedTitle()\n
if attachment_name.startswith(\'"\'):\n
attachment_name = attachment_name[1:]\n
if attachment_name.endswith(\'"\'):\n
attachment_name = attachment_name[:-1]\n
\n
attachment_list = (\n
{\'mime_type\': (request.RESPONSE.getHeader(\'content-type\') or \'application/octet-stream;\').split(\';\')[0],\n
\'content\': \'%s\' % report_data,\n
\'name\': attachment_name},)\n
\n
return getattr(context, transport_method_id)(attachment_list, user_name)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
listbox_path, active_process_path, skin_name, transport_method_id, user_name, format
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_finaliseDeferredListBox
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_renderSimpleView.xml
View file @
cad87037
...
...
@@ -73,16 +73,7 @@ attachment_list = (\n
\'content\': \'%s\' % report_data,\n
\'name\': attachment_name},)\n
\n
# XXX Use notification message to improve message content\n
portal.portal_notifications.sendMessage(\n
recipient=user_name,\n
subject=attachment_name.rsplit(\'.\', 1)[0],\n
message=str(translateString(\'Your report is attached.\\n\')),\n
message_text_format=\'text/plain\',\n
notifier_list=(\'Mail Message\',),\n
store_as_event=False,\n
attachment_list=attachment_list,\n
)\n
return context.Base_sendReportByEmail(attachment_list, user_name)\n
</string>
</value>
</item>
<item>
...
...
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_sendReportByEmail.xml
0 → 100644
View file @
cad87037
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ERP5Type.Message import translateString\n
portal = context.getPortalObject()\n
request = portal.REQUEST\n
\n
if not attachment_list:\n
raise ValueError\n
attachment_name = attachment_list[0][\'name\']\n
\n
portal.portal_notifications.sendMessage(\n
recipient=user_name,\n
subject=attachment_name.rsplit(\'.\', 1)[0],\n
message=str(translateString(\'Your report is attached.\\n\')),\n
message_text_format=\'text/plain\',\n
notifier_list=(\'Mail Message\',),\n
store_as_event=False,\n
attachment_list=attachment_list,\n
)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
attachment_list, user_name
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_sendReportByEmail
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style_core/Base_storeListBoxPage.xml
0 → 100644
View file @
cad87037
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
REQUEST = portal.REQUEST\n
selection = portal.portal_selections.getSelectionFor(selection_name)\n
listbox = portal.restrictedTraverse(listbox_path)\n
\n
REQUEST[\'PARENTS\'][0] = context\n
REQUEST.set(\'here\', context)\n
parameter_dict = selection.getParams()\n
list_start = parameter_dict.get(\'list_start\', 0)\n
\n
renderer = listbox.get_value(\'default\', render_format=\'deferred_list\')\n
renderer.setSelectionName(selection_name)\n
line_list = renderer.call_render(*renderer.positinal_argument_list, **renderer.named_argument_list)\n
if list_start != 0:\n
# remove header column for all pages except first one\n
line_list = line_list[1:]\n
total_pages = renderer.total_pages\n
current_page = renderer.current_page + 1\n
if total_pages != current_page:\n
portal.portal_selections.nextPage(selection_name, [], list_start=list_start)\n
context.activate(active_process=active_process_path,\n
activity=\'SQLQueue\',\n
tag=selection_name).Base_storeListBoxPage(listbox_path,\n
selection_name,\n
active_process_path,\n
skin_name,\n
user_name,\n
format)\n
else:\n
context.activate(after_tag=selection_name).Base_finaliseDeferredListBox(listbox_path,\n
active_process_path,\n
skin_name,\n
\'Base_sendReportByEmail\',\n
user_name, format)\n
return line_list\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
listbox_path, selection_name, active_process_path, skin_name, user_name, format
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_storeListBoxPage
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_deferred_style/bt/revision
View file @
cad87037
103
\ No newline at end of file
107
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment