From 83b27eb5da4ed4474dac28227b9d4f1adf22b87a Mon Sep 17 00:00:00 2001
From: Boxiang Sun <boxiang.sun@nexedi.com>
Date: Wed, 27 Sep 2017 01:35:37 +0200
Subject: [PATCH] erp5_officejs_support_request_ui: Add worklist to the
 homepage and remove child changeState calls

This commit contains two main changes:
- Add worklist gadget to the homepage.
- Remove the child's `changeState` calls in homepage.
  This was done by using customized `form_list_sr`. Which can let the listbox
  has same appearance like `form_view` but use same argument passing mechanism
  as `form_list`.
---
 ...portrequest_erp5_pt_form_list_sr_html.html |  31 ++
 ...pportrequest_erp5_pt_form_list_sr_html.xml | 324 ++++++++++++++++++
 ..._supportrequest_erp5_pt_form_list_sr_js.js |  76 ++++
 ...supportrequest_erp5_pt_form_list_sr_js.xml | 320 +++++++++++++++++
 .../gadget_supportrequest_homepage_css.css    |   5 +
 .../gadget_supportrequest_homepage_css.xml    |   4 +-
 .../gadget_supportrequest_homepage_html.html  |   2 +
 .../gadget_supportrequest_homepage_html.xml   |   4 +-
 .../gadget_supportrequest_homepage_js.js      | 118 +++----
 .../gadget_supportrequest_homepage_js.xml     |   4 +-
 ...get_supportrequest_page_worklist_html.html |  39 +++
 ...dget_supportrequest_page_worklist_html.xml | 324 ++++++++++++++++++
 .../gadget_supportrequest_page_worklist_js.js | 101 ++++++
 ...gadget_supportrequest_page_worklist_js.xml | 320 +++++++++++++++++
 ...questModule_viewLastSupportRequestList.xml |   2 +-
 .../form_list_sr.xml                          |  58 ++++
 .../form_list_sr.zpt                          |  16 +
 17 files changed, 1680 insertions(+), 68 deletions(-)
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.html
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.xml
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.js
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.xml
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js
 create mode 100644 bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml
 create mode 100644 bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.xml
 create mode 100644 bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.zpt

diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.html b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.html
new file mode 100644
index 0000000000..ddb4ee1de2
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+    <meta name="viewport" content="width=device-width, user-scalable=no" />
+    <title>ERP5 PT Form List</title>
+
+    <!-- renderjs -->
+    <script src="rsvp.js" type="text/javascript"></script>
+    <script src="renderjs.js" type="text/javascript"></script>
+
+    <!-- custom script -->
+    <script src="gadget_erp5_global.js" type="text/javascript"></script>
+    <script src="gadget_erp5_pt_form_list_sr.js" type="text/javascript"></script>
+
+  </head>
+  <body>
+
+    <!-- XXX action, method, fieldset -->
+    <form class="dialog_form">
+      <button type="submit" class="ui-btn ui-btn-b ui-btn-inline
+        ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
+
+      <div data-gadget-url="gadget_erp5_form.html"
+              data-gadget-scope="erp5_form"
+              data-gadget-sandbox="public"></div>
+
+    </form>
+
+  </body>
+</html>
\ No newline at end of file
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.xml
new file mode 100644
index 0000000000..46238ef05c
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_html.xml
@@ -0,0 +1,324 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Web Page" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Change_local_roles_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_md5</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>gadget_erp5_pt_form_list_sr.html</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>gadget_supportrequest_erp5_pt_form_list_sr_html</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value> <string>en</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Web Page</string> </value>
+        </item>
+        <item>
+            <key> <string>short_title</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Gadget ERP5 Form List SupportRequest</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>001</string> </value>
+        </item>
+        <item>
+            <key> <string>workflow_history</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>document_publication_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>edit_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>processing_status_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>publish_alive</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506007116.54</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+            <item>
+                <key> <string>validation_state</string> </key>
+                <value> <string>published_alive</string> </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>edit</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value>
+                  <none/>
+                </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>962.15770.42024.56900</string> </value>
+            </item>
+            <item>
+                <key> <string>state</string> </key>
+                <value> <string>current</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506095929.53</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>detect_converted_file</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>external_processing_state</string> </key>
+                <value> <string>converted</string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>0.0.0.0</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506007006.41</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.js
new file mode 100644
index 0000000000..e61a0dc47b
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.js
@@ -0,0 +1,76 @@
+/*global window, rJS, RSVP, calculatePageTitle */
+/*jslint nomen: true, indent: 2, maxerr: 3 */
+(function (window, rJS, RSVP, calculatePageTitle) {
+  "use strict";
+
+  rJS(window)
+    /////////////////////////////////////////////////////////////////
+    // Acquired methods
+    /////////////////////////////////////////////////////////////////
+    .declareAcquiredMethod("updateHeader", "updateHeader")
+    .declareAcquiredMethod("getUrlFor", "getUrlFor")
+    .declareAcquiredMethod("redirect", "redirect")
+    .declareAcquiredMethod("getUrlParameter", "getUrlParameter")
+    .declareAcquiredMethod("renderEditorPanel", "renderEditorPanel")
+
+    /////////////////////////////////////////////////////////////////
+    // Proxy methods to the child gadget
+    /////////////////////////////////////////////////////////////////
+    .declareMethod('checkValidity', function () {
+      return this.getDeclaredGadget("erp5_form")
+        .push(function (declared_gadget) {
+          return declared_gadget.checkValidity();
+        });
+    })
+    .declareMethod('getContent', function () {
+      return this.getDeclaredGadget("erp5_form")
+        .push(function (declared_gadget) {
+          return declared_gadget.getContent();
+        });
+    })
+    /////////////////////////////////////////////////////////////////
+    // declared methods
+    /////////////////////////////////////////////////////////////////
+    .declareMethod('render', function (options) {
+      var gadget = this;
+      return gadget.getUrlParameter('extended_search')
+        .push(function (extended_search) {
+          var state_dict = {
+            jio_key: options.jio_key,
+            view: options.view,
+            editable: options.editable,
+            erp5_document: options.erp5_document,
+            form_definition: options.form_definition,
+            erp5_form: options.erp5_form || {},
+            extended_search: extended_search
+          };
+          return gadget.changeState(state_dict);
+        });
+    })
+
+    .onStateChange(function () {
+      var form_gadget = this;
+
+      // render the erp5 form
+      return form_gadget.getDeclaredGadget("erp5_form")
+        .push(function (erp5_form) {
+          var form_options = form_gadget.state.erp5_form;
+
+          form_options.erp5_document = form_gadget.state.erp5_document;
+          form_options.form_definition = form_gadget.state.form_definition;
+          form_options.view = form_gadget.state.view;
+          form_options.jio_key = form_gadget.state.jio_key;
+          form_options.editable = form_gadget.state.editable;
+
+          // XXX Hardcoded for listbox's hide functionality
+          form_options.form_definition.hide_enabled = true;
+
+          // XXX not generic, fix later
+          if (form_gadget.state.extended_search) {
+            form_options.form_definition.extended_search = form_gadget.state.extended_search;
+          }
+
+          return erp5_form.render(form_options);
+        })
+    })
+}(window, rJS, RSVP, calculatePageTitle));
\ No newline at end of file
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.xml
new file mode 100644
index 0000000000..f113587920
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_erp5_pt_form_list_sr_js.xml
@@ -0,0 +1,320 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Web Script" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Change_local_roles_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_md5</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>gadget_erp5_pt_form_list_sr.js</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>gadget_supportrequest_erp5_pt_form_list_sr_js</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value> <string>en</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Web Script</string> </value>
+        </item>
+        <item>
+            <key> <string>short_title</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Gadget ERP5 Form List SupportRequest JS</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>001</string> </value>
+        </item>
+        <item>
+            <key> <string>workflow_history</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>document_publication_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>edit_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>processing_status_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>publish_alive</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506006406.13</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+            <item>
+                <key> <string>validation_state</string> </key>
+                <value> <string>published_alive</string> </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>edit</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value>
+                  <none/>
+                </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>962.15754.50465.63112</string> </value>
+            </item>
+            <item>
+                <key> <string>state</string> </key>
+                <value> <string>current</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506007912.91</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>detect_converted_file</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>external_processing_state</string> </key>
+                <value> <string>converted</string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>0.0.0.0</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506006072.01</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.css b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.css
index e3ac5290a4..7f61f1537a 100644
--- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.css
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.css
@@ -52,4 +52,9 @@ button:disabled{
 
 input[type="submit"] {
   -webkit-appearance: none;
+}
+
+.worklist-title {
+  color: #777777;
+  margin-top: 10px;
 }
\ No newline at end of file
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.xml
index fbe7068732..327055259a 100644
--- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.xml
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_css.xml
@@ -242,7 +242,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.1022.173.35635</string> </value>
+                <value> <string>962.1250.5215.15667</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -260,7 +260,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1505136124.72</float>
+                        <float>1505897718.64</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.html b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.html
index 3ebf3f72eb..ec2c851672 100644
--- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.html
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.html
@@ -44,6 +44,8 @@
       </div>
       <div data-gadget-url="gadget_erp5_page_form.html" data-gadget-scope="last"></div>
 
+      <h1 data-i18n="Support Requests" class="ui-title ui-override-theme worklist-title">Support Requests WorkList</h1>
+      <div data-gadget-url="gadget_supportrequest_page_worklist.html" data-gadget-scope="worklist"></div>
     </form>
   </body>
 </html>
\ No newline at end of file
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.xml
index 347cd437d9..646a73e0d5 100644
--- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.xml
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_html.xml
@@ -234,7 +234,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.1011.37939.53486</string> </value>
+                <value> <string>962.17075.21280.35942</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -252,7 +252,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1505136135.97</float>
+                        <float>1506095040.88</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
index 716f4231c9..d81aa4c2f3 100644
--- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
@@ -65,12 +65,16 @@
     })
     .allowPublicAcquisition("chartItemClick", function (params) {
       var gadget = this;
-      return gadget.getDeclaredGadget("last")
-        .push(function () {
-          return gadget.getSearchCriteria(params[0][0], params[0][1])
-            .push(function (search_criteria) {
-              gadget.changeState({extended_search: search_criteria});
-            });
+
+      return gadget.getSearchCriteria(params[0][0], params[0][1])
+        .push(function (result) {
+          return gadget.redirect({command: 'change', options: {extended_search: result}});
+        })
+        .push(undefined, function (error) {
+          if (error instanceof RSVP.CancellationError) {
+            return;
+          }
+          throw error;
         })
         .push(function () {
           var restore = document.getElementById("restoreButton");
@@ -232,63 +236,49 @@
           });
         });
     })
-    .onStateChange(function (modification_dict) {
+    .onStateChange(function () {
       var gadget = this,
         queue = new RSVP.Queue();
-      if (modification_dict.hasOwnProperty("extended_search")) {
-        // render the erp5 form
-        queue
-          .push(function () {
-            return gadget.getDeclaredGadget("last");
-          })
-          .push(function (result_list) {
-            var erp5_form = result_list,
-              tmp;
 
-            tmp = JSON.parse(erp5_form.state.erp5_form);
-            tmp.extended_search = modification_dict.extended_search;
-
-            return erp5_form.changeState({erp5_form: JSON.stringify(tmp)});
-          });
-      }
-      if (modification_dict.hasOwnProperty("render")) {
-        queue
-          .push(function () {
-            return RSVP.all([
-              gadget.jio_getAttachment("support_request_module", "links"),
-              gadget.getDeclaredGadget("last")
-            ]);
-          })
-          .push(function (result_list) {
-            var i,
-              erp5_document = result_list[0],
-              view_list = erp5_document._links.action_object_view || [],
-              last_href;
+      queue
+        .push(function () {
+          return RSVP.all([
+            gadget.jio_getAttachment("support_request_module", "links"),
+            gadget.getDeclaredGadget("worklist"),
+            gadget.getUrlParameter('field_listbox_begin_from')
+          ]);
+        })
+        .push(function (result_list) {
+          var i,
+            erp5_document = result_list[0],
+            view_list = erp5_document._links.action_object_view || [],
+            last_href;
 
-            if (view_list.constructor !== Array) {
-              view_list = [view_list];
-            }
+          if (view_list.constructor !== Array) {
+            view_list = [view_list];
+          }
 
-            for (i = 0; i < view_list.length; i += 1) {
-              if (view_list[i].name === 'view_last_support_request') {
-                last_href = view_list[i].href;
-              }
+          for (i = 0; i < view_list.length; i += 1) {
+            if (view_list[i].name === 'view_last_support_request') {
+              last_href = view_list[i].href;
             }
+          }
 
-            if (last_href === undefined) {
-              throw new Error('Cant find the list document view');
-            }
-            gadget.property_dict.option_dict = {
-              graph_gadget: "unsafe/gadget_field_graph_echarts.html",
-              listbox_gadget: last_href,
-              listbox_jio_key: "support_request_module"
-            };
+          if (last_href === undefined) {
+            throw new Error('Cant find the list document view');
+          }
+          gadget.property_dict.option_dict = {
+            graph_gadget: "unsafe/gadget_field_graph_echarts.html",
+            listbox_gadget: last_href,
+            listbox_jio_key: "support_request_module",
+            field_listbox_begin_from: result_list[2]
+          };
 
-            return RSVP.all([
-              gadget.renderGraph() //Launched as service, not blocking
-            ]);
-          });
-      }
+          return RSVP.all([
+            result_list[1].render(),
+            gadget.renderGraph() //Launched as service, not blocking
+          ]);
+        });
       return queue;
     })
     .onEvent('change', function (evt) {
@@ -319,13 +309,19 @@
     }, false, false)
     .onEvent('click', function (event) {
       var gadget = this, rss_link = gadget.element.querySelector("#generate-rss"),
-        generate_button = gadget.element.querySelector("#generateRSS");
+        generate_button = gadget.element.querySelector("#generateRSS"),
+        restore = document.getElementById("restoreButton");
 
       if (event.target.id === "restoreButton") {
-        return gadget.changeState({extended_search: null})
-          .push(function () {
-            var restore = document.getElementById("restoreButton");
-            restore.setAttribute("disabled", "disabled");
+        restore.setAttribute("disabled", "disabled");
+
+        return gadget.getDeclaredGadget("last")
+          .push(function (listbox) {
+            return listbox.render({
+              jio_key: gadget.property_dict.option_dict.listbox_jio_key,
+              view: gadget.property_dict.option_dict.listbox_gadget,
+              extended_search: null
+            });
           });
       }
 
@@ -383,4 +379,4 @@
         });
     });
 
-}(window, rJS, RSVP));
\ No newline at end of file
+}(window, rJS, RSVP));
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml
index e35c20053f..29943babf5 100644
--- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml
@@ -236,7 +236,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.5582.22272.14165</string> </value>
+                <value> <string>962.17232.34531.58794</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -254,7 +254,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1505396121.35</float>
+                        <float>1506095076.51</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html
new file mode 100644
index 0000000000..8881a59e84
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<!--
+  data-i18n=Worklist
+  data-i18n=All work caught up!
+-->
+  <head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+    <meta name="viewport" content="width=device-width, user-scalable=no" />
+    <title>ERP5 Page Worklist</title>
+
+    <!-- renderjs -->
+    <script src="rsvp.js" type="text/javascript"></script>
+    <script src="renderjs.js" type="text/javascript"></script>
+    <script src="handlebars.js" type="text/javascript"></script>
+    <script src="jiodev.js" type="text/javascript"></script>
+
+    <!-- custom script -->
+    <script src="gadget_global.js" type="text/javascript"></script>
+    <script src="gadget_supportrequest_page_worklist.js" type="text/javascript"></script>
+
+    <!-- XXX must set theme here! -->
+    <script id="table-template" type="text/x-handlebars-template">
+      {{#if document_list }}
+      <ul data-role="listview" data-theme="c" class="document-listview ui-listview-inset ui-corner-all">
+        {{#each document_list}}
+          <li class="ui-li-has-count" data-icon="false" ><a class="ui-body-inherit" href="{{link}}">{{title}} <span class="ui-li-count">{{count}}</span></a></li>
+        {{/each}}
+      </ul>
+      {{else}}
+        <p>All work caught up!</p>
+      {{/if}}
+    </script>
+
+  </head>
+  <body>
+    <section class="document_list"></section>
+  </body>
+</html>
\ No newline at end of file
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml
new file mode 100644
index 0000000000..0f4133ebb7
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml
@@ -0,0 +1,324 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Web Page" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Change_local_roles_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_md5</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>gadget_supportrequest_page_worklist.html</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>gadget_supportrequest_page_worklist_html</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value> <string>en</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Web Page</string> </value>
+        </item>
+        <item>
+            <key> <string>short_title</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Gadget Support Request Worklist</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>001</string> </value>
+        </item>
+        <item>
+            <key> <string>workflow_history</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>document_publication_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>edit_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>processing_status_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>publish_alive</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1505751029.89</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+            <item>
+                <key> <string>validation_state</string> </key>
+                <value> <string>published_alive</string> </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>edit</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value>
+                  <none/>
+                </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>962.24219.1265.43878</string> </value>
+            </item>
+            <item>
+                <key> <string>state</string> </key>
+                <value> <string>current</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506514266.01</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>detect_converted_file</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>external_processing_state</string> </key>
+                <value> <string>converted</string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>0.0.0.0</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1505750967.39</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js
new file mode 100644
index 0000000000..a2f122f1fb
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js
@@ -0,0 +1,101 @@
+/*global window, rJS, RSVP, Handlebars, URI */
+/*jslint nomen: true, indent: 2, maxerr: 3 */
+(function (window, rJS, RSVP, Handlebars, URI) {
+  "use strict";
+
+  /////////////////////////////////////////////////////////////////
+  // Handlebars
+  /////////////////////////////////////////////////////////////////
+  // Precompile the templates while loading the first gadget instance
+  var gadget_klass = rJS(window),
+    source = gadget_klass.__template_element
+                         .getElementById("table-template")
+                         .innerHTML,
+    table_template = Handlebars.compile(source);
+
+  gadget_klass
+    /////////////////////////////////////////////////////////////////
+    // Acquired methods
+    /////////////////////////////////////////////////////////////////
+    .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
+    .declareAcquiredMethod("translateHtml", "translateHtml")
+    .declareAcquiredMethod("updateHeader", "updateHeader")
+    .declareAcquiredMethod("getUrlFor", "getUrlFor")
+
+    /////////////////////////////////////////////////////////////////
+    // declared methods
+    /////////////////////////////////////////////////////////////////
+    .declareMethod("render", function () {
+      var gadget = this;
+
+      return gadget.updateHeader({
+        page_title: 'Worklist',
+        page_icon: 'clipboard'
+      })
+        .push(function () {
+          return gadget.jio_getAttachment(
+            'portal_workflow',
+            'links'
+          );
+        })
+        .push(function (result) {
+          return gadget.jio_getAttachment(
+            // result.data.rows[0].id,
+            'portal_workflow',
+            result._links.action_worklist.href
+          );
+        })
+        .push(function (links) {
+          /*jslint continue:true*/
+          var action_list = links.worklist,
+            query_string,
+            promise_list = [],
+            display_options,
+            i;
+          for (i = 0; i < action_list.length; i += 1) {
+            query_string = new URI(action_list[i].href).query(true).query;
+            if (query_string.indexOf('portal_type:"Support Request"') === -1) {
+              continue;
+            }
+            display_options = {extended_search: query_string};
+
+            if (action_list[i].hasOwnProperty('module')) {
+              display_options = {
+                jio_key: new URI(action_list[i].module).segment(2),
+                extended_search: query_string,
+                page: 'form',
+                view: 'view'
+              };
+            } else {
+              display_options = {
+                extended_search: query_string,
+                page: 'search'
+              };
+            }
+            promise_list.push(RSVP.all([
+              gadget.getUrlFor({command: 'display', options: display_options}),
+              // Remove the counter from the title
+              action_list[i].name,
+              action_list[i].count
+            ]));
+
+          }
+          return RSVP.all(promise_list);
+        })
+        .push(function (result_list) {
+          var line_list = [],
+            i;
+          for (i = 0; i < result_list.length; i += 1) {
+            line_list.push({
+              link: result_list[i][0],
+              title: result_list[i][1],
+              count: result_list[i][2]
+            });
+          }
+          gadget.element.querySelector('.document_list').innerHTML = table_template({
+            document_list: line_list
+          });
+        });
+    });
+
+}(window, rJS, RSVP, Handlebars, URI));
\ No newline at end of file
diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml
new file mode 100644
index 0000000000..42fcbccf4c
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml
@@ -0,0 +1,320 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Web Script" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Change_local_roles_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+                <string>Owner</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_md5</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>gadget_supportrequest_page_worklist.js</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>gadget_supportrequest_page_worklist_js</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value> <string>en</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Web Script</string> </value>
+        </item>
+        <item>
+            <key> <string>short_title</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Gadget Support Request Worklist JS</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>001</string> </value>
+        </item>
+        <item>
+            <key> <string>workflow_history</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>document_publication_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>edit_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>processing_status_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>publish_alive</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1505751027.6</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+            <item>
+                <key> <string>validation_state</string> </key>
+                <value> <string>published_alive</string> </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>edit</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value>
+                  <none/>
+                </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>962.13948.13888.3242</string> </value>
+            </item>
+            <item>
+                <key> <string>state</string> </key>
+                <value> <string>current</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1506505200.17</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
+    </pickle>
+    <pickle>
+      <tuple>
+        <none/>
+        <list>
+          <dictionary>
+            <item>
+                <key> <string>action</string> </key>
+                <value> <string>detect_converted_file</string> </value>
+            </item>
+            <item>
+                <key> <string>actor</string> </key>
+                <value> <string>zope</string> </value>
+            </item>
+            <item>
+                <key> <string>comment</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>error_message</string> </key>
+                <value> <string></string> </value>
+            </item>
+            <item>
+                <key> <string>external_processing_state</string> </key>
+                <value> <string>converted</string> </value>
+            </item>
+            <item>
+                <key> <string>serial</string> </key>
+                <value> <string>0.0.0.0</string> </value>
+            </item>
+            <item>
+                <key> <string>time</string> </key>
+                <value>
+                  <object>
+                    <klass>
+                      <global name="DateTime" module="DateTime.DateTime"/>
+                    </klass>
+                    <tuple>
+                      <none/>
+                    </tuple>
+                    <state>
+                      <tuple>
+                        <float>1505750961.95</float>
+                        <string>UTC</string>
+                      </tuple>
+                    </state>
+                  </object>
+                </value>
+            </item>
+          </dictionary>
+        </list>
+      </tuple>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_viewLastSupportRequestList.xml b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_viewLastSupportRequestList.xml
index 0aac96807a..5c95642910 100644
--- a/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_viewLastSupportRequestList.xml
+++ b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_viewLastSupportRequestList.xml
@@ -128,7 +128,7 @@
         </item>
         <item>
             <key> <string>pt</string> </key>
-            <value> <string>form_view</string> </value>
+            <value> <string>form_list_sr</string> </value>
         </item>
         <item>
             <key> <string>row_length</string> </key>
diff --git a/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.xml b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.xml
new file mode 100644
index 0000000000..6830125a5f
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>form_list_sr</string> </value>
+        </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <unicode></unicode> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.zpt b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.zpt
new file mode 100644
index 0000000000..cf2135e69d
--- /dev/null
+++ b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/form_list_sr.zpt
@@ -0,0 +1,16 @@
+<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
+           xmlns:metal="http://xml.zope.org/namespaces/metal"
+           xmlns:i18n="http://xml.zope.org/namespaces/i18n">
+<!--
+  The "form_list_sr.apt" is exactly same as "form_list.apt".
+  The differences between these two page tempalte is the "form_list_sr"
+  removed the search field in its html definition. Use the customized
+  "form_list" because we want the listbox gadget has same appearance like
+  "form_view" but keep the argument pass mechanism of "form_list".
+-->
+  <tal:block metal:use-macro="here/list_main/macros/master">
+    <tal:block metal:fill-slot="main">
+      <tal:block metal:use-macro="here/form_render/macros/master" />
+    </tal:block>
+  </tal:block>
+</tal:block>
\ No newline at end of file
-- 
2.30.9