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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
erp5
Commits
e9b75a27
Commit
e9b75a27
authored
May 29, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimise ERP5Site_getKnowledgePadListForUser.
call getObject() once explicitly to reduce number of calls.
parent
6824bff5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml
...rp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml
+18
-8
bt5/erp5_knowledge_pad/bt/revision
bt5/erp5_knowledge_pad/bt/revision
+1
-1
No files found.
bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml
View file @
e9b75a27
...
...
@@ -56,23 +56,31 @@ isAnonymousKnowledgePadUsed = request.get(\'is_anonymous_knowledge_pad_used\', 0
\n
def filterKnowledgePadListForContext(results, mode, \n
default_pad_group):\n
filtered_results = []\n
append = filtered_results.append\n
# in Web Mode we can have a temporary object created based on current language, document by reference\n
real_context = context.Base_getRealContext()\n
real_context_url = real_context.getRelativeUrl()\n
if mode == \'erp5_front\':\n
# leave only those not having a publication_section as \n
# this means belonging to root\n
results = filter(lambda x: x.getPublicationSection() is None and \\\n
x.getGroup() is None, results)\n
for x in results:\n
x = x.getObject()\n
if x.getPublicationSection() is None and x.getGroup() is None:\n
append(x)\n
elif mode == \'web_front\':\n
# Web Site must at least one Pad referenced by context\n
results = filter(lambda x: real_context_url in x.getPublicationSectionList() and \\\n
x.getGroup() is None, results)\n
for x in results:\n
x = x.getObject()\n
if real_context_url in x.getPublicationSectionList() and x.getGroup() is None:\n
append(x)\n
elif mode == \'web_section\':\n
# Web Sections, Web Pages can "reuse" tabs\n
results = filter(lambda x: real_context_url in x.getPublicationSectionList() or \\\n
x.getGroup() == default_pad_group, results)\n
return results\n
for x in results:\n
x = x.getObject()\n
if real_context_url in x.getPublicationSectionList() and x.getGroup() == default_pad_group:\n
append(x)\n
return filtered_results\n
\n
\n
kw = {\'portal_type\': \'Knowledge Pad\',\n
...
...
@@ -99,9 +107,11 @@ active_pad, results = \\\n
if active_pad is not None and active_pad.getValidationState() != \'deleted\':\n
found = False\n
new_results = []\n
active_pad_path = active_pad.getPath()\n
for brain in results:\n
new_results.append(brain)\n
if brain.getObject() == active_pad: found = True\n
if brain.getPath() == active_pad_path:\n
found = True\n
results = new_results\n
if not found:\n
# append it only if not from Catalog results\n
...
...
bt5/erp5_knowledge_pad/bt/revision
View file @
e9b75a27
763
\ No newline at end of file
764
\ 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