From 43adca0ebb7f8dda3604610f934690ded8cacb05 Mon Sep 17 00:00:00 2001 From: Jeremy Dorn Date: Thu, 13 Jul 2017 13:56:58 -0700 Subject: [PATCH] Add mongo adapter library to composer. Fix chart bug related to json_encode changes in php7 --- composer.json | 3 +- composer.lock | 137 ++++++++++++++++++++++- templates/default/html/chart_report.twig | 11 +- 3 files changed, 144 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 22a3c5b9..1c6d9a3a 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,8 @@ "phpoffice/phpexcel": "dev-develop", "adodb/adodb-php": "dev-master", "lespoilus/spyc": "dev-master", - "google/apiclient": "1.0.*@beta" + "google/apiclient": "1.0.*@beta", + "alcaeus/mongo-php-adapter": "^1.1@dev" }, "autoload": { "files": [ diff --git a/composer.lock b/composer.lock index e6df5bbf..58186dd0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f95ea5ffe884cc7b98c3637b05df0644", - "content-hash": "5dd8eccbc6699fee138e5031fa79c285", + "content-hash": "ff3d65b96641c6a40ec0ca839382c62b", "packages": [ { "name": "adodb/adodb-php", @@ -61,6 +60,70 @@ ], "time": "2016-04-10 15:59:20" }, + { + "name": "alcaeus/mongo-php-adapter", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/alcaeus/mongo-php-adapter.git", + "reference": "72870346ae8bf53f8238593dc1dfe73efdc1c77a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/alcaeus/mongo-php-adapter/zipball/72870346ae8bf53f8238593dc1dfe73efdc1c77a", + "reference": "72870346ae8bf53f8238593dc1dfe73efdc1c77a", + "shasum": "" + }, + "require": { + "ext-hash": "*", + "ext-mongodb": "^1.2.0", + "mongodb/mongodb": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "provide": { + "ext-mongo": "1.6.14" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mongo": "lib/Mongo" + }, + "psr-4": { + "Alcaeus\\MongoDbAdapter\\": "lib/Alcaeus/MongoDbAdapter" + }, + "files": [ + "lib/Mongo/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "alcaeus", + "email": "alcaeus@alcaeus.org" + }, + { + "name": "Olivier Lechevalier", + "email": "olivier.lechevalier@gmail.com" + } + ], + "description": "Adapter to provide ext-mongo interface on top of mongo-php-libary", + "keywords": [ + "database", + "mongodb" + ], + "time": "2017-05-13 19:34:12" + }, { "name": "google/apiclient", "version": "1.0.6-beta", @@ -104,7 +167,7 @@ "keywords": [ "google" ], - "time": "2014-09-30 19:33:59" + "time": "2014-09-30T19:33:59+00:00" }, { "name": "jdorn/file-system-cache", @@ -247,7 +310,7 @@ "yml", "zf2" ], - "time": "2012-10-15 11:52:47" + "time": "2012-10-15T11:52:47+00:00" }, { "name": "mikecao/flight", @@ -292,6 +355,69 @@ "homepage": "http://flightphp.com", "time": "2016-03-28 19:25:27" }, + { + "name": "mongodb/mongodb", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/mongodb/mongo-php-library.git", + "reference": "55e871bfff66f1f6cbe936309ba9f8eb2ca4f273" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/55e871bfff66f1f6cbe936309ba9f8eb2ca4f273", + "reference": "55e871bfff66f1f6cbe936309ba9f8eb2ca4f273", + "shasum": "" + }, + "require": { + "ext-mongodb": "^1.2.0", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "MongoDB\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Jeremy Mikola", + "email": "jmikola@gmail.com" + }, + { + "name": "Hannes Magnusson", + "email": "bjori@mongodb.com" + }, + { + "name": "Derick Rethans", + "email": "github@derickrethans.nl" + } + ], + "description": "MongoDB driver library", + "homepage": "https://jira.mongodb.org/browse/PHPLIB", + "keywords": [ + "database", + "driver", + "mongodb", + "persistence" + ], + "time": "2017-05-25 14:13:41" + }, { "name": "phpoffice/phpexcel", "version": "dev-develop", @@ -478,7 +604,8 @@ "phpoffice/phpexcel": 20, "adodb/adodb-php": 20, "lespoilus/spyc": 20, - "google/apiclient": 10 + "google/apiclient": 10, + "alcaeus/mongo-php-adapter": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/templates/default/html/chart_report.twig b/templates/default/html/chart_report.twig index a4f7d248..80b2f34d 100644 --- a/templates/default/html/chart_report.twig +++ b/templates/default/html/chart_report.twig @@ -75,11 +75,20 @@ options_{{chart.num}}.colors.push('{{color}}'); {% endfor %} - if(!options_{{chart.num}}.colors.length) { delete options_{{chart.num}}.colors; } + if(Array.isArray(options_{{ chart.num }}.series)) { + var t = options_{{ chart.num }}.series; + var n = {}; + for(var i=0;i