From ffd5ff1a6cc0959683c6ab563711affda56d6754 Mon Sep 17 00:00:00 2001 From: Gabriel Monnerat Date: Thu, 14 Nov 2019 17:28:01 +0000 Subject: [PATCH 1/2] erp5_web_renderjs_ui: Extend code to support submit dialog with custom method --- .../rjs_gadget_erp5_pt_form_dialog_js.js | 12 +- .../rjs_gadget_erp5_pt_form_dialog_js.xml | 148 ++++++++++++++++++ .../Foo/view_field_submit_action_dialog.xml | 85 ++++++++++ .../testFormDialogProceedFieldAction.xml | 58 +++++++ .../testFormDialogProceedFieldAction.zpt | 88 +++++++++++ .../Foo_submitCustomFieldSubmitDialog.py | 5 + .../Foo_submitCustomFieldSubmitDialog.xml | 62 ++++++++ .../Foo_updateFieldSubmitDialog.py | 1 + .../Foo_updateFieldSubmitDialog.xml | 62 ++++++++ .../Foo_validateFieldSubmitDialog.py | 1 + .../Foo_validateFieldSubmitDialog.xml | 62 ++++++++ .../Foo_viewFieldSubmitDialog.xml | 136 ++++++++++++++++ .../Foo_viewFieldSubmitDialog/your_button.xml | 143 +++++++++++++++++ .../your_integer_1.xml | 94 +++++++++++ .../gadget_submit_button.html.html | 17 ++ .../gadget_submit_button.html.xml | 32 ++++ .../gadget_submit_button.js.js | 35 +++++ .../gadget_submit_button.js.xml | 32 ++++ .../bt/template_action_path_list | 1 + 19 files changed, 1070 insertions(+), 4 deletions(-) create mode 100644 bt5/erp5_web_renderjs_ui_test/ActionTemplateItem/portal_types/Foo/view_field_submit_action_dialog.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.zpt create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.py create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.py create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_button.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_integer_1.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.html create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.xml create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.js create mode 100644 bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.xml diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js index 7e1672cfb30..0bcacec7e58 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js @@ -19,7 +19,7 @@ }); } - function submitDialog(is_updating) { + function submitDialog(is_updating, custom_dialog_method) { var gadget = this, button_container = gadget.element.querySelector('.dialog_button_container'), @@ -55,7 +55,7 @@ } } // ERP5 expects target Script name in dialog_method field - data.dialog_method = gadget.state.form_definition.action; + data.dialog_method = custom_dialog_method || gadget.state.form_definition.action; // For Update Action - override the default value from "action" if (is_updating) { data.dialog_method = gadget.state.form_definition.update_action; @@ -82,7 +82,6 @@ if (gadget.state.redirect_to_parent) { return gadget.redirect({command: 'history_previous'}); } - console.log('COSUCOUS', result); if ((gadget.state.jio_key === result.jio_key) && (!result.view)) { // don't update navigation history when not really redirecting @@ -107,7 +106,6 @@ } } - console.log('lets redirect', command, result.jio_key, result.view); // forced document change thus we update history return gadget.redirect({ command: command, @@ -131,6 +129,10 @@ } + function submitDialogWithCustomDialogMethod(param_list) { + return submitDialog.apply(this, [false, param_list[0]]); + } + var gadget_klass = rJS(window), dialog_button_source = gadget_klass.__template_element .getElementById("dialog-button-template") @@ -153,6 +155,8 @@ .declareAcquiredMethod("translate", "translate") .declareAcquiredMethod("translateHtml", "translateHtml") .declareAcquiredMethod("submitContent", "submitContent") + .allowPublicAcquisition("submitDialogWithCustomDialogMethod", + submitDialogWithCustomDialogMethod) ///////////////////////////////////////////////////////////////// // Proxy methods to the child gadget diff --git a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml index bdc5449b57d..c06f446ccd9 100644 --- a/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml +++ b/bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml @@ -140,6 +140,154 @@ + + + + + + + + _log + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1574441791.15 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + _log + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.63649.12092.1536 + + + state + current + + + time + + + + + + + + + + + 1574441771.59 + UTC + + + + + + + + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/ActionTemplateItem/portal_types/Foo/view_field_submit_action_dialog.xml b/bt5/erp5_web_renderjs_ui_test/ActionTemplateItem/portal_types/Foo/view_field_submit_action_dialog.xml new file mode 100644 index 00000000000..a3e7dd9fb9a --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/ActionTemplateItem/portal_types/Foo/view_field_submit_action_dialog.xml @@ -0,0 +1,85 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_onlyjio_action + + + + + category + object_onlyjio_action + + + condition + + + + description + + + + + + icon + + + + id + view_field_submit_action_dialog + + + permissions + + + View + + + + + portal_type + Action Information + + + priority + 3.0 + + + title + Field Submit Action + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/Foo_viewFieldSubmitDialog + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.xml b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.xml new file mode 100644 index 00000000000..ffa77870d33 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.xml @@ -0,0 +1,58 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + name_subpath + traverse_subpath + + + + + + + + + + + content_type + text/html + + + expand + 0 + + + id + testFormDialogProceedFieldAction + + + output_encoding + utf-8 + + + title + + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.zpt b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.zpt new file mode 100644 index 00000000000..625d24c2c03 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormDialogProceedFieldAction.zpt @@ -0,0 +1,88 @@ + + + +Test Command Display With History + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test Command Display With History
open${base_url}/web_site_module/renderjs_runner/#/foo_module/1
assertElementPresent//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_view.html']
assertElementPresent//div[@data-gadget-scope='panel']//a[text()='Field Submit Action' and contains(@href, '#!display_dialog_with_history')]
assertValuefield_your_integer_11
typefield_your_integer_12
Submit with the field button
waitForElementPresent//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]//button[@name='action_custom' and @type='button']
assertElementPresent//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]//button[@name='action_custom' and @type='button']
click//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]//button[@name='action_custom' and @type='button']

assertValuefield_your_integer_13
+ + \ No newline at end of file diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py new file mode 100644 index 00000000000..56c3ff02fb4 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.py @@ -0,0 +1,5 @@ +request = container.REQUEST +request.form['your_integer_1'] = integer_1 + 1 +assert button == 'forbarcontent', button + +return context.Base_renderForm('Foo_viewFieldSubmitDialog', message='Field Action Submitted') diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.xml new file mode 100644 index 00000000000..b2fd7cec020 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_submitCustomFieldSubmitDialog.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + integer_1=0, button=None, **kw + + + id + Foo_submitCustomFieldSubmitDialog + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.py b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.py new file mode 100644 index 00000000000..06ffeeddb9e --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.py @@ -0,0 +1 @@ +return context.Base_renderForm('Foo_viewFieldSubmitDialog', message='Update Action Submitted') diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.xml new file mode 100644 index 00000000000..ba25159b73f --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_updateFieldSubmitDialog.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + **kw + + + id + Foo_updateFieldSubmitDialog + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.py b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.py new file mode 100644 index 00000000000..e04d9d7c5ce --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.py @@ -0,0 +1 @@ +return context.Base_renderForm('Foo_viewFieldSubmitDialog', message='Validate Action Submitted') diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.xml new file mode 100644 index 00000000000..c32e5639429 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_validateFieldSubmitDialog.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + **kw + + + id + Foo_validateFieldSubmitDialog + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog.xml new file mode 100644 index 00000000000..da606d2afdd --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog.xml @@ -0,0 +1,136 @@ + + + + + + + + + + _objects + + + + + + action + Foo_validateFieldSubmitDialog + + + action_title + + + + description + + + + edit_order + + + + + + encoding + UTF-8 + + + enctype + + + + group_list + + + left + right + center + bottom + hidden + + + + + groups + + + + bottom + + + + + + center + + + + + + hidden + + + + + + left + + + your_integer_1 + your_button + + + + + right + + + + + + + + + id + Foo_viewFieldSubmitDialog + + + method + POST + + + name + Foo_viewFieldSubmitDialog + + + pt + form_dialog + + + row_length + 4 + + + stored_encoding + UTF-8 + + + title + Default Action + + + unicode_mode + 0 + + + update_action + Foo_updateFieldSubmitDialog + + + update_action_title + + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_button.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_button.xml new file mode 100644 index 00000000000..29ea9c1f362 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_button.xml @@ -0,0 +1,143 @@ + + + + + + + + + + delegated_list + + + title + gadget_url + renderjs_extra + + + + + id + your_button + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + + + + tales + + + + field_id + + + + form_id + + + + gadget_url + + AAAAAAAAAAI= + + + + renderjs_extra + + AAAAAAAAAAM= + + + + title + + AAAAAAAAAAQ= + + + + + + + values + + + + field_id + my_dialog_mode_text_content + + + form_id + Base_viewFieldLibrary + + + title + Button + + + + + + + + + + + + + + + _text + python: field.restrictedTraverse(\'gadget_submit_button.html\').absolute_url() + + + + + + + + + + + + _text + python: {\'title\': here.Base_translateString(\'Submit Custom\'), \'python_script_id\': \'Foo_submitCustomFieldSubmitDialog\'} + + + + + + + + + + + + _text + python: \'\' + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_integer_1.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_integer_1.xml new file mode 100644 index 00000000000..48c030120fb --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/Foo_viewFieldSubmitDialog/your_integer_1.xml @@ -0,0 +1,94 @@ + + + + + + + + + + delegated_list + + + title + default + display_width + + + + + id + your_integer_1 + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + + + + tales + + + + field_id + + + + form_id + + + + + + + values + + + + default + 1 + + + display_width + 20 + + + field_id + my_integer_field + + + form_id + Base_viewFieldLibrary + + + title + Amount + + + + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.html b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.html new file mode 100644 index 00000000000..9870eddf196 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.html @@ -0,0 +1,17 @@ + + + + + + Submit Button + + + + + + + + + + + \ No newline at end of file diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.xml new file mode 100644 index 00000000000..e9fac023ca5 --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.html.xml @@ -0,0 +1,32 @@ + + + + + + + + + + _Cacheable__manager_id + must_revalidate_http_cache + + + __name__ + gadget_submit_button.html + + + content_type + text/html + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.js b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.js new file mode 100644 index 00000000000..22bf2ae8f4f --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.js @@ -0,0 +1,35 @@ +/*global window, rJS, RSVP, jIO, console, document */ +/*jslint nomen: true, maxlen:80, indent:2*/ +(function (rJS, jIO, RSVP, window, document) { + "use strict"; + + rJS(window) + .declareMethod('render', function (options) { + return this.changeState(options); + }) + + .declareMethod('getContent', function () { + var result = {}; + result[this.state.key] = 'forbarcontent'; + return result; + }) + + .onStateChange(function () { + var button = document.createElement('button'); + button.type = 'button'; + button.textContent = this.state.title; + button.name = 'action_custom'; + this.element.innerHTML = ''; + this.element.appendChild(button); + }) + + .declareAcquiredMethod( + "submitDialogWithCustomDialogMethod", "submitDialogWithCustomDialogMethod") + .onEvent('click', function click(evt) { + if (evt.target.type === "button") { + evt.preventDefault(); + return this.submitDialogWithCustomDialogMethod(this.state.python_script_id); + } + }, false, false); + +}(rJS, jIO, RSVP, window, document)); \ No newline at end of file diff --git a/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.xml b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.xml new file mode 100644 index 00000000000..285594aa11e --- /dev/null +++ b/bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/gadget_submit_button.js.xml @@ -0,0 +1,32 @@ + + + + + + + + + + _Cacheable__manager_id + must_revalidate_http_cache + + + __name__ + gadget_submit_button.js + + + content_type + application/javascript + + + precondition + + + + title + + + + + + diff --git a/bt5/erp5_web_renderjs_ui_test/bt/template_action_path_list b/bt5/erp5_web_renderjs_ui_test/bt/template_action_path_list index bc237029269..dfd79f982b3 100644 --- a/bt5/erp5_web_renderjs_ui_test/bt/template_action_path_list +++ b/bt5/erp5_web_renderjs_ui_test/bt/template_action_path_list @@ -1,2 +1,3 @@ Foo | view_complex_time_serie_graph +Foo | view_field_submit_action_dialog Foo | view_simple_graph \ No newline at end of file -- 2.30.9 From 97de39a3d3e763c15ea4a42e6b48d54025fb3013 Mon Sep 17 00:00:00 2001 From: Gabriel Monnerat Date: Mon, 16 Sep 2019 01:19:01 +0000 Subject: [PATCH 2/2] erp5_document_scanner: Add gadget to scanner documents using mobile For now, this is chrome only erp5_document_scanner_ui_test: Add tests to Document Scanner gadget --- .../scan_document.xml | 96 + .../scan_document.xml | 96 + .../Payment%20Transaction/scan_document.xml | 96 + .../scan_document.xml | 96 + .../scan_document.xml | 96 + .../rjs_gadget_document_scanner_css.css | 82 + .../rjs_gadget_document_scanner_css.xml | 469 +++ .../rjs_gadget_document_scanner_html.html | 43 + .../rjs_gadget_document_scanner_html.xml | 649 +++ .../rjs_gadget_document_scanner_js.js | 365 ++ .../rjs_gadget_document_scanner_js.xml | 3710 +++++++++++++++++ .../portal_skins/erp5_document_scanner.xml | 26 + .../Base_getDocumentScannerSelectionName.py | 1 + .../Base_getDocumentScannerSelectionName.xml | 62 + ...etPreferredCropperSettingsFromSelection.py | 12 + ...tPreferredCropperSettingsFromSelection.xml | 62 + .../Base_getTempImageList.py | 16 + .../Base_getTempImageList.xml | 70 + .../Base_postDataToActiveResult.py | 17 + .../Base_postDataToActiveResult.xml | 70 + ...ase_removeActiveProcessFromActivityTool.py | 2 + ...se_removeActiveProcessFromActivityTool.xml | 70 + ..._storeDocumentFromCameraInActiveProcess.py | 47 + ...storeDocumentFromCameraInActiveProcess.xml | 62 + .../Base_uploadDocumentFromCamera.py | 30 + .../Base_uploadDocumentFromCamera.xml | 66 + ...Base_uploadDocumentFromCameraByActivity.py | 18 + ...ase_uploadDocumentFromCameraByActivity.xml | 66 + ...ase_viewUploadDocumentFromCameraDialog.xml | 164 + .../stringfield_validator.xml | 78 + .../your_active_process_url.xml | 96 + .../your_description.xml | 90 + .../your_document_scanner_gadget.xml | 162 + .../your_group.xml | 124 + .../your_language.xml | 105 + .../your_publication_section.xml | 100 + .../your_publication_state.xml | 126 + .../your_reference.xml | 105 + .../your_title.xml | 96 + .../your_version.xml | 109 + .../erp5_document_scanner/cropper.min.css.css | 9 + .../erp5_document_scanner/cropper.min.css.xml | 32 + .../erp5_document_scanner/cropper.min.js.js | 10 + .../erp5_document_scanner/cropper.min.js.xml | 32 + bt5/erp5_document_scanner/bt/dependency_list | 4 + bt5/erp5_document_scanner/bt/license | 1 + .../bt/template_action_path_list | 5 + .../bt/template_format_version | 1 + .../bt/template_keep_workflow_path_list | 3 + .../bt/template_path_list | 3 + .../bt/template_skin_id_list | 1 + bt5/erp5_document_scanner/bt/title | 1 + bt5/erp5_document_scanner/bt/version | 1 + .../renderjs_erp5_document_scanner_zuite.xml | 26 + .../testScanDocument.xml | 58 + .../testScanDocument.zpt | 230 + .../erp5_document_scanner_ui_test.xml | 26 + .../Base_assertActiveProcessHasOneImage.py | 3 + .../Base_assertActiveProcessHasOneImage.xml | 62 + .../Base_enableDocumentScannerTest.py | 1 + .../Base_enableDocumentScannerTest.xml | 62 + .../Base_removeActiveProcessFromFileSystem.py | 5 + ...Base_removeActiveProcessFromFileSystem.xml | 62 + .../test.erp5.testRenderJSDocumentScanner.py | 50 + .../test.erp5.testRenderJSDocumentScanner.xml | 127 + .../bt/copyright_list | 1 + .../bt/dependency_list | 1 + .../bt/description | 1 + bt5/erp5_document_scanner_ui_test/bt/license | 1 + .../bt/template_format_version | 1 + .../bt/template_path_list | 2 + .../bt/template_skin_id_list | 1 + .../bt/template_test_id_list | 1 + bt5/erp5_document_scanner_ui_test/bt/title | 1 + bt5/erp5_document_scanner_ui_test/bt/version | 1 + 75 files changed, 8676 insertions(+) create mode 100644 bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Accounting%20Transaction/scan_document.xml create mode 100644 bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Internal%20Invoice%20Transaction/scan_document.xml create mode 100644 bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Payment%20Transaction/scan_document.xml create mode 100644 bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/scan_document.xml create mode 100644 bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/scan_document.xml create mode 100644 bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css create mode 100644 bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml create mode 100644 bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.html create mode 100644 bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.xml create mode 100644 bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js create mode 100644 bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.py create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/stringfield_validator.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_active_process_url.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_description.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_document_scanner_gadget.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_group.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_language.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_section.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_state.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_reference.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_title.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_version.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.css create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.xml create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.js create mode 100644 bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.xml create mode 100644 bt5/erp5_document_scanner/bt/dependency_list create mode 100644 bt5/erp5_document_scanner/bt/license create mode 100644 bt5/erp5_document_scanner/bt/template_action_path_list create mode 100644 bt5/erp5_document_scanner/bt/template_format_version create mode 100644 bt5/erp5_document_scanner/bt/template_keep_workflow_path_list create mode 100644 bt5/erp5_document_scanner/bt/template_path_list create mode 100644 bt5/erp5_document_scanner/bt/template_skin_id_list create mode 100644 bt5/erp5_document_scanner/bt/title create mode 100644 bt5/erp5_document_scanner/bt/version create mode 100644 bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite.xml create mode 100644 bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.xml create mode 100644 bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.zpt create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test.xml create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.py create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.xml create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.py create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.xml create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.py create mode 100644 bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.xml create mode 100644 bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.py create mode 100644 bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.xml create mode 100644 bt5/erp5_document_scanner_ui_test/bt/copyright_list create mode 100644 bt5/erp5_document_scanner_ui_test/bt/dependency_list create mode 100644 bt5/erp5_document_scanner_ui_test/bt/description create mode 100644 bt5/erp5_document_scanner_ui_test/bt/license create mode 100644 bt5/erp5_document_scanner_ui_test/bt/template_format_version create mode 100644 bt5/erp5_document_scanner_ui_test/bt/template_path_list create mode 100644 bt5/erp5_document_scanner_ui_test/bt/template_skin_id_list create mode 100644 bt5/erp5_document_scanner_ui_test/bt/template_test_id_list create mode 100644 bt5/erp5_document_scanner_ui_test/bt/title create mode 100644 bt5/erp5_document_scanner_ui_test/bt/version diff --git a/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Accounting%20Transaction/scan_document.xml b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Accounting%20Transaction/scan_document.xml new file mode 100644 index 00000000000..3b89e0fdb39 --- /dev/null +++ b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Accounting%20Transaction/scan_document.xml @@ -0,0 +1,96 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_onlyjio_action + + + + + category + object_onlyjio_action + + + condition + + + + description + + + + + + icon + + AAAAAAAAAAM= + + + + id + scan_document + + + permissions + + + View + + + + + priority + 14.0 + + + title + Scan Document + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/Base_viewUploadDocumentFromCameraDialog + + + + + + + + + + + + text + string:${portal_url}/images/video-solid.svg + + + + + diff --git a/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Internal%20Invoice%20Transaction/scan_document.xml b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Internal%20Invoice%20Transaction/scan_document.xml new file mode 100644 index 00000000000..3b89e0fdb39 --- /dev/null +++ b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Internal%20Invoice%20Transaction/scan_document.xml @@ -0,0 +1,96 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_onlyjio_action + + + + + category + object_onlyjio_action + + + condition + + + + description + + + + + + icon + + AAAAAAAAAAM= + + + + id + scan_document + + + permissions + + + View + + + + + priority + 14.0 + + + title + Scan Document + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/Base_viewUploadDocumentFromCameraDialog + + + + + + + + + + + + text + string:${portal_url}/images/video-solid.svg + + + + + diff --git a/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Payment%20Transaction/scan_document.xml b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Payment%20Transaction/scan_document.xml new file mode 100644 index 00000000000..3b89e0fdb39 --- /dev/null +++ b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Payment%20Transaction/scan_document.xml @@ -0,0 +1,96 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_onlyjio_action + + + + + category + object_onlyjio_action + + + condition + + + + description + + + + + + icon + + AAAAAAAAAAM= + + + + id + scan_document + + + permissions + + + View + + + + + priority + 14.0 + + + title + Scan Document + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/Base_viewUploadDocumentFromCameraDialog + + + + + + + + + + + + text + string:${portal_url}/images/video-solid.svg + + + + + diff --git a/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/scan_document.xml b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/scan_document.xml new file mode 100644 index 00000000000..3b89e0fdb39 --- /dev/null +++ b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Purchase%20Invoice%20Transaction/scan_document.xml @@ -0,0 +1,96 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_onlyjio_action + + + + + category + object_onlyjio_action + + + condition + + + + description + + + + + + icon + + AAAAAAAAAAM= + + + + id + scan_document + + + permissions + + + View + + + + + priority + 14.0 + + + title + Scan Document + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/Base_viewUploadDocumentFromCameraDialog + + + + + + + + + + + + text + string:${portal_url}/images/video-solid.svg + + + + + diff --git a/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/scan_document.xml b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/scan_document.xml new file mode 100644 index 00000000000..3b89e0fdb39 --- /dev/null +++ b/bt5/erp5_document_scanner/ActionTemplateItem/portal_types/Sale%20Invoice%20Transaction/scan_document.xml @@ -0,0 +1,96 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_onlyjio_action + + + + + category + object_onlyjio_action + + + condition + + + + description + + + + + + icon + + AAAAAAAAAAM= + + + + id + scan_document + + + permissions + + + View + + + + + priority + 14.0 + + + title + Scan Document + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/Base_viewUploadDocumentFromCameraDialog + + + + + + + + + + + + text + string:${portal_url}/images/video-solid.svg + + + + + diff --git a/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css new file mode 100644 index 00000000000..1e8f71c8865 --- /dev/null +++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.css @@ -0,0 +1,82 @@ +.device-selector { + text-align: center; + font-size: 19px; +} + +div[data-gadget-scope="field_your_document_scanner_gadget"] { + text-align: center; +} + +.video, .photo, .camera-output { + max-width: 100%; + width: auto; + max-height: 500px; + filter: brightness(1); + text-align: center; +} + +.camera-input, .camera-output { + min-height: 360px; +} + +.canvas { + display: none; + filter: brightness(1); +} + +.page-number { + display: inline; +} + +.camera-header { + font-size: 12pt; + font-weight: 400; +} + +.camera-input, .camera-output, .camera-header, .edit-picture { + text-align: center; +} + +.camera, .camera-input, .camera-output { + display: inline-block; +} + +.capture-button, .reset-button { + display: inline; + margin: 0 2em 0 2em; +} + +.startbutton { + display: block; + margin: 0 auto; +} + +.reset-btn, .confirm-btn, .edit-btn, .take-picture-btn, + .capture-btn, .change-camera-btn, .confirm-btn { + color: #212529; + padding: 3pt; + border: 1px solid rgba(0, 0, 0, 0.14); + border-radius: 0.325em; +} + +.take-picture-btn, .capture-btn, .confirm-btn, + .reset-btn, .confirm-btn, .change-camera-btn, .edit-btn { + display: none; +} + +.contentarea { + font-size: 16px; + font-family: "Lucida Grande", "Arial", sans-serif; + width: 760px; +} + +button:disabled, +button[disabled]{ + color: #999999; +} + +@media only screen and (max-width: 600px) { + body { + max-height: 360px; + } +} \ No newline at end of file diff --git a/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml new file mode 100644 index 00000000000..c6199c4c493 --- /dev/null +++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_css.xml @@ -0,0 +1,469 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + content_type + text/css + + + default_reference + gadget_document_scanner.css + + + description + + + + + + id + rjs_gadget_document_scanner_css + + + language + + + + + + portal_type + Web Style + + + short_title + + + + + + title + Gadget Document Scanner CSS + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + _log + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1574261202.27 + UTC + + + + + + + validation_state + draft + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + 1574261323.29 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + _log + + + + + action + edit + + + actor + zope + + + comment + + + + error_message + + + + serial + 0.0.0.0 + + + state + current + + + time + + + + + + + + + + + 1574261202.26 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60822.46188.23978 + + + state + current + + + time + + + + + + + + + 1574261231.12 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60823.12148.22101 + + + state + current + + + time + + + + + + + + + 1574261265.43 + UTC + + + + + + + + + + + + + + + + + + + + _log + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + empty + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1574261202.27 + UTC + + + + + + + + + + + + + diff --git a/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.html b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.html new file mode 100644 index 00000000000..228ad7b6343 --- /dev/null +++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.html @@ -0,0 +1,43 @@ + + + + + + + + + + + Gadget Document Scanner + + +
+
+

Page

+
+ + + +
+ + + + + +
+
+ + \ No newline at end of file diff --git a/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.xml b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.xml new file mode 100644 index 00000000000..cfc452a2cf0 --- /dev/null +++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.xml @@ -0,0 +1,649 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + content_type + text/html + + + default_reference + gadget_document_scanner.html + + + description + + + + + + id + rjs_gadget_document_scanner_html + + + language + + + + + + portal_type + Web Page + + + short_title + + + + + + title + Gadget Document Scanner + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + _log + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1574261595.83 + UTC + + + + + + + validation_state + draft + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + 1574261995.43 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + _log + + + + + action + edit + + + actor + zope + + + comment + + + + error_message + + + + serial + 0.0.0.0 + + + state + current + + + time + + + + + + + + + + + 1574261595.83 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60829.17295.36334 + + + state + current + + + time + + + + + + + + + 1574261616.19 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60829.39532.12458 + + + state + current + + + time + + + + + + + + + 1574261638.39 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60835.60550.28808 + + + state + current + + + time + + + + + + + + + 1574262871.91 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60850.34860.27477 + + + state + current + + + time + + + + + + + + + 1574263390.85 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 980.2211.58828.61730 + + + state + current + + + time + + + + + + + + + 1574679628.14 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 980.2260.30741.13158 + + + state + current + + + time + + + + + + + + + 1574679704.62 + UTC + + + + + + + + + + + + + + + + + + + + _log + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + empty + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1574261595.83 + UTC + + + + + + + + + + + + + diff --git a/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js new file mode 100644 index 00000000000..d3a3a7bdbf4 --- /dev/null +++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.js @@ -0,0 +1,365 @@ +/*jslint indent: 2 */ +/*global rJS, RSVP, window, navigator, Cropper, Promise, JSON, jIO*/ +(function (rJS, RSVP, window, navigator, Cropper, Promise, JSON, jIO) { + "use strict"; + + function drawCanvas(gadget, img) { + var ratio, x, y, + root = gadget.element, + canvas = root.querySelector("canvas"); + canvas.width = gadget.props.image_width; + canvas.height = gadget.props.image_height; + ratio = Math.min(canvas.width / img.width, canvas.height / img.height); + x = (canvas.width - img.width * ratio) / 2; + y = (canvas.height - img.height * ratio) / 2; + + canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height); + canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height, x, y, img.width * ratio, img.height * ratio); + + //contrastImage(canvas, canvas, 10); + + root.querySelector(".camera-output").style.display = ""; + if (gadget.props.cropper) { + gadget.props.cropper.destroy(); + } + gadget.props.cropper = new Cropper(root.querySelector('.photo'), { + data: gadget.props.preferred_cropped_canvas_data + }); + } + + function takePicture(gadget) { + var el = gadget.element, + image_capture = gadget.props.image_capture; + return new RSVP.Queue() + .push(function () { + return image_capture.takePhoto({imageWidth: gadget.props.image_width}); + }) + .push(function (blob) { + return jIO.util.readBlobAsDataURL(blob); + }) + .push(function (result) { + var photoInput = el.querySelector(".photoInput"), + photo = el.querySelector("img"), + data_str = result.target.result; + + photo.setAttribute("src", data_str); + photoInput.setAttribute("value", data_str.split(",")[1]); + return drawCanvas(gadget, photo); + }); + } + + function enableButton(root) { + [".reset-btn", ".take-picture-btn", + ".confirm-btn", ".change-camera-btn"].forEach(function (e) { + root.querySelector(e).disabled = false; + }); + } + + function setPageOne(gadget) { + var root = gadget.element; + root.querySelector(".page-number").innerText = gadget.props.page_number; + root.querySelector(".reset-btn").style.display = "none"; + root.querySelector(".take-picture-btn").style.display = "inline-block"; + root.querySelector(".confirm-btn").style.display = "none"; + root.querySelector(".camera-input").style.display = ""; + if (gadget.props.camera_list.length > 1) { + root.querySelector(".change-camera-btn").style.display = "inline-block"; + } + return enableButton(root); + } + + function setPageTwo(root) { + root.querySelector(".reset-btn").style.display = "inline-block"; + root.querySelector(".confirm-btn").style.display = "inline-block"; + root.querySelector(".take-picture-btn").style.display = "none"; + root.querySelector(".camera-input").style.display = "none"; + root.querySelector(".camera-output").style.display = ""; + root.querySelector(".change-camera-btn").style.display = "none"; + } + + function disableButton(root) { + [".reset-btn", ".take-picture-btn", + ".confirm-btn", ".change-camera-btn"].forEach(function (e) { + root.querySelector(e).disabled = true; + }); + } + + /*function contrastImage(input, output, contrast) { + var i, + outputContext, + inputContext = input.getContext("2d"), + imageData = inputContext.getImageData(0, 0, input.width, input.height), + data = imageData.data, + factor = (259 * (contrast + 255)) / (255 * (259 - contrast)); + + for (i = 0; i < data.length; i += 4) { + data[i] = factor * (data[i] - 128) + 128; + data[i + 1] = factor * (data[i + 1] - 128) + 128; + data[i + 2] = factor * (data[i + 2] - 128) + 128; + } + outputContext = output.getContext("2d"); + outputContext.putImageData(imageData, 0, 0); + }*/ + + /*function grayscale(input, output) { + var i, + gray, + outputContext, + outputCanvas = document.createElement("canvas"), + inputContext = input.getContext("2d"), + imageData = inputContext.getImageData(0, 0, input.width, input.height), + data = imageData.data, + arraylength = input.width * input.height * 4; + + //gray = 0.3*R + 0.59*G + 0.11*B + // http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/ + for (i = arraylength - 1; i > 0; i -= 4) { + gray = 0.3 * data[i - 3] + 0.59 * data[i - 2] + 0.11 * data[i - 1]; + data[i - 3] = gray; + data[i - 2] = gray; + data[i - 1] = gray; + } + outputContext = outputCanvas.getContext("2d"); + outputContext.putImageData(imageData, 0, 0); + + data = canvas.toDataURL("image/png"); + output.setAttribute("src", data); + if (cropper) { + cropper.destroy(); + } + return new RSVP.Queue() + .push(function () { + cropper = new Cropper( + output, + { + data: preferred_cropped_canvas_data + } + ); + }); + }*/ + + function handleUserMedia(gadget, callback) { + var stream, + video = gadget.props.video; + + video.autoplay = "autoplay"; + + function canceller() { + if (stream !== undefined) { + // Stop the streams + stream.getTracks().forEach(function (track) { + track.stop(); + }); + } + } + + function waitForStream() { + return new RSVP.Queue() + .push(function () { + return navigator.mediaDevices.getUserMedia({ + video: { + deviceId: { + exact: gadget.props.device_id + } + } + }); + }) + .push(function (mediaStream) { + stream = mediaStream; + video.srcObject = mediaStream; + return callback(gadget, stream); + }) + .push(undefined, function (error) { + if (!(error instanceof RSVP.CancellationError)) { + canceller(); + } + }); + } + + return new RSVP.Promise(waitForStream, canceller); + } + + function gotStream(gadget, mediaStream) { + return new RSVP.Queue() + .push(function () { + var image_capture; + image_capture = new window.ImageCapture(mediaStream.getVideoTracks()[0]); + gadget.props.image_capture = image_capture; + return image_capture.getPhotoCapabilities(); + }) + .push(function (photoCapabilities) { + gadget.props.image_width = photoCapabilities.imageWidth.max; + gadget.props.image_height = photoCapabilities.imageHeight.max; + return gadget.props.video.play(); + }) + .push(function () { + return setPageOne(gadget); + }); + } + + function startStream(gadget) { + return handleUserMedia(gadget, gotStream); + } + + rJS(window) + .declareAcquiredMethod( + "submitDialogWithCustomDialogMethod", + "submitDialogWithCustomDialogMethod" + ) + .declareAcquiredMethod("getTranslationList", "getTranslationList") + .declareAcquiredMethod("notifySubmitted", "notifySubmitted") + .declareJob("startStream", function () { + return startStream(this); + }) + .ready(function () { + this.props = { + video: this.element.querySelector(".video") + }; + }) + .declareMethod('render', function (options) { + var root = this.element, + camera_list = [], + gadget = this; + + return this.getTranslationList(["Webcam is not available", "Reset", "Take Picture", "Confirm", "Edit", "Change Camera"]) + .push(function (result_list) { + var i, + button_list = root.querySelectorAll("button"); + for (i = 0; i < button_list.length; i += 1) { + button_list[i].innerText = " " + result_list[i + 1]; + } + root.querySelector("video").innerText = result_list[0]; + }) + .push(function () { + var preferred_cropped_canvas_data = gadget.props.preferred_cropped_canvas_data; + preferred_cropped_canvas_data = preferred_cropped_canvas_data || JSON.parse(options.preferred_cropped_canvas_data); + gadget.props.dialog_method = preferred_cropped_canvas_data.dialog_method; + // Clear photo input + root.querySelector('.photoInput').value = ""; + gadget.props.page_number = parseInt(root.querySelector('input[name="page-number"]').value, 10); + root.querySelector(".camera-input").style.display = ""; + root.querySelector(".camera-output").style.display = "none"; + + if (!navigator.mediaDevices) { + throw ("mediaDevices is not supported"); + } + gadget.props.preferred_cropped_canvas_data = preferred_cropped_canvas_data; + return navigator.mediaDevices.enumerateDevices(); + }) + .push(function (info_list) { + var j, + device, + len = info_list.length; + + if (camera_list.length === 0) { + for (j = 0; j < len; j += 1) { + device = info_list[j]; + if (device.kind === 'videoinput') { + camera_list.push(device); + } + } + } + if (camera_list.length >= 1) { + // trick to select back camera in mobile + gadget.props.device_id = camera_list[camera_list.length - 1].deviceId; + } + gadget.props.camera_list = camera_list; + return gadget.startStream(); + }); + }) + .declareMethod('getContent', function () { + var input = this.element.querySelector('.photoInput'), + result = {}; + + result.field_your_document_scanner_gadget = JSON.stringify({ + "input_value": input.value, + "preferred_cropped_canvas_data": this.props.preferred_cropped_canvas_data + }); + return result; + }) + .onEvent("click", function (evt) { + var e, + new_preferred_cropped_canvas_data, + gadget = this, + camera_list = this.props.camera_list, + root = this.element; + + /*if (evt.target.name === "grayscale") { + return grayscale(root.querySelector(".canvas"), + root.querySelector('.photo')); + }*/ + if (evt.target.className.indexOf("change-camera-btn") !== -1) { + evt.preventDefault(); + + for (e in camera_list) { + if (camera_list.hasOwnProperty(e)) { + if (camera_list[e].deviceId !== gadget.props.device_id) { + gadget.props.device_id = camera_list[e].deviceId; + break; + } + } + } + gadget.startStream(); + } + if (evt.target.className.indexOf("take-picture-btn") !== -1) { + evt.preventDefault(); + return new RSVP.Queue() + .push(function () { + disableButton(root); + root.querySelector(".camera").style.maxWidth = gadget.props.video.offsetWidth + "px"; + return takePicture(gadget); + }) + .push(function () { + root.querySelector(".camera-input").style.display = "none"; + setPageTwo(root); + enableButton(root); + }); + } + if (evt.target.className.indexOf("reset-btn") !== -1) { + evt.preventDefault(); + root.querySelector(".camera-input").style.display = ""; + root.querySelector(".camera-output").style.display = "none"; + root.querySelector('.photoInput').value = ""; + gadget.props.cropper.destroy(); + return setPageOne(gadget); + } + if (evt.target.className.indexOf("confirm-btn") !== -1) { + evt.preventDefault(); + new_preferred_cropped_canvas_data = gadget.props.cropper.getData(); + for (e in new_preferred_cropped_canvas_data) { + if (new_preferred_cropped_canvas_data.hasOwnProperty(e)) { + gadget.props.preferred_cropped_canvas_data[e] = new_preferred_cropped_canvas_data[e]; + } + } + return new RSVP.Queue() + .push(function () { + var canvas = gadget.props.cropper.getCroppedCanvas(); + disableButton(gadget.element); + return new Promise(function (resolve) { + canvas.toBlob(function (blob) { + resolve(blob); + }, 'image/jpeg', 0.85); + }); + }) + .push(function (blob) { + return jIO.util.readBlobAsDataURL(blob); + }) + .push(function (result) { + var base64data = result.target.result, + block = base64data.split(";"), + realData = block[1].split(",")[1]; + root.querySelector(".photo").src = base64data; + root.querySelector(".photoInput").value = realData; + gadget.props.cropper.destroy(); + }) + .push(function () { + return gadget.submitDialogWithCustomDialogMethod(gadget.props.dialog_method); + }) + .push(function () { + gadget.props.page_number = gadget.props.page_number + 1; + root.querySelector('input[name="page-number"]').value = gadget.props.page_number; + }); + } + }, false, false); + +}(rJS, RSVP, window, navigator, Cropper, Promise, JSON, jIO)); \ No newline at end of file diff --git a/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml new file mode 100644 index 00000000000..c39335a5aa8 --- /dev/null +++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_js.xml @@ -0,0 +1,3710 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + content_type + application/javascript + + + default_reference + gadget_document_scanner.js + + + description + + + + + + id + rjs_gadget_document_scanner_js + + + language + + + + + + portal_type + Web Script + + + short_title + + + + + + title + Gadget Document Scanner JS + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + _log + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1574261340.43 + UTC + + + + + + + validation_state + draft + + + + + action + publish_alive + + + actor + zope + + + comment + + + + error_message + + + + time + + + + + + + + + 1574261409.0 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + _log + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62034.26107.12646 + + + state + current + + + time + + + + + + + + + + + 1574334426.15 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62043.6727.63897 + + + state + current + + + time + + + + + + + + + 1574334434.07 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62043.15372.1979 + + + state + current + + + time + + + + + + + + + 1574334459.67 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62043.43339.58368 + + + state + current + + + time + + + + + + + + + 1574334473.18 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62043.58096.27869 + + + state + current + + + time + + + + + + + + + 1574334938.08 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62051.41603.16452 + + + state + current + + + time + + + + + + + + + 1574334949.25 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62051.53805.39168 + + + state + current + + + time + + + + + + + + + 1574335000.76 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62052.44527.12595 + + + state + current + + + time + + + + + + + + + 1574335009.11 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62052.53648.38587 + + + state + current + + + time + + + + + + + + + 1574335034.19 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62053.15499.63539 + + + state + current + + + time + + + + + + + + + 1574335260.18 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62057.201.30139 + + + state + current + + + time + + + + + + + + + 1574335275.2 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62057.16612.7850 + + + state + current + + + time + + + + + + + + + 1574335306.78 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62057.51100.60962 + + + state + current + + + time + + + + + + + + + 1574335319.75 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62057.65272.3805 + + + state + current + + + time + + + + + + + + + 1574335338.51 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62058.20221.31044 + + + state + current + + + time + + + + + + + + + 1574335518.14 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62061.19823.20002 + + + state + current + + + time + + + + + + + + + 1574339757.58 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62131.62904.38792 + + + state + current + + + time + + + + + + + + + 1574339781.65 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62132.23662.32563 + + + state + current + + + time + + + + + + + + + 1574339815.15 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62132.60242.36198 + + + state + current + + + time + + + + + + + + + 1574339853.78 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62133.36904.64409 + + + state + current + + + time + + + + + + + + + 1574341175.19 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62155.38441.25361 + + + state + current + + + time + + + + + + + + + 1574341251.38 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62156.56125.51746 + + + state + current + + + time + + + + + + + + + 1574341335.11 + UTC + + + + + + + + + + + _next + + AAAAAAAAAAY= + + + + _prev + + AAAAAAAAAAY= + + + + _tail_count + 52 + + + + + + + + + + + + _log + + + + + action + + + + + + actor + zope + + + comment + + + + error_message + + + + external_processing_state + empty + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1574261340.43 + UTC + + + + + + + + + + + + + + + + + + + + _log + + + + + action + edit + + + actor + zope + + + comment + + + + error_message + + + + serial + 0.0.0.0 + + + state + current + + + time + + + + + + + + + + + 1574261340.43 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60825.480.48810 + + + state + current + + + time + + + + + + + + + 1574261356.64 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60825.46120.29849 + + + state + current + + + time + + + + + + + + + 1574261398.96 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60826.9837.15291 + + + state + current + + + time + + + + + + + + + 1574261577.9 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60828.63254.50278 + + + state + current + + + time + + + + + + + + + 1574262365.84 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60842.6386.64017 + + + state + current + + + time + + + + + + + + + 1574262388.11 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60842.30711.49083 + + + state + current + + + time + + + + + + + + + 1574262460.21 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60843.43928.56746 + + + state + current + + + time + + + + + + + + + 1574262462.44 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60843.43928.56746 + + + state + current + + + time + + + + + + + + + 1574263610.67 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60862.55352.10837 + + + state + current + + + time + + + + + + + + + 1574263793.54 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60865.58483.62873 + + + state + current + + + time + + + + + + + + + 1574263803.34 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60866.3654.22835 + + + state + current + + + time + + + + + + + + + 1574263914.73 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60867.59788.15547 + + + state + current + + + time + + + + + + + + + 1574263994.48 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60869.15817.48384 + + + state + current + + + time + + + + + + + + + 1574264044.06 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60870.4440.37973 + + + state + current + + + time + + + + + + + + + 1574264065.96 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60870.28365.56046 + + + state + current + + + time + + + + + + + + + 1574264073.08 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60870.36143.59784 + + + state + current + + + time + + + + + + + + + 1574264140.93 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.60870.36143.59784 + + + state + current + + + time + + + + + + + + + 1574328581.59 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61945.45445.19456 + + + state + current + + + time + + + + + + + + + 1574328759.88 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61948.43567.53623 + + + state + current + + + time + + + + + + + + + 1574328864.83 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61950.27123.63556 + + + state + current + + + time + + + + + + + + + 1574328881.2 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61950.45006.25873 + + + state + current + + + time + + + + + + + + + 1574328921.25 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61950.45006.25873 + + + state + current + + + time + + + + + + + + + 1574329058.14 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61953.41665.18483 + + + state + current + + + time + + + + + + + + + 1574329244.42 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61956.48527.26880 + + + state + current + + + time + + + + + + + + + 1574329481.16 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61960.44965.38075 + + + state + current + + + time + + + + + + + + + 1574329491.66 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61960.56435.41181 + + + state + current + + + time + + + + + + + + + 1574329517.12 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61961.18710.238 + + + state + current + + + time + + + + + + + + + 1574329524.83 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61961.27126.52992 + + + state + current + + + time + + + + + + + + + 1574329548.23 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61961.52681.35140 + + + state + current + + + time + + + + + + + + + 1574329610.14 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61962.54770.6109 + + + state + current + + + time + + + + + + + + + 1574329618.9 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61962.64337.54272 + + + state + current + + + time + + + + + + + + + 1574329630.75 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61963.11749.30293 + + + state + current + + + time + + + + + + + + + 1574329651.09 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61963.33962.34389 + + + state + current + + + time + + + + + + + + + 1574329665.75 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61963.49975.1860 + + + state + current + + + time + + + + + + + + + 1574329684.61 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61964.5044.3515 + + + state + current + + + time + + + + + + + + + 1574329725.87 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61964.50110.5427 + + + state + current + + + time + + + + + + + + + 1574329792.87 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.61965.57749.53930 + + + state + current + + + time + + + + + + + + + 1574333504.33 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62027.48424.22186 + + + state + current + + + time + + + + + + + + + 1574333540.39 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62028.22281.31658 + + + state + current + + + time + + + + + + + + + 1574333546.63 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62028.29088.60535 + + + state + current + + + time + + + + + + + + + 1574333578.09 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62028.63457.3959 + + + state + current + + + time + + + + + + + + + 1574333588.59 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62029.9391.19456 + + + state + current + + + time + + + + + + + + + 1574333680.86 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62030.44640.11980 + + + state + current + + + time + + + + + + + + + 1574333691.05 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62030.55770.24268 + + + state + current + + + time + + + + + + + + + 1574333695.51 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62030.55770.24268 + + + state + current + + + time + + + + + + + + + 1574333703.68 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62030.55770.24268 + + + state + current + + + time + + + + + + + + + 1574333724.09 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62031.26316.48913 + + + state + current + + + time + + + + + + + + + 1574333754.93 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62031.60011.63180 + + + state + current + + + time + + + + + + + + + 1574333791.01 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62032.33877.17049 + + + state + current + + + time + + + + + + + + + 1574333800.61 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62032.44371.3805 + + + state + current + + + time + + + + + + + + + 1574333880.66 + UTC + + + + + + + + + action + edit + + + actor + zope + + + comment + + + + + + error_message + + + + serial + 979.62034.728.43673 + + + state + current + + + time + + + + + + + + + 1574333903.9 + UTC + + + + + + + + + + + _next + + AAAAAAAAAAQ= + + + + _prev + + AAAAAAAAAAQ= + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner.xml new file mode 100644 index 00000000000..d4cf74a2e58 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + erp5_document_scanner + + + title + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.py new file mode 100644 index 00000000000..95395d0cbd3 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.py @@ -0,0 +1 @@ +return "document_scanner_selection" diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.xml new file mode 100644 index 00000000000..b21e56b4e5a --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getDocumentScannerSelectionName.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + Base_getDocumentScannerSelectionName + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.py new file mode 100644 index 00000000000..9fd6782b15f --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.py @@ -0,0 +1,12 @@ +import json + +portal = context.getPortalObject() + +selection_mapping = portal.portal_selections.getSelectionParamsFor( + context.Base_getDocumentScannerSelectionName(), + REQUEST=context.REQUEST) or {} + +canvas_data = selection_mapping.get(context.REQUEST["HTTP_USER_AGENT"]) or {} +canvas_data["dialog_method"] = context.Base_storeDocumentFromCameraInActiveProcess.getId() + +return json.dumps(canvas_data) diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.xml new file mode 100644 index 00000000000..7cd4da75814 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getPreferredCropperSettingsFromSelection.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + Base_getPreferredCropperSettingsFromSelection + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.py new file mode 100644 index 00000000000..9bf0f212ec7 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.py @@ -0,0 +1,16 @@ +""" + Proxy role as Manager is required here to access getResultList +""" +if REQUEST: + return RuntimeError("You cannot run this script in the url") + +image_module = context.getPortalObject().image_module +pdf_data_list = [] + +for result in active_process.getResultList(): + pdf_data_list.append( + image_module.newContent(data=result.detail, + portal_type="Image", + temp_object=True).convert(format="pdf")[1]) + +return pdf_data_list diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.xml new file mode 100644 index 00000000000..2b1fd5a7338 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_getTempImageList.xml @@ -0,0 +1,70 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + active_process, REQUEST=None + + + _proxy_roles + + + Manager + + + + + id + Base_getTempImageList + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.py new file mode 100644 index 00000000000..19b37877ad0 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.py @@ -0,0 +1,17 @@ +""" + We need proy role as manager to create a new active process + and post active result +""" +portal = context.getPortalObject() + +if REQUEST: + return RuntimeError("You cannot run this script in the url") + +if active_process_url: + active_process = portal.restrictedTraverse(active_process_url) +else: + active_process = portal.portal_activities.newActiveProcess() + +active_process.postActiveResult(detail=detail) + +return active_process diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.xml new file mode 100644 index 00000000000..aebf41d96ca --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.xml @@ -0,0 +1,70 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + active_process_url, detail, REQUEST=None, **kw + + + _proxy_roles + + + Manager + + + + + id + Base_postDataToActiveResult + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.py new file mode 100644 index 00000000000..5ddd3718c0c --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.py @@ -0,0 +1,2 @@ +context.getPortalObject().portal_activities.manage_delObjects( + ids=[active_process.getId(),]) diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.xml new file mode 100644 index 00000000000..7d180b28ae5 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_removeActiveProcessFromActivityTool.xml @@ -0,0 +1,70 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + active_process + + + _proxy_roles + + + Manager + + + + + id + Base_removeActiveProcessFromActivityTool + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.py new file mode 100644 index 00000000000..d39242917ec --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.py @@ -0,0 +1,47 @@ +import json +from base64 import decodestring +portal = context.getPortalObject() + +translateString = portal.Base_translateString + +gadget_data = json.loads(document_scanner_gadget) +image_str = decodestring(gadget_data.pop("input_value")) +preferred_cropped_canvas_data = gadget_data["preferred_cropped_canvas_data"] or {} + +selection_mapping = portal.portal_selections.getSelectionParamsFor( + context.Base_getDocumentScannerSelectionName(), + REQUEST=context.REQUEST) or {} + +http_user_agent = context.REQUEST["HTTP_USER_AGENT"] +selection_mapping[http_user_agent] = preferred_cropped_canvas_data + +portal.portal_selections.setSelectionParamsFor( + context.Base_getDocumentScannerSelectionName(), + selection_mapping, + context.REQUEST +) + +if not image_str: + if batch_mode: + if active_process_url: + return portal.restrictedTraverse(active_process_url) + return None + + return context.Base_renderForm('Base_viewUploadDocumentFromCameraDialog', + message=translateString('Nothing to capture')) + +active_process = context.Base_postDataToActiveResult( + active_process_url, + image_str) + +# We need it to fill the form rendered by renderjs +context.REQUEST.form["your_active_process_url"] = active_process.getRelativeUrl() +# We remove it to reduce the size of the response +context.REQUEST.form.pop("field_your_document_scanner_gadget") +context.REQUEST.form.pop('document_scanner_gadget') + +if batch_mode: + return active_process + +return context.Base_renderForm('Base_viewUploadDocumentFromCameraDialog', + message=translateString('Captured')) diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.xml new file mode 100644 index 00000000000..43144fc3140 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + classification=None, synchronous_metadata_discovery=None, cancel_url=None, batch_mode=False, editable_mode=1, group=None, publication_section=None, document_scanner_gadget=None, active_process_url=None, **kw + + + id + Base_storeDocumentFromCameraInActiveProcess + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.py new file mode 100644 index 00000000000..32cdbc78161 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.py @@ -0,0 +1,30 @@ +from StringIO import StringIO + +class StringIOWithFileName(StringIO): + filename = "{}.pdf".format( + kw.get("title") or DateTime().strftime('%d-%m-%Y_%Hh%M')) + +portal = context.getPortalObject() +active_process = portal.restrictedTraverse(active_process_url) + +pdf_data_list = context.Base_getTempImageList(active_process) +pdf_data = context.ERP5Site_mergePDFList(pdf_data_list=pdf_data_list) +file_object = StringIOWithFileName(pdf_data) + +doc = context.Base_contribute(file=file_object, + batch_mode=True, + redirect_to_document=False, + follow_up_list=[context.getRelativeUrl(),], + **kw) + +if publication_state == "shared": + action_list = ["share",] +elif publication_state == "released": + action_list = ["share", "release"] +else: + action_list = [] + +for action in action_list: + getattr(doc, action)() + +context.Base_removeActiveProcessFromActivityTool(active_process) diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.xml new file mode 100644 index 00000000000..0c0905377cf --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCamera.xml @@ -0,0 +1,66 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + publication_state, active_process_url=None, **kw + + + id + Base_uploadDocumentFromCamera + + + title + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.py b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.py new file mode 100644 index 00000000000..88daa42965f --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.py @@ -0,0 +1,18 @@ +portal = context.getPortalObject() +translateString = portal.Base_translateString + +active_process = context.Base_storeDocumentFromCameraInActiveProcess( + active_process_url=active_process_url, + batch_mode=True, + **kw) + +# Avoid to pass huge images to the activity +kw.pop("your_document_scanner_gadget", None) + +context.activate().Base_uploadDocumentFromCamera( + active_process_url=active_process.getRelativeUrl(), + **kw) + +return context.Base_redirect('view', + keep_items={'portal_status_message': + translateString('The document is being created in background.')}) diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.xml new file mode 100644 index 00000000000..79f84fcd9d9 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.xml @@ -0,0 +1,66 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + active_process_url=None, **kw + + + id + Base_uploadDocumentFromCameraByActivity + + + title + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml new file mode 100644 index 00000000000..7495b0edfd0 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml @@ -0,0 +1,164 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + + + + + + + + _objects + + + + + + action + Base_uploadDocumentFromCameraByActivity + + + description + + + + edit_order + + + + + + encoding + UTF-8 + + + enctype + multipart/form-data + + + group_list + + + left + right + center + bottom + hidden + + + + + groups + + + + bottom + + + + + + center + + + + + + hidden + + + stringfield_validator + + + + + left + + + your_active_process_url + your_document_scanner_gadget + + + + + right + + + your_title + your_reference + your_language + your_version + your_group + your_publication_section + your_publication_state + your_description + + + + + + + + id + Base_viewUploadDocumentFromCameraDialog + + + method + POST + + + name + Base_viewUploadDocumentFromCameraDialog + + + pt + form_dialog + + + row_length + 4 + + + stored_encoding + UTF-8 + + + title + Create PDF + + + unicode_mode + 0 + + + update_action + + + + update_action_title + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/stringfield_validator.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/stringfield_validator.xml new file mode 100644 index 00000000000..d6b5bb1db14 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/stringfield_validator.xml @@ -0,0 +1,78 @@ + + + + + + + + + + delegated_list + + + + + + id + stringfield_validator + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + + + + tales + + + + field_id + + + + form_id + + + + + + + values + + + + field_id + my_view_mode_title + + + form_id + Base_viewFieldLibrary + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_active_process_url.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_active_process_url.xml new file mode 100644 index 00000000000..b12726a259e --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_active_process_url.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + hidden + + + + + id + your_active_process_url + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + hidden + 1 + + + target + Click to edit the target + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_description.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_description.xml new file mode 100644 index 00000000000..93e0b79468f --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_description.xml @@ -0,0 +1,90 @@ + + + + + + + + + + delegated_list + + + + + + id + your_description + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + field_id + my_description + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_document_scanner_gadget.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_document_scanner_gadget.xml new file mode 100644 index 00000000000..3df51736aa2 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_document_scanner_gadget.xml @@ -0,0 +1,162 @@ + + + + + + + + + + delegated_list + + + gadget_url + renderjs_extra + title + validator_field_id + + + + + id + your_document_scanner_gadget + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + + + + tales + + + + field_id + + + + form_id + + + + gadget_url + + AAAAAAAAAAI= + + + + renderjs_extra + + AAAAAAAAAAM= + + + + title + + AAAAAAAAAAQ= + + + + validator_field_id + + + + + + + values + + + + field_id + my_gadget_field + + + form_id + Base_viewFieldLibrary + + + gadget_url + + + + renderjs_extra + + + + + + title + Gadget + + + validator_field_id + stringfield_validator + + + + + + + + + + + + + + + _text + string: gadget_document_scanner.html + + + + + + + + + + + + _text + python: [(\'preferred_cropped_canvas_data\', context.Base_getPreferredCropperSettingsFromSelection()),] + + + + + + + + + + + + _text + string: + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_group.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_group.xml new file mode 100644 index 00000000000..e0a4c68986f --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_group.xml @@ -0,0 +1,124 @@ + + + + + + + + + + delegated_list + + + default + title + + + + + id + your_group + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + default + + AAAAAAAAAAI= + + + + field_id + + + + form_id + + + + target + + + + title + + + + + + + values + + + + default + + + + field_id + my_dialog_mode_category + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Group + + + + + + + + + + + + + + + _text + python: context.getProperty(\'group\') or context.getPortalObject().portal_membership.getAuthenticatedMember().getUserValue() is not None and here.getPortalObject().portal_membership.getAuthenticatedMember().getUserValue().getGroup() or \'\' + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_language.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_language.xml new file mode 100644 index 00000000000..59bbde2d7b8 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_language.xml @@ -0,0 +1,105 @@ + + + + + + + + + + delegated_list + + + title + display_width + + + + + id + your_language + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + description + Language of the web page, it uses code like en, fr, ja... + + + display_width + 10 + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Language + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_section.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_section.xml new file mode 100644 index 00000000000..c229b477b99 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_section.xml @@ -0,0 +1,100 @@ + + + + + + + + + + delegated_list + + + title + + + + + id + your_publication_section + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + title + + + + + + + values + + + + field_id + my_dialog_mode_category + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Publication Section + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_state.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_state.xml new file mode 100644 index 00000000000..5b6867598a0 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_publication_state.xml @@ -0,0 +1,126 @@ + + + + + + + + + + delegated_list + + + items + title + + + + + id + your_publication_state + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + items + + AAAAAAAAAAI= + + + + target + + + + title + + + + + + + values + + + + field_id + my_dialog_mode_category + + + form_id + Base_viewFieldLibrary + + + items + + + + + + target + Click to edit the target + + + title + Publication State + + + + + + + + + + + + + + + _text + python: [("", ""),] + [(here.Base_translateString(x), y) for x,y in [("Draft", "draft"), ("Shared", "shared"), ("Released", "released"),]] + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_reference.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_reference.xml new file mode 100644 index 00000000000..b527e4224c5 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_reference.xml @@ -0,0 +1,105 @@ + + + + + + + + + + delegated_list + + + title + display_width + + + + + id + your_reference + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + description + Reference of a document in ERP5, whatever the module considered. Exceptions to this rule can exist, and if so, terms will be described in the appropriate business field of this glossary. For example, the reference of a Payment Transaction has a specific name, as well as the Reference of Purchase and Sale Invoice Transactions. See the appropriate Glossary for further information. + + + display_width + 20 + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Reference + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_title.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_title.xml new file mode 100644 index 00000000000..f21346f76c1 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_title.xml @@ -0,0 +1,96 @@ + + + + + + + + + + delegated_list + + + display_width + + + + + id + your_title + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + field_id + + + + form_id + + + + target + + + + + + + values + + + + display_width + 40 + + + field_id + your_title + + + form_id + Base_viewDialogFieldLibrary + + + target + Click to edit the target + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_version.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_version.xml new file mode 100644 index 00000000000..1f40bb9d675 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog/your_version.xml @@ -0,0 +1,109 @@ + + + + + + + + + + delegated_list + + + display_width + title + + + + + id + your_version + + + message_values + + + + external_validator_failed + The input failed the external validator. + + + + + + overrides + + + + field_id + + + + form_id + + + + target + + + + + + + tales + + + + display_width + + + + field_id + + + + form_id + + + + target + + + + title + + + + + + + values + + + + display_width + 10 + + + field_id + my_string_field + + + form_id + Base_viewFieldLibrary + + + target + Click to edit the target + + + title + Version + + + + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.css b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.css new file mode 100644 index 00000000000..e1fa4a8a760 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.css @@ -0,0 +1,9 @@ +/*! + * Cropper.js v1.5.1 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2019-03-10T09:55:50.492Z + */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed} \ No newline at end of file diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.xml new file mode 100644 index 00000000000..41bc37d86f1 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.css.xml @@ -0,0 +1,32 @@ + + + + + + + + + + _Cacheable__manager_id + http_cache + + + __name__ + cropper.min.css + + + content_type + text/css + + + precondition + + + + title + cropper.min.css + + + + + diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.js b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.js new file mode 100644 index 00000000000..1d897b5770b --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.js @@ -0,0 +1,10 @@ +/*! + * Cropper.js v1.5.1 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2019-03-10T09:55:53.729Z + */ +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t=t||self).Cropper=i()}(this,function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,i){for(var e=0;et.width?3===e?r=t.height*h:s=t.width/h:3===e?s=t.width/h:r=t.height*h;var c={aspectRatio:h,naturalWidth:n,naturalHeight:o,width:r,height:s};c.left=(t.width-r)/2,c.top=(t.height-s)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===e||2===e,this.limitCanvas(!0,!0),this.initialImageData=ot({},i),this.initialCanvasData=ot({},c)},limitCanvas:function(t,i){var e=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=e.viewMode,r=n.aspectRatio,s=this.cropped&&o;if(t){var c=Number(e.minCanvasWidth)||0,d=Number(e.minCanvasHeight)||0;1=a.width&&(n.minLeft=Math.min(0,p),n.maxLeft=Math.max(0,p)),n.height>=a.height&&(n.minTop=Math.min(0,m),n.maxTop=Math.max(0,m))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height},renderCanvas:function(t,i){var e=this.canvasData,a=this.imageData;if(i){var n=function(t){var i=t.width,e=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))return{width:e,height:i};var n=a%90*Math.PI/180,o=Math.sin(n),h=Math.cos(n),r=i*h+e*o,s=i*o+e*h;return 90e.maxWidth||e.widthe.maxHeight||e.heighti.width?n.height=n.width/e:n.width=n.height*e),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*a),n.height=Math.max(n.minHeight,n.height*a),n.left=i.left+(i.width-n.width)/2,n.top=i.top+(i.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=ot({},n)},limitCropBox:function(t,i){var e=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=this.limited,r=e.aspectRatio;if(t){var s=Number(e.minCropBoxWidth)||0,c=Number(e.minCropBoxHeight)||0,d=h?Math.min(a.width,n.width,n.width+n.left,a.width-n.left):a.width,l=h?Math.min(a.height,n.height,n.height+n.top,a.height-n.top):a.height;s=Math.min(s,a.width),c=Math.min(c,a.height),r&&(s&&c?se.maxWidth||e.widthe.maxHeight||e.height=i.width&&e.height>=i.height?E:k),st(this.cropBox,ot({width:e.width,height:e.height},Et({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Mt(this.element,w,this.getData())}},Yt={initPreview:function(){var e=this.crossOrigin,t=this.options.preview,a=e?this.crossOriginUrl:this.url,i=document.createElement("img");if(e&&(i.crossOrigin=e),i.src=a,this.viewBox.appendChild(i),this.viewBoxImage=i,t){var n=t;"string"==typeof t?n=this.element.ownerDocument.querySelectorAll(t):t.querySelector&&(n=[t]),nt(this.previews=n,function(t){var i=document.createElement("img");gt(t,g,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(i.crossOrigin=e),i.src=a,i.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(i)})}},resetPreview:function(){nt(this.previews,function(t){var i=ut(t,g);st(t,{width:i.width,height:i.height}),t.innerHTML=i.html,function(i,e){if(J(i[e]))try{delete i[e]}catch(t){i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch(t){i.dataset[e]=void 0}else i.removeAttribute("data-".concat(mt(e)))}(t,g)})},preview:function(){var r=this.imageData,t=this.canvasData,i=this.cropBoxData,s=i.width,c=i.height,d=r.width,l=r.height,p=i.left-t.left-r.left,m=i.top-t.top-r.top;this.cropped&&!this.disabled&&(st(this.viewBoxImage,ot({width:d,height:l},Et(ot({translateX:-p,translateY:-m},r)))),nt(this.previews,function(t){var i=ut(t,g),e=i.width,a=i.height,n=e,o=a,h=1;s&&(o=c*(h=e/s)),c&&av&&(D.x=v-m);break;case H:c+D.xw&&(D.y=w-u)}};switch(r){case k:c+=D.x,d+=D.y;break;case N:if(0<=D.x&&(v<=m||s&&(d<=f||w<=u))){b=!1;break}B(N),(l+=D.x)<0&&(r=H,c-=l=-l),s&&(p=l/s,d+=(o.height-p)/2);break;case O:if(D.y<=0&&(d<=f||s&&(c<=g||v<=m))){b=!1;break}B(O),p-=D.y,d+=D.y,p<0&&(r=L,d-=p=-p),s&&(l=p*s,c+=(o.width-l)/2);break;case H:if(D.x<=0&&(c<=g||s&&(d<=f||w<=u))){b=!1;break}B(H),l-=D.x,c+=D.x,l<0&&(r=N,c-=l=-l),s&&(p=l/s,d+=(o.height-p)/2);break;case L:if(0<=D.y&&(w<=u||s&&(c<=g||v<=m))){b=!1;break}B(L),(p+=D.y)<0&&(r=O,d-=p=-p),s&&(l=p*s,c+=(o.width-l)/2);break;case z:if(s){if(D.y<=0&&(d<=f||v<=m)){b=!1;break}B(O),p-=D.y,d+=D.y,l=p*s}else B(O),B(N),0<=D.x?m or element.");this.element=t,this.options=ot({},Z,tt(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,i,a;return t=e,a=[{key:"noConflict",value:function(){return window.Cropper=It,e}},{key:"setDefaults",value:function(t){ot(Z,tt(t)&&t)}}],(i=[{key:"init",value:function(){var t,i=this.element,e=i.tagName.toLowerCase();if(!i[d]){if(i[d]=this,"img"===e){if(this.isImg=!0,t=i.getAttribute("src")||"",!(this.originalUrl=t))return;t=i.src}else"canvas"===e&&window.HTMLCanvasElement&&(t=i.toDataURL());this.load(t)}}},{key:"load",value:function(t){var i=this;if(t){this.url=t,this.imageData={};var e=this.element,a=this.options;if(a.rotatable||a.scalable||(a.checkOrientation=!1),a.checkOrientation&&window.ArrayBuffer)if($.test(t))this.read((n=t.replace(Lt,""),o=atob(n),h=new ArrayBuffer(o.length),nt(r=new Uint8Array(h),function(t,i){r[i]=o.charCodeAt(i)}),h));else{var n,o,h,r,s=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,(this.xhr=s).onabort=c,s.onerror=c,s.ontimeout=c,s.onprogress=function(){s.getResponseHeader("content-type")!==q&&s.abort()},s.onload=function(){i.read(s.response)},s.onloadend=function(){i.reloading=!1,i.xhr=null},a.checkCrossOrigin&&kt(t)&&e.crossOrigin&&(t=Tt(t)),s.open("GET",t),s.responseType="arraybuffer",s.withCredentials="use-credentials"===e.crossOrigin,s.send()}else this.clone()}}},{key:"read",value:function(t){var i=this.options,e=this.imageData,a=Ot(t),n=0,o=1,h=1;if(1
';var o=n.querySelector(".".concat(d,"-container")),h=o.querySelector(".".concat(d,"-canvas")),r=o.querySelector(".".concat(d,"-drag-box")),s=o.querySelector(".".concat(d,"-crop-box")),c=s.querySelector(".".concat(d,"-face"));this.container=a,this.cropper=o,this.canvas=h,this.dragBox=r,this.cropBox=s,this.viewBox=o.querySelector(".".concat(d,"-view-box")),this.face=c,h.appendChild(e),ct(t,A),a.insertBefore(o,t.nextSibling),this.isImg||dt(e,l),this.initPreview(),this.bind(),i.initialAspectRatio=Math.max(0,i.initialAspectRatio)||NaN,i.aspectRatio=Math.max(0,i.aspectRatio)||NaN,i.viewMode=Math.max(0,Math.min(3,Math.round(i.viewMode)))||0,ct(s,A),i.guides||ct(s.getElementsByClassName("".concat(d,"-dashed")),A),i.center||ct(s.getElementsByClassName("".concat(d,"-center")),A),i.background&&ct(o,"".concat(d,"-bg")),i.highlight||ct(c,p),i.cropBoxMovable&&(ct(c,m),gt(c,u,k)),i.cropBoxResizable||(ct(s.getElementsByClassName("".concat(d,"-line")),A),ct(s.getElementsByClassName("".concat(d,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(i.dragMode),i.autoCrop&&this.crop(),this.setData(i.data),it(i.ready)&&yt(t,S,i.ready,{once:!0}),Mt(t,S)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),dt(this.element,A))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(t.prototype,i),a&&n(t,a),e}();return ot(jt.prototype,zt,Yt,Xt,Rt,At,St),jt}); \ No newline at end of file diff --git a/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.xml b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.xml new file mode 100644 index 00000000000..85780228681 --- /dev/null +++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/cropper.min.js.xml @@ -0,0 +1,32 @@ + + + + + + + + + + _Cacheable__manager_id + http_cache + + + __name__ + cropper.min.js + + + content_type + application/x-javascript + + + precondition + + + + title + cropper.min.js + + + + + diff --git a/bt5/erp5_document_scanner/bt/dependency_list b/bt5/erp5_document_scanner/bt/dependency_list new file mode 100644 index 00000000000..74b0141315b --- /dev/null +++ b/bt5/erp5_document_scanner/bt/dependency_list @@ -0,0 +1,4 @@ +erp5_web_renderjs_ui +erp5_dms +erp5_accounting +erp5_pdf_merge \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/license b/bt5/erp5_document_scanner/bt/license new file mode 100644 index 00000000000..3a3e12bcad9 --- /dev/null +++ b/bt5/erp5_document_scanner/bt/license @@ -0,0 +1 @@ +GPL \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/template_action_path_list b/bt5/erp5_document_scanner/bt/template_action_path_list new file mode 100644 index 00000000000..1febd2b17a8 --- /dev/null +++ b/bt5/erp5_document_scanner/bt/template_action_path_list @@ -0,0 +1,5 @@ +Accounting Transaction | scan_document +Internal Invoice Transaction | scan_document +Payment Transaction | scan_document +Purchase Invoice Transaction | scan_document +Sale Invoice Transaction | scan_document \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/template_format_version b/bt5/erp5_document_scanner/bt/template_format_version new file mode 100644 index 00000000000..56a6051ca2b --- /dev/null +++ b/bt5/erp5_document_scanner/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/template_keep_workflow_path_list b/bt5/erp5_document_scanner/bt/template_keep_workflow_path_list new file mode 100644 index 00000000000..87e5720ada3 --- /dev/null +++ b/bt5/erp5_document_scanner/bt/template_keep_workflow_path_list @@ -0,0 +1,3 @@ +web_page_module/rjs_gadget_document_scanner_css +web_page_module/rjs_gadget_document_scanner_html +web_page_module/rjs_gadget_document_scanner_js \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/template_path_list b/bt5/erp5_document_scanner/bt/template_path_list new file mode 100644 index 00000000000..87e5720ada3 --- /dev/null +++ b/bt5/erp5_document_scanner/bt/template_path_list @@ -0,0 +1,3 @@ +web_page_module/rjs_gadget_document_scanner_css +web_page_module/rjs_gadget_document_scanner_html +web_page_module/rjs_gadget_document_scanner_js \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/template_skin_id_list b/bt5/erp5_document_scanner/bt/template_skin_id_list new file mode 100644 index 00000000000..575e5ddaff3 --- /dev/null +++ b/bt5/erp5_document_scanner/bt/template_skin_id_list @@ -0,0 +1 @@ +erp5_document_scanner \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/title b/bt5/erp5_document_scanner/bt/title new file mode 100644 index 00000000000..575e5ddaff3 --- /dev/null +++ b/bt5/erp5_document_scanner/bt/title @@ -0,0 +1 @@ +erp5_document_scanner \ No newline at end of file diff --git a/bt5/erp5_document_scanner/bt/version b/bt5/erp5_document_scanner/bt/version new file mode 100644 index 00000000000..ceab6e11ece --- /dev/null +++ b/bt5/erp5_document_scanner/bt/version @@ -0,0 +1 @@ +0.1 \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite.xml b/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite.xml new file mode 100644 index 00000000000..4ed31be5a70 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + renderjs_erp5_document_scanner_zuite + + + title + + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.xml b/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.xml new file mode 100644 index 00000000000..040d96d25b3 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.xml @@ -0,0 +1,58 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + name_subpath + traverse_subpath + + + + + + + + + + + content_type + text/html + + + expand + 0 + + + id + testScanDocument + + + output_encoding + utf-8 + + + title + Test Scan Document (expected failure) + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.zpt b/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.zpt new file mode 100644 index 00000000000..1bc11ec98a2 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/PathTemplateItem/portal_tests/renderjs_erp5_document_scanner_zuite/testScanDocument.zpt @@ -0,0 +1,230 @@ + + + +Test Page Front + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test Page Action Breadcrumb List
open${base_url}/Zuite_waitForActivities
assertTextPresentDone.
open${base_url}/web_site_module/renderjs_runner/
waitForElementPresent//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']
waitForTextPresentModules
click//a[text()="Modules"]
waitForElementPresent//li/a[text()="Accounting"]
click//li/a[text()="Accounting"]
waitForElementPresent//div[@class="ui-subheader"]/ul/li[3]/a[text()="Add"]
click//div[@class="ui-subheader"]/ul/li[3]/a[text()="Add"]
waitForElementPresentname=field_your_select_action
selectid=field_your_select_actionSale Invoice Transaction
clickname=action_confirm
waitForElementPresent//div[@class="ui-subheader"]/ul/li[2]/a[text()="Actions"]
click//div[@class="ui-subheader"]/ul/li[2]/a[text()="Actions"]
waitForElementPresent//a[text()="Scan Document"]
assertEvaltrue == falseThis test is disabled to run automatically. You need to run manually and enable it in Base_enableDocumentScannerTest
click//a[text()="Scan Document"]
waitForElementPresent//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_form_dialog.html']
waitForElementPresentfield_your_title
typefield_your_titleSample
typefield_your_referenceREF
typefield_your_languageen
typefield_your_version001
selectfield_your_publication_sectionFinancial Reports
selectfield_your_publication_stateReleased
typefield_your_descriptionDESC
waitForElementPresent//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]
waitForConditionselenium.browserbot.getCurrentWindow().document.querySelector("video").readyState == 430000
click//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]
waitForConditionselenium.browserbot.getCurrentWindow().document.querySelector(".confirm-btn").style.display != "none"30000
click//button[@class="reset-btn ui-btn-icon-left ui-icon-times"]
waitForConditionselenium.browserbot.getCurrentWindow().document.querySelector(".confirm-btn").style.display == "none"30000
click//button[@class="take-picture-btn ui-btn-icon-left ui-icon-circle"]
waitForConditionselenium.browserbot.getCurrentWindow().document.querySelector(".confirm-btn").style.display != "none"30000
click//button[@class="confirm-btn ui-btn-icon-left ui-icon-check"]
waitForConditionselenium.browserbot.getCurrentWindow().document.querySelector(".page-number").innerText == "2"30000
storeValue//input[@id="field_your_active_process_url"]active_process_url
open${base_url}/erp5/Base_assertActiveProcessHasOneImage?active_process_url=${active_process_url}
assertTextPresentOK
open${base_url}/erp5/Base_removeActiveProcessFromFileSystem?active_process_url=${active_process_url}
assertTextPresentDone
+ + \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test.xml b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test.xml new file mode 100644 index 00000000000..2e4a75c8a8b --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + erp5_document_scanner_ui_test + + + title + + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.py b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.py new file mode 100644 index 00000000000..7dd677a51a3 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.py @@ -0,0 +1,3 @@ +active_process = context.getPortalObject().restrictedTraverse(active_process_url) +assert len(active_process.getResultList()) +return "OK" diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.xml b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.xml new file mode 100644 index 00000000000..fd39d7de4b0 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_assertActiveProcessHasOneImage.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + active_process_url + + + id + Base_assertActiveProcessHasOneImage + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.py b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.py new file mode 100644 index 00000000000..ab92203fb8e --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.py @@ -0,0 +1 @@ +return False diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.xml b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.xml new file mode 100644 index 00000000000..ed2f5557b6b --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_enableDocumentScannerTest.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + Base_enableDocumentScannerTest + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.py b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.py new file mode 100644 index 00000000000..13393d2b67c --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.py @@ -0,0 +1,5 @@ +portal = context.getPortalObject() +active_process = portal.restrictedTraverse(active_process_url) +portal.portal_activities.manage_delObjects( + ids=[active_process.getId(),]) +return "Done" diff --git a/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.xml b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.xml new file mode 100644 index 00000000000..68486a949aa --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/SkinTemplateItem/portal_skins/erp5_document_scanner_ui_test/Base_removeActiveProcessFromFileSystem.xml @@ -0,0 +1,62 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + active_process_url + + + id + Base_removeActiveProcessFromFileSystem + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.py b/bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.py new file mode 100644 index 00000000000..88ed116301b --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.py @@ -0,0 +1,50 @@ +############################################################################## +# +# Copyright (c) 2011 Nexedi SARL and Contributors. All Rights Reserved. +# Gabriel Monnerat +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## +import unittest + +from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase + +class TestRenderJSDocumentScanner(ERP5TypeFunctionalTestCase): + foreground = 0 + run_only = "renderjs_erp5_document_scanner_zuite" + + def getBusinessTemplateList(self): + return ( + 'erp5_web_renderjs_ui', + 'erp5_web_renderjs_ui_test', + 'erp5_ui_test_core', + 'erp5_dms', + 'erp5_accounting', + 'erp5_pdf_merge', + 'erp5_document_scanner' + ) + +def test_suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestRenderJSDocumentScanner)) + return suite \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.xml b/bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.xml new file mode 100644 index 00000000000..dfcd2440436 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/TestTemplateItem/portal_components/test.erp5.testRenderJSDocumentScanner.xml @@ -0,0 +1,127 @@ + + + + + + + + + + _recorded_property_dict + + AAAAAAAAAAI= + + + + default_reference + testRenderJSDocumentScanner + + + description + + + + + + id + test.erp5.testRenderJSDocumentScanner + + + portal_type + Test Component + + + sid + + + + + + text_content_error_message + + + + + + text_content_warning_message + + + + + + version + erp5 + + + workflow_history + + AAAAAAAAAAM= + + + + + + + + + + + + + data + + + + + + + + + + + + + + + data + + + + component_validation_workflow + + AAAAAAAAAAQ= + + + + + + + + + + + + + + + + _log + + + + + action + validate + + + validation_state + validated + + + + + + + + + diff --git a/bt5/erp5_document_scanner_ui_test/bt/copyright_list b/bt5/erp5_document_scanner_ui_test/bt/copyright_list new file mode 100644 index 00000000000..e2a7d80aead --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/copyright_list @@ -0,0 +1 @@ +Copyright (C) 2019 Nexedi SA \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/dependency_list b/bt5/erp5_document_scanner_ui_test/bt/dependency_list new file mode 100644 index 00000000000..575e5ddaff3 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/dependency_list @@ -0,0 +1 @@ +erp5_document_scanner \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/description b/bt5/erp5_document_scanner_ui_test/bt/description new file mode 100644 index 00000000000..d167bfcf4aa --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/description @@ -0,0 +1 @@ +Document Scanner User Interface Tests \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/license b/bt5/erp5_document_scanner_ui_test/bt/license new file mode 100644 index 00000000000..3a3e12bcad9 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/license @@ -0,0 +1 @@ +GPL \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/template_format_version b/bt5/erp5_document_scanner_ui_test/bt/template_format_version new file mode 100644 index 00000000000..56a6051ca2b --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/template_path_list b/bt5/erp5_document_scanner_ui_test/bt/template_path_list new file mode 100644 index 00000000000..216a5bf9525 --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/template_path_list @@ -0,0 +1,2 @@ +portal_tests/renderjs_erp5_document_scanner_zuite +portal_tests/renderjs_erp5_document_scanner_zuite/** \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/template_skin_id_list b/bt5/erp5_document_scanner_ui_test/bt/template_skin_id_list new file mode 100644 index 00000000000..b6eb05d66db --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/template_skin_id_list @@ -0,0 +1 @@ +erp5_document_scanner_ui_test \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/template_test_id_list b/bt5/erp5_document_scanner_ui_test/bt/template_test_id_list new file mode 100644 index 00000000000..cd9f2ccdeba --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/template_test_id_list @@ -0,0 +1 @@ +test.erp5.testRenderJSDocumentScanner \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/title b/bt5/erp5_document_scanner_ui_test/bt/title new file mode 100644 index 00000000000..b6eb05d66db --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/title @@ -0,0 +1 @@ +erp5_document_scanner_ui_test \ No newline at end of file diff --git a/bt5/erp5_document_scanner_ui_test/bt/version b/bt5/erp5_document_scanner_ui_test/bt/version new file mode 100644 index 00000000000..ceab6e11ece --- /dev/null +++ b/bt5/erp5_document_scanner_ui_test/bt/version @@ -0,0 +1 @@ +0.1 \ No newline at end of file -- 2.30.9