status flag

This commit is contained in:
2016-03-11 07:41:51 +01:00
parent bc74d92463
commit 9c25312cf1
8 changed files with 49 additions and 5 deletions

View File

@@ -113,7 +113,6 @@ class CardController extends \backend\controllers\BackendController {
*/
public function actionUpdate($id) {
$model = $this->findModel ( $id );
if ($model->load ( Yii::$app->request->post () ) && $model->save ()) {
return $this->redirect ( [
'index'

View File

@@ -63,6 +63,7 @@ class CardSearch extends Card
'customer.name as customer_name' ,
'customer.id_customer as customer_id_customer',
'key.number as key_number',
'card.flag as card_flag',
]);
@@ -106,6 +107,10 @@ class CardSearch extends Card
'asc' => ['key.number' => SORT_ASC ],
'desc' => ['key.number' => SORT_DESC],
],
'card_flag' => [
'asc' => ['card.flag' => SORT_ASC ],
'desc' => ['card.flag' => SORT_DESC],
],
]
]
]);

View File

@@ -4,6 +4,8 @@ use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Card;
use yii\helpers\Url;
use common\components\Helper;
use common\models\DoorLog;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\CardSearch */
@@ -66,6 +68,13 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'key_number',
'label' => 'Kulcs száma'
],
[
'attribute' => 'card_flag',
'label' => 'Info',
'value' => function ($model, $key, $index, $column){
return Helper::getArrayValue(DoorLog::getCardFlagTexts(), $model['card_flag'], "Ismeretlen ok");
}
],
[