@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $record = ConferenceRooms::findFirstByUniqid($uniqid); |
| 38 | 38 | if ($record === null) { |
| 39 | 39 | $record = new ConferenceRooms(); |
| 40 | - $record->uniqid = Extensions::TYPE_CONFERENCE.strtoupper('-' . md5(time())); |
|
| 40 | + $record->uniqid = Extensions::TYPE_CONFERENCE.strtoupper('-'.md5(time())); |
|
| 41 | 41 | $record->extension = Extensions::getNextFreeApplicationNumber(); |
| 42 | 42 | } |
| 43 | 43 | $this->view->form = new ConferenceRoomEditForm($record); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function saveAction(): void |
| 53 | 53 | { |
| 54 | - if ( ! $this->request->isPost()) { |
|
| 54 | + if (!$this->request->isPost()) { |
|
| 55 | 55 | return; |
| 56 | 56 | } |
| 57 | 57 | $this->db->begin(); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Заполним параметры внутреннего номера |
| 74 | - if ( ! $this->updateExtension($extension, $data)) { |
|
| 74 | + if (!$this->updateExtension($extension, $data)) { |
|
| 75 | 75 | $this->view->success = false; |
| 76 | 76 | $this->db->rollback(); |
| 77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Заполним параметры участников очереди |
| 82 | - if ( ! $this->updateConferenceRoom($room, $data)) { |
|
| 82 | + if (!$this->updateConferenceRoom($room, $data)) { |
|
| 83 | 83 | $this->view->success = false; |
| 84 | 84 | $this->db->rollback(); |
| 85 | 85 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $room->$name = $data[$name]; |
| 136 | 136 | break; |
| 137 | 137 | default: |
| 138 | - if ( ! array_key_exists($name, $data)) { |
|
| 138 | + if (!array_key_exists($name, $data)) { |
|
| 139 | 139 | continue 2; |
| 140 | 140 | } |
| 141 | 141 | $room->$name = $data[$name]; |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function indexAction(): void |
| 22 | 22 | { |
| 23 | - $this->view->mohFiles = SoundFiles::find('category="' . SoundFiles::CATEGORY_MOH . '"'); |
|
| 24 | - $this->view->customFiles = SoundFiles::find('category="' . SoundFiles::CATEGORY_CUSTOM . '"'); |
|
| 23 | + $this->view->mohFiles = SoundFiles::find('category="'.SoundFiles::CATEGORY_MOH.'"'); |
|
| 24 | + $this->view->customFiles = SoundFiles::find('category="'.SoundFiles::CATEGORY_CUSTOM.'"'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function saveAction(): void |
| 59 | 59 | { |
| 60 | - if ( ! $this->request->isPost()) { |
|
| 60 | + if (!$this->request->isPost()) { |
|
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | $data = $this->request->getPost(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | case "id": |
| 73 | 73 | break; |
| 74 | 74 | default: |
| 75 | - if ( ! array_key_exists($name, $data)) { |
|
| 75 | + if (!array_key_exists($name, $data)) { |
|
| 76 | 76 | continue 2; |
| 77 | 77 | } |
| 78 | 78 | $soundFile->$name = $data[$name]; |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | return; |
| 105 | 105 | } |
| 106 | 106 | $soundFile = SoundFiles::findFirstById($id); |
| 107 | - if ($soundFile === null){ |
|
| 107 | + if ($soundFile === null) { |
|
| 108 | 108 | return; |
| 109 | 109 | } |
| 110 | - $errors = false; |
|
| 111 | - if (! $soundFile->delete()) { |
|
| 110 | + $errors = false; |
|
| 111 | + if (!$soundFile->delete()) { |
|
| 112 | 112 | $errors = $soundFile->getMessages(); |
| 113 | 113 | } |
| 114 | 114 | if ($errors) { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ], |
| 75 | 75 | ], |
| 76 | 76 | ]; |
| 77 | - $extensions = Extensions::find($parameters); |
|
| 77 | + $extensions = Extensions::find($parameters); |
|
| 78 | 78 | foreach ($extensions as $record) { |
| 79 | 79 | $forwardingExtensions[$record->number] = $record ? $record->getRepresent() : ''; |
| 80 | 80 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function modifyAction(string $ruleId = '') :void |
| 95 | 95 | { |
| 96 | - if ((int)$ruleId === 1) { |
|
| 96 | + if ((int) $ruleId === 1) { |
|
| 97 | 97 | $this->forward('incoming-routes/index'); |
| 98 | 98 | } // Первая строка маршрут по умолчанию, ее не трогаем. |
| 99 | 99 | |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | ], |
| 124 | 124 | ], |
| 125 | 125 | ]; |
| 126 | - $extensions = Extensions::find($parameters); |
|
| 126 | + $extensions = Extensions::find($parameters); |
|
| 127 | 127 | foreach ($extensions as $record) { |
| 128 | 128 | $forwardingExtensions[$record->number] = $record ? $record->getRepresent() : ''; |
| 129 | 129 | } |
| 130 | - $form = new IncomingRouteEditForm( |
|
| 130 | + $form = new IncomingRouteEditForm( |
|
| 131 | 131 | $rule, |
| 132 | 132 | ['extensions' => $forwardingExtensions, 'providers' => $providersList] |
| 133 | 133 | ); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function saveAction(): void |
| 143 | 143 | { |
| 144 | - if ( ! $this->request->isPost()) { |
|
| 144 | + if (!$this->request->isPost()) { |
|
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | 147 | $this->db->begin(); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | case 'priority': |
| 164 | 164 | if (empty($data[$name])) { |
| 165 | 165 | // Найдем строчку с самым высоким приоиртетом, кроме 9999 |
| 166 | - $params = [ |
|
| 166 | + $params = [ |
|
| 167 | 167 | 'column' => 'priority', |
| 168 | 168 | 'conditions' => 'priority != 9999', |
| 169 | 169 | ]; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function deleteAction(string $ruleId) |
| 209 | 209 | { |
| 210 | - if ((int)$ruleId === 1) { |
|
| 210 | + if ((int) $ruleId === 1) { |
|
| 211 | 211 | $this->forward('incoming-routes/index'); // Первая строка маршрут по умолчанию, ее не трогаем. |
| 212 | 212 | } |
| 213 | 213 | |
@@ -226,20 +226,20 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function changePriorityAction(string $ruleId = '') |
| 228 | 228 | { |
| 229 | - if ((int)$ruleId === 1 || $ruleId==='') { |
|
| 229 | + if ((int) $ruleId === 1 || $ruleId === '') { |
|
| 230 | 230 | return; |
| 231 | 231 | } // Первая строка маршрут по умолчанию, ее не трогаем. |
| 232 | 232 | |
| 233 | 233 | $this->view->disable(); |
| 234 | 234 | $result = false; |
| 235 | 235 | |
| 236 | - if ( ! $this->request->isPost()) { |
|
| 236 | + if (!$this->request->isPost()) { |
|
| 237 | 237 | return; |
| 238 | 238 | } |
| 239 | 239 | $data = $this->request->getPost(); |
| 240 | 240 | $rule = IncomingRoutingTable::findFirstById($ruleId); |
| 241 | 241 | if ($rule !== null) { |
| 242 | - $rule->priority = (int)$data['newPriority']; |
|
| 242 | + $rule->priority = (int) $data['newPriority']; |
|
| 243 | 243 | $result = $rule->update(); |
| 244 | 244 | } |
| 245 | 245 | echo json_encode($result); |
@@ -93,9 +93,9 @@ |
||
| 93 | 93 | |
| 94 | 94 | $form = new CallQueueEditForm( |
| 95 | 95 | $queue, [ |
| 96 | - 'extensions' => $extensionList, |
|
| 97 | - 'soundfiles' => $soundfilesList, |
|
| 98 | - ] |
|
| 96 | + 'extensions' => $extensionList, |
|
| 97 | + 'soundfiles' => $soundfilesList, |
|
| 98 | + ] |
|
| 99 | 99 | ); |
| 100 | 100 | $this->view->form = $form; |
| 101 | 101 | $this->view->extensionsTable = $queueMembersList; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $extensionList = []; |
| 39 | 39 | if ($queue === null) { |
| 40 | 40 | $queue = new CallQueues(); |
| 41 | - $queue->uniqid = Extensions::TYPE_QUEUE . strtoupper('-' . md5($queue->id . time())); |
|
| 41 | + $queue->uniqid = Extensions::TYPE_QUEUE.strtoupper('-'.md5($queue->id.time())); |
|
| 42 | 42 | $queue->caller_hear = 'moh'; |
| 43 | 43 | $queue->seconds_to_ring_each_member = 20; |
| 44 | 44 | $queue->seconds_for_wrapup = 15; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'queue' => $queue->uniqid, |
| 56 | 56 | ], |
| 57 | 57 | ]; |
| 58 | - $members = CallQueueMembers::find($parameters); |
|
| 58 | + $members = CallQueueMembers::find($parameters); |
|
| 59 | 59 | foreach ($members as $member) { |
| 60 | 60 | $queueMembersList[] = [ |
| 61 | 61 | 'id' => $member->id, |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $soundfilesList[$soundFile->id] = $soundFile->name; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $form = new CallQueueEditForm( |
|
| 94 | + $form = new CallQueueEditForm( |
|
| 95 | 95 | $queue, [ |
| 96 | 96 | 'extensions' => $extensionList, |
| 97 | 97 | 'soundfiles' => $soundfilesList, |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function saveAction(): void |
| 111 | 111 | { |
| 112 | - if ( ! $this->request->isPost()) { |
|
| 112 | + if (!$this->request->isPost()) { |
|
| 113 | 113 | return; |
| 114 | 114 | } |
| 115 | 115 | $this->db->begin(); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // Заполним параметры внутреннего номера |
| 133 | - if ( ! $this->updateExtension($extension, $data)) { |
|
| 133 | + if (!$this->updateExtension($extension, $data)) { |
|
| 134 | 134 | $this->view->success = false; |
| 135 | 135 | $this->db->rollback(); |
| 136 | 136 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // Заполним параметры пользователя |
| 141 | - if ( ! $this->updateQueue($queue, $data)) { |
|
| 141 | + if (!$this->updateQueue($queue, $data)) { |
|
| 142 | 142 | $this->view->success = false; |
| 143 | 143 | $this->db->rollback(); |
| 144 | 144 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | // Заполним параметры участников очереди |
| 149 | - if ( ! $this->updateQueueMembers($data)) { |
|
| 149 | + if (!$this->updateQueueMembers($data)) { |
|
| 150 | 150 | $this->view->success = false; |
| 151 | 151 | $this->db->rollback(); |
| 152 | 152 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | case "periodic_announce_sound_id": |
| 215 | 215 | case "redirect_to_extension_if_repeat_exceeded": |
| 216 | 216 | case "redirect_to_extension_if_empty": |
| 217 | - if ( ! array_key_exists($name, $data) || empty($data[$name])) { |
|
| 217 | + if (!array_key_exists($name, $data) || empty($data[$name])) { |
|
| 218 | 218 | $queue->$name = null; |
| 219 | 219 | continue 2; |
| 220 | 220 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | break; |
| 224 | 224 | case "timeout_to_redirect_to_extension": |
| 225 | 225 | case "number_unanswered_calls_to_redirect": |
| 226 | - if ( ! array_key_exists($name, $data)) { |
|
| 226 | + if (!array_key_exists($name, $data)) { |
|
| 227 | 227 | continue 2; |
| 228 | 228 | } |
| 229 | 229 | if (empty($data[$name])) { |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | break; |
| 235 | 235 | case "timeout_extension": |
| 236 | - if ( ! array_key_exists($name, $data) |
|
| 236 | + if (!array_key_exists($name, $data) |
|
| 237 | 237 | || empty($data[$name]) |
| 238 | 238 | || (array_key_exists('timeout_to_redirect_to_extension', $data) |
| 239 | 239 | && intval($data['timeout_to_redirect_to_extension']) === 0)) { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | break; |
| 246 | 246 | case "redirect_to_extension_if_unanswered": |
| 247 | - if ( ! array_key_exists($name, $data) |
|
| 247 | + if (!array_key_exists($name, $data) |
|
| 248 | 248 | || empty($data[$name]) |
| 249 | 249 | || (array_key_exists('number_unanswered_calls_to_redirect', $data) |
| 250 | 250 | && intval($data['number_unanswered_calls_to_redirect']) === 0)) { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | break; |
| 257 | 257 | default: |
| 258 | - if ( ! array_key_exists($name, $data)) { |
|
| 258 | + if (!array_key_exists($name, $data)) { |
|
| 259 | 259 | continue 2; |
| 260 | 260 | } |
| 261 | 261 | $queue->$name = $data[$name]; |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | // Обновим настройки у существующих членов очереди |
| 286 | 286 | $membersTable = json_decode($data['members']); |
| 287 | 287 | foreach ($membersTable as $member) { |
| 288 | - $parameters = [ |
|
| 288 | + $parameters = [ |
|
| 289 | 289 | 'conditions' => 'extension = :number: AND queue=:uniqid:', |
| 290 | 290 | 'bind' => [ |
| 291 | 291 | 'number' => $member->number, |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | $this->db->begin(); |
| 361 | 361 | $extension = $queue->Extensions; |
| 362 | - if ( ! $extension->delete()) { |
|
| 362 | + if (!$extension->delete()) { |
|
| 363 | 363 | $errors = $extension->getMessages(); |
| 364 | 364 | } |
| 365 | 365 | if ($errors) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $provider = Providers::findFirstByUniqid($uniqid); |
| 51 | 51 | |
| 52 | 52 | if ($provider === null) { |
| 53 | - $uniqid = strtoupper('SIP-' . time()); |
|
| 53 | + $uniqid = strtoupper('SIP-'.time()); |
|
| 54 | 54 | $provider = new Providers(); |
| 55 | 55 | $provider->type = 'SIP'; |
| 56 | 56 | $provider->uniqid = $uniqid; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $provider = Providers::findFirstByUniqid($uniqid); |
| 79 | 79 | |
| 80 | 80 | if ($provider === null) { |
| 81 | - $uniqid = strtoupper('IAX-' . time()); |
|
| 81 | + $uniqid = strtoupper('IAX-'.time()); |
|
| 82 | 82 | $provider = new Providers(); |
| 83 | 83 | $provider->type = 'IAX'; |
| 84 | 84 | $provider->uniqid = $uniqid; |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function saveAction(string $type): void |
| 165 | 165 | { |
| 166 | - if ( ! $this->request->isPost()) { |
|
| 166 | + if (!$this->request->isPost()) { |
|
| 167 | 167 | $this->forward('network/index'); |
| 168 | 168 | } |
| 169 | 169 | $this->db->begin(); |
| 170 | 170 | $data = $this->request->getPost(); |
| 171 | 171 | |
| 172 | 172 | // Заполним параметры провайдера и его SIP IAX записей |
| 173 | - if ( ! $this->saveProvider($data, $type)) { |
|
| 173 | + if (!$this->saveProvider($data, $type)) { |
|
| 174 | 174 | $this->view->success = false; |
| 175 | 175 | $this->db->rollback(); |
| 176 | 176 | |
@@ -291,14 +291,14 @@ discard block |
||
| 291 | 291 | $errors = false; |
| 292 | 292 | if ($provider->Iax) { |
| 293 | 293 | $iax = $provider->Iax; |
| 294 | - if ( ! $iax->delete()) { |
|
| 294 | + if (!$iax->delete()) { |
|
| 295 | 295 | $errors = $iax->getMessages(); |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | if ($errors === false && $provider->Sip) { |
| 300 | 300 | $sip = $provider->Sip; |
| 301 | - if ( ! $sip->delete()) { |
|
| 301 | + if (!$sip->delete()) { |
|
| 302 | 302 | $errors = $sip->getMessages(); |
| 303 | 303 | } |
| 304 | 304 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $app = DialplanApplications::findFirstByUniqid($uniqid); |
| 38 | 38 | if ($app === null) { |
| 39 | 39 | $app = new DialplanApplications(); |
| 40 | - $app->uniqid = strtoupper('DIALPLAN-APP-' . md5($app->id . time())); |
|
| 40 | + $app->uniqid = strtoupper('DIALPLAN-APP-'.md5($app->id.time())); |
|
| 41 | 41 | $app->type = 'php'; |
| 42 | 42 | $app->extension = Extensions::getNextFreeApplicationNumber(); |
| 43 | 43 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function saveAction(): void |
| 57 | 57 | { |
| 58 | - if ( ! $this->request->isPost()) { |
|
| 58 | + if (!$this->request->isPost()) { |
|
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Заполним параметры внутреннего номера |
| 81 | - if ( ! $this->updateExtension($extension, $data)) { |
|
| 81 | + if (!$this->updateExtension($extension, $data)) { |
|
| 82 | 82 | $this->view->success = false; |
| 83 | 83 | $this->db->rollback(); |
| 84 | 84 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // Заполним параметры пользователя |
| 89 | - if ( ! $this->updateDialplanApplication($appRecord, $data)) { |
|
| 89 | + if (!$this->updateDialplanApplication($appRecord, $data)) { |
|
| 90 | 90 | $this->view->success = false; |
| 91 | 91 | $this->db->rollback(); |
| 92 | 92 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $this->db->begin(); |
| 182 | 182 | $errors = false; |
| 183 | 183 | $extension = $appRecord->Extensions; |
| 184 | - if ( ! $extension->delete()) { |
|
| 184 | + if (!$extension->delete()) { |
|
| 185 | 185 | $errors = $extension->getMessages(); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | $newResult = $this->$currentAdvice(); |
| 93 | - if ( ! empty($newResult)) { |
|
| 93 | + if (!empty($newResult)) { |
|
| 94 | 94 | $arrMessages[] = $newResult; |
| 95 | 95 | } |
| 96 | 96 | $managedCache->set( |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $result = []; |
| 109 | 109 | foreach ($arrMessages as $message) { |
| 110 | 110 | foreach ($message as $key => $value) { |
| 111 | - if ( ! empty($value)) { |
|
| 111 | + if (!empty($value)) { |
|
| 112 | 112 | $result[$key][] = $value; |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | $messages = []; |
| 248 | 248 | $licKey = PbxSettings::getValueByKey('PBXLicense'); |
| 249 | - $language = PbxSettings::getValueByKey('WebAdminLanguage'); |
|
| 249 | + $language = PbxSettings::getValueByKey('WebAdminLanguage'); |
|
| 250 | 250 | |
| 251 | - if ( ! empty($licKey)) { |
|
| 251 | + if (!empty($licKey)) { |
|
| 252 | 252 | $checkBaseFeature = $this->license->featureAvailable(33); |
| 253 | 253 | if ($checkBaseFeature['success'] === false) { |
| 254 | 254 | if ($language === 'ru') { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'trimfrombegin' => $rule->trimfrombegin, |
| 52 | 52 | 'prepend' => $rule->prepend, |
| 53 | 53 | 'note' => $rule->note, |
| 54 | - 'rulename' => '<i class="icon attention"></i> ' . $rule->getRepresent(), |
|
| 54 | + 'rulename' => '<i class="icon attention"></i> '.$rule->getRepresent(), |
|
| 55 | 55 | 'disabled' => false, |
| 56 | 56 | ]; |
| 57 | 57 | } |
@@ -105,14 +105,14 @@ discard block |
||
| 105 | 105 | switch ($name) { |
| 106 | 106 | case 'restnumbers': |
| 107 | 107 | { |
| 108 | - if ( ! array_key_exists($name, $data)) { |
|
| 108 | + if (!array_key_exists($name, $data)) { |
|
| 109 | 109 | continue 2; |
| 110 | 110 | } |
| 111 | 111 | $rule->$name = $data[$name] === '' ? '-1' : $data[$name]; |
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | 114 | default: |
| 115 | - if ( ! array_key_exists($name, $data)) { |
|
| 115 | + if (!array_key_exists($name, $data)) { |
|
| 116 | 116 | continue 2; |
| 117 | 117 | } |
| 118 | 118 | $rule->$name = $data[$name]; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $this->view->disable(); |
| 165 | 165 | $result = false; |
| 166 | 166 | |
| 167 | - if ( ! $this->request->isPost()) { |
|
| 167 | + if (!$this->request->isPost()) { |
|
| 168 | 168 | return; |
| 169 | 169 | } |
| 170 | 170 | $data = $this->request->getPost(); |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | $this->license->changeLicenseKey($data['licKey']); |
| 117 | 117 | $this->license->addTrial('11'); // MikoPBX forever license |
| 118 | 118 | $res->success = true; |
| 119 | - } elseif ( ! empty($licenseInfo) && strpos($licenseInfo, '2026') !== false) { |
|
| 119 | + } elseif (!empty($licenseInfo) && strpos($licenseInfo, '2026') !== false) { |
|
| 120 | 120 | $res->success = false; |
| 121 | 121 | $res->messages[] = $this->translation->_('lic_FailedCheckLicense2026'); |
| 122 | - } elseif ( ! empty($licenseInfo)) { |
|
| 122 | + } elseif (!empty($licenseInfo)) { |
|
| 123 | 123 | $res->messages[] = $licenseInfo; |
| 124 | 124 | $res->success = false; |
| 125 | 125 | } else { |
@@ -127,20 +127,20 @@ discard block |
||
| 127 | 127 | $res->success = false; |
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | - if ( ! empty($data['coupon'])) { |
|
| 130 | + if (!empty($data['coupon'])) { |
|
| 131 | 131 | $result = $this->license->activateCoupon($data['coupon']); |
| 132 | 132 | if ($result === true) { |
| 133 | 133 | $res->messages[] = $this->translation->_('lic_SuccessfulCouponActivated'); |
| 134 | 134 | $res->success = true; |
| 135 | 135 | } else { |
| 136 | - $res->messages[] = $this->license->translateLicenseErrorMessage((string)$result); |
|
| 136 | + $res->messages[] = $this->license->translateLicenseErrorMessage((string) $result); |
|
| 137 | 137 | $res->success = false; |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | } else { // Only add trial for license key |
| 141 | 141 | $newLicenseKey = $this->license->getTrialLicense($data); |
| 142 | 142 | if (strlen($newLicenseKey) === 28 |
| 143 | - && Text::startsWith((string)$newLicenseKey, 'MIKO-')) { |
|
| 143 | + && Text::startsWith((string) $newLicenseKey, 'MIKO-')) { |
|
| 144 | 144 | $mikoPBXConfig->setGeneralSettings('PBXLicense', $newLicenseKey); |
| 145 | 145 | $this->license->changeLicenseKey($newLicenseKey); |
| 146 | 146 | $res->success = true; |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | $licFeatureId = $data['licFeatureId']; |
| 213 | 213 | $licProductId = $data['licProductId']; |
| 214 | 214 | |
| 215 | - if ( ! isset($licFeatureId, $licProductId)) { |
|
| 216 | - $res->messages[]='The feature id or product id is empty.'; |
|
| 215 | + if (!isset($licFeatureId, $licProductId)) { |
|
| 216 | + $res->messages[] = 'The feature id or product id is empty.'; |
|
| 217 | 217 | return $res; |
| 218 | 218 | } |
| 219 | 219 | $res->success = true; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | { |
| 244 | 244 | $res = new PBXApiResult(); |
| 245 | 245 | $res->processor = __METHOD__; |
| 246 | - $res->success= true; |
|
| 246 | + $res->success = true; |
|
| 247 | 247 | |
| 248 | 248 | // License Key |
| 249 | 249 | $licenseKey = PbxSettings::getValueByKey('PBXLicense'); |
@@ -251,10 +251,10 @@ discard block |
||
| 251 | 251 | $dataMetrics = []; |
| 252 | 252 | |
| 253 | 253 | // PBXVersion |
| 254 | - $dataMetrics['PBXname'] = 'MikoPBX@' . PbxSettings::getValueByKey('PBXVersion'); |
|
| 254 | + $dataMetrics['PBXname'] = 'MikoPBX@'.PbxSettings::getValueByKey('PBXVersion'); |
|
| 255 | 255 | |
| 256 | 256 | // SIP Extensions count |
| 257 | - $extensions = Extensions::find('type="'.Extensions::TYPE_SIP.'"'); |
|
| 257 | + $extensions = Extensions::find('type="'.Extensions::TYPE_SIP.'"'); |
|
| 258 | 258 | $dataMetrics['CountSipExtensions'] = $extensions->count(); |
| 259 | 259 | |
| 260 | 260 | // Interface language |