add skill and position
This commit is contained in:
@ -13,11 +13,8 @@ return [
|
||||
'bootstrap' => ['log'],
|
||||
|
||||
'modules' => [
|
||||
'status' => [
|
||||
'class' => 'backend\modules\status\Status',
|
||||
],
|
||||
'fields' => [
|
||||
'class' => 'backend\modules\fields\Fields',
|
||||
'settings' => [
|
||||
'class' => 'backend\modules\settings\Settings',
|
||||
],
|
||||
'card' => [
|
||||
'class' => 'backend\modules\card\Card',
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace backend\modules\card\controllers;
|
||||
|
||||
use common\classes\Debug;
|
||||
use common\models\CardSkill;
|
||||
use common\models\FieldsValue;
|
||||
use Yii;
|
||||
use backend\modules\card\models\UserCard;
|
||||
@ -62,9 +63,12 @@ class UserCardController extends Controller
|
||||
],
|
||||
]);
|
||||
|
||||
$skills = CardSkill::find()->where(['card_id' => $id])->with('skill')->all();
|
||||
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
'modelFildValue' => $dataProvider,
|
||||
'skills' => $skills,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,15 @@
|
||||
|
||||
namespace backend\modules\card\models;
|
||||
|
||||
use backend\modules\settings\models\Skill;
|
||||
use common\models\CardSkill;
|
||||
use common\models\FieldsValue;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
class UserCard extends \common\models\UserCard
|
||||
{
|
||||
public $fields;
|
||||
public $skill;
|
||||
|
||||
public function init()
|
||||
{
|
||||
@ -35,6 +39,15 @@ class UserCard extends \common\models\UserCard
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
$skill = ArrayHelper::getColumn(CardSkill::find()->where(['card_id' => \Yii::$app->request->get('id')])->all(),
|
||||
'skill_id');
|
||||
|
||||
if (!empty($skill)) {
|
||||
$this->skill = $skill;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function afterSave($insert, $changedAttributes)
|
||||
@ -53,6 +66,16 @@ class UserCard extends \common\models\UserCard
|
||||
$fildsValue->save();
|
||||
}
|
||||
|
||||
CardSkill::deleteAll(['card_id' => $this->id]);
|
||||
|
||||
foreach ( $post['skill'] as $item) {
|
||||
$skill = new CardSkill();
|
||||
$skill->skill_id = $item;
|
||||
$skill->card_id = $this->id;
|
||||
|
||||
$skill->save();
|
||||
}
|
||||
|
||||
parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use kartik\select2\Select2;
|
||||
use mihaildev\elfinder\InputFile;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use unclead\multipleinput\examples\models\ExampleModel;
|
||||
@ -103,12 +104,32 @@ use yii\widgets\ActiveForm;
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?>
|
||||
<?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<?= $form->field($model, 'position_id')->dropDownList(
|
||||
\yii\helpers\ArrayHelper::map(\backend\modules\settings\models\Position::find()->all(), 'id', 'name'),
|
||||
['prompt' => '...']
|
||||
) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?= $form->field($model, 'skill')->widget(Select2::class,
|
||||
[
|
||||
'data' => \yii\helpers\ArrayHelper::map(\common\models\Skill::find()->all(),'id', 'name'),
|
||||
'options' => ['placeholder' => '...','class' => 'form-control', 'multiple' => true],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true
|
||||
],
|
||||
]
|
||||
)->label('Навыки'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?= $form->field($model, 'fields')->widget(MultipleInput::class, [
|
||||
@ -119,7 +140,7 @@ use yii\widgets\ActiveForm;
|
||||
'type' => 'dropDownList',
|
||||
'title' => 'Поле',
|
||||
'defaultValue' => null,
|
||||
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\fields\models\AdditionalFields::find()
|
||||
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\settings\models\AdditionalFields::find()
|
||||
->joinWith('useFields')
|
||||
->where(['`use_field`.`use`' => \common\models\UseStatus::USE_PROFILE])
|
||||
->all(),
|
||||
|
@ -6,6 +6,8 @@ use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\card\models\UserCard */
|
||||
/* @var $skills \common\models\CardSkill */
|
||||
/* @var $skill \common\models\Skill */
|
||||
|
||||
$this->title = $model->fio;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'User Cards', 'url' => ['index']];
|
||||
@ -23,21 +25,21 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'fio',
|
||||
'passport',
|
||||
[
|
||||
'label' => 'Photo',
|
||||
'attribute' => 'Photo',
|
||||
'format' => 'raw',
|
||||
'value' => function($model){
|
||||
return Html::tag('img', null, ['src' => $model->photo, 'width' => '100px']);
|
||||
}
|
||||
],
|
||||
[
|
||||
'label' => 'Resume',
|
||||
'attribute' => 'Resume',
|
||||
'format' => 'raw',
|
||||
'value' => function($model){
|
||||
return Html::a('Скачать', $model->resume, ['target' => '_blank']);
|
||||
}
|
||||
],
|
||||
[
|
||||
'label' => 'gender',
|
||||
'attribute' => 'gender',
|
||||
'value' => $model->gendersText,
|
||||
],
|
||||
|
||||
@ -45,15 +47,24 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
'dob',
|
||||
[
|
||||
'label' => 'status',
|
||||
'attribute' => 'status',
|
||||
'value' => $model->status0->name,
|
||||
],
|
||||
'salary',
|
||||
[
|
||||
'attribute' => 'position_id',
|
||||
'value' => $model->position->name,
|
||||
],
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<h2>Навыки</h2>
|
||||
|
||||
<?php foreach ($skills as $skill): ?>
|
||||
<span class="btn btn-default btn-sm"><?= $skill['skill']->name; ?></span>
|
||||
<?php endforeach; ?>
|
||||
<h2>Дополнительные сведения</h2>
|
||||
|
||||
<?= GridView::widget([
|
||||
|
@ -40,7 +40,7 @@ use yii\widgets\ActiveForm;
|
||||
'type' => 'dropDownList',
|
||||
'title' => 'Поле',
|
||||
'defaultValue' => null,
|
||||
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\fields\models\AdditionalFields::find()
|
||||
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\settings\models\AdditionalFields::find()
|
||||
->joinWith('useFields')
|
||||
->where(['`use_field`.`use`' => \common\models\UseStatus::USE_PROJECT])
|
||||
->all(),
|
||||
|
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\fields;
|
||||
namespace backend\modules\settings;
|
||||
|
||||
/**
|
||||
* fields module definition class
|
||||
* settings module definition class
|
||||
*/
|
||||
class Fields extends \yii\base\Module
|
||||
class Settings extends \yii\base\Module
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $controllerNamespace = 'backend\modules\fields\controllers';
|
||||
public $controllerNamespace = 'backend\modules\settings\controllers';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\fields\controllers;
|
||||
namespace backend\modules\settings\controllers;
|
||||
|
||||
use Yii;
|
||||
use backend\modules\fields\models\AdditionalFields;
|
||||
use backend\modules\fields\models\AdditionalFieldsSearch;
|
||||
use backend\modules\settings\models\AdditionalFields;
|
||||
use backend\modules\settings\models\AdditionalFieldsSearch;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
127
backend/modules/settings/controllers/PositionController.php
Normal file
127
backend/modules/settings/controllers/PositionController.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\settings\controllers;
|
||||
|
||||
use Yii;
|
||||
use backend\modules\settings\models\Position;
|
||||
use backend\modules\settings\models\PositionSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* PositionController implements the CRUD actions for Position model.
|
||||
*/
|
||||
class PositionController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::class,
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Position models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new PositionSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single Position model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Position model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new Position();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Position model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing Position model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the Position model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return Position the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = Position::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
127
backend/modules/settings/controllers/SkillController.php
Normal file
127
backend/modules/settings/controllers/SkillController.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\settings\controllers;
|
||||
|
||||
use Yii;
|
||||
use backend\modules\settings\models\Skill;
|
||||
use backend\modules\settings\models\SkillSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* SkillController implements the CRUD actions for Skill model.
|
||||
*/
|
||||
class SkillController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Skill models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new SkillSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single Skill model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Skill model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new Skill();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Skill model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing Skill model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the Skill model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return Skill the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = Skill::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\status\controllers;
|
||||
namespace backend\modules\settings\controllers;
|
||||
|
||||
use Yii;
|
||||
use backend\modules\status\models\Status;
|
||||
use backend\modules\status\models\StatusSearch;
|
||||
use backend\modules\settings\models\Status;
|
||||
use backend\modules\settings\models\StatusSearch;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\fields\models;
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
use common\classes\Debug;
|
||||
use common\models\UseField;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\fields\models;
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
8
backend/modules/settings/models/Position.php
Normal file
8
backend/modules/settings/models/Position.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
class Position extends \common\models\Position
|
||||
{
|
||||
|
||||
}
|
69
backend/modules/settings/models/PositionSearch.php
Normal file
69
backend/modules/settings/models/PositionSearch.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use backend\modules\settings\models\Position;
|
||||
|
||||
/**
|
||||
* PositionSearch represents the model behind the search form of `backend\modules\settings\models\Position`.
|
||||
*/
|
||||
class PositionSearch extends Position
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['name'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = Position::find();
|
||||
|
||||
// add conditions that should always apply here
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
// grid filtering conditions
|
||||
$query->andFilterWhere([
|
||||
'id' => $this->id,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
8
backend/modules/settings/models/Skill.php
Normal file
8
backend/modules/settings/models/Skill.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
class Skill extends \common\models\Skill
|
||||
{
|
||||
|
||||
}
|
69
backend/modules/settings/models/SkillSearch.php
Normal file
69
backend/modules/settings/models/SkillSearch.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use backend\modules\settings\models\Skill;
|
||||
|
||||
/**
|
||||
* SkillSearch represents the model behind the search form of `backend\modules\settings\models\Skill`.
|
||||
*/
|
||||
class SkillSearch extends Skill
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['name'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = Skill::find();
|
||||
|
||||
// add conditions that should always apply here
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
// grid filtering conditions
|
||||
$query->andFilterWhere([
|
||||
'id' => $this->id,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\status\models;
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
use common\models\UseStatus;
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\status\models;
|
||||
namespace backend\modules\settings\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use backend\modules\status\models\Status;
|
||||
use backend\modules\settings\models\Status;
|
||||
|
||||
/**
|
||||
* StatusSearch represents the model behind the search form of `backend\modules\status\models\Status`.
|
23
backend/modules/settings/views/position/_form.php
Normal file
23
backend/modules/settings/views/position/_form.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Position */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="position-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
29
backend/modules/settings/views/position/_search.php
Normal file
29
backend/modules/settings/views/position/_search.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\PositionSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="position-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
19
backend/modules/settings/views/position/create.php
Normal file
19
backend/modules/settings/views/position/create.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Position */
|
||||
|
||||
$this->title = 'Новая должность';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Должности', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="position-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
33
backend/modules/settings/views/position/index.php
Normal file
33
backend/modules/settings/views/position/index.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\settings\models\PositionSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Должность';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="position-index">
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'name',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
18
backend/modules/settings/views/position/update.php
Normal file
18
backend/modules/settings/views/position/update.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Position */
|
||||
|
||||
$this->title = 'Редактирование: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Должности', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
?>
|
||||
<div class="position-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
35
backend/modules/settings/views/position/view.php
Normal file
35
backend/modules/settings/views/position/view.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Position */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Должности', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="position-view">
|
||||
|
||||
|
||||
<p>
|
||||
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
23
backend/modules/settings/views/skill/_form.php
Normal file
23
backend/modules/settings/views/skill/_form.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Skill */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="skill-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
29
backend/modules/settings/views/skill/_search.php
Normal file
29
backend/modules/settings/views/skill/_search.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\SkillSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="skill-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
19
backend/modules/settings/views/skill/create.php
Normal file
19
backend/modules/settings/views/skill/create.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Skill */
|
||||
|
||||
$this->title = 'Добавить';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Навыки', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="skill-create">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
33
backend/modules/settings/views/skill/index.php
Normal file
33
backend/modules/settings/views/skill/index.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\modules\settings\models\SkillSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Навыки';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="skill-index">
|
||||
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'name',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
18
backend/modules/settings/views/skill/update.php
Normal file
18
backend/modules/settings/views/skill/update.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Skill */
|
||||
|
||||
$this->title = 'Редактирование: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Навыки', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
?>
|
||||
<div class="skill-update">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
35
backend/modules/settings/views/skill/view.php
Normal file
35
backend/modules/settings/views/skill/view.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\settings\models\Skill */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Навыки', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="skill-view">
|
||||
|
||||
|
||||
<p>
|
||||
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
@ -7,7 +7,7 @@ use yii\grid\GridView;
|
||||
/* @var $searchModel backend\modules\status\models\StatusSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Statuses';
|
||||
$this->title = 'Статусы';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="status-index">
|
@ -3,10 +3,9 @@
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\modules\status\models\Status */
|
||||
|
||||
$this->title = 'Update Status: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Statuses', 'url' => ['index']];
|
||||
$this->title = 'Редактирование: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Статусы', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'Update';
|
||||
?>
|
||||
<div class="status-update">
|
||||
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace backend\modules\status;
|
||||
|
||||
/**
|
||||
* status module definition class
|
||||
*/
|
||||
class Status extends \yii\base\Module
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $controllerNamespace = 'backend\modules\status\controllers';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
// custom initialization code goes here
|
||||
}
|
||||
}
|
@ -5,8 +5,16 @@
|
||||
[
|
||||
'options' => ['class' => 'sidebar-menu tree', 'data-widget' => 'tree'],
|
||||
'items' => [
|
||||
['label' => 'Статусы', 'icon' => 'anchor', 'url' => ['/status/status']],
|
||||
['label' => 'Доп. поля', 'icon' => 'file-text-o', 'url' => ['/fields/additional-fields']],
|
||||
[
|
||||
'label' => 'Настройки', 'icon' => 'gears', 'url' => '#',
|
||||
'items' => [
|
||||
['label' => 'Статусы', 'icon' => 'anchor', 'url' => ['/settings/status']],
|
||||
['label' => 'Доп. поля', 'icon' => 'file-text-o', 'url' => ['/settings/additional-fields']],
|
||||
['label' => 'Должность', 'icon' => 'spotify', 'url' => ['/settings/position']],
|
||||
['label' => 'Навыки', 'icon' => 'flask', 'url' => ['/settings/skill']],
|
||||
]
|
||||
],
|
||||
|
||||
['label' => 'Профили', 'icon' => 'users', 'url' => ['/card/user-card']],
|
||||
['label' => 'Пректы', 'icon' => 'files-o', 'url' => ['/project/project']],
|
||||
['label' => 'Компании', 'icon' => 'files-o', 'url' => ['/company/company']],
|
||||
|
Reference in New Issue
Block a user