diff --git a/src/controllers/AdminMeasureController.php b/src/controllers/AdminMeasureController.php index 0794ba8..fc2f250 100644 --- a/src/controllers/AdminMeasureController.php +++ b/src/controllers/AdminMeasureController.php @@ -46,8 +46,7 @@ public function init() */ public function actions() { - return ArrayHelper::merge(parent::actions(), - [ + return ArrayHelper::merge(parent::actions(), [ 'index' => [ 'filters' => [ 'visibleFilters' => [ @@ -87,6 +86,14 @@ public function actions() "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0, ], + + "create" => [ + 'fields' => [$this, 'updateFields'], + ], + + "update" => [ + 'fields' => [$this, 'updateFields'], + ], ] ); } @@ -107,4 +114,14 @@ public function eachMultiDef($model, $action) } } + public function updateFields() { + return [ + 'code', + 'name', + 'symbol_rus', + 'symbol_intl', + 'symbol_letter_intl', + ]; + } + } diff --git a/src/views/admin-measure/_form.php b/src/views/admin-measure/_form.php deleted file mode 100644 index f5060d8..0000000 --- a/src/views/admin-measure/_form.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @link http://skeeks.com/ - * @copyright 2010 SkeekS (СкикС) - * @date 28.08.2015 - */ -use yii\helpers\Html; -use skeeks\cms\modules\admin\widgets\form\ActiveFormUseTab as ActiveForm; - -/* @var $this yii\web\View */ -?> - - - -fieldSet(\Yii::t('skeeks/measure','Main')); ?> - - fieldInputInt($model, 'code')->textInput(); ?> - field($model, 'name')->textInput(['maxlength' => 500]); ?> - field($model, 'symbol_rus')->textInput(['maxlength' => 20]); ?> - field($model, 'symbol_intl')->textInput(['maxlength' => 20]); ?> - field($model, 'symbol_letter_intl')->textInput(['maxlength' => 20]); ?> - -fieldSetEnd(); ?> - -buttonsCreateOrUpdate($model); ?> -