door manager
This commit is contained in:
@@ -9,7 +9,6 @@ use frontend\models\AccountSelect;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use yii\base\Object;
|
||||
use common\models\Log;
|
||||
use common\models\User;
|
||||
|
||||
@@ -30,7 +29,7 @@ class AccountController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Lists all Account models.
|
||||
* @return mixed
|
||||
@@ -40,12 +39,12 @@ class AccountController extends Controller
|
||||
$model = new AccountSelect();
|
||||
|
||||
$model->id_account = Account::readDefault();
|
||||
|
||||
|
||||
$accounts = Account::read();
|
||||
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->writeToSession()) {
|
||||
Yii::$app->session->setFlash('success', Yii::t('frontend/ticket', 'Default account is set!') );
|
||||
|
||||
|
||||
$user = User::findOne(\Yii::$app->user->id);
|
||||
Log::log([ 'type' => Log::$TYPE_DEFAULT_ACCOUNT,
|
||||
'message' => "Alapértelmezett kassza - Felhasználó: " . $user->username . " - Kassza: " . Account::readDefaultObject()->name,
|
||||
@@ -58,7 +57,7 @@ class AccountController extends Controller
|
||||
'accounts' => $accounts
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lists all Account models.
|
||||
* @return mixed
|
||||
|
||||
@@ -13,7 +13,7 @@ use yii\helpers\Url;
|
||||
<?php
|
||||
/** @var \common\models\Ticket $ticket */
|
||||
$ticket = null;
|
||||
if (count($model->tickets) > 0) {
|
||||
if ( isset($model->tickets) && count($model->tickets) > 0) {
|
||||
$ticket = $model->tickets[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
$dt->sub( new DateInterval( 'P2D') );
|
||||
|
||||
|
||||
echo \common\components\DateUtil::formatUtc($dt);
|
||||
echo \common\components\DateUtil::formatDateTimeUtc($dt);
|
||||
|
||||
echo " - ";
|
||||
|
||||
@@ -33,7 +33,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
$ticketType->time_unit_count = 3;
|
||||
|
||||
$dt2 = \common\components\Helper::getTicketExpirationDate($dt, $ticketType);
|
||||
echo \common\components\DateUtil::formatUtc($dt2);
|
||||
echo \common\components\DateUtil::formatDateTimeUtc($dt2);
|
||||
|
||||
// $dt2 = \common\components\Helper::getTicketExpirationDate($dt, $ticketType);
|
||||
// echo \common\components\DateUtil::formatUtc($dt2);
|
||||
|
||||
Reference in New Issue
Block a user