diff --git a/migrations/m170714_090429_add_default_columns.php b/migrations/m170714_090429_add_default_columns.php new file mode 100644 index 0000000..5fea8c0 --- /dev/null +++ b/migrations/m170714_090429_add_default_columns.php @@ -0,0 +1,35 @@ +addColumn('label', 'default', $this->boolean()->defaultValue(false)); + $this->addColumn('delivery', 'default', $this->boolean()->defaultValue(false)); + $this->addColumn('payment', 'default', $this->boolean()->defaultValue(false)); + } + + public function safeDown() + { + echo "m170714_090429_add_default_columns cannot be reverted.\n"; + + return false; + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m170714_090429_add_default_columns cannot be reverted.\n"; + + return false; + } + */ +} diff --git a/models/Label.php b/models/Label.php index caeaed9..17dfae9 100755 --- a/models/Label.php +++ b/models/Label.php @@ -88,6 +88,10 @@ [ 'status' ], 'boolean', ], + [ + [ 'default' ], + 'boolean', + ], ]; } @@ -102,6 +106,7 @@ 'value' => Yii::t('order', 'Value'), 'status' => Yii::t('order', 'Status'), 'color' => Yii::t('order', 'Color'), + 'default'=> Yii::t('order', 'Default'), ]; } diff --git a/views/label/_form.php b/views/label/_form.php index 4addf0a..ca1d97a 100755 --- a/views/label/_form.php +++ b/views/label/_form.php @@ -37,6 +37,12 @@ 'class' => 'flat', ] ) ?> + field($model, 'default') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> field($model, 'color') -- libgit2 0.21.4