From: Vladimir Fomichev Date: Tue, 3 Sep 2024 13:32:37 +0000 (+0300) Subject: поставил поисковую форму X-Git-Tag: 1.5~26^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=66b7baca7cb16cde6de3a1641140e730cc3a5fd2;p=erp24_rep%2Fyii-erp24%2F.git поставил поисковую форму --- diff --git a/erp24/actions/cabinet/IndexAction.php b/erp24/actions/cabinet/IndexAction.php index 912abca8..114d1d72 100755 --- a/erp24/actions/cabinet/IndexAction.php +++ b/erp24/actions/cabinet/IndexAction.php @@ -85,6 +85,19 @@ class IndexAction extends Action } + foreach ($adminFlorist as $storeName => $employees) { + // Фильтруем сотрудников, убираем уволенных + $adminFlorist[$storeName] = array_filter($employees, function ($employee) { + return strpos($employee, 'уволенные сотрудники') === false; + }); + + // Если в результате фильтрации подмассив стал пустым, можно удалить его + if (empty($adminFlorist[$storeName])) { + unset($adminFlorist[$storeName]); + } + } + + ksort($adminFlorist); $dateFrom = date("Y-m-01", time()); @@ -103,10 +116,12 @@ class IndexAction extends Action if (empty($daysSearchForm->dateFrom)) { $daysSearchForm->dateFrom = $dateFrom; + $daysSearchForm->dateFrom = date("Y-08-01", time()); } if (empty($daysSearchForm->dateTo)) { $daysSearchForm->dateTo = $dateTo; + $daysSearchForm->dateTo = date("Y-08-21", time()); } $dateFrom = $daysSearchForm->dateFrom; diff --git a/erp24/views/cabinet/_search_form.php b/erp24/views/cabinet/_search_form.php index 5bd9441f..141e971b 100755 --- a/erp24/views/cabinet/_search_form.php +++ b/erp24/views/cabinet/_search_form.php @@ -26,20 +26,6 @@ $searchForm = \yii\widgets\ActiveForm::begin([ } ?> - -
-
Сотрудник:
-
- field($daysSearchForm, 'employee_id')->widget(\kartik\select2\Select2::class, [ - 'data' => ArrayHelper::map($adminFlorist, 'id', 'name_full'), - 'language' => 'ru', - 'options' => ['placeholder' => 'Сотрудник...'], - 'pluginOptions' => [ - 'allowClear' => true - ], - ])->label(false) ?> -
-
field($daysSearchForm, 'dateFrom', [ diff --git a/erp24/views/cabinet/administrator.php b/erp24/views/cabinet/administrator.php index ee86bcad..a8ebdee2 100755 --- a/erp24/views/cabinet/administrator.php +++ b/erp24/views/cabinet/administrator.php @@ -161,7 +161,7 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

-
Сотрудник:
+ render('/cabinet/_search_form', [ 'person' => $person, 'adminFlorist' => $adminFlorist, diff --git a/erp24/views/cabinet/florist.php b/erp24/views/cabinet/florist.php index 047fdb5d..dd82dda9 100755 --- a/erp24/views/cabinet/florist.php +++ b/erp24/views/cabinet/florist.php @@ -144,7 +144,7 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

-
Сотрудник:
+ render('/cabinet/_search_form', [ 'person' => $person, 'adminFlorist' => $adminFlorist, diff --git a/erp24/views/cabinet/index.php b/erp24/views/cabinet/index.php index afec97ca..ac163a3c 100755 --- a/erp24/views/cabinet/index.php +++ b/erp24/views/cabinet/index.php @@ -80,8 +80,6 @@ $this->registerJsFile('/js/dashboard/index.js', ['position' => \yii\web\View::PO - -
field($daysSearchForm, 'dateFrom', [ diff --git a/erp24/views/cabinet202310/_search_form.php b/erp24/views/cabinet202310/_search_form.php index 141e971b..e19cdcc6 100755 --- a/erp24/views/cabinet202310/_search_form.php +++ b/erp24/views/cabinet202310/_search_form.php @@ -1,5 +1,6 @@ + */?>
+ +
+
+ + field($daysSearchForm, 'employeeId')->widget(\kartik\select2\Select2::class, [ + 'data' => $adminFlorist, + 'language' => 'ru', + 'options' => ['placeholder' => 'Сотрудник...'], + 'pluginOptions' => [ + 'allowClear' => true + ], + ])->label(false) ?> + +
+
field($daysSearchForm, 'dateFrom', [ @@ -55,4 +71,6 @@ $searchForm = \yii\widgets\ActiveForm::begin([
- \ No newline at end of file + + +