Commit ada20d85 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: Fix code

parent e587e935
...@@ -13,9 +13,12 @@ if not active_preference: ...@@ -13,9 +13,12 @@ if not active_preference:
if active_preference and preferred_cropped_canvas_data: if active_preference and preferred_cropped_canvas_data:
active_preference.setPreferredCroppedCanvasData(preferred_cropped_canvas_data) active_preference.setPreferredCroppedCanvasData(preferred_cropped_canvas_data)
if active_process_url:
active_process = portal.restrictedTraverse(active_process_url)
if not image_str: if not image_str:
if batch_mode: if batch_mode:
return None return active_process
return context.Base_renderForm('Base_viewUploadDocumentFromCameraDialog', return context.Base_renderForm('Base_viewUploadDocumentFromCameraDialog',
message='Nothing to capture') message='Nothing to capture')
...@@ -23,8 +26,6 @@ if not image_str: ...@@ -23,8 +26,6 @@ if not image_str:
if not active_process_url: if not active_process_url:
active_process = portal.portal_activities.newActiveProcess() active_process = portal.portal_activities.newActiveProcess()
context.REQUEST.form["your_active_process_url"] = active_process.getRelativeUrl() context.REQUEST.form["your_active_process_url"] = active_process.getRelativeUrl()
else:
active_process = portal.restrictedTraverse(active_process_url)
active_process.postActiveResult(detail=image_str) active_process.postActiveResult(detail=image_str)
context.REQUEST.form.pop("field_your_document_scanner_gadget") context.REQUEST.form.pop("field_your_document_scanner_gadget")
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>portal_type=None, 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</string> </value> <value> <string>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</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -2,7 +2,7 @@ portal = context.getPortalObject() ...@@ -2,7 +2,7 @@ portal = context.getPortalObject()
translateString = portal.Base_translateString translateString = portal.Base_translateString
active_process = context.Base_storeDocumentFromCameraInActiveProcess( active_process = context.Base_storeDocumentFromCameraInActiveProcess(
active_process_url, active_process_url=active_process_url,
batch_mode=True, batch_mode=True,
**kw) **kw)
......
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
); );
dialogMethod = preferredCroppedCanvasData.dialog_method; dialogMethod = preferredCroppedCanvasData.dialog_method;
// Clear photo input // Clear photo input
//element.querySelector('.photoInput').value = ""; element.querySelector('.photoInput').value = "";
pageNumber = parseInt(element.querySelector('input[name="page-number"]').value, 10); pageNumber = parseInt(element.querySelector('input[name="page-number"]').value, 10);
root.querySelector(".camera-input").style.display = ""; root.querySelector(".camera-input").style.display = "";
root.querySelector(".camera-output").style.display = "none"; root.querySelector(".camera-output").style.display = "none";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment