diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..49ce3c1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/vendor \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4c49bd7..c175506 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .env +/vendor +.env +!sample.env \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..01f5aeb --- /dev/null +++ b/composer.json @@ -0,0 +1,6 @@ +{ + "require-dev": { + "squizlabs/php_codesniffer": "^3.13", + "phpcompatibility/php-compatibility": "^9.3" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..6b96b3d --- /dev/null +++ b/composer.lock @@ -0,0 +1,165 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "f03d8dad71a57fab074127fb70cae2df", + "packages": [], + "packages-dev": [ + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.13.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-06-17T22:17:01+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/config.php b/config.php new file mode 100644 index 0000000..4cba731 --- /dev/null +++ b/config.php @@ -0,0 +1,86 @@ + 'subtime 04:00:00', + '-3 hrs' => 'subtime 03:00:00', + '-2 hrs' => 'subtime 02:00:00', + '-60 min' => 'subtime 01:00:00', + '-30 min' => 'subtime 00:30:00', + '-15 min' => 'subtime 00:15:00', + '-10 min' => 'subtime 00:10:00', + '-5 min' => 'subtime 00:05:00', + '+5 min' => 'addtime 00:05:00', + '+10 min' => 'addtime 00:10:00', + '+15 min' => 'addtime 00:15:00', + '+30 min' => 'addtime 00:30:00', + '+60 min' => 'addtime 01:00:00', +); diff --git a/index.php b/index.php index 67aaf9d..305f09c 100644 --- a/index.php +++ b/index.php @@ -5,11 +5,10 @@ include ("scripts.php"); if (DEBUG === true) { - error_reporting(E_WARN); - ini_set("display_errors", true); - + error_reporting(E_WARNING); + ini_set("display_errors", true); var_dump($_REQUEST); - print "
".PHP_EOL; + print "".PHP_EOL; } if (isset($_REQUEST['set_init'])) { @@ -99,6 +98,10 @@ $offset = (isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0); +// Initialize optional query helpers to prevent undefined-variable notices +$and_where = null; +$hour_focus = isset($_REQUEST['hour_focus']) ? $_REQUEST['hour_focus'] : ""; + if (isset($_REQUEST['action']) && $_REQUEST['action'] == "move_session") { MoveSession($_REQUEST['session_id'], $_REQUEST['transaction_id'], $_REQUEST['time_shift']); print 'Unable to connect to the Suma Server using the url defined as $sumaserver_url = '.$sumaserver_url.' in the config.php file. Please check this url.
A useful test of correctness is this: if you can add /clientinit to the url, you should get a list of your suma initiatives, e.g. '.$url.'.' . PHP_EOL; +return '
Unable to connect to the Suma Server using the url defined as $sumaserver_url = '.SUMASERVER_URL.' in the config.php file. Please check this url.
A useful test of correctness is this: if you can add /clientinit to the url, you should get a list of your suma initiatives, e.g. '.$url.'.' . PHP_EOL; } //end if unable to reach sumaserver } //end function SelectInitiative diff --git a/version.php b/version.php index a5ae057..2efc4ab 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@ \ No newline at end of file