diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_userFollowUpWebPage.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ERP5Site_userFollowUpWebPage.xml similarity index 59% rename from bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_userFollowUpWebPage.xml rename to bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ERP5Site_userFollowUpWebPage.xml index 54149efeec8da9e6235e331996126acf26504145..fde0553a707f74b5f0baecea84d49143841626e0 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_userFollowUpWebPage.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ERP5Site_userFollowUpWebPage.xml @@ -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> diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_shareDocument.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebPage_shareDocument.xml similarity index 93% rename from bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_shareDocument.xml rename to bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebPage_shareDocument.xml index f6c77b9c51fd3f748e09d6dcdf4d726cc8d2b9e7..bea5d371fec27c394a2494f4794aaedfb25c91cc 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_shareDocument.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebPage_shareDocument.xml @@ -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> diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_renderer.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_renderer.xml index 2b88b06350c3cd2038b38b7b48ca50cc2e5b4aac..f174929a121ee458e1644c1a376b2bce6c1560f3 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_renderer.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_renderer.xml @@ -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 diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_uploadDocument.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_uploadDocument.xml index 07bd8f6072de676bf2e366199a162481f0ffde08..61a875520bb955dc16a5e2b6198950004e552101 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_uploadDocument.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_uploadDocument.xml @@ -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> diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung.js.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung.js.xml index 103745e595ec0b6dd841d48abaa43fd092ca9be5..9581f9afb0dc9643236ca40f06f0d34a52fddf4e 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung.js.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung.js.xml @@ -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 diff --git a/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py b/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py index c560c336a0ae6193601abddab73f94b86c10a859..87342438a8fd1f504de3a21faad20fb39a98acc1 100644 --- a/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py +++ b/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py @@ -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()] diff --git a/bt5/erp5_web_ung_theme/bt/revision b/bt5/erp5_web_ung_theme/bt/revision index 58dc5afc0c7b1b0150b0b8d69c6cbd4425563a1e..55663e5ead480ae5528e47d004baa6d34c3043c5 100644 --- a/bt5/erp5_web_ung_theme/bt/revision +++ b/bt5/erp5_web_ung_theme/bt/revision @@ -1 +1 @@ -303 \ No newline at end of file +304 \ No newline at end of file