@@ -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 | } |
@@ -72,8 +73,9 @@ discard block |
||
72 | 73 | $priorities[$row['priority']] = $counter++; |
73 | 74 | $colors[$row['priority']] = $row['color']; |
74 | 75 | } |
75 | - if (!in_array($row['statusvalue'], $status)) |
|
76 | - $status[] = $row['statusvalue']; |
|
76 | + if (!in_array($row['statusvalue'], $status)) { |
|
77 | + $status[] = $row['statusvalue']; |
|
78 | + } |
|
77 | 79 | } |
78 | 80 | if (!empty($tickets)) { |
79 | 81 | $counter = 0; |
@@ -117,13 +119,15 @@ discard block |
||
117 | 119 | $data = $request->get('data'); |
118 | 120 | $createdTime = $request->get('createdtime'); |
119 | 121 | $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId()); |
120 | - if (!$request->has('owner')) |
|
121 | - $owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName); |
|
122 | - else |
|
123 | - $owner = $request->get('owner'); |
|
122 | + if (!$request->has('owner')) { |
|
123 | + $owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName); |
|
124 | + } else { |
|
125 | + $owner = $request->get('owner'); |
|
126 | + } |
|
124 | 127 | $ownerForwarded = $owner; |
125 | - if ($owner == 'all') |
|
126 | - $owner = ''; |
|
128 | + if ($owner == 'all') { |
|
129 | + $owner = ''; |
|
130 | + } |
|
127 | 131 | |
128 | 132 | //Date conversion from user to database format |
129 | 133 | 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(); |
@@ -257,8 +257,9 @@ |
||
257 | 257 | $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments'); |
258 | 258 | if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) { |
259 | 259 | include_once 'modules/ModComments/ModComments.php'; |
260 | - if (class_exists('ModComments')) |
|
261 | - ModComments::addWidgetTo(array('OSSEmployees')); |
|
260 | + if (class_exists('ModComments')) { |
|
261 | + ModComments::addWidgetTo(array('OSSEmployees')); |
|
262 | + } |
|
262 | 263 | } |
263 | 264 | } else if ($event_type == 'module.disabled') { |
264 | 265 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | /** |
8 | 8 | * Detect the MIME type based on extension in the filename. |
9 | - * @return MIME type text. |
|
9 | + * @return string type text. |
|
10 | 10 | */ |
11 | 11 | static function detect($filename) |
12 | 12 | { |
@@ -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; |
@@ -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 | { |