diff --git a/composer.json b/composer.json index 80e29763..f55509fc 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,8 @@ } ], "require": { - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^6.2", + "shuchkin/simplexlsx" : "0.8.10", + "shuchkin/simplexls" : "0.9.4" } } diff --git a/composer.lock b/composer.lock index 65e49851..b66349fa 100644 --- a/composer.lock +++ b/composer.lock @@ -1,48 +1,52 @@ { "_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#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c3cd76e7057a1b566e5fc949f660604e", + "content-hash": "ae04e84d115e6972febb1ac3d55930ea", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.2.2", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60" + "reference": "0895c932405407fd3a7368b6910c09a24d26db11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60", - "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", + "reference": "0895c932405407fd3a7368b6910c09a24d26db11", "shasum": "" }, "require": { + "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.3.1", + "guzzlehttp/psr7": "^1.6.1", "php": ">=5.5" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -66,7 +70,7 @@ "rest", "web service" ], - "time": "2016-10-08T15:01:37+00:00" + "time": "2019-10-23T15:58:00+00:00" }, { "name": "guzzlehttp/promises", @@ -121,32 +125,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.3.1", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", - "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -166,16 +175,24 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "PSR-7 message implementation", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ "http", "message", + "psr-7", + "request", + "response", "stream", - "uri" + "uri", + "url" ], - "time": "2016-06-24T23:00:38+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "psr/http-message", @@ -226,6 +243,138 @@ "response" ], "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "shuchkin/simplexls", + "version": "0.9.4", + "source": { + "type": "git", + "url": "https://github.com/shuchkin/simplexls.git", + "reference": "3b5a08c8ecc67ba6f35a1bb14d88634b152f5a3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shuchkin/simplexls/zipball/3b5a08c8ecc67ba6f35a1bb14d88634b152f5a3a", + "reference": "3b5a08c8ecc67ba6f35a1bb14d88634b152f5a3a", + "shasum": "" + }, + "require": { + "ext-mbstring": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/SimpleXLS.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sergey Shuchkin (SMSPILOT)", + "email": "sergey.shuchkin@gmail.com", + "homepage": "http://www.shuchkin.ru/" + } + ], + "description": "Parse and retrieve data from old format Excel XLS files. MS Excel 97 workbooks PHP reader.", + "homepage": "https://github.com/shuchkin/simplexls", + "keywords": [ + "backend", + "excel", + "parser", + "php", + "xls" + ], + "time": "2019-02-19T02:25:40+00:00" + }, + { + "name": "shuchkin/simplexlsx", + "version": "0.8.10", + "source": { + "type": "git", + "url": "https://github.com/shuchkin/simplexlsx.git", + "reference": "55cdcb34969951c8df0c3193c3e75553d5a38b37" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shuchkin/simplexlsx/zipball/55cdcb34969951c8df0c3193c3e75553d5a38b37", + "reference": "55cdcb34969951c8df0c3193c3e75553d5a38b37", + "shasum": "" + }, + "require": { + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-zlib": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/SimpleXLSX.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sergey Shuchkin (SMSPILOT)", + "email": "sergey.shuchkin@gmail.com", + "homepage": "http://www.shuchkin.ru/" + } + ], + "description": "Parse and retrieve data from Excel XLSx files. MS Excel 2007 workbooks PHP reader.", + "homepage": "https://github.com/shuchkin/simplexlsx", + "keywords": [ + "backend", + "excel", + "parser", + "php", + "xlsx" + ], + "time": "2019-11-06T23:47:40+00:00" } ], "packages-dev": [ @@ -283,39 +432,136 @@ ], "time": "2015-06-14T21:17:01+00:00" }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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": "2017-09-11T18:02:19+00:00" + }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", + "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.6 || ^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "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": "2017-11-10T14:09:06+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -327,42 +573,45 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03T12:10:50+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "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.4.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -390,7 +639,7 @@ "spy", "stub" ], - "time": "2015-08-13T10:07:40+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -456,16 +705,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -499,7 +748,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21T13:08:43+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -544,22 +793,30 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -581,20 +838,20 @@ "keywords": [ "timer" ], - "time": "2015-06-21T08:01:12+00:00" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { @@ -630,20 +887,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15T10:49:45+00:00" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.19", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b2caaf8947aba5e002d42126723e9d69795f32b4" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b2caaf8947aba5e002d42126723e9d69795f32b4", - "reference": "b2caaf8947aba5e002d42126723e9d69795f32b4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -657,9 +914,9 @@ "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "~1.2.2", "sebastian/diff": "~1.2", "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", @@ -702,7 +959,7 @@ "testing", "xunit" ], - "time": "2015-11-30T08:18:59+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -762,22 +1019,22 @@ }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -822,32 +1079,32 @@ "compare", "equality" ], - "time": "2015-07-26T15:48:44+00:00" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -870,31 +1127,31 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22T15:13:53+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "1.3.2", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", - "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -924,20 +1181,20 @@ "environment", "hhvm" ], - "time": "2015-08-03T06:14:51+00:00" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -945,12 +1202,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -990,7 +1248,7 @@ "export", "exporter" ], - "time": "2015-06-21T07:55:53+00:00" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/global-state", @@ -1045,16 +1303,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -1094,7 +1352,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21T08:04:50+00:00" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", @@ -1131,27 +1389,95 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2015-06-21T13:59:46+00:00" }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" + }, { "name": "symfony/yaml", - "version": "v2.8.0", + "version": "v3.4.33", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f79824187de95064a2f5038904c4d7f0227fedb5" + "reference": "dab657db15207879217fc81df4f875947bf68804" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f79824187de95064a2f5038904c4d7f0227fedb5", - "reference": "f79824187de95064a2f5038904c4d7f0227fedb5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/dab657db15207879217fc81df4f875947bf68804", + "reference": "dab657db15207879217fc81df4f875947bf68804", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1178,7 +1504,57 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-11-30T12:35:10+00:00" + "time": "2019-10-24T15:33:53+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "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-08-24T08:43:50+00:00" } ], "aliases": [], diff --git a/include/controllers/activity_controller.php b/include/controllers/activity_controller.php index a93e4a45..94d73133 100755 --- a/include/controllers/activity_controller.php +++ b/include/controllers/activity_controller.php @@ -215,45 +215,79 @@ public function opretAktivitet() $this->page->model = $this->model; } - + + /** + * Imports activities from a submitted spreadsheet + * + * @access public + * @return void + */ public function importActivities() { - $user = $this->model->getLoggedInUser(); - - if ($this->page->request->isPost()) { - $post = $this->page->request->post; - - /* - Nothing in $post... - foreach ($post as $key => $value) { - echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."
"; - } - exit; - */ - - if (empty($post->importactivities)) { // skal jeg bruge file eller importactivities ? + $session = $this->dic->get('Session'); + + // if it's not a post request, don't do anything + if (!$this->page->request->isPost()){ + return; + } + $post = $this->page->request->post; + + // Did the user submit a file + if (isset($post->importactivities)) { + $file = isset($_FILES['activities']) ? $_FILES['activities'] : null; + if($file == null || $file['error'] == 4) { $this->errorMessage('Ingen Excel fil valgt.'); - $this->hardRedirect($this->url('aktiviteterhome')); + return; } - else { - try { - if ($this->model->importActivities()) { - $this->successMessage('Aktiviteter blev importeret.'); - $this->log("Aktiviter blev importeret af {$this->model->getLoggedInUser()->user}", 'Aktivitet', $this->model->getLoggedInUser()); - $this->hardRedirect($this->url('aktiviteterhome')); - } else - { - $this->errorMessage('Kunne ikke importere aktiviteter.'); - $this->hardRedirect($this->url('aktiviteterhome')); - } - } catch (Exception $e) { + + // Parse the file depending on file type or give an error if type isn't known + list($name, $type) = explode(".", $file['name']); + switch ($type) { + case "xlsx": + if ( !$data = SimpleXLSX::parse($file['tmp_name'])->rows() ) { + $this->errorMessage(SimpleXLSX::parseError()); + } + break; + case "xls": + if ( !$data = SimpleXLS::parse($file['tmp_name'])->rows() ) { + $this->errorMessage(SimpleXLS::parseError()); + } + break; + default: + $this->errorMessage('Fil er ikke korrekt type'); + return false; + } + + unset($data[0]); // remove column names from data + $session->activity_data = $this->model->parseActivityData($data); + $this->successMessage('Aktiviteter blev uploadet, men er IKKE gemt'); + } + + if ((isset($post->import_add) || isset($post->import_replace)) && isset($session->activity_data)) { + try { + if ($this->model->importActivities($session->activity_data, isset($post->import_replace))) { + $this->successMessage('Aktiviteter blev importeret.'); + $this->log("Aktiviter blev importeret", 'Aktivitet', $this->model->getLoggedInUser()); + $session->delete('activity_data'); + } else { + $this->errorMessage('Kunne ikke importere aktiviteter.'); + } + } catch (FrameworkException $e) { + if ($e->getCode() == 1) { + $this->errorMessage('Kan ikke udskifte aktiviteter efter der er oprettet afviklinger'); + } else { $this->errorMessage('Kunne ikke importere aktiviteter.'); - $this->hardRedirect($this->url('aktiviteterhome')); } + } catch (Exception $e) { + $this->errorMessage('Kunne ikke importere aktiviteter.'); } } - - $this->page->model = $this->model; + + if (isset($session->activity_data)) { + $this->page->activity_data = $session->activity_data; + $this->page->activity_header = $this->model->getActivityHeader(); + } + } /** diff --git a/include/framework/dbobject.php b/include/framework/dbobject.php index d7aad5e2..2a3367e5 100755 --- a/include/framework/dbobject.php +++ b/include/framework/dbobject.php @@ -568,6 +568,21 @@ public function delete() return true; } + /** + * deletes ALL elements of the curret object type from the database + * + * @access public + * @return bool + */ + public function deleteALL(){ + $query = "DELETE FROM {$this->quoteTable($this->tablename)}"; + $this->getDB()->exec($query); + $this->invalidate(); + $query = "ALTER TABLE {$this->quoteTable($this->tablename)} AUTO_INCREMENT = 1"; + $this->getDB()->exec($query); + return true; + } + //{{{ methods dealing with loading objects and invalidating them /** * creates a number of new objects and calls loadObject to fill them with data diff --git a/include/models/activity_model.php b/include/models/activity_model.php index 09f74451..ec7c19c2 100755 --- a/include/models/activity_model.php +++ b/include/models/activity_model.php @@ -171,49 +171,135 @@ public function opretAktivitet(RequestVars $post) return $activity; } + + public function getActivityHeader(){ + $activity = $this->createEntity('Aktiviteter'); + $fields = $activity->getColumns(); + $fields[] = 'age_min'; + $fields[] = 'age_max'; + unset($fields[0]); // remove id from header + unset($fields[3]); // remove note from header + return $fields; + } + + public static function parseActivityData($data){ + $result = []; + foreach ($data as $row) { + $result[] = self::parseActivityRow($row); + } + return $result; + } + + public static function parseActivityRow($row){ + for($i = 0; $i < 22; $i++){ + $row[$i] = isset($row[$i]) ? $row[$i] : ""; + } + + $result_row = []; + //$result_row['id'] = ''; + $result_row['navn'] = $row[1]; + $result_row['kan_tilmeldes'] = 'ja'; + //$result_row['note'] = ''; + $result_row['foromtale'] = $row[17]; + preg_match("/\d+/", $row[12], $matches); + $result_row['varighed_per_afvikling'] = $matches[0]; + preg_match("/\d+/", $row[6], $matches); + $result_row['min_deltagere_per_hold'] = isset($matches[0]) ? $matches[0] : 0; + preg_match("/\d+/", $row[7], $matches); + $result_row['max_deltagere_per_hold'] = isset($matches[0]) ? $matches[0] : 0; + preg_match("/\d+/", $row[8], $matches); + $result_row['spilledere_per_hold'] = isset($matches[0]) ? $matches[0] : 0; + preg_match("/\d+/", $row[9], $matches); + $result_row['pris'] = isset($matches[0]) ? $matches[0] : 0; + $result_row['lokale_eksklusiv'] = preg_match("/nej/", strtolower($row[19])) == 1 ? 'nej' : 'ja'; + $result_row['wp_link'] = 0; + $result_row['teaser_dk'] = $row[13]; + $result_row['teaser_en'] = $row[14]; + $result_row['title_en'] = $row[2];; + $result_row['description_en'] = $row[18]; + $result_row['author'] = $row[3];; + // parsing type from input + $type = strtolower($row[4]); + if (preg_match("/junior/", $type)) { + $type = 'junior'; + } elseif (preg_match("/live/", $type)) { + $type = 'live'; + } elseif (preg_match("/brætspil/", $type)) { + $type = 'braet'; + } elseif(preg_match("/rollespil/", $type)) { + $type = 'rolle'; + } elseif (preg_match("/figur/", $type)) { + $type = 'figur'; + } elseif(preg_match("/magic/", $type)) { + $type = 'magic'; + } elseif(preg_match("/workshop/", $type)) { + $type = 'workshop'; + } elseif(preg_match("/system/", $type) || preg_match("/spillederbriefing/", strtolower($result_row['navn']))) { + $type = 'system'; + } else { + $type = 'ottoviteter'; + } + $result_row['type'] = $type; + + $result_row['tids_eksklusiv'] = preg_match("/nej/", strtolower($row[20])) == 1 ? 'nej' : 'ja'; + + $sprog = preg_match("/d/", strtolower($row[5])) == 1 ? 'dansk' : ''; + $engelsk = $sprog == '' ? 'engelsk' : '+engelsk'; + $sprog .= preg_match("/e/", strtolower($row[5])) == 1 ? $engelsk : ''; + $result_row['sprog'] = $sprog; + + $result_row['replayable'] = preg_match("/ja/", strtolower($row[15])) == 1 ? 'nej' : 'ja'; // If not one-time event + $result_row['updated'] = $row[0]; + $result_row['hidden'] = preg_match("/ja/", strtolower($row[21])) == 1 ? 'ja' : 'nej'; + $result_row['karmatype'] = 0; + preg_match("/\d+/", $row[16], $matches); + $result_row['max_signups'] = isset($matches[0]) ? $matches[0] : 0; + $result_row['age_min'] = $row[10]; + $result_row['age_max'] = $row[11]; + + return $result_row; + } - public function importActivities() - { - $activity = $this->createEntity('Aktiviteter'); - // Required values - $activity->updated = date('Y-m-d H:i:s'); - $activity->navn = "Test"; - $activity->title_en = "Test"; - $activity->author = "Text"; - $activity->type = 'rolle'; - $activity->sprog = 'dansk'; - $activity->min_deltagere_per_hold = 1; - $activity->max_deltagere_per_hold = 1; - $activity->spilledere_per_hold = 1; - $activity->pris = 0; - $activity->varighed_per_afvikling = 1; - $activity->teaser_dk = "TeaserDK"; - $activity->teaser_en = "TeaserEN"; - $activity->replayable = 'nej'; - $activity->max_signups = 0; - $activity->foromtale = "foromtale"; // Can be null - $activity->description_en = "DescriptionEN"; - - // Default values: - $activity->kan_tilmeldes = 'ja'; - $activity->note = NULL; - $activity->lokale_eksklusiv = 'ja'; - $activity->wp_link = 0; - $activity->tids_eksklusiv = 'ja'; - - // Default values (which are not visible under "Opret Aktivitet") - $activity->hidden = 'nej'; - $activity->karmatype = 0; - - if (!$activity->insert()) { - return false; + public function importActivities($data, $replace = false) { + if($replace === true) { + // Check if we have any afviklinger before trying to replace activities + if ($this->createEntity('Afviklinger')->findAll() + || $this->createEntity('AfviklingerMultiblok')->findAll()) + { + throw new FrameworkException("Cannot replace activities after afviklinger has been created", 1); + } + + $activity = $this->createEntity('Aktiviteter'); + $activity->deleteAll(); + } + + $errors = 0; + foreach($data as $row) { + $activity = $this->createEntity('Aktiviteter'); + + foreach ($row as $key => $value){ + if ($key === 'age_min' || $key === 'age_max'){ + continue; + } + + $activity->$key = $value; + } + + if (!$activity->insert()) { + $errors ++; + } + + // Values that have to be set after the activity is inserted + // since they are in a different table with foreign key constraint + if ($row['age_min'] !== '') { + $activity->setMinAge($row['age_min']); + } + if ($row['age_max'] !== '') { + $activity->setMaxAge($row['age_max']); + } } - // Optional values: - //$activity->setMinAge(7); - //$activity->setMaxAge(50); - - return true; + return $errors == 0; } /** diff --git a/include/templates/activity/importactivities.phtml b/include/templates/activity/importactivities.phtml index 3c606d1b..456c302a 100644 --- a/include/templates/activity/importactivities.phtml +++ b/include/templates/activity/importactivities.phtml @@ -1,14 +1,44 @@ +getMessagesHtml()?>
Importer Aktiviteter
+

Bemærk det er vigtigt at kolonner står i den rigtige rækkefølge.

+

Man vil kunne se resultatet af importen inden man vælger at lægge det i databasen

- - - + + +
+ activity_data)) { ?> +
+

Herunder kan du se de data infosys har læst fra arket

+

Vil du overskrive de aktiviteter der allerede ligger i databasen? +
Eller vil du tilføje alle disse aktiviteter til dem der ligger i forvejen? +
(Infosys checker ikke om du tilføjer en aktivitet der ellerede findes i forvejen, det skal du selv gøre)

+
+ + +
+ + + activity_header as $header) { ?> + + + + activity_data as $row){ ?> + + + + + + +
+
+
\ No newline at end of file diff --git a/public/css/main.css b/public/css/main.css index aedc7e7d..f05fd6f6 100755 --- a/public/css/main.css +++ b/public/css/main.css @@ -1358,7 +1358,7 @@ div#checkin-interface-container div.success.money { div#food-handout-container fieldset#stats-fieldset { background-color: #eeeeee; padding: 10px; - border + /*border*/ } div#food-handout-container div#stats-boxes div.stats-box { @@ -2316,3 +2316,9 @@ table.accounting tbody { border: 1px solid #000; padding: 1em 2em; } + +.importTable td { + padding: 5px; + vertical-align: top; + border: #000 1px solid; +}