From 57dc2d2b11ebac365e1832767a620438282f0510 Mon Sep 17 00:00:00 2001 From: SteveIreland Date: Sat, 15 Feb 2020 22:29:11 -0500 Subject: [PATCH 01/65] Add unique contraint to tax group --- application/controllers/Taxes.php | 15 ++++++++++++++ application/language/en-GB/taxes_lang.php | 1 + application/language/en-US/taxes_lang.php | 1 + .../20200215100000_taxgroupconstraint.php | 20 +++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 application/migrations/20200215100000_taxgroupconstraint.php diff --git a/application/controllers/Taxes.php b/application/controllers/Taxes.php index 4c6a6004d..c4adc08d8 100644 --- a/application/controllers/Taxes.php +++ b/application/controllers/Taxes.php @@ -443,6 +443,8 @@ class Taxes extends Secure_Controller $array_save = array(); + $unique_tax_groups = []; + foreach($jurisdiction_id as $key => $val) { $array_save[] = array( @@ -453,6 +455,19 @@ class Taxes extends Secure_Controller 'reporting_authority'=>$this->xss_clean($reporting_authority[$key]), 'tax_group_sequence'=>$this->xss_clean($tax_group_sequence[$key]), 'cascade_sequence'=>$this->xss_clean($cascade_sequence[$key])); + + if (array_search($tax_group[$key], $unique_tax_groups) !== false) + { + echo json_encode(array( + 'success' => FALSE, + 'message' => $this->lang->line('taxes_tax_group_not_unique', $tax_group[$key]) + )); + return; + } + else + { + $unique_tax_groups[] = $tax_group[$key]; + } } $success = $this->Tax_jurisdiction->save_jurisdictions($array_save); diff --git a/application/language/en-GB/taxes_lang.php b/application/language/en-GB/taxes_lang.php index c15469d9b..0b9aefc5b 100644 --- a/application/language/en-GB/taxes_lang.php +++ b/application/language/en-GB/taxes_lang.php @@ -54,6 +54,7 @@ $lang["taxes_tax_codes_saved_successfully"] = "Tax Code changes saved"; $lang["taxes_tax_codes_saved_unsuccessfully"] = "Tax Code changes not saved"; $lang["taxes_tax_excluded"] = "Tax excluded"; $lang["taxes_tax_group"] = "Tax Group"; +$lang["taxes_tax_group_not_unique"] = "Tax Group %1 is not unique"; $lang["taxes_tax_group_sequence"] = "Tax Group Sequence"; $lang["taxes_tax_included"] = "Tax included"; $lang["taxes_tax_jurisdiction"] = "Tax Jurisdiction"; diff --git a/application/language/en-US/taxes_lang.php b/application/language/en-US/taxes_lang.php index c15469d9b..0b9aefc5b 100644 --- a/application/language/en-US/taxes_lang.php +++ b/application/language/en-US/taxes_lang.php @@ -54,6 +54,7 @@ $lang["taxes_tax_codes_saved_successfully"] = "Tax Code changes saved"; $lang["taxes_tax_codes_saved_unsuccessfully"] = "Tax Code changes not saved"; $lang["taxes_tax_excluded"] = "Tax excluded"; $lang["taxes_tax_group"] = "Tax Group"; +$lang["taxes_tax_group_not_unique"] = "Tax Group %1 is not unique"; $lang["taxes_tax_group_sequence"] = "Tax Group Sequence"; $lang["taxes_tax_included"] = "Tax included"; $lang["taxes_tax_jurisdiction"] = "Tax Jurisdiction"; diff --git a/application/migrations/20200215100000_taxgroupconstraint.php b/application/migrations/20200215100000_taxgroupconstraint.php new file mode 100644 index 000000000..b5803ee10 --- /dev/null +++ b/application/migrations/20200215100000_taxgroupconstraint.php @@ -0,0 +1,20 @@ +db->query('ALTER TABLE ' . $this->db->dbprefix('tax_jurisdictions') . ' ADD CONSTRAINT tax_jurisdictions_uq1 UNIQUE (tax_group)'); + } + + public function down() + { + $this->db->query('ALTER TABLE ' . $this->db->dbprefix('tax_jurisdictions') . ' DROP INDEX tax_jurisdictions_uq1'); + } +} +?> From 7145ad9eec2dac5bc7c5e9d14101fed3570277d5 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Tue, 18 Feb 2020 21:03:06 +0000 Subject: [PATCH 02/65] Fix Travis composer docker error (#2729) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bd0c42765..d13b5dbc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - date=`date +%Y%m%d%H%M%S` && branch=${TRAVIS_BRANCH} && rev=`git rev-parse --short=6 HEAD` && sed -i "s/\$1/\$1.$date.$branch.$rev/g" deployment.json script: - - docker run --rm -v $(pwd):/app composer/composer install + - docker run --rm -v $(pwd):/app composer install - docker run --rm -v $(pwd):/app -w /app lucor/php7-cli php bin/install.php translations develop - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php From 556335918b684214601edf8d9f5ce1f848ba3427 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 21 Feb 2020 22:41:02 +0100 Subject: [PATCH 03/65] Do not install dev dependencies --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d13b5dbc8..274f6e291 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - date=`date +%Y%m%d%H%M%S` && branch=${TRAVIS_BRANCH} && rev=`git rev-parse --short=6 HEAD` && sed -i "s/\$1/\$1.$date.$branch.$rev/g" deployment.json script: - - docker run --rm -v $(pwd):/app composer install + - docker run --rm -v $(pwd):/app composer install --no-dev - docker run --rm -v $(pwd):/app -w /app lucor/php7-cli php bin/install.php translations develop - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php From 3ceb2569cf50343dc5af3b1ade56799973770b8c Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 22 Feb 2020 01:07:36 +0100 Subject: [PATCH 04/65] Use private docker buildbox --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 274f6e291..24fd309b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,13 @@ before_install: - date=`date +%Y%m%d%H%M%S` && branch=${TRAVIS_BRANCH} && rev=`git rev-parse --short=6 HEAD` && sed -i "s/\$1/\$1.$date.$branch.$rev/g" deployment.json script: - - docker run --rm -v $(pwd):/app composer install --no-dev - - docker run --rm -v $(pwd):/app -w /app lucor/php7-cli php bin/install.php translations - develop + - docker run --rm -v $(pwd):/app jekkos/composer composer install --no-dev + - docker run --rm -v $(pwd):/app jekkos/composer php bin/install.php translations develop - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt sh -c "npm install && bower install && grunt package" - /bin/bash docker/install-local.sh + - docker-compose -f docker-compose.test.yml up env: - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" From b88b60597b8961144c277b1affe695c0850a1069 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 22 Feb 2020 01:14:32 +0100 Subject: [PATCH 05/65] Disable tests in build --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 24fd309b4..6e16f05d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,6 @@ script: - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt sh -c "npm install && bower install && grunt package" - /bin/bash docker/install-local.sh - - docker-compose -f docker-compose.test.yml up env: - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" From 1488453ffa5924481f85e5deae648162e3396b43 Mon Sep 17 00:00:00 2001 From: Fredrik Angell Moe Date: Mon, 24 Feb 2020 21:26:34 +0000 Subject: [PATCH 06/65] =?UTF-8?q?Added=20translation=20using=20Weblate=20(?= =?UTF-8?q?Norwegian=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../language/nb_NO/attributes_lang.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 application/language/nb_NO/attributes_lang.php diff --git a/application/language/nb_NO/attributes_lang.php b/application/language/nb_NO/attributes_lang.php new file mode 100644 index 000000000..31ca3ea3a --- /dev/null +++ b/application/language/nb_NO/attributes_lang.php @@ -0,0 +1,30 @@ + Date: Sat, 15 Feb 2020 09:43:03 +0000 Subject: [PATCH 07/65] Translated using Weblate (Turkish) Currently translated at 100.0% (177 of 177 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/tr/ --- application/language/tr/sales_lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/language/tr/sales_lang.php b/application/language/tr/sales_lang.php index 19c739417..e85a2f238 100644 --- a/application/language/tr/sales_lang.php +++ b/application/language/tr/sales_lang.php @@ -18,7 +18,7 @@ $lang["sales_check_filter"] = "Çek"; $lang["sales_comment"] = "Yorum"; $lang["sales_comments"] = "Yorumlar"; $lang["sales_complete_sale"] = "Satışı Tamamla"; -$lang["sales_confirm_cancel_sale"] = "Bu satışı iptal etmek istiyor musunuz? Tüm ürünler çıkarılacak."; +$lang["sales_confirm_cancel_sale"] = "Bu satışı temizlemek istiyor musunuz? Tüm ürünler temizlenecek."; $lang["sales_confirm_delete"] = "Seçilen satışları silmek istediğinize emin misiniz?"; $lang["sales_confirm_restore"] = "Seçilen satışları kurtarmak istediğinize emin misiniz?"; $lang["sales_credit"] = "Kredi Kartı"; @@ -176,3 +176,4 @@ $lang["sales_work_order_unsent"] = "İş Emri gönderilemedi:"; $lang["sales_nontaxed_ind"] = " "; $lang["sales_taxed_ind"] = "T"; $lang["sales_refund"] = "Geri Ödeme Türü"; +$lang["sales_change_price"] = "Satış Fiyatını Değiştir"; From 519242aead6bce056c1a682641e65fe6816bc4fc Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Tue, 25 Feb 2020 22:38:34 +0100 Subject: [PATCH 08/65] Set copy permissions to 775 --- bin/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install.php b/bin/install.php index 9d805bcc1..3829325b6 100755 --- a/bin/install.php +++ b/bin/install.php @@ -253,7 +253,7 @@ class Installer foreach ($iterator as $file) { if ($file->isDir()) { - @mkdir($dst . '/' . $iterator->getSubPathName(), 0777, TRUE); + @mkdir($dst . '/' . $iterator->getSubPathName(), 0775, TRUE); } else { $success = copy($file, $dst . '/' . $iterator->getSubPathName()); From b8174a85eeff0c7a5c760050de57c126cf342a1a Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Wed, 26 Feb 2020 23:40:55 +0100 Subject: [PATCH 09/65] Move dotenv to depdencies (#2737) --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 42de3f88e..fca0faa43 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,10 @@ "codeigniter/framework": "^3.1.11", "dompdf/dompdf": "^0.7", "tamtamchik/namecase": "^1.0", - "paragonie/random_compat": "^2.0" + "paragonie/random_compat": "^2.0", + "vlucas/phpdotenv": "^2.4" }, "require-dev": { - "mikey179/vfsStream": "1.1.*", - "vlucas/phpdotenv": "^2.4" + "mikey179/vfsStream": "1.1.*" } } From 822b7211eced18d043af673f1be062f6dcd90c09 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 28 Feb 2020 15:36:23 +0100 Subject: [PATCH 10/65] Install dev dependencies again --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e16f05d2..8131c3bc6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - date=`date +%Y%m%d%H%M%S` && branch=${TRAVIS_BRANCH} && rev=`git rev-parse --short=6 HEAD` && sed -i "s/\$1/\$1.$date.$branch.$rev/g" deployment.json script: - - docker run --rm -v $(pwd):/app jekkos/composer composer install --no-dev + - docker run --rm -v $(pwd):/app jekkos/composer composer install - docker run --rm -v $(pwd):/app jekkos/composer php bin/install.php translations develop - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt From cdaf88ef282ba906248291dfabfbea7f1912e567 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 1 Mar 2020 17:34:39 +0000 Subject: [PATCH 11/65] Fix Employee autocomplete bug (#2736) --- application/controllers/Employees.php | 2 +- application/views/sales/form.php | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/application/controllers/Employees.php b/application/controllers/Employees.php index 8be38df9f..957167f26 100644 --- a/application/controllers/Employees.php +++ b/application/controllers/Employees.php @@ -37,7 +37,7 @@ class Employees extends Persons */ public function suggest() { - $suggestions = $this->xss_clean($this->Employee->get_search_suggestions($this->input->post('term'), TRUE)); + $suggestions = $this->xss_clean($this->Employee->get_search_suggestions($this->input->get('term'), TRUE)); echo json_encode($suggestions); } diff --git a/application/views/sales/form.php b/application/views/sales/form.php index 40383b8e7..f7eeb52bf 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -160,14 +160,13 @@ $(document).ready(function() load->view('partial/datepicker_locale'); ?> - var fill_value_customer = function(event, ui) { + var fill_value_customer = function(event, ui) { event.preventDefault(); $("input[name='customer_id']").val(ui.item.value); $("input[name='customer_name']").val(ui.item.label); }; - $('#customer_name').autocomplete( - { + $('#customer_name').autocomplete( { source: "", minChars: 0, delay: 15, @@ -177,14 +176,13 @@ $(document).ready(function() focus: fill_value_customer }); - var fill_value_employee = function(event, ui) { + var fill_value_employee = function(event, ui) { event.preventDefault(); $("input[name='employee_id']").val(ui.item.value); $("input[name='employee_name']").val(ui.item.label); }; - $('#employee_name').autocomplete( - { + $('#employee_name').autocomplete( { source: "", minChars: 0, delay: 15, @@ -204,8 +202,7 @@ $(document).ready(function() table_support.do_restore("", ); }); - $('#sales_edit_form').validate($.extend( - { + $('#sales_edit_form').validate($.extend( { submitHandler: function(form) { $(form).ajaxSubmit({ success: function(response) From 3e698f96dcaaf401ea6bb806b00849fb953272d8 Mon Sep 17 00:00:00 2001 From: Thomas Arleth Pedersen Date: Mon, 2 Mar 2020 21:09:55 +0000 Subject: [PATCH 12/65] Added translation using Weblate (Danish) --- application/language/da/attributes_lang.php | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 application/language/da/attributes_lang.php diff --git a/application/language/da/attributes_lang.php b/application/language/da/attributes_lang.php new file mode 100644 index 000000000..31ca3ea3a --- /dev/null +++ b/application/language/da/attributes_lang.php @@ -0,0 +1,30 @@ + Date: Mon, 2 Mar 2020 09:49:02 +0000 Subject: [PATCH 13/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 55.7% (29 of 52 strings) Translation: ospos/customers Translate-URL: http://weblate.jpeelaer.net/projects/ospos/customers/zh_Hans/ --- application/language/zh-Hans/customers_lang.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/application/language/zh-Hans/customers_lang.php b/application/language/zh-Hans/customers_lang.php index 63efacf95..f737fa885 100644 --- a/application/language/zh-Hans/customers_lang.php +++ b/application/language/zh-Hans/customers_lang.php @@ -1,11 +1,10 @@ - Date: Mon, 2 Mar 2020 09:49:01 +0000 Subject: [PATCH 14/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 66.1% (117 of 177 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/zh_Hans/ --- application/language/zh-Hans/sales_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/zh-Hans/sales_lang.php b/application/language/zh-Hans/sales_lang.php index 39497aa8b..37fd82761 100644 --- a/application/language/zh-Hans/sales_lang.php +++ b/application/language/zh-Hans/sales_lang.php @@ -1,6 +1,5 @@ - Date: Fri, 6 Mar 2020 19:56:48 +0000 Subject: [PATCH 15/65] Revert change causing issues with Detailed Transactions --- application/models/reports/Detailed_sales.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 84332d740..86de8cdb2 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -145,7 +145,7 @@ class Detailed_sales extends Report foreach($data['summary'] as $key=>$value) { $this->db->select(' - MAX(name) AS name, + name, category, quantity_purchased, item_location, From 7d94ba7817e1b4b2efa6822253e0af954b0347a7 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 22 Feb 2020 02:20:39 +0100 Subject: [PATCH 16/65] Make multistage docker build --- Dockerfile | 22 +- Dockerfile.dev | 9 - Dockerfile.test | 11 - Gruntfile.js | 20 +- application/tests/.gitignore | 1 + .../tests/libraries/Barcode_lib_test.php | 46 + composer.json | 10 +- composer.lock | 1515 ++++++++++++++++- database/Dockerfile | 5 - docker-compose.dev.yml | 14 +- docker-compose.test.yml | 29 +- docker-compose.yml | 13 +- 12 files changed, 1626 insertions(+), 69 deletions(-) delete mode 100644 Dockerfile.dev delete mode 100644 Dockerfile.test create mode 100644 application/tests/.gitignore delete mode 100644 database/Dockerfile diff --git a/Dockerfile b/Dockerfile index 9ce8d8091..d3da3ad64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.3-apache +FROM php:7.3-apache AS ospos MAINTAINER jekkos RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ @@ -16,4 +16,22 @@ COPY . /app RUN ln -s /app/*[^public] /var/www && rm -rf /var/www/html && ln -nsf /app/public /var/www/html RUN chmod 755 /app/public/uploads && chown -R www-data:www-data /app/public /app/application -RUN [ ! -f test/ospos.js ] || sed -i -e "s/\(localhost\)/web/g" test/ospos.js +FROM ospos AS ospos_test + +COPY --from=composer /usr/bin/composer /usr/bin/composer + +RUN composer install -d/app +RUN php /app/vendor/kenjis/ci-phpunit-test/install.php -a /app/application -p /app/vendor/codeigniter/framework + +WORKDIR /app/application/tests + +CMD ["/app/vendor/phpunit/phpunit/phpunit"] + +FROM ospos AS ospos_dev + +RUN mkdir -p /app/bower_components && ln -s /app/bower_components /var/www/html/bower_components +RUN yes | pecl install xdebug \ + && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ + && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ + && echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini + diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index 9d09afd74..000000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,9 +0,0 @@ -FROM jekkos/opensourcepos:master -MAINTAINER jekkos - -RUN mkdir -p /app/bower_components && ln -s /app/bower_components /var/www/html/bower_components -RUN yes | pecl install xdebug \ - && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ - && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ - && echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini - diff --git a/Dockerfile.test b/Dockerfile.test deleted file mode 100644 index 93b72144e..000000000 --- a/Dockerfile.test +++ /dev/null @@ -1,11 +0,0 @@ -FROM digitallyseamless/nodejs-bower-grunt:5 -MAINTAINER jekkos - -# apt-get install curl - -COPY Gruntfile.js . -COPY package.json . -COPY test . -RUN npm install - -CMD ['while ! curl web/index.php | grep username; do sleep 1; done; grunt mochaWebdriver:test'] diff --git a/Gruntfile.js b/Gruntfile.js index 9153c5a37..112352b0e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -230,7 +230,25 @@ module.exports = function(grunt) { archive: 'dist/opensourcepos.zip' }, files: [ - {src: ['public/**', 'vendor/**', 'application/**', '!/public/images/menubar/png/', '!/public/dist/bootswatch/', '/public/dist/bootswatch/*/*.css', 'database/**', '*.txt', '*.md', 'LICENSE', 'docker*', 'Dockerfile', '**/.htaccess', '*.csv']} + { + src: [ + 'public/**', + 'vendor/**', + 'application/**', + '!/application/tests', + '!/public/images/menubar/png/', + '!/public/dist/bootswatch/', + '/public/dist/bootswatch/*/*.css', + 'database/**', + '*.txt', + '*.md', + 'LICENSE', + 'docker*', + 'Dockerfile', + '**/.htaccess', + '*.csv' + ] + } ] } } diff --git a/application/tests/.gitignore b/application/tests/.gitignore new file mode 100644 index 000000000..e2e075338 --- /dev/null +++ b/application/tests/.gitignore @@ -0,0 +1 @@ +_ci_phpunit_test/tmp/ diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index e69de29bb..61460675d 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -0,0 +1,46 @@ +resetInstance(); + + $this->obj = $this->newLibrary('Barcode_lib'); + } + + public function test_barcode_weight_first() + { + $config = $this->getMockBuilder('CI_Config') + ->disableOriginalConstructor() + ->setMethods(['item']) + ->getMock(); + $config->method('item') + ->willReturn("02(\d{5})(\w{6})"); + + $item_number = "025000abcdef"; + $quantity = 0; + $this->obj->parse_barcode_fields($quantity, $item_number); + + echo $quantity; + $this->assertEquals($quantity, 1); + $this->assertEquals($item_number, "025000123456"); + } + + public function test_barcode_weight_last() + { + $config = $this->getMockBuilder('CI_Config') + ->disableOriginalConstructor() + ->setMethods(['item']) + ->getMock(); + $config->method('item') + ->willReturn("02(\w{6})(\d{5})"); + + $item_number = "0212345650001"; + $quantity = 0; + $this->obj->parse_barcode_fields($quantity, $item_number); + + $this->assertEquals($quantity, 5.001); + $this->assertEquals($item_number, 123456); + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index fca0faa43..af99eab87 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,12 @@ "POS" ], "homepage": "https://github.com/opensourcepos/opensourcepos", + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/kenjis/ci-phpunit-test" + } + ], "require": { "php": "^5.6 || ^7.0", "codeigniter/framework": "^3.1.11", @@ -25,6 +31,8 @@ "vlucas/phpdotenv": "^2.4" }, "require-dev": { - "mikey179/vfsStream": "1.1.*" + "mikey179/vfsstream": "1.1.*", + "phpunit/phpunit": "7.5.6", + "kenjis/ci-phpunit-test": "dev-master" } } diff --git a/composer.lock b/composer.lock index 426a249ad..1207340bd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3322819f98ab53e62fc89cb8b1e4cb8a", + "content-hash": "d0d33e06b18584def4308d4a68eaf4ef", "packages": [ { "name": "codeigniter/framework", @@ -279,7 +279,108 @@ ], "packages-dev": [ { - "name": "mikey179/vfsStream", + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-10-21T16:45:58+00:00" + }, + { + "name": "kenjis/ci-phpunit-test", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/kenjis/ci-phpunit-test.git", + "reference": "d7ab6c251515e1f78918c6b9489dac6aec571e4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kenjis/ci-phpunit-test/zipball/d7ab6c251515e1f78918c6b9489dac6aec571e4e", + "reference": "d7ab6c251515e1f78918c6b9489dac6aec571e4e", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^2.1|^3.0|^4.2", + "php": ">=5.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kenji Suzuki", + "homepage": "https://github.com/kenjis" + } + ], + "description": "An easier way to use PHPUnit with CodeIgniter 3.x", + "homepage": "http://kenjis.github.io/ci-phpunit-test/", + "keywords": [ + "codeigniter", + "monkey patch", + "phpunit", + "test", + "unit testing" + ], + "time": "2020-01-30T02:00:51+00:00" + }, + { + "name": "mikey179/vfsstream", "version": "v1.1.0", "source": { "type": "git", @@ -308,6 +409,1324 @@ "homepage": "http://vfs.bovigo.org/", "time": "2012-08-25T12:49:29+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2020-01-17T21:11:47+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.3.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2019-11-08T13:50:10+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2018-08-07T13:53:10+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "^1.0.5", + "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2019-12-28T18:55:12+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.10.2", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2020-01-20T15:57:02+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "6.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1 || ^4.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "suggest": { + "ext-xdebug": "^2.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-10-31T16:06:48+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2019-06-07T04:22:29+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2019-09-17T06:23:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "7.5.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2019-02-18T09:24:50+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-02-04T06:01:07+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2019-11-20T08:46:58+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2019-09-14T09:02:43+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.13.1", @@ -366,6 +1785,46 @@ ], "time": "2019-11-27T13:56:44+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-06-13T22:48:21+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v2.6.1", @@ -416,11 +1875,61 @@ "environment" ], "time": "2019-01-29T11:11:52+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2019-11-24T13:36:37+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "kenjis/ci-phpunit-test": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/database/Dockerfile b/database/Dockerfile deleted file mode 100644 index 9a2388a68..000000000 --- a/database/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM alpine -MAINTAINER jekkos - -ADD database.sql /docker-entrypoint-initdb.d/database.sql -VOLUME /docker-entrypoint-initdb.d diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index aa4dc0129..4b5906cd4 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,20 +1,16 @@ -version: '2' +version: '3.4' volumes: uploads: driver: local services: - sqlscript: - build: - context: database/ - dockerfile: Dockerfile ospos: build: context: . - dockerfile: Dockerfile.dev - container_name: ospos + target: ospos_dev + container_name: ospos_dev restart: always depends_on: - mysql @@ -36,8 +32,8 @@ services: restart: always ports: - "3306:3306" - volumes_from: - - sqlscript + volumes: + - ./database/database.sql:/docker-entrypoint-initdb.d/database.sql environment: - MYSQL_ROOT_PASSWORD=pointofsale - MYSQL_DATABASE=ospos diff --git a/docker-compose.test.yml b/docker-compose.test.yml index eeba2eb3b..bab203724 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,31 +1,22 @@ -version: '2' +version: '3.4' services: test: build: context: . - dockerfile: Dockerfile.test - - sqlscript: - build: - context: database/ - dockerfile: Dockerfile - - ospos: - build: - context: . - dockerfile: Dockerfile - container_name: ospos - restart: always - depends_on: + target: ospos_test + depends_on: - mysql - ports: - - "80:80" + container_name: ospos_test environment: + - CI_ENV=testing + - ENCRYPTION_KEY= + - MYSQL_HOST_NAME=127.0.0.1 + - MYSQL_DATABASE=ospos - MYSQL_USERNAME=admin - MYSQL_PASSWORD=pointofsale - - MYSQL_DB_NAME=ospos - - MYSQL_HOST_NAME=mysql + ports: + - "80:80" mysql: image: mysql:5.7 diff --git a/docker-compose.yml b/docker-compose.yml index e46b840f0..e34f73589 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.4' volumes: uploads: @@ -11,15 +11,10 @@ networks: db_net: services: - sqlscript: - build: - context: database/ - dockerfile: Dockerfile - ospos: build: context: . - dockerfile: Dockerfile + target: ospos container_name: ospos restart: always depends_on: @@ -49,8 +44,8 @@ services: - "3306" networks: - db_net - volumes_from: - - sqlscript + volumes: + - ./database/database.sql:/docker-entrypoint-initdb.d/database.sql environment: - MYSQL_ROOT_PASSWORD=${OSPOS_MYSQL_ROOT_PASSWORD} - MYSQL_DATABASE=ospos From d8f784c3f008e9b5e4b0dec02f0f46fdf053a29a Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 27 Feb 2020 00:17:03 +0100 Subject: [PATCH 17/65] Align mariadb versions for compose files --- docker-compose.dev.yml | 2 +- docker-compose.test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 4b5906cd4..ea79868e2 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -27,7 +27,7 @@ services: - XDEBUG_CONFIG=remote_host=172.17.0.1 mysql: - image: mariadb:10.1.21 + image: mariadb:10.3 container_name: mysql restart: always ports: diff --git a/docker-compose.test.yml b/docker-compose.test.yml index bab203724..792495b09 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -19,7 +19,7 @@ services: - "80:80" mysql: - image: mysql:5.7 + image: mariadb:10.3 container_name: mysql restart: always ports: From bc4a5570a5236bf39166ffe9847c356518a7af63 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 27 Feb 2020 00:49:46 +0100 Subject: [PATCH 18/65] Disable globals + fixup base_url --- application/config/config.php | 4 +- .../tests/libraries/Barcode_lib_test.php | 3 + bin/wait-for-it.sh | 182 ++++++++++++++++++ docker-compose.test.yml | 3 + 4 files changed, 189 insertions(+), 3 deletions(-) create mode 100755 bin/wait-for-it.sh diff --git a/application/config/config.php b/application/config/config.php index 9050e1b74..654a30949 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -65,9 +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']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http'; -$config['base_url'] .= '://' . $_SERVER['HTTP_HOST']; -$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); +$config['base_url'] = ''; /* |-------------------------------------------------------------------------- diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index 61460675d..39286956b 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -1,5 +1,8 @@ &2; fi } + +usage() +{ + cat << USAGE >&2 +Usage: + $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args] + -h HOST | --host=HOST Host or IP under test + -p PORT | --port=PORT TCP port under test + Alternatively, you specify the host and port as host:port + -s | --strict Only execute subcommand if the test succeeds + -q | --quiet Don't output any status messages + -t TIMEOUT | --timeout=TIMEOUT + Timeout in seconds, zero for no timeout + -- COMMAND ARGS Execute command with args after the test finishes +USAGE + exit 1 +} + +wait_for() +{ + if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then + echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" + else + echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout" + fi + WAITFORIT_start_ts=$(date +%s) + while : + do + if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then + nc -z $WAITFORIT_HOST $WAITFORIT_PORT + WAITFORIT_result=$? + else + (echo > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1 + WAITFORIT_result=$? + fi + if [[ $WAITFORIT_result -eq 0 ]]; then + WAITFORIT_end_ts=$(date +%s) + echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds" + break + fi + sleep 1 + done + return $WAITFORIT_result +} + +wait_for_wrapper() +{ + # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692 + if [[ $WAITFORIT_QUIET -eq 1 ]]; then + timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT & + else + timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT & + fi + WAITFORIT_PID=$! + trap "kill -INT -$WAITFORIT_PID" INT + wait $WAITFORIT_PID + WAITFORIT_RESULT=$? + if [[ $WAITFORIT_RESULT -ne 0 ]]; then + echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" + fi + return $WAITFORIT_RESULT +} + +# process arguments +while [[ $# -gt 0 ]] +do + case "$1" in + *:* ) + WAITFORIT_hostport=(${1//:/ }) + WAITFORIT_HOST=${WAITFORIT_hostport[0]} + WAITFORIT_PORT=${WAITFORIT_hostport[1]} + shift 1 + ;; + --child) + WAITFORIT_CHILD=1 + shift 1 + ;; + -q | --quiet) + WAITFORIT_QUIET=1 + shift 1 + ;; + -s | --strict) + WAITFORIT_STRICT=1 + shift 1 + ;; + -h) + WAITFORIT_HOST="$2" + if [[ $WAITFORIT_HOST == "" ]]; then break; fi + shift 2 + ;; + --host=*) + WAITFORIT_HOST="${1#*=}" + shift 1 + ;; + -p) + WAITFORIT_PORT="$2" + if [[ $WAITFORIT_PORT == "" ]]; then break; fi + shift 2 + ;; + --port=*) + WAITFORIT_PORT="${1#*=}" + shift 1 + ;; + -t) + WAITFORIT_TIMEOUT="$2" + if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi + shift 2 + ;; + --timeout=*) + WAITFORIT_TIMEOUT="${1#*=}" + shift 1 + ;; + --) + shift + WAITFORIT_CLI=("$@") + break + ;; + --help) + usage + ;; + *) + echoerr "Unknown argument: $1" + usage + ;; + esac +done + +if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then + echoerr "Error: you need to provide a host and port to test." + usage +fi + +WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15} +WAITFORIT_STRICT=${WAITFORIT_STRICT:-0} +WAITFORIT_CHILD=${WAITFORIT_CHILD:-0} +WAITFORIT_QUIET=${WAITFORIT_QUIET:-0} + +# Check to see if timeout is from busybox? +WAITFORIT_TIMEOUT_PATH=$(type -p timeout) +WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH) + +WAITFORIT_BUSYTIMEFLAG="" +if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then + WAITFORIT_ISBUSY=1 + # Check if busybox timeout uses -t flag + # (recent Alpine versions don't support -t anymore) + if timeout &>/dev/stdout | grep -q -e '-t '; then + WAITFORIT_BUSYTIMEFLAG="-t" + fi +else + WAITFORIT_ISBUSY=0 +fi + +if [[ $WAITFORIT_CHILD -gt 0 ]]; then + wait_for + WAITFORIT_RESULT=$? + exit $WAITFORIT_RESULT +else + if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then + wait_for_wrapper + WAITFORIT_RESULT=$? + else + wait_for + WAITFORIT_RESULT=$? + fi +fi + +if [[ $WAITFORIT_CLI != "" ]]; then + if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then + echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess" + exit $WAITFORIT_RESULT + fi + exec "${WAITFORIT_CLI[@]}" +else + exit $WAITFORIT_RESULT +fi diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 792495b09..517731712 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -15,6 +15,9 @@ services: - MYSQL_DATABASE=ospos - MYSQL_USERNAME=admin - MYSQL_PASSWORD=pointofsale + command: ["/bin/wait-for-it.sh", "mysql:3306", "--", "/app/vendor/phpunit/phpunit/phpunit"] + volumes: + - ./bin/wait-for-it.sh:/bin/wait-for-it.sh ports: - "80:80" From 21106926646d1921b3d32870bb516c42f55266cc Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 28 Feb 2020 23:49:24 +0100 Subject: [PATCH 19/65] Overwrite backupGlobals + base_url generation in testing mode --- Dockerfile | 1 + application/config/config.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d3da3ad64..229668f53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ COPY --from=composer /usr/bin/composer /usr/bin/composer RUN composer install -d/app RUN php /app/vendor/kenjis/ci-phpunit-test/install.php -a /app/application -p /app/vendor/codeigniter/framework +RUN sed -i 's/backupGlobals="true"/backupGlobals="false"/g' /app/application/tests/phpunit.xml WORKDIR /app/application/tests diff --git a/application/config/config.php b/application/config/config.php index 654a30949..b60d90aab 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -65,7 +65,9 @@ $config['db_log_enabled'] = FALSE; | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = ''; +$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http'; +$config['base_url'] .= '://' . (ENVIRONMENT == "testing") ? 'localhost' : $_SERVER['HTTP_HOST'] ; +$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); /* |-------------------------------------------------------------------------- From 99bd6570b98397272ea10ab34ec777f9a46ffc8b Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 29 Feb 2020 01:07:04 +0100 Subject: [PATCH 20/65] Load testing dotenv if environment is set --- application/config/hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/hooks.php b/application/config/hooks.php index 37e9d3ccc..dfc36793c 100644 --- a/application/config/hooks.php +++ b/application/config/hooks.php @@ -27,7 +27,7 @@ $hook['post_controller'] = array( ); $hook['pre_system'] = function() { - $config_path = APPPATH . 'config/'; + $config_path = APPPATH . (ENVIRONMENT == 'testing') ? 'tests/' : 'config/'; try { $dotenv = new Dotenv\Dotenv($config_path); $dotenv->overload(); From 2eec0ae6f03fcb964b71890be2306668d578c1a7 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 5 Mar 2020 00:02:43 +0100 Subject: [PATCH 21/65] Fix unit test --- .../tests/libraries/Barcode_lib_test.php | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index 39286956b..d9640adf9 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -1,5 +1,4 @@ resetInstance(); - + $this->obj = $this->newLibrary('Barcode_lib'); + } public function test_barcode_weight_first() { - $config = $this->getMockBuilder('CI_Config') - ->disableOriginalConstructor() - ->setMethods(['item']) - ->getMock(); - $config->method('item') - ->willReturn("02(\d{5})(\w{6})"); + $this->CI->config->set_item('barcode_formats', json_encode(array("02(\d{5})(\w{6})"))); - $item_number = "025000abcdef"; + $item_number = "0250000123456"; $quantity = 0; $this->obj->parse_barcode_fields($quantity, $item_number); echo $quantity; - $this->assertEquals($quantity, 1); - $this->assertEquals($item_number, "025000123456"); + $this->assertEquals($quantity, 123.456); + $this->assertEquals($item_number, "50000"); } public function test_barcode_weight_last() { - $config = $this->getMockBuilder('CI_Config') - ->disableOriginalConstructor() - ->setMethods(['item']) - ->getMock(); - $config->method('item') - ->willReturn("02(\w{6})(\d{5})"); + $this->CI->config->set_item('barcode_formats', json_encode(array("02(\w{6})(\d{5})"))); $item_number = "0212345650001"; $quantity = 0; $this->obj->parse_barcode_fields($quantity, $item_number); - $this->assertEquals($quantity, 5.001); + $this->assertEquals($quantity, 50.001); $this->assertEquals($item_number, 123456); } } \ No newline at end of file From 2d57326779841b8289ec0d0eefcea89d1dc4bb18 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 5 Mar 2020 00:07:17 +0100 Subject: [PATCH 22/65] Run tests using travis-CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8131c3bc6..96fa7fc4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ script: - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt sh -c "npm install && bower install && grunt package" - - /bin/bash docker/install-local.sh + - docker-compose -f docker-compose.test.yml up env: - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" From 609cb14cdaa4006e39d50b9921e9e4a43a5867fd Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 5 Mar 2020 00:12:47 +0100 Subject: [PATCH 23/65] Upgrade compose version --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 96fa7fc4b..b9fb38a98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,7 @@ branches: services: - docker before_install: - - curl -L https://github.com/docker/compose/releases/download/1.7.1/docker-compose-`uname - -s`-`uname -m` > docker-compose + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - date=`date +%Y%m%d%H%M%S` && branch=${TRAVIS_BRANCH} && rev=`git rev-parse --short=6 @@ -21,6 +20,7 @@ script: sh -c "npm install && bower install && grunt package" - docker-compose -f docker-compose.test.yml up env: + - DOCKER_COMPOSE_VERSION=1.21.1 - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "opensourcepos_ospos:latest" "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' From be2ff4bee43a35b9d6b8035692ba21e82577b155 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 5 Mar 2020 12:28:19 +0100 Subject: [PATCH 24/65] Don't expose port + set mysql hostname --- docker-compose.test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 517731712..e46250dbc 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -11,7 +11,7 @@ services: environment: - CI_ENV=testing - ENCRYPTION_KEY= - - MYSQL_HOST_NAME=127.0.0.1 + - MYSQL_HOST_NAME=mysql - MYSQL_DATABASE=ospos - MYSQL_USERNAME=admin - MYSQL_PASSWORD=pointofsale @@ -25,8 +25,6 @@ services: image: mariadb:10.3 container_name: mysql restart: always - ports: - - "3306:3306" volumes: - ./database/database.sql:/docker-entrypoint-initdb.d/database.sql environment: From a8d0a376f369e8467bae79841d49712be0c29c11 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 6 Mar 2020 18:19:38 +0100 Subject: [PATCH 25/65] Remove failing test + fetch script from github --- .travis.yml | 7 +- Dockerfile | 5 +- bin/wait-for-it.sh | 182 ---------------------------------------- docker-compose.test.yml | 2 - 4 files changed, 7 insertions(+), 189 deletions(-) delete mode 100755 bin/wait-for-it.sh diff --git a/.travis.yml b/.travis.yml index b9fb38a98..524235e9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,10 @@ script: - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt sh -c "npm install && bower install && grunt package" - - docker-compose -f docker-compose.test.yml up + - docker-compose -f docker-compose.test.yml up --abort-on-container-exit env: - - DOCKER_COMPOSE_VERSION=1.21.1 - - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) -after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + - DOCKER_COMPOSE_VERSION=1.21.1 TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) +fter_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "opensourcepos_ospos:latest" "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' deploy: file: deployment.json diff --git a/Dockerfile b/Dockerfile index 229668f53..ba6f825ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,10 +20,13 @@ FROM ospos AS ospos_test COPY --from=composer /usr/bin/composer /usr/bin/composer +RUN apt-get install -y libzip-dev wget +RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /bin/wait-for-it.sh && chmod +x /bin/wait-for-it.sh +RUN docker-php-ext-install zip RUN composer install -d/app RUN php /app/vendor/kenjis/ci-phpunit-test/install.php -a /app/application -p /app/vendor/codeigniter/framework RUN sed -i 's/backupGlobals="true"/backupGlobals="false"/g' /app/application/tests/phpunit.xml - +RUN sed -i '13,17d' /app/application/tests/controllers/Welcome_test.php WORKDIR /app/application/tests CMD ["/app/vendor/phpunit/phpunit/phpunit"] diff --git a/bin/wait-for-it.sh b/bin/wait-for-it.sh deleted file mode 100755 index 5e8679e54..000000000 --- a/bin/wait-for-it.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env bash -# Use this script to test if a given TCP host/port are available - -WAITFORIT_cmdname=${0##*/} - -echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi } - -usage() -{ - cat << USAGE >&2 -Usage: - $WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args] - -h HOST | --host=HOST Host or IP under test - -p PORT | --port=PORT TCP port under test - Alternatively, you specify the host and port as host:port - -s | --strict Only execute subcommand if the test succeeds - -q | --quiet Don't output any status messages - -t TIMEOUT | --timeout=TIMEOUT - Timeout in seconds, zero for no timeout - -- COMMAND ARGS Execute command with args after the test finishes -USAGE - exit 1 -} - -wait_for() -{ - if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then - echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" - else - echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout" - fi - WAITFORIT_start_ts=$(date +%s) - while : - do - if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then - nc -z $WAITFORIT_HOST $WAITFORIT_PORT - WAITFORIT_result=$? - else - (echo > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1 - WAITFORIT_result=$? - fi - if [[ $WAITFORIT_result -eq 0 ]]; then - WAITFORIT_end_ts=$(date +%s) - echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds" - break - fi - sleep 1 - done - return $WAITFORIT_result -} - -wait_for_wrapper() -{ - # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692 - if [[ $WAITFORIT_QUIET -eq 1 ]]; then - timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT & - else - timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT & - fi - WAITFORIT_PID=$! - trap "kill -INT -$WAITFORIT_PID" INT - wait $WAITFORIT_PID - WAITFORIT_RESULT=$? - if [[ $WAITFORIT_RESULT -ne 0 ]]; then - echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" - fi - return $WAITFORIT_RESULT -} - -# process arguments -while [[ $# -gt 0 ]] -do - case "$1" in - *:* ) - WAITFORIT_hostport=(${1//:/ }) - WAITFORIT_HOST=${WAITFORIT_hostport[0]} - WAITFORIT_PORT=${WAITFORIT_hostport[1]} - shift 1 - ;; - --child) - WAITFORIT_CHILD=1 - shift 1 - ;; - -q | --quiet) - WAITFORIT_QUIET=1 - shift 1 - ;; - -s | --strict) - WAITFORIT_STRICT=1 - shift 1 - ;; - -h) - WAITFORIT_HOST="$2" - if [[ $WAITFORIT_HOST == "" ]]; then break; fi - shift 2 - ;; - --host=*) - WAITFORIT_HOST="${1#*=}" - shift 1 - ;; - -p) - WAITFORIT_PORT="$2" - if [[ $WAITFORIT_PORT == "" ]]; then break; fi - shift 2 - ;; - --port=*) - WAITFORIT_PORT="${1#*=}" - shift 1 - ;; - -t) - WAITFORIT_TIMEOUT="$2" - if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi - shift 2 - ;; - --timeout=*) - WAITFORIT_TIMEOUT="${1#*=}" - shift 1 - ;; - --) - shift - WAITFORIT_CLI=("$@") - break - ;; - --help) - usage - ;; - *) - echoerr "Unknown argument: $1" - usage - ;; - esac -done - -if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then - echoerr "Error: you need to provide a host and port to test." - usage -fi - -WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15} -WAITFORIT_STRICT=${WAITFORIT_STRICT:-0} -WAITFORIT_CHILD=${WAITFORIT_CHILD:-0} -WAITFORIT_QUIET=${WAITFORIT_QUIET:-0} - -# Check to see if timeout is from busybox? -WAITFORIT_TIMEOUT_PATH=$(type -p timeout) -WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH) - -WAITFORIT_BUSYTIMEFLAG="" -if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then - WAITFORIT_ISBUSY=1 - # Check if busybox timeout uses -t flag - # (recent Alpine versions don't support -t anymore) - if timeout &>/dev/stdout | grep -q -e '-t '; then - WAITFORIT_BUSYTIMEFLAG="-t" - fi -else - WAITFORIT_ISBUSY=0 -fi - -if [[ $WAITFORIT_CHILD -gt 0 ]]; then - wait_for - WAITFORIT_RESULT=$? - exit $WAITFORIT_RESULT -else - if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then - wait_for_wrapper - WAITFORIT_RESULT=$? - else - wait_for - WAITFORIT_RESULT=$? - fi -fi - -if [[ $WAITFORIT_CLI != "" ]]; then - if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then - echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess" - exit $WAITFORIT_RESULT - fi - exec "${WAITFORIT_CLI[@]}" -else - exit $WAITFORIT_RESULT -fi diff --git a/docker-compose.test.yml b/docker-compose.test.yml index e46250dbc..fd8cc4f48 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -16,8 +16,6 @@ services: - MYSQL_USERNAME=admin - MYSQL_PASSWORD=pointofsale command: ["/bin/wait-for-it.sh", "mysql:3306", "--", "/app/vendor/phpunit/phpunit/phpunit"] - volumes: - - ./bin/wait-for-it.sh:/bin/wait-for-it.sh ports: - "80:80" From eae2dd483b3575baf3fdbfc6ef67f9f05c299462 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 6 Mar 2020 23:00:46 +0100 Subject: [PATCH 26/65] Remove hebrew (no more official CI support) --- application/helpers/locale_helper.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index f3d87f5e8..c128e8c7f 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -66,7 +66,6 @@ function get_languages() 'es:spanish' => 'Spanish', 'es-MX:spanish' => 'Spanish (Mexico)', 'fr:french' => 'French', - 'he:hebrew' => 'Hebrew', 'hr-HR:croatian' => 'Croatian (Croatia)', 'hu-HU:hungarian' => 'Hungarian (Hungary)', 'id:indonesian' => 'Indonesian', From 1c76edfc01d7e1922d773cfd2f0b3caa203b8652 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 6 Mar 2020 23:22:34 +0100 Subject: [PATCH 27/65] Fix config.php (#2751) --- application/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index b60d90aab..e10ca199b 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -66,7 +66,7 @@ $config['db_log_enabled'] = FALSE; | */ $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http'; -$config['base_url'] .= '://' . (ENVIRONMENT == "testing") ? 'localhost' : $_SERVER['HTTP_HOST'] ; +$config['base_url'] .= '://' . ((ENVIRONMENT == "testing") ? 'localhost' : $_SERVER['HTTP_HOST']) ; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); /* From c6048c8461ffaa281c1cdd2f656568b63afa7c96 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 6 Mar 2020 23:36:01 +0100 Subject: [PATCH 28/65] Set global variables in .travis.env --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 524235e9c..4e5785424 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,9 @@ script: sh -c "npm install && bower install && grunt package" - docker-compose -f docker-compose.test.yml up --abort-on-container-exit env: - - DOCKER_COMPOSE_VERSION=1.21.1 TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) + global: + - DOCKER_COMPOSE_VERSION=1.21.1 + - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) fter_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "opensourcepos_ospos:latest" "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' deploy: From 7a1891e5e8a3d2fe044f51a19c2547069a75a8a1 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 6 Mar 2020 23:52:48 +0100 Subject: [PATCH 29/65] Try to fix docker push (#2751) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4e5785424..e00e2fd1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ env: global: - DOCKER_COMPOSE_VERSION=1.21.1 - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) -fter_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" +after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "opensourcepos_ospos:latest" "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' deploy: file: deployment.json From dbe525a7240ac37c589b7effb001b55cb97861c8 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 7 Mar 2020 00:13:41 +0100 Subject: [PATCH 30/65] Run regular container build before push --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e00e2fd1d..fde898e51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ script: - sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt sh -c "npm install && bower install && grunt package" + - docker-compose build - docker-compose -f docker-compose.test.yml up --abort-on-container-exit env: global: From a9b63fa360078ff11fa888ad09778bca3084c1c8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 7 Mar 2020 12:50:07 +0100 Subject: [PATCH 31/65] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 0b914299b..884219b07 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -98,7 +98,7 @@ Cloud install ------------- If you choose *DigitalOcean*: -[Through this link](https://m.do.co/c/ac38c262507b), you will get a *$50 credit* for a first month. [Check the wiki](https://github.com/opensourcepos/opensourcepos/wiki/DOCS-USERS-Getting-Started-installations#cloud-deploy-installation) for further instructions on how to install the necessary components. +[Through this link](https://m.do.co/c/ac38c262507b), you will get a *$100 credit* for a first month. [Check the wiki](https://github.com/opensourcepos/opensourcepos/wiki/DOCS-USERS-Getting-Started-installations#cloud-deploy-installation) for further instructions on how to install the necessary components. cPanel & SSH Install From ba19bc5ad64e7d3fa9c024046c8fa5746c261d39 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 7 Mar 2020 12:51:28 +0100 Subject: [PATCH 32/65] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 884219b07..08495fa2f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -98,7 +98,7 @@ Cloud install ------------- If you choose *DigitalOcean*: -[Through this link](https://m.do.co/c/ac38c262507b), you will get a *$100 credit* for a first month. [Check the wiki](https://github.com/opensourcepos/opensourcepos/wiki/DOCS-USERS-Getting-Started-installations#cloud-deploy-installation) for further instructions on how to install the necessary components. +[Through this link](https://m.do.co/c/ac38c262507b), you will get a *$100 credit* for a first month. [Check the wiki](https://github.com/opensourcepos/opensourcepos/wiki/Getting-Started-installations) for further instructions on how to install the necessary components. cPanel & SSH Install From 9583483543b641d5d951534f062f8dc425012daa Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 7 Mar 2020 12:58:50 +0100 Subject: [PATCH 33/65] Update after_success line --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fde898e51..7e74b3f5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ env: global: - DOCKER_COMPOSE_VERSION=1.21.1 - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) -after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - && docker tag "opensourcepos_ospos:latest" "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' +after_success: + - 'docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "opensourcepos_ospos:latest" "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' deploy: file: deployment.json provider: bintray From 7c33159a38a898fec2ffecce2325c575d2e12640 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 7 Mar 2020 15:21:20 +0100 Subject: [PATCH 34/65] Fix config.php in testing mode --- application/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index e10ca199b..ff873a9c0 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -66,7 +66,7 @@ $config['db_log_enabled'] = FALSE; | */ $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http'; -$config['base_url'] .= '://' . ((ENVIRONMENT == "testing") ? 'localhost' : $_SERVER['HTTP_HOST']) ; +$config['base_url'] .= '://' . ((isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : 'localhost') ; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); /* From 4300f0a3c6968ae57136d9af58ad00af6094add9 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sun, 8 Mar 2020 20:15:22 +0100 Subject: [PATCH 35/65] Rework barcode format parser --- application/controllers/Receivings.php | 4 +- application/controllers/Sales.php | 3 +- application/libraries/Barcode_lib.php | 21 ++---- application/libraries/Token_lib.php | 38 +++++++++- application/models/tokens/Token.php | 5 ++ .../models/tokens/Token_barcode_ean.php | 22 ++++++ .../models/tokens/Token_barcode_price.php | 22 ++++++ .../models/tokens/Token_barcode_weight.php | 22 ++++++ .../tests/libraries/Barcode_lib_test.php | 73 ++++++++++++------- .../tests/libraries/Token_lib_test.php | 29 ++++++++ 10 files changed, 194 insertions(+), 45 deletions(-) create mode 100644 application/models/tokens/Token_barcode_ean.php create mode 100644 application/models/tokens/Token_barcode_price.php create mode 100644 application/models/tokens/Token_barcode_weight.php create mode 100644 application/tests/libraries/Token_lib_test.php diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index faa90915a..56463479c 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -90,7 +90,7 @@ class Receivings extends Secure_Controller $mode = $this->receiving_lib->get_mode(); $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); - $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); + $this->barcode_lib->parse_barcode_fields($quantity, $price, $item_id_or_number_or_item_kit_or_receipt); $quantity = ($mode == 'receive' || $mode == 'requisition') ? $quantity : -$quantity; $item_location = $this->receiving_lib->get_stock_source(); $discount = $this->config->item('default_receivings_discount'); @@ -104,7 +104,7 @@ class Receivings extends Secure_Controller { $this->receiving_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location, $discount, $discount_type); } - elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_type)) + elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_type, $price)) { $data['error'] = $this->lang->line('receivings_unable_to_add_item'); } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 26cfee789..547ab4aa8 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -398,7 +398,7 @@ class Sales extends Secure_Controller } $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); - $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); + $this->barcode_lib->parse_barcode_fields($quantity, $price, $item_id_or_number_or_item_kit_or_receipt); $mode = $this->sale_lib->get_mode(); $quantity = ($mode == 'return') ? -$quantity : $quantity; $item_location = $this->sale_lib->get_sale_location(); @@ -423,7 +423,6 @@ class Sales extends Secure_Controller $discount_type = $item_kit_info->kit_discount_type; } - $price = NULL; $print_option = PRINT_ALL; // Always include in list of items on invoice if(!empty($kit_item_id)) diff --git a/application/libraries/Barcode_lib.php b/application/libraries/Barcode_lib.php index e8ae9dd59..147b5739b 100644 --- a/application/libraries/Barcode_lib.php +++ b/application/libraries/Barcode_lib.php @@ -49,30 +49,23 @@ class Barcode_lib return $data; } - public function parse_barcode_fields(&$quantity, &$item_id_or_number_or_item_kit_or_receipt) + public function parse_barcode_fields(&$quantity, &$price, &$item_id_or_number_or_item_kit_or_receipt) { $barcode_formats = json_decode($this->CI->config->item('barcode_formats')); + $barcode_tokens = Token::get_barcode_tokens(); if(!empty($barcode_formats)) { foreach($barcode_formats as $barcode_format) { - if(preg_match("/$barcode_format/", $item_id_or_number_or_item_kit_or_receipt, $matches) && sizeof($matches) > 1) - { - $qtyfirst = strpos('d', $barcode_format) - strpos('w', $barcode_format) < 0; - $quantity = $matches[$qtyfirst ? 1 : 2]; - if(strstr($barcode_format, '02')) - { - $quantity = $quantity / 1000; - } - $item_id_or_number_or_item_kit_or_receipt = $matches[$qtyfirst ? 2 : 1]; - - return; - } + $parsed_results = $this->CI->Token_lib->parse($item_id_or_number_or_item_kit_or_receipt, $barcode_format, $barcode_tokens); + $quantity = (isset($parsed_results['W'])) ? (int) $parsed_results['W'] / 1000 : 1; + $item_id_or_number_or_item_kit_or_receipt = (isset($parsed_results['I'])) ? + $parsed_results['I'] : $item_id_or_number_or_item_kit_or_receipt; + $price = (isset($parsed_results['P'])) ? (int) $parsed_results['P'] : NULL; } } - $quantity = 1; } public function validate_barcode($barcode) diff --git a/application/libraries/Token_lib.php b/application/libraries/Token_lib.php index 483ff563c..cbc97825e 100644 --- a/application/libraries/Token_lib.php +++ b/application/libraries/Token_lib.php @@ -78,12 +78,46 @@ class Token_lib return $token_tree; } + public function parse($string, $pattern, $tokens = array()) + { + $token_tree = $this->scan($pattern); + + $found_tokens = array(); + foreach ($token_tree as $token_id => $token_length) + { + foreach ($tokens as $token) + { + if ($token->token_id() == $token_id) + { + $found_tokens[] = $token; + $keys = array_keys($token_length); + $length = array_shift($keys); + $pattern = str_replace(array_shift($token_length), "({$token->get_value()}{".$length."})", $pattern); + } + } + } + + $results = array(); + + if (preg_match("/$pattern/", $string, $matches)) + { + foreach($found_tokens as $token) + { + $index = array_search($token, $found_tokens); + $match = $matches[$index+1]; + $results[$token->token_id()] = $match; + } + } + + return $results; + } + public function generate($used_tokens, &$tokens_to_replace, &$token_values, $tokens) { foreach($used_tokens as $token_code => $token_info) { // Generate value here based on the key value - $token_value = $this->resolveToken($token_code); + $token_value = $this->resolve_token($token_code); foreach($token_info as $length => $token_spec) { @@ -102,7 +136,7 @@ class Token_lib return $token_values; } - private function resolveToken($token_code, $tokens = array()) + private function resolve_token($token_code, $tokens = array()) { foreach(array_merge($tokens, Token::get_tokens()) as $token) { diff --git a/application/models/tokens/Token.php b/application/models/tokens/Token.php index d482de0e4..fab4a1f6a 100644 --- a/application/models/tokens/Token.php +++ b/application/models/tokens/Token.php @@ -25,6 +25,11 @@ abstract class Token $this->value = $value; } + static function get_barcode_tokens() + { + return array(new Token_barcode_price(), new Token_barcode_weight(), new Token_barcode_ean()); + } + static function get_tokens() { return array(new Token_customer(), new Token_invoice_count(), new Token_invoice_sequence(), diff --git a/application/models/tokens/Token_barcode_ean.php b/application/models/tokens/Token_barcode_ean.php new file mode 100644 index 000000000..f6c125cf4 --- /dev/null +++ b/application/models/tokens/Token_barcode_ean.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/application/models/tokens/Token_barcode_price.php b/application/models/tokens/Token_barcode_price.php new file mode 100644 index 000000000..1b12eb158 --- /dev/null +++ b/application/models/tokens/Token_barcode_price.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/application/models/tokens/Token_barcode_weight.php b/application/models/tokens/Token_barcode_weight.php new file mode 100644 index 000000000..bb4f118ec --- /dev/null +++ b/application/models/tokens/Token_barcode_weight.php @@ -0,0 +1,22 @@ + diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index d9640adf9..451918ff7 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -4,36 +4,59 @@ */ class Barcode_lib_test extends UnitTestCase { - public function setUp() - { - $this->resetInstance(); - - $this->obj = $this->newLibrary('Barcode_lib'); + public function setUp() + { + $this->resetInstance(); - } + $this->obj = $this->newLibrary('Barcode_lib'); + $this->CI->Token_lib = $this->newLibrary('Token_lib'); - public function test_barcode_weight_first() - { - $this->CI->config->set_item('barcode_formats', json_encode(array("02(\d{5})(\w{6})"))); + ReflectionHelper::setPrivateProperty( + $this->obj, + 'CI', + $this->CI + ); - $item_number = "0250000123456"; - $quantity = 0; - $this->obj->parse_barcode_fields($quantity, $item_number); + } - echo $quantity; - $this->assertEquals($quantity, 123.456); - $this->assertEquals($item_number, "50000"); - } + public function test_barcode_item_number_and_quantity() + { + $this->CI->config->set_item('barcode_formats', json_encode(array("02{I:5}{W:6}"))); - public function test_barcode_weight_last() - { - $this->CI->config->set_item('barcode_formats', json_encode(array("02(\w{6})(\d{5})"))); + $item_number = "0250000123456"; + $quantity = 0; + $this->obj->parse_barcode_fields($quantity, $price, $item_number); - $item_number = "0212345650001"; - $quantity = 0; - $this->obj->parse_barcode_fields($quantity, $item_number); + $this->assertEquals($quantity, 123.456); + $this->assertEquals($item_number, "50000"); + $this->assertEquals($price, NULL); + } - $this->assertEquals($quantity, 50.001); - $this->assertEquals($item_number, 123456); - } + public function test_barcode_quantity_and_item_number() + { + $this->CI->config->set_item('barcode_formats', json_encode(array("02{I:6}{W:5}{P:2}"))); + + $item_number = "021234565000110"; + $quantity = 0; + $this->obj->parse_barcode_fields($quantity, $price, $item_number); + + + $this->assertEquals($price, 10); + $this->assertEquals($item_number, 123456); + $this->assertEquals($quantity, 50.001); + } + + public function test_no_barcode_format() + { + $this->CI->config->set_item('barcode_formats', json_encode(array(""))); + + $item_number = "021234565000110"; + $quantity = 0; + + $this->obj->parse_barcode_fields($quantity, $price, $item_number); + + $this->assertEquals($quantity, 1); + $this->assertEquals($price, 0); + $this->assertEquals($item_number, "021234565000110"); + } } \ No newline at end of file diff --git a/application/tests/libraries/Token_lib_test.php b/application/tests/libraries/Token_lib_test.php new file mode 100644 index 000000000..546af6086 --- /dev/null +++ b/application/tests/libraries/Token_lib_test.php @@ -0,0 +1,29 @@ +resetInstance(); + + $this->obj = $this->newLibrary('Token_lib'); + } + + public function test_token_parser() + { + $tokens = Token::get_barcode_tokens(); + + $parsed_tokens = $this->obj->parse("0250200000abc", "02{P:2}{W:6}{I:3}", $tokens); + + $this->assertEquals($parsed_tokens['I'], 'abc'); + $this->assertEquals($parsed_tokens['P'], '50'); + $this->assertEquals($parsed_tokens['W'], '200000'); + + } + +} + +?> \ No newline at end of file From 858320fe20531190f784c565a852106e6c0ba398 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Mon, 9 Mar 2020 19:54:14 +0100 Subject: [PATCH 36/65] Disable attribute sort (#2722) --- application/helpers/tabular_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index ba7ff5cf5..bcc2314b8 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -354,7 +354,7 @@ function get_items_manage_table_headers() foreach($definition_names as $definition_id => $definition_name) { - $headers[] = array($definition_id => $definition_name); + $headers[] = array($definition_id => $definition_name, 'sortable' => FALSE); } $headers[] = array('inventory' => ''); From 34b7e68f041957e30cb3564129628d665314679c Mon Sep 17 00:00:00 2001 From: Emil Ebsen Date: Mon, 9 Mar 2020 21:45:33 +0000 Subject: [PATCH 37/65] Added translation using Weblate (Danish) --- application/language/da/bootstrap_tables_lang.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 application/language/da/bootstrap_tables_lang.php diff --git a/application/language/da/bootstrap_tables_lang.php b/application/language/da/bootstrap_tables_lang.php new file mode 100644 index 000000000..8cedaec71 --- /dev/null +++ b/application/language/da/bootstrap_tables_lang.php @@ -0,0 +1,9 @@ + Date: Wed, 4 Mar 2020 04:21:11 +0000 Subject: [PATCH 38/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (67 of 67 strings) Translation: ospos/common Translate-URL: http://weblate.jpeelaer.net/projects/ospos/common/zh_Hans/ --- application/language/zh-Hans/common_lang.php | 92 ++++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/application/language/zh-Hans/common_lang.php b/application/language/zh-Hans/common_lang.php index 93b0836ef..bd4efedd7 100644 --- a/application/language/zh-Hans/common_lang.php +++ b/application/language/zh-Hans/common_lang.php @@ -2,68 +2,68 @@ $lang["common_address_1"] = "地址 1"; $lang["common_address_2"] = "地址 2"; $lang["common_city"] = "城市"; -$lang["common_close"] = "Close"; -$lang["common_comments"] = "評論"; +$lang["common_close"] = "关闭"; +$lang["common_comments"] = "备注"; $lang["common_common"] = "一般"; -$lang["common_confirm_search"] = "您已經選擇一行或多行,在搜索後這些紀錄將不能再被選取。您確定要提交這個搜索?"; +$lang["common_confirm_search"] = "你已经选择了 一行或多行,之后的搜索结果不再被选取。你确定要提交本次搜索吗?"; $lang["common_correct_errors"] = "信息有误,请修正后保存"; -$lang["common_country"] = "國家"; -$lang["common_date"] = "Date"; +$lang["common_country"] = "国家"; +$lang["common_date"] = "日期"; $lang["common_delete"] = "刪除"; $lang["common_det"] = "更多"; -$lang["common_download_import_template"] = "Download Import CSV Template (CSV)"; -$lang["common_edit"] = "編輯"; -$lang["common_email"] = "郵箱"; -$lang["common_email_invalid_format"] = "Email格式錯誤"; -$lang["common_export_csv"] = "CSV Export"; -$lang["common_export_csv_no"] = "No"; -$lang["common_export_csv_yes"] = "Yes"; -$lang["common_fields_required_message"] = "紅色欄位為必填"; +$lang["common_download_import_template"] = "下载CSV模板(CSV)"; +$lang["common_edit"] = "编辑"; +$lang["common_email"] = "邮箱"; +$lang["common_email_invalid_format"] = "Email格式错误。"; +$lang["common_export_csv"] = "CSV 导出"; +$lang["common_export_csv_no"] = "否"; +$lang["common_export_csv_yes"] = "是"; +$lang["common_fields_required_message"] = "红色栏位是必填项"; $lang["common_first_name"] = "名"; -$lang["common_first_name_required"] = "名為必填"; -$lang["common_first_page"] = "First"; -$lang["common_gender"] = "Gender"; -$lang["common_gender_female"] = "V"; -$lang["common_gender_male"] = "M"; +$lang["common_first_name_required"] = "名为必填项。"; +$lang["common_first_page"] = "首页"; +$lang["common_gender"] = "性别"; +$lang["common_gender_female"] = "女"; +$lang["common_gender_male"] = "男"; $lang["common_id"] = "Id"; $lang["common_import"] = "Import"; -$lang["common_import_change_file"] = "Change"; -$lang["common_import_csv"] = "CSV Import"; -$lang["common_import_full_path"] = "Full path to csv file required"; -$lang["common_import_remove_file"] = "Remove"; -$lang["common_import_select_file"] = "Select file"; -$lang["common_inv"] = "庫存"; +$lang["common_import_change_file"] = "更改"; +$lang["common_import_csv"] = "CSV 导入"; +$lang["common_import_full_path"] = "需要CSV文件的完整路径"; +$lang["common_import_remove_file"] = "删除"; +$lang["common_import_select_file"] = "选择文件"; +$lang["common_inv"] = "库存"; $lang["common_last_name"] = "姓"; -$lang["common_last_name_required"] = "姓氏為必填"; -$lang["common_last_page"] = "Last"; -$lang["common_learn_about_project"] = "了解系統開展進度"; +$lang["common_last_name_required"] = "姓氏为必填项。"; +$lang["common_last_page"] = "尾页"; +$lang["common_learn_about_project"] = "了解项目最新进度。"; $lang["common_list_of"] = "列表"; $lang["common_logout"] = "登出"; $lang["common_migration_needed"] = "登录后,数据库将会迁移到%1。"; -$lang["common_new"] = "New"; -$lang["common_no_persons_to_display"] = "沒有使用者資料可以顯示"; -$lang["common_none_selected_text"] = "请选择"; +$lang["common_new"] = "新建"; +$lang["common_no_persons_to_display"] = "沒有使用者资料可以展示。"; +$lang["common_none_selected_text"] = "【请选择】"; $lang["common_or"] = "或"; -$lang["common_phone_number"] = "電話"; +$lang["common_phone_number"] = "电话号码"; $lang["common_phone_number_required"] = ""; -$lang["common_please_visit_my"] = "請造訪"; -$lang["common_powered_by"] = "Powered by"; -$lang["common_price"] = "價值"; -$lang["common_print"] = "Print"; +$lang["common_please_visit_my"] = "请造访"; +$lang["common_powered_by"] = "供应"; +$lang["common_price"] = "价格"; +$lang["common_print"] = "打印"; $lang["common_remove"] = "移除"; -$lang["common_required"] = "Required"; +$lang["common_required"] = "需要"; $lang["common_restore"] = "恢复"; -$lang["common_return_policy"] = "退貨政策"; -$lang["common_search"] = "搜尋"; -$lang["common_search_options"] = "Search options"; +$lang["common_return_policy"] = "退货政策"; +$lang["common_search"] = "搜索"; +$lang["common_search_options"] = "搜索选项"; $lang["common_searched_for"] = "查找"; -$lang["common_state"] = "州"; -$lang["common_submit"] = "送出"; +$lang["common_state"] = "省"; +$lang["common_submit"] = "提交"; $lang["common_total_spent"] = "总支出"; $lang["common_unknown"] = "未知"; -$lang["common_view_recent_sales"] = "最新的消售資訊"; -$lang["common_website"] = "網站"; -$lang["common_welcome"] = "歡迎"; -$lang["common_welcome_message"] = "歡迎使用OSPOS,請點擊下面的模組以開始使用!"; +$lang["common_view_recent_sales"] = "查看最近的销售情况"; +$lang["common_website"] = "网站"; +$lang["common_welcome"] = "欢迎"; +$lang["common_welcome_message"] = "欢迎使用OSPOS,请点击下面的模块开始使用。"; $lang["common_you_are_using_ospos"] = "您正在使用 Open Source Point Of Sale 版本"; -$lang["common_zip"] = "郵遞區號"; +$lang["common_zip"] = "邮政编码"; From 91c6508317e2a1f994f0795667a9b11bde3db62e Mon Sep 17 00:00:00 2001 From: khao_lek Date: Mon, 9 Mar 2020 08:39:27 +0000 Subject: [PATCH 39/65] Translated using Weblate (Thai) Currently translated at 100.0% (67 of 67 strings) Translation: ospos/common Translate-URL: http://weblate.jpeelaer.net/projects/ospos/common/th/ --- application/language/th/common_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/th/common_lang.php b/application/language/th/common_lang.php index e2d8b9a66..fbfa270dc 100644 --- a/application/language/th/common_lang.php +++ b/application/language/th/common_lang.php @@ -29,7 +29,7 @@ $lang["common_id"] = "Id"; $lang["common_import"] = "นำเข้า"; $lang["common_import_change_file"] = "เปลี่ยน"; $lang["common_import_csv"] = "CSV Import"; -$lang["common_import_full_path"] = "ต้องระบุบที่อยู่ของไฟล์เอ็กซ์เซล"; +$lang["common_import_full_path"] = "ต้องระบุบที่อยู่ของไฟล์ซีเอสวี"; $lang["common_import_remove_file"] = "นำออก"; $lang["common_import_select_file"] = "เลือกไฟล์"; $lang["common_inv"] = "ยอด"; From f30e085d78ae78321fa8a211366da909cb4de37e Mon Sep 17 00:00:00 2001 From: Jintao-Yao Date: Wed, 4 Mar 2020 04:14:35 +0000 Subject: [PATCH 40/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (29 of 29 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/zh_Hans/ --- application/language/zh-Hans/attributes_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/zh-Hans/attributes_lang.php b/application/language/zh-Hans/attributes_lang.php index 8a6f961ad..0f273caaa 100644 --- a/application/language/zh-Hans/attributes_lang.php +++ b/application/language/zh-Hans/attributes_lang.php @@ -24,7 +24,7 @@ $lang["attributes_show_in_items"] = "在项目中显示"; $lang["attributes_show_in_items_visibility"] = "物品"; $lang["attributes_show_in_receipt"] = "在收据中显示"; $lang["attributes_show_in_receivings"] = "在收据中显示"; -$lang["attributes_show_in_receivings_visibility"] = ""; +$lang["attributes_show_in_receivings_visibility"] = "收据"; $lang["attributes_show_in_sales"] = "在销售中显示"; $lang["attributes_show_in_sales_visibility"] = "销售"; $lang["attributes_update"] = "更新属性"; From b1cb951a9e82b3b41feaa991c381ae0a92247deb Mon Sep 17 00:00:00 2001 From: Emil Ebsen Date: Mon, 9 Mar 2020 21:35:48 +0000 Subject: [PATCH 41/65] Translated using Weblate (Danish) Currently translated at 100.0% (29 of 29 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/da/ --- application/language/da/attributes_lang.php | 56 ++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/application/language/da/attributes_lang.php b/application/language/da/attributes_lang.php index 31ca3ea3a..bb750d2e6 100644 --- a/application/language/da/attributes_lang.php +++ b/application/language/da/attributes_lang.php @@ -1,30 +1,30 @@ Date: Mon, 2 Mar 2020 23:45:07 +0000 Subject: [PATCH 42/65] Translated using Weblate (Spanish) Currently translated at 100.0% (278 of 278 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/es/ --- application/language/es/config_lang.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index 597cbcf91..888acce91 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -47,7 +47,7 @@ $lang["config_currency_code"] = "Código de Moneda"; $lang["config_currency_decimals"] = "Decimales de moneda"; $lang["config_currency_symbol"] = "Símbolo de moneda"; $lang["config_customer_reward"] = "Premio"; -$lang["config_customer_reward_duplicate"] = "Introduzca un nombre de premio único."; +$lang["config_customer_reward_duplicate"] = "El nombre de premio debe ser único"; $lang["config_customer_reward_enable"] = "Activar los premios para los consumidores"; $lang["config_customer_reward_invalid_chars"] = "El nombre del premio no puede contener el carácter '_'"; $lang["config_customer_reward_required"] = "El premio es un campo obligatorio"; @@ -58,9 +58,9 @@ $lang["config_decimal_point"] = "Punto Decimal"; $lang["config_default_barcode_font_size_number"] = "Tamaño de fuente de código de barras debe ser número."; $lang["config_default_barcode_font_size_required"] = "Tamaño de fuente de código de barras es requerido."; $lang["config_default_barcode_height_number"] = "Alto del código de barras debe ser un número."; -$lang["config_default_barcode_height_required"] = "Alto del código de barras es requerido."; +$lang["config_default_barcode_height_required"] = "Altura del código de barras es requerido."; $lang["config_default_barcode_num_in_row_number"] = "Número por fila del código de barras debe ser un número."; -$lang["config_default_barcode_num_in_row_required"] = "Número por fila del código de barras es requerido."; +$lang["config_default_barcode_num_in_row_required"] = "El número de código de barras por defecto en la fila es un campo requerido"; $lang["config_default_barcode_page_cellspacing_number"] = "Espacios de celdas por página del código de barras debe ser un número."; $lang["config_default_barcode_page_cellspacing_required"] = "Espacios de celdas por página del código de barras es requerido."; $lang["config_default_barcode_page_width_number"] = "Ancho de página del código de barras debe ser un número."; @@ -128,7 +128,7 @@ $lang["config_gcaptcha_secret_key"] = "Llave secreta reCAPTCHA"; $lang["config_gcaptcha_secret_key_required"] = "reCAPTCHA Secret Key es requerida si se usa"; $lang["config_gcaptcha_site_key"] = "Llave del sitio reCAPTCHA"; $lang["config_gcaptcha_site_key_required"] = "reCAPTCHA Site Key es requerida si se usa"; -$lang["config_gcaptcha_tooltip"] = "Proteja la página de inicio de sesión con Google reCAPTCHA, haga clic en el icono de un par de claves API."; +$lang["config_gcaptcha_tooltip"] = "Proteja la página de inicio de sesión con Google reCAPTCHA, haga clic en el icono y de un par de llaves de la API"; $lang["config_general"] = "General"; $lang["config_general_configuration"] = "Configuración General"; $lang["config_giftcard_number"] = "Número de tarjeta de regalo"; From 37006740457d471a1d50e016e29f85878358ed32 Mon Sep 17 00:00:00 2001 From: khao_lek Date: Mon, 9 Mar 2020 10:12:53 +0000 Subject: [PATCH 43/65] Translated using Weblate (Thai) Currently translated at 100.0% (35 of 35 strings) Translation: ospos/employees Translate-URL: http://weblate.jpeelaer.net/projects/ospos/employees/th/ --- application/language/th/employees_lang.php | 53 +++++++++++----------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/application/language/th/employees_lang.php b/application/language/th/employees_lang.php index a2eba221a..bd7d97e45 100644 --- a/application/language/th/employees_lang.php +++ b/application/language/th/employees_lang.php @@ -1,37 +1,36 @@ - Date: Wed, 4 Mar 2020 04:18:14 +0000 Subject: [PATCH 44/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (8 of 8 strings) Translation: ospos/login Translate-URL: http://weblate.jpeelaer.net/projects/ospos/login/zh_Hans/ --- application/language/zh-Hans/login_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/zh-Hans/login_lang.php b/application/language/zh-Hans/login_lang.php index 3a37be89e..a9f92eca6 100644 --- a/application/language/zh-Hans/login_lang.php +++ b/application/language/zh-Hans/login_lang.php @@ -3,7 +3,7 @@ $lang["login_gcaptcha"] = "我不是机器人。"; $lang["login_go"] = "登入"; $lang["login_invalid_gcaptcha"] = "无效,我不是机器人。"; $lang["login_invalid_installation"] = "安装不正确,请检查您的php.ini文件。"; -$lang["login_invalid_username_and_password"] = "錯誤的帳號或密碼"; +$lang["login_invalid_username_and_password"] = "无效的用户名或密码。"; $lang["login_login"] = "登入"; -$lang["login_password"] = "密碼"; -$lang["login_username"] = "帳號"; +$lang["login_password"] = "密码"; +$lang["login_username"] = "用户名"; From 82351243f907e6e5563371b818dbc13f855ae757 Mon Sep 17 00:00:00 2001 From: Qbin <4688998@qq.com> Date: Wed, 4 Mar 2020 04:45:01 +0000 Subject: [PATCH 45/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 98.0% (51 of 52 strings) Translation: ospos/receivings Translate-URL: http://weblate.jpeelaer.net/projects/ospos/receivings/zh_Hans/ --- .../language/zh-Hans/receivings_lang.php | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/application/language/zh-Hans/receivings_lang.php b/application/language/zh-Hans/receivings_lang.php index a7d0a4cd6..72e905062 100644 --- a/application/language/zh-Hans/receivings_lang.php +++ b/application/language/zh-Hans/receivings_lang.php @@ -1,54 +1,53 @@ - Date: Mon, 2 Mar 2020 23:31:45 +0000 Subject: [PATCH 46/65] Translated using Weblate (Spanish) Currently translated at 100.0% (177 of 177 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/es/ --- application/language/es/sales_lang.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/language/es/sales_lang.php b/application/language/es/sales_lang.php index e22b120a7..043a0067d 100644 --- a/application/language/es/sales_lang.php +++ b/application/language/es/sales_lang.php @@ -12,7 +12,7 @@ $lang["sales_cash"] = "Efectivo"; $lang["sales_cash_deposit"] = "Deposito Efectivo"; $lang["sales_cash_filter"] = "Efectivo"; $lang["sales_change_due"] = "Cambio"; -$lang["sales_check"] = "Cheque"; +$lang["sales_check"] = "Comprobación de ventas"; $lang["sales_check_balance"] = "Balance de Cheque"; $lang["sales_check_filter"] = "Comprobar"; $lang["sales_comment"] = "Comentario"; @@ -173,3 +173,7 @@ $lang["sales_work_order_number"] = "Numero Orden Trabajo"; $lang["sales_work_order_number_duplicate"] = "El numero de orden de trabajo debe ser unico."; $lang["sales_work_order_sent"] = "Orden de trabajo enviada a"; $lang["sales_work_order_unsent"] = "Orden de trabajo fallida al enviar a"; +$lang["sales_change_price"] = "Cambiar el precio de venta"; +$lang["sales_nontaxed_ind"] = " Ventas no gravadas "; +$lang["sales_refund"] = "Tipo de reembolso"; +$lang["sales_taxed_ind"] = "Ventas gravadas"; From 5692ae4902c9717eaf49c05d0540310e148fb2cb Mon Sep 17 00:00:00 2001 From: khao_lek Date: Mon, 9 Mar 2020 10:43:33 +0000 Subject: [PATCH 47/65] Translated using Weblate (Thai) Currently translated at 84.1% (149 of 177 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/th/ --- application/language/th/sales_lang.php | 92 +++++++++++++------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/application/language/th/sales_lang.php b/application/language/th/sales_lang.php index 891991b5f..c2962aa94 100644 --- a/application/language/th/sales_lang.php +++ b/application/language/th/sales_lang.php @@ -1,55 +1,55 @@ Date: Fri, 6 Mar 2020 02:33:26 +0000 Subject: [PATCH 48/65] Translated using Weblate (Chinese (Simplified)) Currently translated at 42.3% (33 of 78 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/zh_Hans/ --- application/language/zh-Hans/taxes_lang.php | 69 ++++++++++----------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/application/language/zh-Hans/taxes_lang.php b/application/language/zh-Hans/taxes_lang.php index 2ca78149f..e0a4ba444 100644 --- a/application/language/zh-Hans/taxes_lang.php +++ b/application/language/zh-Hans/taxes_lang.php @@ -1,21 +1,20 @@ - Date: Mon, 2 Mar 2020 23:29:17 +0000 Subject: [PATCH 49/65] Translated using Weblate (Spanish) Currently translated at 100.0% (78 of 78 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/es/ --- application/language/es/taxes_lang.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/language/es/taxes_lang.php b/application/language/es/taxes_lang.php index a05387e8b..ef0e6b6e0 100644 --- a/application/language/es/taxes_lang.php +++ b/application/language/es/taxes_lang.php @@ -76,3 +76,4 @@ $lang["taxes_tax_rounding"] = "Redondeo de Impuestos"; $lang["taxes_tax_type"] = "Tipo de Impuesto"; $lang["taxes_update"] = "Actualizar Tasa de Impuesto"; $lang["taxes_vat_tax"] = "IVA"; +$lang["taxes_tax_group_not_unique"] = "El grupo de impuestos %1 no es único"; From bc38e94f4273b6fcc58f569fec4228704197b400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emin=20Tufan=20=C3=87etin?= Date: Mon, 2 Mar 2020 22:50:46 +0000 Subject: [PATCH 50/65] Translated using Weblate (Turkish) Currently translated at 100.0% (78 of 78 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/tr/ --- application/language/tr/taxes_lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/language/tr/taxes_lang.php b/application/language/tr/taxes_lang.php index 3647fea7a..40e83a978 100644 --- a/application/language/tr/taxes_lang.php +++ b/application/language/tr/taxes_lang.php @@ -52,7 +52,7 @@ $lang["taxes_tax_codes_configuration"] = "Vergi Kodları Yapılandırması"; $lang["taxes_tax_codes_saved_successfully"] = "Vergi Kodu değişiklikleri kaydedildi"; $lang["taxes_tax_codes_saved_unsuccessfully"] = "Vergi Kodu değişiklikleri kaydedilmedi"; $lang["taxes_tax_excluded"] = "Vergi hariç"; -$lang["taxes_tax_group"] = "Vergi Grubu"; +$lang["taxes_tax_group"] = "Vergi Kümesi"; $lang["taxes_tax_group_sequence"] = "Vergi Kümesi Sırası"; $lang["taxes_tax_included"] = "Vergi dahil"; $lang["taxes_tax_jurisdiction"] = "Vergi Yargı Yetkisi"; @@ -76,3 +76,4 @@ $lang["taxes_tax_rounding"] = "Vergi Yuvarlama"; $lang["taxes_tax_type"] = "Tür"; $lang["taxes_update"] = "Vergi Oranını Güncelle"; $lang["taxes_vat_tax"] = "KDV Vergisi"; +$lang["taxes_tax_group_not_unique"] = "%1 Vergi Kümesi eşsiz değil"; From cefd287668421467d9fbd69ae37d388121d1185d Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Mon, 9 Mar 2020 15:11:33 +0400 Subject: [PATCH 51/65] Resolve bug not updating attributes correctly Prior to this fix, if the attribute was of DECIMAL or DATE type and the action was an UPDATE, then it would try to update the attribute_value, not the corresponding attribute_decimal or attribute_date. --- application/models/Attribute.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index cc595b9a1..d0905f6e8 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -530,7 +530,7 @@ class Attribute extends CI_Model if(empty($attribute_id) || empty($item_id)) { - if($definition_type == TEXT || $definition_type == DROPDOWN) + if(in_array($definition_type, [TEXT, DROPDOWN], TRUE)) { $attribute_id = $this->value_exists($attribute_value); @@ -558,7 +558,19 @@ class Attribute extends CI_Model else { $this->db->where('attribute_id', $attribute_id); - $this->db->update('attribute_values', array('attribute_value' => $attribute_value)); + + if(in_array($definition_type, [TEXT, DROPDOWN], TRUE)) + { + $this->db->update('attribute_values', array('attribute_value' => $attribute_value)); + } + else if($definition_type == DECIMAL) + { + $this->db->update('attribute_values', array('attribute_decimal' => $attribute_value)); + } + else + { + $this->db->update('attribute_values', array('attribute_date' => date('Y-m-d', strtotime($attribute_value)))); + } } $this->db->trans_complete(); From 4f60465fa02367748674f737d04cda9ff1843b6e Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Wed, 11 Mar 2020 00:15:37 +0100 Subject: [PATCH 52/65] Revert barcode rework --- application/controllers/Receivings.php | 4 ++-- application/controllers/Sales.php | 2 +- application/libraries/Barcode_lib.php | 21 ++++++++++++++------- application/models/tokens/Token.php | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index 56463479c..faa90915a 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -90,7 +90,7 @@ class Receivings extends Secure_Controller $mode = $this->receiving_lib->get_mode(); $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); - $this->barcode_lib->parse_barcode_fields($quantity, $price, $item_id_or_number_or_item_kit_or_receipt); + $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); $quantity = ($mode == 'receive' || $mode == 'requisition') ? $quantity : -$quantity; $item_location = $this->receiving_lib->get_stock_source(); $discount = $this->config->item('default_receivings_discount'); @@ -104,7 +104,7 @@ class Receivings extends Secure_Controller { $this->receiving_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location, $discount, $discount_type); } - elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_type, $price)) + elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_type)) { $data['error'] = $this->lang->line('receivings_unable_to_add_item'); } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 547ab4aa8..534f329cf 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -398,7 +398,7 @@ class Sales extends Secure_Controller } $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); - $this->barcode_lib->parse_barcode_fields($quantity, $price, $item_id_or_number_or_item_kit_or_receipt); + $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); $mode = $this->sale_lib->get_mode(); $quantity = ($mode == 'return') ? -$quantity : $quantity; $item_location = $this->sale_lib->get_sale_location(); diff --git a/application/libraries/Barcode_lib.php b/application/libraries/Barcode_lib.php index 147b5739b..e8ae9dd59 100644 --- a/application/libraries/Barcode_lib.php +++ b/application/libraries/Barcode_lib.php @@ -49,23 +49,30 @@ class Barcode_lib return $data; } - public function parse_barcode_fields(&$quantity, &$price, &$item_id_or_number_or_item_kit_or_receipt) + public function parse_barcode_fields(&$quantity, &$item_id_or_number_or_item_kit_or_receipt) { $barcode_formats = json_decode($this->CI->config->item('barcode_formats')); - $barcode_tokens = Token::get_barcode_tokens(); if(!empty($barcode_formats)) { foreach($barcode_formats as $barcode_format) { - $parsed_results = $this->CI->Token_lib->parse($item_id_or_number_or_item_kit_or_receipt, $barcode_format, $barcode_tokens); - $quantity = (isset($parsed_results['W'])) ? (int) $parsed_results['W'] / 1000 : 1; - $item_id_or_number_or_item_kit_or_receipt = (isset($parsed_results['I'])) ? - $parsed_results['I'] : $item_id_or_number_or_item_kit_or_receipt; - $price = (isset($parsed_results['P'])) ? (int) $parsed_results['P'] : NULL; + if(preg_match("/$barcode_format/", $item_id_or_number_or_item_kit_or_receipt, $matches) && sizeof($matches) > 1) + { + $qtyfirst = strpos('d', $barcode_format) - strpos('w', $barcode_format) < 0; + $quantity = $matches[$qtyfirst ? 1 : 2]; + if(strstr($barcode_format, '02')) + { + $quantity = $quantity / 1000; + } + $item_id_or_number_or_item_kit_or_receipt = $matches[$qtyfirst ? 2 : 1]; + + return; + } } } + $quantity = 1; } public function validate_barcode($barcode) diff --git a/application/models/tokens/Token.php b/application/models/tokens/Token.php index fab4a1f6a..ed125b42e 100644 --- a/application/models/tokens/Token.php +++ b/application/models/tokens/Token.php @@ -27,7 +27,7 @@ abstract class Token static function get_barcode_tokens() { - return array(new Token_barcode_price(), new Token_barcode_weight(), new Token_barcode_ean()); + return array(); } static function get_tokens() From 45894857a6f09894620dc63245691c137857b8c4 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Wed, 11 Mar 2020 00:46:46 +0100 Subject: [PATCH 53/65] Fix tests --- .../tests/libraries/Barcode_lib_test.php | 71 +++++++------------ .../tests/libraries/Token_lib_test.php | 29 -------- 2 files changed, 24 insertions(+), 76 deletions(-) delete mode 100644 application/tests/libraries/Token_lib_test.php diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index 451918ff7..aae2632ef 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -4,59 +4,36 @@ */ class Barcode_lib_test extends UnitTestCase { - public function setUp() - { - $this->resetInstance(); + public function setUp() + { + $this->resetInstance(); - $this->obj = $this->newLibrary('Barcode_lib'); - $this->CI->Token_lib = $this->newLibrary('Token_lib'); + $this->obj = $this->newLibrary('Barcode_lib'); - ReflectionHelper::setPrivateProperty( - $this->obj, - 'CI', - $this->CI - ); + } - } + public function test_barcode_weight_first() + { + $this->CI->config->set_item('barcode_formats', json_encode(array("02(\d{5})(\w{6})"))); - public function test_barcode_item_number_and_quantity() - { - $this->CI->config->set_item('barcode_formats', json_encode(array("02{I:5}{W:6}"))); + $item_number = "0250000123456"; + $quantity = 0; + $this->obj->parse_barcode_fields($quantity, $item_number); - $item_number = "0250000123456"; - $quantity = 0; - $this->obj->parse_barcode_fields($quantity, $price, $item_number); + echo $quantity; + $this->assertEquals($quantity, 123.456); + $this->assertEquals($item_number, "50000"); + } - $this->assertEquals($quantity, 123.456); - $this->assertEquals($item_number, "50000"); - $this->assertEquals($price, NULL); - } + public function test_barcode_weight_last() + { + $this->CI->config->set_item('barcode_formats', json_encode(array("02(\w{6})(\d{5})"))); - public function test_barcode_quantity_and_item_number() - { - $this->CI->config->set_item('barcode_formats', json_encode(array("02{I:6}{W:5}{P:2}"))); + $item_number = "0212345650001"; + $quantity = 0; + $this->obj->parse_barcode_fields($quantity, $item_number); - $item_number = "021234565000110"; - $quantity = 0; - $this->obj->parse_barcode_fields($quantity, $price, $item_number); - - - $this->assertEquals($price, 10); - $this->assertEquals($item_number, 123456); - $this->assertEquals($quantity, 50.001); - } - - public function test_no_barcode_format() - { - $this->CI->config->set_item('barcode_formats', json_encode(array(""))); - - $item_number = "021234565000110"; - $quantity = 0; - - $this->obj->parse_barcode_fields($quantity, $price, $item_number); - - $this->assertEquals($quantity, 1); - $this->assertEquals($price, 0); - $this->assertEquals($item_number, "021234565000110"); - } + $this->assertEquals($quantity, 50.001); + $this->assertEquals($item_number, 123456); + } } \ No newline at end of file diff --git a/application/tests/libraries/Token_lib_test.php b/application/tests/libraries/Token_lib_test.php deleted file mode 100644 index 546af6086..000000000 --- a/application/tests/libraries/Token_lib_test.php +++ /dev/null @@ -1,29 +0,0 @@ -resetInstance(); - - $this->obj = $this->newLibrary('Token_lib'); - } - - public function test_token_parser() - { - $tokens = Token::get_barcode_tokens(); - - $parsed_tokens = $this->obj->parse("0250200000abc", "02{P:2}{W:6}{I:3}", $tokens); - - $this->assertEquals($parsed_tokens['I'], 'abc'); - $this->assertEquals($parsed_tokens['P'], '50'); - $this->assertEquals($parsed_tokens['W'], '200000'); - - } - -} - -?> \ No newline at end of file From ba1ef472e674157da7b5796d5339de2735ad5ec8 Mon Sep 17 00:00:00 2001 From: Emil Ebsen Date: Wed, 11 Mar 2020 16:26:34 +0000 Subject: [PATCH 54/65] Added translation using Weblate (Danish) --- application/language/da/cashups_lang.php | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 application/language/da/cashups_lang.php diff --git a/application/language/da/cashups_lang.php b/application/language/da/cashups_lang.php new file mode 100644 index 000000000..931b2c31c --- /dev/null +++ b/application/language/da/cashups_lang.php @@ -0,0 +1,37 @@ + Date: Wed, 11 Mar 2020 16:23:27 +0000 Subject: [PATCH 55/65] Translated using Weblate (Danish) Currently translated at 100.0% (8 of 8 strings) Translation: ospos/bootstrap_tables Translate-URL: http://weblate.jpeelaer.net/projects/ospos/bootstrap_tables/da/ --- .../language/da/bootstrap_tables_lang.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/language/da/bootstrap_tables_lang.php b/application/language/da/bootstrap_tables_lang.php index 8cedaec71..ee0a5feae 100644 --- a/application/language/da/bootstrap_tables_lang.php +++ b/application/language/da/bootstrap_tables_lang.php @@ -1,9 +1,9 @@ Date: Fri, 13 Mar 2020 13:22:23 +0400 Subject: [PATCH 56/65] Removing the restriction for colons in the name Please see #2665 --- application/views/attributes/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index bbd7fc4b9..2d40e5d67 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -137,7 +137,7 @@ $(document).ready(function() { var is_event = typeof(value) !== 'string'; - if ($("#definition_value").val().match(/(\||:)/g) != null) + if ($("#definition_value").val().match(/(\|)/g) != null) { return; } From a2a5db890113b3b7045d82c7a0c0fd98c62a01d0 Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Fri, 13 Mar 2020 16:32:39 +0400 Subject: [PATCH 57/65] Correct a bug causing & to break in POST See #2758 for details --- application/views/attributes/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index bbd7fc4b9..4db7c447a 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -157,7 +157,7 @@ $(document).ready(function() } else { - $.post('' + value, {definition_id: definition_id}); + $.post('' + escape(value), {definition_id: definition_id}); } } From ecb21d2d5ec9c567315152b178e371f62d825673 Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Fri, 13 Mar 2020 16:38:18 +0400 Subject: [PATCH 58/65] Same correction for removing attribute value --- application/views/attributes/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index 4db7c447a..da1222889 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -128,7 +128,7 @@ $(document).ready(function() } else { - $.post('' + value, {definition_id: definition_id}); + $.post('' + escape(value), {definition_id: definition_id}); } $(this).parents("li").remove(); }; From 531035fef282536cb1ce50d5f6e7b6f3c420a4ae Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 13 Mar 2020 22:41:42 +0100 Subject: [PATCH 59/65] Update invalid chars --- application/views/attributes/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index 2d40e5d67..f8e5bd3a5 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -137,7 +137,7 @@ $(document).ready(function() { var is_event = typeof(value) !== 'string'; - if ($("#definition_value").val().match(/(\|)/g) != null) + if ($("#definition_value").val().match(/(\||_)/g) != null) { return; } From ea85a8551860d1a5e1da22f441cf64b6059249ab Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 13 Mar 2020 23:12:56 +0100 Subject: [PATCH 60/65] Add unit test for locale_helper (#2748) --- .../tests/helpers/Locale_helper_test.php | 22 +++++++++++++++++++ .../tests/libraries/Barcode_lib_test.php | 9 ++++---- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 application/tests/helpers/Locale_helper_test.php diff --git a/application/tests/helpers/Locale_helper_test.php b/application/tests/helpers/Locale_helper_test.php new file mode 100644 index 000000000..4b7994215 --- /dev/null +++ b/application/tests/helpers/Locale_helper_test.php @@ -0,0 +1,22 @@ +assertEquals(2.22, $decimals); + } + + public function test_format_decimals() + { + $decimals = to_decimals(5, 2); + + $this->assertEquals(5.00, $decimals); + } + + +} diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index aae2632ef..e6cdc009b 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -9,7 +9,6 @@ class Barcode_lib_test extends UnitTestCase $this->resetInstance(); $this->obj = $this->newLibrary('Barcode_lib'); - } public function test_barcode_weight_first() @@ -21,8 +20,8 @@ class Barcode_lib_test extends UnitTestCase $this->obj->parse_barcode_fields($quantity, $item_number); echo $quantity; - $this->assertEquals($quantity, 123.456); - $this->assertEquals($item_number, "50000"); + $this->assertEquals(123.456, $quantity); + $this->assertEquals("50000", $item_number); } public function test_barcode_weight_last() @@ -33,7 +32,7 @@ class Barcode_lib_test extends UnitTestCase $quantity = 0; $this->obj->parse_barcode_fields($quantity, $item_number); - $this->assertEquals($quantity, 50.001); - $this->assertEquals($item_number, 123456); + $this->assertEquals(50.001, $quantity); + $this->assertEquals(123456, $item_number); } } \ No newline at end of file From 0f2bafc7dd8e6e213ac4cf4490626eecc235776b Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 14 Mar 2020 01:44:08 +0100 Subject: [PATCH 61/65] Fix attribute search (#2723) --- application/models/Item.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index 58093e779..7307fba2c 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -177,19 +177,22 @@ class Item extends CI_Model if(!empty($search)) { - $this->db->group_start(); - $this->db->like('name', $search); - $this->db->or_like('item_number', $search); - $this->db->or_like('items.item_id', $search); - $this->db->or_like('company_name', $search); - $this->db->or_like('items.category', $search); - if ($filters['search_custom'] && $attributes_enabled) - { - $this->db->or_like('attribute_value', $search); - $this->db->or_like('attribute_date', $search); - $this->db->or_like('attribute_decimal', $search); - } - $this->db->group_end(); + if ($attributes_enabled && $filters['search_custom']) + { + $this->db->having("attribute_values LIKE '%$search%'"); + $this->db->or_having("attribute_dtvalues LIKE '%$search%'"); + $this->db->or_having("attribute_dvalues LIKE '%$search%'"); + } + else + { + $this->db->group_start(); + $this->db->like('name', $search); + $this->db->or_like('item_number', $search); + $this->db->or_like('items.item_id', $search); + $this->db->or_like('company_name', $search); + $this->db->or_like('items.category', $search); + $this->db->group_end(); + } } if($attributes_enabled) From 20e4040d02794c51a8075075e1754a7c28198cb3 Mon Sep 17 00:00:00 2001 From: Emil Ebsen Date: Mon, 16 Mar 2020 12:35:03 +0000 Subject: [PATCH 62/65] Added translation using Weblate (Danish) --- application/language/da/common_lang.php | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 application/language/da/common_lang.php diff --git a/application/language/da/common_lang.php b/application/language/da/common_lang.php new file mode 100644 index 000000000..3f3e5c13e --- /dev/null +++ b/application/language/da/common_lang.php @@ -0,0 +1,69 @@ + Date: Wed, 11 Mar 2020 19:09:26 +0000 Subject: [PATCH 63/65] Translated using Weblate (Danish) Currently translated at 50.0% (18 of 36 strings) Translation: ospos/cashups Translate-URL: http://weblate.jpeelaer.net/projects/ospos/cashups/da/ --- application/language/da/cashups_lang.php | 58 ++++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/application/language/da/cashups_lang.php b/application/language/da/cashups_lang.php index 931b2c31c..49761ff84 100644 --- a/application/language/da/cashups_lang.php +++ b/application/language/da/cashups_lang.php @@ -1,37 +1,37 @@ Date: Mon, 16 Mar 2020 06:02:28 +0000 Subject: [PATCH 64/65] Translated using Weblate (Thai) Currently translated at 68.4% (191 of 279 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/th/ --- application/language/th/config_lang.php | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index b6f6f2d6c..e2a46a656 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -67,25 +67,25 @@ $lang["config_default_barcode_page_width_number"] = "The default barcode page wi $lang["config_default_barcode_page_width_required"] = "The default barcode page width is a required field"; $lang["config_default_barcode_width_number"] = "The default barcode width must be a number"; $lang["config_default_barcode_width_required"] = "The default barcode width is a required field"; -$lang["config_default_item_columns"] = ""; -$lang["config_default_origin_tax_code"] = ""; -$lang["config_default_receivings_discount"] = ""; -$lang["config_default_receivings_discount_number"] = ""; -$lang["config_default_receivings_discount_required"] = ""; -$lang["config_default_sales_discount"] = "Default Sales Discount %"; +$lang["config_default_item_columns"] = "คอลัมน์รายการที่แสดงเป็นค่าเริ่มต้น"; +$lang["config_default_origin_tax_code"] = "รหัสภาษีที่เป็นค่าเริ่มต้น"; +$lang["config_default_receivings_discount"] = "ส่วนลดที่เป็นค่าเริ่มต้นที่จะได้รับ"; +$lang["config_default_receivings_discount_number"] = "การรับส่วนลดที่เป็นค่าเริ่มต้นต้องเป็นตัวเลข"; +$lang["config_default_receivings_discount_required"] = "การรับส่วนลดที่เป็นค่าเริ่มต้นจำเป็นต้องระบุ"; +$lang["config_default_sales_discount"] = "ส่วนลดการขายที่เป็นค่าเริ่มต้น"; $lang["config_default_sales_discount_number"] = "The default sales discount must be a number"; $lang["config_default_sales_discount_required"] = "The default sales discount is a required field"; -$lang["config_default_tax_category"] = ""; -$lang["config_default_tax_code"] = ""; -$lang["config_default_tax_jurisdiction"] = ""; -$lang["config_default_tax_name_number"] = ""; +$lang["config_default_tax_category"] = "หมวดหมู่ภาษีที่เป็นค่าเริ่มต้น"; +$lang["config_default_tax_code"] = "รหัสภาษีที่เป็นค่าเริ่มต้น"; +$lang["config_default_tax_jurisdiction"] = "ภาษีตามกฏหมายที่เป็นค่าเริ่มต้น"; +$lang["config_default_tax_name_number"] = "ชื่อภาษีที่เป็นค่าเริ่มต้นจะต้องเป็นตัวอักษร"; $lang["config_default_tax_name_required"] = "The default tax name is a required field"; $lang["config_default_tax_rate"] = "อัตราภาษีเริ่มต้น %"; -$lang["config_default_tax_rate_1"] = "อัตราภาษี 1"; -$lang["config_default_tax_rate_2"] = "อัตราภาษี 2"; +$lang["config_default_tax_rate_1"] = "อัตราภาษีลำดับที่ 1"; +$lang["config_default_tax_rate_2"] = "อัตราภาษีลำดับที่ 2"; $lang["config_default_tax_rate_number"] = "อัตราภาษีเริ่มต้นต้องเป็นตัวเลข"; $lang["config_default_tax_rate_required"] = "อัตราภาษีเริ่มต้นต้องกรอก"; -$lang["config_derive_sale_quantity"] = ""; +$lang["config_derive_sale_quantity"] = "จำนวนปริมาณการขายที่ได้รับ"; $lang["config_derive_sale_quantity_tooltip"] = ""; $lang["config_dinner_table"] = ""; $lang["config_dinner_table_duplicate"] = ""; From e7ec8aa49f5c7edc7047bdfbe213ecd9b3c1e8cf Mon Sep 17 00:00:00 2001 From: Emil Ebsen Date: Mon, 16 Mar 2020 12:56:49 +0000 Subject: [PATCH 65/65] Added translation using Weblate (Danish) --- application/language/da/config_lang.php | 281 ++++++++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 application/language/da/config_lang.php diff --git a/application/language/da/config_lang.php b/application/language/da/config_lang.php new file mode 100644 index 000000000..6cc95340a --- /dev/null +++ b/application/language/da/config_lang.php @@ -0,0 +1,281 @@ +