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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aaron Chen
erp5
Commits
2ef1dd35
Commit
2ef1dd35
authored
Feb 26, 2013
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search for documents which reference us only if our reference itself is
following format defined in system preference level.
parent
a4011582
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getImplicitPredecessorValueList.xml
...l_skins/erp5_dms/Base_getImplicitPredecessorValueList.xml
+2
-1
bt5/erp5_dms/bt/revision
bt5/erp5_dms/bt/revision
+1
-1
product/ERP5/Document/Document.py
product/ERP5/Document/Document.py
+17
-1
No files found.
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getImplicitPredecessorValueList.xml
View file @
2ef1dd35
...
...
@@ -58,7 +58,8 @@ and make sure we get latest/most relevant version\n
should be reimplemented in SQL some sunny day.\n
"""\n
reference = context.getReference()\n
if reference is None:\n
if reference is None or not context.isSearchableReference():\n
# empty or not following format preference\n
return ()\n
\n
return context.Base_zGetImplicitPredecessorValueList(reference=reference)\n
...
...
bt5/erp5_dms/bt/revision
View file @
2ef1dd35
1269
\ No newline at end of file
1270
\ No newline at end of file
product/ERP5/Document/Document.py
View file @
2ef1dd35
...
...
@@ -317,6 +317,22 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
preferences.
"""
text = self.getSearchableText() # XXX getSearchableText or asText ?
return self._getSearchableReferenceList(text)
security.declareProtected(Permissions.AccessContentsInformation, '
getSearchableReferenceList
')
def isSearchableReference(self):
"""
Determine if current document'
s
reference
can
be
used
for
searching
-
i
.
e
.
follows
certain
defined
at
system
level
preferences
format
.
"""
reference = self.getReference()
return len(self._getSearchableReferenceList(reference))
def _getSearchableReferenceList(self, text):
"""
Extract
all
reference
alike
strings
from
text
using
for
that
a
regular
expression
defined
at
system
level
preferences
.
"""
regexp = self.portal_preferences.getPreferredDocumentReferenceRegularExpression()
try:
rx_search = re.compile(regexp)
...
...
@@ -334,7 +350,7 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
tmp[key] = None
for group, group_item_tuple in tmp.keys():
result.append((group, dict(group_item_tuple)))
return result
return result
security.declareProtected(Permissions.AccessContentsInformation, 'getImplicitSuccessorValueList')
def getImplicitSuccessorValueList(self):
...
...
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