From db62199400fc5b08c2888ff9b1df71f7a3c4062c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 21 Oct 2015 13:29:31 +0300 Subject: [PATCH] Importers CRUD --- backend/controllers/ArtHistoryController.php | 1 + backend/views/accounts-vin/_form.php | 37 +++++++++++++++++++++++++++++++++++++ backend/views/accounts-vin/_search.php | 41 +++++++++++++++++++++++++++++++++++++++++ backend/views/accounts-vin/create.php | 21 +++++++++++++++++++++ backend/views/accounts-vin/index.php | 41 +++++++++++++++++++++++++++++++++++++++++ backend/views/accounts-vin/update.php | 21 +++++++++++++++++++++ backend/views/accounts-vin/view.php | 42 ++++++++++++++++++++++++++++++++++++++++++ backend/views/accounts_vin/_form.php | 37 ------------------------------------- backend/views/accounts_vin/_search.php | 41 ----------------------------------------- backend/views/accounts_vin/create.php | 21 --------------------- backend/views/accounts_vin/index.php | 41 ----------------------------------------- backend/views/accounts_vin/update.php | 21 --------------------- backend/views/accounts_vin/view.php | 42 ------------------------------------------ backend/views/art-history/_form.php | 27 +++++++++++++++++++++++++++ backend/views/art-history/_search.php | 33 +++++++++++++++++++++++++++++++++ backend/views/art-history/create.php | 21 +++++++++++++++++++++ backend/views/art-history/index.php | 35 +++++++++++++++++++++++++++++++++++ backend/views/art-history/update.php | 21 +++++++++++++++++++++ backend/views/art-history/view.php | 38 ++++++++++++++++++++++++++++++++++++++ backend/views/art_history/_form.php | 27 --------------------------- backend/views/art_history/_search.php | 33 --------------------------------- backend/views/art_history/create.php | 21 --------------------- backend/views/art_history/index.php | 37 ------------------------------------- backend/views/art_history/update.php | 21 --------------------- backend/views/art_history/view.php | 38 -------------------------------------- common/models/ArtHistory.php | 6 ++++++ 26 files changed, 385 insertions(+), 380 deletions(-) create mode 100644 backend/views/accounts-vin/_form.php create mode 100644 backend/views/accounts-vin/_search.php create mode 100644 backend/views/accounts-vin/create.php create mode 100644 backend/views/accounts-vin/index.php create mode 100644 backend/views/accounts-vin/update.php create mode 100644 backend/views/accounts-vin/view.php delete mode 100644 backend/views/accounts_vin/_form.php delete mode 100644 backend/views/accounts_vin/_search.php delete mode 100644 backend/views/accounts_vin/create.php delete mode 100644 backend/views/accounts_vin/index.php delete mode 100644 backend/views/accounts_vin/update.php delete mode 100644 backend/views/accounts_vin/view.php create mode 100644 backend/views/art-history/_form.php create mode 100644 backend/views/art-history/_search.php create mode 100644 backend/views/art-history/create.php create mode 100644 backend/views/art-history/index.php create mode 100644 backend/views/art-history/update.php create mode 100644 backend/views/art-history/view.php delete mode 100644 backend/views/art_history/_form.php delete mode 100644 backend/views/art_history/_search.php delete mode 100644 backend/views/art_history/create.php delete mode 100644 backend/views/art_history/index.php delete mode 100644 backend/views/art_history/update.php delete mode 100644 backend/views/art_history/view.php diff --git a/backend/controllers/ArtHistoryController.php b/backend/controllers/ArtHistoryController.php index d2c41a6..ce4437a 100644 --- a/backend/controllers/ArtHistoryController.php +++ b/backend/controllers/ArtHistoryController.php @@ -14,6 +14,7 @@ use yii\filters\VerbFilter; */ class ArtHistoryController extends Controller { + public $layout = "/column"; public function behaviors() { return [ diff --git a/backend/views/accounts-vin/_form.php b/backend/views/accounts-vin/_form.php new file mode 100644 index 0000000..371ac17 --- /dev/null +++ b/backend/views/accounts-vin/_form.php @@ -0,0 +1,37 @@ + + +
+ + + + field($model, 'account_id')->textInput() ?> + + field($model, 'id')->textInput() ?> + + field($model, 'vin')->textInput(['maxlength' => true]) ?> + + field($model, 'car_name')->textInput(['maxlength' => true]) ?> + + field($model, 'car_mfa_id')->textInput() ?> + + field($model, 'car_model')->textInput(['maxlength' => true]) ?> + + field($model, 'car_mod_id')->textInput() ?> + + field($model, 'timestamp')->textInput() ?> + +
+ isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
diff --git a/backend/views/accounts-vin/_search.php b/backend/views/accounts-vin/_search.php new file mode 100644 index 0000000..703278a --- /dev/null +++ b/backend/views/accounts-vin/_search.php @@ -0,0 +1,41 @@ + + + diff --git a/backend/views/accounts-vin/create.php b/backend/views/accounts-vin/create.php new file mode 100644 index 0000000..f5a4812 --- /dev/null +++ b/backend/views/accounts-vin/create.php @@ -0,0 +1,21 @@ +title = 'Create Accounts Vin'; +$this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/accounts-vin/index.php b/backend/views/accounts-vin/index.php new file mode 100644 index 0000000..ee80c76 --- /dev/null +++ b/backend/views/accounts-vin/index.php @@ -0,0 +1,41 @@ +title = 'Accounts Vins'; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ render('_search', ['model' => $searchModel]); ?> + +

+ 'btn btn-success']) ?> +

+ + $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'account_id', + 'id', + 'vin', + 'car_name', + 'car_mfa_id', + // 'car_model', + // 'car_mod_id', + // 'timestamp', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> + +
diff --git a/backend/views/accounts-vin/update.php b/backend/views/accounts-vin/update.php new file mode 100644 index 0000000..7e2363a --- /dev/null +++ b/backend/views/accounts-vin/update.php @@ -0,0 +1,21 @@ +title = 'Update Accounts Vin: ' . ' ' . $model->account_id; +$this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => $model->account_id, 'url' => ['view', 'account_id' => $model->account_id, 'id' => $model->id]]; +$this->params['breadcrumbs'][] = 'Update'; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/accounts-vin/view.php b/backend/views/accounts-vin/view.php new file mode 100644 index 0000000..db0459b --- /dev/null +++ b/backend/views/accounts-vin/view.php @@ -0,0 +1,42 @@ +title = $model->account_id; +$this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ +

+ $model->account_id, 'id' => $model->id], ['class' => 'btn btn-primary']) ?> + $model->account_id, 'id' => $model->id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => 'Are you sure you want to delete this item?', + 'method' => 'post', + ], + ]) ?> +

+ + $model, + 'attributes' => [ + 'account_id', + 'id', + 'vin', + 'car_name', + 'car_mfa_id', + 'car_model', + 'car_mod_id', + 'timestamp', + ], + ]) ?> + +
diff --git a/backend/views/accounts_vin/_form.php b/backend/views/accounts_vin/_form.php deleted file mode 100644 index 371ac17..0000000 --- a/backend/views/accounts_vin/_form.php +++ /dev/null @@ -1,37 +0,0 @@ - - -
- - - - field($model, 'account_id')->textInput() ?> - - field($model, 'id')->textInput() ?> - - field($model, 'vin')->textInput(['maxlength' => true]) ?> - - field($model, 'car_name')->textInput(['maxlength' => true]) ?> - - field($model, 'car_mfa_id')->textInput() ?> - - field($model, 'car_model')->textInput(['maxlength' => true]) ?> - - field($model, 'car_mod_id')->textInput() ?> - - field($model, 'timestamp')->textInput() ?> - -
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/backend/views/accounts_vin/_search.php b/backend/views/accounts_vin/_search.php deleted file mode 100644 index 703278a..0000000 --- a/backend/views/accounts_vin/_search.php +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/backend/views/accounts_vin/create.php b/backend/views/accounts_vin/create.php deleted file mode 100644 index f5a4812..0000000 --- a/backend/views/accounts_vin/create.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Create Accounts Vin'; -$this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/accounts_vin/index.php b/backend/views/accounts_vin/index.php deleted file mode 100644 index ee80c76..0000000 --- a/backend/views/accounts_vin/index.php +++ /dev/null @@ -1,41 +0,0 @@ -title = 'Accounts Vins'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- render('_search', ['model' => $searchModel]); ?> - -

- 'btn btn-success']) ?> -

- - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'account_id', - 'id', - 'vin', - 'car_name', - 'car_mfa_id', - // 'car_model', - // 'car_mod_id', - // 'timestamp', - - ['class' => 'yii\grid\ActionColumn'], - ], - ]); ?> - -
diff --git a/backend/views/accounts_vin/update.php b/backend/views/accounts_vin/update.php deleted file mode 100644 index 7e2363a..0000000 --- a/backend/views/accounts_vin/update.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Update Accounts Vin: ' . ' ' . $model->account_id; -$this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->account_id, 'url' => ['view', 'account_id' => $model->account_id, 'id' => $model->id]]; -$this->params['breadcrumbs'][] = 'Update'; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/accounts_vin/view.php b/backend/views/accounts_vin/view.php deleted file mode 100644 index db0459b..0000000 --- a/backend/views/accounts_vin/view.php +++ /dev/null @@ -1,42 +0,0 @@ -title = $model->account_id; -$this->params['breadcrumbs'][] = ['label' => 'Accounts Vins', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- -

- $model->account_id, 'id' => $model->id], ['class' => 'btn btn-primary']) ?> - $model->account_id, 'id' => $model->id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'account_id', - 'id', - 'vin', - 'car_name', - 'car_mfa_id', - 'car_model', - 'car_mod_id', - 'timestamp', - ], - ]) ?> - -
diff --git a/backend/views/art-history/_form.php b/backend/views/art-history/_form.php new file mode 100644 index 0000000..48d35cd --- /dev/null +++ b/backend/views/art-history/_form.php @@ -0,0 +1,27 @@ + + +
+ + + + field($model, 'user_id')->textInput() ?> + + field($model, 'art')->textInput(['maxlength' => true]) ?> + + field($model, 'dt')->textInput(['maxlength' => true]) ?> + +
+ isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
diff --git a/backend/views/art-history/_search.php b/backend/views/art-history/_search.php new file mode 100644 index 0000000..aef33e2 --- /dev/null +++ b/backend/views/art-history/_search.php @@ -0,0 +1,33 @@ + + + diff --git a/backend/views/art-history/create.php b/backend/views/art-history/create.php new file mode 100644 index 0000000..bfa1c09 --- /dev/null +++ b/backend/views/art-history/create.php @@ -0,0 +1,21 @@ +title = 'Create Art History'; +$this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/art-history/index.php b/backend/views/art-history/index.php new file mode 100644 index 0000000..08b54e2 --- /dev/null +++ b/backend/views/art-history/index.php @@ -0,0 +1,35 @@ +title = 'Art Histories'; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ render('_search', ['model' => $searchModel]); ?> + +

+ 'btn btn-success']) ?> +

+ + $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + 'dt', + 'user_id', + 'accounts.name', + 'art', + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> + +
diff --git a/backend/views/art-history/update.php b/backend/views/art-history/update.php new file mode 100644 index 0000000..b762426 --- /dev/null +++ b/backend/views/art-history/update.php @@ -0,0 +1,21 @@ +title = 'Update Art History: ' . ' ' . $model->id; +$this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]]; +$this->params['breadcrumbs'][] = 'Update'; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/art-history/view.php b/backend/views/art-history/view.php new file mode 100644 index 0000000..03458a3 --- /dev/null +++ b/backend/views/art-history/view.php @@ -0,0 +1,38 @@ +title = $model->id; +$this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ +

+ $model->id], ['class' => 'btn btn-primary']) ?> + $model->id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => 'Are you sure you want to delete this item?', + 'method' => 'post', + ], + ]) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'user_id', + 'art', + 'dt', + ], + ]) ?> + +
diff --git a/backend/views/art_history/_form.php b/backend/views/art_history/_form.php deleted file mode 100644 index 48d35cd..0000000 --- a/backend/views/art_history/_form.php +++ /dev/null @@ -1,27 +0,0 @@ - - -
- - - - field($model, 'user_id')->textInput() ?> - - field($model, 'art')->textInput(['maxlength' => true]) ?> - - field($model, 'dt')->textInput(['maxlength' => true]) ?> - -
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/backend/views/art_history/_search.php b/backend/views/art_history/_search.php deleted file mode 100644 index aef33e2..0000000 --- a/backend/views/art_history/_search.php +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/backend/views/art_history/create.php b/backend/views/art_history/create.php deleted file mode 100644 index bfa1c09..0000000 --- a/backend/views/art_history/create.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Create Art History'; -$this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/art_history/index.php b/backend/views/art_history/index.php deleted file mode 100644 index 3b0cf13..0000000 --- a/backend/views/art_history/index.php +++ /dev/null @@ -1,37 +0,0 @@ -title = 'Art Histories'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- render('_search', ['model' => $searchModel]); ?> - -

- 'btn btn-success']) ?> -

- - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'id', - 'user_id', - 'art', - 'dt', - - ['class' => 'yii\grid\ActionColumn'], - ], - ]); ?> - -
diff --git a/backend/views/art_history/update.php b/backend/views/art_history/update.php deleted file mode 100644 index b762426..0000000 --- a/backend/views/art_history/update.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Update Art History: ' . ' ' . $model->id; -$this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]]; -$this->params['breadcrumbs'][] = 'Update'; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/art_history/view.php b/backend/views/art_history/view.php deleted file mode 100644 index 03458a3..0000000 --- a/backend/views/art_history/view.php +++ /dev/null @@ -1,38 +0,0 @@ -title = $model->id; -$this->params['breadcrumbs'][] = ['label' => 'Art Histories', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- -

- $model->id], ['class' => 'btn btn-primary']) ?> - $model->id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'id', - 'user_id', - 'art', - 'dt', - ], - ]) ?> - -
diff --git a/common/models/ArtHistory.php b/common/models/ArtHistory.php index 86c6fba..679a423 100644 --- a/common/models/ArtHistory.php +++ b/common/models/ArtHistory.php @@ -48,4 +48,10 @@ class ArtHistory extends \yii\db\ActiveRecord 'dt' => 'Dt', ]; } + + + public function getAccounts() + { + return $this->hasOne(Accounts::className(), ['id' => 'user_id']); + } } -- libgit2 0.21.4