add ticket original end and original price

add helper links to related object in admin
This commit is contained in:
2017-09-06 12:14:12 +02:00
parent bacfc36487
commit 90d19d17b6
19 changed files with 481 additions and 81 deletions

View File

@@ -7,6 +7,8 @@ use kartik\widgets\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\LogSearch */
/* @var $form yii\widgets\ActiveForm */
$userOptions = ['' => 'Mind'] + \yii\helpers\ArrayHelper::map(\common\models\User::read (), 'id', 'username');
?>
<div class="log-search">
@@ -38,6 +40,18 @@ use kartik\widgets\DateTimePicker;
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'type')->dropDownList( ["" =>"Mind"] + \common\models\Log::getTypes()) ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_user')->dropDownList( $userOptions ) ?>
</div>
</div>

View File

@@ -53,7 +53,19 @@ $this->params['breadcrumbs'][] = $this->title;
// 'id_door_log',
// 'updated_at',
// ['class' => 'yii\grid\ActionColumn'],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view}',
'urlCreator' => function($action, $model, $key, $index){
$result = "";
if ( $action == 'view'){
$result = \yii\helpers\Url::toRoute(['log/view','id' => $model['log_id_log']]);
}
return $result;
}
],
],
]); ?>

View File

@@ -13,32 +13,43 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="log-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/log', 'Update'), ['update', 'id' => $model->id_log], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/log', 'Delete'), ['delete', 'id' => $model->id_log], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/log', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_log',
'type',
[
'attribute' => 'type',
// 'format' => 'raw',
'value' =>$model->typeName,
'label' => 'Típus'
],
'message',
'url:ntext',
'app',
'id_user',
[
'attribute' => 'id_user',
'format' => 'raw',
'value' => Html::a($model->userName, ['user/view', 'id' => $model->id_user]),
],
[
'attribute' => 'id_ticket',
'format' => 'raw',
'value' => Html::a($model->ticketName, ['ticket/view', 'id' => $model->id_ticket]),
],
[
'attribute' => 'id_customer',
'format' => 'raw',
'value' => Html::a($model->customerName, ['customer/view', 'id' => $model->id_customer]),
],
'id_transfer',
'id_money_movement',
'id_ticket',
'id_sale',
'id_customer',
'id_account',
'id_account_state',
'id_key',