Commit cb810fbb authored by Gabriel Monnerat's avatar Gabriel Monnerat

2010-12-20 gabriel

* Initial implementation to share documents in UNG.
* Added redirect to be possible open the document with the key.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41543 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 20d6adda
...@@ -158,6 +158,10 @@ ...@@ -158,6 +158,10 @@
<key> <string>content_layout</string> </key> <key> <string>content_layout</string> </key>
<value> <string>erp5_web_ung_content_layout</string> </value> <value> <string>erp5_web_ung_content_layout</string> </value>
</item> </item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_renderer</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>if context.REQUEST.form.has_key("key"):\n
webpage = context.portal_catalog.getResultValue(reference=context.REQUEST.form.get("key"))\n
webpage_id = webpage.getId()\n
editor_name = context.Base_getEditorViewName(webpage.getPortalType())\n
return context.Base_redirect("/web_page_module/%s/%s" % (webpage_id, editor_name),\n
keep_items=dict(editable_mode=1))\n
else:\n
return context.Base_redirect("unfoldDomain", \n
keep_items = dict(domain_url="ung_domain/all_document_list",\n
form_id="erp5_web_ung_layout",\n
list_selection_name="ung_document_list_selection",\n
domain_depth=0,\n
reset=1))\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>_getattr_</string>
<string>context</string>
<string>webpage</string>
<string>webpage_id</string>
<string>editor_name</string>
<string>dict</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>WebSection_renderer</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>if context.getReference().startswith("default-"):\n
context.setReference(DateTime().millis())\n
return "%s/?key=%s" % (context.REQUEST.get("URL3"), context.getReference())\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>_getattr_</string>
<string>context</string>
<string>DateTime</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>WebSection_shareDocument</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -116,7 +116,7 @@ $(document).ready(function(){\n ...@@ -116,7 +116,7 @@ $(document).ready(function(){\n
if (getWebEditorName() == "WebPage_viewEditor")\n if (getWebEditorName() == "WebPage_viewEditor")\n
$("div.content").css({"top": "5em"});\n $("div.content").css({"top": "5em"});\n
if (getWebEditorName() == "WebTable_viewEditor")\n if (getWebEditorName() == "WebTable_viewEditor")\n
$("div.content").css({"top": "7em"});\n $("div.content").css({"top": "6em"});\n
}\n }\n
$("a[name=\'document_title\']").html(getObjectPropertyValue("getTitle"));\n $("a[name=\'document_title\']").html(getObjectPropertyValue("getTitle"));\n
$("input#upload").click(function(event){\n $("input#upload").click(function(event){\n
...@@ -168,6 +168,17 @@ $(document).ready(function(){\n ...@@ -168,6 +168,17 @@ $(document).ready(function(){\n
},\n },\n
});\n });\n
});\n });\n
$("div.action_menu li ul").append("<li><a id=\'share_document\' href=\'#\'>" + \n
"<h6>Share this Document</h6></a></li>");\n
$("div.action_menu li ul").css("height", 101);\n
$("div.action_menu ul li a#share_document").click(function(event){\n
event.preventDefault();\n
reference = $.ajax({\n
url: \'WebSection_shareDocument\',\n
async: false,\n
}).responseText;\n
alert(reference);\n
});\n
}\n }\n
$("#edit_document").dialog({\n $("#edit_document").dialog({\n
autoOpen: false,\n autoOpen: false,\n
......
2010-12-20 gabriel
* Initial implementation to share documents in UNG.
* Added redirect to be possible open the document with the key.
2010-12-16 gabriel 2010-12-16 gabriel
* Implemented feature to change the state of Document via UNG Theme * Implemented feature to change the state of Document via UNG Theme
......
132 134
\ No newline at end of file \ 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