Просмотр исходного кода

[Administration] Correctif isCurrentAdmin()

feature/souke
Guillaume Bourgeois 1 год назад
Родитель
Сommit
1c0b947971
2 измененных файлов: 8 добавлений и 4 удалений
  1. +5
    -3
      backend/views/producer/update.php
  2. +3
    -1
      backend/views/support/view.php

+ 5
- 3
backend/views/producer/update.php Просмотреть файл

@@ -36,6 +36,8 @@
* termes.
*/

use common\helpers\GlobalParam;
use common\logic\User\User\Wrapper\UserModule;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\logic\Producer\Producer\Model\Producer;
@@ -43,9 +45,9 @@ use common\logic\Config\TaxRate\Model\TaxRate;
use common\logic\Document\Document\Model\Document;
use yii\helpers\ArrayHelper;

$userModule = $this->getUserModule();

\backend\assets\VuejsProducerUpdateAsset::register($this);
$userModule = UserModule::getInstance();
$userCurrent = GlobalParam::getCurrentUser();
$this->setTitle('Paramètres');
$this->addBreadcrumb($this->getTitle());

@@ -53,7 +55,7 @@ $this->addBreadcrumb($this->getTitle());

<script>
var appInitValues = {
isAdmin: <?= (int) $userModule->isCurrentAdmin() ?>
isAdmin: <?= (int) $userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent) ?>
};
</script>


+ 3
- 1
backend/views/support/view.php Просмотреть файл

@@ -1,5 +1,6 @@
<?php

use common\helpers\GlobalParam;
use common\logic\Ticket\Ticket\Wrapper\TicketManager;
use common\logic\User\User\Wrapper\UserModule;
use yii\helpers\Html;
@@ -7,6 +8,7 @@ use yii\widgets\ActiveForm;

$ticketManager = TicketManager::getInstance();
$userModule = UserModule::getInstance();
$userCurrent = GlobalParam::getCurrentUser();
$this->setTitle('Voir un ticket');
$this->addBreadcrumb(['label' => 'Support', 'url' => ['index']]);
$this->addBreadcrumb('Voir un ticket');
@@ -29,7 +31,7 @@ $this->addBreadcrumb('Voir un ticket');
<td><strong>Statut</strong></td>
<td><?= $ticketManager->getTicketStatusLabelAsHtml($ticket); ?></td>
</tr>
<?php if($userModule->isCurrentAdmin()): ?>
<?php if($userModule->getAuthorizationChecker()->isGrantedAsAdministrator($userCurrent)): ?>
<tr>
<td><strong>Producteur</strong></td>
<td><?= $ticketManager->isTicketUnread($ticket, $ticket->user) ?

Загрузка…
Отмена
Сохранить