@@ -18,13 +18,13 @@ |
||
18 | 18 | |
19 | 19 | protected function generateConfigProtected(): void |
20 | 20 | { |
21 | - $conf = "[general]\n" . |
|
22 | - "enable=yes\n" . |
|
23 | - "unanswered=yes\n\n" . |
|
24 | - "[sqlite]\n" . |
|
25 | - "usegmtime=no\n" . |
|
26 | - "loguniqueid=yes\n" . |
|
21 | + $conf = "[general]\n". |
|
22 | + "enable=yes\n". |
|
23 | + "unanswered=yes\n\n". |
|
24 | + "[sqlite]\n". |
|
25 | + "usegmtime=no\n". |
|
26 | + "loguniqueid=yes\n". |
|
27 | 27 | "loguserfield=yes\n"; |
28 | - file_put_contents($this->config->path('asterisk.astetcdir') . '/cdr.conf', $conf); |
|
28 | + file_put_contents($this->config->path('asterisk.astetcdir').'/cdr.conf', $conf); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -19,10 +19,10 @@ |
||
19 | 19 | |
20 | 20 | protected function generateConfigProtected(): void |
21 | 21 | { |
22 | - $conf = "[general]\n" . |
|
23 | - "rtpstart={$this->generalSettings['RTPPortFrom']}\n" . |
|
22 | + $conf = "[general]\n". |
|
23 | + "rtpstart={$this->generalSettings['RTPPortFrom']}\n". |
|
24 | 24 | "rtpend={$this->generalSettings['RTPPortTo']}\n\n"; |
25 | 25 | |
26 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/rtp.conf', $conf); |
|
26 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/rtp.conf', $conf); |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -19,6 +19,6 @@ |
||
19 | 19 | protected function generateConfigProtected(): void |
20 | 20 | { |
21 | 21 | $conf = ''; |
22 | - file_put_contents($this->config->path('asterisk.astetcdir') . '/queuerules.conf', $conf); |
|
22 | + file_put_contents($this->config->path('asterisk.astetcdir').'/queuerules.conf', $conf); |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -29,12 +29,12 @@ |
||
29 | 29 | { |
30 | 30 | $this->module_name = $module_name; |
31 | 31 | $this->debug = true; |
32 | - $logPath = System::getLogDir() . '/' . $this->module_name . '/'; |
|
33 | - if (!is_dir($logPath)){ |
|
32 | + $logPath = System::getLogDir().'/'.$this->module_name.'/'; |
|
33 | + if (!is_dir($logPath)) { |
|
34 | 34 | Util::mwMkdir($logPath); |
35 | 35 | Util::addRegularWWWRights($logPath); |
36 | 36 | } |
37 | - $logFile = $logPath . $class . '.log'; |
|
37 | + $logFile = $logPath.$class.'.log'; |
|
38 | 38 | $adapter = new FileLogger($logFile); |
39 | 39 | $this->logger = new \Phalcon\Logger( |
40 | 40 | 'messages', |
@@ -60,7 +60,7 @@ |
||
60 | 60 | public function callback($parameters): void |
61 | 61 | { |
62 | 62 | if ($this->replyOnPingRequest($parameters)){ |
63 | - return; |
|
63 | + return; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ('CdrConnector' !== $parameters['UserEvent']) { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | protected BeanstalkClient $client; |
19 | 19 | |
20 | 20 | protected AsteriskManager $am; |
21 | - protected int $maxProc=1; |
|
21 | + protected int $maxProc = 1; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Установка фильтра |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function callback($parameters): void |
64 | 64 | { |
65 | - if ($this->replyOnPingRequest($parameters)){ |
|
65 | + if ($this->replyOnPingRequest($parameters)) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($message_is_sent === false) { |
104 | - Util::sysLogMsg('CDR_AMI_Connector', "Error send data to queue. " . $error); |
|
104 | + Util::sysLogMsg('CDR_AMI_Connector', "Error send data to queue. ".$error); |
|
105 | 105 | } |
106 | 106 | // Логируем оповещение. |
107 | 107 | Util::logMsgDb('WorkerCallEvents::class', json_decode($result, true)); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | if ($extension) { |
26 | 26 | $result = false; |
27 | 27 | } |
28 | - $this->view->emailAvailable=$result; |
|
28 | + $this->view->emailAvailable = $result; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -13,7 +13,8 @@ |
||
13 | 13 | |
14 | 14 | |
15 | 15 | |
16 | -class UsersController extends BaseController { |
|
16 | +class UsersController extends BaseController |
|
17 | +{ |
|
17 | 18 | |
18 | 19 | /** |
19 | 20 | * Проверка на доступность емейл адреса |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $variable = str_replace(':', '', $variable); |
74 | 74 | $statement = str_replace(":$variable", "'$value'", $statement); |
75 | 75 | $statement = preg_replace('/= \?/', " = '{$value}'", $statement, 1); |
76 | - // $statement = preg_replace('/\?/', " = '{$value}'", $statement, 1); |
|
76 | + // $statement = preg_replace('/\?/', " = '{$value}'", $statement, 1); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | $logger->debug($statement); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | { |
42 | 42 | $di->setShared( |
43 | 43 | $serviceName, |
44 | - function () use ($dbConfig) { |
|
45 | - $dbclass = 'Phalcon\Db\Adapter\Pdo\\' . $dbConfig['adapter']; |
|
44 | + function() use ($dbConfig) { |
|
45 | + $dbclass = 'Phalcon\Db\Adapter\Pdo\\'.$dbConfig['adapter']; |
|
46 | 46 | |
47 | 47 | $folderWithDB = dirname($dbConfig['dbfile']); |
48 | - if (!is_dir($folderWithDB)){ |
|
48 | + if (!is_dir($folderWithDB)) { |
|
49 | 49 | Util::mwMkdir($folderWithDB, true); |
50 | 50 | } |
51 | 51 | |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | // Слушаем все события базы данных |
68 | 68 | $eventsManager->attach( |
69 | 69 | 'db', |
70 | - function ($event, $connection) use ($logger) { |
|
70 | + function($event, $connection) use ($logger) { |
|
71 | 71 | if ($event->getType() === 'beforeQuery') { |
72 | 72 | $statement = $connection->getSQLStatement(); |
73 | 73 | $variables = $connection->getSqlVariables(); |
74 | 74 | if (is_array($variables)) { |
75 | 75 | foreach ($variables as $variable => $value) { |
76 | 76 | if (is_array($value)) { |
77 | - $value = '(' . implode(', ', $value) . ')'; |
|
77 | + $value = '('.implode(', ', $value).')'; |
|
78 | 78 | } |
79 | 79 | $variable = str_replace(':', '', $variable); |
80 | 80 | $statement = str_replace(":$variable", "'$value'", $statement); |
@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | { |
42 | 42 | $di->setShared( |
43 | 43 | $serviceName, |
44 | - function () use ($dbConfig) { |
|
44 | + function () use ($dbConfig) |
|
45 | + { |
|
45 | 46 | $dbclass = 'Phalcon\Db\Adapter\Pdo\\' . $dbConfig['adapter']; |
46 | 47 | |
47 | 48 | $folderWithDB = dirname($dbConfig['dbfile']); |
@@ -67,7 +68,8 @@ discard block |
||
67 | 68 | // Слушаем все события базы данных |
68 | 69 | $eventsManager->attach( |
69 | 70 | 'db', |
70 | - function ($event, $connection) use ($logger) { |
|
71 | + function ($event, $connection) use ($logger) |
|
72 | + { |
|
71 | 73 | if ($event->getType() === 'beforeQuery') { |
72 | 74 | $statement = $connection->getSQLStatement(); |
73 | 75 | $variables = $connection->getSqlVariables(); |
@@ -194,7 +194,7 @@ |
||
194 | 194 | . '= :field' |
195 | 195 | . $index . ':'; |
196 | 196 | $bindField |
197 | - = $mappedFields[$index]; |
|
197 | + = $mappedFields[$index]; |
|
198 | 198 | $parameters['bind']['field' . $index] = $currentDeleteRecord->$bindField; |
199 | 199 | } |
200 | 200 | $relatedRecords = $relatedModel::find($parameters); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $moduleDir = PbxExtensionUtils::getModuleDir($module['uniqid']); |
71 | 71 | |
72 | 72 | $moduleJson = "{$moduleDir}/module.json"; |
73 | - if ( ! file_exists($moduleJson)) { |
|
73 | + if (!file_exists($moduleJson)) { |
|
74 | 74 | continue; |
75 | 75 | } |
76 | 76 | $jsonString = file_get_contents($moduleJson); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $moduleModelsDir = "{$moduleDir}/Models"; |
84 | - $results = glob($moduleModelsDir . '/*.php', GLOB_NOSORT); |
|
84 | + $results = glob($moduleModelsDir.'/*.php', GLOB_NOSORT); |
|
85 | 85 | foreach ($results as $file) { |
86 | 86 | $className = pathinfo($file)['filename']; |
87 | 87 | $moduleModelClass = "\\Modules\\{$module['uniqid']}\\Models\\{$className}"; |
@@ -116,16 +116,16 @@ discard block |
||
116 | 116 | $newErrorMessage = $this->t('ConstraintViolation'); |
117 | 117 | $newErrorMessage .= "<ul class='list'>"; |
118 | 118 | if ($relatedRecords === false) { |
119 | - throw new Model\Exception('Error on models relationship ' . $errorMessage); |
|
119 | + throw new Model\Exception('Error on models relationship '.$errorMessage); |
|
120 | 120 | } |
121 | 121 | if ($relatedRecords instanceof Resultset) { |
122 | 122 | foreach ($relatedRecords as $item) { |
123 | 123 | if ($item instanceof ModelsBase) { |
124 | - $newErrorMessage .= '<li>' . $item->getRepresent(true) . '</li>'; |
|
124 | + $newErrorMessage .= '<li>'.$item->getRepresent(true).'</li>'; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | } elseif ($relatedRecords instanceof ModelsBase) { |
128 | - $newErrorMessage .= '<li>' . $relatedRecords->getRepresent(true) . '</li>'; |
|
128 | + $newErrorMessage .= '<li>'.$relatedRecords->getRepresent(true).'</li>'; |
|
129 | 129 | } else { |
130 | 130 | $newErrorMessage .= '<li>Unknown object</li>'; |
131 | 131 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if (empty($this->id)) { |
177 | 177 | $name .= $this->t('mo_NewElementCallQueues'); |
178 | 178 | } else { |
179 | - $name .= $this->t('mo_CallQueueShort4Dropdown') . ': ' . $this->name; |
|
179 | + $name .= $this->t('mo_CallQueueShort4Dropdown').': '.$this->name; |
|
180 | 180 | } |
181 | 181 | break; |
182 | 182 | case ConferenceRooms::class: |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | if (empty($this->id)) { |
185 | 185 | $name .= $this->t('mo_NewElementConferenceRooms'); |
186 | 186 | } else { |
187 | - $name .= $this->t('mo_ConferenceRoomsShort4Dropdown') . ': ' . $this->name; |
|
187 | + $name .= $this->t('mo_ConferenceRoomsShort4Dropdown').': '.$this->name; |
|
188 | 188 | } |
189 | 189 | break; |
190 | 190 | case CustomFiles::class: |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | if (empty($this->id)) { |
196 | 196 | $name .= $this->t('mo_NewElementDialplanApplications'); |
197 | 197 | } else { |
198 | - $name .= $this->t('mo_ApplicationShort4Dropdown') . ': ' . $this->name; |
|
198 | + $name .= $this->t('mo_ApplicationShort4Dropdown').': '.$this->name; |
|
199 | 199 | } |
200 | 200 | break; |
201 | 201 | case ExtensionForwardingRights::class: |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if (empty($this->id)) { |
258 | 258 | $name .= $this->t('mo_NewElementIax'); |
259 | 259 | } elseif ($this->disabled === '1') { |
260 | - $name .= "{$this->description} ({$this->t( 'mo_Disabled' )})"; |
|
260 | + $name .= "{$this->description} ({$this->t('mo_Disabled')})"; |
|
261 | 261 | } else { |
262 | 262 | $name .= $this->description; |
263 | 263 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | if (empty($this->id)) { |
268 | 268 | $name .= $this->t('mo_NewElementIvrMenu'); |
269 | 269 | } else { |
270 | - $name .= $this->t('mo_IVRMenuShort4Dropdown') . ': ' . $this->name; |
|
270 | + $name .= $this->t('mo_IVRMenuShort4Dropdown').': '.$this->name; |
|
271 | 271 | } |
272 | 272 | break; |
273 | 273 | case IvrMenuActions::class: |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $name = '<i class="map signs icon"></i> '; |
281 | 281 | if (empty($this->id)) { |
282 | 282 | $name .= $this->t('mo_NewElementIncomingRoutingTable'); |
283 | - } elseif ( ! empty($this->note)) { |
|
283 | + } elseif (!empty($this->note)) { |
|
284 | 284 | $name .= $this->t('repIncomingRoutingTable', ['represent' => $this->note]); |
285 | 285 | } else { |
286 | 286 | $name .= $this->t('repIncomingRoutingTableNumber', ['represent' => $this->id]); |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | if (empty($this->id)) { |
296 | 296 | $name .= $this->t('mo_NewElementNetworkFilters'); |
297 | 297 | } else { |
298 | - $name .= $this->description . '(' |
|
299 | - . $this->t('fw_PermitNetwork') . ': ' . $this->permit |
|
298 | + $name .= $this->description.'(' |
|
299 | + . $this->t('fw_PermitNetwork').': '.$this->permit |
|
300 | 300 | . ')'; |
301 | 301 | } |
302 | 302 | break; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $name = '<i class="random icon"></i> '; |
305 | 305 | if (empty($this->id)) { |
306 | 306 | $name .= $this->t('mo_NewElementOutgoingRoutingTable'); |
307 | - } elseif ( ! empty($this->rulename)) { |
|
307 | + } elseif (!empty($this->rulename)) { |
|
308 | 308 | $name .= $this->t('repOutgoingRoutingTable', ['represent' => $this->rulename]); |
309 | 309 | } else { |
310 | 310 | $name .= $this->t('repOutgoingRoutingTableNumber', ['represent' => $this->id]); |
@@ -314,24 +314,24 @@ discard block |
||
314 | 314 | $name = '<i class="time icon"></i> '; |
315 | 315 | if (empty($this->id)) { |
316 | 316 | $name .= $this->t('mo_NewElementOutWorkTimes'); |
317 | - } elseif ( ! empty($this->description)) { |
|
317 | + } elseif (!empty($this->description)) { |
|
318 | 318 | $name .= $this->t('repOutWorkTimes', ['represent' => $this->description]); |
319 | 319 | } else { |
320 | 320 | $represent = ''; |
321 | 321 | if (is_numeric($this->date_from)) { |
322 | - $represent .= date("d/m/Y", $this->date_from) . '-'; |
|
322 | + $represent .= date("d/m/Y", $this->date_from).'-'; |
|
323 | 323 | } |
324 | 324 | if (is_numeric($this->date_to)) { |
325 | - $represent .= date("d/m/Y", $this->date_to) . ' '; |
|
325 | + $represent .= date("d/m/Y", $this->date_to).' '; |
|
326 | 326 | } |
327 | 327 | if (isset($this->weekday_from)) { |
328 | - $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_from} days"))) . '-'; |
|
328 | + $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_from} days"))).'-'; |
|
329 | 329 | } |
330 | 330 | if (isset($this->weekday_to)) { |
331 | - $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_to} days"))) . ' '; |
|
331 | + $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_to} days"))).' '; |
|
332 | 332 | } |
333 | 333 | if (isset($this->time_from) || isset($this->time_to)) { |
334 | - $represent .= $this->time_from . ' - ' . $this->time_to . ' '; |
|
334 | + $represent .= $this->time_from.' - '.$this->time_to.' '; |
|
335 | 335 | } |
336 | 336 | $name .= $this->t('repOutWorkTimes', ['represent' => $represent]); |
337 | 337 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | break; |
349 | 349 | case PbxExtensionModules::class: |
350 | 350 | $name = '<i class="puzzle piece icon"></i> ' |
351 | - . $this->t('mo_ModuleShort4Dropdown') . ': ' |
|
351 | + . $this->t('mo_ModuleShort4Dropdown').': ' |
|
352 | 352 | . $this->name; |
353 | 353 | break; |
354 | 354 | case Sip::class: |
@@ -356,14 +356,14 @@ discard block |
||
356 | 356 | if (empty($this->id)) { |
357 | 357 | $name .= $this->t('mo_NewElementSip'); |
358 | 358 | } elseif ($this->disabled === '1') { |
359 | - $name .= "{$this->description} ({$this->t( 'mo_Disabled' )})"; |
|
359 | + $name .= "{$this->description} ({$this->t('mo_Disabled')})"; |
|
360 | 360 | } else { |
361 | 361 | $name .= $this->description; |
362 | 362 | } |
363 | 363 | |
364 | 364 | break; |
365 | 365 | case Users::class: |
366 | - $name = '<i class="user outline icon"></i> ' . $this->username; |
|
366 | + $name = '<i class="user outline icon"></i> '.$this->username; |
|
367 | 367 | break; |
368 | 368 | case SoundFiles::class: |
369 | 369 | $name = '<i class="file audio outline icon"></i> '; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | $link = $this->getWebInterfaceLink(); |
383 | 383 | $category = explode('\\', static::class)[3]; |
384 | 384 | $result = $this->t( |
385 | - 'rep' . $category, |
|
385 | + 'rep'.$category, |
|
386 | 386 | [ |
387 | 387 | 'represent' => "<a href='{$link}'>{$name}</a>", |
388 | 388 | ] |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | |
408 | 408 | if (strlen($s) > $max_length) { |
409 | 409 | $offset = ($max_length - 3) - strlen($s); |
410 | - $s = substr($s, 0, strrpos($s, ' ', $offset)) . '...'; |
|
410 | + $s = substr($s, 0, strrpos($s, ' ', $offset)).'...'; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | return $s; |
@@ -426,80 +426,80 @@ discard block |
||
426 | 426 | $link = '#'; |
427 | 427 | switch (static::class) { |
428 | 428 | case AsteriskManagerUsers::class: |
429 | - $link = $url->get('asterisk-managers/modify/' . $this->id, null, null, $baseUri); |
|
429 | + $link = $url->get('asterisk-managers/modify/'.$this->id, null, null, $baseUri); |
|
430 | 430 | break; |
431 | 431 | case CallQueueMembers::class: |
432 | - $link = $url->get('call-queues/modify/' . $this->CallQueues->uniqid, null, null, $baseUri); |
|
432 | + $link = $url->get('call-queues/modify/'.$this->CallQueues->uniqid, null, null, $baseUri); |
|
433 | 433 | break; |
434 | 434 | case CallQueues::class: |
435 | - $link = $url->get('call-queues/modify/' . $this->uniqid, null, null, $baseUri); |
|
435 | + $link = $url->get('call-queues/modify/'.$this->uniqid, null, null, $baseUri); |
|
436 | 436 | break; |
437 | 437 | case ConferenceRooms::class: |
438 | - $link = $url->get('conference-rooms/modify/' . $this->uniqid, null, null, $baseUri); |
|
438 | + $link = $url->get('conference-rooms/modify/'.$this->uniqid, null, null, $baseUri); |
|
439 | 439 | break; |
440 | 440 | case CustomFiles::class: |
441 | - $link = $url->get('custom-files/modify/' . $this->id, null, null, $baseUri); |
|
441 | + $link = $url->get('custom-files/modify/'.$this->id, null, null, $baseUri); |
|
442 | 442 | break; |
443 | 443 | case DialplanApplications::class: |
444 | - $link = $url->get('dialplan-applications/modify/' . $this->uniqid, null, null, $baseUri); |
|
444 | + $link = $url->get('dialplan-applications/modify/'.$this->uniqid, null, null, $baseUri); |
|
445 | 445 | break; |
446 | 446 | case ExtensionForwardingRights::class: |
447 | 447 | |
448 | 448 | break; |
449 | 449 | case Extensions::class: |
450 | - $link = $url->get('extensions/modify/' . $this->id, null, null, $baseUri); |
|
450 | + $link = $url->get('extensions/modify/'.$this->id, null, null, $baseUri); |
|
451 | 451 | break; |
452 | 452 | case ExternalPhones::class: |
453 | 453 | if ($this->Extensions->is_general_user_number === "1") { |
454 | - $parameters = [ |
|
455 | - 'conditions' => 'is_general_user_number="1" AND type="' . Extensions::TYPE_EXTERNAL . '" AND userid=:userid:', |
|
454 | + $parameters = [ |
|
455 | + 'conditions' => 'is_general_user_number="1" AND type="'.Extensions::TYPE_EXTERNAL.'" AND userid=:userid:', |
|
456 | 456 | 'bind' => [ |
457 | 457 | 'userid' => $this->Extensions->userid, |
458 | 458 | ], |
459 | 459 | ]; |
460 | 460 | $needExtension = Extensions::findFirst($parameters); |
461 | - $link = $url->get('extensions/modify/' . $needExtension->id, null, null, $baseUri); |
|
461 | + $link = $url->get('extensions/modify/'.$needExtension->id, null, null, $baseUri); |
|
462 | 462 | } else { |
463 | - $link = '#';//TODO сделать если будет раздел для допоплнинельных номеров пользователя |
|
463 | + $link = '#'; //TODO сделать если будет раздел для допоплнинельных номеров пользователя |
|
464 | 464 | } |
465 | 465 | break; |
466 | 466 | case Fail2BanRules::class: |
467 | - $link = '#';//TODO сделать если будет fail2ban |
|
467 | + $link = '#'; //TODO сделать если будет fail2ban |
|
468 | 468 | break; |
469 | 469 | case FirewallRules::class: |
470 | - $link = $url->get('firewall/modify/' . $this->NetworkFilters->id, null, null, $baseUri); |
|
470 | + $link = $url->get('firewall/modify/'.$this->NetworkFilters->id, null, null, $baseUri); |
|
471 | 471 | break; |
472 | 472 | case Iax::class: |
473 | - $link = $url->get('providers/modifyiax/' . $this->Providers->id, null, null, $baseUri); |
|
473 | + $link = $url->get('providers/modifyiax/'.$this->Providers->id, null, null, $baseUri); |
|
474 | 474 | break; |
475 | 475 | case IvrMenu::class: |
476 | - $link = $url->get('ivr-menu/modify/' . $this->uniqid, null, null, $baseUri); |
|
476 | + $link = $url->get('ivr-menu/modify/'.$this->uniqid, null, null, $baseUri); |
|
477 | 477 | break; |
478 | 478 | case IvrMenuActions::class: |
479 | - $link = $url->get('ivr-menu/modify/' . $this->IvrMenu->uniqid, null, null, $baseUri); |
|
479 | + $link = $url->get('ivr-menu/modify/'.$this->IvrMenu->uniqid, null, null, $baseUri); |
|
480 | 480 | break; |
481 | 481 | case Codecs::class: |
482 | 482 | break; |
483 | 483 | case IncomingRoutingTable::class: |
484 | - $link = $url->get('incoming-routes/modify/' . $this->id, null, null, $baseUri); |
|
484 | + $link = $url->get('incoming-routes/modify/'.$this->id, null, null, $baseUri); |
|
485 | 485 | break; |
486 | 486 | case LanInterfaces::class: |
487 | 487 | $link = $url->get('network/index/', null, null, $baseUri); |
488 | 488 | break; |
489 | 489 | case NetworkFilters::class: |
490 | - $link = $url->get('firewall/modify/' . $this->id, null, null, $baseUri); |
|
490 | + $link = $url->get('firewall/modify/'.$this->id, null, null, $baseUri); |
|
491 | 491 | break; |
492 | 492 | case OutgoingRoutingTable::class: |
493 | - $link = $url->get('outbound-routes/modify/' . $this->id, null, null, $baseUri); |
|
493 | + $link = $url->get('outbound-routes/modify/'.$this->id, null, null, $baseUri); |
|
494 | 494 | break; |
495 | 495 | case OutWorkTimes::class: |
496 | - $link = $url->get('out-off-work-time/modify/' . $this->id, null, null, $baseUri); |
|
496 | + $link = $url->get('out-off-work-time/modify/'.$this->id, null, null, $baseUri); |
|
497 | 497 | break; |
498 | 498 | case Providers::class: |
499 | 499 | if ($this->type === "IAX") { |
500 | - $link = $url->get('providers/modifyiax/' . $this->uniqid, null, null, $baseUri); |
|
500 | + $link = $url->get('providers/modifyiax/'.$this->uniqid, null, null, $baseUri); |
|
501 | 501 | } else { |
502 | - $link = $url->get('providers/modifysip/' . $this->uniqid, null, null, $baseUri); |
|
502 | + $link = $url->get('providers/modifysip/'.$this->uniqid, null, null, $baseUri); |
|
503 | 503 | } |
504 | 504 | break; |
505 | 505 | case PbxSettings::class: |
@@ -511,26 +511,26 @@ discard block |
||
511 | 511 | case Sip::class: |
512 | 512 | if ($this->Extensions) { // Это внутренний номер? |
513 | 513 | if ($this->Extensions->is_general_user_number === "1") { |
514 | - $link = $url->get('extensions/modify/' . $this->Extensions->id, null, null, $baseUri); |
|
514 | + $link = $url->get('extensions/modify/'.$this->Extensions->id, null, null, $baseUri); |
|
515 | 515 | } else { |
516 | - $link = '#';//TODO сделать если будет раздел для допоплнинельных номеров пользователя |
|
516 | + $link = '#'; //TODO сделать если будет раздел для допоплнинельных номеров пользователя |
|
517 | 517 | } |
518 | 518 | } elseif ($this->Providers) { // Это провайдер |
519 | - $link = $url->get('providers/modifysip/' . $this->Providers->id, null, null, $baseUri); |
|
519 | + $link = $url->get('providers/modifysip/'.$this->Providers->id, null, null, $baseUri); |
|
520 | 520 | } |
521 | 521 | break; |
522 | 522 | case Users::class: |
523 | - $parameters = [ |
|
523 | + $parameters = [ |
|
524 | 524 | 'conditions' => 'userid=:userid:', |
525 | 525 | 'bind' => [ |
526 | 526 | 'userid' => $this->id, |
527 | 527 | ], |
528 | 528 | ]; |
529 | 529 | $needExtension = Extensions::findFirst($parameters); |
530 | - $link = $url->get('extensions/modify/' . $needExtension->id, null, null, $baseUri); |
|
530 | + $link = $url->get('extensions/modify/'.$needExtension->id, null, null, $baseUri); |
|
531 | 531 | break; |
532 | 532 | case SoundFiles::class: |
533 | - $link = $url->get('sound-files/modify/' . $this->id, null, null, $baseUri); |
|
533 | + $link = $url->get('sound-files/modify/'.$this->id, null, null, $baseUri); |
|
534 | 534 | break; |
535 | 535 | default: |
536 | 536 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $metaData = $this->di->get('modelsMetadata'); |
547 | 547 | $defaultValues = $metaData->getDefaultValues($this); |
548 | 548 | foreach ($defaultValues as $field => $value) { |
549 | - if ( ! isset($this->{$field})) { |
|
549 | + if (!isset($this->{$field})) { |
|
550 | 550 | $this->{$field} = $value; |
551 | 551 | } |
552 | 552 | } |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | = $currentDeleteRecord->_modelsManager->getRelations(get_class($currentDeleteRecord)); |
681 | 681 | foreach ($relations as $relation) { |
682 | 682 | $foreignKey = $relation->getOption('foreignKey'); |
683 | - if ( ! array_key_exists('action', $foreignKey)) { |
|
683 | + if (!array_key_exists('action', $foreignKey)) { |
|
684 | 684 | continue; |
685 | 685 | } |
686 | 686 | // Check if there are some record which restrict delete current record |
@@ -698,10 +698,10 @@ discard block |
||
698 | 698 | ? ' OR ' : ''; |
699 | 699 | $parameters['conditions'] .= $referencedField |
700 | 700 | . '= :field' |
701 | - . $index . ':'; |
|
701 | + . $index.':'; |
|
702 | 702 | $bindField |
703 | 703 | = $mappedFields[$index]; |
704 | - $parameters['bind']['field' . $index] = $currentDeleteRecord->$bindField; |
|
704 | + $parameters['bind']['field'.$index] = $currentDeleteRecord->$bindField; |
|
705 | 705 | } |
706 | 706 | $relatedRecords = $relatedModel::find($parameters); |
707 | 707 | switch ($foreignKey['action']) { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | if (php_sapi_name() === 'cli') { |
776 | 776 | return; |
777 | 777 | } |
778 | - if ( ! $this->hasSnapshotData()) { |
|
778 | + if (!$this->hasSnapshotData()) { |
|
779 | 779 | return; |
780 | 780 | } // nothing changed |
781 | 781 | |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | { |
798 | 798 | // Add changed fields set to Beanstalkd queue |
799 | 799 | $queue = $this->di->getShared('beanstalkConnectionModels'); |
800 | - if ($queue===null){ |
|
800 | + if ($queue === null) { |
|
801 | 801 | return; |
802 | 802 | } |
803 | 803 | if ($this instanceof PbxSettings) { |
@@ -20,32 +20,32 @@ |
||
20 | 20 | protected function generateConfigProtected(): void |
21 | 21 | { |
22 | 22 | $enabled = ($this->generalSettings['AJAMEnabled'] === '1') ? 'yes' : 'no'; |
23 | - $conf = "[general]\n" . |
|
24 | - "enabled={$enabled}\n" . |
|
25 | - "bindaddr=0.0.0.0\n" . |
|
26 | - "bindport={$this->generalSettings['AJAMPort']}\n" . |
|
27 | - "prefix=asterisk\n" . |
|
23 | + $conf = "[general]\n". |
|
24 | + "enabled={$enabled}\n". |
|
25 | + "bindaddr=0.0.0.0\n". |
|
26 | + "bindport={$this->generalSettings['AJAMPort']}\n". |
|
27 | + "prefix=asterisk\n". |
|
28 | 28 | "enablestatic=yes\n\n"; |
29 | 29 | |
30 | - if ( ! empty($this->generalSettings['AJAMPortTLS'])) { |
|
30 | + if (!empty($this->generalSettings['AJAMPortTLS'])) { |
|
31 | 31 | $keys_dir = '/etc/asterisk/keys'; |
32 | 32 | Util::mwMkdir($keys_dir); |
33 | 33 | $WEBHTTPSPublicKey = $this->generalSettings['WEBHTTPSPublicKey']; |
34 | 34 | $WEBHTTPSPrivateKey = $this->generalSettings['WEBHTTPSPrivateKey']; |
35 | 35 | |
36 | - if ( ! empty($WEBHTTPSPublicKey) && ! empty($WEBHTTPSPrivateKey)) { |
|
36 | + if (!empty($WEBHTTPSPublicKey) && !empty($WEBHTTPSPrivateKey)) { |
|
37 | 37 | $s_data = "{$WEBHTTPSPublicKey}\n{$WEBHTTPSPrivateKey}"; |
38 | 38 | } else { |
39 | 39 | // Генерируем сертификат ssl. |
40 | 40 | $data = Util::generateSslCert(); |
41 | 41 | $s_data = implode("\n", $data); |
42 | 42 | } |
43 | - $conf .= "tlsenable=yes\n" . |
|
44 | - "tlsbindaddr=0.0.0.0:{$this->generalSettings['AJAMPortTLS']}\n" . |
|
45 | - "tlscertfile={$keys_dir}/ajam.pem\n" . |
|
43 | + $conf .= "tlsenable=yes\n". |
|
44 | + "tlsbindaddr=0.0.0.0:{$this->generalSettings['AJAMPortTLS']}\n". |
|
45 | + "tlscertfile={$keys_dir}/ajam.pem\n". |
|
46 | 46 | "tlsprivatekey={$keys_dir}/ajam.pem\n"; |
47 | 47 | Util::fileWriteContent("{$keys_dir}/ajam.pem", $s_data); |
48 | 48 | } |
49 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/http.conf', $conf); |
|
49 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/http.conf', $conf); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | \ No newline at end of file |