@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'DASHBOARD_CALENDAR_WIDGET_FILTER_TYPE' => [ |
34 | 34 | 'default' => 'list', |
35 | 35 | 'description' => 'Shows the switch button or filter list in the calendar widget: switch - Switch "To realize" and "History", list - filter list', |
36 | - 'validation' => function () { |
|
36 | + 'validation' => function() { |
|
37 | 37 | $arg = func_get_arg(0); |
38 | 38 | return 'list' === $arg || 'switch' === $arg; |
39 | 39 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'SHOW_QUICK_CREATE_BY_STATUS' => [ |
42 | 42 | 'default' => [], |
43 | 43 | 'description' => 'Show the Calendar quick create window after changing the status: array - PLL_COMPLETED, PLL_CANCELLED', |
44 | - 'validation' => function () { |
|
44 | + 'validation' => function() { |
|
45 | 45 | $arg = func_get_arg(0); |
46 | 46 | return \is_array($arg) && empty(array_diff($arg, ['PLL_COMPLETED', 'PLL_CANCELLED'])); |
47 | 47 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'HIDDEN_DAYS_IN_CALENDAR_VIEW' => [ |
68 | 68 | 'default' => [0, 6], |
69 | 69 | 'description' => 'Exclude certain days-of-the-week from being displayed. The value is an array of day-of-week indices to hide. Each index is zero-base (Sunday=0) and ranges from 0-6. By default, no days are hidden', |
70 | - 'validation' => function () { |
|
70 | + 'validation' => function() { |
|
71 | 71 | $arg = func_get_arg(0); |
72 | 72 | return 'Extended' === $arg || 'Standard' === $arg; |
73 | 73 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'default' => 5000, |
95 | 95 | 'description' => 'Max number of records to update status in cron', |
96 | 96 | 'validation' => '\App\Validator::naturalNumber', |
97 | - 'sanitization' => function () { |
|
97 | + 'sanitization' => function() { |
|
98 | 98 | return (int) func_get_arg(0); |
99 | 99 | } |
100 | 100 | ], |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'CALENDAR_VIEW' => [ |
108 | 108 | 'default' => 'Extended', |
109 | 109 | 'description' => 'Calendar view - allowed values: Extended, Standard, refresh menu files after you change this value', |
110 | - 'validation' => function () { |
|
110 | + 'validation' => function() { |
|
111 | 111 | $arg = func_get_arg(0); |
112 | 112 | return 'Extended' === $arg || 'Standard' === $arg; |
113 | 113 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $mailerContent['to'][] = $this->address_emails; |
47 | 47 | } |
48 | 48 | if ($this->relations_email && '-' !== $this->relations_email) { |
49 | - [$relatedModule,$relatedFieldName,$onlyFirst] = array_pad(explode('::', $this->relations_email), 3, false); |
|
49 | + [$relatedModule, $relatedFieldName, $onlyFirst] = array_pad(explode('::', $this->relations_email), 3, false); |
|
50 | 50 | $relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $relatedModule); |
51 | 51 | $relationListView->setFields(['id', $relatedFieldName]); |
52 | 52 | $relationListView->set('search_key', $relatedFieldName); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function testGetPicklistValue() |
48 | 48 | { |
49 | - \App\Db::getInstance()->createCommand()->insert('vtiger_activitytype', ['activitytype' => 'UnitTestCalendar', 'presence' => 1, 'sortorderid' => 99, 'color' => 'A0B584'])->execute(); |
|
49 | + \App\Db::getInstance()->createCommand()->insert('vtiger_activitytype', ['activitytype' => 'UnitTestCalendar', 'presence' => 1, 'sortorderid' => 99, 'color' => 'A0B584'])->execute(); |
|
50 | 50 | \App\Cache::clear(); |
51 | 51 | $this->assertGreaterThan(0, (\count(\Settings_Calendar_Module_Model::getPicklistValue())), 'Calendar activity type picklist is empty'); |
52 | 52 | } |
@@ -21,43 +21,43 @@ |
||
21 | 21 | const SYSTEM_FIELDS = [ |
22 | 22 | 'assigned_user_id' => [ |
23 | 23 | 'validationConditions' => ['name'], |
24 | - 'name' => 'assigned_user_id', 'column' => 'smownerid', 'label' => 'Assigned To', 'table' => 'vtiger_crmentity', |
|
25 | - 'uitype' => 53, 'typeofdata' => 'V~M', 'maximumlength' => 65535, |
|
24 | + 'name' => 'assigned_user_id', 'column' => 'smownerid', 'label' => 'Assigned To', 'table' => 'vtiger_crmentity', |
|
25 | + 'uitype' => 53, 'typeofdata' => 'V~M', 'maximumlength' => 65535, |
|
26 | 26 | ], |
27 | 27 | 'createdtime' => [ |
28 | 28 | 'validationConditions' => ['name'], |
29 | - 'name' => 'createdtime', 'column' => 'createdtime', 'label' => 'Created Time', 'table' => 'vtiger_crmentity', |
|
30 | - 'uitype' => 70, 'typeofdata' => 'DT~O', 'displaytype' => 2, 'maximumlength' => 65535, |
|
29 | + 'name' => 'createdtime', 'column' => 'createdtime', 'label' => 'Created Time', 'table' => 'vtiger_crmentity', |
|
30 | + 'uitype' => 70, 'typeofdata' => 'DT~O', 'displaytype' => 2, 'maximumlength' => 65535, |
|
31 | 31 | ], |
32 | 32 | 'modifiedtime' => [ |
33 | 33 | 'validationConditions' => ['name'], |
34 | - 'name' => 'modifiedtime', 'column' => 'modifiedtime', 'label' => 'Modified Time', 'table' => 'vtiger_crmentity', |
|
35 | - 'uitype' => 70, 'typeofdata' => 'DT~O', 'displaytype' => 2, 'maximumlength' => 65535, |
|
34 | + 'name' => 'modifiedtime', 'column' => 'modifiedtime', 'label' => 'Modified Time', 'table' => 'vtiger_crmentity', |
|
35 | + 'uitype' => 70, 'typeofdata' => 'DT~O', 'displaytype' => 2, 'maximumlength' => 65535, |
|
36 | 36 | ], |
37 | 37 | 'created_user_id' => [ |
38 | 38 | 'validationConditions' => ['column'], |
39 | - 'name' => 'created_user_id', 'column' => 'smcreatorid', 'label' => 'Created By', 'table' => 'vtiger_crmentity', |
|
40 | - 'uitype' => 52, 'typeofdata' => 'V~O', 'displaytype' => 2, 'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535, |
|
39 | + 'name' => 'created_user_id', 'column' => 'smcreatorid', 'label' => 'Created By', 'table' => 'vtiger_crmentity', |
|
40 | + 'uitype' => 52, 'typeofdata' => 'V~O', 'displaytype' => 2, 'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535, |
|
41 | 41 | ], |
42 | 42 | 'modifiedby' => [ |
43 | 43 | 'validationConditions' => ['name'], |
44 | - 'name' => 'modifiedby', 'column' => 'modifiedby', 'label' => 'Last Modified By', 'table' => 'vtiger_crmentity', |
|
45 | - 'uitype' => 52, 'typeofdata' => 'V~O', 'displaytype' => 2, 'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535, |
|
44 | + 'name' => 'modifiedby', 'column' => 'modifiedby', 'label' => 'Last Modified By', 'table' => 'vtiger_crmentity', |
|
45 | + 'uitype' => 52, 'typeofdata' => 'V~O', 'displaytype' => 2, 'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535, |
|
46 | 46 | ], |
47 | 47 | 'shownerid' => [ |
48 | 48 | 'validationConditions' => ['name'], |
49 | - 'name' => 'shownerid', 'column' => 'shownerid', 'label' => 'Share with users', 'table' => 'vtiger_crmentity', |
|
50 | - 'uitype' => 120, 'typeofdata' => 'V~O', 'columntype' => 'int(11)', 'maximumlength' => 65535, |
|
49 | + 'name' => 'shownerid', 'column' => 'shownerid', 'label' => 'Share with users', 'table' => 'vtiger_crmentity', |
|
50 | + 'uitype' => 120, 'typeofdata' => 'V~O', 'columntype' => 'int(11)', 'maximumlength' => 65535, |
|
51 | 51 | ], |
52 | 52 | 'private' => [ |
53 | 53 | 'validationConditions' => ['name'], |
54 | - 'name' => 'private', 'column' => 'private', 'label' => 'FL_IS_PRIVATE', 'table' => 'vtiger_crmentity', |
|
55 | - 'uitype' => 56, 'typeofdata' => 'C~O', 'columntype' => 'int(11)', 'maximumlength' => '-128,127', |
|
54 | + 'name' => 'private', 'column' => 'private', 'label' => 'FL_IS_PRIVATE', 'table' => 'vtiger_crmentity', |
|
55 | + 'uitype' => 56, 'typeofdata' => 'C~O', 'columntype' => 'int(11)', 'maximumlength' => '-128,127', |
|
56 | 56 | ], |
57 | 57 | 'share_externally' => [ |
58 | 58 | 'validationConditions' => ['uitype', 'fieldparams'], |
59 | - 'name' => 'share_externally', 'column' => 'share_externally', 'label' => 'FL_SHARE_EXTERNALLY', 'defaultvalue' => 1, 'fieldparams' => 1, |
|
60 | - 'uitype' => 318, 'typeofdata' => 'C~O', 'columntype' => 'tinyint(1)', 'maximumlength' => '-128,127', |
|
59 | + 'name' => 'share_externally', 'column' => 'share_externally', 'label' => 'FL_SHARE_EXTERNALLY', 'defaultvalue' => 1, 'fieldparams' => 1, |
|
60 | + 'uitype' => 318, 'typeofdata' => 'C~O', 'columntype' => 'tinyint(1)', 'maximumlength' => '-128,127', |
|
61 | 61 | ], |
62 | 62 | ]; |
63 | 63 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | \App\Process::$requestMode = 'Cli'; |
15 | 15 | |
16 | -set_error_handler(function ($errNo, $errStr, $errFile, $errLine) { |
|
16 | +set_error_handler(function($errNo, $errStr, $errFile, $errLine) { |
|
17 | 17 | if (\in_array($errNo, [E_ERROR, E_WARNING, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR])) { |
18 | 18 | throw new \Exception($errNo . ': ' . $errStr . ' in ' . $errFile . ', line ' . $errLine); |
19 | 19 | } |
@@ -448,13 +448,13 @@ discard block |
||
448 | 448 | public function parseData(string $content) |
449 | 449 | { |
450 | 450 | if ($this->useExtension) { |
451 | - $content = preg_replace_callback('/<!--[\s]+({% [\s\S]+? %})[\s]+-->/u', function ($matches) { |
|
451 | + $content = preg_replace_callback('/<!--[\s]+({% [\s\S]+? %})[\s]+-->/u', function($matches) { |
|
452 | 452 | return $matches[1] ?? ''; |
453 | 453 | }, $content); |
454 | 454 | $twig = new \Twig\Environment(new \Twig\Loader\ArrayLoader(['index' => $content])); |
455 | 455 | $sandbox = new \Twig\Extension\SandboxExtension(\App\Extension\Twig\SecurityPolicy::getPolicy(), true); |
456 | 456 | $twig->addExtension($sandbox); |
457 | - $twig->addFunction(new \Twig\TwigFunction('YFParser', function ($text) { |
|
457 | + $twig->addFunction(new \Twig\TwigFunction('YFParser', function($text) { |
|
458 | 458 | $value = ''; |
459 | 459 | preg_match(static::VARIABLE_REGEX, $text, $matches); |
460 | 460 | if ($matches) { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | })); |
466 | 466 | $content = $twig->render('index'); |
467 | 467 | } |
468 | - return preg_replace_callback(static::VARIABLE_REGEX, function ($matches) { |
|
468 | + return preg_replace_callback(static::VARIABLE_REGEX, function($matches) { |
|
469 | 469 | [, $function, $params] = array_pad($matches, 3, ''); |
470 | 470 | return \in_array($function, static::$baseFunctions) ? $this->{$function}($params) : ''; |
471 | 471 | }, $content); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | if (isset($this->language)) { |
482 | 482 | Language::setTemporaryLanguage($this->language); |
483 | 483 | } |
484 | - $this->content = preg_replace_callback('/\$\(translate : ([,"\+\%\.\=\-\[\]\&\w\s\|]+)\)\$/u', function ($matches) { |
|
484 | + $this->content = preg_replace_callback('/\$\(translate : ([,"\+\%\.\=\-\[\]\&\w\s\|]+)\)\$/u', function($matches) { |
|
485 | 485 | [, $params] = array_pad($matches, 2, ''); |
486 | 486 | return $this->translate($params); |
487 | 487 | }, $this->content); |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | public function getGeneralVariable() |
1436 | 1436 | { |
1437 | 1437 | $variables = [ |
1438 | - 'LBL_ENTITY_VARIABLES' => array_map(function ($value) { |
|
1438 | + 'LBL_ENTITY_VARIABLES' => array_map(function($value) { |
|
1439 | 1439 | return Language::translate($value, 'Other.TextParser'); |
1440 | 1440 | }, array_flip(static::$variableGeneral)), |
1441 | 1441 | ]; |
@@ -1595,7 +1595,7 @@ discard block |
||
1595 | 1595 | } |
1596 | 1596 | } |
1597 | 1597 | $generator = new \HTMLPurifier_Generator($config, new \HTMLPurifier_Context()); |
1598 | - $html = preg_replace_callback('/<*([A-Za-z_]\w*)\s\/>/', function ($matches) { |
|
1598 | + $html = preg_replace_callback('/<*([A-Za-z_]\w*)\s\/>/', function($matches) { |
|
1599 | 1599 | if (\in_array($matches[1], ['div'])) { |
1600 | 1600 | return "<{$matches[1]}></{$matches[1]}>"; |
1601 | 1601 | } |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | $customFieldClassSeq = 0; |
1796 | 1796 | foreach ($config['columns'] as $name) { |
1797 | 1797 | if (false !== strpos($name, '||')) { |
1798 | - [$title,$value] = explode('||', $name, 2); |
|
1798 | + [$title, $value] = explode('||', $name, 2); |
|
1799 | 1799 | if ('(' === $title[0] && ')' === substr($title, -1)) { |
1800 | 1800 | $title = $this->parseVariable("\${$title}\$"); |
1801 | 1801 | } |
@@ -1261,7 +1261,7 @@ |
||
1261 | 1261 | if (isset($history[$value]) && (!isset($locks[$fieldName]) || !\in_array($value, $locks[$fieldName]))) { |
1262 | 1262 | $history[$value]['time'] += \App\Fields\DateTime::getDiff($history[$value]['date'], date('Y-m-d H:i:s'), 'minutes'); |
1263 | 1263 | } |
1264 | - uasort($history, function ($a, $b) { |
|
1264 | + uasort($history, function($a, $b) { |
|
1265 | 1265 | return strnatcmp($b['date'], $a['date']); |
1266 | 1266 | }); |
1267 | 1267 | $viewer = $this->getViewer($request); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | public function preProcess(): bool |
73 | 73 | { |
74 | - register_shutdown_function(function () { |
|
74 | + register_shutdown_function(function() { |
|
75 | 75 | if ($error = error_get_last()) { |
76 | 76 | $this->errorHandler($error['type'], $error['message'], $error['file'], $error['line']); |
77 | 77 | } |
@@ -193,7 +193,7 @@ |
||
193 | 193 | 'time' => (int) ($readOperations / (microtime(true) - $timeStart)), |
194 | 194 | ]; |
195 | 195 | } |
196 | - register_shutdown_function(function () { |
|
196 | + register_shutdown_function(function() { |
|
197 | 197 | \vtlib\Functions::recurseDelete('cache/speed'); |
198 | 198 | }); |
199 | 199 | return [ |