Skip to content

Commit

Permalink
adicionando campo de truno no cadastro de cardápio (#286)
Browse files Browse the repository at this point in the history
* primeiro commit

* adicionando campo de truno no cadastro de cardápio

* atualizando versão do changelog
  • Loading branch information
gabriel-IPTI authored May 4, 2023
1 parent c318fc1 commit 8962561
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/modules/lunch/controllers/LunchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions app/modules/lunch/messages/pt_br/labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Item" => "Item",
"Amount" => "Quantidade",
"Name" => "Nome",
"Turn" => "Turno",
"Description" => "Descrição",
"Unity" => "Unidade",
"Measure" => "Medida",
Expand Down
2 changes: 2 additions & 0 deletions app/modules/lunch/models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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'),
);
}
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
32 changes: 18 additions & 14 deletions themes/default/views/lunch/lunch/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,33 @@
</div>
<?php endif ?>

<div class="row-fluid">
<div class="span12">
<div class="row">
<div class="column no-grow">
<div class="container-box form-container">
<div class="form-group-container">
<h4 class="heading glyphicons notes">
<i></i><?= yii::t('lunchModule.lunch', 'Menu Info') ?>
</h4>
</div>
<div class="form-group-container">
<?= CHTML::activeLabel($menuModel, 'date', ['class' => "control-label"]) ?>
<div class="t-field-text">
<?= CHTML::activeLabel($menuModel, 'date', ['class' => "control-label t-field-text__label"]) ?>

<?php $date = 'date';
?>
<?= CHTML::textField("none", date("d/m/Y", strtotime($menuModel->date)), ['class' => "span8 form-control", "readonly" => "readonly"]) ?>
<?= CHTML::hiddenField(chtml::resolveName($menuModel, $date), $menuModel->date, ['class' => "span10 form-control", "readonly" => "readonly"]) ?>
<?= CHTML::textField("none", date("d/m/Y", strtotime($menuModel->date)), ['class' => "form-control t-field-text____input", "readonly" => "readonly"]) ?>
<?= CHTML::hiddenField(chtml::resolveName($menuModel, $date), $menuModel->date, ['class' => "form-control t-field-text____input", "readonly" => "readonly"]) ?>

</div>
<div class="form-group-container">
<?= CHTML::activeLabel($menuModel, 'name', ['class' => "control-label"]) ?>
<div class="t-field-text">
<?= CHTML::activeLabel($menuModel, 'name', ['class' => "t-field-text__label"]) ?>
<?php $name = 'name'; ?>
<?= CHTML::textField(chtml::resolveName($menuModel, $name), $menuModel->name, ['class' => "span8 form-control", 'placeholder' => 'Digite o Nome do Cardápio']) ?>
<?= CHTML::textField(chtml::resolveName($menuModel, $name), $menuModel->name, ['class' => "t-field-text__input", 'placeholder' => 'Digite o Nome do Cardápio']) ?>

</div>
<div class="t-field-select">
<?= CHTML::activeLabel($menuModel, 'turn', ['class' => "t-field-select__label"])?>
<?php $turn = 'turn'; ?>
<?= CHtml::dropDownList(chtml::resolveName($menuModel, $turn), $menuModel->turn,
['M'=>'Manhã', 'T' => 'Tarde', 'N' => 'Noite'], ["class" => "select-search-on t-field-select__input"])?>
</div>



<div class="form-group-container">
<div class="t-buttons-container">
<button type="submit" class="t-button-primary">
Expand Down

0 comments on commit 8962561

Please # to comment.