-
Notifications
You must be signed in to change notification settings - Fork 0
/
datamodel.sv-approval-advanced.xml
370 lines (361 loc) · 17.1 KB
/
datamodel.sv-approval-advanced.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<?xml version="1.0" encoding="utf-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
<classes>
<class id="ApprovalRuleLevel" _delta="define">
<parent>cmdbAbstractObject</parent>
<properties>
<category/>
<abstract>false</abstract>
<db_table>approval_rule_level</db_table>
<naming>
<attributes>
<attribute id="rule_name"/>
<attribute id="level"/>
</attributes>
</naming>
<reconciliation>
<attributes>
<attribute id="rule_id"/>
<attribute id="level"/>
</attributes>
</reconciliation>
<uniqueness_rules>
<rule id="rule_level">
<attributes>
<attribute id="rule_id"/>
<attribute id="level"/>
</attributes>
</rule>
</uniqueness_rules>
</properties>
<fields>
<field id="rule_id" xsi:type="AttributeExternalKey">
<sql>rule_id</sql>
<is_null_allowed>false</is_null_allowed>
<target_class>ApprovalRule</target_class>
<on_target_delete>DEL_AUTO</on_target_delete>
</field>
<field id="rule_name" xsi:type="AttributeExternalField">
<extkey_attcode>rule_id</extkey_attcode>
<target_attcode>name</target_attcode>
</field>
<field id="level" xsi:type="AttributeInteger">
<sql>level</sql>
<default_value>1</default_value>
<is_null_allowed>false</is_null_allowed>
<tracking_level>none</tracking_level>
</field>
<field id="approvers" xsi:type="AttributeOQL">
<sql>approvers</sql>
<default_value>SELECT Person</default_value>
<is_null_allowed>false</is_null_allowed>
</field>
<field id="default_approval" xsi:type="AttributeEnum" _delta="define">
<values>
<value>yes</value>
<value>no</value>
</values>
<sql>default_approval</sql>
<default_value>no</default_value>
<is_null_allowed>false</is_null_allowed>
</field>
<field id="timeout" xsi:type="AttributeInteger" _delta="define">
<sql>timeout</sql>
<default_value>70</default_value>
<is_null_allowed>false</is_null_allowed>
</field>
<field id="exit_condition" xsi:type="AttributeEnum" _delta="define">
<values>
<value>first_reply</value>
<value>first_reject</value>
<value>first_approve</value>
</values>
<sql>exit_condition</sql>
<default_value>first_reply</default_value>
<is_null_allowed>false</is_null_allowed>
</field>
</fields>
<methods/>
<presentation>
<details>
<items>
<item id="rule_id">
<rank>10</rank>
</item>
<item id="level">
<rank>20</rank>
</item>
<item id="approvers">
<rank>30</rank>
</item>
<item id="default_approval">
<rank>40</rank>
</item>
<item id="timeout">
<rank>50</rank>
</item>
<item id="exit_condition">
<rank>60</rank>
</item>
</items>
</details>
<list>
<items>
<item id="level">
<rank>10</rank>
</item>
<item id="default_approval">
<rank>20</rank>
</item>
<item id="timeout">
<rank>30</rank>
</item>
<item id="exit_condition">
<rank>40</rank>
</item>
</items>
</list>
</presentation>
</class>
<class id="ApprovalRule" _created_in="combodo-approval-extended" _delta="must_exist">
<fields>
<field id="level_list" xsi:type="AttributeLinkedSet" _delta="define">
<linked_class>ApprovalRuleLevel</linked_class>
<ext_key_to_me>rule_id</ext_key_to_me>
<tracking_level>all</tracking_level>
<edit_mode>in_place</edit_mode>
</field>
<field id="level1_rule" _delta="delete"/>
<field id="level1_default_approval" _delta="delete"/>
<field id="level1_timeout" _delta="delete"/>
<field id="level1_exit_condition" _delta="delete"/>
<field id="level2_rule" _delta="delete"/>
<field id="level2_default_approval" _delta="delete"/>
<field id="level2_timeout" _delta="delete"/>
<field id="level2_exit_condition" _delta="delete"/>
</fields>
<presentation>
<details>
<items>
<item id="level_list" _delta="define">
<rank>5</rank>
</item>
<item id="col:col2">
<items>
<item id="fieldset:ApprovalRule:Level1" _delta="delete"/>
</items>
</item>
<item id="col:col3">
<items>
<item id="fieldset:ApprovalRule:Level2" _delta="delete"/>
</items>
</item>
</items>
</details>
</presentation>
</class>
<class id="ExtendedApprovalScheme" _created_in="combodo-approval-extended" _delta="must_exist">
<methods>
<method id="GetApprovalScheme">
<code _delta="redefine"><![CDATA[ public static function GetApprovalScheme($oObject, $sReachingState)
{
if (!is_a($oObject, UserRequest::class))
{
return null;
}
$sTargetState = MetaModel::GetConfig()->GetModuleSetting('combodo-approval-extended', 'target_state', 'new');
if ($sReachingState != $sTargetState)
{
return null;
}
$sOQL = 'SELECT ApprovalRuleLevel WHERE rule_id = :rule_id';
$oApprovalRuleLevelSet = new DBObjectSet(
DBObjectSearch::FromOQL($sOQL),
array('level' => true),
array('rule_id' => $oObject->Get('servicesubcategory_id->approvalrule_id'))
);
if ($oApprovalRuleLevelSet->count() == 0)
{
// No approval rule applies to the current object
return null;
}
$aExitConditionCodes = array(
'first_reply' => ApprovalScheme::EXIT_ON_FIRST_REPLY,
'first_reject' => ApprovalScheme::EXIT_ON_FIRST_REJECT,
'first_approve' => ApprovalScheme::EXIT_ON_FIRST_APPROVE,
);
$bReusePreviousAnswers = MetaModel::GetConfig()->GetModuleSetting('combodo-approval-extended', 'reuse_previous_answers', true);
/** @var _ApprovalScheme_ $oScheme */
$oScheme = new ExtendedApprovalScheme();
$bStepAdded = false;
/** @var ApprovalRuleLevel $oApprovalRuleLevel */
while ($oApprovalRuleLevel = $oApprovalRuleLevelSet->Fetch())
{
$bStepAdded |= $oScheme->AddStepFromQuery(
$oObject,
$oApprovalRuleLevel->Get('approvers'),
$oApprovalRuleLevel->Get('timeout') * 3600,
$oApprovalRuleLevel->Get('default_approval') == 'yes',
$aExitConditionCodes[$oApprovalRuleLevel->Get('exit_condition')],
$bReusePreviousAnswers
);
}
if ($bStepAdded)
{
$oObject->ApplyStimulus('ev_wait_for_approval');
return $oScheme;
}
}]]></code>
</method>
</methods>
</class>
<class id="GRExtendedApprovalScheme" _created_in="itop-global-requests-mgmt" _delta="if_exists">
<methods>
<method id="GetApprovalScheme">
<code _delta="redefine"><![CDATA[ public static function GetApprovalScheme($oObject, $sReachingState)
{
$aExitConditionCodes = array(
'first_reply' => ApprovalScheme::EXIT_ON_FIRST_REPLY,
'first_reject' => ApprovalScheme::EXIT_ON_FIRST_REJECT,
'first_approve' => ApprovalScheme::EXIT_ON_FIRST_APPROVE,
);
if (!($oObject instanceof GlobalRequest))
{
return null;
}
if ($sReachingState != 'new')
{
return null;
}
$sOQL = 'SELECT ApprovalRuleLevel AS ARL JOIN ApprovalRule AS AR ON ARL.rule_id = AR.id JOIN GRType AS T ON T.approvalrule_id = AR.id WHERE T.code = :code';
$oApprovalRuleLevelSet = new DBObjectSet(
DBObjectSearch::FromOQL($sOQL),
array('level' => true),
array('code' => get_class($oObject))
);
$bReusePreviousAnswers = MetaModel::GetConfig()->GetModuleSetting('gr-approval-extended', 'reuse_previous_answers', true);
/** @var _ApprovalScheme_ $oScheme */
$oScheme = new GRExtendedApprovalScheme();
$bStepAdded = false;
/** @var ApprovalRuleLevel $oApprovalRuleLevel */
while ($oApprovalRuleLevel = $oApprovalRuleLevelSet->Fetch())
{
$bStepAdded |= $oScheme->AddStepFromQuery(
$oObject,
$oApprovalRuleLevel->Get('approvers'),
$oApprovalRuleLevel->Get('timeout') * 3600,
$oApprovalRuleLevel->Get('default_approval') == 'yes',
$aExitConditionCodes[$oApprovalRuleLevel->Get('exit_condition')],
$bReusePreviousAnswers
);
}
if ($bStepAdded)
{
$oObject->ApplyStimulus('ev_wait_for_approval');
return $oScheme;
}
else
{
$oObject->ApplyStimulus('ev_wip');
return null;
}
}]]></code>
</method>
</methods>
</class>
</classes>
<dictionaries>
<dictionary id="EN US">
<entries>
<entry id="Class:ApprovalRule/Attribute:level_list" _delta="define">Levels</entry>
<entry id="Class:ApprovalRule/Attribute:level_list+" _delta="define">All the approval levels for this approval rule</entry>
<entry id="Class:ApprovalRuleLevel" _delta="define">Approval Rule Level</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:approvers" _delta="define">Approvers</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval" _delta="define">Automatically approved if no answer</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:no" _delta="define">No</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:yes" _delta="define">Yes</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition" _delta="define">Approval ending</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve" _delta="define">Ends on first "Approve"</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve+" _delta="define">Only one approval is requested</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject" _delta="define">Ends on first "Reject"</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject+" _delta="define">Everyone must approve</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply" _delta="define">Ends on the first reply</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply+" _delta="define">The first reply determines the result at this level</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:level" _delta="define">Level</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_id" _delta="define">Approval rule</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_name" _delta="define">Approval rule name</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:timeout" _delta="define">Approval delay (hours)</entry>
<entry id="Class:ApprovalRuleLevel/Name" _delta="define">%1$s - Level %2$s</entry>
</entries>
</dictionary>
<dictionary id="FR FR">
<entries>
<entry id="Class:ApprovalRule/Attribute:level_list" _delta="define">Niveaux</entry>
<entry id="Class:ApprovalRule/Attribute:level_list+" _delta="define">Tous les niveaux d'approbation de cette règle d'approbation</entry>
<entry id="Class:ApprovalRuleLevel" _delta="define">Niveau de règle d'approbation</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:approvers" _delta="define">Approbateurs</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval" _delta="define">Approuver automatiquement si pas de réponse</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:no" _delta="define">Non</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:yes" _delta="define">Oui</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition" _delta="define">Fin de l'approbation</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve" _delta="define">Se termine à la première "Approbation"</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve+" _delta="define">Une seule approbation nécessaire</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject" _delta="define">Se termine au premier "Refus"</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject+" _delta="define">Tout le monde doit approuver</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply" _delta="define">Se termine à la première réponse</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply+" _delta="define">La première réponse détermine le résultat de ce niveau</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:level" _delta="define">Niveau</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_id" _delta="define">Règle d'approbation</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_name" _delta="define">Nom de la règle d'approbation</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:timeout" _delta="define">Délai d'approbation (heures)</entry>
<entry id="Class:ApprovalRuleLevel/Name" _delta="define">%1$s - Niveau %2$s</entry>
</entries>
</dictionary>
<dictionary id="PT BR">
<entries>
<entry id="Class:ApprovalRule/Attribute:level_list" _delta="define">Níveis</entry>
<entry id="Class:ApprovalRule/Attribute:level_list+" _delta="define">Todos os níveis de aprovação para essa regra de aprovação</entry>
<entry id="Class:ApprovalRuleLevel" _delta="define">Nível da regra de aprovação</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:approvers" _delta="define">Aprovadores</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval" _delta="define">Aprovar automaticamente se sem resposta</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:no" _delta="define">Não</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:yes" _delta="define">Sim</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition" _delta="define">Fim da aprovação</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve" _delta="define">Finaliza na primeira aprovação</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve+" _delta="define">Apenas uma aprovação é obrigatória</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject" _delta="define">Finaliza na primeira rejeição</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject+" _delta="define">Todos devem aprovar</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply" _delta="define">Finaliza na primeira resposta</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply+" _delta="define">A primeira resposta determina o resultado deste nível de aprovação</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:level" _delta="define">Nível</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_id" _delta="define">Regra de aprovação</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_name" _delta="define">Nome da regra de aprovação</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:timeout" _delta="define">Tempo de aprovação (horas)</entry>
<entry id="Class:ApprovalRuleLevel/Name" _delta="define">%1$s - Nível%2$s</entry>
</entries>
</dictionary>
<dictionary id="NL NL">
<entries>
<entry id="Class:ApprovalRule/Attribute:level_list" _delta="define">Niveaus</entry>
<entry id="Class:ApprovalRule/Attribute:level_list+" _delta="define">Alle goedkeuring niveaus voor deze goedkeuring regel</entry>
<entry id="Class:ApprovalRuleLevel" _delta="define">Goedkeuringsprocedure Niveau</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:approvers" _delta="define">Goedkeurders</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval" _delta="define">Automatisch goedgekeurd bij geen antwoord</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:no" _delta="define">Nee</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:default_approval/Value:yes" _delta="define">Ja</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition" _delta="define">Einde van goedkeuringsprocedure</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve" _delta="define">Eindigt na eerste goedkeuring</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_approve+" _delta="define">Enkel één goedkeuring is benodigd</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject" _delta="define">Eindigt na eerste afkeuring</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reject+" _delta="define">Iedereen moet goedkeuren</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply" _delta="define">Eindigt na eerste antwoord</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:exit_condition/Value:first_reply+" _delta="define">The first reply determines the result at this level~~</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:level" _delta="define">Niveau</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_id" _delta="define">Goedkeuringsprocedure</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:rule_name" _delta="define">Naam goedkeuringsprocedure</entry>
<entry id="Class:ApprovalRuleLevel/Attribute:timeout" _delta="define">Approval delay (hours)~~</entry>
<entry id="Class:ApprovalRuleLevel/Name" _delta="define">%1$s - Niveau %2$s</entry>
</entries>
</dictionary>
</dictionaries>
</itop_design>