@@ -340,6 +340,9 @@ |
||
| 340 | 340 | return $rolesAndSubHTML; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | + /** |
|
| 344 | + * @param Users $user |
|
| 345 | + */ |
|
| 343 | 346 | public static function getScheduledReports($adb, $user) |
| 344 | 347 | { |
| 345 | 348 | |
@@ -258,8 +258,9 @@ discard block |
||
| 258 | 258 | public static function generateRecipientOption($type, $value, $name = '') |
| 259 | 259 | { |
| 260 | 260 | switch ($type) { |
| 261 | - case 'users' : if (empty($name)) |
|
| 262 | - $name = \App\Fields\Owner::getUserLabel($value); |
|
| 261 | + case 'users' : if (empty($name)) { |
|
| 262 | + $name = \App\Fields\Owner::getUserLabel($value); |
|
| 263 | + } |
|
| 263 | 264 | $optionName = 'User::' . addslashes(decode_html($name)); |
| 264 | 265 | $optionValue = 'users::' . $value; |
| 265 | 266 | break; |
@@ -269,13 +270,15 @@ discard block |
||
| 269 | 270 | $optionName = 'Group::' . addslashes(decode_html($name)); |
| 270 | 271 | $optionValue = 'groups::' . $value; |
| 271 | 272 | break; |
| 272 | - case 'roles' : if (empty($name)) |
|
| 273 | - $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 273 | + case 'roles' : if (empty($name)) { |
|
| 274 | + $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 275 | + } |
|
| 274 | 276 | $optionName = 'Roles::' . addslashes(decode_html($name)); |
| 275 | 277 | $optionValue = 'roles::' . $value; |
| 276 | 278 | break; |
| 277 | - case 'rs' : if (empty($name)) |
|
| 278 | - $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 279 | + case 'rs' : if (empty($name)) { |
|
| 280 | + $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 281 | + } |
|
| 279 | 282 | $optionName = 'RoleAndSubordinates::' . addslashes(decode_html($name)); |
| 280 | 283 | $optionValue = 'rs::' . $value; |
| 281 | 284 | break; |
@@ -375,10 +378,12 @@ discard block |
||
| 375 | 378 | |
| 376 | 379 | $currentModule = vglobal('currentModule'); |
| 377 | 380 | $current_language = vglobal('current_language'); |
| 378 | - if (empty($currentModule)) |
|
| 379 | - $currentModule = 'Reports'; |
|
| 380 | - if (empty($current_language)) |
|
| 381 | - vglobal('current_language', 'en_us'); |
|
| 381 | + if (empty($currentModule)) { |
|
| 382 | + $currentModule = 'Reports'; |
|
| 383 | + } |
|
| 384 | + if (empty($current_language)) { |
|
| 385 | + vglobal('current_language', 'en_us'); |
|
| 386 | + } |
|
| 382 | 387 | |
| 383 | 388 | $scheduledReports = self::getScheduledReports($adb, $adminUser); |
| 384 | 389 | foreach ($scheduledReports as $scheduledReport) { |
@@ -938,8 +938,8 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | /** Gives an array which contains the information for what all roles, groups and user's related module data that is to be shared for the specified parent module and shared module |
| 940 | 940 | |
| 941 | - * @param $par_mod -- parent module name:: Type varchar |
|
| 942 | - * @param $share_mod -- shared module name:: Type varchar |
|
| 941 | + * @param string $par_mod -- parent module name:: Type varchar |
|
| 942 | + * @param string $share_mod -- shared module name:: Type varchar |
|
| 943 | 943 | * @param $userid -- user id:: Type integer |
| 944 | 944 | * @param $def_org_share -- default organization sharing permission array:: Type array |
| 945 | 945 | * @param $mod_sharingrule_members -- Sharing Rule Members array:: Type array |
@@ -1355,9 +1355,9 @@ discard block |
||
| 1355 | 1355 | |
| 1356 | 1356 | /** Function to populate the read/wirte Sharing permissions data for the specified user into the database |
| 1357 | 1357 | * @param $userid -- user id:: Type integer |
| 1358 | - * @param $enttype -- can have the value of User or Group:: Type varchar |
|
| 1358 | + * @param string $enttype -- can have the value of User or Group:: Type varchar |
|
| 1359 | 1359 | * @param $module -- module name:: Type varchar |
| 1360 | - * @param $pertype -- can have the value of read or write:: Type varchar |
|
| 1360 | + * @param string $pertype -- can have the value of read or write:: Type varchar |
|
| 1361 | 1361 | * @param $var_name_arr - Variable to use instead of including the sharing access again |
| 1362 | 1362 | */ |
| 1363 | 1363 | function populateSharingPrivileges($enttype, $userid, $module, $pertype, $var_name_arr = false) |
@@ -1432,10 +1432,10 @@ discard block |
||
| 1432 | 1432 | |
| 1433 | 1433 | /** Function to populate the read/wirte Sharing permissions related module data for the specified user into the database |
| 1434 | 1434 | * @param $userid -- user id:: Type integer |
| 1435 | - * @param $enttype -- can have the value of User or Group:: Type varchar |
|
| 1435 | + * @param string $enttype -- can have the value of User or Group:: Type varchar |
|
| 1436 | 1436 | * @param $module -- module name:: Type varchar |
| 1437 | 1437 | * @param $relmodule -- related module name:: Type varchar |
| 1438 | - * @param $pertype -- can have the value of read or write:: Type varchar |
|
| 1438 | + * @param string $pertype -- can have the value of read or write:: Type varchar |
|
| 1439 | 1439 | * @param $var_name_arr - Variable to use instead of including the sharing access again |
| 1440 | 1440 | */ |
| 1441 | 1441 | function populateRelatedSharingPrivileges($enttype, $userid, $module, $relmodule, $pertype, $var_name_arr = false) |
@@ -592,8 +592,9 @@ discard block |
||
| 592 | 592 | $var_name = $module . '_share_write_permission'; |
| 593 | 593 | } |
| 594 | 594 | // Lookup for the variable if not set through function argument |
| 595 | - if (!$var_name_arr) |
|
| 596 | - $var_name_arr = $$var_name; |
|
| 595 | + if (!$var_name_arr) { |
|
| 596 | + $var_name_arr = $$var_name; |
|
| 597 | + } |
|
| 597 | 598 | $user_arr = []; |
| 598 | 599 | if (sizeof($var_name_arr['ROLE']) > 0) { |
| 599 | 600 | foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) { |
@@ -627,8 +628,9 @@ discard block |
||
| 627 | 628 | $var_name = $module . '_share_write_permission'; |
| 628 | 629 | } |
| 629 | 630 | // Lookup for the variable if not set through function argument |
| 630 | - if (!$var_name_arr) |
|
| 631 | - $var_name_arr = $$var_name; |
|
| 631 | + if (!$var_name_arr) { |
|
| 632 | + $var_name_arr = $$var_name; |
|
| 633 | + } |
|
| 632 | 634 | $grp_arr = []; |
| 633 | 635 | if (sizeof($var_name_arr['GROUP']) > 0) { |
| 634 | 636 | |
@@ -671,8 +673,9 @@ discard block |
||
| 671 | 673 | $var_name = $module . '_' . $relmodule . '_share_write_permission'; |
| 672 | 674 | } |
| 673 | 675 | // Lookup for the variable if not set through function argument |
| 674 | - if (!$var_name_arr) |
|
| 675 | - $var_name_arr = $$var_name; |
|
| 676 | + if (!$var_name_arr) { |
|
| 677 | + $var_name_arr = $$var_name; |
|
| 678 | + } |
|
| 676 | 679 | $user_arr = []; |
| 677 | 680 | if (sizeof($var_name_arr['ROLE']) > 0) { |
| 678 | 681 | foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) { |
@@ -706,8 +709,9 @@ discard block |
||
| 706 | 709 | $var_name = $module . '_' . $relmodule . '_share_write_permission'; |
| 707 | 710 | } |
| 708 | 711 | // Lookup for the variable if not set through function argument |
| 709 | - if (!$var_name_arr) |
|
| 710 | - $var_name_arr = $$var_name; |
|
| 712 | + if (!$var_name_arr) { |
|
| 713 | + $var_name_arr = $$var_name; |
|
| 714 | + } |
|
| 711 | 715 | $grp_arr = []; |
| 712 | 716 | if (sizeof($var_name_arr['GROUP']) > 0) { |
| 713 | 717 | |
@@ -150,7 +150,6 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** Gives an array which contains the information for what all roles, groups and user's related module data that is to be shared for the specified parent module and shared module |
| 153 | - |
|
| 154 | 153 | * @param $par_mod -- parent module name:: Type varchar |
| 155 | 154 | * @param $share_mod -- shared module name:: Type varchar |
| 156 | 155 | * @param $userid -- user id:: Type integer |
@@ -310,7 +309,6 @@ discard block |
||
| 310 | 309 | } |
| 311 | 310 | |
| 312 | 311 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 313 | - |
|
| 314 | 312 | * @param $var -- input array:: Type array |
| 315 | 313 | * @returns $code -- contains the whole array in a single string:: Type array |
| 316 | 314 | */ |
@@ -327,7 +325,6 @@ discard block |
||
| 327 | 325 | } |
| 328 | 326 | |
| 329 | 327 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 330 | - |
|
| 331 | 328 | * @param $var -- input array:: Type array |
| 332 | 329 | * @returns $code -- contains the whole array in a single string:: Type array |
| 333 | 330 | */ |
@@ -352,7 +349,6 @@ discard block |
||
| 352 | 349 | } |
| 353 | 350 | |
| 354 | 351 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 355 | - |
|
| 356 | 352 | * @param $var -- input array:: Type array |
| 357 | 353 | * @returns $code -- contains the whole array in a single string:: Type array |
| 358 | 354 | */ |
@@ -377,7 +373,6 @@ discard block |
||
| 377 | 373 | } |
| 378 | 374 | |
| 379 | 375 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 380 | - |
|
| 381 | 376 | * @param $var -- input array:: Type array |
| 382 | 377 | * @returns $code -- contains the whole array in a single string:: Type array |
| 383 | 378 | */ |
@@ -394,7 +389,6 @@ discard block |
||
| 394 | 389 | } |
| 395 | 390 | |
| 396 | 391 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 397 | - |
|
| 398 | 392 | * @param $var -- input array:: Type array |
| 399 | 393 | * @returns $code -- contains the whole array in a single string:: Type array |
| 400 | 394 | */ |
@@ -411,7 +405,6 @@ discard block |
||
| 411 | 405 | } |
| 412 | 406 | |
| 413 | 407 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 414 | - |
|
| 415 | 408 | * @param $var -- input array:: Type array |
| 416 | 409 | * @returns $code -- contains the whole array in a single string:: Type array |
| 417 | 410 | */ |
@@ -432,7 +425,6 @@ discard block |
||
| 432 | 425 | } |
| 433 | 426 | |
| 434 | 427 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 435 | - |
|
| 436 | 428 | * @param $var -- input array:: Type array |
| 437 | 429 | * @returns $code -- contains the whole array in a single string:: Type array |
| 438 | 430 | */ |
@@ -453,7 +445,6 @@ discard block |
||
| 453 | 445 | } |
| 454 | 446 | |
| 455 | 447 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 456 | - |
|
| 457 | 448 | * @param $var -- input array:: Type array |
| 458 | 449 | * @returns $code -- contains the whole array in a single string:: Type array |
| 459 | 450 | */ |
@@ -474,7 +465,6 @@ discard block |
||
| 474 | 465 | } |
| 475 | 466 | |
| 476 | 467 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 477 | - |
|
| 478 | 468 | * @param $var -- input array:: Type array |
| 479 | 469 | * @returns $code -- contains the whole array in a single string:: Type array |
| 480 | 470 | */ |
@@ -17,6 +17,9 @@ |
||
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param Vtiger_Record_Model $recordModel |
|
| 22 | + */ |
|
| 20 | 23 | public function checkMandatoryFields($recordModel) |
| 21 | 24 | { |
| 22 | 25 | $mandatoryFields = $recordModel->getModule()->getMandatoryFieldModels(); |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | /** |
| 222 | 222 | * Checks if given record has valid pdf template |
| 223 | 223 | * @param Vtiger_Request $request |
| 224 | - * @return boolean true if valid template exists for this record |
|
| 224 | + * @return boolean|null true if valid template exists for this record |
|
| 225 | 225 | */ |
| 226 | 226 | public function hasValidTemplate(Vtiger_Request $request) |
| 227 | 227 | { |
@@ -113,6 +113,9 @@ discard block |
||
| 113 | 113 | return []; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | + /** |
|
| 117 | + * @param Vtiger_Widget_Model $widgetModel |
|
| 118 | + */ |
|
| 116 | 119 | public function setWidgetModel($widgetModel) |
| 117 | 120 | { |
| 118 | 121 | $this->widgetModel = $widgetModel; |
@@ -127,6 +130,9 @@ discard block |
||
| 127 | 130 | } |
| 128 | 131 | } |
| 129 | 132 | |
| 133 | + /** |
|
| 134 | + * @return string |
|
| 135 | + */ |
|
| 130 | 136 | public function getType() |
| 131 | 137 | { |
| 132 | 138 | return $this->extraData['chartType']; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if (!isset($groupData[$displayValue]['count'])) { |
| 111 | 111 | $groupData[$displayValue]['count'] = 1; |
| 112 | 112 | } else { |
| 113 | - $groupData[$displayValue]['count'] ++; |
|
| 113 | + $groupData[$displayValue]['count']++; |
|
| 114 | 114 | } |
| 115 | 115 | if (!isset($groupData[$displayValue]['link'])) { |
| 116 | 116 | $moduleModel = $this->getTargetModuleModel(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if (!isset($count[$sectorId])) { |
| 128 | 128 | $count[$sectorId] = 1; |
| 129 | 129 | } else { |
| 130 | - $count[$sectorId] ++; |
|
| 130 | + $count[$sectorId]++; |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -122,6 +122,9 @@ discard block |
||
| 122 | 122 | return html_entity_decode($value); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $fileName |
|
| 127 | + */ |
|
| 125 | 128 | public function outputFile($fileName) |
| 126 | 129 | { |
| 127 | 130 | header("Content-Disposition:attachment;filename=$fileName.xml"); |
@@ -133,6 +136,9 @@ discard block |
||
| 133 | 136 | readfile($this->tmpXmlPath); |
| 134 | 137 | } |
| 135 | 138 | |
| 139 | + /** |
|
| 140 | + * @param string $fileName |
|
| 141 | + */ |
|
| 136 | 142 | protected function outputZipFile($fileName) |
| 137 | 143 | { |
| 138 | 144 | |
@@ -16,8 +16,6 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Create the name of the Inventory data table |
| 19 | - * @param string $module Module name |
|
| 20 | - * @param string $prefix Prefix table |
|
| 21 | 19 | * @return string Table name |
| 22 | 20 | */ |
| 23 | 21 | public function getTableName($type = 'data') |
@@ -118,8 +116,6 @@ discard block |
||
| 118 | 116 | |
| 119 | 117 | /** |
| 120 | 118 | * Get inventory columns |
| 121 | - * @param string $module Module name |
|
| 122 | - * @param boolean $returnInBlock Should the result be divided into blocks |
|
| 123 | 119 | * @return array Inventory columns |
| 124 | 120 | */ |
| 125 | 121 | public function getColumns() |
@@ -164,7 +160,6 @@ discard block |
||
| 164 | 160 | |
| 165 | 161 | /** |
| 166 | 162 | * Retrieve list of all fields |
| 167 | - * @param string $moduleName Module name |
|
| 168 | 163 | * @return array Fields instance Vtiger_Basic_InventoryField |
| 169 | 164 | */ |
| 170 | 165 | public function getAllFields() |
@@ -133,8 +133,9 @@ discard block |
||
| 133 | 133 | $columns = []; |
| 134 | 134 | foreach ($this->getFields() as $key => $field) { |
| 135 | 135 | $column = $field->getColumnName(); |
| 136 | - if (!empty($column) && $column != '-') |
|
| 137 | - $columns[] = $column; |
|
| 136 | + if (!empty($column) && $column != '-') { |
|
| 137 | + $columns[] = $column; |
|
| 138 | + } |
|
| 138 | 139 | foreach ($field->getCustomColumn() as $name => $field) { |
| 139 | 140 | $columns[] = $name; |
| 140 | 141 | } |
@@ -187,8 +188,9 @@ discard block |
||
| 187 | 188 | } |
| 188 | 189 | $fields = []; |
| 189 | 190 | foreach ($fieldPaths as $fieldPath) { |
| 190 | - if (!is_dir($fieldPath)) |
|
| 191 | - continue; |
|
| 191 | + if (!is_dir($fieldPath)) { |
|
| 192 | + continue; |
|
| 193 | + } |
|
| 192 | 194 | foreach (new DirectoryIterator($fieldPath) as $fileinfo) { |
| 193 | 195 | if ($fileinfo->isFile() && $fileinfo->getFilename() != 'Basic.php') { |
| 194 | 196 | $fieldName = str_replace('.php', '', $fileinfo->getFilename()); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Functions returns webservices meta object |
| 45 | - * @return webservices meta |
|
| 45 | + * @return boolean meta |
|
| 46 | 46 | */ |
| 47 | 47 | public function getMeta() |
| 48 | 48 | { |
@@ -302,6 +302,9 @@ |
||
| 302 | 302 | return $viewer->view('DetailViewFullContents.tpl', $moduleName, true); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | + /** |
|
| 306 | + * @param Vtiger_Request $request |
|
| 307 | + */ |
|
| 305 | 308 | public function showModuleSummaryView($request) |
| 306 | 309 | { |
| 307 | 310 | $recordId = $request->get('record'); |
@@ -686,8 +686,9 @@ |
||
| 686 | 686 | $sortImage = 'glyphicon glyphicon-chevron-up'; |
| 687 | 687 | } |
| 688 | 688 | if (empty($orderBy) && empty($sortOrder)) { |
| 689 | - if (is_numeric($relatedModuleName)) |
|
| 690 | - $relatedModuleName = vtlib\Functions::getModuleName($relatedModuleName); |
|
| 689 | + if (is_numeric($relatedModuleName)) { |
|
| 690 | + $relatedModuleName = vtlib\Functions::getModuleName($relatedModuleName); |
|
| 691 | + } |
|
| 691 | 692 | $relatedInstance = CRMEntity::getInstance($relatedModuleName); |
| 692 | 693 | $orderBy = $relatedInstance->default_order_by; |
| 693 | 694 | $sortOrder = $relatedInstance->default_sort_order; |