Commit Graph

38 Commits

Author SHA1 Message Date
BudsieBuds
e83c23cf0c Improve code style and PSR-12 compliance (#4204)
* Improve code style and PSR-12 compliance
- refactored code formatting to adhere to PSR-12 guidelines
- standardized coding conventions across the codebase
- added missing framework files and reverted markup changes
- reformatted arrays for enhanced readability
- updated language files for consistent styling and clarity
- minor miscellaneous improvements
2025-05-02 19:37:06 +02:00
objecttothis
e90b5b87da Replace tabs with spaces (#4196)
Signed-off-by: objecttothis <objecttothis@gmail.com>
2025-03-28 21:24:21 +04:00
jekkos
882f3b4522 Fix table header translations (#4175) 2025-02-15 01:08:19 +01:00
jekkos
c81c546286 Remove prepare_decimal and filter_var 2025-01-13 01:13:28 +01:00
objecttothis
2d895b4a9e Adapt Configuration checker for CI4 (#4108)
- Removed $import variable as it is never used and the code generates the csv file for item imports
- Refactored import_customers.csv to match PSR-12 standard file names
- Refactored variable names to match PSR-12 standard variable names
- Updated .editorconfig to reflect PSR-12 requirement for spaces rather than tab symbols. https://www.php-fig.org/psr/psr-12/#24-indenting
- Added version number to browser reporting
- Corrected timezone reporting

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Revert .editorconfig (#3708)

---------

Signed-off-by: objecttothis <objecttothis@gmail.com>
Co-authored-by: jekkos <jeroen.peelaerts@gmail.com>
2024-11-10 09:23:42 +01:00
jekkos
b8a74ba30a Fix employee, supplier, customer (#4086) 2024-10-05 02:27:25 +02:00
jekkos
0f4d06af61 Blind SQL injection fix (#3284) 2024-10-03 00:00:55 +02:00
jekkos
72f147074d Enable html escape + fix XSS (#3965) 2024-10-02 21:29:09 +02:00
jekkos
f279877cd6 Fix customer suggestion (#4031) 2024-09-17 00:32:10 +02:00
jekkos
f49d763254 XSS mitigation features (#4041)
* Remove HtmlPurifier calls

- All calls to Services::htmlPurifier()->purify() removed from data received from view.
- Bootstrap and bootswatch bump in package-lock.json

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Pre-view filtering Items Controller

- Refactored code for clarity
- Created and called sanitization functions.
- Sanitize TEXT type Attributes before being sent to the view.

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Pre-view filtering Customers Controller

- Refactored code for clarity
- Replaced == with === operator to prevent type juggling
- Added Sanitization of Customer data before being sent to the view

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Bump bootstrap-table to 1.23.1

- Bump bootstrap-table to 1.23.1 in attempt to resolve issue with sticky headers
- Sanitize attribute data in tables
- Sanitize item data with controller function.

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Pre-view filtering Items Controller

- Refactored code for clarity
- Created and called sanitization functions.
- Sanitize TEXT type Attributes before being sent to the view.

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Sanitize Item data

- Sanitize category and item_number before display in forms.
- refactor check in pic_filename for empty to be best practices compliant.
- Added TODO

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Minor changes

- Refactored for code clarity.
- Removed extra blank lines.
- Minor reformatting.
- Added PHPdocs
- bumped bootstrap-table to 1.23.2

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Pre-view filtering Items Controller

- Refactored code for clarity
- Created and called sanitization functions.
- Sanitize TEXT type Attributes before being sent to the view.

Signed-off-by: objecttothis <objecttothis@gmail.com>

* Sanitize Item data

- Sanitize category and item_number before display in forms.
- refactor check in pic_filename for empty to be best practices compliant.
- Added TODO

Signed-off-by: objecttothis <objecttothis@gmail.com>

---------

Signed-off-by: objecttothis <objecttothis@gmail.com>
Co-authored-by: objecttothis <objecttothis@gmail.com>
2024-08-26 11:35:56 +04:00
jekkos
0be9488cfb Fix customer sale suggestion (#4031) 2024-08-04 00:13:07 +02:00
objecttothis
52723ceeec Updated PHPDocs
- Added @noinspection PhpUnused to AJAX-called functions to remove weak warning that the function is unused. This will be needed for the linter.
- Referenced where the function is called in the PHPdocs.
- Removed redundant transaction. batch_save() is already being run in a transaction.
- Fixed function name in controller and view.
- Removed form helper load because it's autoloaded.
- Corrected variable reference in Secure_Controller.php

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
objecttothis
b3b8e7ec1d HTMLPurifier filtering on searches
- Formatting
- Added calls to HTMLPurifier
- Added filtering
- Refactored out variable for clarity

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
objecttothis
14248edc06 HTMLPurifier filtering
- Replaced == with === to avoid type juggling
- Removed unneeded TODO
- Added HTMLPurifier to composer.json
- Added Service to allow singleton instance of purifier.
- Implemented use in Customer Controller Search function.

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
objecttothis
5500d3989f Filtering
- Added filtering to decimals which may have different comma separator
- Added formatting of decimals before concatenating into string
- Cast int to string in form_hidden() call

Signed-off-by: objecttothis <objecttothis@gmail.com>
2024-06-15 17:19:15 +02:00
odiea
a2df771f19 Update Customers.php
To keep coding the same
2024-06-15 17:19:15 +02:00
objecttothis
7356500d86 - Fixed missing call to helper and helper function
- Format percentage per locale rules
- Moved constants to Constants.php
- Added PHPdoc comments
- Refactor code for clarity and simplicity.
- Added decimal formatting per locale for display.
- autoload locale helper
- Remove unneeded calls to helpers
- Removed unneeded comments
- fixed errors causing checks in parse_decimals to return false due to locales which use a comma.
2024-06-15 17:19:15 +02:00
objecttothis
34bc4540bf Added Error log
- Logs message when error encountered during Customers CSV Import
2024-06-15 17:19:15 +02:00
Doug Hutcheson
9723e82b61 CI4 bug fixes on behalf of DEV-byoos 3776
Changes to Controllers/Receivings.php and Controllers/Sales.php identified by @DEV-byoos, plus a change to Controllers/Customers.php to deal with the new way PHP 8.2 handles missing array keys.
2024-06-15 17:19:15 +02:00
objecttothis
b5f93b6325 Fixed Customer CSV import
- Corrected function name for CI4
- Removed trailing whitespace
2024-06-15 17:19:15 +02:00
objecttothis
2efda51309 Fixes
- Removed unneeded use statements
- Corrected function name for routes
- Moved import_customers.csv to writable folder to prevent unauthorized access
- Added return to function to force download
2024-06-15 17:19:15 +02:00
objecttothis
ba9bcd7786 PHPdocs
- Added missing PHPdocs
- Corrected Syntax
- Added noinspection parameters to PHPdoc for AJAX called functions
- Added missing function return types
- Added missing parameter types
- Added public keyword to functions without visibility modifier
- Corrected incorrectly formatted PHPdocs
- Added public to constants and functions missing a visibility keyword
2024-06-15 17:19:15 +02:00
objecttothis
7b224be665 PSR compliance and formatting changes
- Replaced TRUE/FALSE constants with true/false keywords
- Replaced NULL constant with null keyword
- Replaced `<?php echo` in views with shortened `<?=`
- Added missing variable declaration
- Added missing function return type in declaration
- replaced `== true`, `== false`, `=== true` and `=== false` in if statements with simplified forms
2024-06-15 17:19:15 +02:00
objecttothis
0754f2f6e6 Fix Request variable retrieval
- getSearch functions to properly retrieve HTTP vars.
- getVar() function calls replaced with getGet() or getPost()
- replaced TRUE/FALSE constants with true/false keywords
2024-06-15 17:19:15 +02:00
objecttothis
48c04417b8 Fixes
- PHP 8.2 deprecates dynamically declared class properties. Adding these declarations removes deprecation warnings and makes the code PHP 8.3 compatible.
- Add Elvis operator to set search string to an empty string when it's value is null to get rid of an error in the search function call.
- Imported class for OSPOS config
- Replaced private with protected in parent controller's property.
- Removed unneeded TODO
- Refactored local variables
- Replaced ternary notation
- Removed unneeded comments
- Removed unneeded class property
- Removed unneeded @property declarations
- Fixed database version
2024-06-15 17:19:15 +02:00
objecttothis
6074d984ed Code fixes
- Replaced ternary notation with null coalescing version.
- Removed unnecessary semi-colon
- Replaced `<? echo` with short echo ``<?=`
- declared stay_open explicitly with `let`
- Updated PHPdocs
- Replaced force_download() from the CI3 download helper with CI4 version
- Removed unneeded using statements
- added needed call to db_connect()
- Removed parameter that matches the default value since it's redundant.
2024-06-15 17:19:15 +02:00
objecttothis
405583c832 Attributes fixes and warning removal
- when the payments array was folded into sale_data there was an earlier payments[] reference in the foreach loop that didn't get folded in.
- Update PHPdoc
- Added ::class to remove polymorphic call warning
- Removed unreachable 'break;' statement after return statement.
- Added missing return type
- fixed missing assignment of mailchimp_api_key
2024-06-15 17:19:15 +02:00
Doug Hutcheson
1a465621e0 Ci4 bugfix string interpolation (#3836)
* CI4: Bugfix string interpolation language files

These are the language files with all placeholders converted to CI4 numbered style eg {0}.

* CI4: Bugfix string interpolation source code files

These are the controllers and views which call lang() with parameters to be interpolated.

* CI4: Bugfix string interpolation shell scripts

These are the Linux bash scripts which use the sed (stream editor) utility to convert earlier forms of placeholders to CI4 numeric type. A number of typographical errors in the original Language files were corrected by these scripts.
2024-06-15 17:19:15 +02:00
Steve Ireland
f5094d62a2 Restore the tables.sql to its virgin state. 2024-06-15 17:19:15 +02:00
Steve Ireland
4798041408 Tack on the void return type onto the Employee:logout method. 2024-06-15 17:19:15 +02:00
Steve Ireland
13a14ec310 Remove grunt045 from zipped opensourcepos file. Also fix the call to array_walker since the parameters (even if not used) are validated in PHP 8. 2024-06-15 17:19:15 +02:00
objecttothis
8d80f5a261 CI4 bugfixes
- Added session variable instantiation where needed.
- Added tabular helper to autoload
- removed tabular helper reference where no longer needed.
- Remove esc() references where it was causing display problems.
- Remove excess whitespace on blank line
- Remove unecessary using reference
- Make parameters for dinner table functions nullable
2024-06-15 17:19:15 +02:00
objecttothis
ae357cab4a Formatting
- Convert indents to tabs
- Remove unnecessary else statement
- Correct PHPDoc formatting
2024-06-15 17:19:15 +02:00
objecttothis
1dd58e922f Corrected link in README.md 2024-06-15 17:19:15 +02:00
objecttothis
f84b795ee6 Upgrade to CodeIgniter 4.1.3 2024-06-15 17:19:15 +02:00
jekkos
73b189b6d4 Prepare rebase: move files to new folder structure 2024-06-15 17:19:15 +02:00
jekkos
dcb797571e evert "Prepare rebase: move files to new folder structure"
This reverts commit eed0cd1ca0.
2023-05-30 17:52:17 +02:00
jekkos
eed0cd1ca0 Prepare rebase: move files to new folder structure 2023-05-07 15:10:27 +02:00