[Erp5-report] r25984 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 11 15:46:46 CET 2009


Author: jerome
Date: Wed Mar 11 15:46:46 2009
New Revision: 25984

URL: http://svn.erp5.org?rev=25984&view=rev
Log:
if the user that performed the action has a corresponding person, show the
person name in the workflow history

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml?rev=25984&r1=25983&r2=25984&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml [utf8] Wed Mar 11 15:46:46 2009
@@ -65,6 +65,19 @@
 workflow_id_list = [x for x, y in context.getWorkflowStateItemList()]\n
 if not workflow_id in workflow_id_list:\n
   return []\n
+\n
+actor_name_cache = dict()\n
+def getActorName(actor):\n
+  # returns the name of the actor. If it\'s a person, show the usual name of the person\n
+  try:\n
+    return actor_name_cache[actor]\n
+  except KeyError:\n
+    actor_name_cache[actor] = actor\n
+    person = portal_object.portal_catalog.getResultValue(portal_type=\'Person\', reference=actor)\n
+    if person is not None:\n
+      actor_name_cache[actor] = person.getTitle()\n
+    return actor_name_cache[actor]\n
+\n
 # Get history\n
 # XXX Compatibility\n
 for history_name in [\'history\', \'building_history\', \'installation_history\']:\n
@@ -109,6 +122,8 @@
         value = \'. \'.join([\'%s\' % x for x in value])\n
       elif key == \'error_message\':\n
         value = \'%s\' % value\n
+      elif key == \'actor\':\n
+        value = getActorName(value)\n
       elif same_type(value, \'\') and key in ( \'action\', \'state\' ): \n
         value = context.Localizer.erp5_ui.gettext(value)\n
     if value is marker:\n
@@ -197,6 +212,9 @@
                             <string>x</string>
                             <string>y</string>
                             <string>workflow_id_list</string>
+                            <string>dict</string>
+                            <string>actor_name_cache</string>
+                            <string>getActorName</string>
                             <string>history_name</string>
                             <string>workflow_item_list</string>
                             <string>_getitem_</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=25984&r1=25983&r2=25984&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Wed Mar 11 15:46:46 2009
@@ -1,1 +1,1 @@
-1103
+1104




More information about the Erp5-report mailing list