@@ -18,8 +18,9 @@ discard block |
||
18 | 18 | public function parse() |
19 | 19 | { |
20 | 20 | $tab = $this->prepareFile(); |
21 | - foreach ($tab as $line) |
|
22 | - $this->parseLine($line); |
|
21 | + foreach ($tab as $line) { |
|
22 | + $this->parseLine($line); |
|
23 | + } |
|
23 | 24 | } |
24 | 25 | |
25 | 26 | protected function parseLine($line) |
@@ -38,10 +39,11 @@ discard block |
||
38 | 39 | break; |
39 | 40 | case 'NS': |
40 | 41 | $code = substr($value, 0, 2); |
41 | - if ($code == '22') |
|
42 | - $this->ownerName = substr($value, 2); |
|
43 | - else if ($code == '23') |
|
44 | - $this->accountName = substr($value, 2); |
|
42 | + if ($code == '22') { |
|
43 | + $this->ownerName = substr($value, 2); |
|
44 | + } else if ($code == '23') { |
|
45 | + $this->accountName = substr($value, 2); |
|
46 | + } |
|
45 | 47 | break; |
46 | 48 | case '60F': |
47 | 49 | $this->openBalance = $this->parseBalance($value); |
@@ -56,16 +58,18 @@ discard block |
||
56 | 58 | self::parseOperation($value); |
57 | 59 | break; |
58 | 60 | case '86': |
59 | - if ($this->_lastTag == '61') |
|
60 | - $this->parseTransaction($value); |
|
61 | - else |
|
62 | - $this->info .= $value; |
|
61 | + if ($this->_lastTag == '61') { |
|
62 | + $this->parseTransaction($value); |
|
63 | + } else { |
|
64 | + $this->info .= $value; |
|
65 | + } |
|
63 | 66 | break; |
64 | 67 | default: |
65 | 68 | break; |
66 | 69 | } |
67 | - if ($tag) |
|
68 | - $this->_lastTag = $tag; |
|
70 | + if ($tag) { |
|
71 | + $this->_lastTag = $tag; |
|
72 | + } |
|
69 | 73 | } |
70 | 74 | |
71 | 75 | protected function parseTransaction($value) |
@@ -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); |
@@ -66,6 +69,9 @@ discard block |
||
66 | 69 | $this->_lastTag = $tag; |
67 | 70 | } |
68 | 71 | |
72 | + /** |
|
73 | + * @param string $value |
|
74 | + */ |
|
69 | 75 | protected function parseTransaction($value) |
70 | 76 | { |
71 | 77 | $transaction = array( |
@@ -84,6 +90,9 @@ discard block |
||
84 | 90 | $this->operations[count($this->operations) - 1]['details'] = $transaction; |
85 | 91 | } |
86 | 92 | |
93 | + /** |
|
94 | + * @param string $value |
|
95 | + */ |
|
87 | 96 | protected function parseOperation($value) |
88 | 97 | { |
89 | 98 | $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( |
@@ -129,6 +135,9 @@ discard block |
||
129 | 135 | $this->operations[count($this->operations) - 1]['details'] = $transaction; |
130 | 136 | } |
131 | 137 | |
138 | + /** |
|
139 | + * @param string $value |
|
140 | + */ |
|
132 | 141 | protected function parseOperation($value) |
133 | 142 | { |
134 | 143 | $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 == 'NS') |
|
58 | - $this->parseTransaction($value); |
|
59 | - else |
|
60 | - $this->info .= $value; |
|
59 | + if ($this->_lastTag == 'NS') { |
|
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( |
@@ -129,6 +135,9 @@ discard block |
||
129 | 135 | $this->operations[count($this->operations) - 1]['details'] = $transaction; |
130 | 136 | } |
131 | 137 | |
138 | + /** |
|
139 | + * @param string $value |
|
140 | + */ |
|
132 | 141 | protected function parseOperation($value) |
133 | 142 | { |
134 | 143 | $this->operations[] = array( |
@@ -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 |
@@ -53,6 +53,9 @@ discard block |
||
53 | 53 | return $this->webappurl; |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @return string |
|
58 | + */ |
|
56 | 59 | public function getOutboundContext() |
57 | 60 | { |
58 | 61 | return $this->outboundcontext; |
@@ -81,6 +84,7 @@ discard block |
||
81 | 84 | /** |
82 | 85 | * Function to set server parameters |
83 | 86 | * @param <array> authdetails |
87 | + * @param PBXManager_Server_Model $serverModel |
|
84 | 88 | */ |
85 | 89 | public function setServerParameters($serverModel) |
86 | 90 | { |
@@ -99,6 +103,10 @@ discard block |
||
99 | 103 | return self::$SETTINGS_REQUIRED_PARAMETERS; |
100 | 104 | } |
101 | 105 | |
106 | + /** |
|
107 | + * @param App\Request $details |
|
108 | + * @param string $type |
|
109 | + */ |
|
102 | 110 | protected function prepareParameters($details, $type) |
103 | 111 | { |
104 | 112 | switch ($type) { |
@@ -293,7 +301,6 @@ discard block |
||
293 | 301 | |
294 | 302 | /** |
295 | 303 | * Function to respond for outgoing calls |
296 | - * @param \App\Request $details |
|
297 | 304 | */ |
298 | 305 | public function respondToOutgoingCall($to) |
299 | 306 | { |
@@ -323,7 +330,7 @@ discard block |
||
323 | 330 | /** |
324 | 331 | * Function to make outbound call |
325 | 332 | * @param string $number (Customer) |
326 | - * @param string $recordid |
|
333 | + * @param string $record |
|
327 | 334 | */ |
328 | 335 | public function call($number, $record) |
329 | 336 | { |
@@ -28,23 +28,25 @@ |
||
28 | 28 | $recordModel = Vtiger_Record_Model::getInstanceById($ID, $moduleName); |
29 | 29 | $vatId = $recordModel->get('vat_id'); |
30 | 30 | } else { |
31 | - if (array_key_exists('vat_id', $recordForm)) |
|
32 | - $vatId = $recordForm['vat_id']; |
|
31 | + if (array_key_exists('vat_id', $recordForm)) { |
|
32 | + $vatId = $recordForm['vat_id']; |
|
33 | + } |
|
33 | 34 | } |
34 | 35 | if ($ID != 0 && $ID != '' && !array_key_exists('accountname', $recordForm)) { |
35 | 36 | $recordModel = Vtiger_Record_Model::getInstanceById($ID, $moduleName); |
36 | 37 | $accountName = $recordModel->get('accountname'); |
37 | 38 | } else { |
38 | - if (array_key_exists('accountname', $recordForm)) |
|
39 | - $accountName = $recordForm['accountname']; |
|
39 | + if (array_key_exists('accountname', $recordForm)) { |
|
40 | + $accountName = $recordForm['accountname']; |
|
41 | + } |
|
40 | 42 | } |
41 | 43 | |
42 | 44 | $moduleModel = Vtiger_Module_Model::getInstance($moduleName); |
43 | 45 | $hierarchyField = Vtiger_Field_Model::getInstance('account_id', $moduleModel); |
44 | 46 | if ($hierarchyField->isActiveField()) { |
45 | - if (array_key_exists('account_id', $recordForm)) |
|
46 | - $hierarchyValue = $recordForm['account_id']; |
|
47 | - elseif ($ID != 0 && $ID != '' && !array_key_exists('account_id', $recordForm)) { |
|
47 | + if (array_key_exists('account_id', $recordForm)) { |
|
48 | + $hierarchyValue = $recordForm['account_id']; |
|
49 | + } elseif ($ID != 0 && $ID != '' && !array_key_exists('account_id', $recordForm)) { |
|
48 | 50 | $recordModel = Vtiger_Record_Model::getInstanceById($ID, $moduleName); |
49 | 51 | $hierarchyValue = $recordModel->get('account_id'); |
50 | 52 | } |
@@ -296,7 +296,7 @@ |
||
296 | 296 | $buffer = fread($handle, filesize($validate)); |
297 | 297 | if (substr_count($buffer, $authkey) < $i) |
298 | 298 | return -1; |
299 | - }else { |
|
299 | + } else { |
|
300 | 300 | return -1; |
301 | 301 | } |
302 | 302 | } |
@@ -201,7 +201,6 @@ discard block |
||
201 | 201 | |
202 | 202 | /** |
203 | 203 | * @return string encrypted password for storage in DB and comparison against DB password. |
204 | - * @param string $user_name - Must be non null and at least 2 characters |
|
205 | 204 | * @param string $user_password - Must be non null and at least 1 character. |
206 | 205 | * @desc Take an unencrypted username and password and return the encrypted password |
207 | 206 | * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. |
@@ -354,7 +353,6 @@ discard block |
||
354 | 353 | } |
355 | 354 | |
356 | 355 | /** |
357 | - * @param string $user name - Must be non null and at least 1 character. |
|
358 | 356 | * @param string $userPassword - Must be non null and at least 1 character. |
359 | 357 | * @param string $newPassword - Must be non null and at least 1 character. |
360 | 358 | * @return boolean - If passwords pass verification and query succeeds, return true, else return false. |
@@ -479,7 +477,7 @@ discard block |
||
479 | 477 | |
480 | 478 | /** Function to retreive the user info of the specifed user id The user info will be available in $this->column_fields array |
481 | 479 | * @param $record -- record id:: Type integer |
482 | - * @param $module -- module:: Type varchar |
|
480 | + * @param string $module -- module:: Type varchar |
|
483 | 481 | */ |
484 | 482 | public function retrieve_entity_info($record, $module) |
485 | 483 | { |
@@ -115,10 +115,11 @@ discard block |
||
115 | 115 | { |
116 | 116 | |
117 | 117 | \App\Log::trace("Entering getSortOrder() method ..."); |
118 | - if (\App\Request::_has('sorder')) |
|
119 | - $sorder = $this->db->sql_escape_string(\App\Request::_get('sorder')); |
|
120 | - else |
|
121 | - $sorder = (($_SESSION['USERS_SORT_ORDER'] != '') ? ($_SESSION['USERS_SORT_ORDER']) : ($this->default_sort_order)); |
|
118 | + if (\App\Request::_has('sorder')) { |
|
119 | + $sorder = $this->db->sql_escape_string(\App\Request::_get('sorder')); |
|
120 | + } else { |
|
121 | + $sorder = (($_SESSION['USERS_SORT_ORDER'] != '') ? ($_SESSION['USERS_SORT_ORDER']) : ($this->default_sort_order)); |
|
122 | + } |
|
122 | 123 | \App\Log::trace("Exiting getSortOrder method ..."); |
123 | 124 | return $sorder; |
124 | 125 | } |
@@ -137,10 +138,11 @@ discard block |
||
137 | 138 | $use_default_order_by = $this->default_order_by; |
138 | 139 | } |
139 | 140 | |
140 | - if (\App\Request::_has('order_by')) |
|
141 | - $order_by = $this->db->sql_escape_string(\App\Request::_get('order_by')); |
|
142 | - else |
|
143 | - $order_by = (($_SESSION['USERS_ORDER_BY'] != '') ? ($_SESSION['USERS_ORDER_BY']) : ($use_default_order_by)); |
|
141 | + if (\App\Request::_has('order_by')) { |
|
142 | + $order_by = $this->db->sql_escape_string(\App\Request::_get('order_by')); |
|
143 | + } else { |
|
144 | + $order_by = (($_SESSION['USERS_ORDER_BY'] != '') ? ($_SESSION['USERS_ORDER_BY']) : ($use_default_order_by)); |
|
145 | + } |
|
144 | 146 | \App\Log::trace("Exiting getOrderBy method ..."); |
145 | 147 | return $order_by; |
146 | 148 | } |
@@ -154,10 +156,11 @@ discard block |
||
154 | 156 | public function setPreference($name, $value) |
155 | 157 | { |
156 | 158 | if (!isset($this->user_preferences)) { |
157 | - if (isset($_SESSION["USER_PREFERENCES"])) |
|
158 | - $this->user_preferences = $_SESSION["USER_PREFERENCES"]; |
|
159 | - else |
|
160 | - $this->user_preferences = []; |
|
159 | + if (isset($_SESSION["USER_PREFERENCES"])) { |
|
160 | + $this->user_preferences = $_SESSION["USER_PREFERENCES"]; |
|
161 | + } else { |
|
162 | + $this->user_preferences = []; |
|
163 | + } |
|
161 | 164 | } |
162 | 165 | if (!array_key_exists($name, $this->user_preferences) || $this->user_preferences[$name] != $value) { |
163 | 166 | \App\Log::trace("Saving To Preferences:" . $name . "=" . $value); |
@@ -257,9 +260,10 @@ discard block |
||
257 | 260 | $authkey = base64_decode($authkey); |
258 | 261 | if (file_exists($validate) && $handle = fopen($validate, 'rb', true)) { |
259 | 262 | $buffer = fread($handle, filesize($validate)); |
260 | - if (substr_count($buffer, $authkey) < $i) |
|
261 | - return -1; |
|
262 | - }else { |
|
263 | + if (substr_count($buffer, $authkey) < $i) { |
|
264 | + return -1; |
|
265 | + } |
|
266 | + } else { |
|
263 | 267 | return -1; |
264 | 268 | } |
265 | 269 | } |
@@ -552,8 +556,9 @@ discard block |
||
552 | 556 | $db = App\Db::getInstance(); |
553 | 557 | //to get the owner id |
554 | 558 | $ownerid = $this->column_fields['assigned_user_id']; |
555 | - if (!isset($ownerid) || $ownerid == '') |
|
556 | - $ownerid = $currentUserId; |
|
559 | + if (!isset($ownerid) || $ownerid == '') { |
|
560 | + $ownerid = $currentUserId; |
|
561 | + } |
|
557 | 562 | $fileInstance = \App\Fields\File::loadFromRequest($fileDetails); |
558 | 563 | if (!$fileInstance->validate('image')) { |
559 | 564 | \App\Log::trace('Skip the save attachment process.'); |
@@ -37,17 +37,19 @@ |
||
37 | 37 | $sourceData = $entity->column_fields; |
38 | 38 | if ($sourceModule == 'HelpDesk') { |
39 | 39 | $sourceData['contact_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['contact_id']); |
40 | - if (vtlib\Functions::getCRMRecordType($sourceData['parent_id']) != 'Accounts') |
|
41 | - unset($sourceData['parent_id']); |
|
42 | - else |
|
43 | - $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['parent_id']); |
|
40 | + if (vtlib\Functions::getCRMRecordType($sourceData['parent_id']) != 'Accounts') { |
|
41 | + unset($sourceData['parent_id']); |
|
42 | + } else { |
|
43 | + $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['parent_id']); |
|
44 | + } |
|
44 | 45 | } else if ($sourceModule == 'Project') { |
45 | 46 | $query = sprintf("select * from vtiger_account where accountid = %s", $sourceData['linktoaccountscontacts']); |
46 | 47 | $ifExist = $adb->query($query, true, "Błąd podczas pobierania danych z vtiger_crmentityrel"); |
47 | - if ($adb->num_rows($ifExist) > 0) |
|
48 | - $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
49 | - else |
|
50 | - $sourceData['contact_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
48 | + if ($adb->num_rows($ifExist) > 0) { |
|
49 | + $sourceData['account_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
50 | + } else { |
|
51 | + $sourceData['contact_label'] = vtlib\Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']); |
|
52 | + } |
|
51 | 53 | } |
52 | 54 | } |
53 | 55 |
@@ -237,10 +237,11 @@ |
||
237 | 237 | $viewer->assign('MODULENAME', $moduleName); |
238 | 238 | $viewer->assign('SAVE', 'Save'); |
239 | 239 | $viewer->assign('CANCEL', 'Cancel'); |
240 | - if (\vtlib\Functions::userIsAdministrator($current_user)) |
|
241 | - $viewer->assign('ISADMIN', 1); |
|
242 | - else |
|
243 | - $viewer->assign('ISADMIN', 0); |
|
240 | + if (\vtlib\Functions::userIsAdministrator($current_user)) { |
|
241 | + $viewer->assign('ISADMIN', 1); |
|
242 | + } else { |
|
243 | + $viewer->assign('ISADMIN', 0); |
|
244 | + } |
|
244 | 245 | |
245 | 246 | // encryption variables |
246 | 247 | $viewer->assign('CONFIG', (!$config ? false : array('key' => $config['key']))); |
@@ -22,10 +22,11 @@ |
||
22 | 22 | $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'TransferOwnership', $module); |
23 | 23 | $transferModel = new $modelClassName(); |
24 | 24 | |
25 | - if (empty($record)) |
|
26 | - $recordIds = $this->getBaseModuleRecordIds($request); |
|
27 | - else |
|
28 | - $recordIds = [$record]; |
|
25 | + if (empty($record)) { |
|
26 | + $recordIds = $this->getBaseModuleRecordIds($request); |
|
27 | + } else { |
|
28 | + $recordIds = [$record]; |
|
29 | + } |
|
29 | 30 | if (!empty($recordIds)) { |
30 | 31 | $transferModel->transferRecordsOwnership($module, $transferOwnerId, $recordIds); |
31 | 32 | } |