Commit bbdc8185 authored by Fabien Morin's avatar Fabien Morin

improve WebSection_getDocumentValue to be more precise

remove condition on captcha displaying

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23622 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e0d172a5
...@@ -53,31 +53,37 @@ ...@@ -53,31 +53,37 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># get some information about the context\n <value> <string>\'\'\'\n
This script generate some web page name related to the context\n
ex :\n
DeclarationTVA-Draft-PDFDocument_viewAttachmentList-Upload.Button-Citizen\n
\'\'\'\n
\n
# get some information about the context\n
absolute_url = context.getAbsoluteUrl()\n absolute_url = context.getAbsoluteUrl()\n
portal_type = context.getPortalType()\n portal_type = context.getPortalType()\n
request = context.REQUEST\n
form_id = request.get(\'form_id\', None)\n
\n
# remove spaces\n
portal_type = portal_type.replace(\' \', \'\')\n
id = context.getId()\n id = context.getId()\n
\n \n
# redirect to the good help webpage using context informations\n web_page_name = []\n
help_page_name = []\n web_page_name.append(portal_type)\n
help_page_name.append(\'HelpOn\')\n if getattr(context, \'getValidationStateTitle\', None) and context.getValidationStateTitle():\n
web_page_name.append(context.getValidationStateTitle())\n
\n \n
if portal_type != \'Web Site\':\n if form_id:\n
state = context.getValidationState()\n web_page_name.append(form_id)\n
\n
#make the name of the page to link to\n
pt_name = portal_type.replace(\' \', \'_\')\n
pt_name = pt_name.lower()\n
# in a first version, we don\'t use portal type to not have so much\n
# documentation to write\n
#help_page_name.append(pt_name)\n
help_page_name.append(state)\n
\n \n
else:\n web_site_id = context.getWebSiteValue().getId()\n
help_page_name.append(id)\n if web_site_id == \'dgid\':\n
help_page_name = \'_\'.join(help_page_name)\n web_page_name.append(\'Agent\')\n
if web_site_id == \'egov_portal\':\n
web_page_name.append(\'Citizen\')\n
\n \n
return help_page_name\n return \'-\'.join(web_page_name)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -118,10 +124,13 @@ return help_page_name\n ...@@ -118,10 +124,13 @@ return help_page_name\n
<string>context</string> <string>context</string>
<string>absolute_url</string> <string>absolute_url</string>
<string>portal_type</string> <string>portal_type</string>
<string>request</string>
<string>None</string>
<string>form_id</string>
<string>id</string> <string>id</string>
<string>help_page_name</string> <string>web_page_name</string>
<string>state</string> <string>getattr</string>
<string>pt_name</string> <string>web_site_id</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -82,7 +82,7 @@ Description:\n ...@@ -82,7 +82,7 @@ Description:\n
<input type="hidden" name="current_action" value="" \n <input type="hidden" name="current_action" value="" \n
tal:attributes="value request/current_action" />-->\n tal:attributes="value request/current_action" />-->\n
<div class="onright">\n <div class="onright">\n
<div class="erp5_captcha" tal:condition="python: here.portal_membership.isAnonymousUser()">\n <div class="erp5_captcha">\n
<img src="Captcha_getCaptchaFile?display=thumbnail&amp;format=&amp;resolution=75" alt="captcha"/>\n <img src="Captcha_getCaptchaFile?display=thumbnail&amp;format=&amp;resolution=75" alt="captcha"/>\n
<input class="captcha_text" type="text" size="6" name="captcha_text"/>\n <input class="captcha_text" type="text" size="6" name="captcha_text"/>\n
</div>\n </div>\n
......
304 305
\ 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