From f84b795ee6ab921e8b3d6c340424904064031198 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Tue, 10 Aug 2021 13:44:43 +0400 Subject: [PATCH] Upgrade to CodeIgniter 4.1.3 --- .gitignore | 14 +- Dockerfile | 8 +- {application => app}/.htaccess | 0 app/Common.php | 15 + .../config => app/Config}/.env.example | 0 app/Config/App.php | 544 ++ app/Config/Autoload.php | 193 + app/Config/Boot/development.php | 32 + app/Config/Boot/production.php | 21 + app/Config/Boot/testing.php | 32 + app/Config/Cache.php | 167 + app/Config/Constants.php | 154 + app/Config/ContentSecurityPolicy.php | 167 + app/Config/Cookie.php | 126 + app/Config/Database.php | 128 + app/Config/DocTypes.php | 33 + app/Config/Email.php | 171 + app/Config/Encryption.php | 73 + app/Config/Events.php | 101 +- app/Config/Exceptions.php | 60 + app/Config/Filters.php | 62 + app/Config/ForeignCharacters.php | 9 + app/Config/Format.php | 76 + app/Config/Generators.php | 39 + app/Config/Honeypot.php | 43 + app/Config/Images.php | 35 + app/Config/Kint.php | 61 + app/Config/Logger.php | 155 + app/Config/Migrations.php | 55 + app/Config/Mimes.php | 543 ++ app/Config/Modules.php | 53 + app/Config/OSPOS.php | 15 + app/Config/Pager.php | 63 + app/Config/Paths.php | 86 + app/Config/Routes.php | 85 + app/Config/Security.php | 95 + app/Config/Services.php | 31 + app/Config/Smileys.php | 68 + app/Config/Toolbar.php | 87 + app/Config/UserAgents.php | 252 + app/Config/Validation.php | 46 + app/Config/View.php | 44 + app/{Language/en-US => Config}/index.html | 2 +- .../config => app/Config}/migration.php | 2 - .../config => app/Config}/profiler.php | 2 - app/Controllers/Attributes.php | 172 +- app/Controllers/BaseController.php | 63 + app/Controllers/Cashups.php | 237 +- app/Controllers/Config.php | 898 +-- app/Controllers/Customers.php | 368 +- app/Controllers/Employees.php | 214 +- app/Controllers/Expenses.php | 178 +- app/Controllers/Expenses_categories.php | 107 +- app/Controllers/Giftcards.php | 320 +- app/Controllers/Home.php | 71 +- app/Controllers/Item_kits.php | 224 +- app/Controllers/Items.php | 781 +-- app/Controllers/Login.php | 127 +- app/Controllers/Messages.php | 73 +- app/Controllers/No_access.php | 33 +- app/Controllers/Office.php | 22 +- app/Controllers/Persons.php | 65 +- app/Controllers/Receivings.php | 897 +-- app/Controllers/Reports.php | 1597 +++--- app/Controllers/Sales.php | 1024 ++-- app/Controllers/Secure_Controller.php | 92 +- app/Controllers/Suppliers.php | 357 +- app/Controllers/Tax_categories.php | 104 +- app/Controllers/Tax_codes.php | 110 +- app/Controllers/Tax_jurisdictions.php | 103 +- app/Controllers/Taxes.php | 441 +- app/Controllers/index.html | 2 +- .../Database/Migrations/.gitkeep | 0 .../20170501150000_upgrade_to_3_1_1.php | 15 +- .../20170502221506_sales_tax_data.php | 241 +- .../20180225100000_upgrade_to_3_2_0.php | 20 +- .../20180501100000_upgrade_to_3_2_1.php | 20 +- .../Migrations/20181015100000_attributes.php | 20 +- .../20190111270000_upgrade_to_3_3_0.php | 20 +- .../Migrations/20190129212600_indiagst.php | 101 +- .../Migrations/20190213210000_indiagst1.php | 20 +- .../Migrations/20190220210000_indiagst2.php | 20 +- .../20190301124900_decimal_attribute_type.php | 20 +- .../20190317102600_add_iso_4217.php | 20 +- .../20190427100000_paymenttracking.php | 20 +- .../20190502100000_refundtracking.php | 70 +- .../Migrations/20190612100000_dbfix.php | 20 +- .../20190615100000_fix_attribute_datetime.php | 20 +- .../20190712150200_fix_empty_reports.php | 39 +- .../20191008100000_receipttaxindicator.php | 24 +- .../20191231100000_paymentdatefix.php | 20 +- .../20200125100000_saleschangeprice.php | 20 +- .../Migrations/20200202000000_taxamount.php | 221 +- .../20200215100000_taxgroupconstraint.php | 24 +- .../20200508000000_image_upload_defaults.php | 41 +- ...819000000_modify_attr_links_constraint.php | 20 +- .../20201108100000_cashrounding.php | 24 +- .../20201110000000_add_item_kit_number.php | 20 +- ...20210103000000_modify_session_datatype.php | 20 +- .../20210422000000_database_optimizations.php | 120 +- .../20210422000001_remove_duplicate_links.php | 69 +- ...0210714140000_move_expenses_categories.php | 18 +- .../Migrations}/sqlscripts/3.0.2_to_3.1.1.sql | 0 .../Migrations}/sqlscripts/3.1.1_to_3.2.0.sql | 0 .../Migrations}/sqlscripts/3.2.0_to_3.2.1.sql | 0 .../Migrations}/sqlscripts/3.2.1_to_3.3.0.sql | 0 .../sqlscripts/3.3.0_add_iso_4217.sql | 0 .../sqlscripts/3.3.0_attributes.sql | 0 .../Migrations}/sqlscripts/3.3.0_dbfix.sql | 0 .../3.3.0_decimal_attribute_type.sql | 0 .../3.3.0_fix_attribute_datetime.sql | 0 .../Migrations}/sqlscripts/3.3.0_indiagst.sql | 0 .../sqlscripts/3.3.0_indiagst1.sql | 0 .../sqlscripts/3.3.0_indiagst2.sql | 0 .../sqlscripts/3.3.0_paymenttracking.sql | 0 .../sqlscripts/3.3.0_refundtracking.sql | 0 .../3.3.2_modify_attr_links_constraint.sql | 0 .../sqlscripts/3.3.2_paymentdatefix.sql | 0 .../sqlscripts/3.3.2_saleschangeprice.sql | 0 .../sqlscripts/3.3.3_add_kits_item_number.sql | 0 .../3.3.4_modify_session_datatype.sql | 0 .../3.4.0_database_optimizations.sql | 0 app/Database/Seeds/.gitkeep | 0 app/Events/Db_log.php | 54 +- app/Events/Load_config.php | 118 +- app/Events/Save.php | 25 +- app/Filters/.gitkeep | 0 app/Helpers/dompdf_helper.php | 14 +- app/Helpers/importfile_helper.php | 22 +- app/Helpers/index.html | 2 +- app/Helpers/locale_helper.php | 256 +- app/Helpers/migration_helper.php | 23 +- app/Helpers/report_helper.php | 35 +- app/Helpers/tabular_helper.php | 902 +-- app/Helpers/tax_helper.php | 194 +- app/Language/bs-BA/attributes_lang.php | 0 app/Language/bs-BA/bootstrap_tables_lang.php | 0 app/Language/bs-BA/cashups_lang.php | 0 app/Language/bs-BA/datepicker_lang.php | 0 app/Language/bs-BA/error_lang.php | 0 .../bs-BA/expenses_categories_lang.php | 0 app/Language/bs-BA/index.html | 0 app/Language/bs-BA/messages_lang.php | 0 .../{attributes_lang.php => Attributes.php} | 0 ...p_tables_lang.php => Bootstrap_tables.php} | 0 .../en-US/{cashups_lang.php => Cashups.php} | 0 .../en-US/{common_lang.php => Common.php} | 0 .../en-US/{config_lang.php => Config.php} | 0 .../{customers_lang.php => Customers.php} | 0 .../{datepicker_lang.php => Datepicker.php} | 0 .../{employees_lang.php => Employees.php} | 0 .../en-US/{enum_lang.php => Enum.php} | 0 .../en-US/{error_lang.php => Error.php} | 0 .../en-US/{expenses_lang.php => Expenses.php} | 0 ...ories_lang.php => Expenses_categories.php} | 0 .../{giftcards_lang.php => Giftcards.php} | 0 .../{item_kits_lang.php => Item_kits.php} | 0 .../en-US/{items_lang.php => Items.php} | 0 .../en-US/{login_lang.php => Login.php} | 0 .../en-US/{messages_lang.php => Messages.php} | 0 .../en-US/{module_lang.php => Module.php} | 0 .../{receivings_lang.php => Receivings.php} | 0 .../en-US/{reports_lang.php => Reports.php} | 0 .../en-US/{sales_lang.php => Sales.php} | 0 .../{suppliers_lang.php => Suppliers.php} | 0 .../en-US/{taxes_lang.php => Taxes.php} | 0 app/Language/nl-BE/receivings_lang.php | 0 app/Language/tr/index.html | 0 app/Libraries/Barcode_lib.php | 163 +- app/Libraries/Email_lib.php | 61 +- app/Libraries/Item_lib.php | 35 +- app/Libraries/MY_Email.php | 71 +- app/Libraries/MY_Migration.php | 32 +- app/Libraries/MY_Validation.php | 120 + app/Libraries/Mailchimp_lib.php | 345 +- app/Libraries/Receiving_lib.php | 819 +-- app/Libraries/Sale_lib.php | 802 +-- app/Libraries/Sms_lib.php | 41 +- app/Libraries/Tax_lib.php | 251 +- app/Libraries/Token_lib.php | 55 +- app/Libraries/index.html | 2 +- app/Models/Appconfig.php | 157 +- app/Models/Attribute.php | 592 +- app/Models/Cashup.php | 182 +- app/Models/Customer.php | 462 +- app/Models/Customer_rewards.php | 68 +- app/Models/Dinner_table.php | 134 +- app/Models/Employee.php | 538 +- app/Models/Enums/Rounding_mode.php | 38 +- app/Models/Expense.php | 296 +- app/Models/Expense_category.php | 181 +- app/Models/Giftcard.php | 367 +- app/Models/Inventory.php | 84 +- app/Models/Item.php | 1005 ++-- app/Models/Item_kit.php | 266 +- app/Models/Item_kit_items.php | 85 +- app/Models/Item_quantity.php | 84 +- app/Models/Item_taxes.php | 74 +- app/Models/Module.php | 138 +- app/Models/Person.php | 135 +- app/Models/Receiving.php | 627 +- app/Models/Reports/Detailed_receivings.php | 157 +- app/Models/Reports/Detailed_sales.php | 255 +- app/Models/Reports/Inventory_low.php | 49 +- app/Models/Reports/Inventory_summary.php | 101 +- app/Models/Reports/Report.php | 32 +- app/Models/Reports/Specific_customer.php | 230 +- app/Models/Reports/Specific_discount.php | 231 +- app/Models/Reports/Specific_employee.php | 224 +- app/Models/Reports/Specific_supplier.php | 166 +- app/Models/Reports/Summary_categories.php | 48 +- app/Models/Reports/Summary_customers.php | 46 +- app/Models/Reports/Summary_discounts.php | 52 +- app/Models/Reports/Summary_employees.php | 47 +- .../Reports/Summary_expenses_categories.php | 59 +- app/Models/Reports/Summary_items.php | 50 +- app/Models/Reports/Summary_payments.php | 142 +- app/Models/Reports/Summary_report.php | 131 +- app/Models/Reports/Summary_sales.php | 40 +- app/Models/Reports/Summary_sales_taxes.php | 47 +- app/Models/Reports/Summary_suppliers.php | 52 +- app/Models/Reports/Summary_taxes.php | 52 +- app/Models/Rewards.php | 30 +- app/Models/Sale.php | 1039 ++-- app/Models/Stock_location.php | 218 +- app/Models/Supplier.php | 618 +- app/Models/Tax.php | 228 +- app/Models/Tax_category.php | 190 +- app/Models/Tax_code.php | 234 +- app/Models/Tax_jurisdiction.php | 187 +- app/Models/Tokens/Token.php | 62 +- app/Models/Tokens/Token_barcode_ean.php | 19 +- app/Models/Tokens/Token_barcode_price.php | 19 +- app/Models/Tokens/Token_barcode_weight.php | 15 +- app/Models/Tokens/Token_customer.php | 38 +- app/Models/Tokens/Token_invoice_count.php | 24 +- app/Models/Tokens/Token_invoice_sequence.php | 25 +- app/Models/Tokens/Token_quote_sequence.php | 30 +- .../Tokens/Token_suspended_invoice_count.php | 22 +- .../Tokens/Token_work_order_sequence.php | 29 +- .../Tokens/Token_year_invoice_count.php | 27 +- app/Models/Tokens/Token_year_quote_count.php | 27 +- app/Models/index.html | 2 +- .../cache => app/ThirdParty}/index.html | 2 +- app/Views/attributes/form.php | 90 +- app/Views/attributes/item.php | 54 +- app/Views/attributes/manage.php | 27 +- app/Views/barcodes/barcode_sheet.php | 19 +- app/Views/cashups/form.php | 254 +- app/Views/cashups/manage.php | 44 +- app/Views/configs/barcode_config.php | 201 +- app/Views/configs/email_config.php | 83 +- app/Views/configs/general_config.php | 328 +- app/Views/configs/info_config.php | 97 +- app/Views/configs/integrations_config.php | 44 +- app/Views/configs/invoice_config.php | 105 +- app/Views/configs/license_config.php | 18 +- app/Views/configs/locale_config.php | 244 +- app/Views/configs/manage.php | 48 +- app/Views/configs/message_config.php | 49 +- app/Views/configs/receipt_config.php | 218 +- app/Views/configs/reward_config.php | 41 +- app/Views/configs/stock_config.php | 36 +- app/Views/configs/system_config.php | 20 +- app/Views/configs/system_info.php | 201 +- app/Views/configs/table_config.php | 39 +- app/Views/configs/tax_config.php | 83 +- app/Views/customers/form.php | 443 +- app/Views/customers/form_csv_import.php | 14 +- app/Views/employees/form.php | 128 +- app/Views/errors/cli/error_404.php | 14 +- app/Views/errors/cli/error_db.php | 10 +- app/Views/errors/cli/error_exception.php | 91 +- app/Views/errors/cli/error_general.php | 10 +- app/Views/errors/cli/error_php.php | 26 +- app/Views/errors/cli/index.html | 2 +- app/Views/errors/cli/production.php | 5 + app/Views/errors/error.php | 6 + app/Views/errors/html/debug.css | 197 + app/Views/errors/html/debug.js | 118 + app/Views/errors/html/error_404.php | 134 +- app/Views/errors/html/error_db.php | 14 +- app/Views/errors/html/error_exception.php | 424 +- app/Views/errors/html/error_general.php | 14 +- app/Views/errors/html/error_php.php | 18 +- app/Views/errors/html/index.html | 2 +- app/Views/errors/html/production.php | 25 + app/Views/errors/index.html | 2 +- app/Views/expenses/form.php | 170 +- app/Views/expenses/manage.php | 38 +- app/Views/expenses_categories/form.php | 44 +- app/Views/expenses_categories/manage.php | 26 +- app/Views/giftcards/form.php | 88 +- app/Views/giftcards/manage.php | 26 +- app/Views/home/form_change_password.php | 75 +- app/Views/home/home.php | 17 +- app/Views/home/office.php | 17 +- app/Views/index.html | 2 +- app/Views/item_kits/form.php | 247 +- app/Views/item_kits/manage.php | 30 +- app/Views/items/form.php | 530 +- app/Views/items/form_bulk.php | 172 +- app/Views/items/form_count_details.php | 125 +- app/Views/items/form_csv_import.php | 14 +- app/Views/items/form_inventory.php | 116 +- app/Views/items/manage.php | 86 +- app/Views/login.php | 64 +- app/Views/messages/form_sms.php | 36 +- app/Views/messages/index.html | 2 +- app/Views/messages/sms.php | 30 +- app/Views/no_access.php | 6 +- app/Views/partial/bootstrap_tables_locale.php | 37 +- app/Views/partial/customer_rewards.php | 75 +- app/Views/partial/datepicker_locale.php | 112 +- app/Views/partial/daterangepicker.php | 298 +- app/Views/partial/dinner_tables.php | 23 +- app/Views/partial/footer.php | 12 + app/Views/partial/header.php | 158 + app/Views/partial/header_js.php | 31 +- app/Views/partial/lang_lines.php | 4 +- app/Views/partial/print_receipt.php | 26 +- app/Views/partial/stock_locations.php | 19 +- app/Views/partial/tax_categories.php | 27 +- app/Views/partial/tax_codes.php | 67 +- app/Views/partial/tax_jurisdictions.php | 80 +- app/Views/people/form_basic_info.php | 195 +- app/Views/people/manage.php | 36 +- app/Views/receivings/form.php | 61 +- app/Views/receivings/receipt.php | 103 +- app/Views/receivings/receiving.php | 326 +- app/Views/reports/date_input.php | 66 +- app/Views/reports/graphical.php | 22 +- app/Views/reports/graphs/bar.php | 25 +- app/Views/reports/graphs/hbar.php | 27 +- app/Views/reports/graphs/line.php | 35 +- app/Views/reports/graphs/pie.php | 17 +- app/Views/reports/inventory_summary_input.php | 39 +- app/Views/reports/listing.php | 27 +- app/Views/reports/specific_customer_input.php | 51 +- app/Views/reports/specific_input.php | 54 +- app/Views/reports/tabular.php | 32 +- app/Views/reports/tabular_details.php | 53 +- app/Views/sales/form.php | 126 +- app/Views/sales/invoice.php | 166 +- app/Views/sales/invoice_email.php | 134 +- app/Views/sales/manage.php | 49 +- app/Views/sales/quote.php | 139 +- app/Views/sales/quote_email.php | 105 +- app/Views/sales/receipt.php | 33 +- app/Views/sales/receipt_default.php | 133 +- app/Views/sales/receipt_email.php | 121 +- app/Views/sales/receipt_short.php | 121 +- app/Views/sales/register.php | 472 +- app/Views/sales/suspended.php | 55 +- app/Views/sales/tax_invoice.php | 174 +- app/Views/sales/work_order.php | 128 +- app/Views/sales/work_order_email.php | 89 +- app/Views/suppliers/form.php | 213 +- app/Views/taxes/manage.php | 20 +- app/Views/taxes/tax_categories.php | 34 +- app/Views/taxes/tax_codes.php | 35 +- app/Views/taxes/tax_jurisdictions.php | 38 +- app/Views/taxes/tax_rates.php | 22 +- app/Views/taxes/tax_rates_form.php | 53 +- {application/config => app}/index.html | 2 +- {application => app}/tests/.gitignore | 0 app/tests/helpers/LocaleHelperTest.php | 8 +- app/tests/libraries/TokenLibTest.php | 60 +- app/tests/models/RoundingModeTest.php | 14 +- app/tests/phpunit.xml | 26 + application/config/autoload.php | 163 - application/config/config.php | 559 -- application/config/constants.php | 157 - application/config/database.php | 96 - application/config/doctypes.php | 24 - application/config/email.php | 10 - application/config/foreign_chars.php | 103 - application/config/memcached.php | 19 - application/config/mimes.php | 167 - application/config/pagination.php | 24 - application/config/routes.php | 87 - application/config/smileys.php | 64 - application/config/user_agents.php | 214 - application/core/MY_Lang.php | 96 - application/core/MY_Security.php | 57 - application/hooks/index.html | 11 - application/index.html | 11 - application/language/.htaccess | 1 - application/logs/index.html | 11 - application/third_party/index.html | 11 - bin/check-diff.sh | 14 - bin/devinstall.sh | 8 - bin/gendocs.sh | 8 - bin/install.php | 289 - bin/my-codeigniter.sh | 29 - bin/router.php | 28 - bin/server.sh | 13 - composer.json | 28 +- composer.lock | 5043 +++++++++++++++-- docker-compose.test.yml | 2 +- package.json | 24 +- public/css/invoice.css | 6 +- public/css/invoice_email.css | 4 +- public/index.php | 330 +- public/license/composer.LICENSES | 2 +- public/uploads/.gitignore | 5 - spark | 67 + writable/.htaccess | 6 + {application => writable}/cache/.htaccess | 0 .../core => writable/cache}/index.html | 2 +- writable/debugbar/.gitkeep | 0 writable/logs/index.html | 11 + writable/session/index.html | 11 + writable/uploads/index.html | 11 + .../uploads/item_pics/.gitignore | 2 +- 415 files changed, 28805 insertions(+), 19038 deletions(-) rename {application => app}/.htaccess (100%) create mode 100644 app/Common.php rename {application/config => app/Config}/.env.example (100%) create mode 100644 app/Config/App.php create mode 100644 app/Config/Autoload.php create mode 100644 app/Config/Boot/development.php create mode 100644 app/Config/Boot/production.php create mode 100644 app/Config/Boot/testing.php create mode 100644 app/Config/Cache.php create mode 100644 app/Config/Constants.php create mode 100644 app/Config/ContentSecurityPolicy.php create mode 100644 app/Config/Cookie.php create mode 100644 app/Config/Database.php create mode 100644 app/Config/DocTypes.php create mode 100644 app/Config/Email.php create mode 100644 app/Config/Encryption.php create mode 100644 app/Config/Exceptions.php create mode 100644 app/Config/Filters.php create mode 100644 app/Config/ForeignCharacters.php create mode 100644 app/Config/Format.php create mode 100644 app/Config/Generators.php create mode 100644 app/Config/Honeypot.php create mode 100644 app/Config/Images.php create mode 100644 app/Config/Kint.php create mode 100644 app/Config/Logger.php create mode 100644 app/Config/Migrations.php create mode 100644 app/Config/Mimes.php create mode 100644 app/Config/Modules.php create mode 100644 app/Config/OSPOS.php create mode 100644 app/Config/Pager.php create mode 100644 app/Config/Paths.php create mode 100644 app/Config/Routes.php create mode 100644 app/Config/Security.php create mode 100644 app/Config/Services.php create mode 100644 app/Config/Smileys.php create mode 100644 app/Config/Toolbar.php create mode 100644 app/Config/UserAgents.php create mode 100644 app/Config/Validation.php create mode 100644 app/Config/View.php rename app/{Language/en-US => Config}/index.html (87%) rename {application/config => app/Config}/migration.php (97%) rename {application/config => app/Config}/profiler.php (86%) create mode 100644 app/Controllers/BaseController.php rename bin/.placeholder => app/Database/Migrations/.gitkeep (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.0.2_to_3.1.1.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.1.1_to_3.2.0.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.2.0_to_3.2.1.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.2.1_to_3.3.0.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_add_iso_4217.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_attributes.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_dbfix.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_decimal_attribute_type.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_fix_attribute_datetime.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_indiagst.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_indiagst1.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_indiagst2.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_paymenttracking.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.0_refundtracking.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.2_modify_attr_links_constraint.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.2_paymentdatefix.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.2_saleschangeprice.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.3_add_kits_item_number.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.3.4_modify_session_datatype.sql (100%) rename {application/migrations => app/Database/Migrations}/sqlscripts/3.4.0_database_optimizations.sql (100%) create mode 100644 app/Database/Seeds/.gitkeep create mode 100644 app/Filters/.gitkeep mode change 100755 => 100644 app/Language/bs-BA/attributes_lang.php mode change 100755 => 100644 app/Language/bs-BA/bootstrap_tables_lang.php mode change 100755 => 100644 app/Language/bs-BA/cashups_lang.php mode change 100755 => 100644 app/Language/bs-BA/datepicker_lang.php mode change 100755 => 100644 app/Language/bs-BA/error_lang.php mode change 100755 => 100644 app/Language/bs-BA/expenses_categories_lang.php mode change 100755 => 100644 app/Language/bs-BA/index.html mode change 100755 => 100644 app/Language/bs-BA/messages_lang.php rename app/Language/en-US/{attributes_lang.php => Attributes.php} (100%) rename app/Language/en-US/{bootstrap_tables_lang.php => Bootstrap_tables.php} (100%) rename app/Language/en-US/{cashups_lang.php => Cashups.php} (100%) rename app/Language/en-US/{common_lang.php => Common.php} (100%) rename app/Language/en-US/{config_lang.php => Config.php} (100%) rename app/Language/en-US/{customers_lang.php => Customers.php} (100%) rename app/Language/en-US/{datepicker_lang.php => Datepicker.php} (100%) rename app/Language/en-US/{employees_lang.php => Employees.php} (100%) rename app/Language/en-US/{enum_lang.php => Enum.php} (100%) rename app/Language/en-US/{error_lang.php => Error.php} (100%) rename app/Language/en-US/{expenses_lang.php => Expenses.php} (100%) rename app/Language/en-US/{expenses_categories_lang.php => Expenses_categories.php} (100%) rename app/Language/en-US/{giftcards_lang.php => Giftcards.php} (100%) rename app/Language/en-US/{item_kits_lang.php => Item_kits.php} (100%) rename app/Language/en-US/{items_lang.php => Items.php} (100%) rename app/Language/en-US/{login_lang.php => Login.php} (100%) rename app/Language/en-US/{messages_lang.php => Messages.php} (100%) rename app/Language/en-US/{module_lang.php => Module.php} (100%) rename app/Language/en-US/{receivings_lang.php => Receivings.php} (100%) rename app/Language/en-US/{reports_lang.php => Reports.php} (100%) rename app/Language/en-US/{sales_lang.php => Sales.php} (100%) rename app/Language/en-US/{suppliers_lang.php => Suppliers.php} (100%) rename app/Language/en-US/{taxes_lang.php => Taxes.php} (100%) mode change 100755 => 100644 app/Language/nl-BE/receivings_lang.php mode change 100755 => 100644 app/Language/tr/index.html mode change 100755 => 100644 app/Libraries/MY_Email.php create mode 100644 app/Libraries/MY_Validation.php mode change 100755 => 100644 app/Models/Reports/Specific_discount.php rename {application/cache => app/ThirdParty}/index.html (87%) mode change 100755 => 100644 app/Views/configs/message_config.php create mode 100644 app/Views/errors/cli/production.php create mode 100644 app/Views/errors/error.php create mode 100644 app/Views/errors/html/debug.css create mode 100644 app/Views/errors/html/debug.js create mode 100644 app/Views/errors/html/production.php mode change 100755 => 100644 app/Views/messages/sms.php create mode 100644 app/Views/partial/footer.php create mode 100644 app/Views/partial/header.php mode change 100755 => 100644 app/Views/receivings/form.php mode change 100755 => 100644 app/Views/sales/form.php mode change 100755 => 100644 app/Views/sales/invoice.php mode change 100755 => 100644 app/Views/sales/manage.php rename {application/config => app}/index.html (87%) rename {application => app}/tests/.gitignore (100%) create mode 100644 app/tests/phpunit.xml delete mode 100644 application/config/autoload.php delete mode 100644 application/config/config.php delete mode 100644 application/config/constants.php delete mode 100644 application/config/database.php delete mode 100644 application/config/doctypes.php delete mode 100644 application/config/email.php delete mode 100644 application/config/foreign_chars.php delete mode 100644 application/config/memcached.php delete mode 100644 application/config/mimes.php delete mode 100644 application/config/pagination.php delete mode 100644 application/config/routes.php delete mode 100644 application/config/smileys.php delete mode 100644 application/config/user_agents.php delete mode 100644 application/core/MY_Lang.php delete mode 100644 application/core/MY_Security.php delete mode 100644 application/hooks/index.html delete mode 100644 application/index.html delete mode 100644 application/language/.htaccess delete mode 100644 application/logs/index.html delete mode 100644 application/third_party/index.html delete mode 100755 bin/check-diff.sh delete mode 100644 bin/devinstall.sh delete mode 100644 bin/gendocs.sh delete mode 100755 bin/install.php delete mode 100755 bin/my-codeigniter.sh delete mode 100644 bin/router.php delete mode 100755 bin/server.sh delete mode 100755 public/uploads/.gitignore create mode 100644 spark create mode 100644 writable/.htaccess rename {application => writable}/cache/.htaccess (100%) rename {application/core => writable/cache}/index.html (87%) create mode 100644 writable/debugbar/.gitkeep create mode 100644 writable/logs/index.html create mode 100644 writable/session/index.html create mode 100644 writable/uploads/index.html rename {public => writable}/uploads/item_pics/.gitignore (86%) mode change 100755 => 100644 diff --git a/.gitignore b/.gitignore index e90fc1c3c..3152ae533 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,10 @@ /node_modules /vendor /public/bower_components - -# Logs -/application/logs/* -*.log +app/Config/email.php +app/sessions/* +app/logs/* +app/uploads/* npm-debug.log* # Build generated @@ -81,6 +81,7 @@ $RECYCLE.BIN/ git-svn-diff.py *.bash .swp +system/ *.swp *.rej *.orig @@ -88,3 +89,8 @@ git-svn-diff.py *.~ .env auth.json + +*.png +*.jpg +*.jpeg +*copy* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c15f83fac..4e03d2b20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN echo "date.timezone = \"\${PHP_TIMEZONE}\"" > /usr/local/etc/php/conf.d/time WORKDIR /app COPY . /app RUN ln -s /app/*[^public] /var/www && rm -rf /var/www/html && ln -nsf /app/public /var/www/html -RUN chmod -R 750 /app/public/uploads /app/application/logs && chown -R www-data:www-data /app/public /app/application +RUN chmod -R 750 /app/writable/uploads /app/writable/logs && chown -R www-data:www-data /app/writable /app/application FROM ospos AS ospos_test @@ -23,10 +23,8 @@ RUN apt-get install -y libzip-dev wget git 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 +#RUN sed -i 's/backupGlobals="true"/backupGlobals="false"/g' /app/tests/phpunit.xml +WORKDIR /app/tests CMD ["/app/vendor/phpunit/phpunit/phpunit"] diff --git a/application/.htaccess b/app/.htaccess similarity index 100% rename from application/.htaccess rename to app/.htaccess diff --git a/app/Common.php b/app/Common.php new file mode 100644 index 000000000..780ba3f80 --- /dev/null +++ b/app/Common.php @@ -0,0 +1,15 @@ +https_on = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true'); + $this->baseURL = $this->https_on ? 'https' : 'http'; + $this->baseURL .= '://' . ((isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : 'localhost'); + $this->baseURL .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); + } +} diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php new file mode 100644 index 000000000..a6e894f13 --- /dev/null +++ b/app/Config/Autoload.php @@ -0,0 +1,193 @@ + SYSTEMPATH, + * 'App' => APPPATH + * ]; + *``` + * @var array + */ + public $psr4 = [ + APP_NAMESPACE => APPPATH, // For custom app namespace + 'Config' => APPPATH . 'Config', + 'dompdf' => APPPATH . 'ThirdParty/dompdf/src' + ]; + + /** + * ------------------------------------------------------------------- + * Class Map + * ------------------------------------------------------------------- + * The class map provides a map of class names and their exact + * location on the drive. Classes loaded in this manner will have + * slightly faster performance because they will not have to be + * searched for within one or more directories as they would if they + * were being autoloaded through a namespace. + * + * Prototype: + *``` + * $classmap = [ + * 'MyClass' => '/path/to/class/file.php' + * ]; + *``` + * @var array + */ + public $classmap = [ + //Controllers + 'Attributes' => '/App/Controllers/Attributes.php', + 'Cashups' => '/App/Controllers/Cashups.php', + 'Config' => '/App/Controllers/Config.php', + 'Customers' => '/App/Controllers/Customers.php', + 'Employees' => '/App/Controllers/Employees.php', + 'Expenses' => '/App/Controllers/Expenses.php', + 'Expenses_categories' => '/App/Controllers/Expenses_categories.php', + 'Giftcards' => '/App/Controllers/Giftcards.php', + 'Home' => '/App/Controllers/Home.php', + 'Item_kits' => '/App/Controllers/Item_kits.php', + 'Items' => '/App/Controllers/Items.php', + 'Login' => '/App/Controllers/Login.php', + 'Messages' => '/App/Controllers/Messages.php', + 'No_access' => '/App/Controllers/No_access.php', + 'Office' => '/App/Controllers/Office.php', + 'Persons' => '/App/Controllers/Persons.php', + 'Receivings' => '/App/Controllers/Receivings.php', + 'Reports' => '/App/Controllers/Reports.php', + 'Sales' => '/App/Controllers/Sales.php', + 'Secure_Controller' => '/App/Controllers/Secure_Controller.php', + 'Suppliers' => '/App/Controllers/Suppliers.php', + 'Tax_categories' => '/App/Controllers/Tax_categories.php', + 'Tax_codes' => '/App/Controllers/Tax_codes.php', + 'Tax_jurisdictions' => '/App/Controllers/Tax_jurisdictions.php', + 'Taxes' => '/App/Controllers/Taxes.php', + + //Models + 'Appconfig' => '/App/Models/Appconfig.php', + 'Attribute' => '/App/Models/Attribute.php', + 'Cashup' => '/App/Models/Cashup.php', + 'Customer' => '/App/Models/Customer.php', + 'Customer_rewards' => '/App/Models/Customer_rewards.php', + 'Dinner_table' => '/App/Models/Dinner_table.php', + 'Employee' => '/App/Models/Employee.php', + 'Expense' => '/App/Models/Expense.php', + 'Expense_category' => '/App/Models/Expense_category.php', + 'Giftcard' => '/App/Models/Giftcard.php', + 'Inventory' => '/App/Models/Inventory.php', + 'Item_kit' => '/App/Models/Item_kit.php', + 'Item_kit_items' => '/App/Models/Item_kit_items.php', + 'Item_quantity' => '/App/Models/Item_quantity.php', + 'Item_taxes' => '/App/Models/Item_taxes.php', + 'Module' => '/App/Models/Module.php', + 'Person' => '/App/Models/Person.php', + 'Receiving' => '/App/Models/Receiving.php', + 'Rewards' => '/App/Models/Rewards.php', + 'Sale' => '/App/Models/Sale.php', + 'Stock_location' => '/App/Models/Stock_location.php', + 'Supplier' => '/App/Models/Supplier.php', + 'Tax' => '/App/Models/Tax.php', + 'Tax_category' => '/App/Models/Tax_category.php', + 'Tax_code' => '/App/Models/Tax_code.php', + 'Tax_jurisdiction' => '/App/Models/Tax_jurisdiction.php', + + //Reports + 'Report' => '/App/Models/Reports/Report.php', + 'Detailed_receiving' => '/App/Models/Reports/Detailed_receiving.php', + 'Detailed_sales' => '/App/Models/Reports/Detailed_sales.php', + 'Inventory_low' => '/App/Models/Reports/Inventory_low.php', + 'Inventory_summary' => '/App/Models/Reports/Inventory_summary.php', + 'Specific_customer' => '/App/Models/Reports/Specific_customer.php', + 'Specific_discount' => '/App/Models/Reports/Specific_discount.php', + 'Specific_employee' => '/App/Models/Reports/Specific_employee.php', + 'Specific_supplier' => '/App/Models/Reports/Specific_supplier.php', + 'Summary_categories' => '/App/Models/Reports/Summary_categories.php', + 'Summary_customers' => '/App/Models/Reports/Summary_customers.php', + 'Summary_discounts' => '/App/Models/Reports/Summary_discounts.php', + 'Summary_employees' => '/App/Models/Reports/Summary_employees.php', + 'Summary_expenses_categories' => '/App/Models/Reports/Summary_expenses_categories.php', + 'Summary_items' => '/App/Models/Reports/Summary_items.php', + 'Summary_payments' => '/App/Models/Reports/Summary_payments.php', + 'Summary_report' => '/App/Models/Reports/Summary_report.php', + 'Summary_sales' => '/App/Models/Reports/Summary_sales.php', + 'Summary_sales_taxes' => '/App/Models/Reports/Summary_sales_taxes.php', + 'Summary_suppliers' => '/App/Models/Reports/Summary_suppliers.php', + 'Summary_taxes' => '/App/Models/Reports/Summary_taxes.php', + + //Tokens + 'Token' => '/App/Models/Tokens/Token.php', + 'Token_barcode_ean' => '/App/Models/Tokens/Token_barcode_ean.php', + 'Token_barcode_price' => '/App/Models/Tokens/Token_barcode_price.php', + 'Token_barcode_weight' => '/App/Models/Tokens/Token_barcode_weight.php', + 'Token_customer' => '/App/Models/Tokens/Token_customer.php', + 'Token_invoice_count' => '/App/Models/Tokens/Token_invoice_count.php', + 'Token_invoice_sequence' => '/App/Models/Tokens/Token_invoice_sequence.php', + 'Token_quote_sequence' => '/App/Models/Tokens/Token_quote_sequence.php', + 'Token_suspended_invoice_count' => '/App/Models/Tokens/Token_suspended_invoice_count.php', + 'Token_work_order_sequence' => '/App/Models/Tokens/Token_work_order_sequence.php', + 'Token_year_invoice_count' => '/App/Models/Tokens/Token_year_invoice_count.php', + 'Token_year_quote_count' => '/App/Models/Tokens/Token_year_quote_count.php', + + //Libraries + 'Barcode_lib' => '/App/Libraries/Barcode_lib.php', + 'Email_lib' => '/App/Libraries/Email_lib.php', + 'Item_lib' => '/App/Libraries/Item_lib.php', + 'Mailchimp_lib' => '/App/Libraries/Mailchimp_lib.php', + 'MY_Email' => '/App/Libraries/MY_Email.php', + 'MY_Migration' => '/App/Libraries/MY_Migration.php', + 'Receving_lib' => '/App/Libraries/Receiving_lib.php', + 'Sale_lib' => '/App/Libraries/Sale_lib.php', + 'Sms_lib' => '/App/Libraries/Sms_lib.php', + 'Tax_lib' => '/App/Libraries/Tax_lib.php', + 'Token_lib' => '/App/Libraries/Token_lib.php', + + //Miscellaneous + 'Rounding_mode' => '/App/Models/Enums/Rounding_mode.php' + ]; + + /** + * ------------------------------------------------------------------- + * Files + * ------------------------------------------------------------------- + * The files array provides a list of paths to __non-class__ files + * that will be autoloaded. This can be useful for bootstrap operations + * or for loading functions. + * + * Prototype: + * ``` + * $files = [ + * '/path/to/my/file.php', + * ]; + * ``` + * @var array + */ + public $files = []; +} \ No newline at end of file diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php new file mode 100644 index 000000000..05a861258 --- /dev/null +++ b/app/Config/Boot/development.php @@ -0,0 +1,32 @@ + + */ + public $file = [ + 'storePath' => WRITEPATH . 'cache/', + 'mode' => 0640, + ]; + + /** + * ------------------------------------------------------------------------- + * Memcached settings + * ------------------------------------------------------------------------- + * Your Memcached servers can be specified below, if you are using + * the Memcached drivers. + * + * @see https://codeigniter.com/user_guide/libraries/caching.html#memcached + * + * @var array + */ + public $memcached = [ + 'host' => '127.0.0.1', + 'port' => 11211, + 'weight' => 1, + 'raw' => false, + ]; + + /** + * ------------------------------------------------------------------------- + * Redis settings + * ------------------------------------------------------------------------- + * Your Redis server can be specified below, if you are using + * the Redis or Predis drivers. + * + * @var array + */ + public $redis = [ + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + 'database' => 0, + ]; + + /** + * -------------------------------------------------------------------------- + * Available Cache Handlers + * -------------------------------------------------------------------------- + * + * This is an array of cache engine alias' and class names. Only engines + * that are listed here are allowed to be used. + * + * @var array + */ + public $validHandlers = [ + 'dummy' => DummyHandler::class, + 'file' => FileHandler::class, + 'memcached' => MemcachedHandler::class, + 'predis' => PredisHandler::class, + 'redis' => RedisHandler::class, + 'wincache' => WincacheHandler::class, + ]; +} diff --git a/app/Config/Constants.php b/app/Config/Constants.php new file mode 100644 index 000000000..16be5e47f --- /dev/null +++ b/app/Config/Constants.php @@ -0,0 +1,154 @@ +` element. + * + * Will default to self if not overridden + * + * @var string|string[]|null + */ + public $baseURI = null; + + /** + * Lists the URLs for workers and embedded frame contents + * + * @var string|string[] + */ + public $childSrc = 'self'; + + /** + * Limits the origins that you can connect to (via XHR, + * WebSockets, and EventSource). + * + * @var string|string[] + */ + public $connectSrc = 'self'; + + /** + * Specifies the origins that can serve web fonts. + * + * @var string|string[] + */ + public $fontSrc = null; + + /** + * Lists valid endpoints for submission from `
` tags. + * + * @var string|string[] + */ + public $formAction = 'self'; + + /** + * Specifies the sources that can embed the current page. + * This directive applies to ``, `