@@ -27,7 +27,6 @@ |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Function returns Tickets grouped by Status |
| 30 | - * @param type $data |
|
| 31 | 30 | * @return <Array> |
| 32 | 31 | */ |
| 33 | 32 | public function getTicketsByStatus($owner) |
@@ -19,8 +19,9 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | $listSearchParams = []; |
| 21 | 21 | $conditions = array(array('ticketstatus', 'e', $value)); |
| 22 | - if (!empty($assignedto)) |
|
| 23 | - array_push($conditions, array('assigned_user_id', 'e', $assignedto)); |
|
| 22 | + if (!empty($assignedto)) { |
|
| 23 | + array_push($conditions, array('assigned_user_id', 'e', $assignedto)); |
|
| 24 | + } |
|
| 24 | 25 | $listSearchParams[] = $conditions; |
| 25 | 26 | return '&viewname=All&search_params=' . json_encode($listSearchParams); |
| 26 | 27 | } |
@@ -62,8 +63,9 @@ discard block |
||
| 62 | 63 | $sql .= " && vtiger_troubletickets.status NOT IN ('$ticketStatusSearch')"; |
| 63 | 64 | $this->conditions = ['vtiger_troubletickets.status', "'$ticketStatusSearch'", 'nin', QueryGenerator::$AND]; |
| 64 | 65 | } |
| 65 | - if (!empty($securityParameter)) |
|
| 66 | - $sql .= $securityParameter; |
|
| 66 | + if (!empty($securityParameter)) { |
|
| 67 | + $sql .= $securityParameter; |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | |
| 69 | 71 | $sql .= ' GROUP BY statusvalue, priority ORDER BY vtiger_ticketstatus.sortorderid'; |
@@ -78,8 +80,9 @@ discard block |
||
| 78 | 80 | $priorities[$row['priority']] = $counter++; |
| 79 | 81 | $colors[$row['priority']] = $row['color']; |
| 80 | 82 | } |
| 81 | - if (!in_array($row['statusvalue'], $status)) |
|
| 82 | - $status[] = $row['statusvalue']; |
|
| 83 | + if (!in_array($row['statusvalue'], $status)) { |
|
| 84 | + $status[] = $row['statusvalue']; |
|
| 85 | + } |
|
| 83 | 86 | } |
| 84 | 87 | if (!empty($tickets)) { |
| 85 | 88 | $counter = 0; |
@@ -123,13 +126,15 @@ discard block |
||
| 123 | 126 | $data = $request->get('data'); |
| 124 | 127 | $createdTime = $request->get('createdtime'); |
| 125 | 128 | $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId()); |
| 126 | - if (!$request->has('owner')) |
|
| 127 | - $owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName); |
|
| 128 | - else |
|
| 129 | - $owner = $request->get('owner'); |
|
| 129 | + if (!$request->has('owner')) { |
|
| 130 | + $owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName); |
|
| 131 | + } else { |
|
| 132 | + $owner = $request->get('owner'); |
|
| 133 | + } |
|
| 130 | 134 | $ownerForwarded = $owner; |
| 131 | - if ($owner == 'all') |
|
| 132 | - $owner = ''; |
|
| 135 | + if ($owner == 'all') { |
|
| 136 | + $owner = ''; |
|
| 137 | + } |
|
| 133 | 138 | |
| 134 | 139 | //Date conversion from user to database format |
| 135 | 140 | if (!empty($createdTime)) { |
@@ -27,6 +27,9 @@ discard block |
||
| 27 | 27 | $this->user = $user; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | + /** |
|
| 31 | + * @param Vtiger_Request $request |
|
| 32 | + */ |
|
| 30 | 33 | public static function import($request, $user) |
| 31 | 34 | { |
| 32 | 35 | $importController = new Import_Main_View($request, $user); |
@@ -100,6 +103,9 @@ discard block |
||
| 100 | 103 | } |
| 101 | 104 | } |
| 102 | 105 | |
| 106 | + /** |
|
| 107 | + * @param boolean $continueImport |
|
| 108 | + */ |
|
| 103 | 109 | public static function showCurrentStatus($importInfo, $importStatusCount, $continueImport) |
| 104 | 110 | { |
| 105 | 111 | $moduleName = $importInfo['module']; |
@@ -210,6 +216,9 @@ discard block |
||
| 210 | 216 | Import_Queue_Action::add($this->request, $this->user); |
| 211 | 217 | } |
| 212 | 218 | |
| 219 | + /** |
|
| 220 | + * @param Vtiger_Request $request |
|
| 221 | + */ |
|
| 213 | 222 | public static function deleteMap($request) |
| 214 | 223 | { |
| 215 | 224 | $moduleName = $request->getModule(); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Add widget to other module. |
| 62 | - * @param unknown_type $moduleNames |
|
| 62 | + * @param string[] $moduleNames |
|
| 63 | 63 | * @return unknown_type |
| 64 | 64 | */ |
| 65 | 65 | static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget') |
@@ -64,11 +64,13 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget') |
| 66 | 66 | { |
| 67 | - if (empty($moduleNames)) |
|
| 68 | - return; |
|
| 67 | + if (empty($moduleNames)) { |
|
| 68 | + return; |
|
| 69 | + } |
|
| 69 | 70 | |
| 70 | - if (is_string($moduleNames)) |
|
| 71 | - $moduleNames = array($moduleNames); |
|
| 71 | + if (is_string($moduleNames)) { |
|
| 72 | + $moduleNames = array($moduleNames); |
|
| 73 | + } |
|
| 72 | 74 | |
| 73 | 75 | $commentWidgetModules = array(); |
| 74 | 76 | foreach ($moduleNames as $moduleName) { |
@@ -95,11 +97,13 @@ discard block |
||
| 95 | 97 | */ |
| 96 | 98 | static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget') |
| 97 | 99 | { |
| 98 | - if (empty($moduleNames)) |
|
| 99 | - return; |
|
| 100 | + if (empty($moduleNames)) { |
|
| 101 | + return; |
|
| 102 | + } |
|
| 100 | 103 | |
| 101 | - if (is_string($moduleNames)) |
|
| 102 | - $moduleNames = array($moduleNames); |
|
| 104 | + if (is_string($moduleNames)) { |
|
| 105 | + $moduleNames = array($moduleNames); |
|
| 106 | + } |
|
| 103 | 107 | |
| 104 | 108 | $commentWidgetModules = array(); |
| 105 | 109 | foreach ($moduleNames as $moduleName) { |
@@ -149,6 +149,10 @@ discard block |
||
| 149 | 149 | return $hierarchy; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | + /** |
|
| 153 | + * @param integer $id |
|
| 154 | + * @param integer[] $encountered_accounts |
|
| 155 | + */ |
|
| 152 | 156 | public function __getParentEmployees($id, &$parent_accounts, &$encountered_accounts) |
| 153 | 157 | { |
| 154 | 158 | $adb = PearDatabase::getInstance(); |
@@ -200,6 +204,9 @@ discard block |
||
| 200 | 204 | return $parent_accounts; |
| 201 | 205 | } |
| 202 | 206 | |
| 207 | + /** |
|
| 208 | + * @param integer $id |
|
| 209 | + */ |
|
| 203 | 210 | public function __getChildEmployees($id, &$child_accounts, $depth) |
| 204 | 211 | { |
| 205 | 212 | $adb = PearDatabase::getInstance(); |
@@ -284,16 +284,18 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | |
| 287 | - if ($singlepane_view == 'true') |
|
| 288 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 289 | - else |
|
| 290 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 287 | + if ($singlepane_view == 'true') { |
|
| 288 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 289 | + } else { |
|
| 290 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 291 | + } |
|
| 291 | 292 | |
| 292 | 293 | $button = ''; |
| 293 | 294 | |
| 294 | 295 | if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') { |
| 295 | - if (is_string($actions)) |
|
| 296 | - $actions = explode(',', strtoupper($actions)); |
|
| 296 | + if (is_string($actions)) { |
|
| 297 | + $actions = explode(',', strtoupper($actions)); |
|
| 298 | + } |
|
| 297 | 299 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 298 | 300 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 299 | 301 | } |
@@ -316,8 +318,9 @@ discard block |
||
| 316 | 318 | WHERE vtiger_crmentity.deleted = 0 && vtiger_crmentity.`smownerid`= " . $userId; |
| 317 | 319 | |
| 318 | 320 | $return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset); |
| 319 | - if ($return_value === null) |
|
| 320 | - $return_value = Array(); |
|
| 321 | + if ($return_value === null) { |
|
| 322 | + $return_value = Array(); |
|
| 323 | + } |
|
| 321 | 324 | $return_value['CUSTOM_BUTTON'] = $button; |
| 322 | 325 | $log->debug("Exiting get_osstimecontrol method ..."); |
| 323 | 326 | return $return_value; |
@@ -336,8 +339,9 @@ discard block |
||
| 336 | 339 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments'); |
| 337 | 340 | if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) { |
| 338 | 341 | include_once 'modules/ModComments/ModComments.php'; |
| 339 | - if (class_exists('ModComments')) |
|
| 340 | - ModComments::addWidgetTo(array('OSSEmployees')); |
|
| 342 | + if (class_exists('ModComments')) { |
|
| 343 | + ModComments::addWidgetTo(array('OSSEmployees')); |
|
| 344 | + } |
|
| 341 | 345 | } |
| 342 | 346 | } else if ($event_type == 'module.disabled') { |
| 343 | 347 | |
@@ -50,6 +50,9 @@ discard block |
||
| 50 | 50 | return $xml; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param integer $level |
|
| 55 | + */ |
|
| 53 | 56 | protected function createXML($key, $value, $level) |
| 54 | 57 | { |
| 55 | 58 | $indent = ''; |
@@ -69,6 +72,9 @@ discard block |
||
| 69 | 72 | return $xml; |
| 70 | 73 | } |
| 71 | 74 | |
| 75 | + /** |
|
| 76 | + * @param string $line |
|
| 77 | + */ |
|
| 72 | 78 | protected function parseLine($line) |
| 73 | 79 | { |
| 74 | 80 | $tag = substr($line, 1, strpos($line, ':', 1) - 1); |
@@ -114,6 +120,9 @@ discard block |
||
| 114 | 120 | $this->_lastTag = $tag; |
| 115 | 121 | } |
| 116 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $value |
|
| 125 | + */ |
|
| 117 | 126 | protected function parseOperation($value) |
| 118 | 127 | { |
| 119 | 128 | $this->operations[] = array( |
@@ -124,6 +133,9 @@ discard block |
||
| 124 | 133 | ); |
| 125 | 134 | } |
| 126 | 135 | |
| 136 | + /** |
|
| 137 | + * @param string $value |
|
| 138 | + */ |
|
| 127 | 139 | protected function parseBalance($value) |
| 128 | 140 | { |
| 129 | 141 | return array( |
@@ -134,6 +146,9 @@ discard block |
||
| 134 | 146 | ); |
| 135 | 147 | } |
| 136 | 148 | |
| 149 | + /** |
|
| 150 | + * @param string $value |
|
| 151 | + */ |
|
| 137 | 152 | protected function parseTransaction($value) |
| 138 | 153 | { |
| 139 | 154 | $transaction = array( |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | public function parse() |
| 35 | 35 | { |
| 36 | 36 | $tab = $this->prepareFile(); |
| 37 | - foreach ($tab as $line) |
|
| 38 | - $this->parseLine($line); |
|
| 37 | + foreach ($tab as $line) { |
|
| 38 | + $this->parseLine($line); |
|
| 39 | + } |
|
| 39 | 40 | } |
| 40 | 41 | |
| 41 | 42 | public function getXML() |
@@ -53,13 +54,15 @@ discard block |
||
| 53 | 54 | protected function createXML($key, $value, $level) |
| 54 | 55 | { |
| 55 | 56 | $indent = ''; |
| 56 | - for ($i = 0; $i <= $level; $i++) |
|
| 57 | - $indent .= "\t"; |
|
| 57 | + for ($i = 0; $i <= $level; $i++) { |
|
| 58 | + $indent .= "\t"; |
|
| 59 | + } |
|
| 58 | 60 | if (is_array($value)) { |
| 59 | 61 | $xml = "$indent<$key>\n"; |
| 60 | 62 | foreach ($value as $subKey => $subVal) { |
| 61 | - if (is_numeric($subKey)) |
|
| 62 | - $subKey = substr($key, 0, -1); |
|
| 63 | + if (is_numeric($subKey)) { |
|
| 64 | + $subKey = substr($key, 0, -1); |
|
| 65 | + } |
|
| 63 | 66 | $xml .= $this->createXML($subKey, $subVal, $level + 1); |
| 64 | 67 | } |
| 65 | 68 | $xml .= "$indent</$key>\n"; |
@@ -85,10 +88,11 @@ discard block |
||
| 85 | 88 | break; |
| 86 | 89 | case 'NS': |
| 87 | 90 | $code = substr($value, 0, 2); |
| 88 | - if ($code == '22') |
|
| 89 | - $this->ownerName = substr($value, 2); |
|
| 90 | - else if ($code == '23') |
|
| 91 | - $this->accountName = substr($value, 2); |
|
| 91 | + if ($code == '22') { |
|
| 92 | + $this->ownerName = substr($value, 2); |
|
| 93 | + } else if ($code == '23') { |
|
| 94 | + $this->accountName = substr($value, 2); |
|
| 95 | + } |
|
| 92 | 96 | break; |
| 93 | 97 | case '60F': |
| 94 | 98 | $this->openBalance = $this->parseBalance($value); |
@@ -103,10 +107,11 @@ discard block |
||
| 103 | 107 | self::parseOperation($value); |
| 104 | 108 | break; |
| 105 | 109 | case '86': |
| 106 | - if ($this->_lastTag == '61') |
|
| 107 | - $this->parseTransaction($value); |
|
| 108 | - else |
|
| 109 | - $this->info .= $value; |
|
| 110 | + if ($this->_lastTag == '61') { |
|
| 111 | + $this->parseTransaction($value); |
|
| 112 | + } else { |
|
| 113 | + $this->info .= $value; |
|
| 114 | + } |
|
| 110 | 115 | break; |
| 111 | 116 | default: |
| 112 | 117 | break; |
@@ -20,6 +20,9 @@ discard block |
||
| 20 | 20 | $this->parseLine($line); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $line |
|
| 25 | + */ |
|
| 23 | 26 | protected function parseLine($line) |
| 24 | 27 | { |
| 25 | 28 | $tag = substr($line, 1, strpos($line, ':', 1) - 1); |
@@ -65,6 +68,9 @@ discard block |
||
| 65 | 68 | $this->_lastTag = $tag; |
| 66 | 69 | } |
| 67 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string $value |
|
| 73 | + */ |
|
| 68 | 74 | protected function parseOperation($value) |
| 69 | 75 | { |
| 70 | 76 | $this->operations[] = array( |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | public function parse() |
| 17 | 17 | { |
| 18 | 18 | $tab = $this->prepareFile(); |
| 19 | - foreach ($tab as $line) |
|
| 20 | - $this->parseLine($line); |
|
| 19 | + foreach ($tab as $line) { |
|
| 20 | + $this->parseLine($line); |
|
| 21 | + } |
|
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | protected function parseLine($line) |
@@ -36,10 +37,11 @@ discard block |
||
| 36 | 37 | break; |
| 37 | 38 | case 'NS': |
| 38 | 39 | $code = substr($value, 0, 2); |
| 39 | - if ($code == '22') |
|
| 40 | - $this->ownerName = substr($value, 2); |
|
| 41 | - else if ($code == '23') |
|
| 42 | - $this->accountName = substr($value, 2); |
|
| 40 | + if ($code == '22') { |
|
| 41 | + $this->ownerName = substr($value, 2); |
|
| 42 | + } else if ($code == '23') { |
|
| 43 | + $this->accountName = substr($value, 2); |
|
| 44 | + } |
|
| 43 | 45 | break; |
| 44 | 46 | case '60F': |
| 45 | 47 | $this->openBalance = $this->parseBalance($value); |
@@ -54,10 +56,11 @@ discard block |
||
| 54 | 56 | self::parseOperation($value); |
| 55 | 57 | break; |
| 56 | 58 | case '86': |
| 57 | - if ($this->_lastTag == '61') |
|
| 58 | - $this->parseTransaction($value); |
|
| 59 | - else |
|
| 60 | - $this->info .= $value; |
|
| 59 | + if ($this->_lastTag == '61') { |
|
| 60 | + $this->parseTransaction($value); |
|
| 61 | + } else { |
|
| 62 | + $this->info .= $value; |
|
| 63 | + } |
|
| 61 | 64 | break; |
| 62 | 65 | default: |
| 63 | 66 | break; |
@@ -20,6 +20,9 @@ discard block |
||
| 20 | 20 | $this->parseLine($line); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $line |
|
| 25 | + */ |
|
| 23 | 26 | protected function parseLine($line) |
| 24 | 27 | { |
| 25 | 28 | $tag = substr($line, 1, strpos($line, ':', 1) - 1); |
@@ -65,6 +68,9 @@ discard block |
||
| 65 | 68 | $this->_lastTag = $tag; |
| 66 | 69 | } |
| 67 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string $value |
|
| 73 | + */ |
|
| 68 | 74 | protected function parseTransaction($value) |
| 69 | 75 | { |
| 70 | 76 | $transaction = array( |
@@ -109,6 +115,9 @@ discard block |
||
| 109 | 115 | $this->operations[count($this->operations) - 1]['details'] = $transaction; |
| 110 | 116 | } |
| 111 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $value |
|
| 120 | + */ |
|
| 112 | 121 | protected function parseOperation($value) |
| 113 | 122 | { |
| 114 | 123 | $this->operations[] = array( |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | public function parse() |
| 17 | 17 | { |
| 18 | 18 | $tab = $this->prepareFile(); |
| 19 | - foreach ($tab as $line) |
|
| 20 | - $this->parseLine($line); |
|
| 19 | + foreach ($tab as $line) { |
|
| 20 | + $this->parseLine($line); |
|
| 21 | + } |
|
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | protected function parseLine($line) |
@@ -36,10 +37,11 @@ discard block |
||
| 36 | 37 | break; |
| 37 | 38 | case 'NS': |
| 38 | 39 | $code = substr($value, 0, 2); |
| 39 | - if ($code == '22') |
|
| 40 | - $this->ownerName = substr($value, 2); |
|
| 41 | - else if ($code == '23') |
|
| 42 | - $this->accountName = substr($value, 2); |
|
| 40 | + if ($code == '22') { |
|
| 41 | + $this->ownerName = substr($value, 2); |
|
| 42 | + } else if ($code == '23') { |
|
| 43 | + $this->accountName = substr($value, 2); |
|
| 44 | + } |
|
| 43 | 45 | break; |
| 44 | 46 | case '60F': |
| 45 | 47 | $this->openBalance = $this->parseBalance($value); |
@@ -54,10 +56,11 @@ discard block |
||
| 54 | 56 | self::parseOperation($value); |
| 55 | 57 | break; |
| 56 | 58 | case '86': |
| 57 | - if ($this->_lastTag == '61') |
|
| 58 | - $this->parseTransaction($value); |
|
| 59 | - else |
|
| 60 | - $this->info .= $value; |
|
| 59 | + if ($this->_lastTag == '61') { |
|
| 60 | + $this->parseTransaction($value); |
|
| 61 | + } else { |
|
| 62 | + $this->info .= $value; |
|
| 63 | + } |
|
| 61 | 64 | break; |
| 62 | 65 | default: |
| 63 | 66 | break; |
@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | return $this->webappurl; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @return string |
|
| 59 | + */ |
|
| 57 | 60 | public function getOutboundContext() |
| 58 | 61 | { |
| 59 | 62 | return $this->outboundcontext; |
@@ -82,6 +85,7 @@ discard block |
||
| 82 | 85 | /** |
| 83 | 86 | * Function to set server parameters |
| 84 | 87 | * @param <array> authdetails |
| 88 | + * @param PBXManager_Server_Model $serverModel |
|
| 85 | 89 | */ |
| 86 | 90 | public function setServerParameters($serverModel) |
| 87 | 91 | { |
@@ -100,6 +104,9 @@ discard block |
||
| 100 | 104 | return self::$SETTINGS_REQUIRED_PARAMETERS; |
| 101 | 105 | } |
| 102 | 106 | |
| 107 | + /** |
|
| 108 | + * @param string $type |
|
| 109 | + */ |
|
| 103 | 110 | protected function prepareParameters($details, $type) |
| 104 | 111 | { |
| 105 | 112 | switch ($type) { |
@@ -294,7 +301,6 @@ discard block |
||
| 294 | 301 | |
| 295 | 302 | /** |
| 296 | 303 | * Function to respond for outgoing calls |
| 297 | - * @param <Vtiger_Request> $details |
|
| 298 | 304 | */ |
| 299 | 305 | public function respondToOutgoingCall($to) |
| 300 | 306 | { |
@@ -324,7 +330,7 @@ discard block |
||
| 324 | 330 | /** |
| 325 | 331 | * Function to make outbound call |
| 326 | 332 | * @param <string> $number (Customer) |
| 327 | - * @param <string> $recordid |
|
| 333 | + * @param <string> $record |
|
| 328 | 334 | */ |
| 329 | 335 | public function call($number, $record) |
| 330 | 336 | { |
@@ -239,10 +239,11 @@ discard block |
||
| 239 | 239 | $recordModel = PBXManager_Record_Model::getCleanInstance(); |
| 240 | 240 | $recordModel->saveRecordWithArrray($params); |
| 241 | 241 | |
| 242 | - if ($direction == self::INCOMING_TYPE) |
|
| 243 | - $this->respondToIncomingCall($details); |
|
| 244 | - else |
|
| 245 | - $this->respondToOutgoingCall($params['CustomerNumber']); |
|
| 242 | + if ($direction == self::INCOMING_TYPE) { |
|
| 243 | + $this->respondToIncomingCall($details); |
|
| 244 | + } else { |
|
| 245 | + $this->respondToOutgoingCall($params['CustomerNumber']); |
|
| 246 | + } |
|
| 246 | 247 | } |
| 247 | 248 | |
| 248 | 249 | /** |
@@ -312,8 +313,9 @@ discard block |
||
| 312 | 313 | } else { |
| 313 | 314 | $response .= '<Number>SIP/'; |
| 314 | 315 | $response .= $to; |
| 315 | - if ($numberLength > 5) |
|
| 316 | - $response .= '@' . $this->getOutboundTrunk(); |
|
| 316 | + if ($numberLength > 5) { |
|
| 317 | + $response .= '@' . $this->getOutboundTrunk(); |
|
| 318 | + } |
|
| 317 | 319 | $response .= '</Number>'; |
| 318 | 320 | } |
| 319 | 321 | |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | |
| 198 | 198 | /** function used to get whether the pricebook has related with a product or not |
| 199 | 199 | * @param int $id - product id |
| 200 | - * @return true or false - if there are no pricebooks available or associated pricebooks for the product is equal to total number of pricebooks then return false, else return true |
|
| 200 | + * @return boolean|null or false - if there are no pricebooks available or associated pricebooks for the product is equal to total number of pricebooks then return false, else return true |
|
| 201 | 201 | */ |
| 202 | 202 | public function get_pricebook_noproduct($id) |
| 203 | 203 | { |
@@ -283,19 +283,19 @@ |
||
| 283 | 283 | $query = $this->getRelationQuery($module, $secmodule, "vtiger_pricebook", "pricebookid", $queryplanner); |
| 284 | 284 | // TODO Support query planner |
| 285 | 285 | if ($queryplanner->requireTable("vtiger_crmentityPriceBooks", $matrix)) { |
| 286 | - $query .=" left join vtiger_crmentity as vtiger_crmentityPriceBooks on vtiger_crmentityPriceBooks.crmid=vtiger_pricebook.pricebookid and vtiger_crmentityPriceBooks.deleted=0"; |
|
| 286 | + $query .= " left join vtiger_crmentity as vtiger_crmentityPriceBooks on vtiger_crmentityPriceBooks.crmid=vtiger_pricebook.pricebookid and vtiger_crmentityPriceBooks.deleted=0"; |
|
| 287 | 287 | } |
| 288 | 288 | if ($queryplanner->requireTable("vtiger_currency_infoPriceBooks")) { |
| 289 | - $query .=" left join vtiger_currency_info as vtiger_currency_infoPriceBooks on vtiger_currency_infoPriceBooks.id = vtiger_pricebook.currency_id"; |
|
| 289 | + $query .= " left join vtiger_currency_info as vtiger_currency_infoPriceBooks on vtiger_currency_infoPriceBooks.id = vtiger_pricebook.currency_id"; |
|
| 290 | 290 | } |
| 291 | 291 | if ($queryplanner->requireTable("vtiger_usersPriceBooks")) { |
| 292 | - $query .=" left join vtiger_users as vtiger_usersPriceBooks on vtiger_usersPriceBooks.id = vtiger_crmentityPriceBooks.smownerid"; |
|
| 292 | + $query .= " left join vtiger_users as vtiger_usersPriceBooks on vtiger_usersPriceBooks.id = vtiger_crmentityPriceBooks.smownerid"; |
|
| 293 | 293 | } |
| 294 | 294 | if ($queryplanner->requireTable("vtiger_groupsPriceBooks")) { |
| 295 | - $query .=" left join vtiger_groups as vtiger_groupsPriceBooks on vtiger_groupsPriceBooks.groupid = vtiger_crmentityPriceBooks.smownerid"; |
|
| 295 | + $query .= " left join vtiger_groups as vtiger_groupsPriceBooks on vtiger_groupsPriceBooks.groupid = vtiger_crmentityPriceBooks.smownerid"; |
|
| 296 | 296 | } |
| 297 | 297 | if ($queryplanner->requireTable("vtiger_lastModifiedByPriceBooks")) { |
| 298 | - $query .=" left join vtiger_users as vtiger_lastModifiedByPriceBooks on vtiger_lastModifiedByPriceBooks.id = vtiger_crmentityPriceBooks.smownerid"; |
|
| 298 | + $query .= " left join vtiger_users as vtiger_lastModifiedByPriceBooks on vtiger_lastModifiedByPriceBooks.id = vtiger_crmentityPriceBooks.smownerid"; |
|
| 299 | 299 | } |
| 300 | 300 | if ($queryplanner->requireTable("vtiger_createdbyPriceBooks")) { |
| 301 | 301 | $query .= " left join vtiger_users as vtiger_createdbyPriceBooks on vtiger_createdbyPriceBooks.id = vtiger_crmentityPriceBooks.smcreatorid "; |
@@ -102,16 +102,18 @@ discard block |
||
| 102 | 102 | vtlib_setup_modulevars($related_module, $other); |
| 103 | 103 | $singular_modname = vtlib_toSingular($related_module); |
| 104 | 104 | |
| 105 | - if ($singlepane_view == 'true') |
|
| 106 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 107 | - else |
|
| 108 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 105 | + if ($singlepane_view == 'true') { |
|
| 106 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 107 | + } else { |
|
| 108 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 109 | + } |
|
| 109 | 110 | |
| 110 | 111 | $button = ''; |
| 111 | 112 | |
| 112 | 113 | if ($actions) { |
| 113 | - if (is_string($actions)) |
|
| 114 | - $actions = explode(',', strtoupper($actions)); |
|
| 114 | + if (is_string($actions)) { |
|
| 115 | + $actions = explode(',', strtoupper($actions)); |
|
| 116 | + } |
|
| 115 | 117 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 116 | 118 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='submit' name='button' onclick=\"this.form.action.value='AddProductsToPriceBook';this.form.module.value='$related_module';this.form.return_module.value='$currentModule';this.form.return_action.value='PriceBookDetailView'\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 117 | 119 | } |
@@ -131,8 +133,9 @@ discard block |
||
| 131 | 133 | $this->retrieve_entity_info($id, $this_module); |
| 132 | 134 | $return_value = getPriceBookRelatedProducts($query, $this, $returnset); |
| 133 | 135 | |
| 134 | - if ($return_value === null) |
|
| 135 | - $return_value = Array(); |
|
| 136 | + if ($return_value === null) { |
|
| 137 | + $return_value = Array(); |
|
| 138 | + } |
|
| 136 | 139 | $return_value['CUSTOM_BUTTON'] = $button; |
| 137 | 140 | |
| 138 | 141 | $log->debug("Exiting get_pricebook_products method ..."); |
@@ -158,16 +161,18 @@ discard block |
||
| 158 | 161 | vtlib_setup_modulevars($related_module, $other); |
| 159 | 162 | $singular_modname = vtlib_toSingular($related_module); |
| 160 | 163 | |
| 161 | - if ($singlepane_view == 'true') |
|
| 162 | - $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 163 | - else |
|
| 164 | - $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 164 | + if ($singlepane_view == 'true') { |
|
| 165 | + $returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id; |
|
| 166 | + } else { |
|
| 167 | + $returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id; |
|
| 168 | + } |
|
| 165 | 169 | |
| 166 | 170 | $button = ''; |
| 167 | 171 | |
| 168 | 172 | if ($actions) { |
| 169 | - if (is_string($actions)) |
|
| 170 | - $actions = explode(',', strtoupper($actions)); |
|
| 173 | + if (is_string($actions)) { |
|
| 174 | + $actions = explode(',', strtoupper($actions)); |
|
| 175 | + } |
|
| 171 | 176 | if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') { |
| 172 | 177 | $button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='submit' name='button' onclick=\"this.form.action.value='AddServicesToPriceBook';this.form.module.value='$related_module';this.form.return_module.value='$currentModule';this.form.return_action.value='PriceBookDetailView'\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'> "; |
| 173 | 178 | } |
@@ -187,8 +192,9 @@ discard block |
||
| 187 | 192 | $this->retrieve_entity_info($id, $this_module); |
| 188 | 193 | $return_value = $other->getPriceBookRelatedServices($query, $this, $returnset); |
| 189 | 194 | |
| 190 | - if ($return_value === null) |
|
| 191 | - $return_value = Array(); |
|
| 195 | + if ($return_value === null) { |
|
| 196 | + $return_value = Array(); |
|
| 197 | + } |
|
| 192 | 198 | $return_value['CUSTOM_BUTTON'] = $button; |
| 193 | 199 | |
| 194 | 200 | $log->debug("Exiting get_pricebook_services method ..."); |