@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function __construct($recordPost, $userId = 0) |
| 30 | 30 | { |
| 31 | 31 | $this->_post = $recordPost; |
| 32 | - $this->_userId = (int)$userId; |
|
| 32 | + $this->_userId = (int) $userId; |
|
| 33 | 33 | parent::__construct(); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function __construct($captcha = true) |
| 22 | 22 | { |
| 23 | - $this->_useCaptcha = (bool)$captcha; |
|
| 23 | + $this->_useCaptcha = (bool) $captcha; |
|
| 24 | 24 | parent::__construct(); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -9,4 +9,4 @@ |
||
| 9 | 9 | ['type' => 'link', 'text' => __('Group management'), 'link' => ['user/grouplist']], |
| 10 | 10 | ['type' => 'link', 'text' => __('Settings'), 'link' => ['user/settings']] |
| 11 | 11 | ] |
| 12 | -]);?> |
|
| 13 | 12 | \ No newline at end of file |
| 13 | +]); ?> |
|
| 14 | 14 | \ No newline at end of file |
@@ -31,14 +31,13 @@ |
||
| 31 | 31 | foreach ($records as $item) { |
| 32 | 32 | /** @var \Apps\ActiveRecord\FeedbackPost $item*/ |
| 33 | 33 | $items[] = [ |
| 34 | - ['text' => $item->id . ((int)$item->readed !== 1 ? ' <i class="fa fa-bell alert-info"></i>' : null), 'html' => true], |
|
| 34 | + ['text' => $item->id . ((int) $item->readed !== 1 ? ' <i class="fa fa-bell alert-info"></i>' : null), 'html' => true], |
|
| 35 | 35 | ['text' => Url::link(['feedback/read', $item->id], Text::snippet($item->message, 40, false)), 'html' => true], |
| 36 | 36 | ['text' => $item->getAnswers()->count()], |
| 37 | 37 | ['text' => $item->email], |
| 38 | 38 | ['text' => |
| 39 | - (int)$item->closed === 1 ? |
|
| 40 | - '<span class="label label-danger">' . __('Closed') . '</span>' : |
|
| 41 | - '<span class="label label-success">' . __('Opened') . '</span>', |
|
| 39 | + (int) $item->closed === 1 ? |
|
| 40 | + '<span class="label label-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', |
|
| 42 | 41 | 'html' => true, '!secure' => true], |
| 43 | 42 | ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)], |
| 44 | 43 | ['text' => Url::link(['feedback/read', $item->id], '<i class="fa fa-list fa-lg"></i> ') . |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | <div class="panel panel-info"> |
| 29 | 29 | <div class="panel-heading"> |
| 30 | 30 | <?php |
| 31 | - if ((int)$record->readed !== 1) { |
|
| 31 | + if ((int) $record->readed !== 1) { |
|
| 32 | 32 | echo '<i class="fa fa-bell"></i> '; |
| 33 | 33 | } |
| 34 | 34 | ?> |
| 35 | 35 | <?= __('Message sent') ?>: <?= Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?>. |
| 36 | 36 | <?php |
| 37 | - if ((int)$record->closed !== 1) { |
|
| 37 | + if ((int) $record->closed !== 1) { |
|
| 38 | 38 | echo '<span class="label label-success">' . __('Opened') . '</span>'; |
| 39 | 39 | } else { |
| 40 | 40 | echo '<span class="label label-danger">' . __('Closed') . '</span>'; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | </div> |
| 44 | 44 | <div class="panel-body"> |
| 45 | 45 | <?php |
| 46 | - if ((int)$record->closed !== 0) { |
|
| 46 | + if ((int) $record->closed !== 0) { |
|
| 47 | 47 | echo '<p class="alert alert-warning">' . __('The feedback request is closed! Thread in only-read mode') . '.</p>'; |
| 48 | 48 | } |
| 49 | 49 | ?> |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | <hr /> |
| 52 | 52 | <?php |
| 53 | 53 | // show "mark as read" button if message is not readed |
| 54 | - if ((int)$record->readed !== 1) { |
|
| 54 | + if ((int) $record->readed !== 1) { |
|
| 55 | 55 | echo Url::link(['feedback/turn', 'read', $record->id], __('Mark as read'), ['class' => 'label label-success']) . ' '; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // show close/open button depend of current status |
| 59 | - if ((int)$record->closed === 0) { |
|
| 59 | + if ((int) $record->closed === 0) { |
|
| 60 | 60 | echo Url::link(['feedback/turn', 'close', $record->id], __('Close'), ['class' => 'label label-warning']) . ' '; |
| 61 | 61 | } else { |
| 62 | 62 | echo Url::link(['feedback/turn', 'open', $record->id], __('Open'), ['class' => 'label label-info']) . ' '; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | <div class="panel-body"> |
| 77 | 77 | <?php |
| 78 | 78 | $uInfo = 'no'; |
| 79 | - if ((int)$record->user_id > 0) { |
|
| 79 | + if ((int) $record->user_id > 0) { |
|
| 80 | 80 | $user = \App::$User->identity($record->user_id); |
| 81 | 81 | if ($user !== null && $user->getId() > 0) { |
| 82 | 82 | $uInfo = Url::link(['user/update', $user->getId()], $user->getProfile()->nick); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | <?php if ($record->getAnswers()->count() > 0): ?> |
| 103 | 103 | <?php foreach ($record->getAnswers()->get() as $answer): ?> |
| 104 | - <div class="panel <?= (int)$answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>"> |
|
| 104 | + <div class="panel <?= (int) $answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>"> |
|
| 105 | 105 | <div class="panel-heading"> |
| 106 | 106 | <?= __('From') ?>: <?= $answer->name . '(' . $answer->email . ')' ?>, |
| 107 | 107 | <?= Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?> |
@@ -30,9 +30,8 @@ |
||
| 30 | 30 | ['text' => $item->id], |
| 31 | 31 | ['text' => Url::link(['feedback/read', $item->id, $item->hash], Text::cut($item->message, 0, 40)), 'html' => true], |
| 32 | 32 | ['text' => |
| 33 | - (int)$item->closed === 1 ? |
|
| 34 | - '<span class="label label-danger">' . __('Closed') . '</span>' : |
|
| 35 | - '<span class="label label-success">' . __('Opened') . '</span>', |
|
| 33 | + (int) $item->closed === 1 ? |
|
| 34 | + '<span class="label label-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', |
|
| 36 | 35 | 'html' => true, '!secure' => true], |
| 37 | 36 | ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)], |
| 38 | 37 | ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)] |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | ?> |
| 28 | 28 | |
| 29 | 29 | <?php |
| 30 | -if ((int)$post->closed === 0 && \App::$User->isAuth()) { |
|
| 30 | +if ((int) $post->closed === 0 && \App::$User->isAuth()) { |
|
| 31 | 31 | $user = App::$User->identity(); |
| 32 | - if ($user->getId() === (int)$post->user_id) { |
|
| 32 | + if ($user->getId() === (int) $post->user_id) { |
|
| 33 | 33 | echo '<div class="pull-right">' . |
| 34 | 34 | Url::link(['feedback/close', $post->id, $post->hash], __('Close request'), ['class' => 'btn btn-danger']) . |
| 35 | 35 | '</div>'; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | </div> |
| 53 | 53 | <h3><?= __('Answers') ?></h3> |
| 54 | 54 | <hr /> |
| 55 | -<?php if ((int)$post->readed === 0 && ($answers === null || $answers->count() < 1)): ?> |
|
| 55 | +<?php if ((int) $post->readed === 0 && ($answers === null || $answers->count() < 1)): ?> |
|
| 56 | 56 | <p class="alert alert-warning"><?= __('This message is not properly readed by website administrators') ?></p> |
| 57 | 57 | <?php endif; ?> |
| 58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | <?php foreach ($answers as $answer): ?> |
| 61 | 61 | <div class="row"> |
| 62 | 62 | <div class="col-md-12"> |
| 63 | - <div class="panel <?= (int)$answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>"> |
|
| 63 | + <div class="panel <?= (int) $answer->is_admin === 1 ? 'panel-success' : 'panel-default' ?>"> |
|
| 64 | 64 | <div class="panel-heading"> |
| 65 | 65 | <strong><?= $answer->name ?> (<?= $answer->email ?>)</strong>, |
| 66 | 66 | <?= Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?> |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | <?php endif; ?> |
| 76 | 76 | |
| 77 | 77 | <br /> |
| 78 | -<?php if ((int)$post->closed === 0 && $model !== null): ?> |
|
| 78 | +<?php if ((int) $post->closed === 0 && $model !== null): ?> |
|
| 79 | 79 | <h3><?= __('Add answer') ?></h3> |
| 80 | 80 | <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post']) ?> |
| 81 | 81 | <?= $form->start() ?> |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | <div class="panel-heading"> |
| 55 | 55 | <?php |
| 56 | 56 | $answerAuthor = Simplify::parseUserNick($answer->user_id, $answer->guest_name); |
| 57 | - if ((int)$answer->user_id > 0) { |
|
| 57 | + if ((int) $answer->user_id > 0) { |
|
| 58 | 58 | $answerAuthor = Url::link(['user/update', $answer->user_id], $answerAuthor); |
| 59 | 59 | } |
| 60 | 60 | ?> |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $answerTime = Date::convertToTimestamp($lastAnswer->created_at); |
| 150 | 150 | $cfgs = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
| 151 | 151 | // hmm, maybe past less then delay required? |
| 152 | - if ($now - (int)$cfgs['delayBetweenPost'] < $answerTime) { |
|
| 152 | + if ($now - (int) $cfgs['delayBetweenPost'] < $answerTime) { |
|
| 153 | 153 | throw new JsonException('Delay between answers not pass'); |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $postInfo = $findAnswer->getWallPost(); |
| 197 | 197 | |
| 198 | 198 | // if not a target user of answer and not answer owner - lets throw exception |
| 199 | - if($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
| 199 | + if ($postInfo->target_id !== $viewer->id && $findAnswer->user_id !== $viewer->id) { |
|
| 200 | 200 | throw new JsonException('Access declined!'); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | // sender is not myself? then i'm - target (remote user is sender user->to_me) |
| 257 | 257 | if ($row->sender_id !== $user->id) { |
| 258 | 258 | $userList[] = $row->sender_id; |
| 259 | - if ((int)$row->tread === 0) { |
|
| 259 | + if ((int) $row->tread === 0) { |
|
| 260 | 260 | $unreadList[] = $row->sender_id; |
| 261 | 261 | } |
| 262 | 262 | } |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | // get special types for this action |
| 326 | 326 | $queryType = App::$Request->get('type'); |
| 327 | - $queryId = (int)App::$Request->get('id'); |
|
| 327 | + $queryId = (int) App::$Request->get('id'); |
|
| 328 | 328 | // get current user object |
| 329 | 329 | $user = App::$User->identity(); |
| 330 | 330 | |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | switch ($queryType) { |
| 341 | 341 | case 'after': |
| 342 | 342 | $messages = Message::where('id', '>', $queryId) |
| 343 | - ->where(function ($query) use ($cor_id, $user) { |
|
| 344 | - $query->where(function ($q) use ($cor_id, $user){ |
|
| 343 | + ->where(function($query) use ($cor_id, $user) { |
|
| 344 | + $query->where(function($q) use ($cor_id, $user){ |
|
| 345 | 345 | $q->where('target_id', '=', $user->getId()) |
| 346 | 346 | ->where('sender_id', '=', $cor_id); |
| 347 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
| 347 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
| 348 | 348 | $q->where('target_id', '=', $cor_id) |
| 349 | 349 | ->where('sender_id', '=', $user->getId()); |
| 350 | 350 | }); |
@@ -352,11 +352,11 @@ discard block |
||
| 352 | 352 | break; |
| 353 | 353 | case 'before': |
| 354 | 354 | $messages = Message::where('id', '<', $queryId) |
| 355 | - ->where(function ($query) use ($cor_id, $user) { |
|
| 356 | - $query->where(function ($q) use ($cor_id, $user){ |
|
| 355 | + ->where(function($query) use ($cor_id, $user) { |
|
| 356 | + $query->where(function($q) use ($cor_id, $user){ |
|
| 357 | 357 | $q->where('target_id', '=', $user->getId()) |
| 358 | 358 | ->where('sender_id', '=', $cor_id); |
| 359 | - })->orWhere(function ($q) use ($cor_id, $user){ |
|
| 359 | + })->orWhere(function($q) use ($cor_id, $user){ |
|
| 360 | 360 | $q->where('target_id', '=', $cor_id) |
| 361 | 361 | ->where('sender_id', '=', $user->getId()); |
| 362 | 362 | }); |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | $this->setJsonHeader(); |
| 456 | 456 | |
| 457 | 457 | // get operation type and target user id |
| 458 | - $target_id = (int)App::$Request->get('target'); |
|
| 458 | + $target_id = (int) App::$Request->get('target'); |
|
| 459 | 459 | $type = App::$Request->get('type'); |
| 460 | 460 | |
| 461 | 461 | // check type of query |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | $cfg = \Apps\ActiveRecord\App::getConfigs('app', 'Profile'); |
| 472 | 472 | // check if rating is enabled for website |
| 473 | - if ((int)$cfg['rating'] !== 1) { |
|
| 473 | + if ((int) $cfg['rating'] !== 1) { |
|
| 474 | 474 | throw new JsonException('Rating is disabled'); |
| 475 | 475 | } |
| 476 | 476 | |