Commit 75a86178 authored by Christophe Dumez's avatar Christophe Dumez

- You can now view a bt svn history directly from portal_templates (action entry)

- code clean for svn log

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7159 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c00c5a1
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.ActionInformation</string>
<string>ActionInformation</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>bt_svn_history</string> </value>
</item>
<item>
<key> <string>optional</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string></string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>9.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View SVN History</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/BusinessTemplate_doSvnLogGlobal</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -91,12 +91,8 @@ for my_dict in log_list:\n ...@@ -91,12 +91,8 @@ for my_dict in log_list:\n
temp_object.edit(**my_dict)\n temp_object.edit(**my_dict)\n
object_list.append(temp_object)\n object_list.append(temp_object)\n
\n \n
#return object_list\n
context.REQUEST.set(\'object_list\', object_list)\n context.REQUEST.set(\'object_list\', object_list)\n
return context.BusinessTemplate_viewSvnLog()\n return context.BusinessTemplate_viewSvnLog()\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url()+\'/BusinessTemplate_viewSvnLog\')\n
return context.asContext(object_list=object_list).BusinessTemplate_viewSvnLog() # Working "here.object_list"\n
#return context.BusinessTemplate_viewSvnLog()\n
]]></string> </value> ]]></string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">bfINCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.ERP5Subversion.SubversionClient import SubversionSSLTrustError, SubversionLoginError\n
from Products.ERP5Type.Document import newTempBase\n
\n
# get selected business templates\n
p = context.getPortalObject()\n
portal_selections = p.portal_selections\n
selection_name = \'business_template_selection\' # harcoded because we can also get delete_selection\n
uids = portal_selections.getSelectionCheckedUidsFor(selection_name)\n
\n
if len(uids) != 1:\n
raise \'TemplateConditionError\', \'You can select only one Business Template\'\n
\n
file = context.portal_catalog.getObject(uids[0]).getTitle()\n
\n
try:\n
log_list = context.getPortalObject()["portal_subversion"].log(file, context.portal_catalog.getObject(uids[0]))\n
except SubversionSSLTrustError, error:\n
context.REQUEST.set(\'portal_status_message\', \'SSL Certificate was not recognized\')\n
return context.asContext(trust_dict = error.getTrustDict(), caller=\'log\', file=file).BusinessTemplate_viewSvnSSLTrust()\n
except SubversionLoginError, error1 :\n
context.REQUEST.set(\'portal_status_message\', \'Server needs authentication, no cookie found\')\n
return context.asContext(caller=\'log\', file=file, realm = error1.getRealm(), username = context.getPortalObject().portal_preferences.getPreference(\'preferred_subversion_user_name\')).BusinessTemplate_viewSvnLogin()\n
\n
if not log_list:\n
return []\n
\n
object_list = []\n
for my_dict in log_list:\n
my_dict[\'message\']=\'<br>\'.join(my_dict[\'message\'].split(\'\\n\'))\n
my_dict[\'uid\']=my_dict[\'revision\']\n
temp_object = newTempBase(folder=context.getPortalObject(), id=\'1234\')\n
temp_object.edit(**my_dict)\n
object_list.append(temp_object)\n
\n
context.REQUEST.set(\'object_list\', object_list)\n
context.REQUEST.set(\'file\', file)\n
return context.asContext(context=context.portal_catalog.getObject(uids[0])).BusinessTemplate_viewSvnLog()\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_svn/BusinessTemplate_doSvnLogGlobal</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>Products.ERP5Subversion.SubversionClient</string>
<string>SubversionSSLTrustError</string>
<string>SubversionLoginError</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>_getattr_</string>
<string>context</string>
<string>p</string>
<string>portal_selections</string>
<string>selection_name</string>
<string>uids</string>
<string>len</string>
<string>_getitem_</string>
<string>file</string>
<string>log_list</string>
<string>error</string>
<string>error1</string>
<string>object_list</string>
<string>_getiter_</string>
<string>my_dict</string>
<string>_write_</string>
<string>temp_object</string>
<string>_apply_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessTemplate_doSvnLogGlobal</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<input type=\'hidden\' name=\'modified\' value=\'\'>\n <input type=\'hidden\' name=\'modified\' value=\'\'>\n
<input type=\'hidden\' name=\'files\' value=\'\'>\n <input type=\'hidden\' name=\'files\' value=\'\'>\n
<!-- End Hidden -->\n <!-- End Hidden -->\n
\n
<div id="menudiv" style="position:absolute; display:none; top:0px; left:0px;z-index:10000;" onmouseover="javascript:overpopupmenu=true;" onmouseout="javascript:overpopupmenu=false;">\n <div id="menudiv" style="position:absolute; display:none; top:0px; left:0px;z-index:10000;" onmouseover="javascript:overpopupmenu=true;" onmouseout="javascript:overpopupmenu=false;">\n
<table width=82 cellspacing=1 cellpadding=0 bgcolor=lightgray>\n <table width=82 cellspacing=1 cellpadding=0 bgcolor=lightgray>\n
<tr><td>\n <tr><td>\n
......
...@@ -16,5 +16,6 @@ External Folder | metadata ...@@ -16,5 +16,6 @@ External Folder | metadata
External Folder | print External Folder | print
External Folder | view External Folder | view
Preference | subversion Preference | subversion
Template Tool | bt_svn_history
Upload Module | list Upload Module | list
Upload Module | view Upload Module | view
\ 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