implement ticket_type comment in frontend/backend

This commit is contained in:
Schneider Roland 2023-03-09 19:05:28 +01:00
parent 8d98f510d1
commit 176d42ea76
4 changed files with 73 additions and 57 deletions

View File

@ -31,6 +31,9 @@ use yii\helpers\ArrayHelper;
<?= $form->field($model, 'type')->dropDownList(TicketType::ticketTypes() ) ?>
<?= mkTitle("Megjegyzés")?>
<?= $form->field($model, 'comment')->textInput()->label("Megjegyzés") ?>
<?= mkTitle("Alkalmak")?>
<?= $form->field($model, 'max_usage_count')->textInput() ?>
<?= $form->field($model, 'max_reservation_count')->textInput() ?>

View File

@ -31,6 +31,10 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => $model->typeHuman
],
'max_usage_count',
[
'attribute' => 'comment',
'label' => "Megjegyzés"
],
'max_reservation_count',
[
'attribute' => 'time_unit_count',

View File

@ -128,7 +128,7 @@ class TicketType extends BaseFitnessActiveRecord
////////////////
[['door_allowed',], 'integer'],
[['door_allowed',], 'in', 'range' => [ self::FLAG_DOOR_ALLOWED_OFF, self::FLAG_DOOR_ALLOWED_ON ]],
[['comment'], 'string' ],
];
}

View File

@ -25,6 +25,15 @@ use common\components\Helper;
$accountOptions = HtmlHelper::mkAccountOptions($accounts);
$discountOptions = ['' => ''] + HtmlHelper::mkDiscountOptions($discounts, [ 'emptyOption' => true] );
$ticketTypeOptions = HtmlHelper::mkTicketTypeOptions($ticketTypes);
$ticketTypeOptions = [];
foreach ($ticketTypes as $ticketType){
$comment = "";
if ( isset($ticketType->comment)){
$comment = " (" . $ticketType->comment .")";
}
$ticketTypeOptions[$ticketType->id_ticket_type] = $ticketType->name . $comment;
}
// echo "default kassza: " . Account::readDefault();
// echo " kassza: " . $model->id_account;