From f20ba236407fd255ff26d4503402c8d5af173fd7 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 17 Aug 2018 23:54:47 +0200 Subject: [PATCH 1/8] No password change in testing mode (#2073) --- application/controllers/Employees.php | 2 +- application/models/Employee.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/Employees.php b/application/controllers/Employees.php index 3267f5c13..ab68faff8 100644 --- a/application/controllers/Employees.php +++ b/application/controllers/Employees.php @@ -121,7 +121,7 @@ class Employees extends Persons } //Password has been changed OR first time password set - if($this->input->post('password') != '') + if($this->input->post('password') != '' && ENVIRONMENT != 'testing') { $exploded = explode(":", $this->input->post('language')); $employee_data = array( diff --git a/application/models/Employee.php b/application/models/Employee.php index f5678d666..32a11f3d6 100644 --- a/application/models/Employee.php +++ b/application/models/Employee.php @@ -119,11 +119,9 @@ class Employee extends Person //Now insert the new grants if($success) { - $count = 0; foreach($grants_data as $grant) { $success = $this->db->insert('grants', array('permission_id' => $grant['permission_id'], 'person_id' => $employee_id, 'menu_group' => $grant['menu_group'])); - $count = $count+ 1; } } } @@ -473,6 +471,10 @@ class Employee extends Person { $success = FALSE; + if (ENVIRONMENT == 'testing') { + return $success; + } + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); From 9c3c7a9c773d5cf0e073ad7b7bb2553ea704faed Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 12:35:29 +0100 Subject: [PATCH 2/8] Update Employee.php --- application/models/Employee.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/application/models/Employee.php b/application/models/Employee.php index 32a11f3d6..aa4dd9f07 100644 --- a/application/models/Employee.php +++ b/application/models/Employee.php @@ -364,7 +364,7 @@ class Employee extends Person /* Determines whether the employee has access to at least one submodule - */ + */ public function has_module_grant($permission_id, $person_id) { $this->db->from('grants'); @@ -431,8 +431,8 @@ class Employee extends Person } /* - Gets employee permission grants - */ + Gets employee permission grants + */ public function get_employee_grants($person_id) { $this->db->from('grants'); @@ -441,7 +441,6 @@ class Employee extends Person return $this->db->get()->result_array(); } - /* Attempts to login employee and set session. Returns boolean based on outcome. */ @@ -471,20 +470,19 @@ class Employee extends Person { $success = FALSE; - if (ENVIRONMENT == 'testing') { - return $success; + if(ENVIRONMENT != 'testing') + { + //Run these queries as a transaction, we want to make sure we do all or nothing + $this->db->trans_start(); + + $this->db->where('person_id', $employee_id); + $success = $this->db->update('employees', $employee_data); + + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); } - //Run these queries as a transaction, we want to make sure we do all or nothing - $this->db->trans_start(); - - $this->db->where('person_id', $employee_id); - $success = $this->db->update('employees', $employee_data); - - $this->db->trans_complete(); - - $success &= $this->db->trans_status(); - return $success; } } From 26e33dddecfc52130815e5c8c35d64b2b9df2e48 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 25 Aug 2018 16:03:07 +0100 Subject: [PATCH 3/8] Check FORCE_HTTPS env to be true, upgrade MariaDB vs in docker-compose --- application/config/config.php | 2 +- application/views/partial/header.php | 2 +- docker-compose.yml | 2 +- public/license/LICENSE | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 3a345c88d..bd72045ef 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -65,7 +65,7 @@ $config['db_log_enabled'] = FALSE; | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || isset($_ENV['FORCE_HTTPS'])) ? 'https' : 'http'; +$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http'; $config['base_url'] .= '://' . $_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); diff --git a/application/views/partial/header.php b/application/views/partial/header.php index dd8be8928..58fa5e7d2 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -75,7 +75,7 @@ - + diff --git a/docker-compose.yml b/docker-compose.yml index 8ebe12f8c..80421a0f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: - MYSQL_HOST_NAME=mysql mysql: - image: mariadb:10.1.21 + image: mariadb:10.3.9 environment: - MYSQL_ROOT_PASSWORD=pointofsale - MYSQL_DATABASE=ospos diff --git a/public/license/LICENSE b/public/license/LICENSE index 882aae407..dcea0bfc2 100644 --- a/public/license/LICENSE +++ b/public/license/LICENSE @@ -18,6 +18,7 @@ Copyright (c) 2017 Deep Shah (aka deepshah) Copyright (c) 2017 Joshua Fernandez (aka joshua1234511) Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 +Copyright (c) 2018 WebShells/Shady Sh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 0248a50ae32b3f431a1c152e4f36550a4e572215 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 26 Aug 2018 14:22:50 +0200 Subject: [PATCH 4/8] Filter out duplicate results (#2038) --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index 1d5f91315..ead25240e 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -879,7 +879,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return $suggestions; + return array_unique($suggestions); } public function get_low_sell_suggestions($search) From 024565d67c6c8921f4b51a1592f9b1b13b9e6234 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 26 Aug 2018 14:36:42 +0200 Subject: [PATCH 5/8] Enable array filtering (#2030) --- application/models/Item.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index ead25240e..b9e3bf18c 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -663,7 +663,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return $suggestions; + return array_unique($suggestions, SORT_REGULAR); } @@ -774,7 +774,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return $suggestions; + return array_unique($suggestions, SORT_REGULAR); } public function get_kit_search_suggestions($search, $filters = array('is_deleted' => FALSE, 'search_custom' => FALSE), $unique = FALSE, $limit = 25) @@ -879,7 +879,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return array_unique($suggestions); + return array_unique($suggestions, SORT_REGULAR); } public function get_low_sell_suggestions($search) From da114ae988e6a4ed086b287d4699944cdbe03a27 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 1 Sep 2018 02:33:06 +0200 Subject: [PATCH 6/8] Add item_number to receivings view --- application/libraries/Receiving_lib.php | 1 + application/views/receivings/receiving.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 4c01e9bbc..c3e805533 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -229,6 +229,7 @@ class Receiving_lib $item = array($insertkey => array( 'item_id' => $item_id, 'item_location' => $item_location, + 'item_number' => $item_info->item_number, 'stock_name' => $this->CI->Stock_location->get_location_name($item_location), 'line' => $insertkey, 'name' => $item_info->name, diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index ae131f6bf..7ce3470ed 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -103,11 +103,12 @@ if (isset($success)) lang->line('common_delete'); ?> - lang->line('receivings_item_name'); ?> + lang->line('sales_item_number'); ?> + lang->line('receivings_item_name'); ?> lang->line('receivings_cost'); ?> lang->line('receivings_quantity'); ?> lang->line('receivings_ship_pack'); ?> - lang->line('receivings_discount'); ?> + lang->line('receivings_discount'); ?> lang->line('receivings_total'); ?> lang->line('receivings_update'); ?> @@ -133,6 +134,7 @@ if (isset($success)) 'form-horizontal', 'id'=>'cart_'.$line)); ?> ');?> +
From a1ae343139f5222888347000403fbfac6901da81 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 1 Sep 2018 11:16:16 +0200 Subject: [PATCH 7/8] Add download badge to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 76dadf863..c48e239eb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[ ![Download](https://api.bintray.com/packages/jekkos/opensourcepos/opensourcepos/images/download.svg?version=3.2.3) ](https://bintray.com/jekkos/opensourcepos/opensourcepos/3.2.3/link) [![Build Status](https://travis-ci.org/opensourcepos/opensourcepos.svg?branch=master)](https://travis-ci.org/opensourcepos/opensourcepos) [![Join the chat at https://gitter.im/jekkos/opensourcepos](https://badges.gitter.im/jekkos/opensourcepos.svg)](https://gitter.im/jekkos/opensourcepos?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![devDependency Status](https://david-dm.org/jekkos/opensourcepos/dev-status.svg)](https://david-dm.org/jekkos/opensourcepos#info=dev) From 7e855863135c75db63692f7966ceba8e2cb6652c Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 1 Sep 2018 16:24:28 +0100 Subject: [PATCH 8/8] Fix Receivings colspan when cart is empty --- application/views/receivings/receiving.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 7ce3470ed..fdc224cca 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -120,7 +120,7 @@ if (isset($success)) { ?> - +
lang->line('sales_no_items_in_cart'); ?>