From 961419be5db71d827e9bc1679bcae09b98c5af3e Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Fri, 7 Apr 2023 08:51:45 -0400 Subject: [PATCH] For #3730. Fix issue raised by @odiea and cleaned up the checkboxes on forms so that they render correctly. --- app/Views/attributes/item.php | 2 +- app/Views/cashups/form.php | 8 ++++---- app/Views/configs/barcode_config.php | 4 ++-- app/Views/configs/general_config.php | 22 +++++++++++----------- app/Views/configs/invoice_config.php | 4 ++-- app/Views/configs/locale_config.php | 4 ++-- app/Views/configs/receipt_config.php | 18 +++++++++--------- app/Views/configs/reward_config.php | 2 +- app/Views/configs/table_config.php | 2 +- app/Views/configs/tax_config.php | 4 ++-- app/Views/employees/form.php | 4 ++-- app/Views/expenses/form.php | 2 +- app/Views/items/form.php | 6 +++--- app/Views/receivings/receiving.php | 4 ++-- 14 files changed, 43 insertions(+), 43 deletions(-) diff --git a/app/Views/attributes/item.php b/app/Views/attributes/item.php index f0058ed3c..646585a8a 100644 --- a/app/Views/attributes/item.php +++ b/app/Views/attributes/item.php @@ -68,7 +68,7 @@ foreach($definition_values as $definition_id => $definition_value) 'name' => esc("attribute_links[$definition_id]"), 'id' => "attribute_links[$definition_id]", 'value' => 1, - 'checked' => ($value ? 1 : 0), + 'checked' => $value == 1, 'class' => 'checkbox-inline', 'data-definition-id' => $definition_id ]); diff --git a/app/Views/cashups/form.php b/app/Views/cashups/form.php index fd7562f87..6337aa1ca 100644 --- a/app/Views/cashups/form.php +++ b/app/Views/cashups/form.php @@ -128,8 +128,8 @@ 'name' => 'note', 'id' => 'note', 'value'=>0, - 'checked'=>($cash_ups_info->note) ? 1 : 0] - ) ?> + 'checked'=>$cash_ups_info->note == 1 + ]) ?> @@ -239,8 +239,8 @@ 'name' => 'deleted', 'id' => 'deleted', 'value'=>1, - 'checked'=>($cash_ups_info->deleted) ? 1 : 0] - ) ?> + 'checked'=>$cash_ups_info->deleted == 1 + ]) ?> 'allow_duplicate_barcodes', 'id' => 'allow_duplicate_barcodes', 'value' => 'allow_duplicate_barcodes', - 'checked' => $config['allow_duplicate_barcodes'] + 'checked' => $config['allow_duplicate_barcodes'] == 1 ]) ?>   diff --git a/app/Views/configs/general_config.php b/app/Views/configs/general_config.php index 694d80a4c..3dd79da52 100644 --- a/app/Views/configs/general_config.php +++ b/app/Views/configs/general_config.php @@ -40,7 +40,7 @@ ], esc(@$config['login_form']), ['class' => 'form-control input-sm'] - ) ?>s + ) ?> @@ -67,7 +67,7 @@ 'data-onstyle' => 'success', 'data-on' => '' . esc($config['currency_symbol']).'', 'data-off' => '%', - 'checked' => $config['default_sales_discount_type'] + 'checked' => $config['default_sales_discount_type'] == 1 ]) ?> @@ -97,7 +97,7 @@ 'data-onstyle' => 'success', 'data-on' => '' . esc($config['currency_symbol']) . '', 'data-off' => '%', - 'checked' => $config['default_receivings_discount_type'] + 'checked' => $config['default_receivings_discount_type'] == 1 ]) ?> @@ -111,7 +111,7 @@ 'name' => 'enforce_privacy', 'id' => 'enforce_privacy', 'value' => 'enforce_privacy', - 'checked' => $config['enforce_privacy'] + 'checked' => $config['enforce_privacy'] == 1 ]) ?>