Commit 01435054 authored by Gabriel Monnerat's avatar Gabriel Monnerat

continuation of r44433. Rename scripts according to your right context

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44439 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 95b48669
......@@ -53,7 +53,12 @@
<value> <string>portal = context.getPortalObject()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
webpage = portal.portal_catalog.getResultValue(reference=reference)\n
if not person:\n
return None\n
\n
result_list = portal.portal_catalog(reference=reference, limit=1)\n
webpage = result_list[0].getObject()\n
\n
if person.getRelativeUrl() not in webpage.getFollowUpList():\n
value_list = webpage.getFollowUpValueList()\n
value_list.append(person)\n
......@@ -62,12 +67,6 @@ if person.getRelativeUrl() not in webpage.getFollowUpList():\n
return webpage\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>reference</string> </value>
......@@ -80,60 +79,9 @@ return webpage\n
</tuple>
</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>reference</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>person</string>
<string>webpage</string>
<string>value_list</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_userFollowUpWebPage</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
<value> <string>ERP5Site_userFollowUpWebPage</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.WebSection_userFollowUpWebPage()\n
<value> <string>context.ERP5Site_userFollowUpWebPage(context.getReference())\n
if context.getReference().startswith("default-"):\n
context.setReference(DateTime().millis())\n
context.share()\n
......@@ -63,7 +63,7 @@ return "%s/?key=%s" % (context.REQUEST.get("URL3"), context.getReference())\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_shareDocument</string> </value>
<value> <string>WebPage_shareDocument</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -58,7 +58,7 @@ portal = context.getPortalObject()\n
request = context.REQUEST\n
\n
if request.form.has_key("key"):\n
webpage = context.WebSection_userFollowUpWebPage(reference=context.REQUEST.form.get("key"))\n
webpage = context.ERP5Site_userFollowUpWebPage(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
......
......@@ -76,12 +76,6 @@ return context.ERP5Site_createNewWebDocument(template=portal_type_dict.get(porta
upload_document=1)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>file, **kw</string> </value>
......@@ -97,64 +91,10 @@ return context.ERP5Site_createNewWebDocument(template=portal_type_dict.get(porta
</tuple>
</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>file</string>
<string>kw</string>
<string>portal_type_dict</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_type</string>
<string>None</string>
<string>_getitem_</string>
<string>False</string>
<string>document</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_uploadDocument</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -310,7 +310,7 @@ $().ready(function(){\n
$("div.action_menu ul li a#share_document").click(function(event){\n
event.preventDefault();\n
$.ajax({\n
url: \'WebSection_shareDocument\',\n
url: \'WebPage_shareDocument\',\n
async: false,\n
});\n
location.reload();\n
......
......@@ -148,7 +148,7 @@ class TestUNG(ERP5TypeTestCase):
self.stepTic()
self.assertEquals(len(self.portal.portal_catalog(relative_url=relative_url)), 0)
def testWebSection_userFollowUpWebPage(self):
def testERP5Site_userFollowUpWebPage(self):
"""Test if user is added in field Follow Up of Web Page"""
web_page = self.portal.web_page_module.newContent(portal_type="Web Page")
web_page.setReference("new.Web-Page")
......@@ -164,12 +164,12 @@ class TestUNG(ERP5TypeTestCase):
assignment.open()
self.stepTic()
self.login("ung_new_user")
self.portal.WebSection_userFollowUpWebPage("new.Web-Page")
self.portal.ERP5Site_userFollowUpWebPage("new.Web-Page")
self.stepTic()
self.login("ERP5TypeTestCase")
self.assertEquals("ung_new_user", web_page.getFollowUpValue().getReference())
self.login("ung_new_user2")
self.portal.WebSection_userFollowUpWebPage("new.Web-Page")
self.portal.ERP5Site_userFollowUpWebPage("new.Web-Page")
self.stepTic()
self.login("ERP5TypeTestCase")
reference_list = [user.getReference() for user in web_page.getFollowUpValueList()]
......
303
\ No newline at end of file
304
\ 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