]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Деактивация форм
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 7 Aug 2025 11:34:14 +0000 (14:34 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 7 Aug 2025 11:34:14 +0000 (14:34 +0300)
erp24/views/products1c-nomenclature-actuality/index.php

index 02296dd202d17ce76c56403fa7e99b9d59a640a5..f0998b1fd7ef81a369e35666b6ae2513125b0dbe 100644 (file)
@@ -235,7 +235,7 @@ $months = monthList();
     <!-- Форма массового обновления актуальности -->
     <?php $form = ActiveForm::begin(['id' => 'actuality-form']); ?>
     <div class="form-group d-flex justify-content-end">
-        <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
+        <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success', 'id' => 'saveButton']) ?>
     </div>
     <?= GridView::widget([
         'dataProvider' => $dataProvider,
@@ -280,15 +280,18 @@ $months = monthList();
                         $from = $active ? (new \DateTime($active->date_from))->format('Y-m') : null;
                         $to   = $active ? (new \DateTime($active->date_to))->format('Y-m') : null;
                     }
+
                     return Html::hiddenInput("actuality[$i][guid]", $m->id)
                         . Html::tag('div',
                             Html::dropDownList("actuality[$i][from]", $from, $months, [
                                 'class'=>'form-select from-month form-select-sm me-1',
-                                'prompt'=>'от'
+                                'prompt'=>'от',
+                                'disabled' => $filter->onlyInactive ? true : null
                             ])
                             . Html::dropDownList("actuality[$i][to]", $to, $months, [
                                 'class'=>'form-select to-month form-select-sm',
-                                'prompt'=>'до'
+                                'prompt'=>'до',
+                                'disabled' => $filter->onlyInactive ? true : null
                             ]),
                             ['class'=>'d-flex align-items-center']
                         );
@@ -298,16 +301,20 @@ $months = monthList();
                 'label' => 'Склад NN',
                 'format' => 'raw',
                 'contentOptions' => ['style'=>'width:60px; text-align:center;'],
-                'value' => function ($m, $k, $i) {
-                    return Html::checkbox("actuality[$i][warehouse_nn]", false);
+                'value' => function ($m, $k, $i) use ($filter){
+                    return Html::checkbox("actuality[$i][warehouse_nn]", false, [
+                        'disabled' => $filter->onlyInactive ? true : null
+                    ]);
                 }
             ],
             [
                 'label' => 'Склад MSK',
                 'format' => 'raw',
                 'contentOptions' => ['style'=>'width:60px; text-align:center;'],
-                'value' => function ($m, $k, $i) {
-                    return Html::checkbox("actuality[$i][warehouse_msk]", false);
+                'value' => function ($m, $k, $i) use ($filter){
+                    return Html::checkbox("actuality[$i][warehouse_msk]", false, [
+                        'disabled' => $filter->onlyInactive ? true : null
+                    ]);
                 }
             ],
             [