Commit 05fa56f1 authored by Fabien Morin's avatar Fabien Morin

correct a bug of the track button (was not working with empty application number)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23538 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1778719e
......@@ -68,23 +68,19 @@
<value> <string>portal = context.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
if application_number is not None:\n
if not application_number and id:\n
application_number = id\n
\n
if application_number:\n
document = context.portal_catalog.getResultValue(id=application_number)\n
if document is not None:\n
if document.getValidationState() == \'draft\':\n
return document.Base_redirect(form_id=\'view\')\n
return document.Base_redirect(form_id=\'PDFDocument_viewHistory\')\n
else:\n
document = context.portal_catalog.getResultValue(id=id)\n
if document is not None:\n
if document.getValidationState() == \'draft\':\n
return document.Base_redirect(form_id=\'view\')\n
return document.Base_redirect(form_id=\'PDFDocument_viewHistory\')\n
\n
\n
# Prepare message\n
msg = N_(\'Sorry, this document is not available\')\n
return context.Base_redirect(form_id=\'view\', keep_items = {\'portal_status_message\' : msg, \'editable_mode\' : False})\n
return context.Base_redirect(form_id=\'view\', keep_items = {\'portal_status_message\' : msg})\n
</string> </value>
</item>
<item>
......@@ -148,10 +144,9 @@ return context.Base_redirect(form_id=\'view\', keep_items = {\'portal_status_mes
<string>context</string>
<string>portal</string>
<string>N_</string>
<string>None</string>
<string>document</string>
<string>None</string>
<string>msg</string>
<string>False</string>
</tuple>
</value>
</item>
......@@ -173,6 +168,12 @@ return context.Base_redirect(form_id=\'view\', keep_items = {\'portal_status_mes
<key> <string>id</string> </key>
<value> <string>EGov_goToDocument</string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......
281
\ No newline at end of file
282
\ 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