Commit 415ef86b authored by Jérome Perrin's avatar Jérome Perrin

Show old value, new value and current value for all properties on the Historical comparisions view.

--This line, and those below, will be ignored--

M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewWorkflowHistory.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewHistoricalComparison/listbox.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonUrl.xml
M    erp5_core/bt/revision

--This line, and those below, will be ignored--

M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetTrackingList.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zStatInventory.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventory.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetMovementHistoryList.xml
M    erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.xml
M    erp5_core/bt/change_log
M    erp5_core/bt/revision


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10715 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9dd34374
......@@ -69,17 +69,36 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.PythonScripts.standard import Object\n
from ZODB.POSException import ConflictError\n
\n
serial = context.REQUEST[\'serial\']\n
next_serial = context.REQUEST[\'next_serial\']\n
\n
try:\n
context.HistoricalRevisions[serial]\n
except ConflictError:\n
raise\n
except: # POSKeyError\n
return [Object(property_name=\'Historical revisions are not available, \'\n
\'maybe the database has been packed\')]\n
\n
if next_serial == \'0.0.0.0\':\n
new_getProperty = context.getProperty\n
else:\n
new = context.HistoricalRevisions[next_serial]\n
new_getProperty = new.getProperty\n
old = context.HistoricalRevisions[serial]\n
result = []\n
\n
for prop_dict in context.getPropertyMap():\n
prop = prop_dict[\'id\']\n
old_value = old.getProperty(prop)\n
current_value = context.getProperty(prop)\n
if current_value != old_value:\n
new_value = new_getProperty(prop)\n
if new_value != old_value:\n
result.append( Object( property_name=prop,\n
new_value=new_value,\n
old_value=old_value,\n
current_value=current_value ))\n
current_value=context.getProperty(prop)))\n
return result\n
</string> </value>
</item>
......@@ -89,6 +108,12 @@ return result\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
......@@ -126,17 +151,22 @@ return result\n
<string>kw</string>
<string>Products.PythonScripts.standard</string>
<string>Object</string>
<string>ZODB.POSException</string>
<string>ConflictError</string>
<string>_getitem_</string>
<string>_getattr_</string>
<string>context</string>
<string>serial</string>
<string>next_serial</string>
<string>new_getProperty</string>
<string>new</string>
<string>old</string>
<string>result</string>
<string>_getiter_</string>
<string>prop_dict</string>
<string>prop</string>
<string>old_value</string>
<string>current_value</string>
<string>new_value</string>
</tuple>
</value>
</item>
......@@ -164,4 +194,25 @@ return result\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -70,8 +70,12 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
if getattr(brain, \'serial\', \'0.0.0.0\') != \'0.0.0.0\':\n
return \'Base_viewHistoricalComparison?serial=%s&time=%s\' % (brain.serial, brain.time)\n
serial = getattr(brain, \'serial\', \'0.0.0.0\')\n
next_serial = getattr(brain, \'next_serial\', \'0.0.0.0\')\n
\n
if serial != \'0.0.0.0\':\n
return \'Base_viewHistoricalComparison?serial=%s&next_serial=%s&time=%s\'\\\n
% ( serial, next_serial, brain.time )\n
]]></string> </value>
......@@ -82,6 +86,12 @@ if getattr(brain, \'serial\', \'0.0.0.0\') != \'0.0.0.0\':\n
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
......@@ -119,6 +129,8 @@ if getattr(brain, \'serial\', \'0.0.0.0\') != \'0.0.0.0\':\n
<string>brain</string>
<string>kw</string>
<string>getattr</string>
<string>serial</string>
<string>next_serial</string>
<string>_getattr_</string>
</tuple>
</value>
......@@ -147,4 +159,25 @@ if getattr(brain, \'serial\', \'0.0.0.0\') != \'0.0.0.0\':\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -86,6 +86,7 @@ for history_name in [\'history\', \'building_history\', \'installation_history\'
wf_states = context.portal_workflow[workflow_id].states\n
wf_transitions = context.portal_workflow[workflow_id].transitions\n
\n
next_serial = None\n
for workflow_item in workflow_item_list:\n
# XXX removing str method generate a strange bug\n
o = newTempBase(portal_object, str(i))\n
......@@ -118,6 +119,12 @@ for workflow_item in workflow_item_list:\n
if same_type(value, \'\') and key != \'error_message\':\n
value = context.Localizer.erp5_ui.gettext(value)\n
o.setProperty(key, value)\n
\n
# record current serial as "next serial" for the previous revision\n
if next_serial is not None:\n
previous_obj.setProperty(\'next_serial\', o.serial)\n
next_serial = getattr(o, \'serial\', None)\n
previous_obj = o\n
result.append(o)\n
\n
return result\n
......@@ -205,6 +212,8 @@ return result\n
<string>_getitem_</string>
<string>wf_states</string>
<string>wf_transitions</string>
<string>None</string>
<string>next_serial</string>
<string>workflow_item</string>
<string>str</string>
<string>o</string>
......@@ -212,8 +221,9 @@ return result\n
<string>value</string>
<string>compatibility_name</string>
<string>len</string>
<string>None</string>
<string>same_type</string>
<string>previous_obj</string>
<string>getattr</string>
</tuple>
</value>
</item>
......
......@@ -74,7 +74,7 @@
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
......@@ -82,19 +82,19 @@
</value>
</item>
<item>
<key> <string>center</string> </key>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<key> <string>left</string> </key>
<value>
<list>
<string>old_revision</string>
......@@ -102,7 +102,7 @@
</value>
</item>
<item>
<key> <string>right</string> </key>
<key> <string>right</string> </key>
<value>
<list/>
</value>
......
......@@ -333,6 +333,10 @@
<string>old_value</string>
<string>Old Value</string>
</tuple>
<tuple>
<string>new_value</string>
<string>New Value</string>
</tuple>
<tuple>
<string>current_value</string>
<string>Current Value</string>
......
......@@ -73,7 +73,7 @@
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
......@@ -81,19 +81,19 @@
</value>
</item>
<item>
<key> <string>center</string> </key>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<key> <string>right</string> </key>
<value>
<list/>
</value>
......
110
\ No newline at end of file
111
\ 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