@@ -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 | |
@@ -82,6 +82,9 @@ |
||
| 82 | 82 | $response->emit(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @param string $datetime |
|
| 87 | + */ |
|
| 85 | 88 | public function changeDateTime($datetime, $delta) |
| 86 | 89 | { |
| 87 | 90 | $date = new DateTime($datetime); |
@@ -318,6 +318,9 @@ discard block |
||
| 318 | 318 | return $permissions; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | + /** |
|
| 322 | + * @param string $val |
|
| 323 | + */ |
|
| 321 | 324 | public static function getFlag($val) |
| 322 | 325 | { |
| 323 | 326 | if ($val == 'On' || $val == 1 || stripos($val, 'On') !== false) { |
@@ -326,6 +329,9 @@ discard block |
||
| 326 | 329 | return 'Off'; |
| 327 | 330 | } |
| 328 | 331 | |
| 332 | + /** |
|
| 333 | + * @param string $value |
|
| 334 | + */ |
|
| 329 | 335 | public function error2string($value) |
| 330 | 336 | { |
| 331 | 337 | $level_names = array( |
@@ -340,7 +340,7 @@ |
||
| 340 | 340 | $levels = array(); |
| 341 | 341 | if (($value & E_ALL) == E_ALL) { |
| 342 | 342 | $levels[] = 'E_ALL'; |
| 343 | - $value&=~E_ALL; |
|
| 343 | + $value &= ~E_ALL; |
|
| 344 | 344 | } |
| 345 | 345 | foreach ($level_names as $level => $name) |
| 346 | 346 | if (($value & $level) == $level) |
@@ -119,113 +119,139 @@ discard block |
||
| 119 | 119 | $directiveValues['suhosin.post.max_value_length'] = array('prefer' => '1500000'); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if (ini_get('safe_mode') == '1' || stripos(ini_get('safe_mode'), 'On') !== false) |
|
| 123 | - $directiveValues['safe_mode']['status'] = true; |
|
| 122 | + if (ini_get('safe_mode') == '1' || stripos(ini_get('safe_mode'), 'On') !== false) { |
|
| 123 | + $directiveValues['safe_mode']['status'] = true; |
|
| 124 | + } |
|
| 124 | 125 | $directiveValues['safe_mode']['current'] = self::getFlag(ini_get('safe_mode')); |
| 125 | 126 | |
| 126 | - if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false) |
|
| 127 | - $directiveValues['display_errors']['status'] = true; |
|
| 127 | + if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false) { |
|
| 128 | + $directiveValues['display_errors']['status'] = true; |
|
| 129 | + } |
|
| 128 | 130 | $directiveValues['display_errors']['current'] = self::getFlag(ini_get('display_errors')); |
| 129 | 131 | |
| 130 | - if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false) |
|
| 131 | - $directiveValues['file_uploads']['status'] = true; |
|
| 132 | + if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false) { |
|
| 133 | + $directiveValues['file_uploads']['status'] = true; |
|
| 134 | + } |
|
| 132 | 135 | $directiveValues['file_uploads']['current'] = self::getFlag(ini_get('file_uploads')); |
| 133 | 136 | |
| 134 | - if ((ini_get('output_buffering') <= '4096' && ini_get('output_buffering') != '1') || stripos(ini_get('output_buffering'), 'Off') !== false) |
|
| 135 | - $directiveValues['output_buffering']['status'] = true; |
|
| 137 | + if ((ini_get('output_buffering') <= '4096' && ini_get('output_buffering') != '1') || stripos(ini_get('output_buffering'), 'Off') !== false) { |
|
| 138 | + $directiveValues['output_buffering']['status'] = true; |
|
| 139 | + } |
|
| 136 | 140 | if (!in_array(ini_get('output_buffering'), ['On', 1, 0, 'Off'])) { |
| 137 | 141 | $directiveValues['output_buffering']['current'] = ini_get('output_buffering'); |
| 138 | 142 | } else { |
| 139 | 143 | $directiveValues['output_buffering']['current'] = self::getFlag(ini_get('output_buffering')); |
| 140 | 144 | } |
| 141 | 145 | |
| 142 | - if (ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 600) |
|
| 143 | - $directiveValues['max_execution_time']['status'] = true; |
|
| 146 | + if (ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 600) { |
|
| 147 | + $directiveValues['max_execution_time']['status'] = true; |
|
| 148 | + } |
|
| 144 | 149 | $directiveValues['max_execution_time']['current'] = ini_get('max_execution_time'); |
| 145 | 150 | |
| 146 | - if (ini_get('max_input_time') != 0 && ini_get('max_input_time') < 600) |
|
| 147 | - $directiveValues['max_input_time']['status'] = true; |
|
| 151 | + if (ini_get('max_input_time') != 0 && ini_get('max_input_time') < 600) { |
|
| 152 | + $directiveValues['max_input_time']['status'] = true; |
|
| 153 | + } |
|
| 148 | 154 | $directiveValues['max_input_time']['current'] = ini_get('max_input_time'); |
| 149 | 155 | |
| 150 | - if (ini_get('default_socket_timeout') != 0 && ini_get('default_socket_timeout') < 600) |
|
| 151 | - $directiveValues['default_socket_timeout']['status'] = true; |
|
| 156 | + if (ini_get('default_socket_timeout') != 0 && ini_get('default_socket_timeout') < 600) { |
|
| 157 | + $directiveValues['default_socket_timeout']['status'] = true; |
|
| 158 | + } |
|
| 152 | 159 | $directiveValues['default_socket_timeout']['current'] = ini_get('default_socket_timeout'); |
| 153 | 160 | |
| 154 | - if (ini_get('mysql.connect_timeout') != 0 && ini_get('mysql.connect_timeout') < 600) |
|
| 155 | - $directiveValues['mysql.connect_timeout']['status'] = true; |
|
| 161 | + if (ini_get('mysql.connect_timeout') != 0 && ini_get('mysql.connect_timeout') < 600) { |
|
| 162 | + $directiveValues['mysql.connect_timeout']['status'] = true; |
|
| 163 | + } |
|
| 156 | 164 | $directiveValues['mysql.connect_timeout']['current'] = ini_get('mysql.connect_timeout'); |
| 157 | 165 | |
| 158 | - if (vtlib\Functions::parseBytes(ini_get('memory_limit')) < 33554432) |
|
| 159 | - $directiveValues['memory_limit']['status'] = true; |
|
| 166 | + if (vtlib\Functions::parseBytes(ini_get('memory_limit')) < 33554432) { |
|
| 167 | + $directiveValues['memory_limit']['status'] = true; |
|
| 168 | + } |
|
| 160 | 169 | $directiveValues['memory_limit']['current'] = vtlib\Functions::showBytes(ini_get('memory_limit')); |
| 161 | 170 | |
| 162 | - if (vtlib\Functions::parseBytes(ini_get('post_max_size')) < 10485760) |
|
| 163 | - $directiveValues['post_max_size']['status'] = true; |
|
| 171 | + if (vtlib\Functions::parseBytes(ini_get('post_max_size')) < 10485760) { |
|
| 172 | + $directiveValues['post_max_size']['status'] = true; |
|
| 173 | + } |
|
| 164 | 174 | $directiveValues['post_max_size']['current'] = vtlib\Functions::showBytes(ini_get('post_max_size')); |
| 165 | 175 | |
| 166 | - if (vtlib\Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760) |
|
| 167 | - $directiveValues['upload_max_filesize']['status'] = true; |
|
| 176 | + if (vtlib\Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760) { |
|
| 177 | + $directiveValues['upload_max_filesize']['status'] = true; |
|
| 178 | + } |
|
| 168 | 179 | $directiveValues['upload_max_filesize']['current'] = vtlib\Functions::showBytes(ini_get('upload_max_filesize')); |
| 169 | 180 | |
| 170 | - if (ini_get('magic_quotes_gpc') == '1' || stripos(ini_get('magic_quotes_gpc'), 'On') !== false) |
|
| 171 | - $directiveValues['magic_quotes_gpc']['status'] = true; |
|
| 181 | + if (ini_get('magic_quotes_gpc') == '1' || stripos(ini_get('magic_quotes_gpc'), 'On') !== false) { |
|
| 182 | + $directiveValues['magic_quotes_gpc']['status'] = true; |
|
| 183 | + } |
|
| 172 | 184 | $directiveValues['magic_quotes_gpc']['current'] = self::getFlag(ini_get('magic_quotes_gpc')); |
| 173 | 185 | |
| 174 | - if (ini_get('magic_quotes_runtime') == '1' || stripos(ini_get('magic_quotes_runtime'), 'On') !== false) |
|
| 175 | - $directiveValues['magic_quotes_runtime']['status'] = true; |
|
| 186 | + if (ini_get('magic_quotes_runtime') == '1' || stripos(ini_get('magic_quotes_runtime'), 'On') !== false) { |
|
| 187 | + $directiveValues['magic_quotes_runtime']['status'] = true; |
|
| 188 | + } |
|
| 176 | 189 | $directiveValues['magic_quotes_runtime']['current'] = self::getFlag((ini_get('magic_quotes_runtime'))); |
| 177 | 190 | |
| 178 | - if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false) |
|
| 179 | - $directiveValues['zlib.output_compression']['status'] = true; |
|
| 191 | + if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false) { |
|
| 192 | + $directiveValues['zlib.output_compression']['status'] = true; |
|
| 193 | + } |
|
| 180 | 194 | $directiveValues['zlib.output_compression']['current'] = self::getFlag((ini_get('zlib.output_compression'))); |
| 181 | 195 | |
| 182 | - if (ini_get('zend.ze1_compatibility_mode') == '1' || stripos(ini_get('zend.ze1_compatibility_mode'), 'On') !== false) |
|
| 183 | - $directiveValues['zend.ze1_compatibility_mode']['status'] = true; |
|
| 196 | + if (ini_get('zend.ze1_compatibility_mode') == '1' || stripos(ini_get('zend.ze1_compatibility_mode'), 'On') !== false) { |
|
| 197 | + $directiveValues['zend.ze1_compatibility_mode']['status'] = true; |
|
| 198 | + } |
|
| 184 | 199 | $directiveValues['zend.ze1_compatibility_mode']['current'] = self::getFlag(ini_get('zend.ze1_compatibility_mode')); |
| 185 | 200 | |
| 186 | 201 | if (extension_loaded('suhosin')) { |
| 187 | - if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false) |
|
| 188 | - $directiveValues['suhosin.session.encrypt']['status'] = true; |
|
| 202 | + if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false) { |
|
| 203 | + $directiveValues['suhosin.session.encrypt']['status'] = true; |
|
| 204 | + } |
|
| 189 | 205 | $directiveValues['suhosin.session.encrypt']['current'] = self::getFlag(ini_get('suhosin.session.encrypt')); |
| 190 | 206 | } |
| 191 | - if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false) |
|
| 192 | - $directiveValues['session.auto_start']['status'] = true; |
|
| 207 | + if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false) { |
|
| 208 | + $directiveValues['session.auto_start']['status'] = true; |
|
| 209 | + } |
|
| 193 | 210 | $directiveValues['session.auto_start']['current'] = self::getFlag(ini_get('session.auto_start')); |
| 194 | 211 | |
| 195 | - if (ini_get('mbstring.func_overload') == '1' || stripos(ini_get('mbstring.func_overload'), 'On') !== false) |
|
| 196 | - $directiveValues['mbstring.func_overload']['status'] = true; |
|
| 212 | + if (ini_get('mbstring.func_overload') == '1' || stripos(ini_get('mbstring.func_overload'), 'On') !== false) { |
|
| 213 | + $directiveValues['mbstring.func_overload']['status'] = true; |
|
| 214 | + } |
|
| 197 | 215 | $directiveValues['mbstring.func_overload']['current'] = self::getFlag(ini_get('mbstring.func_overload')); |
| 198 | 216 | |
| 199 | - if (ini_get('magic_quotes_sybase') == '1' || stripos(ini_get('magic_quotes_sybase'), 'On') !== false) |
|
| 200 | - $directiveValues['magic_quotes_sybase']['status'] = true; |
|
| 217 | + if (ini_get('magic_quotes_sybase') == '1' || stripos(ini_get('magic_quotes_sybase'), 'On') !== false) { |
|
| 218 | + $directiveValues['magic_quotes_sybase']['status'] = true; |
|
| 219 | + } |
|
| 201 | 220 | $directiveValues['magic_quotes_sybase']['current'] = self::getFlag(ini_get('magic_quotes_sybase')); |
| 202 | 221 | |
| 203 | - if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false) |
|
| 204 | - $directiveValues['log_errors']['status'] = true; |
|
| 222 | + if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false) { |
|
| 223 | + $directiveValues['log_errors']['status'] = true; |
|
| 224 | + } |
|
| 205 | 225 | $directiveValues['log_errors']['current'] = self::getFlag(ini_get('log_errors')); |
| 206 | 226 | |
| 207 | - if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false) |
|
| 208 | - $directiveValues['short_open_tag']['status'] = true; |
|
| 227 | + if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false) { |
|
| 228 | + $directiveValues['short_open_tag']['status'] = true; |
|
| 229 | + } |
|
| 209 | 230 | $directiveValues['short_open_tag']['current'] = self::getFlag(ini_get('short_open_tag')); |
| 210 | 231 | |
| 211 | - if (ini_get('session.gc_maxlifetime') < 21600) |
|
| 212 | - $directiveValues['session.gc_maxlifetime']['status'] = true; |
|
| 232 | + if (ini_get('session.gc_maxlifetime') < 21600) { |
|
| 233 | + $directiveValues['session.gc_maxlifetime']['status'] = true; |
|
| 234 | + } |
|
| 213 | 235 | $directiveValues['session.gc_maxlifetime']['current'] = ini_get('session.gc_maxlifetime'); |
| 214 | 236 | |
| 215 | - if (ini_get('session.gc_divisor') < 500) |
|
| 216 | - $directiveValues['session.gc_divisor']['status'] = true; |
|
| 237 | + if (ini_get('session.gc_divisor') < 500) { |
|
| 238 | + $directiveValues['session.gc_divisor']['status'] = true; |
|
| 239 | + } |
|
| 217 | 240 | $directiveValues['session.gc_divisor']['current'] = ini_get('session.gc_divisor'); |
| 218 | 241 | |
| 219 | - if (ini_get('session.gc_probability') < 1) |
|
| 220 | - $directiveValues['session.gc_probability']['status'] = true; |
|
| 242 | + if (ini_get('session.gc_probability') < 1) { |
|
| 243 | + $directiveValues['session.gc_probability']['status'] = true; |
|
| 244 | + } |
|
| 221 | 245 | $directiveValues['session.gc_probability']['current'] = ini_get('session.gc_probability'); |
| 222 | 246 | |
| 223 | - if (ini_get('max_input_vars') < 5000) |
|
| 224 | - $directiveValues['max_input_vars']['status'] = true; |
|
| 247 | + if (ini_get('max_input_vars') < 5000) { |
|
| 248 | + $directiveValues['max_input_vars']['status'] = true; |
|
| 249 | + } |
|
| 225 | 250 | $directiveValues['max_input_vars']['current'] = ini_get('max_input_vars'); |
| 226 | 251 | |
| 227 | - if (version_compare(PHP_VERSION, '5.4.0', '<')) |
|
| 228 | - $directiveValues['PHP']['status'] = true; |
|
| 252 | + if (version_compare(PHP_VERSION, '5.4.0', '<')) { |
|
| 253 | + $directiveValues['PHP']['status'] = true; |
|
| 254 | + } |
|
| 229 | 255 | $directiveValues['PHP']['current'] = PHP_VERSION; |
| 230 | 256 | |
| 231 | 257 | if (extension_loaded('suhosin')) { |
@@ -280,8 +306,9 @@ discard block |
||
| 280 | 306 | } |
| 281 | 307 | |
| 282 | 308 | $errorReporting = stripos(ini_get('error_reporting'), '_') === false ? self::error2string(ini_get('error_reporting')) : ini_get('error_reporting'); |
| 283 | - if (in_array('E_NOTICE', $errorReporting) || in_array('E_DEPRECATED', $errorReporting) || in_array('E_STRICT', $errorReporting)) |
|
| 284 | - $directiveValues['error_reporting']['status'] = true; |
|
| 309 | + if (in_array('E_NOTICE', $errorReporting) || in_array('E_DEPRECATED', $errorReporting) || in_array('E_STRICT', $errorReporting)) { |
|
| 310 | + $directiveValues['error_reporting']['status'] = true; |
|
| 311 | + } |
|
| 285 | 312 | $directiveValues['error_reporting']['current'] = implode(' | ', $errorReporting); |
| 286 | 313 | |
| 287 | 314 | return $directiveValues; |
@@ -335,16 +362,18 @@ discard block |
||
| 335 | 362 | E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', |
| 336 | 363 | E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING', |
| 337 | 364 | E_USER_NOTICE => 'E_USER_NOTICE'); |
| 338 | - if (defined('E_STRICT')) |
|
| 339 | - $level_names[E_STRICT] = 'E_STRICT'; |
|
| 365 | + if (defined('E_STRICT')) { |
|
| 366 | + $level_names[E_STRICT] = 'E_STRICT'; |
|
| 367 | + } |
|
| 340 | 368 | $levels = array(); |
| 341 | 369 | if (($value & E_ALL) == E_ALL) { |
| 342 | 370 | $levels[] = 'E_ALL'; |
| 343 | 371 | $value&=~E_ALL; |
| 344 | 372 | } |
| 345 | - foreach ($level_names as $level => $name) |
|
| 346 | - if (($value & $level) == $level) |
|
| 373 | + foreach ($level_names as $level => $name) { |
|
| 374 | + if (($value & $level) == $level) |
|
| 347 | 375 | $levels[] = $name; |
| 376 | + } |
|
| 348 | 377 | return $levels; |
| 349 | 378 | } |
| 350 | 379 | } |
@@ -303,6 +303,9 @@ |
||
| 303 | 303 | return array_merge($mainFolderFiles, $moduleFolderFiles); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | + /** |
|
| 307 | + * @param string|boolean $prefix |
|
| 308 | + */ |
|
| 306 | 309 | public function listFolderFiles($dir, $prefix) |
| 307 | 310 | { |
| 308 | 311 | $ffs = scandir($dir); |
@@ -131,8 +131,9 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | public static function getListBaseModuleField($baseModule) |
| 133 | 133 | { |
| 134 | - if ($baseModule === 'All') |
|
| 135 | - return $baseModule; |
|
| 134 | + if ($baseModule === 'All') { |
|
| 135 | + return $baseModule; |
|
| 136 | + } |
|
| 136 | 137 | $baseModuleModel = Vtiger_Module_Model::getInstance($baseModule); |
| 137 | 138 | $list = $baseModuleModel->getFields(); |
| 138 | 139 | $output = array(); |
@@ -276,10 +277,11 @@ discard block |
||
| 276 | 277 | public function getActionName($name, $typ) |
| 277 | 278 | { |
| 278 | 279 | $actionsName = explode(self::$separator, $name); |
| 279 | - if ($typ) |
|
| 280 | - return vtranslate('Action_' . $actionsName[1], 'DataAccess'); |
|
| 281 | - else |
|
| 282 | - return vtranslate('Action_Desc_' . $actionsName[1], 'DataAccess'); |
|
| 280 | + if ($typ) { |
|
| 281 | + return vtranslate('Action_' . $actionsName[1], 'DataAccess'); |
|
| 282 | + } else { |
|
| 283 | + return vtranslate('Action_Desc_' . $actionsName[1], 'DataAccess'); |
|
| 284 | + } |
|
| 283 | 285 | } |
| 284 | 286 | |
| 285 | 287 | public function listAccesDataDirector($module = false) |
@@ -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) |
@@ -154,7 +154,6 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** Gives an array which contains the information for what all roles, groups and user data is to be shared with the spcified user for the specified module |
| 157 | - |
|
| 158 | 157 | * @param $module -- module name:: Type varchar |
| 159 | 158 | * @param $userid -- user id:: Type integer |
| 160 | 159 | * @param $def_org_share -- default organization sharing permission array:: Type array |
@@ -937,7 +936,6 @@ discard block |
||
| 937 | 936 | } |
| 938 | 937 | |
| 939 | 938 | /** 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 | - |
|
| 941 | 939 | * @param $par_mod -- parent module name:: Type varchar |
| 942 | 940 | * @param $share_mod -- shared module name:: Type varchar |
| 943 | 941 | * @param $userid -- user id:: Type integer |
@@ -1097,7 +1095,6 @@ discard block |
||
| 1097 | 1095 | } |
| 1098 | 1096 | |
| 1099 | 1097 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1100 | - |
|
| 1101 | 1098 | * @param $var -- input array:: Type array |
| 1102 | 1099 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1103 | 1100 | */ |
@@ -1114,7 +1111,6 @@ discard block |
||
| 1114 | 1111 | } |
| 1115 | 1112 | |
| 1116 | 1113 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1117 | - |
|
| 1118 | 1114 | * @param $var -- input array:: Type array |
| 1119 | 1115 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1120 | 1116 | */ |
@@ -1139,7 +1135,6 @@ discard block |
||
| 1139 | 1135 | } |
| 1140 | 1136 | |
| 1141 | 1137 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1142 | - |
|
| 1143 | 1138 | * @param $var -- input array:: Type array |
| 1144 | 1139 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1145 | 1140 | */ |
@@ -1164,7 +1159,6 @@ discard block |
||
| 1164 | 1159 | } |
| 1165 | 1160 | |
| 1166 | 1161 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1167 | - |
|
| 1168 | 1162 | * @param $var -- input array:: Type array |
| 1169 | 1163 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1170 | 1164 | */ |
@@ -1191,7 +1185,6 @@ discard block |
||
| 1191 | 1185 | } |
| 1192 | 1186 | |
| 1193 | 1187 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1194 | - |
|
| 1195 | 1188 | * @param $var -- input array:: Type array |
| 1196 | 1189 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1197 | 1190 | */ |
@@ -1208,7 +1201,6 @@ discard block |
||
| 1208 | 1201 | } |
| 1209 | 1202 | |
| 1210 | 1203 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1211 | - |
|
| 1212 | 1204 | * @param $var -- input array:: Type array |
| 1213 | 1205 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1214 | 1206 | */ |
@@ -1225,7 +1217,6 @@ discard block |
||
| 1225 | 1217 | } |
| 1226 | 1218 | |
| 1227 | 1219 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1228 | - |
|
| 1229 | 1220 | * @param $var -- input array:: Type array |
| 1230 | 1221 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1231 | 1222 | */ |
@@ -1246,7 +1237,6 @@ discard block |
||
| 1246 | 1237 | } |
| 1247 | 1238 | |
| 1248 | 1239 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1249 | - |
|
| 1250 | 1240 | * @param $var -- input array:: Type array |
| 1251 | 1241 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1252 | 1242 | */ |
@@ -1267,7 +1257,6 @@ discard block |
||
| 1267 | 1257 | } |
| 1268 | 1258 | |
| 1269 | 1259 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1270 | - |
|
| 1271 | 1260 | * @param $var -- input array:: Type array |
| 1272 | 1261 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1273 | 1262 | */ |
@@ -1288,7 +1277,6 @@ discard block |
||
| 1288 | 1277 | } |
| 1289 | 1278 | |
| 1290 | 1279 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 1291 | - |
|
| 1292 | 1280 | * @param $var -- input array:: Type array |
| 1293 | 1281 | * @returns $code -- contains the whole array in a single string:: Type array |
| 1294 | 1282 | */ |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | if ($handle) { |
| 27 | 27 | $newbuf = ''; |
| 28 | - $newbuf .="<?php\n"; |
|
| 28 | + $newbuf .= "<?php\n"; |
|
| 29 | 29 | $user_focus = CRMEntity::getInstance('Users'); |
| 30 | 30 | $user_focus->retrieve_entity_info($userid, 'Users'); |
| 31 | 31 | $userInfo = []; |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | if (is_array($var)) { |
| 1218 | 1218 | $code = '['; |
| 1219 | 1219 | foreach ($var as $value) { |
| 1220 | - $code .="'" . $value . "',"; |
|
| 1220 | + $code .= "'" . $value . "',"; |
|
| 1221 | 1221 | } |
| 1222 | 1222 | $code .= ']'; |
| 1223 | 1223 | return $code; |
@@ -257,8 +257,9 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | //Get roles from Role2Grp |
| 259 | 259 | $groupList = $current_user_groups; |
| 260 | - if (empty($groupList)) |
|
| 261 | - $groupList = array(0); |
|
| 260 | + if (empty($groupList)) { |
|
| 261 | + $groupList = array(0); |
|
| 262 | + } |
|
| 262 | 263 | |
| 263 | 264 | if (!empty($groupList)) { |
| 264 | 265 | $query = "select vtiger_datashare_role2group.* from vtiger_datashare_role2group inner join vtiger_datashare_module_rel on vtiger_datashare_module_rel.shareid=vtiger_datashare_role2group.shareid where vtiger_datashare_module_rel.tabid=?"; |
@@ -1379,8 +1380,9 @@ discard block |
||
| 1379 | 1380 | $var_name = $module . '_share_write_permission'; |
| 1380 | 1381 | } |
| 1381 | 1382 | // Lookup for the variable if not set through function argument |
| 1382 | - if (!$var_name_arr) |
|
| 1383 | - $var_name_arr = $$var_name; |
|
| 1383 | + if (!$var_name_arr) { |
|
| 1384 | + $var_name_arr = $$var_name; |
|
| 1385 | + } |
|
| 1384 | 1386 | $user_arr = []; |
| 1385 | 1387 | if (sizeof($var_name_arr['ROLE']) > 0) { |
| 1386 | 1388 | foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) { |
@@ -1414,8 +1416,9 @@ discard block |
||
| 1414 | 1416 | $var_name = $module . '_share_write_permission'; |
| 1415 | 1417 | } |
| 1416 | 1418 | // Lookup for the variable if not set through function argument |
| 1417 | - if (!$var_name_arr) |
|
| 1418 | - $var_name_arr = $$var_name; |
|
| 1419 | + if (!$var_name_arr) { |
|
| 1420 | + $var_name_arr = $$var_name; |
|
| 1421 | + } |
|
| 1419 | 1422 | $grp_arr = []; |
| 1420 | 1423 | if (sizeof($var_name_arr['GROUP']) > 0) { |
| 1421 | 1424 | |
@@ -1458,8 +1461,9 @@ discard block |
||
| 1458 | 1461 | $var_name = $module . '_' . $relmodule . '_share_write_permission'; |
| 1459 | 1462 | } |
| 1460 | 1463 | // Lookup for the variable if not set through function argument |
| 1461 | - if (!$var_name_arr) |
|
| 1462 | - $var_name_arr = $$var_name; |
|
| 1464 | + if (!$var_name_arr) { |
|
| 1465 | + $var_name_arr = $$var_name; |
|
| 1466 | + } |
|
| 1463 | 1467 | $user_arr = []; |
| 1464 | 1468 | if (sizeof($var_name_arr['ROLE']) > 0) { |
| 1465 | 1469 | foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) { |
@@ -1493,8 +1497,9 @@ discard block |
||
| 1493 | 1497 | $var_name = $module . '_' . $relmodule . '_share_write_permission'; |
| 1494 | 1498 | } |
| 1495 | 1499 | // Lookup for the variable if not set through function argument |
| 1496 | - if (!$var_name_arr) |
|
| 1497 | - $var_name_arr = $$var_name; |
|
| 1500 | + if (!$var_name_arr) { |
|
| 1501 | + $var_name_arr = $$var_name; |
|
| 1502 | + } |
|
| 1498 | 1503 | $grp_arr = []; |
| 1499 | 1504 | if (sizeof($var_name_arr['GROUP']) > 0) { |
| 1500 | 1505 | |
@@ -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(); |