Commit 8824e7bb authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

Add newer ticket in the listbox if it still not indexed yet

parent f1f87c14
......@@ -52,12 +52,25 @@
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
kw[\'portal_type\'] = ["Support Request", "Regularisation Request", "Upgrade Decision"]\n
support_in_progress_url = context.REQUEST.get(\'new_support_request\', \'\')\n
\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
if person:\n
kw[\'default_destination_decision_uid\'] = person.getUid()\n
kw[\'sort_on\'] = [(\'modification_date\', \'DESC\'),]\n
return context.getPortalObject().portal_catalog(**kw)\n
found = False\n
support_request_list = []\n
for support_request in context.getPortalObject().portal_catalog(**kw):\n
if support_in_progress_url and \\\n
support_request.getRelativeUrl() == support_in_progress_url:\n
found = True\n
support_request_list.append(support_request)\n
if support_in_progress_url and not found:\n
support_in_progress = portal.restrictedTraverse(\n
support_in_progress_url, None)\n
if support_in_progress and support_in_progress.getDestinationDecisionUid() == person.getUid():\n
support_request_list.insert(0, support_in_progress)\n
return support_request_list\n
\n
else:\n
return []\n
......
......@@ -53,6 +53,7 @@
<value> <string>portal = context.getPortalObject()\n
web_site = context.getWebSiteValue()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
context.REQUEST.set(\'new_support_request\', None)\n
\n
support_request_template = portal.restrictedTraverse(\n
portal.portal_preferences.getPreferredSupportRequestTemplate())\n
......@@ -83,7 +84,7 @@ web_message.edit(\n
web_message.stop(comment="Submitted from the web site contact form")\n
\n
# Redirect to web site to hide the indexation process\n
web_site.Base_redirect(\'view\', keep_items={\'editable_mode\': 0, \'portal_status_message\':context.Base_translateString(\'Ticket created.\')})\n
web_site.myspace.help.Base_redirect(\'\', keep_items={\'editable_mode\': 0, \'new_support_request\': support_request.getRelativeUrl(), \'portal_status_message\':context.Base_translateString(\'Ticket created.\')})\n
</string> </value>
</item>
<item>
......
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