From 896256179ec05c6a51cce2c78f3ae98f2725e4b1 Mon Sep 17 00:00:00 2001 From: gabriel-IPTI <115715913+gabriel-IPTI@users.noreply.github.com> Date: Thu, 4 May 2023 12:21:18 -0300 Subject: [PATCH] =?UTF-8?q?adicionando=20campo=20de=20truno=20no=20cadastr?= =?UTF-8?q?o=20de=20card=C3=A1pio=20(#286)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * primeiro commit * adicionando campo de truno no cadastro de cardápio * atualizando versão do changelog --- CHANGELOG.md | 2 ++ .../lunch/controllers/LunchController.php | 3 +- app/modules/lunch/messages/pt_br/labels.php | 1 + app/modules/lunch/models/Menu.php | 2 ++ config.php | 2 +- themes/default/views/lunch/lunch/_form.php | 32 +++++++++++-------- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a24c567..3fcf64752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Atualizações +## [Versão 3.17.35] +- Adicionando campo de truno no cadastro de cardápio ## [Versão 3.16.35] - Mudando a ordenação 'default' dos alunos na página Ordem no Diário - Colocado campo de número do ató no formulário de escola diff --git a/app/modules/lunch/controllers/LunchController.php b/app/modules/lunch/controllers/LunchController.php index 82f245430..88355bb29 100755 --- a/app/modules/lunch/controllers/LunchController.php +++ b/app/modules/lunch/controllers/LunchController.php @@ -23,7 +23,7 @@ public function actionCreate(){ $menu = new Menu(); $menu->date = date("Y-m-d h:i:s"); - + $menu->turn = $menuPost["turn"]; if($menuPost){ $menu->attributes = $menuPost; $menu->date = date("Y-m-d h:i:s"); @@ -52,6 +52,7 @@ public function actionUpdate($id){ if($menuPost){ $menu->name = $menuPost['name']; + $menu->turn = $menuPost["turn"]; if($menu->validate()){ $menu->save(); Log::model()->saveAction("lunch_menu", $menu->id, "U", $menu->name); diff --git a/app/modules/lunch/messages/pt_br/labels.php b/app/modules/lunch/messages/pt_br/labels.php index ab09263d1..e5132e285 100755 --- a/app/modules/lunch/messages/pt_br/labels.php +++ b/app/modules/lunch/messages/pt_br/labels.php @@ -6,6 +6,7 @@ "Item" => "Item", "Amount" => "Quantidade", "Name" => "Nome", + "Turn" => "Turno", "Description" => "Descrição", "Unity" => "Unidade", "Measure" => "Medida", diff --git a/app/modules/lunch/models/Menu.php b/app/modules/lunch/models/Menu.php index 08995515c..32349247f 100755 --- a/app/modules/lunch/models/Menu.php +++ b/app/modules/lunch/models/Menu.php @@ -6,6 +6,7 @@ * The followings are the available columns in table 'lunch_menu': * @property integer $id * @property string $name + * @property string $turn * @property string $date * @property string $school_fk * @@ -64,6 +65,7 @@ public function attributeLabels(){ 'id' => Yii::t('lunchModule.labels', 'ID'), 'date' => Yii::t('lunchModule.labels', 'Date Creation'), 'name' => Yii::t('lunchModule.labels', 'Name'), + 'turn' => Yii::t('lunchModule.labels', 'Turn'), 'school' => Yii::t('lunchModule.labels', 'School'), ); } diff --git a/config.php b/config.php index 413a55e28..8d9de405a 100644 --- a/config.php +++ b/config.php @@ -2,7 +2,7 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); // defined('YII_DEBUG') or define('YII_DEBUG', false); -define("TAG_VERSION", '3.16.35'); +define("TAG_VERSION", '3.17.35'); define("YII_VERSION", Yii::getVersion()); diff --git a/themes/default/views/lunch/lunch/_form.php b/themes/default/views/lunch/lunch/_form.php index f18db5774..b2e93a96c 100755 --- a/themes/default/views/lunch/lunch/_form.php +++ b/themes/default/views/lunch/lunch/_form.php @@ -42,29 +42,33 @@ -
-
+
+
-
-

- -

-
-
- "control-label"]) ?> +
+ "control-label t-field-text__label"]) ?> - date)), ['class' => "span8 form-control", "readonly" => "readonly"]) ?> - date, ['class' => "span10 form-control", "readonly" => "readonly"]) ?> + date)), ['class' => "form-control t-field-text____input", "readonly" => "readonly"]) ?> + date, ['class' => "form-control t-field-text____input", "readonly" => "readonly"]) ?>
-
- "control-label"]) ?> +
+ "t-field-text__label"]) ?> - name, ['class' => "span8 form-control", 'placeholder' => 'Digite o Nome do Cardápio']) ?> + name, ['class' => "t-field-text__input", 'placeholder' => 'Digite o Nome do Cardápio']) ?>
+
+ "t-field-select__label"])?> + + turn, + ['M'=>'Manhã', 'T' => 'Tarde', 'N' => 'Noite'], ["class" => "select-search-on t-field-select__input"])?> +
+ + +