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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
da4b246c
Commit
da4b246c
authored
Sep 05, 2017
by
Papa Tamsir Kane
Committed by
Papa Tamsir Kane
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_decision: Remove unneeded scripts and comments
parent
2c3b0688
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
0 additions
and
296 deletions
+0
-296
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_getSourceDecisionDepartmentPersonList.py
...ecision/Decision_getSourceDecisionDepartmentPersonList.py
+0
-22
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_getSourceDecisionDepartmentPersonList.xml
...cision/Decision_getSourceDecisionDepartmentPersonList.xml
+0
-62
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_notifySourceDecisionValue.py
...skins/erp5_decision/Decision_notifySourceDecisionValue.py
+0
-47
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_notifySourceDecisionValue.xml
...kins/erp5_decision/Decision_notifySourceDecisionValue.xml
+0
-70
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_statusModify.py
...eItem/portal_skins/erp5_decision/Decision_statusModify.py
+0
-17
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_updateRelatedDocument.py
...tal_skins/erp5_decision/Decision_updateRelatedDocument.py
+0
-1
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_interaction_workflow/scripts/Decision_decideDecisionLineList.py
...ction_workflow/scripts/Decision_decideDecisionLineList.py
+0
-2
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_interaction_workflow/scripts/Decision_postDecisionLineList.py
...raction_workflow/scripts/Decision_postDecisionLineList.py
+0
-11
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_workflow/scripts/Decision_checkConsistency.py
...ow/decision_workflow/scripts/Decision_checkConsistency.py
+0
-2
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_workflow/scripts/Decision_checkConsistency.xml
...w/decision_workflow/scripts/Decision_checkConsistency.xml
+0
-62
No files found.
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_getSourceDecisionDepartmentPersonList.py
deleted
100644 → 0
View file @
2c3b0688
"""
List persons per division.
"""
source_value
=
context
.
getSourceDecisionValue
()
source_type
=
source_value
.
getPortalType
()
if
source_type
==
'Organisation'
:
organisation
=
source_value
elif
source_type
==
'Person'
:
organisation
=
source_value
.
getCareerSubordinationValue
()
else
:
organisation
=
source_value
.
getSubordinationValue
()
person_list
=
[]
for
person
in
context
.
portal_catalog
(
portal_type
=
'Person'
,
subordination_uid
=
organisation
.
getUid
()):
person_list
.
append
([
person
.
getTitle
(),
person
.
getRelativeUrl
()])
return
person_list
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_getSourceDecisionDepartmentPersonList.xml
deleted
100644 → 0
View file @
2c3b0688
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Decision_getSourceDecisionDepartmentPersonList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_notifySourceDecisionValue.py
deleted
100644 → 0
View file @
2c3b0688
"""
Email the person who must make a decision.
We need proxy roles so we're able to check Persons' preferences
for any context this script is executed from.
"""
def
getPreferenceForUser
(
owner_id
):
"""
Return Preference object for user
"""
preference_list
=
context
.
portal_preferences
.
searchFolder
(
portal_type
=
'Preference'
,
owner
=
owner_id
)
preference_list
=
[
x
for
x
in
preference_list
if
x
.
getProperty
(
'preference_state'
,
'broken'
)
in
(
'enabled'
,
'global'
)]
if
len
(
preference_list
):
return
preference_list
[
0
]
notification_message
=
context
.
NotificationTool_getDocumentValue
(
notification_reference
)
message
=
notification_message
.
asText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
subject
=
notification_message
.
asSubjectText
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
# we can have Organisation, Positions, etc for source_decision_value
# so inform them
source_decision_value
=
context
.
getSourceDecisionValue
()
if
source_decision_value
is
not
None
:
person_list
=
[]
if
source_decision_value
.
getPortalType
()
==
'Person'
:
person_list
=
[
source_decision_value
]
elif
source_decision_value
.
getPortalType
()
==
'Organisation'
:
for
person
in
context
.
Base_getPersonListForOrganisation
(
source_decision_value
,
validation_state
=
'validated'
):
person_preference
=
getPreferenceForUser
(
person
.
getReference
())
if
person_preference
is
not
None
:
# check preferences for user who is department manager if he wants to receive notifications or not?
is_preferred_send_email_notification_only_for_own_decision
=
person_preference
.
isPreferredSendEmailNotificationOnlyForOwnDecision
()
#context.log('%s %s' %(person_preference.getTitle(), is_preferred_send_email_notification_only_for_own_decision))
if
not
is_preferred_send_email_notification_only_for_own_decision
:
person_list
.
append
(
person
)
else
:
# no preference for user so we inform unconditionally
person_list
.
append
(
person
)
elif
source_decision_value
.
getPortalType
()
==
'Position'
:
person_list
=
context
.
Base_getPersonListForPosition
(
source_decision_value
)
if
person_list
:
for
reference
in
[
x
.
getReference
()
for
x
in
person_list
]:
context
.
portal_notifications
.
sendMessage
(
recipient
=
reference
,
subject
=
subject
,
message
=
message
)
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_notifySourceDecisionValue.xml
deleted
100644 → 0
View file @
2c3b0688
<?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>
notification_reference, mapping_dict
</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>
Decision_notifySourceDecisionValue
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_statusModify.py
View file @
da4b246c
"""
Change source of decision.
"""
from
AccessControl
import
getSecurityManager
request
=
context
.
REQUEST
causality_value
=
context
.
getCausalityValue
()
current_person
=
context
.
ERP5Site_getAuthenticatedMemberPersonValue
()
if
current_person
is
None
:
title
=
getSecurityManager
().
getUser
().
getId
()
else
:
title
=
current_person
.
getTitle
()
# Set new source
source_decision
=
context
.
portal_catalog
.
getResultValue
(
...
...
@@ -20,12 +11,4 @@ context.setSourceDecisionValue(source_decision)
context
.
setTitle
(
'Approval by %s'
%
source_decision
.
getTitle
())
# Send email as activity
'''
context.activate().Decision_sendAssignNotification(
decision_id=context.getId(),
assignor_person_title=title,
assignee_person_reference=source_decision.getReference())
'''
return
context
.
Workflow_statusModify
(
form_id
,
dialog_id
,
**
kw
)
bt5/erp5_decision/SkinTemplateItem/portal_skins/erp5_decision/Decision_updateRelatedDocument.py
View file @
da4b246c
"""
Update related "Document" to a Decision when a Decision is decided (approved or refused)
Related "Document" can be of any type.
We need proxy roles as not always current approver has enough rights to change related Documents.
"""
portal
=
context
.
getPortalObject
()
...
...
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_interaction_workflow/scripts/Decision_decideDecisionLineList.py
View file @
da4b246c
...
...
@@ -9,5 +9,3 @@ for decision_line in decision.contentValues(filter = {'portal_type': 'Decision L
if
decision_line
.
getSimulationState
()
!=
'decided'
:
decision_line
.
setApproval
(
approval
)
decision_line
.
decide
()
#context.activate().Base_notifyDecisionStateChange(decision.getCausalityUid(), decision.getUid())
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_interaction_workflow/scripts/Decision_postDecisionLineList.py
View file @
da4b246c
...
...
@@ -8,14 +8,3 @@ decision = state_change['object']
for
decision_line
in
decision
.
contentValues
(
filter
=
{
'portal_type'
:
'Decision Line'
}):
decision_line
.
post
()
'''
causality_value = decision.getCausalityValue()
document_url = causality_value.absolute_url()
mapping_dict = {"url" : decision.absolute_url(),
"document_url": document_url,
"initiator_title": causality_value.Base_getOwnerValue().getTitle()}
decision.activate().Decision_notifySourceDecisionValue('decision-posted', mapping_dict)
'''
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_workflow/scripts/Decision_checkConsistency.py
deleted
100644 → 0
View file @
2c3b0688
decision
=
state_change
[
'object'
]
decision
.
Base_checkConsistency
()
bt5/erp5_decision/WorkflowTemplateItem/portal_workflow/decision_workflow/scripts/Decision_checkConsistency.xml
deleted
100644 → 0
View file @
2c3b0688
<?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>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Decision_checkConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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