diff --git a/README.md b/README.md index 755c73f60..c10dd69bb 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 9f1da31f3..0a661c3aa 100644 --- a/app/Controllers/Config.php +++ b/app/Controllers/Config.php @@ -80,7 +80,7 @@ class Config extends Secure_Controller $npmDev = false; $license = []; - $license[$i]['title'] = 'Open Source Point Of Sale ' . config('App')->application_version; + $license[$i]['title'] = 'Open Source Point of Sale ' . config('App')->application_version; if (file_exists('license/LICENSE')) { $license[$i]['text'] = file_get_contents('license/LICENSE', false, null, 0, 3000); @@ -363,8 +363,6 @@ class Config extends Secure_Controller public function postSaveGeneral(): void { $batch_save_data = [ - '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, @@ -372,8 +370,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), @@ -410,6 +406,26 @@ class Config extends Secure_Controller echo json_encode(['success' => $success, 'message' => lang('Config.saved_' . ($success ? '' : 'un') . 'successfully')]); } + /** + * Saves Appearance configuration. Used in app/Views/configs/appearance_config.php + */ + public function postSaveAppearance(): void + { + $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); + + echo json_encode(['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 * @@ -462,6 +478,7 @@ class Config extends Secure_Controller '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'), diff --git a/app/Database/tables.sql b/app/Database/tables.sql index 943706722..203bb2943 100644 --- a/app/Database/tables.sql +++ b/app/Database/tables.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/Views/attributes/manage.php b/app/Views/attributes/manage.php index 91e9e5478..41e2a2355 100644 --- a/app/Views/attributes/manage.php +++ b/app/Views/attributes/manage.php @@ -8,6 +8,11 @@ = view('partial/header') ?> + + -