Commit 19d2fa08 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Do not display closed tickets on Ticket List

    Move closed tickets to a different tab, only "To Reply/Track" is placed on the main list.
parent 73537984
...@@ -133,6 +133,8 @@ url_list = [ ...@@ -133,6 +133,8 @@ url_list = [
"gadget_erp5_page_slap_stop_instance_tree.html", "gadget_erp5_page_slap_stop_instance_tree.html",
"gadget_erp5_page_slap_stop_instance_tree.js", "gadget_erp5_page_slap_stop_instance_tree.js",
"gadget_erp5_page_slap_support_request_view.html", "gadget_erp5_page_slap_support_request_view.html",
"gadget_erp5_page_slap_all_ticket_list.html",
"gadget_erp5_page_slap_all_ticket_list.js",
"gadget_erp5_page_slap_ticket_list.html", "gadget_erp5_page_slap_ticket_list.html",
"gadget_erp5_page_slap_ticket_list.js", "gadget_erp5_page_slap_ticket_list.js",
"gadget_erp5_page_slap_ticket_view.js", "gadget_erp5_page_slap_ticket_view.js",
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Title
data-i18n=Reference
data-i18n=State
data-i18n=Tickets
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Site List</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_slapos_utils.js" type="text/javascript"></script>
<script src="gadget_erp5_page_slap_all_ticket_list.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body>
</html>
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("getTranslationList", "getTranslationList")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function () {
var gadget = this,
lines_limit,
tickets_translation,
translation_list = [
"Title",
"Reference",
"State",
"Tickets"
];
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getSetting("listbox_lines_limit", 20),
window.getSettingMe(gadget)
]);
})
.push(function (setting) {
lines_limit = setting[0];
return RSVP.all([
gadget.getDeclaredGadget('form_list'),
gadget.jio_get(setting[1]),
gadget.getTranslationList(translation_list)
]);
})
.push(function (result) {
var column_list = [
['title', result[2][0]],
['reference', result[2][1]],
['translated_simulation_state_title', result[2][2]]
];
tickets_translation = result[2][3];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"listbox": {
"column_list": column_list,
"show_anchor": 0,
"default_params": {},
"editable": 0,
"editable_column_list": [],
"key": "slap_site_listbox",
"lines": lines_limit,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%20%28%22Support%20Request%22%2C%20%22Upgrade%20Decision%22%2C%20%22Regularisation%20Request%22%29%20AND%20destination_decision_reference%3A" + result[1].reference,
"portal_type": [],
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["modification_date", "Descending"]],
"title": tickets_translation,
"type": "ListBox"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"bottom",
[["listbox"]]
]]
}
});
})
.push(function () {
return gadget.getSetting('frontpage_gadget');
})
.push(function (frontpage_gadget) {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "slap_add_ticket"}}),
gadget.getUrlFor({command: "change", options: {"page": "slap_rss_ticket"}}),
gadget.getUrlFor({command: "change", options: {"page": frontpage_gadget}}),
gadget.updatePanel({jio_key: "support_request_module"}),
gadget.getUrlFor({command: "change", options: {"page": "slap_ticket_list"}})
]);
})
.push(function (result) {
return gadget.updateHeader({
page_title: tickets_translation,
filter_action: true,
selection_url: result[2],
tab_url: result[4],
add_url: result[0],
rss_url: result[1]
});
});
});
}(window, rJS, RSVP));
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<string>Associate</string> <string>Associate</string>
<string>Auditor</string> <string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -59,7 +58,6 @@ ...@@ -59,7 +58,6 @@
<string>Associate</string> <string>Associate</string>
<string>Auditor</string> <string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -191,7 +189,7 @@ ...@@ -191,7 +189,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1508398078.97</float> <float>1668201861.78</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -71,7 +71,10 @@ ...@@ -71,7 +71,10 @@
"key": "slap_site_listbox", "key": "slap_site_listbox",
"lines": lines_limit, "lines": lines_limit,
"list_method": "portal_catalog", "list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%20%28%22Support%20Request%22%2C%20%22Upgrade%20Decision%22%2C%20%22Regularisation%20Request%22%29%20AND%20destination_decision_reference%3A" + result[1].reference, "query": "urn:jio:allDocs?query=portal_type%3A%20%28%22Support%20Request%22%2C%20%" +
"22Upgrade%20Decision%22%2C%20%22Regularisation%20Request%22%29%20AND%20" +
"simulation_state%3A%20%28%22suspended%22%2C%20%22validated%22%2C%20%22confirmed%22%2C%20%22started%22%29%20AND%20" +
"destination_decision_reference%3A" + result[1].reference,
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": column_list,
"sort_column_list": column_list, "sort_column_list": column_list,
...@@ -103,7 +106,8 @@ ...@@ -103,7 +106,8 @@
gadget.getUrlFor({command: "change", options: {"page": "slap_add_ticket"}}), gadget.getUrlFor({command: "change", options: {"page": "slap_add_ticket"}}),
gadget.getUrlFor({command: "change", options: {"page": "slap_rss_ticket"}}), gadget.getUrlFor({command: "change", options: {"page": "slap_rss_ticket"}}),
gadget.getUrlFor({command: "change", options: {"page": frontpage_gadget}}), gadget.getUrlFor({command: "change", options: {"page": frontpage_gadget}}),
gadget.updatePanel({jio_key: "support_request_module"}) gadget.updatePanel({jio_key: "support_request_module"}),
gadget.getUrlFor({command: "change", options: {"page": 'slap_all_ticket_list'}})
]); ]);
}) })
.push(function (result) { .push(function (result) {
...@@ -113,6 +117,7 @@ ...@@ -113,6 +117,7 @@
selection_url: result[2], selection_url: result[2],
add_url: result[0], add_url: result[0],
rss_url: result[1], rss_url: result[1],
list_all_url: result[4]
}); });
}); });
}); });
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<string>Associate</string> <string>Associate</string>
<string>Auditor</string> <string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -59,7 +58,6 @@ ...@@ -59,7 +58,6 @@
<string>Associate</string> <string>Associate</string>
<string>Auditor</string> <string>Auditor</string>
<string>Manager</string> <string>Manager</string>
<string>Owner</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -187,7 +185,7 @@ ...@@ -187,7 +185,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1508398046.04</float> <float>1668194508.48</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -236,7 +234,7 @@ ...@@ -236,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1001.59377.44199.3498</string> </value> <value> <string>1004.16914.46845.35908</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +252,7 @@ ...@@ -254,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1659068844.09</float> <float>1668203512.68</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -39,6 +39,8 @@ web_page_module/rjs_gadget_erp5_page_slap_add_ticket_html ...@@ -39,6 +39,8 @@ web_page_module/rjs_gadget_erp5_page_slap_add_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_add_ticket_js web_page_module/rjs_gadget_erp5_page_slap_add_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_html web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_js web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_js
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_compute_node_get_token_html web_page_module/rjs_gadget_erp5_page_slap_compute_node_get_token_html
......
...@@ -36,6 +36,8 @@ web_page_module/rjs_gadget_erp5_page_slap_add_ticket_html ...@@ -36,6 +36,8 @@ web_page_module/rjs_gadget_erp5_page_slap_add_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_add_ticket_js web_page_module/rjs_gadget_erp5_page_slap_add_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_html web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_js web_page_module/rjs_gadget_erp5_page_slap_all_invoice_list_js
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_html
web_page_module/rjs_gadget_erp5_page_slap_all_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html web_page_module/rjs_gadget_erp5_page_slap_close_ticket_html
web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js
web_page_module/rjs_gadget_erp5_page_slap_compute_node_get_token_html web_page_module/rjs_gadget_erp5_page_slap_compute_node_get_token_html
......
...@@ -509,6 +509,18 @@ ...@@ -509,6 +509,18 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td colspan="3"><b tal:content="python: 'Click on Show all'"> Menu Item </b></td>
</tr>
<tal:block define="menu_action python: 'Show all'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'}; <tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})"> dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
......
...@@ -346,7 +346,19 @@ ...@@ -346,7 +346,19 @@
<tal:block define="menu_item python: 'Tickets'; header menu_item"> <tal:block define="menu_item python: 'Tickets'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td colspan="3"><b tal:content="python: 'Click on Show all'"> Menu Item </b></td>
</tr>
<tal:block define="menu_action python: 'Show all'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'}; <tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})"> dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
......
...@@ -284,8 +284,21 @@ ...@@ -284,8 +284,21 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(0)', 'footer': 'No records'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td colspan="3"><b tal:content="python: 'Click on Show all'"> Menu Item </b></td>
</tr>
<tal:block define="menu_action python: 'Show all'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'}; <tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})"> dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block> </tal:block>
......
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