1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
constants.php
См. документацию.
1<?php
2
4
6{
7 const Initialized = 0;
8 const Executing = 1;
9 const Canceling = 2;
10 const Closed = 3;
11 const Faulting = 4;
12
13 public static function out($v)
14 {
15 $result = "";
16
17 switch ($v)
18 {
19 case self::Initialized:
20 $result = "Initialized";
21 break;
22 case self::Executing:
23 $result = "Executing";
24 break;
25 case self::Canceling:
26 $result = "Canceling";
27 break;
28 case self::Closed:
29 $result = "Closed";
30 break;
31 case self::Faulting:
32 $result = "Faulting";
33 break;
34 default:
35 throw new Exception("UnknownActivityExecutionStatus");
36 }
37
38 return $result;
39 }
40}
41
43{
44 const None = 0;
45 const Succeeded = 1;
46 const Canceled = 2;
47 const Faulted = 3;
48 const Uninitialized = 4;
49
50 public static function out($v)
51 {
52 $result = "";
53
54 switch ($v)
55 {
56 case self::None:
57 $result = "None";
58 break;
59 case self::Succeeded:
60 $result = "Succeeded";
61 break;
62 case self::Canceled:
63 $result = "Canceled";
64 break;
65 case self::Faulted:
66 $result = "Faulted";
67 break;
68 case self::Uninitialized:
69 $result = "Uninitialized";
70 break;
71 default:
72 throw new Exception("UnknownActivityExecutionResult");
73 }
74
75 return $result;
76 }
77}
78
80{
81 const Created = 0;
82 const Running = 1;
83 const Completed = 2;
84 const Suspended = 3;
85 const Terminated = 4;
86
87 public static function out($v)
88 {
89 $result = "";
90
91 switch ($v)
92 {
93 case self::Created:
94 $result = "Created";
95 break;
96 case self::Running:
97 $result = "Running";
98 break;
99 case self::Completed:
100 $result = "Completed";
101 break;
102 case self::Suspended:
103 $result = "Suspended";
104 break;
105 case self::Terminated:
106 $result = "Terminated";
107 break;
108 default:
109 throw new Exception("UnknownWorkflowStatus");
110 }
111
112 return $result;
113 }
114
115 public static function isFinished(int $status): bool
116 {
117 return $status === static::Completed || $status === static::Terminated;
118 }
119}
120
122{
123 const Execute = 0;
124 const Cancel = 1;
125 const HandleFault = 2;
126
127 public static function out($v)
128 {
129 $result = "";
130
131 switch ($v)
132 {
133 case self::Execute:
134 $result = "Execute";
135 break;
136 case self::Cancel:
137 $result = "Running";
138 break;
139 case self::HandleFault:
140 $result = "HandleFault";
141 break;
142 default:
143 throw new Exception("UnknownActivityExecutorOperationType");
144 }
145
146 return $result;
147 }
148}
149
151{
152 const None = 0;
153 const Create = 1;
154 const Edit = 2;
155 const Delete = 4;
156 const Automation = 8;
157 const Manual = 16;
158 const Script = 32;
159 const Debug = 64;
160
161 public static function out($v)
162 {
163 $result = [];
164
165 if ($v == self::None)
166 {
167 $result[] = "None";
168 }
169
170 if (($v & self::Create) != 0)
171 {
172 $result[] = "Create";
173 }
174
175 if (($v & self::Edit) != 0)
176 {
177 $result[] = "Edit";
178 }
179
180 if (($v & self::Delete) != 0)
181 {
182 $result[] = "Delete";
183 }
184
185 if (($v & self::Automation) != 0)
186 {
187 $result[] = "Automation";
188 }
189
190 if (($v & self::Manual) != 0)
191 {
192 $result[] = "Manual";
193 }
194
195 if (($v & self::Script) != 0)
196 {
197 $result[] = "Script";
198 }
199
200 if (($v & self::Debug) != 0)
201 {
202 $result[] = "Debug";
203 }
204
205 return implode(', ', $result);
206 }
207}
208
219
221{
222 const Hold = 1;
223 const Rewrite = 2;
224 const Clear = 3;
225
226 const ScopeWorkflow = 1;
227 const ScopeDocument = 2;
228
229 public static function outMode($v)
230 {
231 $result = "";
232 switch ($v)
233 {
234 case self::Rewrite:
235 $result = "Rewrite";
236 break;
237 case self::Clear:
238 $result = "Clear";
239 break;
240 default:
241 $result = "Hold";
242 }
243 return $result;
244 }
245
246 public static function outScope($v)
247 {
248 if ($v == self::ScopeDocument)
249 {
250 return "ScopeDocument";
251 }
252 return "ScopeWorkflow";
253 }
254}
255
257{
258 public const Running = 0;
259 public const CompleteYes = 1;
260 public const CompleteNo = 2;
261 public const CompleteOk = 3;
262 public const Timeout = 4;
263 public const CompleteCancel = 5;
264
265 public static function isSuccess(int $status)
266 {
267 return $status === self::CompleteYes || $status === self::CompleteOk;
268 }
269}
270
272{
273 public const Waiting = 0;
274 public const Yes = 1;
275 public const No = 2;
276 public const Ok = 3;
277 public const Cancel = 4;
278
279 public static function resolveStatus($name)
280 {
281 switch (mb_strtolower((string)$name))
282 {
283 case '0':
284 case 'waiting':
285 return self::Waiting;
286 case '1':
287 case 'yes':
288 return self::Yes;
289 case '2':
290 case 'no':
291 return self::No;
292 case '3':
293 case 'ok':
294 return self::Ok;
295 case '4':
296 case 'cancel':
297 return self::Cancel;
298 }
299 return null;
300 }
301
302 public static function isPositive(int $status): bool
303 {
304 return $status === self::Yes || $status === self::Ok;
305 }
306
307 public static function isNegative(int $status): bool
308 {
309 return $status === self::No || $status === self::Cancel;
310 }
311}
312
314{
315 const Add = 1;
316 const Update = 2;
317 const Delegate = 3;
318 const Delete = 4;
319}
320
322{
323 public const Subordinate = 0; // default value
324 public const AllEmployees = 1;
325 public const None = 2;
326 public const ExactlyNone = 3; // not public type
327
328 public static function getSelectList()
329 {
330 return [
331 self::Subordinate => Loc::getMessage('BPCG_CONSTANTS_DELEGATION_TYPE_SUBORDINATE'),
332 self::AllEmployees => Loc::getMessage('BPCG_CONSTANTS_DELEGATION_TYPE_ALL_EMPLOYEES'),
333 self::None => Loc::getMessage('BPCG_CONSTANTS_DELEGATION_TYPE_NONE'),
334 ];
335 }
336}
const Faulted
Определения constants.php:47
const Succeeded
Определения constants.php:45
const Uninitialized
Определения constants.php:48
const Canceled
Определения constants.php:46
const None
Определения constants.php:44
static out($v)
Определения constants.php:50
const Executing
Определения constants.php:8
const Canceling
Определения constants.php:9
const Faulting
Определения constants.php:11
const Initialized
Определения constants.php:7
const Closed
Определения constants.php:10
static out($v)
Определения constants.php:13
static out($v)
Определения constants.php:127
const ViewWorkflow
Определения constants.php:211
const CreateWorkflow
Определения constants.php:213
const StartWorkflow
Определения constants.php:212
const ReadDocument
Определения constants.php:216
const DebugAutomation
Определения constants.php:217
const WriteDocument
Определения constants.php:215
const CreateAutomation
Определения constants.php:214
const Edit
Определения constants.php:154
const Manual
Определения constants.php:157
const Debug
Определения constants.php:159
const Automation
Определения constants.php:156
const Create
Определения constants.php:153
const Script
Определения constants.php:158
const None
Определения constants.php:152
const Delete
Определения constants.php:155
static out($v)
Определения constants.php:161
const ScopeWorkflow
Определения constants.php:226
static outScope($v)
Определения constants.php:246
const Rewrite
Определения constants.php:223
const ScopeDocument
Определения constants.php:227
static outMode($v)
Определения constants.php:229
const Clear
Определения constants.php:224
const Hold
Определения constants.php:222
const Add
Определения constants.php:315
const Delegate
Определения constants.php:317
const Delete
Определения constants.php:318
const Update
Определения constants.php:316
const AllEmployees
Определения constants.php:324
const ExactlyNone
Определения constants.php:326
const None
Определения constants.php:325
static getSelectList()
Определения constants.php:328
const Subordinate
Определения constants.php:323
Определения constants.php:257
const Timeout
Определения constants.php:262
const CompleteOk
Определения constants.php:261
const Running
Определения constants.php:258
static isSuccess(int $status)
Определения constants.php:265
const CompleteNo
Определения constants.php:260
const CompleteYes
Определения constants.php:259
const CompleteCancel
Определения constants.php:263
Определения constants.php:272
const Ok
Определения constants.php:276
const Yes
Определения constants.php:274
const Cancel
Определения constants.php:277
static isNegative(int $status)
Определения constants.php:307
static isPositive(int $status)
Определения constants.php:302
const No
Определения constants.php:275
static resolveStatus($name)
Определения constants.php:279
const Waiting
Определения constants.php:273
Определения constants.php:80
const Suspended
Определения constants.php:84
const Running
Определения constants.php:82
static isFinished(int $status)
Определения constants.php:115
const Completed
Определения constants.php:83
const Terminated
Определения constants.php:85
const Created
Определения constants.php:81
static out($v)
Определения constants.php:87
$result
Определения get_property_values.php:14
$status
Определения session.php:10
$name
Определения menu_edit.php:35