@steedos/standard-process-approval 2.2.55-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main/default/applications/.gitkeep +0 -0
- package/main/default/applications/process_automation.app.yml +49 -0
- package/main/default/client/action_field_updates.client.js +155 -0
- package/main/default/client/core.client.js +134 -0
- package/main/default/client/process.client.js +211 -0
- package/main/default/client/process_node.client.js +36 -0
- package/main/default/client/workflow_notifications.client.js +74 -0
- package/main/default/objectTranslations/action_field_updates.en/action_field_updates.en.objectTranslation.yml +69 -0
- package/main/default/objectTranslations/action_field_updates.zh-CN/action_field_updates.zh-CN.objectTranslation.yml +72 -0
- package/main/default/objectTranslations/process_definition.en/process_definition.en.objectTranslation.yml +150 -0
- package/main/default/objectTranslations/process_definition.zh-CN/process_definition.zh-CN.objectTranslation.yml +145 -0
- package/main/default/objectTranslations/process_flows.en/process_flows.en.objectTranslation.yml +41 -0
- package/main/default/objectTranslations/process_flows.zh-CN/process_flows.zh-CN.objectTranslation.yml +41 -0
- package/main/default/objectTranslations/process_flows_criteria.en/process_flows_criteria.en.objectTranslation.yml +38 -0
- package/main/default/objectTranslations/process_flows_criteria.zh-CN/process_flows_criteria.zh-CN.objectTranslation.yml +38 -0
- package/main/default/objectTranslations/process_flows_criteria_action.en/process_flows_criteria_action.en.objectTranslation.yml +47 -0
- package/main/default/objectTranslations/process_flows_criteria_action.zh-CN/process_flows_criteria_action.zh-CN.objectTranslation.yml +47 -0
- package/main/default/objectTranslations/process_instance.en/process_instance.en.objectTranslation.yml +63 -0
- package/main/default/objectTranslations/process_instance.zh-CN/process_instance.zh-CN.objectTranslation.yml +63 -0
- package/main/default/objectTranslations/process_instance_history.en/process_instance_history.en.objectTranslation.yml +109 -0
- package/main/default/objectTranslations/process_instance_history.zh-CN/process_instance_history.zh-CN.objectTranslation.yml +109 -0
- package/main/default/objectTranslations/process_instance_node.en/process_instance_node.en.objectTranslation.yml +59 -0
- package/main/default/objectTranslations/process_instance_node.zh-CN/process_instance_node.zh-CN.objectTranslation.yml +59 -0
- package/main/default/objectTranslations/process_node.en/process_node.en.objectTranslation.yml +120 -0
- package/main/default/objectTranslations/process_node.zh-CN/process_node.zh-CN.objectTranslation.yml +116 -0
- package/main/default/objectTranslations/workflow_notifications.en/workflow_notifications.en.objectTranslation.yml +41 -0
- package/main/default/objectTranslations/workflow_notifications.zh-CN/workflow_notifications.zh-CN.objectTranslation.yml +44 -0
- package/main/default/objectTranslations/workflow_rule.en/workflow_rule.en.objectTranslation.yml +53 -0
- package/main/default/objectTranslations/workflow_rule.zh-CN/workflow_rule.zh-CN.objectTranslation.yml +60 -0
- package/main/default/objects/process/approval/process_definition.action.js +65 -0
- package/main/default/objects/process/approval/process_definition.function.js +39 -0
- package/main/default/objects/process/approval/process_definition.object.yml +313 -0
- package/main/default/objects/process/approval/process_node.object.yml +267 -0
- package/main/default/objects/process/flows/process_flows.object.yml +48 -0
- package/main/default/objects/process/flows/process_flows_criteria.object.yml +46 -0
- package/main/default/objects/process/flows/process_flows_criteria_action.object.yml +56 -0
- package/main/default/objects/process/process_instance/process_instance.object.yml +65 -0
- package/main/default/objects/process/process_instance/process_instance_history.action.js +26 -0
- package/main/default/objects/process/process_instance/process_instance_history.object.yml +153 -0
- package/main/default/objects/process/process_instance/process_instance_node.object.yml +59 -0
- package/main/default/objects/workflow-actions/action_field_updates.action.js +33 -0
- package/main/default/objects/workflow-actions/action_field_updates.object.yml +197 -0
- package/main/default/objects/workflow-actions/workflow_notifications.action.js +33 -0
- package/main/default/objects/workflow-actions/workflow_notifications.object.yml +107 -0
- package/main/default/objects/workflow-actions/workflow_rule.action.js +33 -0
- package/main/default/objects/workflow-actions/workflow_rule.object.yml +112 -0
- package/main/default/permissionsets/.gitkeep +0 -0
- package/main/default/profiles/.gitkeep +0 -0
- package/main/default/tabs/.gitkeep +0 -0
- package/main/default/triggers/.gitkeep +0 -0
- package/main/default/triggers/action_field_updates.trigger.js +175 -0
- package/main/default/triggers/process_definition.trigger.js +132 -0
- package/main/default/triggers/process_instance_history.trigger.js +42 -0
- package/main/default/triggers/process_node.trigger.js +232 -0
- package/main/default/triggers/workflow_notifications.trigger.js +236 -0
- package/main/default/triggers/workflow_rule.trigger.js +96 -0
- package/package.json +16 -0
- package/package.service.js +75 -0
- package/public/.md +3 -0
- package/src/.md +3 -0
- package/webapp/.md +1 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
name: process_node
|
|
2
|
+
label: Approval Steps
|
|
3
|
+
hidden: true
|
|
4
|
+
enable_inline_edit: false
|
|
5
|
+
icon: steps
|
|
6
|
+
version: 2
|
|
7
|
+
fields:
|
|
8
|
+
name:
|
|
9
|
+
type: text
|
|
10
|
+
required: true
|
|
11
|
+
label:
|
|
12
|
+
type: text
|
|
13
|
+
required: true
|
|
14
|
+
is_name: true
|
|
15
|
+
order: #TODO 必须为整数,最小为1, 最大值不能超过当前最大值+1。输入的值已存在则当前记录占用原来的序号,之后的记录序号后移,比如已有1,2,3。添加2后,原来的2,3变为3,4,新记录占用2
|
|
16
|
+
is_wide: true
|
|
17
|
+
type: number
|
|
18
|
+
scale: 0
|
|
19
|
+
min: 1
|
|
20
|
+
description:
|
|
21
|
+
label: Description
|
|
22
|
+
type: textarea
|
|
23
|
+
is_wide: true
|
|
24
|
+
process_definition:
|
|
25
|
+
type: master_detail
|
|
26
|
+
is_wide: true
|
|
27
|
+
reference_to: process_definition
|
|
28
|
+
filtrad:
|
|
29
|
+
type: boolean
|
|
30
|
+
label: All records should enter this step
|
|
31
|
+
group: Specify Step Criteria
|
|
32
|
+
defaultValue: false
|
|
33
|
+
is_wide: true
|
|
34
|
+
entry_criteria:
|
|
35
|
+
type: textarea
|
|
36
|
+
label: Entry criteria
|
|
37
|
+
is_wide: true
|
|
38
|
+
required: true
|
|
39
|
+
visible_on: "{{ formData.filtrad != true }}"
|
|
40
|
+
group: Specify Step Criteria
|
|
41
|
+
if_criteria_not_met: # https://help.salesforce.com/articleView?err=1&id=approvals_step_entrycriteria.htm&type=5
|
|
42
|
+
type: select
|
|
43
|
+
firstOption: false
|
|
44
|
+
options: approve,reject,skip
|
|
45
|
+
visible_on: "{{ formData.filtrad != true }}"
|
|
46
|
+
group: Specify Step Criteria
|
|
47
|
+
is_wide: true #TODO 选项规则:第一个有(order=1):拒绝记录;批准记录;如果有后续步骤,则会多一个 转到下一步的条件; 最后一个步骤且不是第一步时,不能设置不满足的情况; 只有第一步有拒绝记录
|
|
48
|
+
approver:
|
|
49
|
+
type: select
|
|
50
|
+
is_wide: true
|
|
51
|
+
label: Select Approver
|
|
52
|
+
required: true
|
|
53
|
+
firstOption: false
|
|
54
|
+
group: Select Assigned Approver
|
|
55
|
+
options:
|
|
56
|
+
- label: 'Let the submitter choose the approver manually'
|
|
57
|
+
value: 'submitter_choose'
|
|
58
|
+
# - label: 'Automatically assign using the user field selected earlier'
|
|
59
|
+
# value: 'role'
|
|
60
|
+
# - label: 'Automatically assign to queue'
|
|
61
|
+
# value: 'auto_queue'
|
|
62
|
+
- label: 'Automatically assign to approver(s)'
|
|
63
|
+
value: 'auto_assign'
|
|
64
|
+
assigned_approver_users:
|
|
65
|
+
type: lookup
|
|
66
|
+
reference_to: users
|
|
67
|
+
multiple: true
|
|
68
|
+
group: Select Assigned Approver
|
|
69
|
+
visible_on: "{{ formData.approver != 'submitter_choose' }}"
|
|
70
|
+
assigned_approver_roles:
|
|
71
|
+
type: lookup
|
|
72
|
+
reference_to: roles
|
|
73
|
+
reference_to_field: api_name
|
|
74
|
+
multiple: true
|
|
75
|
+
group: Select Assigned Approver
|
|
76
|
+
visible_on: "{{ formData.approver != 'submitter_choose' }}"
|
|
77
|
+
assigned_approver_flow_roles:
|
|
78
|
+
type: lookup
|
|
79
|
+
reference_to: flow_roles
|
|
80
|
+
reference_to_field: api_name
|
|
81
|
+
multiple: true
|
|
82
|
+
group: Select Assigned Approver
|
|
83
|
+
visible_on: "{{ formData.approver != 'submitter_choose' }}"
|
|
84
|
+
assigned_approver_user_field:
|
|
85
|
+
type: lookup
|
|
86
|
+
multiple: true
|
|
87
|
+
group: Select Assigned Approver
|
|
88
|
+
showIcon: false
|
|
89
|
+
visible_on: "{{ formData.approver != 'submitter_choose' }}"
|
|
90
|
+
depend_on:
|
|
91
|
+
- process_definition
|
|
92
|
+
optionsFunction: !!js/function |
|
|
93
|
+
function (doc){
|
|
94
|
+
var options = [];
|
|
95
|
+
if(doc.process_definition){
|
|
96
|
+
var pid = doc.process_definition;
|
|
97
|
+
if(_.isObject(pid)){
|
|
98
|
+
pid = pid._id;
|
|
99
|
+
}
|
|
100
|
+
var object_name = Creator.odata.get("process_definition", pid, "object_name").object_name;
|
|
101
|
+
var userFields = _.filter(Creator.getObject(object_name).fields, function(field){
|
|
102
|
+
return (field.type === 'lookup' || field.type === 'master_detail') && field.omit != true && field.reference_to === 'users'
|
|
103
|
+
});
|
|
104
|
+
_.each(userFields, function(field){
|
|
105
|
+
options.push({label:field.label, value:field.name});
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
return options;
|
|
109
|
+
}
|
|
110
|
+
when_multiple_approvers:
|
|
111
|
+
type: select
|
|
112
|
+
is_wide: true
|
|
113
|
+
label: When multiple approvers are selected
|
|
114
|
+
group: Select Assigned Approver
|
|
115
|
+
firstOption: false
|
|
116
|
+
options:
|
|
117
|
+
- label: Approve or reject based on the FIRST response.
|
|
118
|
+
value: first_response
|
|
119
|
+
- label: Require UNANIMOUS approval from all selected approvers.
|
|
120
|
+
value: unanimous
|
|
121
|
+
visible_on: "{{ formData.approver != 'submitter_choose' }}"
|
|
122
|
+
#TODO 批准代理也可以批准此请求
|
|
123
|
+
reject_behavior:
|
|
124
|
+
type: select
|
|
125
|
+
label: Reject Behavior
|
|
126
|
+
is_wide: true
|
|
127
|
+
required: true
|
|
128
|
+
group: Select Assigned Approver
|
|
129
|
+
defaultValue: reject_request
|
|
130
|
+
firstOption: false
|
|
131
|
+
inlineHelpText: What should happen if the approver rejects this request? #TODO 只有步骤号不等于1时,才能设置拒绝行为, 等于1时始终为最终拒绝
|
|
132
|
+
options:
|
|
133
|
+
- label: 'Perform all rejection actions for this step AND all final rejection actions. (Final Rejection)'
|
|
134
|
+
value: reject_request
|
|
135
|
+
- label: 'Perform ONLY the rejection actions for this step and send the approval request back to the most recent approver. (Go Back 1 Step)'
|
|
136
|
+
value: back_to_previous
|
|
137
|
+
approval_updates_field_actions:
|
|
138
|
+
type: lookup
|
|
139
|
+
multiple: true
|
|
140
|
+
label: Field Update
|
|
141
|
+
reference_to: action_field_updates
|
|
142
|
+
reference_to_field: name
|
|
143
|
+
depend_on:
|
|
144
|
+
- process_definition
|
|
145
|
+
filtersFunction: !!js/function |
|
|
146
|
+
function (filters, dependValues) {
|
|
147
|
+
if(dependValues && dependValues.process_definition){
|
|
148
|
+
var pid = dependValues.process_definition;
|
|
149
|
+
if(_.isObject(pid)){
|
|
150
|
+
pid = pid._id;
|
|
151
|
+
}
|
|
152
|
+
var object_name = Creator.odata.get("process_definition", pid, "object_name").object_name;
|
|
153
|
+
return "object_name eq '" + object_name + "'";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
group: Approval Actions
|
|
157
|
+
approval_workflow_notifications_actions:
|
|
158
|
+
type: lookup
|
|
159
|
+
multiple: true
|
|
160
|
+
label: Workflow Notification
|
|
161
|
+
reference_to: workflow_notifications
|
|
162
|
+
reference_to_field: name
|
|
163
|
+
depend_on:
|
|
164
|
+
- process_definition
|
|
165
|
+
filtersFunction: !!js/function |
|
|
166
|
+
function (filters, dependValues) {
|
|
167
|
+
if(dependValues && dependValues.process_definition){
|
|
168
|
+
var pid = dependValues.process_definition;
|
|
169
|
+
if(_.isObject(pid)){
|
|
170
|
+
pid = pid._id;
|
|
171
|
+
}
|
|
172
|
+
var object_name = Creator.odata.get("process_definition", pid, "object_name").object_name;
|
|
173
|
+
return "object_name eq '" + object_name + "'";
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
group: Approval Actions
|
|
177
|
+
rejection_updates_field_actions:
|
|
178
|
+
type: lookup
|
|
179
|
+
multiple: true
|
|
180
|
+
label: Field Update
|
|
181
|
+
reference_to: action_field_updates
|
|
182
|
+
reference_to_field: name
|
|
183
|
+
depend_on:
|
|
184
|
+
- process_definition
|
|
185
|
+
filtersFunction: !!js/function |
|
|
186
|
+
function (filters, dependValues) {
|
|
187
|
+
if(dependValues && dependValues.process_definition){
|
|
188
|
+
var pid = dependValues.process_definition;
|
|
189
|
+
if(_.isObject(pid)){
|
|
190
|
+
pid = pid._id;
|
|
191
|
+
}
|
|
192
|
+
var object_name = Creator.odata.get("process_definition", pid, "object_name").object_name;
|
|
193
|
+
return "object_name eq '" + object_name + "'";
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
group: Rejection Actions
|
|
197
|
+
rejection_workflow_notifications_actions:
|
|
198
|
+
type: lookup
|
|
199
|
+
multiple: true
|
|
200
|
+
label: Workflow Notification
|
|
201
|
+
reference_to: workflow_notifications
|
|
202
|
+
reference_to_field: name
|
|
203
|
+
depend_on:
|
|
204
|
+
- process_definition
|
|
205
|
+
filtersFunction: !!js/function |
|
|
206
|
+
function (filters, dependValues) {
|
|
207
|
+
if(dependValues && dependValues.process_definition){
|
|
208
|
+
var pid = dependValues.process_definition;
|
|
209
|
+
if(_.isObject(pid)){
|
|
210
|
+
pid = pid._id;
|
|
211
|
+
}
|
|
212
|
+
var object_name = Creator.odata.get("process_definition", pid, "object_name").object_name;
|
|
213
|
+
return "object_name eq '" + object_name + "'";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
group: Rejection Actions
|
|
217
|
+
form:
|
|
218
|
+
beforeInsert:
|
|
219
|
+
function(){
|
|
220
|
+
if(_.isString(this.doc.assigned_approver_users)){
|
|
221
|
+
this.doc.assigned_approver_users = this.doc.assigned_approver_users.split(',')
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
beforeUpdate:
|
|
225
|
+
function(){
|
|
226
|
+
if(_.isString(this.doc.assigned_approver_users)){
|
|
227
|
+
this.doc.assigned_approver_users = this.doc.assigned_approver_users.split(',')
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
beforeEdit: !!js/function |
|
|
231
|
+
function(){
|
|
232
|
+
Steedos.ProcessNodeManager.changeSchema(this.doc, this.schema);
|
|
233
|
+
}
|
|
234
|
+
afterEdit: !!js/function |
|
|
235
|
+
function(){
|
|
236
|
+
Steedos.ProcessNodeManager.changeSchema(this.doc, this.schema);
|
|
237
|
+
}
|
|
238
|
+
beforeView: !!js/function |
|
|
239
|
+
function(){
|
|
240
|
+
Steedos.ProcessNodeManager.changeSchema(this.doc, this.schema);
|
|
241
|
+
}
|
|
242
|
+
list_views:
|
|
243
|
+
all:
|
|
244
|
+
label: All
|
|
245
|
+
filter_scope: space
|
|
246
|
+
sort: [["order", "asc"]]
|
|
247
|
+
columns:
|
|
248
|
+
- label
|
|
249
|
+
- order
|
|
250
|
+
- description
|
|
251
|
+
- approver
|
|
252
|
+
- reject_behavior
|
|
253
|
+
permission_set:
|
|
254
|
+
user:
|
|
255
|
+
allowCreate: false
|
|
256
|
+
allowDelete: false
|
|
257
|
+
allowEdit: false
|
|
258
|
+
allowRead: true
|
|
259
|
+
modifyAllRecords: false
|
|
260
|
+
viewAllRecords: true
|
|
261
|
+
admin:
|
|
262
|
+
allowCreate: true
|
|
263
|
+
allowDelete: true
|
|
264
|
+
allowEdit: true
|
|
265
|
+
allowRead: true
|
|
266
|
+
modifyAllRecords: true
|
|
267
|
+
viewAllRecords: true
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: process_flows
|
|
2
|
+
label: process_flows
|
|
3
|
+
hidden: true
|
|
4
|
+
icon: record
|
|
5
|
+
fields:
|
|
6
|
+
name:
|
|
7
|
+
type: text
|
|
8
|
+
object_name:
|
|
9
|
+
type: text
|
|
10
|
+
when:
|
|
11
|
+
type: select
|
|
12
|
+
options: record_changes
|
|
13
|
+
label: The process starts when
|
|
14
|
+
start:
|
|
15
|
+
type: select
|
|
16
|
+
options:
|
|
17
|
+
- label: only when a record is created
|
|
18
|
+
value: create
|
|
19
|
+
- label: when a record is created or edited
|
|
20
|
+
value: changes
|
|
21
|
+
enable_recursion_check:
|
|
22
|
+
type: boolean
|
|
23
|
+
label: Recursion - Allow process to evaluate a record multiple times in a single save operation?
|
|
24
|
+
description:
|
|
25
|
+
label: description
|
|
26
|
+
type: textarea
|
|
27
|
+
is_wide: true
|
|
28
|
+
list_views:
|
|
29
|
+
all:
|
|
30
|
+
label: All
|
|
31
|
+
filter_scope: space
|
|
32
|
+
columns:
|
|
33
|
+
- name
|
|
34
|
+
permission_set:
|
|
35
|
+
user:
|
|
36
|
+
allowCreate: false
|
|
37
|
+
allowDelete: false
|
|
38
|
+
allowEdit: false
|
|
39
|
+
allowRead: true
|
|
40
|
+
modifyAllRecords: false
|
|
41
|
+
viewAllRecords: true
|
|
42
|
+
admin:
|
|
43
|
+
allowCreate: true
|
|
44
|
+
allowDelete: true
|
|
45
|
+
allowEdit: true
|
|
46
|
+
allowRead: true
|
|
47
|
+
modifyAllRecords: true
|
|
48
|
+
viewAllRecords: true
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: process_flows_criteria
|
|
2
|
+
label: process_flows_criteria
|
|
3
|
+
hidden: true
|
|
4
|
+
icon: record
|
|
5
|
+
fields:
|
|
6
|
+
process_flow:
|
|
7
|
+
type: master_detail
|
|
8
|
+
reference_to: process_flows
|
|
9
|
+
name:
|
|
10
|
+
type: text
|
|
11
|
+
executing_actions:
|
|
12
|
+
type: select
|
|
13
|
+
options:
|
|
14
|
+
- label: Conditions are met
|
|
15
|
+
value: criteria
|
|
16
|
+
- label: No criteria—just execute the actions!
|
|
17
|
+
value: always
|
|
18
|
+
criteria:
|
|
19
|
+
type: textarea
|
|
20
|
+
label: Conditions
|
|
21
|
+
is_wide: true
|
|
22
|
+
update_once:
|
|
23
|
+
type: boolean
|
|
24
|
+
label: Do you want to execute the actions only when specified changes are made to the record?
|
|
25
|
+
inlineHelpText: When you select yes, the actions are executed only if the record meets the criteria now but the values that the record had immediately before it was saved didn't meet criteria. This means that these actions won't be executed when irrelevant changes are made.
|
|
26
|
+
list_views:
|
|
27
|
+
all:
|
|
28
|
+
label: All
|
|
29
|
+
filter_scope: space
|
|
30
|
+
columns:
|
|
31
|
+
- name
|
|
32
|
+
permission_set:
|
|
33
|
+
user:
|
|
34
|
+
allowCreate: false
|
|
35
|
+
allowDelete: false
|
|
36
|
+
allowEdit: false
|
|
37
|
+
allowRead: true
|
|
38
|
+
modifyAllRecords: false
|
|
39
|
+
viewAllRecords: true
|
|
40
|
+
admin:
|
|
41
|
+
allowCreate: true
|
|
42
|
+
allowDelete: true
|
|
43
|
+
allowEdit: true
|
|
44
|
+
allowRead: true
|
|
45
|
+
modifyAllRecords: true
|
|
46
|
+
viewAllRecords: true
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: process_flows_criteria_action
|
|
2
|
+
label: process_flows_criteria_action
|
|
3
|
+
icon: record
|
|
4
|
+
hidden: true
|
|
5
|
+
fields:
|
|
6
|
+
criteria:
|
|
7
|
+
type: master_detail
|
|
8
|
+
reference_to: process_flows_criteria
|
|
9
|
+
name:
|
|
10
|
+
type: text
|
|
11
|
+
type:
|
|
12
|
+
type: select
|
|
13
|
+
options:
|
|
14
|
+
- label: Submit for Approval
|
|
15
|
+
value: submit
|
|
16
|
+
process_definition:
|
|
17
|
+
type: lookup
|
|
18
|
+
label: Approval Process
|
|
19
|
+
reference_to: process_definition
|
|
20
|
+
skip_entry_criteria:
|
|
21
|
+
type: boolean
|
|
22
|
+
label: Skip the entry criteria for this process?
|
|
23
|
+
inlineHelpText: If selected, the record is submitted to the specified approval process, regardless of the entry criteria.
|
|
24
|
+
submitter:
|
|
25
|
+
type: select
|
|
26
|
+
options:
|
|
27
|
+
- label: Current User
|
|
28
|
+
value: current_user
|
|
29
|
+
- label: User Field from a Record
|
|
30
|
+
value: reference
|
|
31
|
+
- label: Other User
|
|
32
|
+
value: user
|
|
33
|
+
user_field:
|
|
34
|
+
type: text
|
|
35
|
+
label: User Field
|
|
36
|
+
list_views:
|
|
37
|
+
all:
|
|
38
|
+
label: All
|
|
39
|
+
filter_scope: space
|
|
40
|
+
columns:
|
|
41
|
+
- name
|
|
42
|
+
permission_set:
|
|
43
|
+
user:
|
|
44
|
+
allowCreate: false
|
|
45
|
+
allowDelete: false
|
|
46
|
+
allowEdit: false
|
|
47
|
+
allowRead: true
|
|
48
|
+
modifyAllRecords: false
|
|
49
|
+
viewAllRecords: true
|
|
50
|
+
admin:
|
|
51
|
+
allowCreate: true
|
|
52
|
+
allowDelete: true
|
|
53
|
+
allowEdit: true
|
|
54
|
+
allowRead: true
|
|
55
|
+
modifyAllRecords: true
|
|
56
|
+
viewAllRecords: true
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: process_instance
|
|
2
|
+
label: process_instance
|
|
3
|
+
hidden: true
|
|
4
|
+
icon: record
|
|
5
|
+
fields:
|
|
6
|
+
name:
|
|
7
|
+
type: text
|
|
8
|
+
process_definition:
|
|
9
|
+
type: master_detail
|
|
10
|
+
is_wide: true
|
|
11
|
+
reference_to: process_definition
|
|
12
|
+
target_object:
|
|
13
|
+
type: lookup
|
|
14
|
+
reference_to: !!js/function
|
|
15
|
+
function(){
|
|
16
|
+
return []
|
|
17
|
+
}
|
|
18
|
+
status:
|
|
19
|
+
type: select
|
|
20
|
+
options:
|
|
21
|
+
- approved
|
|
22
|
+
- fault
|
|
23
|
+
- held
|
|
24
|
+
- no_response
|
|
25
|
+
- pending
|
|
26
|
+
- reassigned
|
|
27
|
+
- rejected
|
|
28
|
+
- removed
|
|
29
|
+
- started
|
|
30
|
+
completed_date:
|
|
31
|
+
type: datetime
|
|
32
|
+
label: Completed Date
|
|
33
|
+
last_actor:
|
|
34
|
+
type: lookup
|
|
35
|
+
reference_to: users
|
|
36
|
+
submitted_by:
|
|
37
|
+
type: lookup
|
|
38
|
+
reference_to: users
|
|
39
|
+
elapsed_time_in_days:
|
|
40
|
+
type: number
|
|
41
|
+
precision: 18
|
|
42
|
+
scale: 0
|
|
43
|
+
elapsed_time_in_hours:
|
|
44
|
+
type: number
|
|
45
|
+
precision: 5
|
|
46
|
+
scale: 2
|
|
47
|
+
elapsed_time_in_minutes:
|
|
48
|
+
type: number
|
|
49
|
+
precision: 8
|
|
50
|
+
scale: 0
|
|
51
|
+
permission_set:
|
|
52
|
+
user:
|
|
53
|
+
allowCreate: false
|
|
54
|
+
allowDelete: false
|
|
55
|
+
allowEdit: false
|
|
56
|
+
allowRead: true
|
|
57
|
+
modifyAllRecords: false
|
|
58
|
+
viewAllRecords: true
|
|
59
|
+
admin:
|
|
60
|
+
allowCreate: false
|
|
61
|
+
allowDelete: false
|
|
62
|
+
allowEdit: false
|
|
63
|
+
allowRead: true
|
|
64
|
+
modifyAllRecords: false
|
|
65
|
+
viewAllRecords: true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
approveVisible: function(object_name, record_id, record_permissions){
|
|
3
|
+
return Steedos.ProcessManager.allowApprover(object_name, record_id)
|
|
4
|
+
},
|
|
5
|
+
approve: function(object_name, record_id, fields){
|
|
6
|
+
Steedos.ProcessManager.approve(object_name, record_id);
|
|
7
|
+
},
|
|
8
|
+
rejectVisible: function(object_name, record_id, record_permissions){
|
|
9
|
+
return Steedos.ProcessManager.allowApprover(object_name, record_id)
|
|
10
|
+
},
|
|
11
|
+
reject: function(object_name, record_id, fields){
|
|
12
|
+
Steedos.ProcessManager.reject(object_name, record_id);
|
|
13
|
+
},
|
|
14
|
+
reassignVisible: function(object_name, record_id, record_permissions){
|
|
15
|
+
return Steedos.ProcessManager.allowApprover(object_name, record_id)
|
|
16
|
+
},
|
|
17
|
+
reassign: function(object_name, record_id, fields){
|
|
18
|
+
Steedos.ProcessManager.reassign(object_name, record_id);
|
|
19
|
+
},
|
|
20
|
+
recallVisible: function(){
|
|
21
|
+
return Steedos.ProcessManager.allowRecall(Session.get("object_name"), Session.get("record_id"))
|
|
22
|
+
},
|
|
23
|
+
recall: function(object_name, record_id, fields){
|
|
24
|
+
Steedos.ProcessManager.recall(object_name, record_id);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
name: process_instance_history
|
|
2
|
+
label: Approval History
|
|
3
|
+
hidden: true
|
|
4
|
+
icon: approval
|
|
5
|
+
version: 2
|
|
6
|
+
# paging:
|
|
7
|
+
# enabled: false
|
|
8
|
+
fields:
|
|
9
|
+
name:
|
|
10
|
+
type: text
|
|
11
|
+
label: Step Name
|
|
12
|
+
hidden: true
|
|
13
|
+
created_by:
|
|
14
|
+
label: Submitter
|
|
15
|
+
is_wide: true
|
|
16
|
+
process_instance:
|
|
17
|
+
type: lookup
|
|
18
|
+
reference_to: process_instance
|
|
19
|
+
hidden: true
|
|
20
|
+
process_instance_node:
|
|
21
|
+
type: lookup
|
|
22
|
+
reference_to: process_instance_node
|
|
23
|
+
hidden: true
|
|
24
|
+
step_status:
|
|
25
|
+
type: select
|
|
26
|
+
label: Status
|
|
27
|
+
hidden: true
|
|
28
|
+
options:
|
|
29
|
+
- approved
|
|
30
|
+
- fault
|
|
31
|
+
- held
|
|
32
|
+
- no_response
|
|
33
|
+
- pending
|
|
34
|
+
- reassigned
|
|
35
|
+
- rejected
|
|
36
|
+
- removed
|
|
37
|
+
- started
|
|
38
|
+
original_actor:
|
|
39
|
+
type: lookup
|
|
40
|
+
label: Assigned To
|
|
41
|
+
reference_to: users
|
|
42
|
+
sort_no: 100
|
|
43
|
+
actor:
|
|
44
|
+
type: lookup
|
|
45
|
+
label: Actual Approver
|
|
46
|
+
reference_to: users
|
|
47
|
+
sort_no: 200
|
|
48
|
+
target_object:
|
|
49
|
+
type: lookup
|
|
50
|
+
label: Approval Details
|
|
51
|
+
is_wide: true
|
|
52
|
+
sort_no: 300
|
|
53
|
+
reference_to: !!js/function
|
|
54
|
+
function(){
|
|
55
|
+
return ['contracts']
|
|
56
|
+
}
|
|
57
|
+
comments:
|
|
58
|
+
sort_no: 400
|
|
59
|
+
type: textarea
|
|
60
|
+
label: Comments
|
|
61
|
+
is_wide: true
|
|
62
|
+
step_node:
|
|
63
|
+
type: lookup
|
|
64
|
+
reference_to: process_node
|
|
65
|
+
hidden: true
|
|
66
|
+
elapsed_time_in_days:
|
|
67
|
+
type: number
|
|
68
|
+
precision: 18
|
|
69
|
+
scale: 0
|
|
70
|
+
hidden: true
|
|
71
|
+
omit: true
|
|
72
|
+
elapsed_time_in_hours:
|
|
73
|
+
type: number
|
|
74
|
+
precision: 5
|
|
75
|
+
scale: 2
|
|
76
|
+
hidden: true
|
|
77
|
+
omit: true
|
|
78
|
+
elapsed_time_in_minutes:
|
|
79
|
+
type: number
|
|
80
|
+
precision: 8
|
|
81
|
+
scale: 0
|
|
82
|
+
hidden: true
|
|
83
|
+
omit: true
|
|
84
|
+
modified:
|
|
85
|
+
hidden: true
|
|
86
|
+
omit: true
|
|
87
|
+
modified_by:
|
|
88
|
+
hidden: true
|
|
89
|
+
omit: true
|
|
90
|
+
list_views:
|
|
91
|
+
all:
|
|
92
|
+
label: All
|
|
93
|
+
filter_scope: space
|
|
94
|
+
sort: [["modified", "desc"]]
|
|
95
|
+
extra_columns:
|
|
96
|
+
- step_node
|
|
97
|
+
columns:
|
|
98
|
+
- name
|
|
99
|
+
- step_status
|
|
100
|
+
- modified
|
|
101
|
+
- comments
|
|
102
|
+
- original_actor
|
|
103
|
+
- actor
|
|
104
|
+
actions:
|
|
105
|
+
approve:
|
|
106
|
+
label: Approve
|
|
107
|
+
on: record_only
|
|
108
|
+
visible: true
|
|
109
|
+
reject:
|
|
110
|
+
label: Reject
|
|
111
|
+
on: record_only
|
|
112
|
+
visible: true
|
|
113
|
+
reassign:
|
|
114
|
+
label: Reassign
|
|
115
|
+
on: record_only
|
|
116
|
+
visible: true
|
|
117
|
+
recall:
|
|
118
|
+
label: Recall
|
|
119
|
+
on: record_only
|
|
120
|
+
visible: true
|
|
121
|
+
permission_set:
|
|
122
|
+
user:
|
|
123
|
+
allowCreate: false
|
|
124
|
+
allowDelete: false
|
|
125
|
+
allowEdit: false
|
|
126
|
+
allowRead: true
|
|
127
|
+
modifyAllRecords: false
|
|
128
|
+
viewAllRecords: true
|
|
129
|
+
admin:
|
|
130
|
+
allowCreate: false
|
|
131
|
+
allowDelete: false
|
|
132
|
+
allowEdit: false
|
|
133
|
+
allowRead: true
|
|
134
|
+
modifyAllRecords: false
|
|
135
|
+
viewAllRecords: true
|
|
136
|
+
form:
|
|
137
|
+
afterView: !!js/function |
|
|
138
|
+
function(){
|
|
139
|
+
var step_status = this.doc.step_status;
|
|
140
|
+
$("div", $(".crm-header-title")).css("display", "inline");
|
|
141
|
+
switch (step_status) {
|
|
142
|
+
case 'approved':
|
|
143
|
+
$(".crm-header-title").append('<span class="text-xs inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-green-500 text-white rounded">'+TAPi18n.__("process_instance_history_field_step_status_options_approved")+'</span>')
|
|
144
|
+
break;
|
|
145
|
+
case 'rejected':
|
|
146
|
+
$(".crm-header-title").append('<span class="text-xs inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-red-600 text-white rounded">'+TAPi18n.__("process_instance_history_field_step_status_options_rejected")+'</span>')
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
$(".crm-header-title").append('<span class="text-xs inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-gray-200 text-gray-700 rounded">'+TAPi18n.__("process_instance_history_field_step_status_options_"+step_status)+'</span>')
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
// $(".object-form [fieldname=target_object] a.link-detail").attr("target", "_blank");
|
|
153
|
+
}
|