Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
147
Merge Requests
147
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
9f4af817
Commit
9f4af817
authored
Nov 05, 2019
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_document_scanner: We need to create active process manager
Normal users can not call it directly
parent
51b5f4e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
8 deletions
+95
-8
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.py
...kins/erp5_document_scanner/Base_postDataToActiveResult.py
+17
-0
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.xml
...ins/erp5_document_scanner/Base_postDataToActiveResult.xml
+70
-0
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.py
...nt_scanner/Base_storeDocumentFromCameraInActiveProcess.py
+5
-8
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.py
...cument_scanner/Base_uploadDocumentFromCameraByActivity.py
+3
-0
No files found.
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.py
0 → 100644
View file @
9f4af817
"""
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
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_postDataToActiveResult.xml
0 → 100644
View file @
9f4af817
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
active_process_url, detail, REQUEST=None, **kw
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_postDataToActiveResult
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_storeDocumentFromCameraInActiveProcess.py
View file @
9f4af817
...
...
@@ -15,21 +15,18 @@ if not active_preference:
if
active_preference
and
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
batch_mode
:
return
active_process
return
None
return
context
.
Base_renderForm
(
'Base_viewUploadDocumentFromCameraDialog'
,
message
=
translateString
(
'Nothing to capture'
))
if
not
active_process_url
:
active_process
=
portal
.
portal_activities
.
newActiveProcess
()
context
.
REQUEST
.
form
[
"your_active_process_url"
]
=
active_process
.
getRelativeUrl
(
)
active_process
=
context
.
Base_postDataToActiveResult
(
active_process
_url
,
image_str
)
active_process
.
postActiveResult
(
detail
=
image_str
)
context
.
REQUEST
.
form
[
"your_active_process_url"
]
=
active_process
.
getRelativeUrl
(
)
context
.
REQUEST
.
form
.
pop
(
"field_your_document_scanner_gadget"
)
context
.
REQUEST
.
form
.
pop
(
'document_scanner_gadget'
)
...
...
erp5_document_scanner/SkinTemplateItem/portal_skins/erp5_document_scanner/Base_uploadDocumentFromCameraByActivity.py
View file @
9f4af817
...
...
@@ -6,6 +6,9 @@ active_process = context.Base_storeDocumentFromCameraInActiveProcess(
batch_mode
=
True
,
**
kw
)
if
active_process
is
None
and
active_process_url
:
active_process
=
portal
.
restrictedTraverse
(
active_process_url
)
# Avoid to pass huge images to the activity
kw
.
pop
(
"your_document_scanner_gadget"
,
None
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment