Commit 2f0f48bc authored by Jean-Paul Smets's avatar Jean-Paul Smets

Improvement of DocumentManagement extension (to prevent bugs during search on...

Improvement of DocumentManagement extension (to prevent bugs during search on portal types without history). Added categories to Web Page.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14383 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aa9ffd30
...@@ -90,6 +90,8 @@ def getAttrFromFilename(self, fname): ...@@ -90,6 +90,8 @@ def getAttrFromFilename(self, fname):
def getLastWorkflowDate(self, state_name='simulation_state', state=('released','public')): def getLastWorkflowDate(self, state_name='simulation_state', state=('released','public')):
'''we can make something more generic out of it '''we can make something more generic out of it
or JP says "there is an API for it" and we trash this one''' or JP says "there is an API for it" and we trash this one'''
if not hasattr(self, 'workflow_history'):
return None
for name,wflow in self.workflow_history.items(): for name,wflow in self.workflow_history.items():
if len(wflow) == 0: continue # empty history if len(wflow) == 0: continue # empty history
if wflow[0].get(state_name) is None: continue # not the right one if wflow[0].get(state_name) is None: continue # not the right one
...@@ -99,7 +101,7 @@ def getLastWorkflowDate(self, state_name='simulation_state', state=('released',' ...@@ -99,7 +101,7 @@ def getLastWorkflowDate(self, state_name='simulation_state', state=('released','
if act is not None and act.endswith('action'): if act is not None and act.endswith('action'):
if ch.get(state_name, '') in state: if ch.get(state_name, '') in state:
return ch['time'] return ch['time']
return 0 return None
############################################################################# #############################################################################
# Mail management # Mail management
......
<base_category_list>
<portal_type id="Web Page">
<item>group</item>
<item>site</item>
<item>source_project</item>
<item>function</item>
</portal_type>
</base_category_list>
\ No newline at end of file
erp5_base erp5_base
erp5_web erp5_web
erp5_dms_mysql_innodb_catalog erp5_dms_catalog
\ No newline at end of file \ No newline at end of file
633 634
\ No newline at end of file \ No newline at end of file
Web Page | function
Web Page | group
Web Page | site
Web Page | source_project
\ 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