commit
88212626a6
@ -48,6 +48,11 @@ class ReportsSearch extends Reports
|
|||||||
|
|
||||||
$dataProvider = new ActiveDataProvider([
|
$dataProvider = new ActiveDataProvider([
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
|
'sort' => [
|
||||||
|
'defaultOrder' => [
|
||||||
|
'created_at' => SORT_DESC,
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->load($params);
|
$this->load($params);
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
use yii\grid\GridView;
|
use yii\grid\GridView;
|
||||||
|
|
||||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||||
|
/* @var $pages */
|
||||||
|
|
||||||
echo GridView::widget([
|
echo GridView::widget([
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
|
|
||||||
'columns' => [
|
'columns' => [
|
||||||
['class' => 'yii\grid\SerialColumn'],
|
['class' => 'yii\grid\SerialColumn'],
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use kartik\date\DatePicker;
|
||||||
|
use kartik\datetime\DateTimePicker;
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
use yii\widgets\ActiveForm;
|
use yii\widgets\ActiveForm;
|
||||||
|
|
||||||
@ -10,18 +12,27 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
<div class="reports-form">
|
<div class="reports-form">
|
||||||
|
|
||||||
<?php $form = ActiveForm::begin(); ?>
|
<?php $form = ActiveForm::begin();
|
||||||
|
|
||||||
<?= $form->field($model, 'created_at')->input(
|
$now = time();
|
||||||
'date',
|
$day = idate('d', $now);
|
||||||
[
|
$month = idate('m', $now);
|
||||||
'placeholder' => 'Zadejte svůj Datum narození',
|
$year = idate('Y', $now);
|
||||||
'language' => 'en',
|
$date = $year."-".$month."-".$day;
|
||||||
"data-format" => "DD MMMM YYYY",
|
|
||||||
'class' => 'form-control report-date'
|
|
||||||
|
|
||||||
|
if(!$model->created_at)
|
||||||
|
$model->created_at = $date;
|
||||||
|
echo '<b>Дата заполнения отчета:</b>';
|
||||||
|
echo DatePicker::widget([
|
||||||
|
'model' => $model,
|
||||||
|
'attribute' => 'created_at',
|
||||||
|
'options' => [],
|
||||||
|
'pluginOptions' => [
|
||||||
|
'autoclose' => true,
|
||||||
|
'format' => 'yyyy-mm-dd'
|
||||||
]
|
]
|
||||||
) ?>
|
]).'<br>';
|
||||||
|
?>
|
||||||
|
|
||||||
<?= $form->field($model, 'today')->textarea(['maxlength' => true]) ?>
|
<?= $form->field($model, 'today')->textarea(['maxlength' => true]) ?>
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use backend\modules\reports\models\ReportsSearch;
|
use backend\modules\reports\models\ReportsSearch;
|
||||||
use kartik\grid\GridView;
|
use kartik\grid\GridView;
|
||||||
|
use yii\data\Pagination;
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
|
|
||||||
/* @var $this yii\web\View */
|
/* @var $this yii\web\View */
|
||||||
@ -38,6 +39,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
$searchReports = new ReportsSearch();
|
$searchReports = new ReportsSearch();
|
||||||
$providerReports = $searchReports->search(Yii::$app->request->queryParams);
|
$providerReports = $searchReports->search(Yii::$app->request->queryParams);
|
||||||
$providerReports->query->andWhere(['user_card.id_user' => $model->id_user]);
|
$providerReports->query->andWhere(['user_card.id_user' => $model->id_user]);
|
||||||
|
$providerReports->pagination->pageSize = 10;
|
||||||
|
|
||||||
return Yii::$app->controller->renderPartial('_expand-row-details', ['dataProvider' => $providerReports]);
|
return Yii::$app->controller->renderPartial('_expand-row-details', ['dataProvider' => $providerReports]);
|
||||||
},
|
},
|
||||||
|
@ -5,9 +5,9 @@ use yii\helpers\Html;
|
|||||||
/* @var $this yii\web\View */
|
/* @var $this yii\web\View */
|
||||||
/* @var $model common\models\Reports */
|
/* @var $model common\models\Reports */
|
||||||
|
|
||||||
$this->title = 'Редактировать отчет';
|
$this->title = 'Редактировать отчет ' . $model->created_at;
|
||||||
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
||||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
$this->params['breadcrumbs'][] = ['label' => $model->created_at, 'url' => ['view', 'id' => $model->id]];
|
||||||
$this->params['breadcrumbs'][] = 'Редактировать';
|
$this->params['breadcrumbs'][] = 'Редактировать';
|
||||||
?>
|
?>
|
||||||
<div class="reports-update">
|
<div class="reports-update">
|
||||||
|
@ -6,7 +6,7 @@ use yii\widgets\DetailView;
|
|||||||
/* @var $this yii\web\View */
|
/* @var $this yii\web\View */
|
||||||
/* @var $model common\models\Reports */
|
/* @var $model common\models\Reports */
|
||||||
|
|
||||||
$this->title = 'Отчет';
|
$this->title = $model->created_at;
|
||||||
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
\yii\web\YiiAsset::register($this);
|
\yii\web\YiiAsset::register($this);
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
"mirocow/yii2-eav": "*",
|
"mirocow/yii2-eav": "*",
|
||||||
"kartik-v/yii2-widget-fileinput": "^1.0",
|
"kartik-v/yii2-widget-fileinput": "^1.0",
|
||||||
"2amigos/yii2-file-upload-widget": "~1.0",
|
"2amigos/yii2-file-upload-widget": "~1.0",
|
||||||
"kartik-v/yii2-grid": "dev-master"
|
"kartik-v/yii2-grid": "dev-master",
|
||||||
|
"kartik-v/yii2-widget-datetimepicker": "dev-master"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"yiisoft/yii2-debug": "~2.0.0",
|
"yiisoft/yii2-debug": "~2.0.0",
|
||||||
|
63
composer.lock
generated
63
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "27fb15c02f7c345930818f5f2b532cf8",
|
"content-hash": "fa1395e986b21ee60c85db006a32bcc9",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "2amigos/yii2-file-upload-widget",
|
"name": "2amigos/yii2-file-upload-widget",
|
||||||
@ -257,7 +257,7 @@
|
|||||||
"version": "v3.4.1",
|
"version": "v3.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@github.com:twbs/bootstrap.git",
|
"url": "https://github.com/twbs/bootstrap.git",
|
||||||
"reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e"
|
"reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
@ -317,7 +317,7 @@
|
|||||||
"version": "1.12.1",
|
"version": "1.12.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/components/jqueryui.git",
|
"url": "git@github.com:components/jqueryui.git",
|
||||||
"reference": "44ecf3794cc56b65954cc19737234a3119d036cc"
|
"reference": "44ecf3794cc56b65954cc19737234a3119d036cc"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
@ -1049,6 +1049,60 @@
|
|||||||
],
|
],
|
||||||
"time": "2019-08-23T17:23:20+00:00"
|
"time": "2019-08-23T17:23:20+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "kartik-v/yii2-widget-datetimepicker",
|
||||||
|
"version": "dev-master",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/kartik-v/yii2-widget-datetimepicker.git",
|
||||||
|
"reference": "c201f98d3b8e41dcce2c70678ae31008246fc430"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/kartik-v/yii2-widget-datetimepicker/zipball/c201f98d3b8e41dcce2c70678ae31008246fc430",
|
||||||
|
"reference": "c201f98d3b8e41dcce2c70678ae31008246fc430",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"kartik-v/yii2-krajee-base": ">=2.0.0"
|
||||||
|
},
|
||||||
|
"type": "yii2-extension",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.4.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"kartik\\datetime\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Kartik Visweswaran",
|
||||||
|
"email": "kartikv2@gmail.com",
|
||||||
|
"homepage": "http://www.krajee.com/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)",
|
||||||
|
"homepage": "https://github.com/kartik-v/yii2-widget-datetimepicker",
|
||||||
|
"keywords": [
|
||||||
|
"datetime",
|
||||||
|
"extension",
|
||||||
|
"form",
|
||||||
|
"jquery",
|
||||||
|
"picker",
|
||||||
|
"plugin",
|
||||||
|
"select2",
|
||||||
|
"widget",
|
||||||
|
"yii2"
|
||||||
|
],
|
||||||
|
"time": "2019-12-16T09:37:15+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "kartik-v/yii2-widget-fileinput",
|
"name": "kartik-v/yii2-widget-fileinput",
|
||||||
"version": "v1.0.9",
|
"version": "v1.0.9",
|
||||||
@ -4945,7 +4999,8 @@
|
|||||||
"kartik-v/yii2-widget-select2": 20,
|
"kartik-v/yii2-widget-select2": 20,
|
||||||
"kavalar/hhapi": 20,
|
"kavalar/hhapi": 20,
|
||||||
"kartik-v/yii2-widget-datepicker": 20,
|
"kartik-v/yii2-widget-datepicker": 20,
|
||||||
"kartik-v/yii2-grid": 20
|
"kartik-v/yii2-grid": 20,
|
||||||
|
"kartik-v/yii2-widget-datetimepicker": 20
|
||||||
},
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
|
@ -4,8 +4,8 @@ namespace frontend\modules\access\controllers;
|
|||||||
|
|
||||||
use Yii;
|
use Yii;
|
||||||
use common\models\Accesses;
|
use common\models\Accesses;
|
||||||
use frontend\modules\access\models\AccessSearch;
|
|
||||||
use yii\data\ActiveDataProvider;
|
use yii\data\ActiveDataProvider;
|
||||||
|
use yii\filters\AccessControl;
|
||||||
use yii\web\Controller;
|
use yii\web\Controller;
|
||||||
use yii\web\NotFoundHttpException;
|
use yii\web\NotFoundHttpException;
|
||||||
use yii\filters\VerbFilter;
|
use yii\filters\VerbFilter;
|
||||||
@ -27,6 +27,15 @@ class AccessController extends Controller
|
|||||||
'delete' => ['POST'],
|
'delete' => ['POST'],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'access' => [
|
||||||
|
'class' => AccessControl::className(),
|
||||||
|
'rules' => [
|
||||||
|
[
|
||||||
|
'allow' => true,
|
||||||
|
'roles' => ['@'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class UserCardController extends Controller
|
|||||||
return [
|
return [
|
||||||
'access' => [
|
'access' => [
|
||||||
'class' => AccessControl::className(),
|
'class' => AccessControl::className(),
|
||||||
'only' => ['index', 'update'],
|
//'only' => ['index', 'update'],
|
||||||
'rules' => [
|
'rules' => [
|
||||||
[
|
[
|
||||||
'allow' => true,
|
'allow' => true,
|
||||||
|
@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
namespace frontend\modules\reports\controllers;
|
namespace frontend\modules\reports\controllers;
|
||||||
|
|
||||||
use common\classes\Debug;
|
|
||||||
use common\models\Accesses;
|
|
||||||
use Yii;
|
use Yii;
|
||||||
use common\models\Reports;
|
use common\models\Reports;
|
||||||
use frontend\modules\reports\models\ReportsSearch;
|
use frontend\modules\reports\models\ReportsSearch;
|
||||||
use yii\data\ActiveDataProvider;
|
use yii\filters\AccessControl;
|
||||||
use yii\web\Controller;
|
use yii\web\Controller;
|
||||||
use yii\web\NotFoundHttpException;
|
use yii\web\NotFoundHttpException;
|
||||||
use yii\filters\VerbFilter;
|
use yii\filters\VerbFilter;
|
||||||
@ -29,6 +27,15 @@ class ReportsController extends Controller
|
|||||||
'delete' => ['POST'],
|
'delete' => ['POST'],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'access' => [
|
||||||
|
'class' => AccessControl::className(),
|
||||||
|
'rules' => [
|
||||||
|
[
|
||||||
|
'allow' => true,
|
||||||
|
'roles' => ['@'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +46,11 @@ class ReportsSearch extends Reports
|
|||||||
|
|
||||||
$dataProvider = new ActiveDataProvider([
|
$dataProvider = new ActiveDataProvider([
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
|
'sort' => [
|
||||||
|
'defaultOrder' => [
|
||||||
|
'created_at' => SORT_DESC,
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->load($params);
|
$this->load($params);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use kartik\date\DatePicker;
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
use yii\widgets\ActiveForm;
|
use yii\widgets\ActiveForm;
|
||||||
|
|
||||||
@ -12,22 +13,32 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
<?php $form = ActiveForm::begin(); ?>
|
<?php $form = ActiveForm::begin(); ?>
|
||||||
|
|
||||||
<?= $form->field($model, 'created_at')->input(
|
<?php
|
||||||
'date',
|
$now = time();
|
||||||
[
|
$day = idate('d', $now);
|
||||||
'placeholder' => 'Zadejte svůj Datum narození',
|
$month = idate('m', $now);
|
||||||
'language' => 'en',
|
$year = idate('Y', $now);
|
||||||
"data-format" => "DD MMMM YYYY",
|
$date = $year."-".$month."-".$day;
|
||||||
'class' => 'form-control report-date'
|
|
||||||
|
|
||||||
|
if(!$model->created_at)
|
||||||
|
$model->created_at = $date;
|
||||||
|
echo '<b>Дата заполнения отчета:</b>';
|
||||||
|
echo DatePicker::widget([
|
||||||
|
'model' => $model,
|
||||||
|
'attribute' => 'created_at',
|
||||||
|
'options' => [],
|
||||||
|
'pluginOptions' => [
|
||||||
|
'autoclose' => true,
|
||||||
|
'format' => 'yyyy-mm-dd'
|
||||||
]
|
]
|
||||||
) ?>
|
]).'<br>';
|
||||||
|
?>
|
||||||
|
|
||||||
<?= $form->field($model, 'today')->textInput(['maxlength' => true]) ?>
|
<?= $form->field($model, 'today')->textarea(['maxlength' => true]) ?>
|
||||||
|
|
||||||
<?= $form->field($model, 'difficulties')->textInput(['maxlength' => true]) ?>
|
<?= $form->field($model, 'difficulties')->textarea(['maxlength' => true]) ?>
|
||||||
|
|
||||||
<?= $form->field($model, 'tomorrow')->textInput(['maxlength' => true]) ?>
|
<?= $form->field($model, 'tomorrow')->textarea(['maxlength' => true]) ?>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
|
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
|
||||||
|
@ -24,13 +24,25 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'columns' => [
|
'columns' => [
|
||||||
['class' => 'yii\grid\SerialColumn'],
|
['class' => 'yii\grid\SerialColumn'],
|
||||||
|
|
||||||
// 'id',
|
|
||||||
'created_at',
|
'created_at',
|
||||||
'today',
|
[
|
||||||
'difficulties',
|
'format' => 'raw',
|
||||||
'tomorrow',
|
'attribute' => 'Что было сделано сегодня?',
|
||||||
// 'user_card_id',
|
'filter' => Html::activeTextInput($searchModel, 'today', ['class' => 'form-control']),
|
||||||
//'status',
|
'value' => function ($data) { return '<div class="custom-text">'.$data->today.'</div>'; },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'format' => 'raw',
|
||||||
|
'attribute' => 'Какие сложности возникли?',
|
||||||
|
'filter' => Html::activeTextInput($searchModel, 'difficulties', ['class' => 'form-control']),
|
||||||
|
'value' => function ($data) { return '<div class="custom-text">'.$data->difficulties.'</div>'; },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'format' => 'raw',
|
||||||
|
'attribute' => 'Что планируется сделать завтра?',
|
||||||
|
'filter' => Html::activeTextInput($searchModel, 'tomorrow', ['class' => 'form-control']),
|
||||||
|
'value' => function ($data) { return '<div class="custom-text">'.$data->tomorrow.'</div>'; },
|
||||||
|
],
|
||||||
|
|
||||||
['class' => 'yii\grid\ActionColumn'],
|
['class' => 'yii\grid\ActionColumn'],
|
||||||
],
|
],
|
||||||
|
@ -7,7 +7,7 @@ use yii\helpers\Html;
|
|||||||
|
|
||||||
$this->title = 'Редактировать отчет';
|
$this->title = 'Редактировать отчет';
|
||||||
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
||||||
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
|
$this->params['breadcrumbs'][] = ['label' => $model->created_at, 'url' => ['view', 'id' => $model->id]];
|
||||||
$this->params['breadcrumbs'][] = 'Редактировать';
|
$this->params['breadcrumbs'][] = 'Редактировать';
|
||||||
?>
|
?>
|
||||||
<div class="reports-update">
|
<div class="reports-update">
|
||||||
|
@ -6,7 +6,7 @@ use yii\widgets\DetailView;
|
|||||||
/* @var $this yii\web\View */
|
/* @var $this yii\web\View */
|
||||||
/* @var $model common\models\Reports */
|
/* @var $model common\models\Reports */
|
||||||
|
|
||||||
$this->title = $model->id;
|
$this->title = $model->created_at;
|
||||||
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
$this->params['breadcrumbs'][] = ['label' => 'Отчеты', 'url' => ['index']];
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
\yii\web\YiiAsset::register($this);
|
\yii\web\YiiAsset::register($this);
|
||||||
|
@ -126,3 +126,7 @@ a.desc:after {
|
|||||||
.report-date {
|
.report-date {
|
||||||
width: 155px;
|
width: 155px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-text {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user