diff --git a/README.md b/README.md index ecd695b8f..4192cb67c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@
Introduction · Demo · Installation ·
Contributing · Bugs · FAQ ·
diff --git a/app/Controllers/Config.php b/app/Controllers/Config.php
index 0619190f8..1fa6650ff 100644
--- a/app/Controllers/Config.php
+++ b/app/Controllers/Config.php
@@ -371,8 +371,6 @@ class Config extends Secure_Controller
public function postSaveGeneral(): ResponseInterface
{
$batchSaveData = [
- 'theme' => $this->request->getPost('theme'),
- 'login_form' => $this->request->getPost('login_form'),
'default_sales_discount_type' => $this->request->getPost('default_sales_discount_type') != null,
'default_sales_discount' => parse_decimals($this->request->getPost('default_sales_discount')),
'default_receivings_discount_type' => $this->request->getPost('default_receivings_discount_type') != null,
@@ -380,8 +378,6 @@ class Config extends Secure_Controller
'enforce_privacy' => $this->request->getPost('enforce_privacy') != null,
'receiving_calculate_average_price' => $this->request->getPost('receiving_calculate_average_price') != null,
'lines_per_page' => $this->request->getPost('lines_per_page', FILTER_SANITIZE_NUMBER_INT),
- 'notify_horizontal_position' => $this->request->getPost('notify_horizontal_position'),
- 'notify_vertical_position' => $this->request->getPost('notify_vertical_position'),
'image_max_width' => $this->request->getPost('image_max_width', FILTER_SANITIZE_NUMBER_INT),
'image_max_height' => $this->request->getPost('image_max_height', FILTER_SANITIZE_NUMBER_INT),
'image_max_size' => $this->request->getPost('image_max_size', FILTER_SANITIZE_NUMBER_INT),
@@ -425,6 +421,26 @@ class Config extends Secure_Controller
return $this->response->setJSON(['success' => $success, 'message' => lang('Config.saved_' . ($success ? '' : 'un') . 'successfully')]);
}
+ /**
+ * Saves Appearance configuration. Used in app/Views/configs/appearance_config.php
+ */
+ public function postSaveAppearance(): ResponseInterface
+ {
+ $batch_save_data = [
+ 'theme' => $this->request->getPost('theme'),
+ 'login_form' => $this->request->getPost('login_form'),
+ 'notify_horizontal_position' => $this->request->getPost('notify_horizontal_position'),
+ 'notify_vertical_position' => $this->request->getPost('notify_vertical_position'),
+ 'color_mode' => $this->request->getPost('color_mode'),
+ 'config_menu_position' => $this->request->getPost('config_menu_position'),
+ 'responsive_design' => $this->request->getPost('responsive_design') != null
+ ];
+
+ $success = $this->appconfig->batch_save($batch_save_data);
+
+ return $this->response->setJSON(['success' => $success, 'message' => lang('Config.saved_' . ($success ? '' : 'un') . 'successfully')]);
+ }
+
/**
* Checks a number against the currently selected locale. Used in app/Views/configs/locale_config.php
*
@@ -486,26 +502,25 @@ class Config extends Secure_Controller
$exploded = explode(":", $this->request->getPost('language'));
$currency_symbol = $this->request->getPost('currency_symbol');
$batch_save_data = [
- 'currency_symbol' => htmlspecialchars($currency_symbol ?? ''),
- 'currency_code' => $this->request->getPost('currency_code'),
- 'language_code' => $exploded[0],
- 'language' => $exploded[1],
- 'timezone' => $this->request->getPost('timezone'),
- 'dateformat' => $this->request->getPost('dateformat'),
- 'timeformat' => $this->request->getPost('timeformat'),
- 'thousands_separator' => $this->request->getPost('thousands_separator') != null,
- 'number_locale' => $this->request->getPost('number_locale'),
- 'currency_decimals' => $this->request->getPost('currency_decimals', FILTER_SANITIZE_NUMBER_INT),
- 'tax_decimals' => $this->request->getPost('tax_decimals', FILTER_SANITIZE_NUMBER_INT),
- 'quantity_decimals' => $this->request->getPost('quantity_decimals', FILTER_SANITIZE_NUMBER_INT),
- 'country_codes' => htmlspecialchars($this->request->getPost('country_codes')),
- 'payment_options_order' => $this->request->getPost('payment_options_order'),
- 'payment_reference_code_min' => $this->request->getPost('payment_reference_code_min', FILTER_SANITIZE_NUMBER_INT),
- 'payment_reference_code_max' => $this->request->getPost('payment_reference_code_max', FILTER_SANITIZE_NUMBER_INT),
- 'date_or_time_format' => $this->request->getPost('date_or_time_format') != null,
- 'cash_decimals' => $this->request->getPost('cash_decimals', FILTER_SANITIZE_NUMBER_INT),
- 'cash_rounding_code' => $this->request->getPost('cash_rounding_code'),
- 'financial_year' => $this->request->getPost('financial_year', FILTER_SANITIZE_NUMBER_INT)
+ 'currency_symbol' => htmlspecialchars($currency_symbol ?? ''),
+ 'currency_code' => $this->request->getPost('currency_code'),
+ 'language_code' => $exploded[0],
+ 'language' => $exploded[1],
+ 'rtl_language' => $this->request->getPost('rtl_language') != null,
+ 'timezone' => $this->request->getPost('timezone'),
+ 'dateformat' => $this->request->getPost('dateformat'),
+ 'timeformat' => $this->request->getPost('timeformat'),
+ 'thousands_separator' => $this->request->getPost('thousands_separator') != null,
+ 'number_locale' => $this->request->getPost('number_locale'),
+ 'currency_decimals' => $this->request->getPost('currency_decimals', FILTER_SANITIZE_NUMBER_INT),
+ 'tax_decimals' => $this->request->getPost('tax_decimals', FILTER_SANITIZE_NUMBER_INT),
+ 'quantity_decimals' => $this->request->getPost('quantity_decimals', FILTER_SANITIZE_NUMBER_INT),
+ 'country_codes' => htmlspecialchars($this->request->getPost('country_codes')),
+ 'payment_options_order' => $this->request->getPost('payment_options_order'),
+ 'date_or_time_format' => $this->request->getPost('date_or_time_format') != null,
+ 'cash_decimals' => $this->request->getPost('cash_decimals', FILTER_SANITIZE_NUMBER_INT),
+ 'cash_rounding_code' => $this->request->getPost('cash_rounding_code'),
+ 'financial_year' => $this->request->getPost('financial_year', FILTER_SANITIZE_NUMBER_INT)
];
$success = $this->appconfig->batch_save($batch_save_data);
diff --git a/app/Controllers/Reports.php b/app/Controllers/Reports.php
index 0c9a884ca..b4ab3b67c 100644
--- a/app/Controllers/Reports.php
+++ b/app/Controllers/Reports.php
@@ -1312,7 +1312,7 @@ class Reports extends Secure_Controller
'sales/edit/' . $row['sale_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
$button_key => $button_label,
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Sales.update')
@@ -1439,7 +1439,7 @@ class Reports extends Secure_Controller
'sales/edit/' . $row['sale_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
$button_key => $button_label,
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Sales.update')
@@ -1571,7 +1571,7 @@ class Reports extends Secure_Controller
'sales/edit/' . $row['sale_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
$button_key => $button_label,
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Sales.update')
@@ -1659,7 +1659,7 @@ class Reports extends Secure_Controller
'sales/edit/' . $report_data['sale_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
$button_key => $button_label,
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Sales.update')
@@ -1835,7 +1835,7 @@ class Reports extends Secure_Controller
'sales/edit/' . $row['sale_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
$button_key => $button_label,
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Sales.update')
@@ -1915,7 +1915,7 @@ class Reports extends Secure_Controller
'receivings/edit/' . $report_data['receiving_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
'data-btn-submit' => lang('Common.submit'),
'data-btn-delete' => lang('Common.delete'),
'title' => lang('Receivings.update')
@@ -1975,7 +1975,7 @@ class Reports extends Secure_Controller
'receivings/edit/' . $row['receiving_id'],
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
'data-btn-delete' => lang('Common.delete'),
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Receivings.update')
diff --git a/app/Database/Migrations/sqlscripts/initial_schema.sql b/app/Database/Migrations/sqlscripts/initial_schema.sql
index 0823793a5..363757edc 100644
--- a/app/Database/Migrations/sqlscripts/initial_schema.sql
+++ b/app/Database/Migrations/sqlscripts/initial_schema.sql
@@ -79,10 +79,14 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('smtp_timeout', '5'),
('smtp_crypto', 'ssl'),
('receipt_template', 'receipt_default'),
- ('theme', 'flatly'),
+ ('theme', 'bootstrap'),
('statistics', '1'),
('language', 'english'),
- ('language_code', 'en');
+ ('language_code', 'en'),
+ ('rtl_language', '0'),
+ ('color_mode', 'light'),
+ ('config_menu_position', 'start'),
+ ('responsive_design', '1');
-- --------------------------------------------------------
diff --git a/app/Helpers/tabular_helper.php b/app/Helpers/tabular_helper.php
index 3aa23fafd..068e6ee4b 100644
--- a/app/Helpers/tabular_helper.php
+++ b/app/Helpers/tabular_helper.php
@@ -132,7 +132,7 @@ function get_sale_data_row(object $sale): array
"$controller/edit/$sale->sale_id",
'',
[
- 'class' => 'modal-dlg print_hide',
+ 'class' => 'modal-launch print_hide',
'data-btn-delete' => lang('Common.delete'),
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
@@ -234,7 +234,7 @@ function get_person_data_row(object $person): array
"Messages/view/$person->person_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Messages.sms_send')
]
@@ -243,7 +243,7 @@ function get_person_data_row(object $person): array
"$controller/view/$person->person_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . '.update') // TODO: String interpolation
]
@@ -301,7 +301,7 @@ function get_customer_data_row(object $person, object $stats): array
"Messages/view/$person->person_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Messages.sms_send')
]
@@ -310,7 +310,7 @@ function get_customer_data_row(object $person, object $stats): array
"$controller/view/$person->person_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -371,7 +371,7 @@ function get_supplier_data_row(object $supplier): array
"Messages/view/$supplier->person_id",
'',
[
- 'class' => "modal-dlg",
+ 'class' => "modal-launch",
'data-btn-submit' => lang('Common.submit'),
'title' => lang('Messages.sms_send')
]
@@ -380,7 +380,7 @@ function get_supplier_data_row(object $supplier): array
"$controller/view/$supplier->person_id",
'',
[
- 'class' => "modal-dlg",
+ 'class' => "modal-launch",
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -500,7 +500,7 @@ function get_item_data_row(object $item): array
"$controller/inventory/$item->item_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".count")
]
@@ -509,7 +509,7 @@ function get_item_data_row(object $item): array
"$controller/countDetails/$item->item_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'title' => lang(ucfirst($controller) . ".details_count")
]
),
@@ -517,7 +517,7 @@ function get_item_data_row(object $item): array
"$controller/view/$item->item_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -563,7 +563,7 @@ function get_giftcard_data_row(object $giftcard): array
"$controller/view/$giftcard->giftcard_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -609,7 +609,7 @@ function get_item_kit_data_row(object $item_kit): array
"$controller/view/$item_kit->item_kit_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -717,7 +717,7 @@ function get_attribute_definition_data_row(object $attribute_row): array
"$controller/view/$attribute_row->definition_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -757,7 +757,7 @@ function get_expense_category_data_row(object $expense_category): array
"$controller/view/$expense_category->expense_category_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -811,7 +811,7 @@ function get_expenses_data_row(object $expense): array
"$controller/view/$expense->expense_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
@@ -913,7 +913,7 @@ function get_cash_up_data_row(object $cash_up): array
"$controller/view/$cash_up->cashup_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller) . ".update")
]
diff --git a/app/Helpers/tax_helper.php b/app/Helpers/tax_helper.php
index 654ebfd76..501e1d65d 100644
--- a/app/Helpers/tax_helper.php
+++ b/app/Helpers/tax_helper.php
@@ -38,7 +38,7 @@ function get_tax_code_data_row($tax_code_row): array
"$controller_name/view_tax_codes/$tax_code_row->tax_code",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller_name) . ".update_tax_codes")
]
@@ -76,7 +76,7 @@ function get_tax_categories_data_row($tax_categories_row): array
"$controller_name/view/$tax_categories_row->tax_category_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller_name) . ".update")
]
@@ -113,7 +113,7 @@ function get_tax_jurisdictions_data_row($tax_jurisdiction_row): array
"$controller_name/view/$tax_jurisdiction_row->jurisdiction_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller_name) . ".update")
]
@@ -158,7 +158,7 @@ function get_tax_rates_data_row($tax_rates_row): array
"$controller_name/view/$tax_rates_row->tax_rate_id",
'',
[
- 'class' => 'modal-dlg',
+ 'class' => 'modal-launch',
'data-btn-submit' => lang('Common.submit'),
'title' => lang(ucfirst($controller_name) . ".update")
]
diff --git a/app/Language/en/Config.php b/app/Language/en/Config.php
index 6ad5f033c..4a661b863 100644
--- a/app/Language/en/Config.php
+++ b/app/Language/en/Config.php
@@ -227,7 +227,7 @@ return [
'os_timezone' => 'OSPOS Timezone:',
'ospos_info' => 'OSPOS Installation Info',
'payment_options_order' => 'Payment Options Order',
- 'payment_reference_code_length_limits' => 'Payment Reference Code
Length Limits',
+ 'payment_reference_code_length_limits' => 'Payment Reference Code Length Limits',
'payment_reference_code_length_max_label' => 'Max',
'payment_reference_code_length_min_label' => 'Min',
'perm_risk' => 'Incorrect permissions leaves this software at risk.',
diff --git a/app/Views/attributes/form.php b/app/Views/attributes/form.php
index 345189dd8..a75dcb833 100644
--- a/app/Views/attributes/form.php
+++ b/app/Views/attributes/form.php
@@ -10,93 +10,75 @@
*/
?>
-