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
No related merge requests found
...@@ -52,12 +52,25 @@ ...@@ -52,12 +52,25 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
kw[\'portal_type\'] = ["Support Request", "Regularisation Request", "Upgrade Decision"]\n kw[\'portal_type\'] = ["Support Request", "Regularisation Request", "Upgrade Decision"]\n
support_in_progress_url = context.REQUEST.get(\'new_support_request\', \'\')\n
\n \n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
if person:\n if person:\n
kw[\'default_destination_decision_uid\'] = person.getUid()\n kw[\'default_destination_decision_uid\'] = person.getUid()\n
kw[\'sort_on\'] = [(\'modification_date\', \'DESC\'),]\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 \n
else:\n else:\n
return []\n return []\n
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
web_site = context.getWebSiteValue()\n web_site = context.getWebSiteValue()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
context.REQUEST.set(\'new_support_request\', None)\n
\n \n
support_request_template = portal.restrictedTraverse(\n support_request_template = portal.restrictedTraverse(\n
portal.portal_preferences.getPreferredSupportRequestTemplate())\n portal.portal_preferences.getPreferredSupportRequestTemplate())\n
...@@ -83,7 +84,7 @@ web_message.edit(\n ...@@ -83,7 +84,7 @@ web_message.edit(\n
web_message.stop(comment="Submitted from the web site contact form")\n web_message.stop(comment="Submitted from the web site contact form")\n
\n \n
# Redirect to web site to hide the indexation process\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> </string> </value>
</item> </item>
<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