Commit 281eb936 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Initial implementation of Graphic Gadget

* Render graphics in RJS without code
* Supporting the generation of bar graphics using domains
* Build graphics from listbox

The idea is get more information from listbox and make the script a bit smarter
parent 9f5d4256
import random
from DateTime import DateTime
from datetime import timedelta
portal = context.getPortalObject()
now = DateTime().asdatetime()
text_list = [
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?",
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?",
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.",
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."
]
title_list = [
"The standard Lorem Ipsum passage, used since the 1500s",
"Section 1.10.32 of 'de Finibus Bonorum et Malorum', written by Cicero in 45 BC",
"1914 translation by H. Rackham",
"Section 1.10.33 of 'de Finibus Bonorum et Malorum', written by Cicero in 45 BC",
"1915 translation by H. Rackham",
"1916 translation by H. Rackham"
]
portal.portal_caches.clearAllCache()
resource_list = [
"erp5_officejs_support_request_ui_test_service_001",
"erp5_officejs_support_request_ui_test_service_002",
"erp5_officejs_support_request_ui_test_service_003",
"erp5_officejs_support_request_ui_test_service_004",
]
for _ in range(amount):
support_request = portal.support_request_module.newContent(
portal_type='Support Request',
title=random.choice(title_list),
start_date=DateTime(now - timedelta(days=random.choice(range(1, 100)))),
resource_value=getattr(portal.service_module, random.choice(resource_list)),
source_project_value=portal.project_module.erp5_officejs_support_request_ui_test_project_001,
)
support_request.submit()
if random.choice([True, False]):
support_request.validate()
if random.choice([True, False]):
support_request.invalidate()
elif random.choice([True, False]):
support_request.suspend()
portal.post_module.PostModule_createHTMLPostForSupportRequest(
follow_up=support_request.getRelativeUrl(),
predecessor=None,
data=random.choice(text_list),
file=None,
web_site_relative_url=portal.web_site_module.erp5_officejs_support_request_ui.getRelativeUrl(),
)
if len(portal.support_request_module.contentIds()) < limit:
# Use after_method_id just to not kill the dev instance
return portal.support_request_module.activate(after_method_id=(
'recursiveImmediateReindexObject',
'immediateReindexObject',
'Post_ingestMailMessageForSupportRequest',
"searchAndActivate")).ERP5Site_createMassiveSupportRequestDataSet(amount, limit)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>amount=10, limit=10</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_createMassiveSupportRequestDataSet</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>generic_report_module_by_state</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>100.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Report Module by state</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object.absolute_url() + "/Base_viewModuleStatisticsReport"</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: getattr(object, "isModuleType", False) and object.isModuleType() or False</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Domain" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_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>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateDeliveryStartDateDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>graphic_gadget_delivery_start_date_domain</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Graphic Gadget Delivery Start Date Domain</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
if (!rendered_document.hasOwnProperty(field_name)) { if (!rendered_document.hasOwnProperty(field_name)) {
return; return;
} }
suboptions = { suboptions = {
hide_enabled: form_definition.hide_enabled, // listbox specific hide_enabled: form_definition.hide_enabled, // listbox specific
configure_enabled: form_definition.configure_enabled, // listbox specific configure_enabled: form_definition.configure_enabled, // listbox specific
extended_search: (is_first_bottom_listbox && (form_definition.extended_search)), // searchfield specific extended_search: (is_first_bottom_listbox && (form_definition.extended_search)), // searchfield specific
field_type: rendered_document[field_name].type, field_type: rendered_document[field_name].type,
label: ((group_name !== "bottom") && (rendered_document[field_name].title.length > 0)), // no label for bottom group and field without title label: ((group_name !== "bottom") && (rendered_document[field_name].title.length > 0)), // no label for bottom group and field without title
field_json: rendered_document[field_name] // pass field_json: rendered_document[field_name], // pass
jio_key: modification_dict.jio_key,
enable_graphic: modification_dict.enable_graphic
}; };
// XXX: what is the purpose of this? // XXX: what is the purpose of this?
...@@ -186,10 +187,10 @@ ...@@ -186,10 +187,10 @@
if (options.form_definition.hasOwnProperty("edit_form_update_href")) { if (options.form_definition.hasOwnProperty("edit_form_update_href")) {
hash += "edit_form_update_action"; hash += "edit_form_update_action";
} }
return this.changeState({ return this.changeState({
erp5_document: options.erp5_document, erp5_document: options.erp5_document,
form_definition: options.form_definition, form_definition: options.form_definition,
enable_graphic: options.enable_graphic,
jio_key: options.jio_key, jio_key: options.jio_key,
hash: hash, hash: hash,
view: options.view, view: options.view,
...@@ -299,6 +300,15 @@ ...@@ -299,6 +300,15 @@
begin_from: 0 begin_from: 0
}; };
}, {mutex: 'changestate'}) }, {mutex: 'changestate'})
.declareMethod("getGraphicType", function () {
var gadget = this;
if (gadget.props.listbox_gadget) {
return gadget.props.listbox_gadget.getGraphicType();
}
return;
}, {mutex: 'changestate'})
.declareMethod("getContent", function (options) { .declareMethod("getContent", function (options) {
var form_gadget = this, var form_gadget = this,
k, k,
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>991.26405.47.57924</string> </value> <value> <string>997.49201.45822.48315</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1618519262.64</float> <float>1643133280.23</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -337,6 +337,14 @@ ...@@ -337,6 +337,14 @@
}); });
}, {mutex: 'changestate'}) }, {mutex: 'changestate'})
.declareMethod('getGraphicType', function getGraphicType() {
var argument_list = arguments;
return this.getDeclaredGadget(SCOPE)
.push(function (gadget) {
return gadget.getGraphicType.apply(gadget, argument_list);
});
}, {mutex: 'changestate'})
.allowPublicAcquisition("notifyFocus", function notifyFocus() { .allowPublicAcquisition("notifyFocus", function notifyFocus() {
return this.changeState({display_error_text: true}); return this.changeState({display_error_text: true});
}) })
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>991.31753.10689.19694</string> </value> <value> <string>997.7172.17438.7031</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1618839010.44</float> <float>1643134111.55</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</head> </head>
<body> <body>
<div class="document_table"> <div class="graphic_section"></div>
</div> <div class="document_table"></div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>993.55171.44758.6877</string> </value> <value> <string>994.9738.18277.17732</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1628545474.29</float> <float>1629923258.92</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>994.13949.44825.36573</string> </value> <value> <string>997.50830.31540.53299</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1629394496.1</float> <float>1643230974.76</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -1212,12 +1212,6 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1212,12 +1212,6 @@ div[data-gadget-scope='header'] .ui-header ul {
flex: 7; flex: 7;
} }
} }
.gadget-content .bottom iframe {
height: 80vh;
}
.gadget-content .bottom div[data-gadget-url$="gadget_erp5_field_listbox.html"] iframe {
height: 30vh;
}
.gadget-content form .ui-field-contain { .gadget-content form .ui-field-contain {
position: relative; position: relative;
} }
...@@ -1375,6 +1369,14 @@ div[data-gadget-scope='erp5_searchfield'] div.search_parsed_value button { ...@@ -1375,6 +1369,14 @@ div[data-gadget-scope='erp5_searchfield'] div.search_parsed_value button {
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis; -ms-text-overflow: ellipsis;
} }
div[data-gadget-scope='field_listbox'] .graphic_section {
text-align: center;
padding-bottom: 0.3em;
}
div[data-gadget-scope='field_listbox'] .graphic_section select {
width: 50%;
font-size: 12pt;
}
.document_table .ui-table-header { .document_table .ui-table-header {
display: flex; display: flex;
padding-top: 3pt; padding-top: 3pt;
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>990.6663.38009.56354</string> </value> <value> <string>994.39809.40344.18312</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1613660719.23</float> <float>1630946631.88</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
<!-- XXX action, method, fieldset --> <!-- XXX action, method, fieldset -->
<form> <form>
<button type="submit" class="ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button> <button type="submit" class="ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_searchfield.html" <div data-gadget-url="gadget_erp5_searchfield.html"
data-gadget-scope="erp5_searchfield" data-gadget-scope="erp5_searchfield"
data-gadget-sandbox="public"></div> data-gadget-sandbox="public"></div>
...@@ -41,6 +40,5 @@ ...@@ -41,6 +40,5 @@
data-gadget-sandbox="public"></div> data-gadget-sandbox="public"></div>
</form> </form>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.48720.1486.39116</string> </value> <value> <string>997.39276.32766.15104</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1554191230.42</float> <float>1642645073.04</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, renderFormViewHeader, renderFormListHeader, /*global window, rJS, renderFormViewHeader, renderFormListHeader,
SimpleQuery, ComplexQuery, SimpleQuery, ComplexQuery,
Query, QueryFactory, ensureArray, triggerListboxClipboardAction, Query, QueryFactory, ensureArray, triggerListboxClipboardAction,
declareGadgetClassCanHandleListboxClipboardAction*/ declareGadgetClassCanHandleListboxClipboardAction, RSVP*/
/*jslint nomen: true, indent: 2, maxerr: 3, continue: true */ /*jslint nomen: true, indent: 2, maxerr: 3, continue: true */
(function (window, rJS, renderFormViewHeader, renderFormListHeader, (function (window, rJS, renderFormViewHeader, renderFormListHeader,
SimpleQuery, ComplexQuery, SimpleQuery, ComplexQuery,
Query, QueryFactory, ensureArray, triggerListboxClipboardAction, Query, QueryFactory, ensureArray, triggerListboxClipboardAction,
declareGadgetClassCanHandleListboxClipboardAction) { declareGadgetClassCanHandleListboxClipboardAction, RSVP) {
"use strict"; "use strict";
function updateSearchQueryFromSelection(extended_search, checked_uid_list, function updateSearchQueryFromSelection(extended_search, checked_uid_list,
...@@ -114,12 +114,19 @@ ...@@ -114,12 +114,19 @@
}) })
.onStateChange(function onStateChange() { .onStateChange(function onStateChange() {
var form_gadget = this; var erp5_form,
graphic_type,
form_gadget = this;
// render the erp5 form // render the erp5 form
return form_gadget.getDeclaredGadget("erp5_form") return new RSVP.Queue(RSVP.all([
.push(function (erp5_form) { form_gadget.getDeclaredGadget("erp5_form"),
form_gadget.getUrlParameter("graphic_type")
]))
.push(function (result_list) {
var form_options = form_gadget.state.erp5_form; var form_options = form_gadget.state.erp5_form;
graphic_type = result_list[1];
erp5_form = result_list[0];
form_options.erp5_document = form_gadget.state.erp5_document; form_options.erp5_document = form_gadget.state.erp5_document;
form_options.form_definition = form_gadget.state.form_definition; form_options.form_definition = form_gadget.state.form_definition;
...@@ -136,19 +143,39 @@ ...@@ -136,19 +143,39 @@
form_options.form_definition.extended_search = form_gadget.state.extended_search; form_options.form_definition.extended_search = form_gadget.state.extended_search;
} }
form_options.enable_graphic = false;
if (graphic_type || (
!form_gadget.state.extended_search && !graphic_type
)) {
form_options.enable_graphic = true;
}
return erp5_form.render(form_options); return erp5_form.render(form_options);
}) })
// render the search field // render the search field
.push(function () { .push(function () {
return form_gadget.getDeclaredGadget("erp5_searchfield"); return RSVP.all([
form_gadget.getDeclaredGadget("erp5_searchfield"),
erp5_form.getGraphicType()
]);
}) })
.push(function (search_gadget) { .push(function (result_list) {
var search_options = {}; var search_gadget = result_list[0],
search_options = {};
// XXX not generic, fix later // XXX not generic, fix later
if (form_gadget.state.extended_search) { if (form_gadget.state.extended_search) {
search_options.extended_search = form_gadget.state.extended_search; search_options.extended_search = form_gadget.state.extended_search;
} }
search_options.enable_graphic = false;
if (graphic_type ||
(!form_gadget.state.extended_search && !graphic_type)
) {
search_options.enable_graphic = true;
}
search_options.graphic_type = result_list[1];
search_options.jio_key = form_gadget.state.jio_key;
return search_gadget.render(search_options); return search_gadget.render(search_options);
}) })
...@@ -267,7 +294,23 @@ ...@@ -267,7 +294,23 @@
return result_list; return result_list;
}); });
}) })
.allowPublicAcquisition("triggerListboxGraphicSelection", function triggerListboxGraphicSelection() {
var gadget = this;
return this.getDeclaredGadget("erp5_form")
.push(function (declared_gadget) {
return RSVP.all([
declared_gadget.getListboxInfo(),
gadget.getUrlParameter("graphic_type")
]);
})
.push(function (result_list) {
return gadget.renderEditorPanel("gadget_erp5_graphic_editor.html", {
graphic_option_list: result_list[0].graphic_option_list,
jio_key: gadget.state.jio_key,
graphic_type: result_list[1]
});
});
})
.allowPublicAcquisition("triggerListboxSelectAction", function triggerListboxSelectAction(argument_list) { .allowPublicAcquisition("triggerListboxSelectAction", function triggerListboxSelectAction(argument_list) {
var action = argument_list[0], var action = argument_list[0],
checked_uid_list = argument_list[1], checked_uid_list = argument_list[1],
...@@ -311,4 +354,4 @@ ...@@ -311,4 +354,4 @@
}(window, rJS, renderFormViewHeader, renderFormListHeader, SimpleQuery, }(window, rJS, renderFormViewHeader, renderFormListHeader, SimpleQuery,
ComplexQuery, Query, ComplexQuery, Query,
QueryFactory, ensureArray, triggerListboxClipboardAction, QueryFactory, ensureArray, triggerListboxClipboardAction,
declareGadgetClassCanHandleListboxClipboardAction)); declareGadgetClassCanHandleListboxClipboardAction, RSVP));
\ No newline at end of file \ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>979.58033.54588.53418</string> </value> <value> <string>997.50840.41905.62822</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1574153832.0</float> <float>1643231574.6</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="domsugar.js"></script>
<script src="jiodev.js" type="text/javascript"></script> <script src="jiodev.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
...@@ -16,12 +17,26 @@ ...@@ -16,12 +17,26 @@
</head> </head>
<body> <body>
<div class="ui-input-text"> <!-- XXX Just a draft -->
<div class="search_parsed_value"></div> <div class="graphic-button-section" style="float: left;">
<div data-gadget-url="gadget_html5_input.html" <button
data-gadget-scope="input" class="ui-btn-icon-notext ui-icon-bar-chart-o ui-screen-hidden change-graphic-button"
data-gadget-sandbox="public"></div> style="border: 1px solid rgba(0, 0, 0, 0.14);
<button class="search_button ui-btn-icon-notext ui-icon-search" type="submit" /> margin-right: 6pt;
</div> border-radius: 0.325em;" type="button"> Change Graphic</button>
<button
class="ui-btn-icon-notext ui-icon-bar-chart-o ui-screen-hidden graphic-button"
style="border: 1px solid rgba(0, 0, 0, 0.14);
margin-right: 6pt;
border-radius: 0.325em;" type="button"> Display Graphic</button>
</div>
<div class="ui-input-text">
<div class="search_parsed_value"></div>
<div data-gadget-url="gadget_html5_input.html"
data-gadget-scope="input"
data-gadget-sandbox="public"></div>
<button class="search_button ui-btn-icon-notext ui-icon-search" type="submit" />
</div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.15561.39912.10990</string> </value> <value> <string>997.43553.453.33228</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1537193726.71</float> <float>1643060796.12</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, document, Node, /*global window, rJS, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query*/ QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar*/
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, document, Node, (function (window, rJS, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query) { QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar) {
"use strict"; "use strict";
function convertQueryToSearchText(query) { function convertQueryToSearchText(query) {
...@@ -29,19 +29,35 @@ ...@@ -29,19 +29,35 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("getUrlParameter",
"getUrlParameter")
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var state_dict = { var gadget = this,
extended_search: options.extended_search || "" state_dict = {
}; // XXX probably get from url
return this.changeState(state_dict); extended_search: options.extended_search || "",
// XXX probably get from url
enable_graphic: options.enable_graphic || false,
// XXX probably get from url
graphic_type: options.graphic_type,
jio_key: options.jio_key
};
return gadget.getUrlParameter("only_graphic")
.push(function (only_graphic) {
state_dict.only_graphic = only_graphic || false;
return gadget.changeState(state_dict);
});
}) })
.declareAcquiredMethod("triggerListboxGraphicSelection",
.onStateChange(function () { "triggerListboxGraphicSelection")
.onStateChange(function (modification_dict) {
var gadget = this, var gadget = this,
i, i,
len, len,
button_container = gadget.element.querySelector('div.search_parsed_value'), button_container = gadget.element.querySelector('div.search_parsed_value'),
button, button_graphic = gadget.element.querySelector(".graphic-button"),
change_button_graphic = gadget.element.querySelector(".change-graphic-button"),
graphic_css_class = "ui-screen-hidden",
operator = 'AND', operator = 'AND',
jio_query_list = [], jio_query_list = [],
query_text_list = [], query_text_list = [],
...@@ -53,6 +69,12 @@ ...@@ -53,6 +69,12 @@
continue_full_text_query_search = true; continue_full_text_query_search = true;
if (gadget.state.extended_search) { if (gadget.state.extended_search) {
if (modification_dict.graphic_type && !modification_dict.only_graphic) {
button_graphic.classList.remove(graphic_css_class);
} else if (modification_dict.only_graphic) {
change_button_graphic.classList.remove(graphic_css_class);
}
// Parse the raw query // Parse the raw query
try { try {
jio_query = QueryFactory.create(gadget.state.extended_search); jio_query = QueryFactory.create(gadget.state.extended_search);
...@@ -109,20 +131,26 @@ ...@@ -109,20 +131,26 @@
})); }));
} }
} }
} else if (modification_dict.enable_graphic &&
modification_dict.graphic_type &&
!modification_dict.extended_search) {
change_button_graphic.classList.remove(graphic_css_class);
} }
button_container.innerHTML = ''; button_container.innerHTML = '';
len = query_text_list.length; len = query_text_list.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
button = document.createElement('button'); button_container.appendChild(
button.textContent = query_text_list[i]; domsugar("button", {
button.value = i; "text": query_text_list[i],
button_container.appendChild(button); "value": i
})
);
} }
button = document.createElement('input'); button_container.appendChild(domsugar("input", {
button.setAttribute("type", "hidden"); "type": "hidden",
button.value = parsed_value; "value": parsed_value
button_container.appendChild(button); }));
return gadget.getDeclaredGadget('input') return gadget.getDeclaredGadget('input')
.push(function (input_gadget) { .push(function (input_gadget) {
...@@ -222,17 +250,39 @@ ...@@ -222,17 +250,39 @@
// But, in the case of panel, we don't need to handle anything. // But, in the case of panel, we don't need to handle anything.
return; return;
}) })
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("triggerSubmit", "triggerSubmit") .declareAcquiredMethod("triggerSubmit", "triggerSubmit")
.onEvent('click', function (evt) { .onEvent('click', function (evt) {
if ((evt.target.nodeType === Node.ELEMENT_NODE) && var gadget = this;
(evt.target.tagName === 'BUTTON') && if (evt.target.tagName === 'BUTTON') {
(evt.target.value)) { if ((evt.target.nodeType === Node.ELEMENT_NODE) &&
// Open the filter panel if one 'search' button is clicked (evt.target.value)) {
evt.preventDefault(); // Open the filter panel if one 'search' button is clicked
return this.triggerSubmit({focus_on: parseInt(evt.target.value, 10)}); evt.preventDefault();
return this.triggerSubmit({focus_on: parseInt(evt.target.value, 10)});
}
if (evt.target.classList.contains("graphic-button")) {
evt.target.classList.add("ui-screen-hidden");
gadget.element.querySelector(
".change-graphic-button"
).classList.remove("ui-screen-hidden");
return gadget.redirect({
command: "display_with_history",
options: {
jio_key: gadget.state.jio_key,
graphic_type: gadget.state.graphic_type,
extended_search: gadget.state.extended_search,
only_graphic: true
}
});
}
if (evt.target.classList.contains("change-graphic-button")) {
evt.target.classList.add("ui-screen-hidden");
return gadget.triggerListboxGraphicSelection();
}
} }
}, false, false); }, false, false);
}(window, rJS, document, Node, }(window, rJS, Node,
QueryFactory, SimpleQuery, ComplexQuery, Query)); QueryFactory, SimpleQuery, ComplexQuery, Query, domsugar));
\ No newline at end of file \ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.27464.21813.55483</string> </value> <value> <string>997.50887.11419.51200</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1604428536.71</float> <float>1643288555.22</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
div[data-gadget-url$="gadget_graphic.html"] iframe {
height: 100%;
}
div[data-gadget-url$="gadget_graphic.html"] .ui-field-contain .graph-spinner {
position: absolute;
top: 100px;
width: 120px;
}
div[data-gadget-url$="gadget_graphic.html"] .left {
height: 50%;
width: 100%;
}
div[data-gadget-url$="gadget_graphic.html"] .ui-field-contain .bottom .first-line-buttons {
-webkit-appearance: none;
margin-top: 0;
margin-bottom: 20px;
}
div[data-gadget-url$="gadget_graphic.html"] .wrap {
height: 300px;
}
<html>
<!--
data-i18n=Homepage
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 Page Homepage</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_graphic.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="gadget_graphic.css">
</head>
<body>
<div class="ui-field-contain">
<div class="left">
<div class="ui-icon-spinner ui-btn-icon-notext first-loader graph-spinner"></div>
<div class="wrap"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
domain_id = listbox.get_value("domain_root_list")[0][0]
portal = context.getPortalObject()
base_category = getattr(portal.portal_categories, domain_id, None)
# We should not group by catalog keys like translate_*_title.
# For now, we keep a dict here, to convert this key by another faster catalog ket
perfomance_mapping = {
"translated_simulation_state_title": "simulation_state"
}
if base_category is not None:
label_list, domain_list = [], []
# should we get childs recursively?
for child in base_category.objectValues():
label_list.append(child.getTranslatedTitle())
domain_list.append(child.getId())
else:
label_list, domain_list = context.Base_getSubdomainTitleAndIdList(domain_id)
default_param_dict = {}
default_param_list = listbox.get_value('default_params') or []
group_by, group_by_title = None, ""
column_list = listbox.get_value("columns") or []
for column in column_list:
key, title = column
if any([i in key for i in ("validation_state", "simulation_state")]):
group_by = key
group_by_title = title
assert group_by, "group_by not found"
if default_param_list:
list_method, relative_url = None, None
# Use dict() is simpler but is slower
for (key, value) in default_param_list:
if isinstance(value, list):
default_param_dict.setdefault(key, []).extend(value)
else:
default_param_dict.setdefault(key, []).append(value)
else:
relative_url = context.getObject().getRelativeUrl()
list_method = listbox.get_value("list_method").getMethodName()
# XXX - hack to build absolute_url to add hateoas script through hateoas web site
script_id = "ERP5Document_getHateoas"
root_url = context.getWebSiteValue().hateoas.absolute_url()
list_method_template = (
"%(root_url)s/%(script_id)s?mode=search"
"{&query,select_list*,limit*,group_by*,sort_on*,"
"local_roles*,selection_domain*,list_method*,relative_url*}") % {"root_url": root_url, "script_id": script_id}
return [
("group_by", perfomance_mapping.get(group_by, None) or group_by),
("list_method_template", list_method_template),
("list_method", list_method),
("relative_url", relative_url),
("query_by", default_param_dict),
("title", listbox.get_value("title")),
("layout", {
"x": {
"title": group_by_title,
"key": group_by,
"domain_id": domain_id,
"column_list": label_list,
"domain_list": domain_list
},
"y": {
"title": "Quantity"
}
})
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_extractGadgetDataDictFromListbox</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
now = DateTime()
domain_mapping_dict = {
'< 2': {
"range": "min",
"query": (now - 2).earliestTime()
},
'2 - 7': {
"range": "minmax",
"query": ((now - 7).earliestTime(), (now - 2).latestTime())
},
'7 - 30': {
"range": "minmax",
"query": ((now - 30).earliestTime(), (now - 7).latestTime())
},
'> 30': {
"range": "max",
"query": ((now - 30).earliestTime())
}
}
generateDomain = context.Base_generateDomain
return [
generateDomain(parent, 'delivery_start_date_lt2', '< 2', 'delivery.start_date', domain_mapping_dict["< 2"]),
generateDomain(parent, 'delivery_start_date_2to7', '2 - 7', 'delivery.start_date', domain_mapping_dict["2 - 7"]),
generateDomain(parent, 'delivery_start_date_7to30', '7 - 30', 'delivery.start_date', domain_mapping_dict["7 - 30"]),
generateDomain(parent, 'delivery_start_date_gt30', '> 30', 'delivery.start_date', domain_mapping_dict["> 30"]),
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateDeliveryStartDateDomain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Fail if domain does not exists
domain = context.getPortalObject().portal_domains[domain_id]
id_list, title_list = [], []
for subdomain in domain.getDomainGeneratorList():
id_list.append(subdomain.id)
title_list.append(subdomain.title)
return title_list, id_list
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>domain_id</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getSubdomainTitleAndIdList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewModuleStatisticsReport</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_reportPrototype</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>ERP5 Form</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Report Module By State</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>columns</string>
<string>count_method</string>
<string>domain_root_list</string>
<string>sort</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>portal_type</string>
<string>Portal Type</string>
</tuple>
<tuple>
<string>delivery.start_date</string>
<string>Start Date</string>
</tuple>
<tuple>
<string>translated_simulation_state_title</string>
<string>Simulation State</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>graphic_gadget_delivery_start_date_domain</string>
<string>Delivery Start Date</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value>
<list>
<tuple>
<string>modification_date</string>
<string>DESC</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Recent Updates</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
return context.get_value("field_domain_tree")
data_dict = {
# ("group_by", "simulation_state"),
# ("query_by", {"parent_uid": context.getUid()}),
"title": context.get_value("title"),
"layout": {
"x": {
# "title": translateString("Days"),
# "key": "getTranslatedSimulationStateTitle",
# "domain_id": domain_id,
# "column_list": column_list,
# "domain_list": domain_list
},
"y": {
# "title": translateString("Quantity")
}
}
}
if context.get_value("field_domain_tree"):
domain_id = context.get_value("field_domain_root_list")[0][0]
column_list, domain_list = context.Base_getSubdomainTitleAndIdList(domain_id)
data_dict["layout"]["x"]["column_list"] = column_list
data_dict["layout"]["x"]["domain_list"] = domain_list
return data_dict.items()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Listbox_getGraphicGadgetDataList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -2,6 +2,8 @@ web_section = context ...@@ -2,6 +2,8 @@ web_section = context
# Add all ERP5JS gadget # Add all ERP5JS gadget
url_list = [ url_list = [
'echarts-all.js',
'favicon.ico',
'font-awesome/font-awesome-webfont.eot', 'font-awesome/font-awesome-webfont.eot',
'font-awesome/font-awesome-webfont.woff', 'font-awesome/font-awesome-webfont.woff',
'font-awesome/font-awesome-webfont.woff2', 'font-awesome/font-awesome-webfont.woff2',
...@@ -138,6 +140,9 @@ url_list = [ ...@@ -138,6 +140,9 @@ url_list = [
'gadget_erp5_sort_editor.html', 'gadget_erp5_sort_editor.html',
'gadget_erp5_sort_editor.js', 'gadget_erp5_sort_editor.js',
'gadget_global.js', 'gadget_global.js',
'gadget_graphic.html',
'gadget_graphic.js',
'gadget_graphic.css',
'gadget_html5_element.html', 'gadget_html5_element.html',
'gadget_html5_element.js', 'gadget_html5_element.js',
'gadget_html5_input.html', 'gadget_html5_input.html',
...@@ -164,6 +169,8 @@ url_list = [ ...@@ -164,6 +169,8 @@ url_list = [
'jiodev.js', 'jiodev.js',
'renderjs.js', 'renderjs.js',
'rsvp.js', 'rsvp.js',
'unsafe/gadget_field_graph_echarts.html',
'unsafe/gadget_field_graph_echarts.js'
] ]
# Add all root gadgets # Add all root gadgets
......
...@@ -1406,19 +1406,6 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1406,19 +1406,6 @@ div[data-gadget-scope='header'] .ui-header {
} }
} }
// Increase the size of the editors when placed
// in the bottom group
.bottom {
iframe {
height: 80vh;
}
div[data-gadget-url$="gadget_erp5_field_listbox.html"] {
iframe {
height: 30vh;
}
}
}
/* /*
@media @smartphone { @media @smartphone {
.ui-field-contain { .ui-field-contain {
......
...@@ -12,4 +12,5 @@ Web Site | create_translation_data ...@@ -12,4 +12,5 @@ Web Site | create_translation_data
Web Style | version_view Web Style | version_view
Web Style | view Web Style | view
Web Style | view_editor Web Style | view_editor
Web Style | web_view Web Style | web_view
\ No newline at end of file portal_actions | generic_report_module_by_state
\ No newline at end of file
...@@ -7,6 +7,7 @@ portal_contribution_registry/web_script_mimetype ...@@ -7,6 +7,7 @@ portal_contribution_registry/web_script_mimetype
portal_contribution_registry/web_style_by_content portal_contribution_registry/web_style_by_content
portal_contribution_registry/web_style_extension portal_contribution_registry/web_style_extension
portal_contribution_registry/web_style_mimetype portal_contribution_registry/web_style_mimetype
portal_domains/graphic_gadget_delivery_start_date_domain
web_page_module/rjs_* web_page_module/rjs_*
web_site_module/renderjs_runner web_site_module/renderjs_runner
web_site_module/renderjs_runner/** web_site_module/renderjs_runner/**
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_graphic_gadget_report</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>15.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Test Graphic Gadget Report</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/EventModule_viewExamplesOfGraphicGadgetReport</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Domain" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_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>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateCreationDateDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>graphic_gadget_creation_date_domain</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Graphic Gadget Creation Date Domain</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Base Domain" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_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>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateModificationDateDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>graphic_gadget_modification_date_domain</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Graphic Gadget Modification Date Domain</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
now = DateTime()
domain_mapping_dict = {
'< 2': {
"range": "min",
"query": (now - 2).earliestTime()
},
'2 - 7': {
"range": "minmax",
"query": ((now - 7).earliestTime(), (now - 2).latestTime())
},
'7 - 30': {
"range": "minmax",
"query": ((now - 30).earliestTime(), (now - 7).latestTime())
},
'> 30': {
"range": "max",
"query": ((now - 30).earliestTime())
}
}
generateDomain = context.Base_generateDomain
return [
generateDomain(parent, 'creation_date_lt2', '< 2', 'creation_date', domain_mapping_dict["< 2"]),
generateDomain(parent, 'creation_date_2to7', '2 - 7', 'creation_date', domain_mapping_dict["2 - 7"]),
generateDomain(parent, 'creation_date_7to30', '7 - 30', 'creation_date', domain_mapping_dict["7 - 30"]),
generateDomain(parent, 'creation_date_gt30', '> 30', 'creation_date', domain_mapping_dict["> 30"]),
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateCreationDateDomain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
now = DateTime()
domain_mapping_dict = {
'< 2': {
"range": "min",
"query": (now - 2).earliestTime()
},
'2 - 7': {
"range": "minmax",
"query": ((now - 7).earliestTime(), (now - 2).latestTime())
},
'7 - 30': {
"range": "minmax",
"query": ((now - 30).earliestTime(), (now - 7).latestTime())
},
'> 30': {
"range": "max",
"query": ((now - 30).earliestTime())
}
}
generateDomain = context.Base_generateDomain
return [
generateDomain(parent, 'modification_date_lt2', '< 2', 'modification_date', domain_mapping_dict["< 2"]),
generateDomain(parent, 'modification_date_2to7', '2 - 7', 'modification_date', domain_mapping_dict["2 - 7"]),
generateDomain(parent, 'modification_date_7to30', '7 - 30', 'modification_date', domain_mapping_dict["7 - 30"]),
generateDomain(parent, 'modification_date_gt30', '> 30', 'modification_date', domain_mapping_dict["> 30"]),
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateModificationDateDomain</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
translateString = context.Base_translateString
return [
("group_by", ["portal_type",]),
("query_by", {"portal_type": context.getPortalDocumentTypeList()}),
("title", translateString("Number of Documents")),
("layout", {
"x": {
"title": translateString("Portal Type"),
"key": "getTranslatedPortalType"
},
"y": {
"title": translateString("Quantity")
}
})
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getPortalDocumentTypeListGadgetData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
translateString = context.Base_translateString
domain_id = "graphic_gadget_creation_date_domain"
column_list, domain_list = context.Base_getSubdomainTitleAndIdList(domain_id)
return [
("group_by", ["portal_type",]),
("query_by", {"parent_uid": context.getUid()}),
("title", translateString("Number of events from a range of creation_date")),
("layout", {
"x": {
"title": translateString("Days"),
"key": "getTranslatedPortalType",
"domain_id": domain_id,
"column_list": column_list,
"domain_list": domain_list
},
"y": {
"title": translateString("Quantity")
}
})
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getTypeAndCreationDateRangeGadgetData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
translateString = context.Base_translateString
domain_id = "graphic_gadget_modification_date_domain"
column_list, domain_list = context.Base_getSubdomainTitleAndIdList(domain_id)
return [
("group_by", ["portal_type",]),
("query_by", {"parent_uid": context.getUid()}),
("title", translateString("Number of events from a range of modification_date")),
("layout", {
"x": {
"title": translateString("Days"),
"key": "getTranslatedPortalType",
"domain_id": domain_id,
"column_list": column_list,
"domain_list": domain_list
},
"y": {
"title": translateString("Quantity")
}
})
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getTypeAndModificationDateRangeGadgetData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
translateString = context.Base_translateString
portal = context.getPortalObject()
return [
("query_by", {"parent_uid": [portal.person_module.getUid(),
portal.organisation_module.getUid()]}),
("layout", {
"x": {
"title": translateString("Portal Type"),
"key": "portal_type"
},
"y": {
"title": translateString("Quantity")
}
}),
("title", translateString("Types from Person and Organisation module"))
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getTypeFromPersonAndOrganisationModuleGadgetData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
translateString = context.Base_translateString
return [
("group_by", ["simulation_state", "portal_type"]),
("select_list", ["getTranslatedPortalType", "getTranslatedSimulationStateTitle"]),
("query_by", {"parent_uid": context.getUid()}),
("title", translateString("Number of different events per simulation state")),
("layout", {
"x": {
"title": translateString("Types"),
"key": "getTranslatedPortalType",
},
"y": {
"title": translateString("Quantity")
}
})
]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>EventModule_getStateAndPortalTypeGadgetData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>report_by_creation_date_gadget</string>
<string>report_by_modification_date_gadget</string>
<string>report_by_simulation_state_gadget</string>
<string>report_by_quantity_unit_gadget</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>report_by_portal_type_gadget</string>
<string>report_portal_type_gadget</string>
<string>report_person_and_organisation_gadget</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>EventModule_viewExamplesOfGraphicGadgetReport</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>EventModule_viewExamplesOfGraphicGadgetReport</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>ERP5 Form</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Test Graphic Gadget</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>columns</string>
<string>count_method</string>
<string>default_params</string>
<string>domain_root_list</string>
<string>list_method</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>translated_simulation_state_title</string>
<string>State</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
<list>
<tuple>
<string>quantity_unit</string>
<string>Quantity Unit</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [("parent_uid", context.support_request_module.getUid())]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>searchFolder</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Event Module | test_graphic_gadget_report
Foo | view_complex_time_serie_graph Foo | view_complex_time_serie_graph
Foo | view_dialog_without_action Foo | view_dialog_without_action
Foo | view_field_submit_action_dialog Foo | view_field_submit_action_dialog
......
portal_domains/graphic_gadget_creation_date_domain
portal_domains/graphic_gadget_modification_date_domain
portal_tests/renderjs_ui_check_box_field_zuite portal_tests/renderjs_ui_check_box_field_zuite
portal_tests/renderjs_ui_check_box_field_zuite/** portal_tests/renderjs_ui_check_box_field_zuite/**
portal_tests/renderjs_ui_date_time_field_zuite portal_tests/renderjs_ui_date_time_field_zuite
......
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