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 0000000000000000000000000000000000000000..3b89e0fdb395efe747b26ca5cb27936a637a5099
--- /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 0000000000000000000000000000000000000000..3b89e0fdb395efe747b26ca5cb27936a637a5099
--- /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 0000000000000000000000000000000000000000..3b89e0fdb395efe747b26ca5cb27936a637a5099
--- /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 0000000000000000000000000000000000000000..3b89e0fdb395efe747b26ca5cb27936a637a5099
--- /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 0000000000000000000000000000000000000000..3b89e0fdb395efe747b26ca5cb27936a637a5099
--- /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 0000000000000000000000000000000000000000..1e8f71c886558a0ef3da71ad80f4f058b3fd8685
--- /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 0000000000000000000000000000000000000000..c6199c4c493e43d372df38385e46a8c747585862
--- /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
+
+
+
+
+ -
+ validation_state
+ draft
+
+
+
+ -
+ action
+ publish_alive
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ time
+
+
+
+
+ -
+ validation_state
+ published_alive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 0.0.0.0
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60822.46188.23978
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60823.12148.22101
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+
+
+
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ external_processing_state
+ empty
+
+ -
+ serial
+ 0.0.0.0
+
+ -
+ time
+
+
+
+
+
+
+
+
+
+
+
+
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 0000000000000000000000000000000000000000..228ad7b63432aeda0a0f4656717dfef152ccbd4d
--- /dev/null
+++ b/bt5/erp5_document_scanner/PathTemplateItem/web_page_module/rjs_gadget_document_scanner_html.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+ Gadget Document Scanner
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 0000000000000000000000000000000000000000..cfc452a2cf0ae350f620a2ef23f76cad79981eea
--- /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
+
+
+
+
+ -
+ validation_state
+ draft
+
+
+
+ -
+ action
+ publish_alive
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ time
+
+
+
+
+ -
+ validation_state
+ published_alive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 0.0.0.0
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60829.17295.36334
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60829.39532.12458
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60835.60550.28808
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60850.34860.27477
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 980.2211.58828.61730
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 980.2260.30741.13158
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+
+
+
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ external_processing_state
+ empty
+
+ -
+ serial
+ 0.0.0.0
+
+ -
+ time
+
+
+
+
+
+
+
+
+
+
+
+
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 0000000000000000000000000000000000000000..d3a3a7bdbf4ffe945823ecd69f1c27eed20ca790
--- /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 0000000000000000000000000000000000000000..c39335a5aa871c361de65077d2918f0be6aa2239
--- /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
+
+
+
+
+ -
+ validation_state
+ draft
+
+
+
+ -
+ action
+ publish_alive
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ time
+
+
+
+
+ -
+ validation_state
+ published_alive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62034.26107.12646
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62043.6727.63897
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62043.15372.1979
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62043.43339.58368
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62043.58096.27869
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62051.41603.16452
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62051.53805.39168
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62052.44527.12595
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62052.53648.38587
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62053.15499.63539
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62057.201.30139
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62057.16612.7850
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62057.51100.60962
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62057.65272.3805
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62058.20221.31044
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62061.19823.20002
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62131.62904.38792
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62132.23662.32563
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62132.60242.36198
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62133.36904.64409
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62155.38441.25361
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62156.56125.51746
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+
+
+ -
+ _next
+
+ AAAAAAAAAAY=
+
+
+ -
+ _prev
+
+ AAAAAAAAAAY=
+
+
+ -
+ _tail_count
+ 52
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+
+
+
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ external_processing_state
+ empty
+
+ -
+ serial
+ 0.0.0.0
+
+ -
+ time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ _log
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 0.0.0.0
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60825.480.48810
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60825.46120.29849
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60826.9837.15291
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60828.63254.50278
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60842.6386.64017
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60842.30711.49083
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60843.43928.56746
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60843.43928.56746
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60862.55352.10837
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60865.58483.62873
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60866.3654.22835
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60867.59788.15547
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60869.15817.48384
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60870.4440.37973
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60870.28365.56046
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60870.36143.59784
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.60870.36143.59784
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61945.45445.19456
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61948.43567.53623
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61950.27123.63556
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61950.45006.25873
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61950.45006.25873
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61953.41665.18483
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61956.48527.26880
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61960.44965.38075
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61960.56435.41181
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61961.18710.238
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61961.27126.52992
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61961.52681.35140
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61962.54770.6109
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61962.64337.54272
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61963.11749.30293
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61963.33962.34389
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61963.49975.1860
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61964.5044.3515
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61964.50110.5427
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.61965.57749.53930
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62027.48424.22186
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62028.22281.31658
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62028.29088.60535
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62028.63457.3959
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62029.9391.19456
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62030.44640.11980
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62030.55770.24268
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62030.55770.24268
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62030.55770.24268
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62031.26316.48913
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62031.60011.63180
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62032.33877.17049
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62032.44371.3805
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+ -
+ action
+ edit
+
+ -
+ actor
+ zope
+
+ -
+ comment
+
+
+
+
+ -
+ error_message
+
+
+ -
+ serial
+ 979.62034.728.43673
+
+ -
+ state
+ current
+
+ -
+ time
+
+
+
+
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..d4cf74a2e588f1b637d3285f5818b0c5cb896e65
--- /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 0000000000000000000000000000000000000000..95395d0cbd3221096f40a7a232abf624a69f12af
--- /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 0000000000000000000000000000000000000000..b21e56b4e5a2737178f1d40156a11fe0dd2c78d3
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..9fd6782b15fe50e83406201dc3dd610387ee26a8
--- /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 0000000000000000000000000000000000000000..7cd4da75814239f5445f7252cb53767d68b41343
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..9bf0f212ec782fc577b7668790f8755a06158a45
--- /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 0000000000000000000000000000000000000000..2b1fd5a7338045904401791fce0847aee882cb5e
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..19b37877ad01e7c38b25fac8e5dc1d3083224b30
--- /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 0000000000000000000000000000000000000000..aebf41d96ca1835fcd9a9b708a14bb931c103af2
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..5ddd3718c0c553231954131a5ebe13cbd23789ba
--- /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 0000000000000000000000000000000000000000..7d180b28ae5a9b3371e52569b72e353534325cb7
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..d39242917ec09b228c30f597f144f7a734933798
--- /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 0000000000000000000000000000000000000000..43144fc314079764791ffed3cf0add19d44cff21
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..32cdbc7816159da02b4318ea9c419406e935c204
--- /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 0000000000000000000000000000000000000000..0c0905377cf04f5fa0bd4ea2c0975695d03d1ed1
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..88daa42965f3fc9a41c04378e8a2b80ee27d7950
--- /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 0000000000000000000000000000000000000000..79f84fcd9d93fa6bb4aab8eb22604687e6760fc3
--- /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
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..7495b0edfd0a5c0bfa562e815f8e82411338829f
--- /dev/null
+++ b/bt5/erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_viewUploadDocumentFromCameraDialog.xml
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+ -
+ _bind_names
+
+
+
+
+ -
+ _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 0000000000000000000000000000000000000000..d6b5bb1db1472ba139b45383c296c124f69acf19
--- /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 0000000000000000000000000000000000000000..b12726a259ea9d325480d7532d4bc076a339d3ff
--- /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 0000000000000000000000000000000000000000..93e0b79468f02e5b3dc109b00f93f505f2f28238
--- /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 0000000000000000000000000000000000000000..3df51736aa29a80c3bf387071d421d2e8827063a
--- /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 0000000000000000000000000000000000000000..e0a4c68986f566f6d3337b6702f80fbad76569ce
--- /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 0000000000000000000000000000000000000000..59bbde2d7b8dc50aef8ad75681d81642e7f67eb5
--- /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 0000000000000000000000000000000000000000..c229b477b9981a51989da9a474cf18ba2f13367a
--- /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 0000000000000000000000000000000000000000..5b6867598a05b7d75065f1bfa4262611dedc4747
--- /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 0000000000000000000000000000000000000000..b527e4224c5a29aafc895eb01e2a65dd84b3eb47
--- /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 0000000000000000000000000000000000000000..f21346f76c14ef78d29a181a6025616cbfeabe03
--- /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 0000000000000000000000000000000000000000..1f40bb9d67591338e56a19d08eb966b9d0c95f68
--- /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 0000000000000000000000000000000000000000..e1fa4a8a760620cddc02e1ccdc347302fb467d38
--- /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 0000000000000000000000000000000000000000..41bc37d86f1cec9a4459b1b53a3662748b93c422
--- /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 0000000000000000000000000000000000000000..1d897b5770be405713e0057393670b6f4fc53279
--- /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