@@ -147,6 +147,7 @@ discard block |
||
147 | 147 | * Get all the links related to module. |
148 | 148 | * |
149 | 149 | * @param int Module ID |
150 | + * @param boolean $tabid |
|
150 | 151 | */ |
151 | 152 | public static function getAll($tabid) |
152 | 153 | { |
@@ -278,6 +279,7 @@ discard block |
||
278 | 279 | |
279 | 280 | /** |
280 | 281 | * Extract the links of module for export. |
282 | + * @param boolean $tabid |
|
281 | 283 | */ |
282 | 284 | public static function getAllForExport($tabid) |
283 | 285 | { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'linklabel' => $label, |
89 | 89 | 'linkurl' => $url, |
90 | 90 | 'linkicon' => $iconpath, |
91 | - 'sequence' => (int)$sequence, |
|
91 | + 'sequence' => (int) $sequence, |
|
92 | 92 | ]; |
93 | 93 | if (!empty($handlerInfo)) { |
94 | 94 | $params['handler_path'] = $handlerInfo['path']; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if ($tabid === self::IGNORE_MODULE) { |
183 | 183 | $permittedTabIdList = \vtlib\Deprecated::getPermittedModuleIdList(); |
184 | 184 | if (!empty($permittedTabIdList)) { |
185 | - $permittedTabIdList[] = 0; // Added to support one link for all modules |
|
185 | + $permittedTabIdList[] = 0; // Added to support one link for all modules |
|
186 | 186 | foreach ($permittedTabIdList as $moduleId) { |
187 | 187 | foreach ($type as $typ) { |
188 | 188 | if (isset($rows[$moduleId][$typ])) { |
@@ -50,17 +50,17 @@ |
||
50 | 50 | */ |
51 | 51 | public function initialize($valuemap) |
52 | 52 | { |
53 | - $this->id = (int)$valuemap['tabid']; |
|
53 | + $this->id = (int) $valuemap['tabid']; |
|
54 | 54 | $this->name = $valuemap['name']; |
55 | 55 | $this->label = $valuemap['tablabel']; |
56 | 56 | $this->version = $valuemap['version']; |
57 | - $this->presence = (int)$valuemap['presence']; |
|
57 | + $this->presence = (int) $valuemap['presence']; |
|
58 | 58 | $this->ownedby = $valuemap['ownedby']; |
59 | - $this->tabsequence = (int)$valuemap['tabsequence']; |
|
59 | + $this->tabsequence = (int) $valuemap['tabsequence']; |
|
60 | 60 | $this->parent = $valuemap['parent']; |
61 | - $this->customized = (int)$valuemap['customized']; |
|
62 | - $this->type = (int)$valuemap['type']; |
|
63 | - $this->isentitytype = (int)$valuemap['isentitytype']; |
|
61 | + $this->customized = (int) $valuemap['customized']; |
|
62 | + $this->type = (int) $valuemap['type']; |
|
63 | + $this->isentitytype = (int) $valuemap['isentitytype']; |
|
64 | 64 | if ($this->isentitytype || $this->name === 'Users') { |
65 | 65 | $entitydata = \App\Module::getEntityInfo($this->name); |
66 | 66 | if ($entitydata) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | return false; |
196 | 196 | } |
197 | 197 | } |
198 | - return (bool)$this->_modulexml->modulebundle; |
|
198 | + return (bool) $this->_modulexml->modulebundle; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function getAvailableModuleInfoFromModuleBundle() |
205 | 205 | { |
206 | - $list = (array)$this->_modulexml->modulelist; |
|
206 | + $list = (array) $this->_modulexml->modulelist; |
|
207 | 207 | |
208 | - return (array)$list['dependent_module']; |
|
208 | + return (array) $list['dependent_module']; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | $matches = []; |
263 | 263 | if ($fileName === 'manifest.xml') { |
264 | 264 | $manifestxml_found = true; |
265 | - $modulename = (string)$this->_modulexml->name; |
|
266 | - $isModuleBundle = (string)$this->_modulexml->modulebundle; |
|
265 | + $modulename = (string) $this->_modulexml->name; |
|
266 | + $isModuleBundle = (string) $this->_modulexml->modulebundle; |
|
267 | 267 | if ($isModuleBundle === 'true' && (!empty($this->_modulexml)) && |
268 | 268 | (!empty($this->_modulexml->dependencies)) && |
269 | 269 | (!empty($this->_modulexml->dependencies->vtiger_version))) { |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if (!empty($this->_modulexml) && |
312 | 312 | !empty($this->_modulexml->dependencies) && |
313 | 313 | !empty($this->_modulexml->dependencies->vtiger_version)) { |
314 | - $moduleVersion = (string)$this->_modulexml->dependencies->vtiger_version; |
|
314 | + $moduleVersion = (string) $this->_modulexml->dependencies->vtiger_version; |
|
315 | 315 | if (\App\Version::check($moduleVersion) >= 0) { |
316 | 316 | $moduleVersionFound = true; |
317 | 317 | } else { |
@@ -345,9 +345,9 @@ discard block |
||
345 | 345 | if ($validzip) { |
346 | 346 | if (!empty($this->_modulexml->license)) { |
347 | 347 | if (!empty($this->_modulexml->license->inline)) { |
348 | - $this->_licensetext = (string)$this->_modulexml->license->inline; |
|
348 | + $this->_licensetext = (string) $this->_modulexml->license->inline; |
|
349 | 349 | } elseif (!empty($this->_modulexml->license->file)) { |
350 | - $licensefile = (string)$this->_modulexml->license->file; |
|
350 | + $licensefile = (string) $this->_modulexml->license->file; |
|
351 | 351 | if ($licenseContent = $zip->getFromName($licensefile)) { |
352 | 352 | $this->_licensetext = $licenseContent; |
353 | 353 | } else { |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | if (!$this->checkZip($zipfile)) { |
371 | 371 | return null; |
372 | 372 | } |
373 | - return (string)$this->_modulexml->name; |
|
373 | + return (string) $this->_modulexml->name; |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | /** |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | */ |
381 | 381 | public function getModuleName() |
382 | 382 | { |
383 | - return (string)$this->_modulexml->name; |
|
383 | + return (string) $this->_modulexml->name; |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | /** |
@@ -523,12 +523,12 @@ discard block |
||
523 | 523 | } |
524 | 524 | $buildModuleArray = []; |
525 | 525 | $installSequenceArray = []; |
526 | - $moduleBundle = (bool)$this->_modulexml->modulebundle; |
|
526 | + $moduleBundle = (bool) $this->_modulexml->modulebundle; |
|
527 | 527 | if ($moduleBundle === true) { |
528 | - $moduleList = (array)$this->_modulexml->modulelist; |
|
528 | + $moduleList = (array) $this->_modulexml->modulelist; |
|
529 | 529 | foreach ($moduleList as $moduleInfos) { |
530 | 530 | foreach ($moduleInfos as $moduleInfo) { |
531 | - $moduleInfo = (array)$moduleInfo; |
|
531 | + $moduleInfo = (array) $moduleInfo; |
|
532 | 532 | $buildModuleArray[] = $moduleInfo; |
533 | 533 | $installSequenceArray[] = $moduleInfo['install_sequence']; |
534 | 534 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | } |
544 | 544 | } |
545 | 545 | } else { |
546 | - if ((string)$this->_modulexml->type === 'update') { |
|
546 | + if ((string) $this->_modulexml->type === 'update') { |
|
547 | 547 | Functions::recurseDelete('cache/updates'); |
548 | 548 | $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]); |
549 | 549 | $zip->extract('cache/updates'); |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | // Import the table via queries |
622 | 622 | foreach ($modulenode->tables->table as $tablenode) { |
623 | 623 | $tableName = $tablenode->name; |
624 | - $sql = (string)$tablenode->sql; // Convert to string format |
|
624 | + $sql = (string) $tablenode->sql; // Convert to string format |
|
625 | 625 | // Avoid executing SQL that will DELETE or DROP table data |
626 | 626 | if (Utils::isCreateSql($sql)) { |
627 | 627 | if (!Utils::checkTable($tableName)) { |
@@ -666,18 +666,18 @@ discard block |
||
666 | 666 | $blockInstance = new Block(); |
667 | 667 | $blockInstance->label = $blocklabel; |
668 | 668 | if (isset($blocknode->sequence, $blocknode->display_status)) { |
669 | - $blockInstance->sequence = (string)($blocknode->sequence); |
|
669 | + $blockInstance->sequence = (string) ($blocknode->sequence); |
|
670 | 670 | if ($blockInstance->sequence = '') { |
671 | 671 | $blockInstance->sequence = null; |
672 | 672 | } |
673 | - $blockInstance->showtitle = (string)($blocknode->show_title); |
|
674 | - $blockInstance->visible = (string)($blocknode->visible); |
|
675 | - $blockInstance->increateview = (string)($blocknode->create_view); |
|
676 | - $blockInstance->ineditview = (string)($blocknode->edit_view); |
|
677 | - $blockInstance->indetailview = (string)($blocknode->detail_view); |
|
678 | - $blockInstance->display_status = (string)($blocknode->display_status); |
|
679 | - $blockInstance->iscustom = (string)($blocknode->iscustom); |
|
680 | - $blockInstance->islist = (string)($blocknode->islist); |
|
673 | + $blockInstance->showtitle = (string) ($blocknode->show_title); |
|
674 | + $blockInstance->visible = (string) ($blocknode->visible); |
|
675 | + $blockInstance->increateview = (string) ($blocknode->create_view); |
|
676 | + $blockInstance->ineditview = (string) ($blocknode->edit_view); |
|
677 | + $blockInstance->indetailview = (string) ($blocknode->detail_view); |
|
678 | + $blockInstance->display_status = (string) ($blocknode->display_status); |
|
679 | + $blockInstance->iscustom = (string) ($blocknode->iscustom); |
|
680 | + $blockInstance->islist = (string) ($blocknode->islist); |
|
681 | 681 | } else { |
682 | 682 | $blockInstance->display_status = null; |
683 | 683 | } |
@@ -706,37 +706,37 @@ discard block |
||
706 | 706 | public function importField($blocknode, $blockInstance, $moduleInstance, $fieldnode) |
707 | 707 | { |
708 | 708 | $fieldInstance = new Field(); |
709 | - $fieldInstance->name = (string)$fieldnode->fieldname; |
|
710 | - $fieldInstance->label = (string)$fieldnode->fieldlabel; |
|
711 | - $fieldInstance->table = (string)$fieldnode->tablename; |
|
712 | - $fieldInstance->column = (string)$fieldnode->columnname; |
|
713 | - $fieldInstance->uitype = (int)$fieldnode->uitype; |
|
714 | - $fieldInstance->generatedtype = (int)$fieldnode->generatedtype; |
|
715 | - $fieldInstance->readonly = (int)$fieldnode->readonly; |
|
716 | - $fieldInstance->presence = (int)$fieldnode->presence; |
|
717 | - $fieldInstance->defaultvalue = (string)$fieldnode->defaultvalue; |
|
718 | - $fieldInstance->maximumlength = (int)$fieldnode->maximumlength; |
|
719 | - $fieldInstance->sequence = (int)$fieldnode->sequence; |
|
720 | - $fieldInstance->quickcreate = (int)$fieldnode->quickcreate; |
|
721 | - $fieldInstance->quicksequence = (int)$fieldnode->quickcreatesequence; |
|
722 | - $fieldInstance->typeofdata = (string)$fieldnode->typeofdata; |
|
723 | - $fieldInstance->displaytype = (int)$fieldnode->displaytype; |
|
724 | - $fieldInstance->info_type = (string)$fieldnode->info_type; |
|
709 | + $fieldInstance->name = (string) $fieldnode->fieldname; |
|
710 | + $fieldInstance->label = (string) $fieldnode->fieldlabel; |
|
711 | + $fieldInstance->table = (string) $fieldnode->tablename; |
|
712 | + $fieldInstance->column = (string) $fieldnode->columnname; |
|
713 | + $fieldInstance->uitype = (int) $fieldnode->uitype; |
|
714 | + $fieldInstance->generatedtype = (int) $fieldnode->generatedtype; |
|
715 | + $fieldInstance->readonly = (int) $fieldnode->readonly; |
|
716 | + $fieldInstance->presence = (int) $fieldnode->presence; |
|
717 | + $fieldInstance->defaultvalue = (string) $fieldnode->defaultvalue; |
|
718 | + $fieldInstance->maximumlength = (int) $fieldnode->maximumlength; |
|
719 | + $fieldInstance->sequence = (int) $fieldnode->sequence; |
|
720 | + $fieldInstance->quickcreate = (int) $fieldnode->quickcreate; |
|
721 | + $fieldInstance->quicksequence = (int) $fieldnode->quickcreatesequence; |
|
722 | + $fieldInstance->typeofdata = (string) $fieldnode->typeofdata; |
|
723 | + $fieldInstance->displaytype = (int) $fieldnode->displaytype; |
|
724 | + $fieldInstance->info_type = (string) $fieldnode->info_type; |
|
725 | 725 | |
726 | 726 | if (!empty($fieldnode->fieldparams)) { |
727 | - $fieldInstance->fieldparams = (string)$fieldnode->fieldparams; |
|
727 | + $fieldInstance->fieldparams = (string) $fieldnode->fieldparams; |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | if (!empty($fieldnode->helpinfo)) { |
731 | - $fieldInstance->helpinfo = (string)$fieldnode->helpinfo; |
|
731 | + $fieldInstance->helpinfo = (string) $fieldnode->helpinfo; |
|
732 | 732 | } |
733 | 733 | |
734 | 734 | if (isset($fieldnode->masseditable)) { |
735 | - $fieldInstance->masseditable = (int)$fieldnode->masseditable; |
|
735 | + $fieldInstance->masseditable = (int) $fieldnode->masseditable; |
|
736 | 736 | } |
737 | 737 | |
738 | 738 | if (isset($fieldnode->columntype) && !empty($fieldnode->columntype)) { |
739 | - $fieldInstance->columntype = (string)($fieldnode->columntype); |
|
739 | + $fieldInstance->columntype = (string) ($fieldnode->columntype); |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | if (!empty($fieldnode->tree_template)) { |
@@ -871,11 +871,11 @@ discard block |
||
871 | 871 | */ |
872 | 872 | public function importAction($modulenode, $moduleInstance, $actionnode) |
873 | 873 | { |
874 | - $actionstatus = (string)$actionnode->status; |
|
874 | + $actionstatus = (string) $actionnode->status; |
|
875 | 875 | if ($actionstatus === 'enabled') { |
876 | - $moduleInstance->enableTools((string)$actionnode->name); |
|
876 | + $moduleInstance->enableTools((string) $actionnode->name); |
|
877 | 877 | } else { |
878 | - $moduleInstance->disableTools((string)$actionnode->name); |
|
878 | + $moduleInstance->disableTools((string) $actionnode->name); |
|
879 | 879 | } |
880 | 880 | } |
881 | 881 | |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | $handlerInfo = []; |
949 | 949 | $handlerInfo = ['path' => "$customlinknode->handler_path", |
950 | 950 | 'class' => "$customlinknode->handler_class", |
951 | - 'method' => "$customlinknode->handler",]; |
|
951 | + 'method' => "$customlinknode->handler", ]; |
|
952 | 952 | } |
953 | 953 | $moduleInstance->addLink( |
954 | 954 | "$customlinknode->linktype", "$customlinknode->linklabel", "$customlinknode->linkurl", "$customlinknode->linkicon", "$customlinknode->sequence", $handlerInfo |
@@ -1015,17 +1015,17 @@ discard block |
||
1015 | 1015 | } |
1016 | 1016 | $db->createCommand()->insert('yetiforce_updates', [ |
1017 | 1017 | 'user' => \Users_Record_Model::getCurrentUserModel()->get('user_name'), |
1018 | - 'name' => (string)$this->_modulexml->label, |
|
1019 | - 'from_version' => (string)$this->_modulexml->from_version, |
|
1020 | - 'to_version' => (string)$this->_modulexml->to_version, |
|
1018 | + 'name' => (string) $this->_modulexml->label, |
|
1019 | + 'from_version' => (string) $this->_modulexml->from_version, |
|
1020 | + 'to_version' => (string) $this->_modulexml->to_version, |
|
1021 | 1021 | 'result' => $result, |
1022 | 1022 | 'time' => date('Y-m-d H:i:s'), |
1023 | 1023 | ])->execute(); |
1024 | 1024 | if ($result) { |
1025 | - $db->createCommand()->update('vtiger_version', ['current_version' => (string)$this->_modulexml->to_version])->execute(); |
|
1025 | + $db->createCommand()->update('vtiger_version', ['current_version' => (string) $this->_modulexml->to_version])->execute(); |
|
1026 | 1026 | } |
1027 | 1027 | Functions::recurseDelete($dirName); |
1028 | - register_shutdown_function(function () { |
|
1028 | + register_shutdown_function(function() { |
|
1029 | 1029 | $viewer = \Vtiger_Viewer::getInstance(); |
1030 | 1030 | $viewer->clearAllCache(); |
1031 | 1031 | Functions::recurseDelete('cache/templates_c'); |
@@ -1045,7 +1045,7 @@ discard block |
||
1045 | 1045 | if (empty($this->_modulexml->inventory) || empty($this->_modulexml->inventory->fields->field)) { |
1046 | 1046 | return false; |
1047 | 1047 | } |
1048 | - $module = (string)$this->moduleInstance->name; |
|
1048 | + $module = (string) $this->moduleInstance->name; |
|
1049 | 1049 | |
1050 | 1050 | $inventoryInstance = \Vtiger_Inventory_Model::getInstance($module); |
1051 | 1051 | $inventoryInstance->createInventoryTables(); |