@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | case 'answer': |
| 45 | 45 | $record = FeedbackAnswer::find($id); |
| 46 | 46 | if (!$record) { |
| 47 | - $postId = (int)$record->getFeedbackPost()->id; |
|
| 47 | + $postId = (int) $record->getFeedbackPost()->id; |
|
| 48 | 48 | } |
| 49 | 49 | break; |
| 50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ($model->validate()) { |
| 61 | 61 | $model->make(); |
| 62 | 62 | App::$Session->getFlashBag()->add('success', __('Feedback item are successful changed')); |
| 63 | - $this->response->redirect('feedback/read/' . $postId); |
|
| 63 | + $this->response->redirect('feedback/read/'.$postId); |
|
| 64 | 64 | } else { |
| 65 | 65 | App::$Session->getFlashBag()->add('danger', __('Updating is failed')); |
| 66 | 66 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | // initialize model with answer add if thread is not closed |
| 43 | 43 | $model = null; |
| 44 | - if (!(bool)$record->closed) { |
|
| 44 | + if (!(bool) $record->closed) { |
|
| 45 | 45 | $model = new FormAnswerAdd($record); |
| 46 | 46 | if ($model->send()) { |
| 47 | 47 | if ($model->validate()) { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | ['text' => $profile->user->email], |
| 43 | 43 | ['text' => $profile->nick], |
| 44 | 44 | ['text' => Str::startsWith('0000-', $profile->birthday) ? __('None') : Date::convertToDatetime($profile->birthday)], |
| 45 | - ['text' => ($profile->rating > 0 ? '+' : null) . $profile->rating], |
|
| 45 | + ['text' => ($profile->rating > 0 ? '+' : null).$profile->rating], |
|
| 46 | 46 | ['text' => $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm']) |
| 47 | 47 | ->add('<i class="fa fa-pencil"></i>', ['profile/update', [$profile->id]], ['html' => true, 'class' => 'btn btn-primary']) |
| 48 | 48 | ->add('<i class="fa fa-trash-o"></i>', ['user/delete', [$profile->user->id]], ['html' => true, 'class' => 'btn btn-danger']) |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | <h1><?= __('Feedback list') ?></h1> |
| 26 | 26 | <?php |
| 27 | 27 | if (!$records || $records->count() < 1) { |
| 28 | - echo '<p class="alert alert-warning">' . __('Feedback requests is empty now!') . '</p>'; |
|
| 28 | + echo '<p class="alert alert-warning">'.__('Feedback requests is empty now!').'</p>'; |
|
| 29 | 29 | $this->stop(); |
| 30 | 30 | return; |
| 31 | 31 | } |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | foreach ($records as $item) { |
| 46 | 46 | /** @var \Apps\ActiveRecord\FeedbackPost $item*/ |
| 47 | 47 | $table->row([ |
| 48 | - ['text' => $item->id . (!$item->readed ? ' <i class="fa fa-bell alert-info"></i>' : null) . ($item->closed ? ' <i class="fa fa-eye-slash alert-danger"></i>' : null), 'html' => true], |
|
| 48 | + ['text' => $item->id.(!$item->readed ? ' <i class="fa fa-bell alert-info"></i>' : null).($item->closed ? ' <i class="fa fa-eye-slash alert-danger"></i>' : null), 'html' => true], |
|
| 49 | 49 | ['text' => Url::a(['feedback/read', [$item->id]], Text::snippet($item->message, 40)), 'html' => true], |
| 50 | - ['text' => '<span class="badge badge-light">' . $item->answers->count() . '</span>', 'html' => true], |
|
| 50 | + ['text' => '<span class="badge badge-light">'.$item->answers->count().'</span>', 'html' => true], |
|
| 51 | 51 | ['text' => $item->email], |
| 52 | - ['text' => (bool)$item->closed ? '<span class="label label-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', 'html' => true, '!secure' => true], |
|
| 52 | + ['text' => (bool) $item->closed ? '<span class="label label-danger">'.__('Closed').'</span>' : '<span class="label label-success">'.__('Opened').'</span>', 'html' => true, '!secure' => true], |
|
| 53 | 53 | ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)], |
| 54 | 54 | ['text' => $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm', 'role' => 'group']) |
| 55 | 55 | ->add('<i class="fa fa-feed"></i>', ['feedback/read', [$item->id]], ['class' => 'btn btn-light', 'html' => true]) |
@@ -30,28 +30,28 @@ discard block |
||
| 30 | 30 | <div class="card"> |
| 31 | 31 | <div class="card-header" style="background-color: #cadcee"> |
| 32 | 32 | <?php |
| 33 | - if (!(bool)$record->readed) { |
|
| 33 | + if (!(bool) $record->readed) { |
|
| 34 | 34 | echo '<i class="fa fa-bell"></i> '; |
| 35 | 35 | } |
| 36 | 36 | ?> |
| 37 | 37 | <?= __('Message sent') ?>: <?= Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR) ?>. |
| 38 | 38 | <?php |
| 39 | - if (!(bool)$record->closed) { |
|
| 40 | - echo '<span class="badge badge-success">' . __('Opened') . '</span>'; |
|
| 39 | + if (!(bool) $record->closed) { |
|
| 40 | + echo '<span class="badge badge-success">'.__('Opened').'</span>'; |
|
| 41 | 41 | } else { |
| 42 | - echo '<span class="badge badge-danger">' . __('Closed') . '</span>'; |
|
| 42 | + echo '<span class="badge badge-danger">'.__('Closed').'</span>'; |
|
| 43 | 43 | } |
| 44 | 44 | ?> |
| 45 | 45 | <?php |
| 46 | 46 | $btngrp = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm', 'role' => 'group'], 4); |
| 47 | 47 | |
| 48 | 48 | // show "mark as read" button if message is not readed |
| 49 | - if (!(bool)$record->readed) { |
|
| 49 | + if (!(bool) $record->readed) { |
|
| 50 | 50 | $btngrp->add('<i class="fa fa-bookmark-o"></i>', ['feedback/turn', ['read', $record->id]], ['class' => 'btn btn-success', 'html' => true, 'data-toggle' => 'tooltip', 'title' => __('Mark as read')]); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // show close/open button depend of current status |
| 54 | - if (!(bool)$record->closed) { |
|
| 54 | + if (!(bool) $record->closed) { |
|
| 55 | 55 | $btngrp->add('<i class="fa fa-eye-slash"></i>', ['feedback/turn', ['close', $record->id]], ['class' => 'btn btn-warning', 'html' => true, 'data-toggle' => 'tooltip', 'title' => __('Close')]); |
| 56 | 56 | } else { |
| 57 | 57 | $btngrp->add('<i class="fa fa-eye"></i>', ['feedback/turn', ['open', $record->id]], ['class' => 'btn btn-info', 'html' => true, 'data-toggle' => 'tooltip', 'title' => __('Open')]); |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | </div> |
| 65 | 65 | <div class="card-body"> |
| 66 | 66 | <?php |
| 67 | - if ((bool)$record->closed) { |
|
| 68 | - echo '<p class="alert alert-warning">' . __('The feedback request is closed! Thread in only-read mode') . '.</p>'; |
|
| 67 | + if ((bool) $record->closed) { |
|
| 68 | + echo '<p class="alert alert-warning">'.__('The feedback request is closed! Thread in only-read mode').'.</p>'; |
|
| 69 | 69 | } |
| 70 | 70 | ?> |
| 71 | 71 | <p><?= Str::replace("\n", "<br />", $record->message) ?></p> |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | <div class="card-body"> |
| 81 | 81 | <?php |
| 82 | 82 | $uInfo = 'no'; |
| 83 | - if ((int)$record->user_id > 0) { |
|
| 83 | + if ((int) $record->user_id > 0) { |
|
| 84 | 84 | $user = \App::$User->identity($record->user_id); |
| 85 | 85 | if ($user && $user->getId() > 0) { |
| 86 | 86 | $uInfo = Url::a(['user/update', [$user->getId()]], $user->profile->getNickname()); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | <?php foreach ($record->answers as $answer): ?> |
| 104 | 104 | <div class="card"> |
| 105 | 105 | <div class="card-header"> |
| 106 | - <?= __('From') ?>: <?= $answer->name . '(' . $answer->email . ')' . ((int)$answer->user_id > 0 ? Url::a(['user/update', [$answer->user_id]], '[id' . $answer->user_id . ']') : null) ?>, |
|
| 106 | + <?= __('From') ?>: <?= $answer->name.'('.$answer->email.')'.((int) $answer->user_id > 0 ? Url::a(['user/update', [$answer->user_id]], '[id'.$answer->user_id.']') : null) ?>, |
|
| 107 | 107 | <?= Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR) ?> |
| 108 | 108 | <div class="pull-right"> |
| 109 | 109 | <?= $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm']) |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | <div class="table-responsive"> |
| 27 | 27 | <?= $this->table(['class' => 'table table-bordered']) |
| 28 | 28 | ->body([ |
| 29 | - [['text' => __('Sender')], ['text' => $record->name . ' (' . $record->email . ')']], |
|
| 29 | + [['text' => __('Sender')], ['text' => $record->name.' ('.$record->email.')']], |
|
| 30 | 30 | [['text' => __('Date')], ['text' => Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR)]], |
| 31 | 31 | [['text' => __('Message')], ['text' => $record->message]] |
| 32 | 32 | ])->display() ?> |