diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..eb71d317 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: "GLPI professional support" + url: "https://services.glpi-network.com" + about: "Get professional support from the editor and a network of local partners." + - name: "Find an official partner" + url: "https://glpi-project.org/partners/" + about: "Get support to deploy GLPI in a professional manner." + - name: "GLPI Community Forum" + url: "https://forum.glpi-project.org" + about: "Ask questions and get help from the community." diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..46a6d7ab --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + # Ensure GitHub Actions are used in their latest version + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + + # Strategy for composer dependencies + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "monthly" + allow: + - dependency-type: "direct" + open-pull-requests-limit: 100 + versioning-strategy: "increase" + groups: + dev-dependencies: + dependency-type: "development" diff --git a/.github/workflows/autoclose-issues.yml b/.github/workflows/autoclose-issues.yml new file mode 100644 index 00000000..f756c1ec --- /dev/null +++ b/.github/workflows/autoclose-issues.yml @@ -0,0 +1,34 @@ +name: "Close issues" + +on: + issues: + types: ["opened"] + +jobs: + close-issue: + permissions: + issues: "write" + name: "Close issue" + runs-on: "ubuntu-latest" + steps: + - uses: "actions/github-script@v7" + with: + script: | + const issues_url = context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/issues/new/choose'; + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Issues opened on this repository are not processed. Please follow links proposed in ${issues_url}.` + }); + await github.rest.issues.lock({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + }); + await github.rest.issues.update({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + state: "closed", + }); diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..a29d2300 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,35 @@ +name: "Continuous integration" + +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + generate-ci-matrix: + name: "Generate CI matrix" + uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1" + with: + glpi-version: "10.0.x" + ci: + name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}" + needs: "generate-ci-matrix" + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }} + uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1" + with: + plugin-key: "mreporting" + glpi-version: "${{ matrix.glpi-version }}" + php-version: "${{ matrix.php-version }}" + db-image: "${{ matrix.db-image }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8f5e15a..ef7ca1ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: "Plugin release" +name: "Publish release" on: push: @@ -6,35 +6,6 @@ on: - '*' jobs: - create-release: - name: "Create release" - runs-on: "ubuntu-latest" - steps: - - name: "Extract tag name" - run: | - echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: "Checkout" - uses: "actions/checkout@v2" - - name: "Build package" - id: "build-package" - uses: "glpi-project/tools/github-actions/build-package@0.1.15" - with: - plugin-version: ${{ env.tag_name }} - - name: "Create release" - id: "create-release" - uses: "actions/create-release@v1" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.tag_name }} - release_name: ${{ env.tag_name }} - draft: true - - name: "Attach package to release" - uses: "actions/upload-release-asset@v1" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: ${{ steps.build-package.outputs.package-path }} - asset_name: ${{ steps.build-package.outputs.package-basename }} - asset_content_type: " application/x-bzip2" + publish-release: + name: "Publish release" + uses: "glpi-project/plugin-release-workflows/.github/workflows/publish-release.yml@v1" diff --git a/.phpcs.xml b/.phpcs.xml new file mode 100644 index 00000000..c0dcc48e --- /dev/null +++ b/.phpcs.xml @@ -0,0 +1,19 @@ + + + . + /.git/ + ^vendor/ + ^lib/ + ^locales/ + + + + + + + + + + + + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 17203bb5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: php -php: - - 7.2 - - 7.4 - -before_script: - - composer self-update - - composer install --optimize-autoloader --prefer-dist --no-interaction --no-progress --no-suggest - -script: - - vendor/bin/robo --no-interaction code:cs --strict - -cache: - directories: - - $HOME/.composer/cache diff --git a/.tx/config b/.tx/config index 0ec65604..50a1ba5c 100644 --- a/.tx/config +++ b/.tx/config @@ -1,8 +1,10 @@ [main] host = https://www.transifex.com -[glpi-project-plugin-mreporting.mreporting-pot] -file_filter = locales/.po -source_file = locales/mreporting.pot -source_lang = en_GB -type = PO +[o:teclib:p:glpi-project-plugin-mreporting:r:mreporting-pot] +file_filter = locales/.po +source_file = locales/mreporting.pot +source_lang = en_GB +type = PO +replace_edited_strings = false +keep_translations = false diff --git a/README.md b/README.md index eca52da2..220db103 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Join the chat at https://gitter.im/TECLIB/mreporting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TECLIB/mreporting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -![Dashboard](https://raw.githubusercontent.com/PluginsGLPI/mreporting/master/screenshots/dashboard.png) +![Dashboard](https://raw.githubusercontent.com/PluginsGLPI/mreporting/main/screenshots/dashboard.png) * Download : https://github.com/PluginsGLPI/mreporting/releases * WIKI (Develop new reports) : https://github.com/PluginsGLPI/mreporting/wiki diff --git a/RoboFile.php b/RoboFile.php deleted file mode 100644 index b078dc94..00000000 --- a/RoboFile.php +++ /dev/null @@ -1,14 +0,0 @@ -. - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); diff --git a/ajax/dashboard.php b/ajax/dashboard.php index 3df47804..1cd12e33 100644 --- a/ajax/dashboard.php +++ b/ajax/dashboard.php @@ -1,40 +1,69 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + include('../../../inc/includes.php'); Html::header_nocache(); Session::checkLoginUser(); if (isset($_REQUEST['action'])) { - switch ($_REQUEST['action']) { - case 'removeReportFromDashboard': - PluginMreportingDashboard::removeReportFromDashboard($_REQUEST['id']); - break; - - case 'updateWidget': - PluginMreportingDashboard::updateWidget($_REQUEST['id']); - break; - - case 'getConfig': - PluginMreportingDashboard::getConfig(); - break; - - case 'centralDashboard' : - Html::includeHeader(); - echo ""; - $dashboard = new PluginMreportingDashboard(); - $dashboard->showDashboard(false); - - //load protovis lib for dashboard render - $version = Plugin::getInfo('mreporting', 'version'); - $php_dir = Plugin::getPhpDir('mreporting', false); - echo Html::script($php_dir . "/lib/protovis/protovis.js", ['version' => $version]); - - Html::popFooter(); - break; - - default: - echo 0; - } + switch ($_REQUEST['action']) { + case 'removeReportFromDashboard': + PluginMreportingDashboard::removeReportFromDashboard($_REQUEST['id']); + break; + + case 'updateWidget': + PluginMreportingDashboard::updateWidget($_REQUEST['id']); + break; + + case 'getConfig': + PluginMreportingDashboard::getConfig(); + break; + + case 'centralDashboard': + Html::includeHeader(); + echo ""; + $dashboard = new PluginMreportingDashboard(); + $dashboard->showDashboard(false); + + //load protovis lib for dashboard render + $version = Plugin::getInfo('mreporting', 'version'); + $php_dir = Plugin::getPhpDir('mreporting', false); + echo Html::script($php_dir . "/lib/protovis/protovis.js", ['version' => $version]); + + Html::popFooter(); + break; + + default: + echo 0; + } } else { - echo 'No action defined'; + echo 'No action defined'; } diff --git a/ajax/dropdownExport.php b/ajax/dropdownExport.php index 5245005e..e14f4f8a 100644 --- a/ajax/dropdownExport.php +++ b/ajax/dropdownExport.php @@ -1,61 +1,63 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); -if (isset($_POST['ext']) - && !empty($_POST['ext'])) { - if ($_POST['ext'] == "odt") { - echo " "; - $option = []; - $option[1] = __("With data", 'mreporting'); - $option[0] = __("Without data", 'mreporting'); - Dropdown::showFromArray("withdata", $option, []); - - } - - if ($_POST['ext'] == "svg") { - //close previous form - Html::Closeform(); - - $randname = $_POST['randname']; - echo "
"; - echo ""; - echo ""; - Html::Closeform(); - echo ""; - } else { + } else { + echo " "; - echo " "; - - echo ""; - } - + } } diff --git a/ajax/dropdownGraphs.php b/ajax/dropdownGraphs.php index 50cabb52..b07be6b9 100644 --- a/ajax/dropdownGraphs.php +++ b/ajax/dropdownGraphs.php @@ -1,47 +1,48 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ if (strpos($_SERVER['PHP_SELF'], "dropdownGraphs.php")) { - include ("../../../inc/includes.php"); - header("Content-Type: text/html; charset=UTF-8"); - Html::header_nocache(); + include("../../../inc/includes.php"); + header("Content-Type: text/html; charset=UTF-8"); + Html::header_nocache(); } Session::checkLoginUser(); if ($_POST['graphname'] != -1) { - $test = explode(";", $_POST['graphname']); - if (isset($test[0])) { - $_POST['classname'] = $test[0]; - $_POST['name'] = $test[1]; - - $config= new PluginMreportingConfig(); - echo " ".__('Send').""; - } + $test = explode(";", $_POST['graphname']); + if (isset($test[0])) { + $_POST['classname'] = $test[0]; + $_POST['name'] = $test[1]; + + $config = new PluginMreportingConfig(); + echo " " . __('Send') . ""; + } } diff --git a/ajax/get_new_crsf_token.php b/ajax/get_new_crsf_token.php index 9413b40e..b5644a6a 100644 --- a/ajax/get_new_crsf_token.php +++ b/ajax/get_new_crsf_token.php @@ -1,6 +1,35 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + $AJAX_INCLUDE = 1; -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); diff --git a/ajax/homepage_link.php b/ajax/homepage_link.php index dbef8689..ab857f9f 100644 --- a/ajax/homepage_link.php +++ b/ajax/homepage_link.php @@ -1,8 +1,37 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +include('../../../inc/includes.php'); Session::checkLoginUser(); echo ''; + '/front/dashboard.form.php" class="itemP">  ' . + __("Dashboard", 'mreporting') . '  '; diff --git a/ajax/index.php b/ajax/index.php index 95d8de68..0c6f82fb 100644 --- a/ajax/index.php +++ b/ajax/index.php @@ -1,2 +1,31 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + header('Location: ../front/central.php'); diff --git a/composer.json b/composer.json index 92fc1bb6..380867ec 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,24 @@ { "require": { - "php": "^7.2", + "php": ">=7.4", "masnathan/odtphp": "dev-teclib" }, "require-dev": { - "glpi-project/tools": "^0.1" + "glpi-project/tools": "^0.7", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^1.10", + "squizlabs/php_codesniffer": "^3.7" }, "config": { "optimize-autoloader": true, "platform": { - "php": "7.2.0" + "php": "7.4.0" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true + } }, "repositories": [ { diff --git a/composer.lock b/composer.lock index 578f5ab0..26b1fed7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a91291239eda8ca133325a08094c24aa", + "content-hash": "431a18648ac5e705e31edea4f27bc51d", "packages": [ { "name": "masnathan/odtphp", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/TECLIB/odtphp.git", - "reference": "6c2f07dd82993565ab6536a30d2d6c04ab699086" + "reference": "c4e081136296beac75b6151abdfc5d5633479bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TECLIB/odtphp/zipball/6c2f07dd82993565ab6536a30d2d6c04ab699086", - "reference": "6c2f07dd82993565ab6536a30d2d6c04ab699086", + "url": "https://api.github.com/repos/TECLIB/odtphp/zipball/c4e081136296beac75b6151abdfc5d5633479bb0", + "reference": "c4e081136296beac75b6151abdfc5d5633479bb0", "shasum": "" }, "require": { @@ -62,816 +62,245 @@ "support": { "source": "https://github.com/TECLIB/odtphp/tree/teclib" }, - "time": "2017-03-01T11:06:18+00:00" + "time": "2023-01-18T14:42:14+00:00" } ], "packages-dev": [ { - "name": "consolidation/annotated-command", - "version": "4.2.4", - "source": { - "type": "git", - "url": "https://github.com/consolidation/annotated-command.git", - "reference": "ec297e05cb86557671c2d6cbb1bebba6c7ae2c60" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/ec297e05cb86557671c2d6cbb1bebba6c7ae2c60", - "reference": "ec297e05cb86557671c2d6cbb1bebba6c7ae2c60", - "shasum": "" - }, - "require": { - "consolidation/output-formatters": "^4.1.1", - "php": ">=7.1.3", - "psr/log": "^1|^2", - "symfony/console": "^4.4.8|~5.1.0", - "symfony/event-dispatcher": "^4.4.8|^5", - "symfony/finder": "^4.4.8|^5" - }, - "require-dev": { - "phpunit/phpunit": ">=7.5.20", - "squizlabs/php_codesniffer": "^3", - "yoast/phpunit-polyfills": "^0.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "Consolidation\\AnnotatedCommand\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" - } - ], - "description": "Initialize Symfony Console commands from annotated command class methods.", - "support": { - "issues": "https://github.com/consolidation/annotated-command/issues", - "source": "https://github.com/consolidation/annotated-command/tree/4.2.4" - }, - "time": "2020-12-10T16:56:39+00:00" - }, - { - "name": "consolidation/config", - "version": "2.0.1", + "name": "glpi-project/tools", + "version": "0.7.1", "source": { "type": "git", - "url": "https://github.com/consolidation/config.git", - "reference": "9a2c2a7b2aea1b3525984a4378743a8b74c14e1c" + "url": "https://github.com/glpi-project/tools.git", + "reference": "4bc5a725d9f4da0ee946ad3cbdd54a782d2f40fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/9a2c2a7b2aea1b3525984a4378743a8b74c14e1c", - "reference": "9a2c2a7b2aea1b3525984a4378743a8b74c14e1c", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/4bc5a725d9f4da0ee946ad3cbdd54a782d2f40fb", + "reference": "4bc5a725d9f4da0ee946ad3cbdd54a782d2f40fb", "shasum": "" }, "require": { - "dflydev/dot-access-data": "^1.1.0", - "grasmash/expander": "^1", - "php": ">=7.1.3", - "psr/log": "^1.1", - "symfony/event-dispatcher": "^4||^5" + "symfony/console": "^5.4 || ^6.0", + "twig/twig": "^3.3" }, "require-dev": { - "phpunit/phpunit": ">=7.5.20", - "squizlabs/php_codesniffer": "^3", - "symfony/console": "^4||^5", - "symfony/yaml": "^4||^5", - "yoast/phpunit-polyfills": "^0.2.0" - }, - "suggest": { - "symfony/event-dispatcher": "Required to inject configuration into Command options", - "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Consolidation\\Config\\": "src" - } + "nikic/php-parser": "^4.13", + "phpstan/phpstan-src": "^1.10" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" - } + "bin": [ + "bin/extract-locales", + "bin/licence-headers-check", + "tools/plugin-release" ], - "description": "Provide configuration services for a commandline tool.", - "support": { - "issues": "https://github.com/consolidation/config/issues", - "source": "https://github.com/consolidation/config/tree/2.0.1" - }, - "time": "2020-12-06T00:03:30+00:00" - }, - { - "name": "consolidation/log", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/consolidation/log.git", - "reference": "82a2aaaa621a7b976e50a745a8d249d5085ee2b1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consolidation/log/zipball/82a2aaaa621a7b976e50a745a8d249d5085ee2b1", - "reference": "82a2aaaa621a7b976e50a745a8d249d5085ee2b1", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/log": "^1.0", - "symfony/console": "^4|^5" - }, - "require-dev": { - "phpunit/phpunit": ">=7.5.20", - "squizlabs/php_codesniffer": "^3", - "yoast/phpunit-polyfills": "^0.2.0" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, "autoload": { "psr-4": { - "Consolidation\\Log\\": "src" + "GlpiProject\\Tools\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-3.0-or-later" ], "authors": [ { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" - } - ], - "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "support": { - "issues": "https://github.com/consolidation/log/issues", - "source": "https://github.com/consolidation/log/tree/2.0.2" - }, - "time": "2020-12-10T16:26:23+00:00" - }, - { - "name": "consolidation/output-formatters", - "version": "4.1.2", - "source": { - "type": "git", - "url": "https://github.com/consolidation/output-formatters.git", - "reference": "5821e6ae076bf690058a4de6c94dce97398a69c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/5821e6ae076bf690058a4de6c94dce97398a69c9", - "reference": "5821e6ae076bf690058a4de6c94dce97398a69c9", - "shasum": "" - }, - "require": { - "dflydev/dot-access-data": "^1.1.0", - "php": ">=7.1.3", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.4.2", - "phpunit/phpunit": ">=7", - "squizlabs/php_codesniffer": "^3", - "symfony/var-dumper": "^4", - "symfony/yaml": "^4", - "yoast/phpunit-polyfills": "^0.2.0" - }, - "suggest": { - "symfony/var-dumper": "For using the var_dump formatter" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "Consolidation\\OutputFormatters\\": "src" + "name": "Teclib'", + "email": "glpi@teclib.com", + "homepage": "http://teclib-group.com" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "authors": [ - { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" - } + "description": "Various tools for GLPI and its plugins", + "keywords": [ + "glpi", + "plugins", + "tools" ], - "description": "Format text by applying transformations provided by plug-in formatters.", "support": { - "issues": "https://github.com/consolidation/output-formatters/issues", - "source": "https://github.com/consolidation/output-formatters/tree/4.1.2" + "issues": "https://github.com/glpi-project/tools/issues", + "source": "https://github.com/glpi-project/tools" }, - "time": "2020-12-12T19:04:59+00:00" + "time": "2023-10-16T11:40:35+00:00" }, { - "name": "consolidation/robo", - "version": "3.0.3", + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.2", "source": { "type": "git", - "url": "https://github.com/consolidation/Robo.git", - "reference": "734620ad3f9bb457fda1a52338b42439115cf941" + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/734620ad3f9bb457fda1a52338b42439115cf941", - "reference": "734620ad3f9bb457fda1a52338b42439115cf941", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", "shasum": "" }, "require": { - "consolidation/annotated-command": "^4.2.4", - "consolidation/config": "^1.2.1|^2.0.1", - "consolidation/log": "^1.1.1|^2.0.2", - "consolidation/output-formatters": "^4.1.2", - "consolidation/self-update": "^1.2", - "league/container": "^3.3.1", - "php": ">=7.1.3", - "symfony/console": "^4.4.19 || ^5", - "symfony/event-dispatcher": "^4.4.19 || ^5", - "symfony/filesystem": "^4.4.9 || ^5", - "symfony/finder": "^4.4.9 || ^5", - "symfony/process": "^4.4.9 || ^5", - "symfony/yaml": "^4.4 || ^5" + "ext-json": "*", + "php": ">=5.3.0" }, - "conflict": { - "codegyre/robo": "*" + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" }, "require-dev": { - "natxet/cssmin": "3.0.4", - "patchwork/jsqueeze": "^2", - "pear/archive_tar": "^1.4.4", - "phpunit/phpunit": "^7.5.20 | ^8", - "squizlabs/php_codesniffer": "^3", - "yoast/phpunit-polyfills": "^0.2.0" + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" }, "suggest": { - "natxet/cssmin": "For minifying CSS files in taskMinify", - "patchwork/jsqueeze": "For minifying JS files in taskMinify", - "pear/archive_tar": "Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.", - "totten/lurkerlite": "For monitoring filesystem changes in taskWatch" - }, - "bin": [ - "robo" - ], - "type": "library", - "extra": { - "scenarios": { - "symfony4": { - "require": { - "symfony/console": "^4.4.11", - "symfony/event-dispatcher": "^4.4.11", - "symfony/filesystem": "^4.4.11", - "symfony/finder": "^4.4.11", - "symfony/process": "^4.4.11", - "phpunit/phpunit": "^6", - "nikic/php-parser": "^2" - }, - "remove": [ - "codeception/phpunit-wrapper" - ], - "config": { - "platform": { - "php": "7.1.3" - } - } - } - }, - "branch-alias": { - "dev-master": "2.x-dev", - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Robo\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Davert", - "email": "davert.php@resend.cc" - } - ], - "description": "Modern task runner", - "support": { - "issues": "https://github.com/consolidation/Robo/issues", - "source": "https://github.com/consolidation/Robo/tree/3.0.3" - }, - "time": "2021-02-21T19:19:43+00:00" - }, - { - "name": "consolidation/self-update", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/consolidation/self-update.git", - "reference": "dba6b2c0708f20fa3ba8008a2353b637578849b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consolidation/self-update/zipball/dba6b2c0708f20fa3ba8008a2353b637578849b4", - "reference": "dba6b2c0708f20fa3ba8008a2353b637578849b4", - "shasum": "" - }, - "require": { - "php": ">=5.5.0", - "symfony/console": "^2.8|^3|^4|^5", - "symfony/filesystem": "^2.5|^3|^4|^5" + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" }, "bin": [ - "scripts/release" + "parallel-lint" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { - "psr-4": { - "SelfUpdate\\": "src" - } + "classmap": [ + "./src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "Alexander Menk", - "email": "menk@mestrona.net" - }, - { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" } ], - "description": "Provides a self:update command for Symfony Console applications.", + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", "support": { - "issues": "https://github.com/consolidation/self-update/issues", - "source": "https://github.com/consolidation/self-update/tree/1.2.0" + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" }, - "time": "2020-04-13T02:49:20+00:00" + "time": "2022-02-21T12:50:22+00:00" }, { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "name": "phpstan/extension-installer", + "version": "1.3.1", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0" }, "require-dev": { - "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" }, "type": "composer-plugin", "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "PHPStan\\ExtensionInstaller\\Plugin" }, "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2020-12-07T18:04:37+00:00" - }, - { - "name": "dflydev/dot-access-data", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a", - "reference": "3fbd874921ab2c041e899d044585a2ab9795df8a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "Dflydev\\DotAccessData": "src" + "PHPStan\\ExtensionInstaller\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" - }, - { - "name": "Carlos Frutos", - "email": "carlos@kiwing.it", - "homepage": "https://github.com/cfrutos" - } - ], - "description": "Given a deep data structure, access data by dot notation.", - "homepage": "https://github.com/dflydev/dflydev-dot-access-data", - "keywords": [ - "access", - "data", - "dot", - "notation" - ], + "description": "Composer plugin for automatic installation of PHPStan extensions", "support": { - "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", - "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/master" + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.3.1" }, - "time": "2017-01-20T21:14:22+00:00" + "time": "2023-05-24T08:59:17+00:00" }, { - "name": "glpi-project/coding-standard", - "version": "0.8", + "name": "phpstan/phpstan", + "version": "1.10.41", "source": { "type": "git", - "url": "https://github.com/glpi-project/coding-standard.git", - "reference": "a34ec2abf52e720ef700f59a91a4dde963b9f33e" + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c6174523c2a69231df55bdc65b61655e72876d76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/glpi-project/coding-standard/zipball/a34ec2abf52e720ef700f59a91a4dde963b9f33e", - "reference": "a34ec2abf52e720ef700f59a91a4dde963b9f33e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c6174523c2a69231df55bdc65b61655e72876d76", + "reference": "c6174523c2a69231df55bdc65b61655e72876d76", "shasum": "" }, "require": { - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5.5" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Teclib'", - "email": "glpi@teclib.com", - "homepage": "https://teclib.com" - } - ], - "description": "GLPI PHP CodeSniffer Coding Standard", - "keywords": [ - "codesniffer", - "glpi", - "phpcs" - ], - "support": { - "issues": "https://github.com/glpi-project/coding-standard/issues", - "source": "https://github.com/glpi-project/coding-standard" + "php": "^7.2|^8.0" }, - "time": "2020-06-03T08:54:27+00:00" - }, - { - "name": "glpi-project/tools", - "version": "0.1.16", - "source": { - "type": "git", - "url": "https://github.com/glpi-project/tools.git", - "reference": "218e67a88ed2f5db7085af80e39522a138a262d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/218e67a88ed2f5db7085af80e39522a138a262d8", - "reference": "218e67a88ed2f5db7085af80e39522a138a262d8", - "shasum": "" - }, - "require": { - "consolidation/robo": "^2.0 || ^3.0", - "glpi-project/coding-standard": "^0.8", - "symfony/console": "^4.4 || ^5.0" + "conflict": { + "phpstan/phpstan-shim": "*" }, "bin": [ - "bin/licence-headers-check", - "tools/extract_template.sh", - "tools/plugin-release" + "phpstan", + "phpstan.phar" ], "type": "library", "autoload": { - "psr-4": { - "Glpi\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Teclib'", - "email": "glpi@teclib.com", - "homepage": "http://teclib-group.com" - } - ], - "description": "Various tools for GLPI and its plugins", - "keywords": [ - "glpi", - "plugins", - "tools" - ], - "support": { - "issues": "https://github.com/glpi-project/tools/issues", - "source": "https://github.com/glpi-project/tools" - }, - "time": "2021-03-03T08:05:40+00:00" - }, - { - "name": "grasmash/expander", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/grasmash/expander.git", - "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/grasmash/expander/zipball/95d6037344a4be1dd5f8e0b0b2571a28c397578f", - "reference": "95d6037344a4be1dd5f8e0b0b2571a28c397578f", - "shasum": "" - }, - "require": { - "dflydev/dot-access-data": "^1.1.0", - "php": ">=5.4" - }, - "require-dev": { - "greg-1-anderson/composer-test-scenarios": "^1", - "phpunit/phpunit": "^4|^5.5.4", - "satooshi/php-coveralls": "^1.0.2|dev-master", - "squizlabs/php_codesniffer": "^2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Grasmash\\Expander\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Grasmick" - } - ], - "description": "Expands internal property references in PHP arrays file.", - "support": { - "issues": "https://github.com/grasmash/expander/issues", - "source": "https://github.com/grasmash/expander/tree/master" - }, - "time": "2017-12-21T22:14:55+00:00" - }, - { - "name": "league/container", - "version": "3.3.5", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/container.git", - "reference": "048ab87810f508dbedbcb7ae941b606eb8ee353b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/048ab87810f508dbedbcb7ae941b606eb8ee353b", - "reference": "048ab87810f508dbedbcb7ae941b606eb8ee353b", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/container": "^1.0.0 || ^2.0.0" - }, - "provide": { - "psr/container-implementation": "^1.0" - }, - "replace": { - "orno/di": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0", - "roave/security-advisories": "dev-master", - "scrutinizer/ocular": "^1.8", - "squizlabs/php_codesniffer": "^3.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Container\\": "src" - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Phil Bennett", - "email": "philipobenito@gmail.com", - "homepage": "http://www.philipobenito.com", - "role": "Developer" - } - ], - "description": "A fast and intuitive dependency injection container.", - "homepage": "https://github.com/thephpleague/container", + "description": "PHPStan - PHP Static Analysis Tool", "keywords": [ - "container", - "dependency", - "di", - "injection", - "league", - "provider", - "service" + "dev", + "static analysis" ], "support": { - "issues": "https://github.com/thephpleague/container/issues", - "source": "https://github.com/thephpleague/container/tree/3.3.5" + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { - "url": "https://github.com/philipobenito", + "url": "https://github.com/ondrejmirtes", "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" } ], - "time": "2021-03-16T09:42:56+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "0.4.9", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/98a088b17966bdf6ee25c8a4b634df313d8aa531", - "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "consistence/coding-standard": "^3.5", - "ergebnis/composer-normalize": "^2.0.2", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.26", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^4.7.2", - "symfony/process": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/master" - }, - "time": "2020-08-03T20:32:43+00:00" + "time": "2023-11-05T12:57:57+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -900,133 +329,22 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" - }, - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "slevomat/coding-standard", - "version": "6.4.1", - "source": { - "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "696dcca217d0c9da2c40d02731526c1e25b65346" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/696dcca217d0c9da2c40d02731526c1e25b65346", - "reference": "696dcca217d0c9da2c40d02731526c1e25b65346", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.1 || ^8.0", - "phpstan/phpdoc-parser": "0.4.5 - 0.4.9", - "squizlabs/php_codesniffer": "^3.5.6" - }, - "require-dev": { - "phing/phing": "2.16.3", - "php-parallel-lint/php-parallel-lint": "1.2.0", - "phpstan/phpstan": "0.12.48", - "phpstan/phpstan-deprecation-rules": "0.12.5", - "phpstan/phpstan-phpunit": "0.12.16", - "phpstan/phpstan-strict-rules": "0.12.5", - "phpunit/phpunit": "7.5.20|8.5.5|9.4.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "6.x-dev" - } - }, - "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/6.4.1" - }, - "funding": [ - { - "url": "https://github.com/kukulich", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" - } - ], - "time": "2020-10-05T12:39:37+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -1050,159 +368,81 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2021-04-09T00:54:41+00:00" - }, - { - "name": "symfony/console", - "version": "v4.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", - "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, + "BSD-3-Clause" + ], + "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Greg Sherwood", + "role": "lead" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], "support": { - "source": "https://github.com/symfony/console/tree/v4.4.21" + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-03-26T09:23:24+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v4.4.20", + "name": "symfony/console", + "version": "v5.4.28", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "c352647244bd376bf7d31efbd5401f13f50dad0c" + "url": "https://github.com/symfony/console.git", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c352647244bd376bf7d31efbd5401f13f50dad0c", - "reference": "c352647244bd376bf7d31efbd5401f13f50dad0c", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { - "symfony/dependency-injection": "<3.4" + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "Symfony\\Component\\Console\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1222,10 +462,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.20" + "source": "https://github.com/symfony/console/tree/v5.4.28" }, "funding": [ { @@ -1241,33 +487,29 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { - "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.9", + "name": "symfony/deprecation-contracts", + "version": "v2.5.2", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=7.1.3" - }, - "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -1275,9 +517,9 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } + "files": [ + "function.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1293,18 +535,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to dispatching event", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.9" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { @@ -1320,34 +554,48 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { - "name": "symfony/filesystem", - "version": "v4.4.21", + "name": "symfony/polyfill-ctype", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "940826c465be2690c9fae91b2793481e5cbd6834" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/940826c465be2690c9fae91b2793481e5cbd6834", - "reference": "940826c465be2690c9fae91b2793481e5cbd6834", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1355,18 +603,24 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides basic utilities for the filesystem", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.21" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1382,33 +636,45 @@ "type": "tidelift" } ], - "time": "2021-03-28T09:59:32+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/finder", - "version": "v4.4.20", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "2543795ab1570df588b9bbd31e1a2bd7037b94f6" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2543795ab1570df588b9bbd31e1a2bd7037b94f6", - "reference": "2543795ab1570df588b9bbd31e1a2bd7037b94f6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1416,18 +682,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Finds files and directories via an intuitive fluent interface", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.20" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -1443,32 +717,32 @@ "type": "tidelift" } ], - "time": "2021-02-12T10:48:09+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { "php": ">=7.1" }, "suggest": { - "ext-ctype": "For best performance" + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1476,11 +750,14 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1489,24 +766,26 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", + "intl", + "normalizer", "polyfill", - "portable" + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -1522,32 +801,35 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1555,12 +837,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1586,7 +868,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1602,20 +884,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.22.1", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -1624,7 +906,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1632,12 +914,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1665,7 +947,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -1681,20 +963,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1703,7 +985,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1711,12 +993,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1748,7 +1030,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1764,33 +1046,47 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/process", - "version": "v4.4.20", + "name": "symfony/service-contracts", + "version": "v2.5.2", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "7e950b6366d4da90292c2e7fa820b3c1842b965a" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/7e950b6366d4da90292c2e7fa820b3c1842b965a", - "reference": "7e950b6366d4da90292c2e7fa820b3c1842b965a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1798,18 +1094,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Executes commands in sub-processes", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "source": "https://github.com/symfony/process/tree/v4.4.20" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, "funding": [ { @@ -1825,43 +1129,50 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2022-05-30T19:17:29+00:00" }, { - "name": "symfony/service-contracts", - "version": "v1.1.9", + "name": "symfony/string", + "version": "v5.4.29", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" + "url": "https://github.com/symfony/string.git", + "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", + "url": "https://api.github.com/repos/symfony/string/zipball/e41bdc93def20eaf3bfc1537c4e0a2b0680a152d", + "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/container": "^1.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, - "suggest": { - "symfony/service-implementation": "" + "conflict": { + "symfony/translation-contracts": ">=3.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, + "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1877,18 +1188,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to writing services", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v1.1.9" + "source": "https://github.com/symfony/string/tree/v5.4.29" }, "funding": [ { @@ -1904,78 +1215,78 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2023-09-13T11:47:41+00:00" }, { - "name": "symfony/yaml", - "version": "v4.4.21", + "name": "twig/twig", + "version": "v3.7.1", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "3871c720871029f008928244e56cf43497da7e9d" + "url": "https://github.com/twigphp/Twig.git", + "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/3871c720871029f008928244e56cf43497da7e9d", - "reference": "3871c720871029f008928244e56cf43497da7e9d", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", + "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "psr/container": "^1.0|^2.0", + "symfony/phpunit-bridge": "^5.4.9|^6.3" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Twig\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.21" + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.7.1" }, "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, { "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/twig/twig", "type": "tidelift" } ], - "time": "2021-03-05T17:58:50+00:00" + "time": "2023-08-28T11:09:02+00:00" } ], "aliases": [], @@ -1986,11 +1297,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.2" + "php": ">=7.4" }, "platform-dev": [], "platform-overrides": { - "php": "7.2.0" + "php": "7.4.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.6.0" } diff --git a/css/mreporting.css b/css/mreporting.css index 997e0ee2..e202275c 100644 --- a/css/mreporting.css +++ b/css/mreporting.css @@ -1,3 +1,31 @@ +/*! + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + #fig { border:1px solid #E0E0E0; position:relative; @@ -73,32 +101,14 @@ width: auto; height: auto; min-height: 500px; - background: white; + display: flex; + flex-wrap: wrap; } .mreportingwidget { height: 441px; - width:461px; - border-color: #DDD; - border-style: solid; - border-width: 1px; - display:inline-block; - vertical-align: top; - margin: 2px 0 0 0; -} - -.mreportingwidget-header { - background-color: #EEE; - padding: 10px 0; -} - -.mreportingwidget-body { - bottom: 0px; - top: 0px; - left: 0px; - overflow-y: auto; - width: 461px; - height: 408px; + width: 561px; + margin: 30px 20px 0 0; } .m_left { @@ -113,14 +123,6 @@ clear: both; } -#dashboard button { - width: 20px; - height: 20px; -} -.mreportingwidget-header button { - margin-top: -5px; -} - #mreporting_central_dashboard iframe { width: 100%; border-width: 0 1px 1px 1px; @@ -149,52 +151,10 @@ select[name=graphmenu] option { z-index: 100; } -.add_report { - border: 3px solid #999; - float: right; - border-radius: 6px; - cursor: pointer; - height: 30px; - width: 30px; - background: #eeeeee; /* Old browsers */ - background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); /* IE10+ */ - background: linear-gradient(to bottom, #eeeeee 0%,#cccccc 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */ -} - -.add_report:hover { - background: #999; -} - -.add_report_helptext { - line-height: 30px; - margin-right: 5px; - display: none; -} - -.m_dashboard_controls:hover .add_report_helptext { - display: inline-block; -} - -.add_report i.fa { - text-align: center; - font-size: 2em; - padding-top: 4px; - width: 100%; -} - -.add_report:hover i.fa { - color: white; -} - .empty_dashboard { position: absolute; - right: 40px; - background: url(pics/howto_arrow.png) no-repeat right top; + right: 70px; + background: url("../pics/howto_arrow.png") no-repeat right top; z-index: 50; } diff --git a/front/central.php b/front/central.php index 6a5a22ed..3e89827e 100644 --- a/front/central.php +++ b/front/central.php @@ -1,33 +1,34 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); Session::checkLoginUser(); Html::header(__("More Reporting", 'mreporting'), '', 'tools', 'PluginMreportingCommon', 'dashboard_list'); @@ -37,47 +38,46 @@ $reports = $common->getAllReports(); $tabs = []; foreach ($reports as $classname => $report) { - - $tabs[$classname]=['title'=>$report['title'], - 'url'=>Plugin::getWebDir('mreporting')."/ajax/common.tabs.php", - 'params'=>"target=".$_SERVER['PHP_SELF']."&classname=$classname"]; + $tabs[$classname] = ['title' => $report['title'], + 'url' => Plugin::getWebDir('mreporting') . "/ajax/common.tabs.php", + 'params' => "target=" . $_SERVER['PHP_SELF'] . "&classname=$classname" + ]; } if (count($tabs) > 0) { //foreach tabs - foreach ($tabs as $tab) { - global $DB; - $params = (isset($tab['params'])?$tab['params']:''); - //we get the classname - $classname = str_replace("target=".$_SERVER['PHP_SELF']."&classname=", '', $params); - - //we found all reports for classname where current profil have right - $query = "SELECT * + foreach ($tabs as $tab) { + global $DB; + $params = (isset($tab['params']) ? $tab['params'] : ''); + //we get the classname + $classname = str_replace("target=" . $_SERVER['PHP_SELF'] . "&classname=", '', $params); + + //we found all reports for classname where current profil have right + $query = "SELECT * FROM `glpi_plugin_mreporting_configs`,`glpi_plugin_mreporting_profiles` WHERE `glpi_plugin_mreporting_configs`.`id` = `glpi_plugin_mreporting_profiles`.`reports` AND `glpi_plugin_mreporting_configs`.`classname` = '$classname' - AND `glpi_plugin_mreporting_profiles`.`right` = ".READ." - AND `glpi_plugin_mreporting_profiles`.`profiles_id` = ".$_SESSION['glpiactiveprofile']['id']; - - //for this classname if current user have no right on any reports - if ($result = $DB->query($query)) { - if ($DB->numrows($result) == 0) { - //we unset the index - unset($tabs[$classname]); - } - } - } + AND `glpi_plugin_mreporting_profiles`.`right` = " . READ . " + AND `glpi_plugin_mreporting_profiles`.`profiles_id` = " . $_SESSION['glpiactiveprofile']['id']; + + //for this classname if current user have no right on any reports + if ($result = $DB->query($query)) { + if ($DB->numrows($result) == 0) { + //we unset the index + unset($tabs[$classname]); + } + } + } //finally if tabs is empty - if (empty($tabs)) { - echo "

".__("No report is available !", 'mreporting')."
"; - } else { - echo "
"; - Ajax::createTabs('tabspanel', 'tabcontent', $tabs, 'PluginMreportingCommon'); - } - + if (empty($tabs)) { + echo "

" . __("No report is available !", 'mreporting') . "
"; + } else { + echo "
"; + Ajax::createTabs('tabspanel', 'tabcontent', $tabs, 'PluginMreportingCommon'); + } } else { - echo "

".__("No report is available !", 'mreporting')."
"; + echo "

" . __("No report is available !", 'mreporting') . "
"; } Html::footer(); diff --git a/front/config.form.php b/front/config.form.php index ff4daaa0..fe903589 100644 --- a/front/config.form.php +++ b/front/config.form.php @@ -1,68 +1,65 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); Session::checkRight("config", UPDATE); if (!isset($_GET["id"])) { - $_GET["id"] = 0; + $_GET["id"] = 0; } if (!isset($_GET["preconfig"])) { - $_GET["preconfig"] = -1; + $_GET["preconfig"] = -1; } -$config= new PluginMreportingConfig(); +$config = new PluginMreportingConfig(); if (isset($_POST["add"])) { - $newID=$config->add($_POST); + $newID = $config->add($_POST); Html::back(); - } else if (isset($_POST["update"])) { $config->update($_POST); Html::back(); - } else if (isset($_POST["delete"])) { $config->delete($_POST, 1); Html::redirect("./config.form.php"); - } else { Html::header(__("More Reporting", 'mreporting'), '', 'tools', 'PluginMreportingCommon', 'config'); //Link from graph - if (isset($_GET["name"]) && isset($_GET["classname"])) { - if ($config->getFromDBByFunctionAndClassname($_GET["name"], $_GET["classname"])) { - $_GET["id"] = $config->fields['id']; - } - } - $config->display($_GET); + if (isset($_GET["name"]) && isset($_GET["classname"])) { + if ($config->getFromDBByFunctionAndClassname($_GET["name"], $_GET["classname"])) { + $_GET["id"] = $config->fields['id']; + } + } + $config->display($_GET); Html::footer(); - } diff --git a/front/config.php b/front/config.php index a2f66022..f9a0dc43 100644 --- a/front/config.php +++ b/front/config.php @@ -1,58 +1,55 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); + +include("../../../inc/includes.php"); Session::checkRight("config", UPDATE); $plugin = new Plugin(); if ($plugin->isActivated("mreporting")) { - //Create first config for graphs - if (isset($_GET["new"])) { - - $config= new PluginMreportingConfig(); - $config->createFirstConfig(); - Html::back(); - - } else { - - Html::header(__("More Reporting", 'mreporting'), '', 'tools', 'PluginMreportingCommon', 'config'); - - PluginMreportingConfig::addFirstconfigLink(); - Search::show("PluginMreportingConfig"); - } - + if (isset($_GET["new"])) { + $config = new PluginMreportingConfig(); + $config->createFirstConfig(); + Html::back(); + } else { + Html::header(__("More Reporting", 'mreporting'), '', 'tools', 'PluginMreportingCommon', 'config'); + + PluginMreportingConfig::addFirstconfigLink(); + Search::show("PluginMreportingConfig"); + } } else { Html::header(__("Setup"), '', "config", "plugins"); echo "
"; echo "

"; - echo "\"warning\""; + echo "\"warning\""; echo "

"; echo "Please activate the plugin
"; } diff --git a/front/dashboard.form.php b/front/dashboard.form.php index 39045637..17c3d3c9 100644 --- a/front/dashboard.form.php +++ b/front/dashboard.form.php @@ -1,51 +1,74 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + if (!isset($_POST['saveConfig']) && !isset($_POST['addReports'])) { - $USEDBREPLICATE = 1; + $USEDBREPLICATE = 1; } $DBCONNECTION_REQUIRED = 0; // Not really a big SQL request -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); Session::checkLoginUser(); if (isset($_POST['saveConfig'])) { + PluginMreportingCommon::saveSelectors($_POST['f_name']); - PluginMreportingCommon::saveSelectors($_POST['f_name']); - - $_REQUEST['f_name'] = $_POST['f_name']; - $_REQUEST['short_classname'] = $_POST['short_classname']; - PluginMreportingCommon::getSelectorValuesByUser(); - - Html::back(); + $_REQUEST['f_name'] = $_POST['f_name']; + $_REQUEST['short_classname'] = $_POST['short_classname']; + PluginMreportingCommon::getSelectorValuesByUser(); + Html::back(); } else if (isset($_POST['addReports'])) { + $dashboard = new PluginMreportingDashboard(); + $post = ['users_id' => $_SESSION['glpiID'], 'reports_id' => $_POST['report']]; + $dashboard->add($post); - $dashboard = new PluginMreportingDashboard(); - $post = ['users_id' => $_SESSION['glpiID'], 'reports_id' => $_POST['report']]; - $dashboard->add($post); - - Html::back(); - + Html::back(); } else { + if ($_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { + Html::helpHeader( + __("More Reporting", 'mreporting'), + $_SERVER['PHP_SELF'] + ); + } else { + Html::header( + __("More Reporting", 'mreporting'), + $_SERVER['PHP_SELF'], + 'tools', + 'PluginMreportingCommon', + 'dashboard' + ); + } + + $dashboard = new PluginMreportingDashboard(); + $dashboard->showDashBoard(); - if ($_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { - Html::helpHeader( - __("More Reporting", 'mreporting'), - $_SERVER['PHP_SELF'] - ); - } else { - Html::header( - __("More Reporting", 'mreporting'), - $_SERVER['PHP_SELF'], - 'tools', - 'PluginMreportingCommon', - 'dashboard' - ); - } - - $dashboard = new PluginMreportingDashboard(); - $dashboard->showDashBoard(); - - Html::footer(); + Html::footer(); } diff --git a/front/dashboard.php b/front/dashboard.php index 92d580b2..1542b3d1 100644 --- a/front/dashboard.php +++ b/front/dashboard.php @@ -1,2 +1,31 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +require_once "dashboard.form.php"; diff --git a/front/export.php b/front/export.php index c1debe4f..75862c5f 100644 --- a/front/export.php +++ b/front/export.php @@ -1,36 +1,37 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ $USEDBREPLICATE = 1; $DBCONNECTION_REQUIRED = 0; // Not really a big SQL request -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); Session::checkLoginUser(); diff --git a/front/export_svg.php b/front/export_svg.php index 55b78c56..37b3cdf3 100644 --- a/front/export_svg.php +++ b/front/export_svg.php @@ -1,5 +1,34 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +include("../../../inc/includes.php"); header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL diff --git a/front/graph.php b/front/graph.php index fa54f46b..3d109b7f 100644 --- a/front/graph.php +++ b/front/graph.php @@ -1,38 +1,39 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ if (!isset($_REQUEST['submit']) && !isset($_REQUEST['reset'])) { - $USEDBREPLICATE = 1; + $USEDBREPLICATE = 1; } $DBCONNECTION_REQUIRED = 0; // Not really a big SQL request -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); Session::checkLoginUser(); diff --git a/front/index.php b/front/index.php index c1207189..cba90a95 100644 --- a/front/index.php +++ b/front/index.php @@ -1,2 +1,31 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + header('Location: central.php'); diff --git a/front/popup.php b/front/popup.php index 448aec96..f530348f 100644 --- a/front/popup.php +++ b/front/popup.php @@ -1,38 +1,39 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); +include("../../../inc/includes.php"); Session::checkLoginUser(); if (isset($_GET["classname"])) { - $_POST["classname"] = $_GET["classname"]; + $_POST["classname"] = $_GET["classname"]; } Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); @@ -42,6 +43,6 @@ echo "
"; echo "
"; -echo "".__("Back").""; +echo "" . __("Back") . ""; echo "
"; Html::popFooter(); diff --git a/front/preference.form.php b/front/preference.form.php index b7009d67..b15f8885 100644 --- a/front/preference.form.php +++ b/front/preference.form.php @@ -1,50 +1,50 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -include ("../../../inc/includes.php"); + +include("../../../inc/includes.php"); Session::checkLoginUser(); -if (!isset ($_GET["id"])) { - $_GET["id"] = ""; +if (!isset($_GET["id"])) { + $_GET["id"] = ""; } $pref = new PluginMreportingPreference(); if (isset($_POST["update"])) { - - $pref->update($_POST); - Html::back(); - + $pref->update($_POST); + Html::back(); } else { - Html::header(__("More Reporting", 'mreporting'), '', 'tools', 'PluginMreportingCommon', 'viewreports'); + Html::header(__("More Reporting", 'mreporting'), '', 'tools', 'PluginMreportingCommon', 'viewreports'); - $pref->showForm("./preference.form.php", $_GET["id"]); + $pref->showForm($_GET["id"]); - Html::footer(); + Html::footer(); } diff --git a/front/profile.form.php b/front/profile.form.php index 9ebe61db..18f433bb 100644 --- a/front/profile.form.php +++ b/front/profile.form.php @@ -1,5 +1,34 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +include("../../../inc/includes.php"); Session::checkRight("profile", READ); @@ -8,95 +37,89 @@ $profil = new PluginMreportingProfile(); //Save profile -if (isset ($_REQUEST['update'])) { - foreach ($res as $report) { - if (class_exists($report['classname'])) { - $access = $_REQUEST[$report['id']]; - - $profil->getFromDBByCrit( - [ - 'profiles_id' => $_REQUEST['profile_id'], - 'reports' => $report['id'], - ] - ); - $profil->fields['right'] = $access; - $profil->update($profil->fields); - } - } +if (isset($_REQUEST['update'])) { + foreach ($res as $report) { + if (class_exists($report['classname'])) { + $access = $_REQUEST[$report['id']]; -} else if (isset ($_REQUEST['add'])) { - $query = "SELECT `id`, `name` + $profil->getFromDBByCrit( + [ + 'profiles_id' => $_REQUEST['profile_id'], + 'reports' => $report['id'], + ] + ); + $profil->fields['right'] = $access; + $profil->update($profil->fields); + } + } +} else if (isset($_REQUEST['add'])) { + $query = "SELECT `id`, `name` FROM `glpi_profiles` WHERE `interface` = 'central' ORDER BY `name`"; - foreach ($DB->request($query) as $profile) { - $access = $_REQUEST[$profile['id']]; - - $profil->getFromDBByCrit( - [ - 'profiles_id' => $profile['id'], - 'reports' => $_REQUEST['report_id'], - ] - ); - $profil->fields['right'] = $access; - $profil->update($profil->fields); - } + foreach ($DB->request($query) as $profile) { + $access = $_REQUEST[$profile['id']]; + $profil->getFromDBByCrit( + [ + 'profiles_id' => $profile['id'], + 'reports' => $_REQUEST['report_id'], + ] + ); + $profil->fields['right'] = $access; + $profil->update($profil->fields); + } } else if (isset($_REQUEST['giveReadAccessForAllReport'])) { - foreach ($res as $report) { - $profil->getFromDBByCrit( - [ - 'profiles_id' => $_REQUEST['profile_id'], - 'reports' => $report['id'], - ] - ); - $profil->fields['right'] = READ; - $profil->update($profil->fields); - } - + foreach ($res as $report) { + $profil->getFromDBByCrit( + [ + 'profiles_id' => $_REQUEST['profile_id'], + 'reports' => $report['id'], + ] + ); + $profil->fields['right'] = READ; + $profil->update($profil->fields); + } } else if (isset($_REQUEST['giveNoneAccessForAllReport'])) { - foreach ($res as $report) { - $profil->getFromDBByCrit( - [ - 'profiles_id' => $_REQUEST['profile_id'], - 'reports' => $report['id'], - ] - ); - $profil->fields['right'] = 'NULL'; - $profil->update($profil->fields); - } - + foreach ($res as $report) { + $profil->getFromDBByCrit( + [ + 'profiles_id' => $_REQUEST['profile_id'], + 'reports' => $report['id'], + ] + ); + $profil->fields['right'] = 'NULL'; + $profil->update($profil->fields); + } } else if (isset($_REQUEST['giveNoneAccessForAllProfile'])) { - $query = "SELECT `id`, `name` + $query = "SELECT `id`, `name` FROM `glpi_profiles` ORDER BY `name`"; - foreach ($DB->request($query) as $profile) { - $profil->getFromDBByCrit( - [ - 'profiles_id' => $profile['id'], - 'reports' => $_REQUEST['report_id'], - ] - ); - $profil->fields['right'] = 'NULL'; - $profil->update($profil->fields); - } - + foreach ($DB->request($query) as $profile) { + $profil->getFromDBByCrit( + [ + 'profiles_id' => $profile['id'], + 'reports' => $_REQUEST['report_id'], + ] + ); + $profil->fields['right'] = 'NULL'; + $profil->update($profil->fields); + } } else if (isset($_REQUEST['giveReadAccessForAllProfile'])) { - $query = "SELECT `id`, `name` + $query = "SELECT `id`, `name` FROM `glpi_profiles` ORDER BY `name`"; - foreach ($DB->request($query) as $profile) { - $profil->getFromDBByCrit( - [ - 'profiles_id' => $profile['id'], - 'reports' => $_REQUEST['report_id'], - ] - ); - $profil->fields['right'] = READ; - $profil->update($profil->fields); - } - + foreach ($DB->request($query) as $profile) { + $profil->getFromDBByCrit( + [ + 'profiles_id' => $profile['id'], + 'reports' => $_REQUEST['report_id'], + ] + ); + $profil->fields['right'] = READ; + $profil->update($profil->fields); + } } Html::back(); diff --git a/hook.php b/hook.php index 187cdc61..9b43c789 100644 --- a/hook.php +++ b/hook.php @@ -1,30 +1,31 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ /** @@ -32,18 +33,23 @@ * * @return boolean */ -function plugin_mreporting_install() { - global $DB; +function plugin_mreporting_install() +{ + global $DB; + + $version = plugin_version_mreporting(); + $migration = new Migration($version['version']); - $version = plugin_version_mreporting(); - $migration = new Migration($version['version']); + include_once(Plugin::getPhpDir('mreporting') . "/inc/profile.class.php"); - include_once(Plugin::getPhpDir('mreporting')."/inc/profile.class.php"); + $default_charset = DBConnection::getDefaultCharset(); + $default_collation = DBConnection::getDefaultCollation(); + $default_key_sign = DBConnection::getDefaultPrimaryKeySignOption(); //create profiles table - $queries = []; - $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_profiles` ( - `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + $queries = []; + $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_profiles` ( + `id` INT {$default_key_sign} NOT NULL AUTO_INCREMENT, `profiles_id` VARCHAR(45) NOT NULL, `reports` CHAR(1), PRIMARY KEY (`id`), @@ -53,148 +59,162 @@ function plugin_mreporting_install() { //create configuration table $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_configs` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(255) collate utf8_unicode_ci default NULL, - `classname` varchar(255) collate utf8_unicode_ci default NULL, - `is_active` tinyint(1) NOT NULL default '0', - `is_notified` tinyint(1) NOT NULL default '1', - `show_graph` tinyint(1) NOT NULL default '0', - `show_area` tinyint(1) NOT NULL default '0', - `spline` tinyint(1) NOT NULL default '0', + `id` int {$default_key_sign} NOT NULL auto_increment, + `name` varchar(255) default NULL, + `classname` varchar(255) default NULL, + `is_active` tinyint NOT NULL default '0', + `is_notified` tinyint NOT NULL default '1', + `show_graph` tinyint NOT NULL default '0', + `show_area` tinyint NOT NULL default '0', + `spline` tinyint NOT NULL default '0', `show_label` VARCHAR(10) default NULL, - `flip_data` tinyint(1) NOT NULL default '0', + `flip_data` tinyint NOT NULL default '0', `unit` VARCHAR(10) default NULL, `default_delay` VARCHAR(10) default NULL, `condition` VARCHAR(255) default NULL, `graphtype` VARCHAR(255) default 'SVG', PRIMARY KEY (`id`), KEY `is_active` (`is_active`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; + ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; //create configuration table $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_dashboards` ( - `id` int(11) NOT NULL auto_increment, - `users_id` int(11) NOT NULL, - `reports_id`int(11) NOT NULL, + `id` int {$default_key_sign} NOT NULL auto_increment, + `users_id` int {$default_key_sign} NOT NULL, + `reports_id`int {$default_key_sign} NOT NULL, `configuration` VARCHAR(500) default NULL, PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; + ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; - $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_preferences` ( - `id` int(11) NOT NULL auto_increment, - `users_id` int(11) NOT NULL default 0, - `template` varchar(255) collate utf8_unicode_ci default NULL, + $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_preferences` ( + `id` int {$default_key_sign} NOT NULL auto_increment, + `users_id` int {$default_key_sign} NOT NULL default 0, + `template` varchar(255) default NULL, PRIMARY KEY (`id`), KEY `users_id` (`users_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; + ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; // add display preferences - $query_display_pref = "SELECT id + $query_display_pref = "SELECT id FROM glpi_displaypreferences WHERE itemtype = 'PluginMreportingConfig'"; - $res_display_pref = $DB->query($query_display_pref); - if ($DB->numrows($res_display_pref) == 0) { - $queries[] = "INSERT INTO `glpi_displaypreferences` + $res_display_pref = $DB->query($query_display_pref); + if ($DB->numrows($res_display_pref) == 0) { + $queries[] = "INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginMreportingConfig','2','2','0');"; - $queries[] = "INSERT INTO `glpi_displaypreferences` + $queries[] = "INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginMreportingConfig','3','3','0');"; - $queries[] = "INSERT INTO `glpi_displaypreferences` + $queries[] = "INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginMreportingConfig','4','4','0');"; - $queries[] = "INSERT INTO `glpi_displaypreferences` + $queries[] = "INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginMreportingConfig','5','5','0');"; - $queries[] = "INSERT INTO `glpi_displaypreferences` + $queries[] = "INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginMreportingConfig','6','6','0');"; - $queries[] = "INSERT INTO `glpi_displaypreferences` + $queries[] = "INSERT INTO `glpi_displaypreferences` VALUES (NULL,'PluginMreportingConfig','8','8','0');"; - } + } $queries[] = "CREATE TABLE IF NOT EXISTS `glpi_plugin_mreporting_notifications` ( - `id` int(11) NOT NULL auto_increment, - `entities_id` int(11) NOT NULL default '0', - `is_recursive` tinyint(1) NOT NULL default '0', - `name` varchar(255) collate utf8_unicode_ci default NULL, - `notepad` longtext collate utf8_unicode_ci, + `id` int {$default_key_sign} NOT NULL auto_increment, + `entities_id` int {$default_key_sign} NOT NULL default '0', + `is_recursive` tinyint NOT NULL default '0', + `name` varchar(255) default NULL, + `notepad` longtext, `date_envoie` DATE DEFAULT NULL, - `notice`INT(11) NOT NULL DEFAULT 0, - `alert` INT(11) NOT NULL DEFAULT 0, - `comment` text collate utf8_unicode_ci, + `notice` INT {$default_key_sign} NOT NULL DEFAULT 0, + `alert` INT {$default_key_sign} NOT NULL DEFAULT 0, + `comment` text, `date_mod` timestamp NULL default NULL, - `is_deleted` tinyint(1) NOT NULL default '0', + `is_deleted` tinyint NOT NULL default '0', PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; + ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; - foreach ($queries as $query) { - $DB->query($query); - } + foreach ($queries as $query) { + $DB->query($query); + } // == Update to 2.1 == - $migration->addField('glpi_plugin_mreporting_configs', 'is_notified', - 'tinyint(1) NOT NULL default "1"', ['after' => 'is_active']); - $migration->migrationOneTable('glpi_plugin_mreporting_configs'); + $migration->addField( + 'glpi_plugin_mreporting_configs', + 'is_notified', + 'tinyint NOT NULL default "1"', + ['after' => 'is_active'] + ); + $migration->migrationOneTable('glpi_plugin_mreporting_configs'); // == Update to 2.3 == - if (!$DB->fieldExists('glpi_plugin_mreporting_profiles', 'right') - && $DB->fieldExists('glpi_plugin_mreporting_profiles', 'reports')) { - //save all profile with right READ - $right = PluginMreportingProfile::getRight(); - - //truncate profile table - $query = "TRUNCATE TABLE `glpi_plugin_mreporting_profiles`"; - $DB->query($query); - - //migration of field - $migration->addField('glpi_plugin_mreporting_profiles', 'right', 'char'); - $migration->changeField('glpi_plugin_mreporting_profiles', 'reports', - 'reports', 'integer'); - $migration->changeField('glpi_plugin_mreporting_profiles', 'profiles_id', - 'profiles_id', 'integer'); - $migration->dropField('glpi_plugin_mreporting_profiles', 'config'); - - $migration->migrationOneTable('glpi_plugin_mreporting_profiles'); - } + if ( + !$DB->fieldExists('glpi_plugin_mreporting_profiles', 'right') + && $DB->fieldExists('glpi_plugin_mreporting_profiles', 'reports') + ) { + //save all profile with right READ + $right = PluginMreportingProfile::getRight(); + + //truncate profile table + $query = "TRUNCATE TABLE `glpi_plugin_mreporting_profiles`"; + $DB->query($query); + + //migration of field + $migration->addField('glpi_plugin_mreporting_profiles', 'right', 'char'); + $migration->changeField( + 'glpi_plugin_mreporting_profiles', + 'reports', + 'reports', + 'integer' + ); + $migration->changeField( + 'glpi_plugin_mreporting_profiles', + 'profiles_id', + 'profiles_id', + "int {$default_key_sign} NOT NULL default 0" + ); + $migration->dropField('glpi_plugin_mreporting_profiles', 'config'); + + $migration->migrationOneTable('glpi_plugin_mreporting_profiles'); + } // == UPDATE to 0.84+1.0 == - $query = "UPDATE `glpi_plugin_mreporting_profiles` pr SET pr.right = ".READ." WHERE pr.right = 'r'"; - $DB->query($query); - if (!isIndex('glpi_plugin_mreporting_profiles', 'profiles_id_reports')) { - $query = "ALTER TABLE glpi_plugin_mreporting_profiles + $query = "UPDATE `glpi_plugin_mreporting_profiles` pr SET pr.right = " . READ . " WHERE pr.right = 'r'"; + $DB->query($query); + if (!isIndex('glpi_plugin_mreporting_profiles', 'profiles_id_reports')) { + $query = "ALTER TABLE glpi_plugin_mreporting_profiles ADD UNIQUE INDEX `profiles_id_reports` (`profiles_id`, `reports`)"; - $DB->query($query); - } + $DB->query($query); + } // Remove GLPI graphtype to fix compatibility with GLPI 9.2.2+ - $query = "UPDATE `glpi_plugin_mreporting_configs` SET `graphtype` = 'SVG' WHERE `graphtype` = 'GLPI'"; - $DB->query($query); + $query = "UPDATE `glpi_plugin_mreporting_configs` SET `graphtype` = 'SVG' WHERE `graphtype` = 'GLPI'"; + $DB->query($query); //== Create directories - $rep_files_mreporting = GLPI_PLUGIN_DOC_DIR."/mreporting"; - if (!is_dir($rep_files_mreporting)) { - mkdir($rep_files_mreporting); - } - $notifications_folder = GLPI_PLUGIN_DOC_DIR."/mreporting/notifications"; - if (!is_dir($notifications_folder)) { - mkdir($notifications_folder); - } + $rep_files_mreporting = GLPI_PLUGIN_DOC_DIR . "/mreporting"; + if (!is_dir($rep_files_mreporting)) { + mkdir($rep_files_mreporting); + } + $notifications_folder = GLPI_PLUGIN_DOC_DIR . "/mreporting/notifications"; + if (!is_dir($notifications_folder)) { + mkdir($notifications_folder); + } // == Install notifications - require_once "inc/notification.class.php"; - PluginMreportingNotification::install($migration); - CronTask::Register('PluginMreportingNotification', 'SendNotifications', MONTH_TIMESTAMP); + require_once "inc/notification.class.php"; + PluginMreportingNotification::install($migration); + CronTask::Register('PluginMreportingNotification', 'SendNotifications', MONTH_TIMESTAMP); - $migration->addField("glpi_plugin_mreporting_preferences", "selectors", "text"); - $migration->migrationOneTable('glpi_plugin_mreporting_preferences'); + $migration->addField("glpi_plugin_mreporting_preferences", "selectors", "text"); + $migration->migrationOneTable('glpi_plugin_mreporting_preferences'); // == Init available reports - require_once "inc/baseclass.class.php"; - require_once "inc/common.class.php"; - require_once "inc/config.class.php"; - $config = new PluginMreportingConfig(); - $config->createFirstConfig(); + require_once "inc/baseclass.class.php"; + require_once "inc/common.class.php"; + require_once "inc/config.class.php"; + $config = new PluginMreportingConfig(); + $config->createFirstConfig(); - PluginMreportingProfile::addRightToAllProfiles(); - PluginMreportingProfile::addRightToProfile($_SESSION['glpiactiveprofile']['id']); + PluginMreportingProfile::addRightToAllProfiles(); + PluginMreportingProfile::addRightToProfile($_SESSION['glpiactiveprofile']['id']); - return true; + return true; } /** @@ -202,158 +222,161 @@ function plugin_mreporting_install() { * * @return boolean */ -function plugin_mreporting_uninstall() { - global $DB; +function plugin_mreporting_uninstall() +{ + global $DB; - $migration = new Migration("2.3.0"); - $tables = ["glpi_plugin_mreporting_profiles", - "glpi_plugin_mreporting_configs", - "glpi_plugin_mreporting_preferences", - "glpi_plugin_mreporting_notifications", - "glpi_plugin_mreporting_dashboards" - ]; + $migration = new Migration("2.3.0"); + $tables = ["glpi_plugin_mreporting_profiles", + "glpi_plugin_mreporting_configs", + "glpi_plugin_mreporting_preferences", + "glpi_plugin_mreporting_notifications", + "glpi_plugin_mreporting_dashboards" + ]; - foreach ($tables as $table) { - $migration->dropTable($table); - } + foreach ($tables as $table) { + $migration->dropTable($table); + } - Toolbox::deleteDir(GLPI_PLUGIN_DOC_DIR."/mreporting/notifications"); - Toolbox::deleteDir(GLPI_PLUGIN_DOC_DIR."/mreporting"); + Toolbox::deleteDir(GLPI_PLUGIN_DOC_DIR . "/mreporting/notifications"); + Toolbox::deleteDir(GLPI_PLUGIN_DOC_DIR . "/mreporting"); - $objects = ["DisplayPreference", "SavedSearch"]; + $objects = ["DisplayPreference", "SavedSearch"]; - foreach ($objects as $object) { - $obj = new $object(); - $obj->deleteByCriteria(['itemtype' => 'PluginMreportingConfig']); - } + foreach ($objects as $object) { + $obj = new $object(); + $obj->deleteByCriteria(['itemtype' => 'PluginMreportingConfig']); + } - require_once "inc/notification.class.php"; - PluginMreportingNotification::uninstall(); + require_once "inc/notification.class.php"; + PluginMreportingNotification::uninstall(); - return true; + return true; } // Define dropdown relations -function plugin_mreporting_getDatabaseRelations() { - - $plugin = new Plugin(); - if ($plugin->isActivated("mreporting")) { - return ["glpi_profiles" => ["glpi_plugin_mreporting_profiles" => "profiles_id"]]; - } else { - return []; - } +function plugin_mreporting_getDatabaseRelations() +{ + + $plugin = new Plugin(); + if ($plugin->isActivated("mreporting")) { + return ["glpi_profiles" => ["glpi_plugin_mreporting_profiles" => "profiles_id"]]; + } else { + return []; + } } -function plugin_mreporting_giveItem($type, $ID, $data, $num) { - global $LANG; - - $searchopt=&Search::getOptions($type); - $table=$searchopt[$ID]["table"]; - $field=$searchopt[$ID]["field"]; - - $output_type=Search::HTML_OUTPUT; - if (isset($_GET['display_type'])) { - $output_type=$_GET['display_type']; - } - - switch ($type) { - - case 'PluginMreportingConfig': - - switch ($table.'.'.$field) { - case "glpi_plugin_mreporting_configs.show_label": - $out = ' '; - if (!empty($data['raw']["ITEM_$num"])) { - $out=PluginMreportingConfig::getLabelTypeName($data['raw']["ITEM_$num"]); - } - return $out; - break; - case "glpi_plugin_mreporting_configs.name": - $out = ' '; - if (!empty($data['raw']["ITEM_$num"])) { - $title_func = ''; - $short_classname = ''; - $f_name = ''; - - $inc_dir = Plugin::getPhpDir('mreporting')."/inc"; - //parse inc dir to search report classes - $classes = PluginMreportingCommon::parseAllClasses($inc_dir); - - foreach ($classes as $classname) { - if (!class_exists($classname)) { - continue; - } - $functions = get_class_methods($classname); - - foreach ($functions as $funct_name) { - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); - if ($ex_func[0] != 'report') { - continue; +function plugin_mreporting_giveItem($type, $ID, $data, $num) +{ + global $LANG; + + $searchopt=&Search::getOptions($type); + $table = $searchopt[$ID]["table"]; + $field = $searchopt[$ID]["field"]; + + $output_type = Search::HTML_OUTPUT; + if (isset($_GET['display_type'])) { + $output_type = $_GET['display_type']; + } + + switch ($type) { + case 'PluginMreportingConfig': + switch ($table . '.' . $field) { + case "glpi_plugin_mreporting_configs.show_label": + $out = ' '; + if (!empty($data['raw']["ITEM_$num"])) { + $out = PluginMreportingConfig::getLabelTypeName($data['raw']["ITEM_$num"]); + } + return $out; + break; + case "glpi_plugin_mreporting_configs.name": + $out = ' '; + if (!empty($data['raw']["ITEM_$num"])) { + $title_func = ''; + $short_classname = ''; + $f_name = ''; + + $inc_dir = Plugin::getPhpDir('mreporting') . "/inc"; + //parse inc dir to search report classes + $classes = PluginMreportingCommon::parseAllClasses($inc_dir); + + foreach ($classes as $classname) { + if (!class_exists($classname)) { + continue; + } + $functions = get_class_methods($classname); + + foreach ($functions as $funct_name) { + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); + if ($ex_func[0] != 'report') { + continue; + } + + $gtype = strtolower($ex_func[1]); + + if ($data['raw']["ITEM_$num"] == $funct_name) { + if (!empty($classname) && !empty($funct_name)) { + $short_classname = str_replace('PluginMreporting', '', $classname); + if (isset($LANG['plugin_mreporting'][$short_classname][$funct_name]['title'])) { + $title_func = $LANG['plugin_mreporting'][$short_classname][$funct_name]['title']; + } + } + } + } } - - $gtype = strtolower($ex_func[1]); - - if ($data['raw']["ITEM_$num"] == $funct_name) { - if (!empty($classname) && !empty($funct_name)) { - $short_classname = str_replace('PluginMreporting', '', $classname); - if (isset($LANG['plugin_mreporting'][$short_classname][$funct_name]['title'])) { - $title_func = $LANG['plugin_mreporting'][$short_classname][$funct_name]['title']; - } - } - } - } - } - $out="". - $data['raw']["ITEM_$num"]." (".$title_func.")"; - } - return $out; - break; - } - return ""; + $out = "" . + $data['raw']["ITEM_$num"] . " (" . $title_func . ")"; + } + return $out; + break; + } + return ""; break; - - } - return ""; + } + return ""; } -function plugin_mreporting_MassiveActionsFieldsDisplay($options = []) { +function plugin_mreporting_MassiveActionsFieldsDisplay($options = []) +{ - $table = $options['options']['table']; - $field = $options['options']['field']; - $linkfield = $options['options']['linkfield']; - if ($table == getTableForItemType($options['itemtype'])) { - - // Table fields - switch ($table.".".$field) { - - case "glpi_plugin_mreporting_configs.show_label": - PluginMreportingConfig::dropdownLabel('show_label'); - return true; + $table = $options['options']['table']; + $field = $options['options']['field']; + $linkfield = $options['options']['linkfield']; + if ($table == getTableForItemType($options['itemtype'])) { + // Table fields + switch ($table . "." . $field) { + case "glpi_plugin_mreporting_configs.show_label": + PluginMreportingConfig::dropdownLabel('show_label'); + return true; break; - case "glpi_plugin_mreporting_configs.graphtype": - Dropdown::showFromArray("graphtype", - ['PNG'=>'PNG', 'SVG'=>'SVG']); - return true; + case "glpi_plugin_mreporting_configs.graphtype": + Dropdown::showFromArray( + "graphtype", + ['PNG' => 'PNG', 'SVG' => 'SVG'] + ); + return true; break; - } - - } + } + } // Need to return false on non display item - return false; + return false; } -function plugin_mreporting_searchOptionsValues($options = []) { +function plugin_mreporting_searchOptionsValues($options = []) +{ - $table = $options['searchoption']['table']; - $field = $options['searchoption']['field']; + $table = $options['searchoption']['table']; + $field = $options['searchoption']['field']; - switch ($table.".".$field) { - case "glpi_plugin_mreporting_configs.graphtype": - Dropdown::showFromArray("graphtype", - ['PNG'=>'PNG', 'SVG'=>'SVG']); - return true; - } - return false; + switch ($table . "." . $field) { + case "glpi_plugin_mreporting_configs.graphtype": + Dropdown::showFromArray( + "graphtype", + ['PNG' => 'PNG', 'SVG' => 'SVG'] + ); + return true; + } + return false; } diff --git a/inc/baseclass.class.php b/inc/baseclass.class.php index f55261ee..1f892a53 100644 --- a/inc/baseclass.class.php +++ b/inc/baseclass.class.php @@ -1,160 +1,170 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingBaseclass { - - protected $sql_date, - $sql_date_create, - $sql_date_solve, - $sql_date_closed, - $filters, - $where_entities, - $where_entities_array, - $where_entities_level; - - function __construct($config = []) { - global $DB, $LANG; - - //force MySQL DATE_FORMAT in user locale - $query = "SET lc_time_names = '".$_SESSION['glpilanguage']."'"; - $DB->query($query); - - if (empty($config)) { - return true; - } - - $this->filters = [ - 'open' => [ - 'label' => $LANG['plugin_mreporting']['Helpdeskplus']['opened'], - 'status' => [ - CommonITILObject::INCOMING => _x('status', 'New'), - CommonITILObject::ASSIGNED => _x('status', 'Processing (assigned)'), - CommonITILObject::PLANNED => _x('status', 'Processing (planned)'), - CommonITILObject::WAITING => __('Pending') +class PluginMreportingBaseclass +{ + protected $sql_date; + protected $sql_date_create; + protected $sql_date_solve; + protected $sql_date_closed; + protected $filters; + protected $where_entities; + protected $where_entities_array; + protected $where_entities_level; + + public function __construct($config = []) + { + global $DB, $LANG; + + //force MySQL DATE_FORMAT in user locale + $query = "SET lc_time_names = '" . $_SESSION['glpilanguage'] . "'"; + $DB->query($query); + + if (empty($config)) { + return true; + } + + $this->filters = [ + 'open' => [ + 'label' => $LANG['plugin_mreporting']['Helpdeskplus']['opened'], + 'status' => [ + CommonITILObject::INCOMING => _x('status', 'New'), + CommonITILObject::ASSIGNED => _x('status', 'Processing (assigned)'), + CommonITILObject::PLANNED => _x('status', 'Processing (planned)'), + CommonITILObject::WAITING => __('Pending') + ] + ], + 'close' => [ + 'label' => _x('status', 'Closed'), + 'status' => [ + CommonITILObject::SOLVED => _x('status', 'Solved'), + CommonITILObject::CLOSED => _x('status', 'Closed') + ] ] - ], - 'close' => [ - 'label' => _x('status', 'Closed'), - 'status' => [ - CommonITILObject::SOLVED => _x('status', 'Solved'), - CommonITILObject::CLOSED => _x('status', 'Closed') - ] - ] - ]; - $this->status = [CommonITILObject::INCOMING, - CommonITILObject::ASSIGNED, - CommonITILObject::PLANNED, - CommonITILObject::WAITING, - CommonITILObject::SOLVED, - CommonITILObject::CLOSED]; - - if (isset( $_SESSION['glpiactiveentities'])) { - $this->where_entities = "'".implode("', '", $_SESSION['glpiactiveentities'])."'"; - $this->where_entities_array = $_SESSION['glpiactiveentities']; - } else { // maybe cron mode - $entities = []; - $entity = new Entity; - $found_entities = $entity->find(); - foreach ($found_entities as $entities_id => $current_entity) { - $entities[] = $entities_id; - } - $this->where_entities = "'".implode("', '", $entities)."'"; - $this->where_entities_array = $entities; - } - - // init default value for status selector - if (!isset($_SESSION['mreporting_values']['status_1'])) { - $_SESSION['mreporting_values']['status_1'] + ]; + $this->status = [CommonITILObject::INCOMING, + CommonITILObject::ASSIGNED, + CommonITILObject::PLANNED, + CommonITILObject::WAITING, + CommonITILObject::SOLVED, + CommonITILObject::CLOSED + ]; + + if (isset($_SESSION['glpiactiveentities'])) { + $this->where_entities = "'" . implode("', '", $_SESSION['glpiactiveentities']) . "'"; + $this->where_entities_array = $_SESSION['glpiactiveentities']; + } else { // maybe cron mode + $entities = []; + $entity = new Entity(); + $found_entities = $entity->find(); + foreach ($found_entities as $entities_id => $current_entity) { + $entities[] = $entities_id; + } + $this->where_entities = "'" . implode("', '", $entities) . "'"; + $this->where_entities_array = $entities; + } + + // init default value for status selector + if (!isset($_SESSION['mreporting_values']['status_1'])) { + $_SESSION['mreporting_values']['status_1'] = $_SESSION['mreporting_values']['status_2'] = $_SESSION['mreporting_values']['status_3'] = $_SESSION['mreporting_values']['status_4'] = 1; - $_SESSION['mreporting_values']['status_5'] + $_SESSION['mreporting_values']['status_5'] = $_SESSION['mreporting_values']['status_6'] = 0; - } - - if (!isset($_SESSION['mreporting_values']['period'])) { - $_SESSION['mreporting_values']['period'] = 'month'; - } - if (isset($_SESSION['mreporting_values']['period']) - && !empty($_SESSION['mreporting_values']['period'])) { - switch ($_SESSION['mreporting_values']['period']) { - case 'day': - $this->period_sort = '%y%m%d'; - $this->period_sort_php = $this->period_sort = '%y%m%d'; - $this->period_datetime = '%Y-%m-%d 23:59:59'; - $this->period_label = '%d %b'; - $this->period_interval = 'DAY'; - $this->sql_list_date = "DISTINCT DATE_FORMAT(`date` , '{$this->period_datetime}') as period_l"; - break; - case 'week': - $this->period_sort = '%x%v'; - $this->period_sort_php = '%Y%V'; - $this->period_datetime = "%Y-%m-%d 23:59:59"; - $this->period_label = 'S%v %x'; - $this->period_interval = 'WEEK'; - $this->sql_list_date = "DISTINCT DATE_FORMAT(`date` - INTERVAL (WEEKDAY(`date`)) DAY, '{$this->period_datetime}') as period_l"; - break; - case 'month': - $this->period_sort = '%y%m'; - $this->period_sort_php = $this->period_sort = '%y%m'; - $this->period_datetime = '%Y-%m-01 23:59:59'; - $this->period_label = '%b %Y'; - $this->period_interval = 'MONTH'; - $this->sql_list_date = "DISTINCT CONCAT(LAST_DAY(DATE_FORMAT(`date` , '{$this->period_datetime}')), ' 23:59:59') as period_l"; - break; - case 'year': - $this->period_sort = '%Y'; - $this->period_sort_php = $this->period_sort = '%Y'; - $this->period_datetime = '%Y-12-31 23:59:59'; - $this->period_label = '%Y'; - $this->period_interval = 'YEAR'; - $this->sql_list_date = "DISTINCT DATE_FORMAT(`date` , '{$this->period_datetime}') as period_l"; - break; - default : - $this->period_sort = '%y%u'; - $this->period_label = 'S-%u %y'; - break; - } - } else { - $this->period_sort = '%y%m'; - $this->period_label = '%b %Y'; - } - - $this->sql_date_create = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); - $this->sql_date_solve = PluginMreportingCommon::getSQLDate("glpi_tickets.solvedate", - $config['delay'], - $config['randname']); - $this->sql_date_closed = PluginMreportingCommon::getSQLDate("glpi_tickets.closedate", - $config['delay'], - $config['randname']); - - } + } + + if (!isset($_SESSION['mreporting_values']['period'])) { + $_SESSION['mreporting_values']['period'] = 'month'; + } + if ( + isset($_SESSION['mreporting_values']['period']) + && !empty($_SESSION['mreporting_values']['period']) + ) { + switch ($_SESSION['mreporting_values']['period']) { + case 'day': + $this->period_sort = '%y%m%d'; + $this->period_sort_php = 'ymd'; + $this->period_datetime = '%Y-%m-%d 23:59:59'; + $this->period_label = '%d %b'; + $this->period_interval = 'DAY'; + $this->sql_list_date = "DISTINCT DATE_FORMAT(`date` , '{$this->period_datetime}') as period_l"; + break; + case 'week': + $this->period_sort = '%x%v'; + $this->period_sort_php = 'oW'; + $this->period_datetime = "%Y-%m-%d 23:59:59"; + $this->period_label = 'S%v %x'; + $this->period_interval = 'WEEK'; + $this->sql_list_date = "DISTINCT DATE_FORMAT(`date` - INTERVAL (WEEKDAY(`date`)) DAY, '{$this->period_datetime}') as period_l"; + break; + case 'month': + $this->period_sort = '%y%m'; + $this->period_sort_php = 'ym'; + $this->period_datetime = '%Y-%m-01 23:59:59'; + $this->period_label = '%b %Y'; + $this->period_interval = 'MONTH'; + $this->sql_list_date = "DISTINCT CONCAT(LAST_DAY(DATE_FORMAT(`date` , '{$this->period_datetime}')), ' 23:59:59') as period_l"; + break; + case 'year': + $this->period_sort = '%Y'; + $this->period_sort_php = 'Y'; + $this->period_datetime = '%Y-12-31 23:59:59'; + $this->period_label = '%Y'; + $this->period_interval = 'YEAR'; + $this->sql_list_date = "DISTINCT DATE_FORMAT(`date` , '{$this->period_datetime}') as period_l"; + break; + default: + $this->period_sort = '%y%u'; + $this->period_label = 'S-%u %y'; + break; + } + } else { + $this->period_sort = '%y%m'; + $this->period_label = '%b %Y'; + } + + $this->sql_date_create = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + $this->sql_date_solve = PluginMreportingCommon::getSQLDate( + "glpi_tickets.solvedate", + $config['delay'], + $config['randname'] + ); + $this->sql_date_closed = PluginMreportingCommon::getSQLDate( + "glpi_tickets.closedate", + $config['delay'], + $config['randname'] + ); + } } diff --git a/inc/common.class.php b/inc/common.class.php index 9e049392..c8bccc45 100644 --- a/inc/common.class.php +++ b/inc/common.class.php @@ -1,38 +1,40 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ use Odtphp\Odf; -class PluginMreportingCommon extends CommonDBTM { - static $rightname = 'statistic'; +class PluginMreportingCommon extends CommonDBTM +{ + public static $rightname = 'statistic'; - const MNBSP = "        + const MNBSP = "                                @@ -45,80 +47,90 @@ class PluginMreportingCommon extends CommonDBTM { * @param number $nb Number of item(s) * @return string Itemtype name */ - public static function getTypeName($nb = 0) { - return __("More Reporting", 'mreporting'); - } - - public static function canCreate() { - return false; - } - - static function getMenuContent() { - global $CFG_GLPI; - - $web_full_dir = Plugin::getWebDir('mreporting'); - $img_db = "".__("Dashboard", "; - $img_ct = "".__("Reports list", "; - - $web_rel_dir = Plugin::getWebDir('mreporting', false); - $url_central = "/$web_rel_dir/front/central.php"; - $url_dashboard = "/$web_rel_dir/front/dashboard.php"; - - $menu = parent::getMenuContent(); - - $menu['page'] = PluginMreportingDashboard::CurrentUserHaveDashboard() ? $url_dashboard : $url_central; - $menu['icon'] = self::getIcon(); - - $menu['options']['dashboard']['page'] = $url_dashboard; - $menu['options']['dashboard']['title'] = __("Dashboard", 'mreporting'); - $menu['options']['dashboard']['links'][$img_db] = $url_dashboard; - $menu['options']['dashboard']['links'][$img_ct] = $url_central; - if (PluginMreportingConfig::canCreate()) { - $menu['options']['dashboard']['links']['config'] = PluginMreportingConfig::getSearchURL(false); - } - - $menu['options']['dashboard_list'] = $menu['options']['dashboard']; - $menu['options']['dashboard_list']['page'] = $url_central; - $menu['options']['dashboard_list']['title'] = __("Reports list", 'mreporting'); - - $menu['options']['config']['title'] = PluginMreportingConfig::getTypeName(2); - $menu['options']['config']['page'] = PluginMreportingConfig::getSearchURL(false); - $menu['options']['config']['links'] = $menu['options']['dashboard']['links']; - $menu['options']['config']['links']['search'] = PluginMreportingConfig::getSearchURL(false); - if (PluginMreportingConfig::canCreate()) { - $menu['options']['config']['links']['add'] = PluginMreportingConfig::getFormURL(false); - } - - return $menu; - } + public static function getTypeName($nb = 0) + { + return __("More Reporting", 'mreporting'); + } + + public static function canCreate() + { + return false; + } + + public static function getMenuContent() + { + global $CFG_GLPI; + + $web_full_dir = Plugin::getWebDir('mreporting'); + $img_db = "" . __("Dashboard", "; + $img_ct = "" . __("Reports list", "; + + $web_rel_dir = Plugin::getWebDir('mreporting', false); + $url_central = "/$web_rel_dir/front/central.php"; + $url_dashboard = "/$web_rel_dir/front/dashboard.php"; + + $menu = parent::getMenuContent(); + + $menu['page'] = PluginMreportingDashboard::currentUserHaveDashboard() ? $url_dashboard : $url_central; + $menu['icon'] = self::getIcon(); + $menu['title'] = self::getTypeName(Session::getPluralNumber()); + + $menu['options']['dashboard']['page'] = $url_dashboard; + $menu['options']['dashboard']['title'] = __("Dashboard", 'mreporting'); + $menu['options']['dashboard']['links'][$img_db] = $url_dashboard; + $menu['options']['dashboard']['links'][$img_ct] = $url_central; + if (PluginMreportingConfig::canCreate()) { + $menu['options']['dashboard']['links']['config'] = PluginMreportingConfig::getSearchURL(false); + } + + $menu['options']['dashboard_list'] = $menu['options']['dashboard']; + $menu['options']['dashboard_list']['page'] = $url_central; + $menu['options']['dashboard_list']['title'] = __("Reports list", 'mreporting'); + + $menu['options']['config']['title'] = PluginMreportingConfig::getTypeName(2); + $menu['options']['config']['page'] = PluginMreportingConfig::getSearchURL(false); + $menu['options']['config']['links'] = $menu['options']['dashboard']['links']; + $menu['options']['config']['links']['search'] = PluginMreportingConfig::getSearchURL(false); + if (PluginMreportingConfig::canCreate()) { + $menu['options']['config']['links']['add'] = PluginMreportingConfig::getFormURL(false); + } + + return $menu; + } /** * Parsing all classes * Search all class into inc folder */ - static function parseAllClasses($inc_dir) { - - $classes = []; - $matches = []; - - if ($handle = opendir($inc_dir)) { - while (false !== ($entry = readdir($handle))) { - if ($entry != "." && $entry != "..") { - $fcontent = file_get_contents($inc_dir."/".$entry); - if (preg_match("/class\s(.+)Extends PluginMreporting.*Baseclass/i", - $fcontent, $matches)) { - $classes[] = trim($matches[1]); - } + public static function parseAllClasses($inc_dir) + { + + $classes = []; + $matches = []; + + if ($handle = opendir($inc_dir)) { + while (false !== ($entry = readdir($handle))) { + if ($entry != "." && $entry != "..") { + $fcontent = file_get_contents($inc_dir . "/" . $entry); + if ( + preg_match( + "/class\s(.+)Extends PluginMreporting.*Baseclass/i", + $fcontent, + $matches + ) + ) { + $classes[] = trim($matches[1]); + } + } } - } - } + } - return $classes; - } + return $classes; + } /** * Get all reports from parsing class @@ -126,395 +138,413 @@ static function parseAllClasses($inc_dir) { * @params */ - function getAllReports($with_url = true, $params = []) { - global $LANG; - - $reports = []; - - $inc_dir = Plugin::getPhpDir('mreporting') . "/inc"; - $pics_dir = "../pics"; - - if (isset($params['classname']) - && !empty($params['classname'])) { - $classes = []; - $classes[] = $params['classname']; - - } else { - //parse inc dir to search report classes - $classes = self::parseAllClasses($inc_dir); - - sort($classes); - } - - //construct array to list classes and functions - foreach ($classes as $classname) { - $i = 0; - if (!class_exists($classname)) { - continue; - } - - //scn = short class name - $scn = str_replace('PluginMreporting', '', $classname); - if (isset($LANG['plugin_mreporting'][$scn]['title'])) { - $title = $LANG['plugin_mreporting'][$scn]['title']; - - $functions = get_class_methods($classname); - - foreach ($functions as $f_name) { - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); - if ($ex_func[0] != 'report') { - continue; - } - - if (isset($LANG['plugin_mreporting'][$scn][$f_name])) { - $gtype = strtolower($ex_func[1]); - $title_func = $LANG['plugin_mreporting'][$scn][$f_name]['title']; - $category_func = ''; - if (isset($LANG['plugin_mreporting'][$scn][$f_name]['category'])) { - $category_func = $LANG['plugin_mreporting'][$scn][$f_name]['category']; - } - - if (isset($LANG['plugin_mreporting'][$scn][$f_name]['desc'])) { - $des_func = $LANG['plugin_mreporting'][$scn][$f_name]['desc']; - } else { - $des_func = ""; - } - $url_graph = "graph.php?short_classname=$scn". - "&f_name=$f_name&gtype=$gtype"; - $min_url_graph = "front/graph.php?short_classname=$scn". - "&f_name=$f_name&gtype=$gtype"; - - $reports[$classname]['title'] = $title; - $reports[$classname]['functions'][$i]['function'] = $f_name; - $reports[$classname]['functions'][$i]['title'] = $title_func; - $reports[$classname]['functions'][$i]['desc'] = $des_func; - $reports[$classname]['functions'][$i]['category_func'] = $category_func; - $reports[$classname]['functions'][$i]['pic'] = $pics_dir."/chart-$gtype.png"; - $reports[$classname]['functions'][$i]['gtype'] = $gtype; - $reports[$classname]['functions'][$i]['short_classname'] = $scn; - $reports[$classname]['functions'][$i]['is_active'] = false; - - $config = new PluginMreportingConfig(); - if ($config->getFromDBByFunctionAndClassname($f_name, $classname)) { - if ($config->fields['is_active'] == 1) { - $reports[$classname]['functions'][$i]['is_active'] = true; - $reports[$classname]['functions'][$i]['id'] = $config->fields['id']; - } - $reports[$classname]['functions'][$i]['right'] = READ; - if (isset($_SESSION['glpiactiveprofile'])) { - $reports[$classname]['functions'][$i]['right'] = - PluginMreportingProfile::canViewReports($_SESSION['glpiactiveprofile']['id'], $config->fields['id']); - } - } - - if ($with_url) { - $reports[$classname]['functions'][$i]['url_graph'] = $url_graph; - $reports[$classname]['functions'][$i]['min_url_graph'] = $min_url_graph; - } - - $i++; - } + public function getAllReports($with_url = true, $params = []) + { + global $LANG; + + $reports = []; + + $inc_dir = Plugin::getPhpDir('mreporting') . "/inc"; + $pics_dir = "../pics"; + + if ( + isset($params['classname']) + && !empty($params['classname']) + ) { + $classes = []; + $classes[] = $params['classname']; + } else { + //parse inc dir to search report classes + $classes = self::parseAllClasses($inc_dir); + + sort($classes); + } + + //construct array to list classes and functions + foreach ($classes as $classname) { + $i = 0; + if (!class_exists($classname)) { + continue; } - } - } - return $reports; - } + //scn = short class name + $scn = str_replace('PluginMreporting', '', $classname); + if (isset($LANG['plugin_mreporting'][$scn]['title'])) { + $title = $LANG['plugin_mreporting'][$scn]['title']; + + $functions = get_class_methods($classname); + + foreach ($functions as $f_name) { + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); + if ($ex_func[0] != 'report') { + continue; + } + + if (isset($LANG['plugin_mreporting'][$scn][$f_name])) { + $gtype = strtolower($ex_func[1]); + $title_func = $LANG['plugin_mreporting'][$scn][$f_name]['title']; + $category_func = ''; + if (isset($LANG['plugin_mreporting'][$scn][$f_name]['category'])) { + $category_func = $LANG['plugin_mreporting'][$scn][$f_name]['category']; + } + + if (isset($LANG['plugin_mreporting'][$scn][$f_name]['desc'])) { + $des_func = $LANG['plugin_mreporting'][$scn][$f_name]['desc']; + } else { + $des_func = ""; + } + $url_graph = "graph.php?short_classname=$scn" . + "&f_name=$f_name&gtype=$gtype"; + $min_url_graph = "front/graph.php?short_classname=$scn" . + "&f_name=$f_name&gtype=$gtype"; + + $reports[$classname]['title'] = $title; + $reports[$classname]['functions'][$i]['function'] = $f_name; + $reports[$classname]['functions'][$i]['title'] = $title_func; + $reports[$classname]['functions'][$i]['desc'] = $des_func; + $reports[$classname]['functions'][$i]['category_func'] = $category_func; + $reports[$classname]['functions'][$i]['pic'] = $pics_dir . "/chart-$gtype.png"; + $reports[$classname]['functions'][$i]['gtype'] = $gtype; + $reports[$classname]['functions'][$i]['short_classname'] = $scn; + $reports[$classname]['functions'][$i]['is_active'] = false; + + $config = new PluginMreportingConfig(); + if ($config->getFromDBByFunctionAndClassname($f_name, $classname)) { + if ($config->fields['is_active'] == 1) { + $reports[$classname]['functions'][$i]['is_active'] = true; + $reports[$classname]['functions'][$i]['id'] = $config->fields['id']; + } + $reports[$classname]['functions'][$i]['right'] = READ; + if (isset($_SESSION['glpiactiveprofile'])) { + $reports[$classname]['functions'][$i]['right'] = + PluginMreportingProfile::canViewReports($_SESSION['glpiactiveprofile']['id'], $config->fields['id']); + } + } + + if ($with_url) { + $reports[$classname]['functions'][$i]['url_graph'] = $url_graph; + $reports[$classname]['functions'][$i]['min_url_graph'] = $min_url_graph; + } + + $i++; + } + } + } + } + + return $reports; + } /** * Show list of activated reports * * @param array $opt : short_classname,f_name,gtype,rand */ - static function title($opt) { - echo ""; - echo ""; - echo ""; - echo ""; - echo "
".__("Select statistics to be displayed")." :
"; - echo self::getSelectAllReports(true); - echo "
"; - } - - static function getSelectAllReports($onchange = false, $setIdInOptionsValues = false) { - - $common = new self(); - $reports = $common->getAllReports(true); - - if (empty($reports)) { - return ""; - } - - $js_onchange = $onchange ? " onchange='window.location.href=this.options[this.selectedIndex].value'" : ""; - - $select = ""; + $select .= ""; + + foreach ($reports as $classname => $report) { + $graphs = []; + foreach ($report['functions'] as $function) { + if ($function['is_active']) { + $graphs[$function['category_func']][] = $function; + } } - } - if (count($graphs) > 0) { - $select.= ""; foreach ($graphs as $cat => $graph) { - if (count($graph) > 0) { - $select.= ""; - - usort( - $graph, - function ($a, $b) { - $a_title = $a['title']; - $b_title = $b['title']; - return strcmp($a_title, $b_title); - } - ); - - foreach ($graph as $key => $value) { - if ($value['right']) { - if ($value['is_active']) { - $comment = ""; - if (isset($value["desc"])) { - $comment = $value["desc"]; - } - $option_value = $value["url_graph"]; - if ($setIdInOptionsValues) { - $option_value = $value['id']; - } - $icon = self::getReportIcon($value['function']); - $select .= ""; + $remove = true; + foreach ($graph as $key => $value) { + if ($value['right']) { + $remove = false; + } + } + if ($remove) { + unset($graphs[$cat]); + } + } + + if (count($graphs) > 0) { + $select .= ""; + foreach ($graphs as $cat => $graph) { + if (count($graph) > 0) { + $select .= ""; + + usort( + $graph, + function ($a, $b) { + $a_title = $a['title']; + $b_title = $b['title']; + return strcmp($a_title, $b_title); + } + ); + + foreach ($graph as $key => $value) { + if ($value['right']) { + if ($value['is_active']) { + $comment = ""; + if (isset($value["desc"])) { + $comment = $value["desc"]; + } + $option_value = $value["url_graph"]; + if ($setIdInOptionsValues) { + $option_value = $value['id']; + } + $icon = self::getReportIcon($value['function']); + $select .= ""; + } + } } - } - } - $select.= ""; - } + $select .= ""; + } + } + $select .= ""; } - $select.= ""; - } - } - $select.= ""; + } + $select .= ""; - return $select; - } + return $select; + } /** * parse All class for list active reports * and display list */ - function showCentral($params) { + public function showCentral($params) + { - $reports = $this->getAllReports(true, $params); + $reports = $this->getAllReports(true, $params); - if ($reports === false) { - echo "
".__("No report is available !", 'mreporting')."
"; - return false; - } + if ($reports === false) { + echo "
" . __("No report is available !", 'mreporting') . "
"; + return false; + } - echo ""; + echo "
"; - foreach ($reports as $classname => $report) { - $i = 0; - $nb_per_line = 2; - $graphs = []; - foreach ($report['functions'] as $function) { - if ($function['is_active']) { - $graphs[$classname][$function['category_func']][] = $function; + foreach ($reports as $classname => $report) { + $i = 0; + $nb_per_line = 2; + $graphs = []; + foreach ($report['functions'] as $function) { + if ($function['is_active']) { + $graphs[$classname][$function['category_func']][] = $function; + } } - } - - $count = 0; - if (isset($graphs[$classname])) { - foreach ($graphs[$classname] as $cat => $graph) { - if (self::haveSomeThingToShow($graph)) { - echo ""; - foreach ($graph as $k => $v) { - if ($v['right'] && $v['is_active']) { - if ($i%$nb_per_line == 0) { - if ($i != 0) { - echo ""; - } - echo ""; + + $count = 0; + if (isset($graphs[$classname])) { + foreach ($graphs[$classname] as $cat => $graph) { + if (self::haveSomeThingToShow($graph)) { + echo ""; + foreach ($graph as $k => $v) { + if ($v['right'] && $v['is_active']) { + if ($i % $nb_per_line == 0) { + if ($i != 0) { + echo ""; + } + echo ""; + } + + echo ""; + $i++; + } + + $count++; + if ($i % $nb_per_line > 0) { + $count++; + } } - echo ""; - $i++; - } - - $count++; - if ($i%$nb_per_line > 0) { - $count++; - } - } - - while ($i%$nb_per_line != 0) { - echo ""; - $i++; - } - } + while ($i % $nb_per_line != 0) { + echo ""; + $i++; + } + } + } } - } - echo ""; + echo ""; - echo ""; - echo ""; + echo ""; - echo ""; - } - - echo "
".$cat."
" . $cat . "
"; + echo ""; + echo " "; + echo $v['title']; + echo ""; + echo""; - echo ""; - echo " "; - echo $v['title']; - echo ""; - echo"  
"; + echo "
"; - if (isset($graphs[$classname]) && $count>0) { - $height = 200 + 30*$count; + if (isset($graphs[$classname]) && $count > 0) { + $height = 200 + 30 * $count; - echo "
"; - echo __("Export")." : "; - echo ""; + echo __("Export") . " : "; + echo ""; - echo "ODT"; - echo "
"; - } else { - echo __("No report is available !", 'mreporting'); - } - echo "
"; - } - - static function haveSomeThingToShow($graph) { - foreach ($graph as $k => $v) { - if ($v['right']) { - return true; - } - } - return false; - } + echo "ODT"; + echo ""; + } else { + echo __("No report is available !", 'mreporting'); + } + echo ""; + echo ""; + } + + echo ""; + } + + public static function haveSomeThingToShow($graph) + { + foreach ($graph as $k => $v) { + if ($v['right']) { + return true; + } + } + return false; + } /** * show Export Form from popup.php * for odt export */ - function showExportForm($opt) { - $classname = $opt["classname"]; - if ($classname) { - echo "
"; + public function showExportForm($opt) + { + $classname = $opt["classname"]; + if ($classname) { + echo "
"; - echo "\n"; - echo ""; + echo "
"; - $reports = $this->getAllReports(false, $opt); + $reports = $this->getAllReports(false, $opt); - foreach ($reports as $class => $report) { - $i = 0; - $nb_per_line = 2; - $graphs = []; - foreach ($report['functions'] as $function) { - if ($function['gtype'] === "sunburst") { - continue; - } - if ($function['is_active']) { - $graphs[$classname][$function['category_func']][] = $function; - } + foreach ($reports as $class => $report) { + $i = 0; + $nb_per_line = 2; + $graphs = []; + foreach ($report['functions'] as $function) { + if ($function['gtype'] === "sunburst") { + continue; + } + if ($function['is_active']) { + $graphs[$classname][$function['category_func']][] = $function; + } + } + + foreach ($graphs[$classname] as $cat => $graph) { + echo ""; + foreach ($graph as $k => $v) { + if ($v['is_active']) { + if ($i % $nb_per_line == 0) { + if ($i != 0) { + echo ""; + } + echo ""; + } + + echo ""; + echo ""; + $i++; + } + } + + while ($i % $nb_per_line != 0) { + echo ""; + echo ""; + $i++; + } + } + echo ""; } - foreach ($graphs[$classname] as $cat => $graph) { - echo ""; - foreach ($graph as $k => $v) { + echo ""; + echo ""; - } - echo ""; - } - - echo ""; - echo ""; - $i++; - } - } - - while ($i%$nb_per_line != 0) { - echo ""; - echo ""; - $i++; - } - } + echo ""; echo ""; - } - - echo ""; - echo ""; - echo ""; - - echo "
" . $cat . "
"; + echo ""; + echo ""; + echo " "; + echo $v['title']; + echo "  
".$cat."
"; + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
" . __("Begin date") . ""; + $date1 = date("Y-m-d", time() - (30 * 24 * 60 * 60)); + Html::showDateField("date1", ['value' => $date1, + 'maybeempty' => true + ]); + echo "" . __("End date") . ""; + $date2 = date("Y-m-d"); + Html::showDateField("date2", ['value' => $date2, + 'maybeempty' => true + ]); + echo "
"; + echo "
"; - if ($v['is_active']) { - if ($i%$nb_per_line == 0) { - if ($i != 0) { - echo "
"; - echo ""; - echo ""; - echo " "; - echo $v['title']; - echo "  
"; - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
".__("Begin date").""; - $date1 = strftime("%Y-%m-%d", time() - (30 * 24 * 60 * 60)); - Html::showDateField("date1", ['value' => $date1, - 'maybeempty' => true]); - echo "".__("End date").""; - $date2 = strftime("%Y-%m-%d"); - Html::showDateField("date2", ['value' => $date2, - 'maybeempty' => true]); - echo "
"; - echo "
"; - - echo "
"; - Html::openArrowMassives("exportform", true); - - $option[0] = __("Without data", 'mreporting'); - $option[1] = __("With data", 'mreporting'); - Dropdown::showFromArray("withdata", $option, []); - echo " "; - echo ""; - echo ""; - echo ""; - Html::closeForm(); - echo "
"; - - echo ""; - } - } + } + } /** * exit from grpah if no @params detected @@ -534,21 +564,22 @@ function showExportForm($opt) { * @params */ - function initParams($params, $export = false) { - if (!isset($params['classname'])) { - if (!isset($params['short_classname'])) { - exit; - } - if (!isset($params['f_name'])) { - exit; - } - if (!isset($params['gtype'])) { - exit; - } - } - - return $params; - } + public function initParams($params, $export = false) + { + if (!isset($params['classname'])) { + if (!isset($params['short_classname'])) { + exit; + } + if (!isset($params['f_name'])) { + exit; + } + if (!isset($params['gtype'])) { + exit; + } + } + + return $params; + } /** * init Params for graph function @@ -556,24 +587,25 @@ function initParams($params, $export = false) { * @params */ - static function initGraphParams($params) { - $crit = []; + public static function initGraphParams($params) + { + $crit = []; - // Default values of parameters - $raw_datas = []; - $title = ""; - $desc = ""; - $root = ""; + // Default values of parameters + $raw_datas = []; + $title = ""; + $desc = ""; + $root = ""; - $export = false; - $opt = []; + $export = false; + $opt = []; - foreach ($params as $key => $val) { - $crit[$key]=$val; - } + foreach ($params as $key => $val) { + $crit[$key] = $val; + } - return $crit; - } + return $crit; + } /** * show Graph : Show graph @@ -582,115 +614,126 @@ static function initGraphParams($params) { * @params $opt (classname, short_classname, f_name, gtype) */ - function showGraph($opt, $export = false, $forceFormat = null) { - global $LANG, $CFG_GLPI; - - if (!isset($opt['hide_title'])) { - self::title($opt); - $opt['hide_title'] = false; - } - - if (!isset($opt['width'])) { - $opt['width'] = false; - } - - //check the format display charts configured in glpi - $opt = $this->initParams($opt, $export); - $config = PluginMreportingConfig::initConfigParams($opt['f_name'], - "PluginMreporting".$opt['short_classname']); - - if ('PNG' === $forceFormat || $config['graphtype'] == 'PNG') { - $graph = new PluginMreportingGraphpng(); - } else { - // Defaults to SVG - $graph = new PluginMreportingGraph(); - } - - //generate default date - if (!isset($_SESSION['mreporting_values']['date1'.$config['randname']])) { - $_SESSION['mreporting_values']['date1'.$config['randname']] = strftime("%Y-%m-%d", - time() - ($config['delay'] * 24 * 60 * 60)); - } - if (!isset($_SESSION['mreporting_values']['date2'.$config['randname']])) { - $_SESSION['mreporting_values']['date2'.$config['randname']] = strftime("%Y-%m-%d"); - } - - // save/clear selectors - if (isset($opt['submit'])) { - self::saveSelectors($opt['f_name'], $config); - } else if (isset($opt['reset'])) { - self::resetSelectorsForReport($opt['f_name']); - } - self::getSelectorValuesByUser(); - - //dynamic instanciation of class passed by 'short_classname' GET parameter - $classname = 'PluginMreporting'.$opt['short_classname']; - - //dynamic call of method passed by 'f_name' GET parameter with previously instancied class - $obj = new $classname($config); - $datas = $obj->{$opt['f_name']}($config); - - //show graph (pgrah type determined by first entry of explode of camelcase of function name - $title_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['title']; - $des_func = ""; - if (isset($LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc'])) { - $des_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc']; - } - - $opt['class'] = $classname; - $opt['withdata'] = 1; - $params = ["raw_datas" => $datas, - "title" => $title_func, - "desc" => $des_func, - "export" => $export, - "opt" => $opt]; - return $graph->{'show'.$opt['gtype']}($params, $opt['hide_title'], $opt['width']); - } - - - static function dropdownExt($options = []) { - global $DB; - - $p['myname'] = ''; - $p['value'] = ""; - $p['ajax_page'] = ''; - $p['class'] = ''; - $p['span'] = ''; - $p['gtype'] = ''; - $p['show_graph'] = ''; - $p['randname'] = ''; - $p['display_svg'] = ''; - foreach ($options as $key => $value) { - $p[$key] = $value; - } - - echo ""; - - $params = ['span' => $p['span'], - 'ext' => '__VALUE__', - 'randname' => $p['randname']]; - - Ajax::updateItemOnSelectEvent($p['myname'], $p['span'], - $p['ajax_page'], - $params); - } + public function showGraph($opt, $export = false, $forceFormat = null) + { + global $LANG, $CFG_GLPI; + + if (!isset($opt['hide_title'])) { + self::title($opt); + $opt['hide_title'] = false; + } + + if (!isset($opt['width'])) { + $opt['width'] = false; + } + + //check the format display charts configured in glpi + $opt = $this->initParams($opt, $export); + $config = PluginMreportingConfig::initConfigParams( + $opt['f_name'], + "PluginMreporting" . $opt['short_classname'] + ); + + if ('PNG' === $forceFormat || $config['graphtype'] == 'PNG') { + $graph = new PluginMreportingGraphpng(); + } else { + // Defaults to SVG + $graph = new PluginMreportingGraph(); + } + + //generate default date + if (!isset($_SESSION['mreporting_values']['date1' . $config['randname']])) { + $_SESSION['mreporting_values']['date1' . $config['randname']] = date( + "Y-m-d", + time() - ($config['delay'] * 24 * 60 * 60) + ); + } + if (!isset($_SESSION['mreporting_values']['date2' . $config['randname']])) { + $_SESSION['mreporting_values']['date2' . $config['randname']] = date("Y-m-d"); + } + + // save/clear selectors + if (isset($opt['submit'])) { + self::saveSelectors($opt['f_name'], $config); + } else if (isset($opt['reset'])) { + self::resetSelectorsForReport($opt['f_name']); + } + self::getSelectorValuesByUser(); + + //dynamic instanciation of class passed by 'short_classname' GET parameter + $classname = 'PluginMreporting' . $opt['short_classname']; + + //dynamic call of method passed by 'f_name' GET parameter with previously instancied class + $obj = new $classname($config); + $datas = $obj->{$opt['f_name']}($config); + + //show graph (pgrah type determined by first entry of explode of camelcase of function name + $title_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['title']; + $des_func = ""; + if (isset($LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc'])) { + $des_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc']; + } + + $opt['class'] = $classname; + $opt['withdata'] = 1; + $params = ["raw_datas" => $datas, + "title" => $title_func, + "desc" => $des_func, + "export" => $export, + "opt" => $opt + ]; + return $graph->{'show' . $opt['gtype']}($params, $opt['hide_title'], $opt['width']); + } + + + public static function dropdownExt($options = []) + { + global $DB; + + $p['myname'] = ''; + $p['value'] = ""; + $p['ajax_page'] = ''; + $p['class'] = ''; + $p['span'] = ''; + $p['gtype'] = ''; + $p['show_graph'] = ''; + $p['randname'] = ''; + $p['display_svg'] = ''; + foreach ($options as $key => $value) { + $p[$key] = $value; + } + + echo ""; + + $params = ['span' => $p['span'], + 'ext' => '__VALUE__', + 'randname' => $p['randname'] + ]; + + Ajax::updateItemOnSelectEvent( + $p['myname'], + $p['span'], + $p['ajax_page'], + $params + ); + } /** * end Graph : Show graph datas array, setup link, export @@ -698,109 +741,110 @@ static function dropdownExt($options = []) { * @params $options ($opt, export, datas, unit, labels2, flip_data) */ - static function endGraph($options, $dashboard = false) { - global $CFG_GLPI; - - $opt = []; - $export = false; - $datas = []; - $unit = ''; - $labels2 = []; - $flip_data = false; - - foreach ($options as $k => $v) { - $$k=$v; - } - - $randname = false; - if (isset($opt['randname']) && $opt['randname'] !== false) { - $randname = $opt['randname']; - $_REQUEST['short_classname'] = $opt['short_classname']; - $_REQUEST['f_name'] = $opt['f_name']; - $_REQUEST['gtype'] = $opt['gtype']; - $_REQUEST['randname'] = $opt['randname']; - - //End Script for graph display - //if $randname exists - - $config = PluginMreportingConfig::initConfigParams($opt['f_name'], - "PluginMreporting".$opt['short_classname']); - if (!$export) { - if ($config['graphtype'] == 'SVG') { - echo "} + public static function endGraph($options, $dashboard = false) + { + global $CFG_GLPI; + + $opt = []; + $export = false; + $datas = []; + $unit = ''; + $labels2 = []; + $flip_data = false; + + foreach ($options as $k => $v) { + $$k = $v; + } + + $randname = false; + if (isset($opt['randname']) && $opt['randname'] !== false) { + $randname = $opt['randname']; + $_REQUEST['short_classname'] = $opt['short_classname']; + $_REQUEST['f_name'] = $opt['f_name']; + $_REQUEST['gtype'] = $opt['gtype']; + $_REQUEST['randname'] = $opt['randname']; + + //End Script for graph display + //if $randname exists + + $config = PluginMreportingConfig::initConfigParams( + $opt['f_name'], + "PluginMreporting" . $opt['short_classname'] + ); + if (!$export) { + if ($config['graphtype'] == 'SVG') { + echo "} showGraph$randname(); "; + } + echo "
"; } - echo ""; - } - } - - if (!$dashboard) { - $request_string = self::getRequestString($_REQUEST); - - if ($export != "odtall") { - if ($randname !== false && !$export) { - - $show_graph = PluginMreportingConfig::showGraphConfigValue($opt['f_name'], $opt['class']); - self::showGraphDatas($datas, $unit, $labels2, $flip_data, $show_graph); + } + + if (!$dashboard) { + $request_string = self::getRequestString($_REQUEST); + + if ($export != "odtall") { + if ($randname !== false && !$export) { + $show_graph = PluginMreportingConfig::showGraphConfigValue($opt['f_name'], $opt['class']); + self::showGraphDatas($datas, $unit, $labels2, $flip_data, $show_graph); + } + if (!$export) { + if (isset($_REQUEST['f_name']) && $_REQUEST['f_name'] != "test") { + echo "
"; + echo ""; + echo "

"; + self::showNavigation(); + echo "
"; + echo ""; + if (Session::haveRight('config', UPDATE)) { + echo "" . PluginMreportingConfig::getTypeName() . " : "; + echo " "; + echo ""; + } + if ($randname !== false) { + echo "

"; - } - if (!$export) { - if (isset($_REQUEST['f_name']) && $_REQUEST['f_name'] != "test") { - echo "
"; - echo ""; - echo "

"; - self::showNavigation(); - echo "
"; - echo ""; - if (Session::haveRight('config', UPDATE)) { - echo "".PluginMreportingConfig::getTypeName()." : "; - echo " "; - echo ""; - } - if ($randname !== false) { - echo "

"; - - echo ""; - echo "".__("Export")." : "; - $params = ['myname' => 'ext', - 'ajax_page' => Plugin::getWebDir('mreporting')."/ajax/dropdownExport.php", - 'class' => __CLASS__, - 'span' => 'show_ext', - 'gtype' => $_REQUEST['gtype'], - 'show_graph' => $show_graph, - 'display_svg' => ($config['graphtype'] != 'PNG'), - 'randname' => $randname]; - - self::dropdownExt($params); - - echo ""; - Html::closeForm(); - - } - echo "
"; - } - echo "
"; - echo "
"; - - if (isset($_REQUEST['f_name']) && $_REQUEST['f_name'] != "test") { - echo "
"; - } - } - - if ($randname == false) { - echo ""; + echo "" . __("Export") . " : "; + $params = ['myname' => 'ext', + 'ajax_page' => Plugin::getWebDir('mreporting') . "/ajax/dropdownExport.php", + 'class' => __CLASS__, + 'span' => 'show_ext', + 'gtype' => $_REQUEST['gtype'], + 'show_graph' => $show_graph, + 'display_svg' => ($config['graphtype'] != 'PNG'), + 'randname' => $randname + ]; + + self::dropdownExt($params); + + echo ""; + Html::closeForm(); + } + echo ""; + } + echo "
"; + echo ""; + + if (isset($_REQUEST['f_name']) && $_REQUEST['f_name'] != "test") { + echo ""; + } + } + + if ($randname == false) { + echo ""; + } } - } - } + } - //destroy specific palette - unset($_SESSION['mreporting']['colors']); - unset($_SESSION['mreporting_values']); - } + //destroy specific palette + unset($_SESSION['mreporting']['colors']); + unset($_SESSION['mreporting_values']); + } /** * Compile datas for unit display @@ -810,71 +854,68 @@ static function endGraph($options, $dashboard = false) { * @if percent, return new datas */ - static function compileDatasForUnit($values, $unit = '') { + public static function compileDatasForUnit($values, $unit = '') + { - $datas = $values; + $datas = $values; - if ($unit == '%') { - //complie news datas with percent values - $calcul = []; + if ($unit == '%') { + //complie news datas with percent values + $calcul = []; - $simpledatas = true; - foreach ($datas as $k=>$v) { - //multiple array - if (is_array($v)) { - $simpledatas = false; + $simpledatas = true; + foreach ($datas as $k => $v) { + //multiple array + if (is_array($v)) { + $simpledatas = false; + } } - } - if (!$simpledatas) { + if (!$simpledatas) { + $types = []; - $types = []; + foreach ($datas as $k => $v) { + if (is_array($v)) { + foreach ($v as $key => $val) { + $types[$key][$k] = $val; + } + } + } + $datas = $types; + } foreach ($datas as $k => $v) { - - if (is_array($v)) { - foreach ($v as $key => $val) { - $types[$key][$k] = $val; - } - } + //multiple array + if (!$simpledatas) { + foreach ($v as $key => $val) { + $total = array_sum($v); + if ($total == 0) { + $calcul[$k][$key] = Html::formatNumber(0); + } else { + $calcul[$k][$key] = Html::formatNumber(($val * 100) / $total); + } + } + } else {//simple array + $total = array_sum($values); + $calcul[$k] = Html::formatNumber(($v * 100) / $total); + } } - $datas = $types; - } - foreach ($datas as $k=>$v) { - //multiple array if (!$simpledatas) { - foreach ($v as $key => $val) { - $total = array_sum($v); - if ($total == 0) { - $calcul[$k][$key] = Html::formatNumber(0); - } else { - $calcul[$k][$key]= Html::formatNumber(($val*100)/$total); - } - } - } else {//simple array - $total = array_sum($values); - $calcul[$k]= Html::formatNumber(($v*100)/$total); - - } - } - - if (!$simpledatas) { - $datas = []; - foreach ($calcul as $k => $v) { - if (is_array($v)) { - foreach ($v as $key => $val) { - $datas[$key][$k] = $val; - } - } + $datas = []; + foreach ($calcul as $k => $v) { + if (is_array($v)) { + foreach ($v as $key => $val) { + $datas[$key][$k] = $val; + } + } + } + } else { + $datas = $calcul; } - } else { - $datas = $calcul; - } + } - } - - return $datas; - } + return $datas; + } /** * show Graph datas @@ -885,747 +926,811 @@ static function compileDatasForUnit($values, $unit = '') { * @param $flip_data, flip array if necessary */ - static function showGraphDatas ($datas = [], $unit = '', $labels2 = [], - $flip_data = false, $show_graph = false) { - global $CFG_GLPI; + public static function showGraphDatas( + $datas = [], + $unit = '', + $labels2 = [], + $flip_data = false, + $show_graph = false + ) { + global $CFG_GLPI; - $simpledatas = false; - $treedatas = false; + $simpledatas = false; + $treedatas = false; - //simple and tree array - $depth = self::getArrayDepth($datas); + //simple and tree array + $depth = self::getArrayDepth($datas); - if (!$labels2 && $depth < 2) { - $simpledatas = true; - } + if (!$labels2 && $depth < 2) { + $simpledatas = true; + } - if (strtolower($_REQUEST['gtype']) == "sunburst") { - $treedatas = true; - } + if (strtolower($_REQUEST['gtype']) == "sunburst") { + $treedatas = true; + } - if ($flip_data == true) { - $labels2 = array_flip($labels2); - } + if ($flip_data == true) { + $labels2 = array_flip($labels2); + } - $types = []; + $types = []; - foreach ($datas as $k => $v) { - if (is_array($v)) { - foreach ($v as $key => $val) { - if (isset($labels2[$key])) { - $types[$key][$k] = $val; - } - } - } - } - - if ($flip_data != true) { - $tmp = $datas; - $datas = $types; - $types = $tmp; - } - //simple array - if ($simpledatas) { - $datas = [__("Number", 'mreporting') => 0]; - } - - $rand = mt_rand(); - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
"; - - echo ""; - - if ($show_graph) { - $img = "deplier_down.png"; - } else { - $img = "deplier_up.png"; - } - echo " "; - - echo __("data", 'mreporting').""; - echo "
"; - - $visibility = $show_graph ? "display:none;" : "display:inline;"; - echo "
"; - echo ""; - - echo ""; - if (!($treedatas)) { - echo ""; - } - foreach ($datas as $label => $cols) { - if (!empty($labels2)) { - echo ""; - } else { - echo ""; - } - } - echo ""; - if ($treedatas) { - echo ""; - self::showGraphTreeDatas($types, $flip_data); - echo ""; - } else { - foreach ($types as $label2 => $cols) { - echo ""; - echo ""; - if ($simpledatas) { //simple array - echo ""; - } else if ($treedatas) { //multiple array - self::showGraphTreeDatas($cols, $flip_data); - } else { //multiple array - foreach ($cols as $date => $nb) { - if (!is_array($nb)) { - echo ""; - } - } + foreach ($datas as $k => $v) { + if (is_array($v)) { + foreach ($v as $key => $val) { + if (isset($labels2[$key])) { + $types[$key][$k] = $val; + } + } } - echo ""; - } - } + } - echo "
".$labels2[$label]."".$label."
".$label2."".$cols." ".$unit."".$nb." ".$unit."
"; - echo "

"; - } - - static function showGraphTreeDatas($cols, $flip_data = false) { - if ($flip_data != true) { - arsort($cols); - foreach ($cols as $label => $value) { - echo ""; - echo "$label"; - echo ""; - if (is_array($value)) { - echo ""; - self::showGraphTreeDatas($value); - echo "
"; + if ($flip_data != true) { + $tmp = $datas; + $datas = $types; + $types = $tmp; + } + //simple array + if ($simpledatas) { + $datas = [__("Number", 'mreporting') => 0]; + } + + $rand = mt_rand(); + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + + echo ""; + + if ($show_graph) { + $img = "deplier_down.png"; + } else { + $img = "deplier_up.png"; + } + echo " "; + + echo __("data", 'mreporting') . ""; + echo "
"; + + $visibility = $show_graph ? "display:none;" : "display:inline;"; + echo "
"; + echo ""; + + echo ""; + if (!($treedatas)) { + echo ""; + } + foreach ($datas as $label => $cols) { + if (!empty($labels2)) { + echo ""; } else { - echo $value; + echo ""; } - echo ""; - } - } else { - foreach ($cols as $label => $value) { + } + echo ""; + if ($treedatas) { echo ""; - echo ""; - echo ""; + } else { + foreach ($types as $label2 => $cols) { + echo ""; + echo ""; + if ($simpledatas) { //simple array + echo ""; + } else if ($treedatas) { //multiple array + self::showGraphTreeDatas($cols, $flip_data); + } else { //multiple array + foreach ($cols as $date => $nb) { + if (!is_array($nb)) { + echo ""; + } + } + } + echo ""; } - echo ""; - } - - } - } + } + + echo "
" . $labels2[$label] . "" . $label . "
$label"; - if (is_array($value)) { - echo ""; - self::showGraphTreeDatas($value, true); - echo "
"; - } else { - echo $value; + self::showGraphTreeDatas($types, $flip_data); + echo "
" . $label2 . "" . $cols . " " . $unit . "" . $nb . " " . $unit . "
"; + echo "

"; + } + + public static function showGraphTreeDatas($cols, $flip_data = false) + { + if ($flip_data != true) { + arsort($cols); + foreach ($cols as $label => $value) { + echo ""; + echo "$label"; + echo ""; + if (is_array($value)) { + echo ""; + self::showGraphTreeDatas($value); + echo "
"; + } else { + echo $value; + } + echo ""; + } + } else { + foreach ($cols as $label => $value) { + echo ""; + echo "$label"; + echo ""; + if (is_array($value)) { + echo ""; + self::showGraphTreeDatas($value, true); + echo "
"; + } else { + echo $value; + } + echo ""; + } + } + } /** * Launch export of datas * * @param $opt */ - function export($opt) { - global $LANG; - - switch ($opt['switchto']) { - default: - case 'png': - $graph = new PluginMreportingGraphpng(); - //check the format display charts configured in glpi - $opt = $this->initParams($opt, true); - $opt['export'] = 'png'; - $opt['withdata'] = 1; - break; - case 'csv': - $graph = new PluginMreportingGraphcsv(); - $opt['export'] = 'csv'; - $opt['withdata'] = 1; - break; - case 'odt': - $graph = new PluginMreportingGraphpng(); - $opt = $this->initParams($opt, true); - $opt['export'] = 'odt'; - break; - case 'odtall': - $graph = new PluginMreportingGraphpng(); - $opt = $this->initParams($opt, true); - $opt['export'] = 'odtall'; - break; - } - - //export all with odt - if (isset($opt['classname'])) { - if (isset($opt['check'])) { - unset($_SESSION['glpi_plugin_mreporting_odtarray']); - - $reports = $this->getAllReports(false, $opt); - - foreach ($reports as $classname => $report) { - foreach ($report['functions'] as $func) { - foreach ($opt['check'] as $do=>$to) { - if ($do == $func['function'].$classname) { - //dynamic instanciation of class passed by 'short_classname' GET parameter - $config = PluginMreportingConfig::initConfigParams($func['function'], $classname); - $class = 'PluginMreporting'.$func['short_classname']; - $obj = new $class($config); - $randname = $classname.$func['function']; - if (isset($opt['date1']) && isset($opt['date2'])) { - - $s = strtotime($opt['date2'])-strtotime($opt['date1']); - - // If customExportDates exists in class : we configure the dates - if (method_exists($obj, 'customExportDates')) { - $opt = $obj->customExportDates($opt, $func['function']); - } - - $_REQUEST['date1'.$randname] = $opt['date1']; - $_REQUEST['date2'.$randname] = $opt['date2']; - } - - //dynamic call of method passed by 'f_name' - //GET parameter with previously instancied class - $method = $func['function']; - $datas = $obj->$method($config); - - //show graph (pgrah type determined by - //first entry of explode of camelcase of function name - $title_func = $LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['title']; - - $des_func = ""; - if (isset($LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc'])) { - $des_func = $LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc']; - } - if (isset($LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc']) - &&isset($opt['date1']) - && isset($opt['date2'])) { - $des_func.= " - "; - } - - if (isset($opt['date1']) - && isset($opt['date2'])) { - $des_func.= Html::convdate($opt['date1'])." / ". - Html::convdate($opt['date2']); - } - $options = ["short_classname" => $func['short_classname'], + public function export($opt) + { + global $LANG; + + switch ($opt['switchto']) { + default: + case 'png': + $graph = new PluginMreportingGraphpng(); + //check the format display charts configured in glpi + $opt = $this->initParams($opt, true); + $opt['export'] = 'png'; + $opt['withdata'] = 1; + break; + case 'csv': + $graph = new PluginMreportingGraphcsv(); + $opt['export'] = 'csv'; + $opt['withdata'] = 1; + break; + case 'odt': + $graph = new PluginMreportingGraphpng(); + $opt = $this->initParams($opt, true); + $opt['export'] = 'odt'; + break; + case 'odtall': + $graph = new PluginMreportingGraphpng(); + $opt = $this->initParams($opt, true); + $opt['export'] = 'odtall'; + break; + } + + //export all with odt + if (isset($opt['classname'])) { + if (isset($opt['check'])) { + unset($_SESSION['glpi_plugin_mreporting_odtarray']); + + $reports = $this->getAllReports(false, $opt); + + foreach ($reports as $classname => $report) { + foreach ($report['functions'] as $func) { + foreach ($opt['check'] as $do => $to) { + if ($do == $func['function'] . $classname) { + //dynamic instanciation of class passed by 'short_classname' GET parameter + $config = PluginMreportingConfig::initConfigParams($func['function'], $classname); + $class = 'PluginMreporting' . $func['short_classname']; + $obj = new $class($config); + $randname = $classname . $func['function']; + if (isset($opt['date1']) && isset($opt['date2'])) { + $s = strtotime($opt['date2']) - strtotime($opt['date1']); + + // If customExportDates exists in class : we configure the dates + if (method_exists($obj, 'customExportDates')) { + $opt = $obj->customExportDates($opt, $func['function']); + } + + $_REQUEST['date1' . $randname] = $opt['date1']; + $_REQUEST['date2' . $randname] = $opt['date2']; + } + + //dynamic call of method passed by 'f_name' + //GET parameter with previously instancied class + $method = $func['function']; + $datas = $obj->$method($config); + + //show graph (pgrah type determined by + //first entry of explode of camelcase of function name + $title_func = $LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['title']; + + $des_func = ""; + if (isset($LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc'])) { + $des_func = $LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc']; + } + if ( + isset($LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc']) + && isset($opt['date1']) + && isset($opt['date2']) + ) { + $des_func .= " - "; + } + + if ( + isset($opt['date1']) + && isset($opt['date2']) + ) { + $des_func .= Html::convdate($opt['date1']) . " / " . + Html::convdate($opt['date2']); + } + $options = ["short_classname" => $func['short_classname'], "f_name" => $func['function'], "class" => $opt['classname'], "gtype" => $func['gtype'], "randname" => $randname, - "withdata" => $opt['withdata']]; + "withdata" => $opt['withdata'] + ]; - $show_label = 'always'; + $show_label = 'always'; - $params = ["raw_datas" => $datas, - "title" => $title_func, - "desc" => $des_func, - "export" => $opt['export'], - "opt" => $options]; + $params = ["raw_datas" => $datas, + "title" => $title_func, + "desc" => $des_func, + "export" => $opt['export'], + "opt" => $options + ]; - $graph->{'show'.$func['gtype']}($params); - } - } - } + $graph->{'show' . $func['gtype']}($params); + } + } + } + } + if ( + isset($_SESSION['glpi_plugin_mreporting_odtarray']) && + !empty($_SESSION['glpi_plugin_mreporting_odtarray']) + ) { + if (PluginMreportingPreference::atLeastOneTemplateExists()) { + $template = PluginMreportingPreference::checkPreferenceTemplateValue(Session::getLoginUserID()); + if ($template) { + self::generateOdt($_SESSION['glpi_plugin_mreporting_odtarray']); + } else { + Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); + echo "

" . __("Please, select a model in your preferences", 'mreporting') . "

"; + Html::displayBackLink(); + echo "
"; + Html::popFooter(); + } + } else { + Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); + echo "

" . __("No model available", 'mreporting') . "

"; + Html::displayBackLink(); + echo "
"; + Html::popFooter(); + } + } + } else { //no selected data + Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); + echo "

" . __("No graphic selected", 'mreporting') . "

"; + Html::displayBackLink(); + echo "
"; + Html::popFooter(); } - if (isset($_SESSION['glpi_plugin_mreporting_odtarray']) && - !empty($_SESSION['glpi_plugin_mreporting_odtarray'])) { - - if (PluginMreportingPreference::atLeastOneTemplateExists()) { - $template = PluginMreportingPreference::checkPreferenceTemplateValue(Session::getLoginUserID()); - if ($template) { - self::generateOdt($_SESSION['glpi_plugin_mreporting_odtarray']); - } else { - Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); - echo "

".__("Please, select a model in your preferences", 'mreporting')."

"; - Html::displayBackLink(); - echo "
"; - Html::popFooter(); - } - } else { - Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); - echo "

".__("No model available", 'mreporting')."

"; - Html::displayBackLink(); - echo "
"; - Html::popFooter(); - } + } else { + $config = PluginMreportingConfig::initConfigParams( + $opt['f_name'], + "PluginMreporting" . $opt['short_classname'] + ); + + // get periods selected + self::getSelectorValuesByUser(); + + //dynamic instanciation of class passed by 'short_classname' GET parameter + $classname = 'PluginMreporting' . $opt['short_classname']; + $obj = new $classname($config); + + //dynamic call of method passed by 'f_name' GET parameter with previously instancied class + $datas = $obj->{$opt['f_name']}($config); + + //show graph (pgrah type determined by first entry of explode of camelcase of function name + $title_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['title']; + $des_func = ""; + if (isset($LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc'])) { + $des_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc']; + } + if ( + isset($LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc']) + && isset($_REQUEST['date1' . $opt['randname']]) + && isset($_REQUEST['date2' . $opt['randname']]) + ) { + $des_func .= " - "; + } + if ( + isset($_REQUEST['date1' . $opt['randname']]) + && isset($_REQUEST['date2' . $opt['randname']]) + ) { + $des_func .= Html::convdate($_REQUEST['date1' . $opt['randname']]) . + " / " . Html::convdate($_REQUEST['date2' . $opt['randname']]); } - } else { //no selected data - Html::popHeader(__("General Report - ODT", 'mreporting'), $_SERVER['PHP_SELF']); - echo "

".__("No graphic selected", 'mreporting')."

"; - Html::displayBackLink(); - echo "
"; - Html::popFooter(); - } - - } else { - $config = PluginMreportingConfig::initConfigParams($opt['f_name'], - "PluginMreporting".$opt['short_classname']); - - // get periods selected - self::getSelectorValuesByUser(); - //dynamic instanciation of class passed by 'short_classname' GET parameter - $classname = 'PluginMreporting'.$opt['short_classname']; - $obj = new $classname($config); + $show_label = 'always'; - //dynamic call of method passed by 'f_name' GET parameter with previously instancied class - $datas = $obj->{$opt['f_name']}($config); + $opt['class'] = $classname; + $params = ["raw_datas" => $datas, + "title" => $title_func, + "desc" => $des_func, + "export" => $opt['export'], + "opt" => $opt + ]; - //show graph (pgrah type determined by first entry of explode of camelcase of function name - $title_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['title']; - $des_func = ""; - if (isset($LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc'])) { - $des_func = $LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc']; - } - if (isset($LANG['plugin_mreporting'][$opt['short_classname']][$opt['f_name']]['desc']) - && isset($_REQUEST['date1'.$opt['randname']]) - && isset($_REQUEST['date2'.$opt['randname']])) { - $des_func.= " - "; - } - if (isset($_REQUEST['date1'.$opt['randname']]) - && isset($_REQUEST['date2'.$opt['randname']])) { - $des_func.= Html::convdate($_REQUEST['date1'.$opt['randname']]). - " / ".Html::convdate($_REQUEST['date2'.$opt['randname']]); - } - - $show_label = 'always'; - - $opt['class'] = $classname; - $params = ["raw_datas" => $datas, - "title" => $title_func, - "desc" => $des_func, - "export" => $opt['export'], - "opt" => $opt]; - - $graph->{'show'.$opt['gtype']}($params); - } - } - - static function generateOdt($params) { - global $LANG; - - $config = ['PATH_TO_TMP' => GLPI_DOC_DIR . '/_tmp']; - - $category = ''; - $description = ''; - $short_classname = str_replace('PluginMreporting', '', $params[0]['class']); - if (isset($LANG['plugin_mreporting'][$short_classname]['title'])) { - $category = $LANG['plugin_mreporting'][$short_classname]['title']; - $description = $LANG['plugin_mreporting'][$short_classname][$params[0]['f_name']]['desc']; - } - - $odf = new Odf("../templates/template.odt", $config); - $odf->setVars('category', $category, ENT_NOQUOTES, "utf-8"); - $odf->setVars('title', $params[0]['title'], ENT_NOQUOTES, "utf-8"); - $odf->setVars('description', $description, ENT_NOQUOTES, "utf-8"); - - $path = GLPI_PLUGIN_DOC_DIR."/mreporting/" . $params[0]['f_name'] . ".png"; - - if (is_file($path)) { - list($image_width, $image_height) = @getimagesize($path); - $image_width *= Odf::PIXEL_TO_CM; - $image_height *= Odf::PIXEL_TO_CM * 17 / $image_width; - $odf->setImage('image', $path, -1, 17, $image_height); - } else { - $odf->setVars('image', "", true, 'UTF-8'); - } - - $singledatas = $odf->setSegment('singledatas'); - $multipledatas = $odf->setSegment('multipledatas'); - - if ($params[0]['withdata']) { - $datas = $params[0]['raw_datas']['datas']; - $first = $datas; - $first = array_shift($first); - $is_multiple = is_array($first); - - // Multidatas graph - if ($is_multiple) { - $multipledatas->setVars('datas_title', mb_strtoupper(__('data', 'mreporting')), ENT_NOQUOTES, "utf-8"); - - foreach ($datas as $key => $value) { - $multipledatas->subtitle->datas_subtitle(mb_strtoupper($key), ENT_NOQUOTES, "utf-8"); - $multipledatas->subtitle->merge(); - - foreach ($value as $col => $val) { - $multipledatas->datas->row($col, ENT_NOQUOTES, "utf-8"); - $multipledatas->datas->value($val, ENT_NOQUOTES, "utf-8"); - $multipledatas->datas->merge(); - } - $multipledatas->merge(); + $graph->{'show' . $opt['gtype']}($params); + } + } + + public static function generateOdt($params) + { + global $LANG; + + $config = ['PATH_TO_TMP' => GLPI_DOC_DIR . '/_tmp']; + + $category = ''; + $description = ''; + $short_classname = str_replace('PluginMreporting', '', $params[0]['class']); + if (isset($LANG['plugin_mreporting'][$short_classname]['title'])) { + $category = $LANG['plugin_mreporting'][$short_classname]['title']; + $description = $LANG['plugin_mreporting'][$short_classname][$params[0]['f_name']]['desc']; + } + + $odf = new Odf("../templates/template.odt", $config); + $odf->setVars('category', $category, ENT_NOQUOTES, "utf-8"); + $odf->setVars('title', $params[0]['title'], ENT_NOQUOTES, "utf-8"); + $odf->setVars('description', $description, ENT_NOQUOTES, "utf-8"); + + $path = GLPI_PLUGIN_DOC_DIR . "/mreporting/" . $params[0]['f_name'] . ".png"; + + if (is_file($path)) { + list($image_width, $image_height) = @getimagesize($path); + $image_width *= Odf::PIXEL_TO_CM; + $image_height *= Odf::PIXEL_TO_CM * 17 / $image_width; + $odf->setImage('image', $path, -1, 17, $image_height); + } else { + $odf->setVars('image', "", true, 'UTF-8'); + } + + $singledatas = $odf->setSegment('singledatas'); + $multipledatas = $odf->setSegment('multipledatas'); + + if ($params[0]['withdata']) { + $datas = $params[0]['raw_datas']['datas']; + $first = $datas; + $first = array_shift($first); + $is_multiple = is_array($first); + + // Multidatas graph + if ($is_multiple) { + $multipledatas->setVars('datas_title', mb_strtoupper(__('data', 'mreporting')), ENT_NOQUOTES, "utf-8"); + + foreach ($datas as $key => $value) { + $multipledatas->subtitle->datas_subtitle(mb_strtoupper($key), ENT_NOQUOTES, "utf-8"); + $multipledatas->subtitle->merge(); + + foreach ($value as $col => $val) { + $multipledatas->datas->row($col, ENT_NOQUOTES, "utf-8"); + $multipledatas->datas->value($val, ENT_NOQUOTES, "utf-8"); + $multipledatas->datas->merge(); + } + $multipledatas->merge(); + } + + // Simples graph + } else { + $singledatas->setVars('datas_title', mb_strtoupper(__('data', 'mreporting')), ENT_NOQUOTES, "utf-8"); + foreach ($datas as $key => $value) { + $singledatas->datas->row($key, ENT_NOQUOTES, "utf-8"); + $singledatas->datas->value($value, ENT_NOQUOTES, "utf-8"); + $singledatas->datas->merge(); + } + $singledatas->merge(); } + } + $odf->mergeSegment($singledatas); + $odf->mergeSegment($multipledatas); + $odf->exportAsAttachedFile(); + } - // Simples graph - } else { - $singledatas->setVars('datas_title', mb_strtoupper(__('data', 'mreporting')), ENT_NOQUOTES, "utf-8"); - foreach ($datas as $key => $value) { - $singledatas->datas->row($key, ENT_NOQUOTES, "utf-8"); - $singledatas->datas->value($value, ENT_NOQUOTES, "utf-8"); - $singledatas->datas->merge(); - } - $singledatas->merge(); - } + // === SELECTOR FUNCTIONS ==== - } - $odf->mergeSegment($singledatas); - $odf->mergeSegment($multipledatas); - $odf->exportAsAttachedFile(); - } + public static function selectorForMultipleGroups($field, $condition = [], $label = '') + { + global $DB; - // === SELECTOR FUNCTIONS ==== + echo "
" . $label . " :
"; - static function selectorForMultipleGroups($field, $condition = [], $label = '') { - global $DB; - - echo "
".$label." :
"; - - $values = []; - if (isset($_SESSION['mreporting_values'][$field])) { - if (is_array($_SESSION['mreporting_values'][$field])) { //if link in from dashboard - $values = $_SESSION['mreporting_values'][$field]; - } else { - $values = [$_SESSION['mreporting_values'][$field]]; - } - } - - $datas = []; - $condition['ORDER'] = 'name'; - foreach (getAllDataFromTable('glpi_groups', $condition, false) as $data) { - $datas[$data['id']] = $data['completename']; - } - - $param = ['multiple' => true, - 'display' => true, - 'size' => count($values), - 'values' => $values]; - - Dropdown::showFromArray($field, $datas, $param); - } - - static function selectorForSingleGroup($field, $condition = [], $label = '') { - echo "
".$label." :
"; - - $value = isset($_SESSION['mreporting_values'][$field]) ? $_SESSION['mreporting_values'][$field] : 0; - - Dropdown::show("Group", ['comments' => false, - 'name' => $field, - 'value' => $value, - 'condition' => $condition]); - } - - - static function selectorGrouprequest() { - self::selectorForSingleGroup( - 'groups_request_id', - ['is_requester' => 1], - __("Requester group") - ); - } - - static function selectorGroupassign() { - self::selectorForSingleGroup( - 'groups_assign_id', - ['is_assign' => 1], - __("Group in charge of the ticket") - ); - } - - static function selectorMultipleGrouprequest() { - self::selectorForMultipleGroups( - 'groups_request_id', - ['is_requester' => '1'], - __("Requester group") - ); - } - - static function selectorMultipleGroupassign() { - self::selectorForMultipleGroups( - 'groups_assign_id', - ['is_assign' => '1'], - __("Group in charge of the ticket") - ); - } - - static function selectorUserassign() { - echo "
".__("Technician in charge of the ticket")." :
"; - $options = ['name' => 'users_assign_id', - 'entity' => isset($_SESSION['glpiactive_entity']) ? $_SESSION['glpiactive_entity'] : 0, - 'right' => 'own_ticket', - 'value' => isset($_SESSION['mreporting_values']['users_assign_id']) ? $_SESSION['mreporting_values']['users_assign_id'] : 0, - 'ldap_import' => false, - 'comments' => false]; - User::dropdown($options); - } + $values = []; + if (isset($_SESSION['mreporting_values'][$field])) { + if (is_array($_SESSION['mreporting_values'][$field])) { //if link in from dashboard + $values = $_SESSION['mreporting_values'][$field]; + } else { + $values = [$_SESSION['mreporting_values'][$field]]; + } + } + + $datas = []; + $condition['ORDER'] = 'name'; + foreach (getAllDataFromTable('glpi_groups', $condition, false) as $data) { + $datas[$data['id']] = $data['completename']; + } + + $param = ['multiple' => true, + 'display' => true, + 'size' => count($values), + 'values' => $values + ]; + + Dropdown::showFromArray($field, $datas, $param); + } + + public static function selectorForSingleGroup($field, $condition = [], $label = '') + { + echo "
" . $label . " :
"; + + $value = isset($_SESSION['mreporting_values'][$field]) ? $_SESSION['mreporting_values'][$field] : 0; + + Dropdown::show("Group", ['comments' => false, + 'name' => $field, + 'value' => $value, + 'condition' => $condition + ]); + } + + + public static function selectorGrouprequest() + { + self::selectorForSingleGroup( + 'groups_request_id', + ['is_requester' => 1], + __("Requester group") + ); + } + + public static function selectorGroupassign() + { + self::selectorForSingleGroup( + 'groups_assign_id', + ['is_assign' => 1], + __("Group in charge of the ticket") + ); + } + + public static function selectorMultipleGrouprequest() + { + self::selectorForMultipleGroups( + 'groups_request_id', + ['is_requester' => '1'], + __("Requester group") + ); + } + + public static function selectorMultipleGroupassign() + { + self::selectorForMultipleGroups( + 'groups_assign_id', + ['is_assign' => '1'], + __("Group in charge of the ticket") + ); + } + + public static function selectorUserassign() + { + echo "
" . __("Technician in charge of the ticket") . " :
"; + $options = ['name' => 'users_assign_id', + 'entity' => isset($_SESSION['glpiactive_entity']) ? $_SESSION['glpiactive_entity'] : 0, + 'right' => 'own_ticket', + 'value' => isset($_SESSION['mreporting_values']['users_assign_id']) ? $_SESSION['mreporting_values']['users_assign_id'] : 0, + 'ldap_import' => false, + 'comments' => false + ]; + User::dropdown($options); + } /** * Show the selector for tickets status (new, open, solved, closed...) */ - static function selectorAllSlasWithTicket() { - global $LANG, $DB; + public static function selectorAllSlasWithTicket() + { + global $LANG, $DB; - echo "" . $LANG['plugin_mreporting']['Helpdeskplus']['selector']["slas"] . " :
"; + echo "" . $LANG['plugin_mreporting']['Helpdeskplus']['selector']["slas"] . " :
"; - $query = "SELECT DISTINCT s.id, + $query = "SELECT DISTINCT s.id, s.name FROM glpi_slas s INNER JOIN glpi_tickets t ON s.id = t.slas_id_ttr WHERE t.status IN (" . implode( ',', array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray()) - ) . ") + ) . ") AND t.is_deleted = '0' ORDER BY s.name ASC"; - $result = $DB->query($query); - - $values = []; - while ($data = $DB->fetchAssoc($result)) { - $values[$data['id']] = $data['name']; - } - - $selected_values = isset($_SESSION['mreporting_values']['slas']) ? $_SESSION['mreporting_values']['slas'] : []; - - Dropdown::showFromArray('slas', $values, ['values' => $selected_values, - 'multiple' => true, - 'readonly' => false]); - } - - static function selectorPeriod($period = "day") { - global $LANG; - - echo ''.$LANG['plugin_mreporting']['Helpdeskplus']['period'].' :
'; - - $elements = [ - 'day' => _n("Day", "Days", 1), - 'week' => __("Week", 'mreporting'), - 'month' => __("Month", 'mreporting'), - 'year' => __("By year")]; - - Dropdown::showFromArray("period", $elements, - ['value' => isset($_SESSION['mreporting_values']['period']) - ? $_SESSION['mreporting_values']['period'] : 'month']); - } - - static function selectorType() { - echo "
"._n("Type", "Types", 1) ." :
"; - Ticket::dropdownType('type', - ['value' => isset($_SESSION['mreporting_values']['type']) - ? $_SESSION['mreporting_values']['type'] : Ticket::INCIDENT_TYPE]); - - } - - static function selectorCategory($type = true) { - global $CFG_GLPI; - - echo "
"._n('Ticket category', 'Ticket categories', 2) ." :
"; - if ($type) { - $rand = Ticket::dropdownType('type', - ['value' => isset($_SESSION['mreporting_values']['type']) + $result = $DB->query($query); + + $values = []; + while ($data = $DB->fetchAssoc($result)) { + $values[$data['id']] = $data['name']; + } + + $selected_values = isset($_SESSION['mreporting_values']['slas']) ? $_SESSION['mreporting_values']['slas'] : []; + + Dropdown::showFromArray('slas', $values, ['values' => $selected_values, + 'multiple' => true, + 'readonly' => false + ]); + } + + public static function selectorPeriod($period = "day") + { + global $LANG; + + echo '' . $LANG['plugin_mreporting']['Helpdeskplus']['period'] . ' :
'; + + $elements = [ + 'day' => _n("Day", "Days", 1), + 'week' => __("Week", 'mreporting'), + 'month' => __("Month", 'mreporting'), + 'year' => __("By year") + ]; + + Dropdown::showFromArray( + "period", + $elements, + ['value' => isset($_SESSION['mreporting_values']['period']) + ? $_SESSION['mreporting_values']['period'] : 'month' + ] + ); + } + + public static function selectorType() + { + echo "
" . _n("Type", "Types", 1) . " :
"; + Ticket::dropdownType( + 'type', + ['value' => isset($_SESSION['mreporting_values']['type']) + ? $_SESSION['mreporting_values']['type'] : Ticket::INCIDENT_TYPE + ] + ); + } + + public static function selectorCategory($type = true) + { + global $CFG_GLPI; + + echo "
" . _n('Ticket category', 'Ticket categories', 2) . " :
"; + if ($type) { + $rand = Ticket::dropdownType( + 'type', + ['value' => isset($_SESSION['mreporting_values']['type']) ? $_SESSION['mreporting_values']['type'] : Ticket::INCIDENT_TYPE, - 'toadd' => [-1 => __('All')]]); - $params = ['type' => '__VALUE__', - 'currenttype' => Ticket::INCIDENT_TYPE, - 'entity_restrict' => -1, - 'condition' => ['is_incident' => 1], - 'value' => isset($_SESSION['mreporting_values']['itilcategories_id']) + 'toadd' => [-1 => __('All')] + ] + ); + $params = ['type' => '__VALUE__', + 'currenttype' => Ticket::INCIDENT_TYPE, + 'entity_restrict' => -1, + 'condition' => ['is_incident' => 1], + 'value' => isset($_SESSION['mreporting_values']['itilcategories_id']) ? $_SESSION['mreporting_values']['itilcategories_id'] - : 0]; - echo ""; - } - - $params['comments'] = false; - ITILCategory::dropdown($params); - - if ($type) { - echo ""; - - Ajax::updateItemOnSelectEvent("dropdown_type$rand", "show_category_by_type", - $CFG_GLPI["root_doc"]."/ajax/dropdownTicketCategories.php", - $params); - } - } - - static function selectorLimit() { - echo "".__("Maximal count")." :
"; - - Dropdown::showListLimit(); // glpilist_limit - } - - - static function selectorAllstates() { - echo "
"._n('Status', 'Statuses', 2)." :
"; - $default = [CommonITILObject::INCOMING, - CommonITILObject::ASSIGNED, - CommonITILObject::PLANNED, - CommonITILObject::WAITING]; - - $i = 1; - foreach (Ticket::getAllStatusArray() as $value => $name) { - echo ''; - if ($i%3 == 0) { - echo "
"; - } - $i++; - } - } - - static function selectorDateinterval() { - $randname = 'PluginMreporting'.$_REQUEST['short_classname'].$_REQUEST['f_name']; - - if (!isset($_SESSION['mreporting_values']['date1'.$randname])) { - $_SESSION['mreporting_values']['date1'.$randname] = strftime("%Y-%m-%d", time() - (365 * 24 * 60 * 60)); - } - if (!isset($_SESSION['mreporting_values']['date2'.$randname])) { - $_SESSION['mreporting_values']['date2'.$randname] = strftime("%Y-%m-%d"); - } - - $date1 = $_SESSION['mreporting_values']["date1".$randname]; - echo "".__("Start date")."
"; - Html::showDateField("date1$randname", ['value' => $date1, - 'maybeempty' => false]); - echo ""; - - $date2 = $_SESSION['mreporting_values']["date2".$randname]; - echo ""; - echo "".__("End date")."
"; - Html::showDateField("date2$randname", ['value' => $date2, - 'maybeempty' => false]); - } + : 0 + ]; + echo ""; + } + + $params['comments'] = false; + ITILCategory::dropdown($params); + + if ($type) { + echo ""; + + Ajax::updateItemOnSelectEvent( + "dropdown_type$rand", + "show_category_by_type", + $CFG_GLPI["root_doc"] . "/ajax/dropdownTicketCategories.php", + $params + ); + } + } + + public static function selectorLimit() + { + echo "" . __("Maximal count") . " :
"; + + Dropdown::showListLimit(); // glpilist_limit + } + + + public static function selectorAllstates() + { + echo "
" . _n('Status', 'Statuses', 2) . " :
"; + $default = [CommonITILObject::INCOMING, + CommonITILObject::ASSIGNED, + CommonITILObject::PLANNED, + CommonITILObject::WAITING + ]; + + $i = 1; + foreach (Ticket::getAllStatusArray() as $value => $name) { + echo ''; + if ($i % 3 == 0) { + echo "
"; + } + $i++; + } + } + + public static function selectorDateinterval() + { + $randname = 'PluginMreporting' . $_REQUEST['short_classname'] . $_REQUEST['f_name']; + + if (!isset($_SESSION['mreporting_values']['date1' . $randname])) { + $_SESSION['mreporting_values']['date1' . $randname] = date("Y-m-d", time() - (365 * 24 * 60 * 60)); + } + if (!isset($_SESSION['mreporting_values']['date2' . $randname])) { + $_SESSION['mreporting_values']['date2' . $randname] = date("Y-m-d"); + } + + $date1 = $_SESSION['mreporting_values']["date1" . $randname]; + echo "" . __("Start date") . "
"; + Html::showDateField("date1$randname", ['value' => $date1, + 'maybeempty' => false + ]); + echo ""; + + $date2 = $_SESSION['mreporting_values']["date2" . $randname]; + echo ""; + echo "" . __("End date") . "
"; + Html::showDateField("date2$randname", ['value' => $date2, + 'maybeempty' => false + ]); + } /** * Show entity level selector. * @return display selector */ - static function selectorEntityLevel() { - global $DB; + public static function selectorEntityLevel() + { + global $DB; - echo "".__('Max depth entity level', 'mreporting')." :
"; + echo "" . __('Max depth entity level', 'mreporting') . " :
"; - $default_level = self::getActiveEntityLevel(); - if (isset($_SESSION['mreporting_values']['entitylevel'])) { - $selected = $_SESSION['mreporting_values']['entitylevel']; - } else { - $selected = $default_level; - } + $default_level = self::getActiveEntityLevel(); + if (isset($_SESSION['mreporting_values']['entitylevel'])) { + $selected = $_SESSION['mreporting_values']['entitylevel']; + } else { + $selected = $default_level; + } - $values = [$default_level]; - $maxlevel = self::getMaxEntityLevel(); - for ($i=($default_level+1); $i<=$maxlevel; $i++) { - $values[$i] = $i; - } + $values = [$default_level]; + $maxlevel = self::getMaxEntityLevel(); + for ($i = ($default_level + 1); $i <= $maxlevel; $i++) { + $values[$i] = $i; + } - return Dropdown::showFromArray('entitylevel', $values, ['value' => $selected]); - } + return Dropdown::showFromArray('entitylevel', $values, ['value' => $selected]); + } /** * Get SQL condition to filter entity depth by level. * @param string $field the sql table field to compare * @return string sql condition */ - static function getSQLEntityLevel($field = "`glpi_entities`.`level`") { + public static function getSQLEntityLevel($field = "`glpi_entities`.`level`") + { - if (isset($_SESSION['mreporting_values']['entitylevel'])) { - $maxlevel = $_SESSION['mreporting_values']['entitylevel']; - } else { - $maxlevel = self::getMaxEntityLevel(); - } + if (isset($_SESSION['mreporting_values']['entitylevel'])) { + $maxlevel = $_SESSION['mreporting_values']['entitylevel']; + } else { + $maxlevel = self::getMaxEntityLevel(); + } - $default_level = self::getActiveEntityLevel(); + $default_level = self::getActiveEntityLevel(); - $where_entities_level = "({$field} = {$default_level}"; - for ($i=($default_level+1); $i<=$maxlevel; $i++) { - $where_entities_level.= " OR {$field} = {$i}"; - } - $where_entities_level.= ")"; + $where_entities_level = "({$field} = {$default_level}"; + for ($i = ($default_level + 1); $i <= $maxlevel; $i++) { + $where_entities_level .= " OR {$field} = {$i}"; + } + $where_entities_level .= ")"; - return $where_entities_level; - } + return $where_entities_level; + } /** * Get active entity level according to GLPi SESSION * @return integer default entity level */ - static function getActiveEntityLevel() { - - if (isset($_SESSION['glpiactive_entity'])) { - $Entity = new Entity(); - $Entity->getFromDB($_SESSION['glpiactive_entity']); - return $Entity->fields['level']; - } else { - return 0; - } - } + public static function getActiveEntityLevel() + { + + if (isset($_SESSION['glpiactive_entity'])) { + $Entity = new Entity(); + $Entity->getFromDB($_SESSION['glpiactive_entity']); + return $Entity->fields['level']; + } else { + return 0; + } + } /** * Get max entity level according to GLPi SESSION current active entity * @return integer max entity level */ - static function getMaxEntityLevel() { - global $DB; + public static function getMaxEntityLevel() + { + global $DB; - if (count($_SESSION['glpiactiveentities']) > 1) { - $restrict = " `id` IN ({$_SESSION['glpiactiveentities_string']})"; - } else { - $restrict = " `id` = {$_SESSION['glpiactiveentities_string']}"; - } + if (count($_SESSION['glpiactiveentities']) > 1) { + $restrict = " `id` IN ({$_SESSION['glpiactiveentities_string']})"; + } else { + $restrict = " `id` = {$_SESSION['glpiactiveentities_string']}"; + } - $query = "SELECT MAX(level) AS 'maxlevel' + $query = "SELECT MAX(level) AS 'maxlevel' FROM glpi_entities WHERE {$restrict}"; - $result = $DB->query($query); - if ($DB->numrows($result) > 0) { - return $DB->result($result, 0, "maxlevel"); - } else { - return 0; - } - } - - static function canAccessAtLeastOneReport($profiles_id) { - return countElementsInTable("glpi_plugin_mreporting_profiles", - ['profiles_id' => $profiles_id, 'right' => READ]); - } - - static function showNavigation() { - echo "
"; - echo "".__("Back").""; - echo "
"; - } + $result = $DB->query($query); + if ($DB->numrows($result) > 0) { + return $DB->result($result, 0, "maxlevel"); + } else { + return 0; + } + } + + public static function canAccessAtLeastOneReport($profiles_id) + { + return countElementsInTable( + "glpi_plugin_mreporting_profiles", + ['profiles_id' => $profiles_id, 'right' => READ] + ); + } + + public static function showNavigation() + { + echo "
"; + echo "" . __("Back") . ""; + echo "
"; + } /** * Transform a request var into a get string * @param array $var the request string ($_REQUEST, $_POST, $_GET) * @return string the imploded array. Format : $key=$value&$key2=$value2... */ - static function getRequestString($var) { - unset($var['submit']); + public static function getRequestString($var) + { + unset($var['submit']); - // For have clean URL (best practice) - if (isset($var['reset'])) { - unset($var['reset']); - } + // For have clean URL (best practice) + if (isset($var['reset'])) { + unset($var['reset']); + } - return http_build_query($var); - } + return http_build_query($var); + } /** @@ -1633,193 +1738,206 @@ static function getRequestString($var) { * @param datetime $date1 date of start * @param datetime $date2 date of ending * @param string $randname random string (to prevent conflict in js selection) - * @return nothing + * @return void */ - static function showSelector($date1, $date2, $randname) { - global $CFG_GLPI; + public static function showSelector($date1, $date2, $randname) + { + global $CFG_GLPI; - if (!isset($_REQUEST['f_name'])) { - $has_selector = false; //Security - } else { - $has_selector = (isset($_SESSION['mreporting_selector'][$_REQUEST['f_name']])); - } + if (!isset($_REQUEST['f_name'])) { + $has_selector = false; //Security + } else { + $has_selector = (isset($_SESSION['mreporting_selector'][$_REQUEST['f_name']])); + } - echo "
"; - $request_string = self::getRequestString($_GET); - echo ""; + echo "
"; + $request_string = self::getRequestString($_GET); + echo ""; - echo ""; - echo ""; + echo "
"; + echo ""; - if ($has_selector) { - self::getReportSelectors(); - } + if ($has_selector) { + self::getReportSelectors(); + } - echo ""; - echo ""; + //If there's no selector for the report, there's no need for a reset button ! + if ($has_selector) { + echo "  "; + echo "\"""; + echo ""; + } + echo ""; + echo ""; - echo "
"; - if ($has_selector) { - echo ""; - } - $_SERVER['REQUEST_URI'] .= "&date1".$randname."=".$date1."&date2".$randname."=".$date2; + echo ""; + if ($has_selector) { + echo ""; + } + $_SERVER['REQUEST_URI'] .= "&date1" . $randname . "=" . $date1 . "&date2" . $randname . "=" . $date2; - SavedSearch::showSaveButton(SavedSearch::URI, __CLASS__); + SavedSearch::showSaveButton(SavedSearch::URI, __CLASS__); - //If there's no selector for the report, there's no need for a reset button ! - if ($has_selector) { - echo "  "; - echo "\"".__s('Blank')."\""; - echo ""; - } - echo "
"; - Html::closeForm(); + echo ""; + Html::closeForm(); - echo "
"; + echo "
"; - unset($_SESSION['mreporting_selector']); - } + unset($_SESSION['mreporting_selector']); + } /** * Parse and include selectors functions */ - static function getReportSelectors($export = false) { - ob_start(); - self::addToSelector(); - $graphname = $_REQUEST['f_name']; - if (!isset($_SESSION['mreporting_selector'][$graphname]) - || empty($_SESSION['mreporting_selector'][$graphname])) { - return; - } - - $classname = 'PluginMreporting'.$_REQUEST['short_classname']; - if (!class_exists($classname)) { - return; - } - - $i = 1; - foreach ($_SESSION['mreporting_selector'][$graphname] as $selector) { - if ($i%4 == 0) { - echo ''; - } - $selector = 'selector'.ucfirst($selector); - if (method_exists('PluginMreportingCommon', $selector)) { - $classselector = 'PluginMreportingCommon'; - } else if (method_exists($classname, $selector)) { - $classselector = $classname; - } else { - continue; - } - - $i++; - echo ''; - $classselector::$selector(); - echo ''; - } - while ($i%4 != 0) { - $i++; - echo ' '; - } - - $content = ob_get_clean(); - - if ($export) { - return $content; - } - echo $content; - } - - static function saveSelectors($graphname, $config = []) { - $remove = ['short_classname', 'f_name', 'gtype', 'submit']; - $values = []; - - foreach ($_REQUEST as $key => $value) { - if (!preg_match("/^_/", $key) && !in_array($key, $remove)) { - $values[$key] = $value; - } - if (empty($value)) { - unset($_REQUEST[$key]); - } - } - - //clean unmodified date - if (isset($config['randname'])) { - if (isset($_REQUEST['date1'.$config['randname']]) - && $_REQUEST['date1'.$config['randname']] - == $_SESSION['mreporting_values']['date1'.$config['randname']]) { - unset($_REQUEST['date1'.$config['randname']]); - } - if (isset($_REQUEST['date2'.$config['randname']]) - && $_REQUEST['date2'.$config['randname']] - == $_SESSION['mreporting_values']['date2'.$config['randname']]) { - unset($_REQUEST['date2'.$config['randname']]); - } - } - - if (!empty($values)) { - $pref = new PluginMreportingPreference(); - $id = $pref->addDefaultPreference(Session::getLoginUserID()); - $tmp['id'] = $id; - - $pref->getFromDB($id); - - if (!is_null($pref->fields['selectors'])) { - $selectors = $pref->fields['selectors']; - $sel = json_decode(stripslashes($selectors), true); - $sel[$graphname] = $values; - } else { - $sel = $values; - } - $tmp['selectors'] = addslashes(json_encode($sel)); - $pref->update($tmp); - } - $_SESSION['mreporting_values'] = $values; - } - - static function getSelectorValuesByUser() { - global $DB; - - $myvalues = (isset($_SESSION['mreporting_values'])?$_SESSION['mreporting_values']:[]); - $selectors = PluginMreportingPreference::checkPreferenceValue('selectors', Session::getLoginUserID()); - if ($selectors) { - $values = json_decode(stripslashes($selectors), true); - if (isset($values[$_REQUEST['f_name']])) { - foreach ($values[$_REQUEST['f_name']] as $key => $value) { - $myvalues[$key] = $value; + public static function getReportSelectors($export = false) + { + ob_start(); + self::addToSelector(); + $graphname = isset($_REQUEST['f_name']) ? $_REQUEST['f_name'] : false; + if ( + !$graphname + || !isset($_SESSION['mreporting_selector'][$graphname]) + || empty($_SESSION['mreporting_selector'][$graphname]) + ) { + return; + } + + $classname = 'PluginMreporting' . $_REQUEST['short_classname']; + if (!class_exists($classname)) { + return; + } + + $i = 1; + foreach ($_SESSION['mreporting_selector'][$graphname] as $selector) { + if ($i % 4 == 0) { + echo ''; + } + $selector = 'selector' . ucfirst($selector); + if (method_exists('PluginMreportingCommon', $selector)) { + $classselector = 'PluginMreportingCommon'; + } else if (method_exists($classname, $selector)) { + $classselector = $classname; + } else { + continue; + } + + $i++; + echo ''; + $classselector::$selector(); + echo ''; + } + while ($i % 4 != 0) { + $i++; + echo ' '; + } + + $content = ob_get_clean(); + + if ($export) { + return $content; + } + echo $content; + } + + public static function saveSelectors($graphname, $config = []) + { + $remove = ['short_classname', 'f_name', 'gtype', 'submit']; + $values = []; + + foreach ($_REQUEST as $key => $value) { + if (!preg_match("/^_/", $key) && !in_array($key, $remove)) { + $values[$key] = $value; + } + if (empty($value)) { + unset($_REQUEST[$key]); + } + } + + //clean unmodified date + if (isset($config['randname'])) { + if ( + isset($_REQUEST['date1' . $config['randname']]) + && $_REQUEST['date1' . $config['randname']] + == $_SESSION['mreporting_values']['date1' . $config['randname']] + ) { + unset($_REQUEST['date1' . $config['randname']]); } - } - } - $_SESSION['mreporting_values'] = $myvalues; - } - - static function addToSelector() { - foreach ($_REQUEST as $key => $value) { - if (!isset($_SESSION['mreporting_values'][$key])) { - $_SESSION['mreporting_values'][$key] = $value; - } - } - } - - static function resetSelectorsForReport($report_name) { - global $DB; - - $users_id = Session::getLoginUserID(); - $selectors = PluginMreportingPreference::checkPreferenceValue('selectors', $users_id); - - if ($selectors) { - $values = json_decode(stripslashes($selectors), true); - if (isset($values[$report_name])) { - unset($values[$report_name]); - } - $selector = addslashes(json_encode($values)); - - $query = "UPDATE `glpi_plugin_mreporting_preferences` + if ( + isset($_REQUEST['date2' . $config['randname']]) + && $_REQUEST['date2' . $config['randname']] + == $_SESSION['mreporting_values']['date2' . $config['randname']] + ) { + unset($_REQUEST['date2' . $config['randname']]); + } + } + + if (!empty($values)) { + $pref = new PluginMreportingPreference(); + $id = $pref->addDefaultPreference(Session::getLoginUserID()); + $tmp['id'] = $id; + + $pref->getFromDB($id); + + if (!is_null($pref->fields['selectors'])) { + $selectors = $pref->fields['selectors']; + $sel = json_decode(stripslashes($selectors), true); + $sel[$graphname] = $values; + } else { + $sel = $values; + } + $tmp['selectors'] = addslashes(json_encode($sel)); + $pref->update($tmp); + } + $_SESSION['mreporting_values'] = $values; + } + + public static function getSelectorValuesByUser() + { + global $DB; + + $myvalues = (isset($_SESSION['mreporting_values']) ? $_SESSION['mreporting_values'] : []); + $selectors = PluginMreportingPreference::checkPreferenceValue('selectors', Session::getLoginUserID()); + if ($selectors) { + $values = json_decode(stripslashes($selectors), true); + if (isset($_REQUEST['f_name']) && isset($values[$_REQUEST['f_name']])) { + foreach ($values[$_REQUEST['f_name']] as $key => $value) { + $myvalues[$key] = $value; + } + } + } + $_SESSION['mreporting_values'] = $myvalues; + } + + public static function addToSelector() + { + foreach ($_REQUEST as $key => $value) { + if (!isset($_SESSION['mreporting_values'][$key])) { + $_SESSION['mreporting_values'][$key] = $value; + } + } + } + + public static function resetSelectorsForReport($report_name) + { + global $DB; + + $users_id = Session::getLoginUserID(); + $selectors = PluginMreportingPreference::checkPreferenceValue('selectors', $users_id); + + if ($selectors) { + $values = json_decode(stripslashes($selectors), true); + if (isset($values[$report_name])) { + unset($values[$report_name]); + } + $selector = addslashes(json_encode($values)); + + $query = "UPDATE `glpi_plugin_mreporting_preferences` SET `selectors`='$selector' WHERE `users_id`='$users_id'"; - $DB->query($query); - } - } + $DB->query($query); + } + } /** * Generate a SQL date test with $_REQUEST date fields @@ -1829,36 +1947,37 @@ static function resetSelectorsForReport($report_name) { * @param string $randname random string (to prevent conflict in js selection) * @return string The sql test to insert in your query */ - static function getSQLDate($field = "`glpi_tickets`.`date`", $delay = 365, $randname = '') { - - if (empty($_SESSION['mreporting_values']['date1'.$randname])) { - $_SESSION['mreporting_values']['date1'.$randname] = strftime("%Y-%m-%d", time() - ($delay * 24 * 60 * 60)); - } - if (empty($_SESSION['mreporting_values']['date2'.$randname])) { - $_SESSION['mreporting_values']['date2'.$randname] = strftime("%Y-%m-%d"); - } - - $date_array1=explode("-", $_SESSION['mreporting_values']['date1'.$randname]); - $time1=mktime(0, 0, 0, $date_array1[1], $date_array1[2], $date_array1[0]); - - $date_array2=explode("-", $_SESSION['mreporting_values']['date2'.$randname]); - $time2=mktime(0, 0, 0, $date_array2[1], $date_array2[2], $date_array2[0]); - - //if data inverted, reverse it - if ($time1 > $time2) { - list($time1, $time2) = [$time2, $time1]; - list($_SESSION['mreporting_values']['date1'.$randname], - $_SESSION['mreporting_values']['date2'.$randname]) = [ - $_SESSION['mreporting_values']['date2'.$randname], - $_SESSION['mreporting_values']['date1'.$randname] + public static function getSQLDate($field = "`glpi_tickets`.`date`", $delay = 365, $randname = '') + { + + if (empty($_SESSION['mreporting_values']['date1' . $randname])) { + $_SESSION['mreporting_values']['date1' . $randname] = date("Y-m-d", time() - ($delay * 24 * 60 * 60)); + } + if (empty($_SESSION['mreporting_values']['date2' . $randname])) { + $_SESSION['mreporting_values']['date2' . $randname] = date("Y-m-d"); + } + + $date_array1 = explode("-", $_SESSION['mreporting_values']['date1' . $randname]); + $time1 = mktime(0, 0, 0, $date_array1[1], $date_array1[2], $date_array1[0]); + + $date_array2 = explode("-", $_SESSION['mreporting_values']['date2' . $randname]); + $time2 = mktime(0, 0, 0, $date_array2[1], $date_array2[2], $date_array2[0]); + + //if data inverted, reverse it + if ($time1 > $time2) { + list($time1, $time2) = [$time2, $time1]; + list($_SESSION['mreporting_values']['date1' . $randname], + $_SESSION['mreporting_values']['date2' . $randname]) = [ + $_SESSION['mreporting_values']['date2' . $randname], + $_SESSION['mreporting_values']['date1' . $randname] ]; - } + } - $begin=date("Y-m-d H:i:s", $time1); - $end=date("Y-m-d H:i:s", $time2); + $begin = date("Y-m-d H:i:s", $time1); + $end = date("Y-m-d H:i:s", $time2); - return "($field >= '$begin' AND $field <= ADDDATE('$end', INTERVAL 1 DAY) )"; - } + return "($field >= '$begin' AND $field <= ADDDATE('$end', INTERVAL 1 DAY) )"; + } /** @@ -1866,28 +1985,29 @@ static function getSQLDate($field = "`glpi_tickets`.`date`", $delay = 365, $rand * @param array() $array the array to compute * @return number the sum */ - static function getArrayMaxValue($array) { - $max = 0; - - if (!is_array($array)) { - return $array; - } - - foreach ($array as $value) { - if (is_array($value)) { - $sub_max = self::getArrayMaxValue($value); - if ($sub_max > $max) { - $max = $sub_max; - } - } else { - if ($value > $max) { - $max = $value; + public static function getArrayMaxValue($array) + { + $max = 0; + + if (!is_array($array)) { + return $array; + } + + foreach ($array as $value) { + if (is_array($value)) { + $sub_max = self::getArrayMaxValue($value); + if ($sub_max > $max) { + $max = $sub_max; + } + } else { + if ($value > $max) { + $max = $value; + } } - } - } + } - return $max; - } + return $max; + } /** @@ -1895,23 +2015,24 @@ static function getArrayMaxValue($array) { * @param array() $array the array where to seek * @return number the sum */ - static function getArraySum($array) { - $sum = 0; + public static function getArraySum($array) + { + $sum = 0; - if (!is_array($array)) { - return $array; - } + if (!is_array($array)) { + return $array; + } - foreach ($array as $value) { - if (is_array($value)) { - $sum+= self::getArraySum($value); - } else { - $sum+= $value; - } - } + foreach ($array as $value) { + if (is_array($value)) { + $sum += self::getArraySum($value); + } else { + $sum += $value; + } + } - return $sum; - } + return $sum; + } /** @@ -1919,21 +2040,22 @@ static function getArraySum($array) { * @param array() $array the array where to seek * @return number the sum */ - static function getArrayDepth($array) { - $max_depth = 1; + public static function getArrayDepth($array) + { + $max_depth = 1; - foreach ($array as $value) { - if (is_array($value)) { - $depth = self::getArrayDepth($value) + 1; + foreach ($array as $value) { + if (is_array($value)) { + $depth = self::getArrayDepth($value) + 1; - if ($depth > $max_depth) { - $max_depth = $depth; + if ($depth > $max_depth) { + $max_depth = $depth; + } } - } - } + } - return $max_depth; - } + return $max_depth; + } /** @@ -1941,11 +2063,12 @@ static function getArrayDepth($array) { * @param array $flat_array the flat array. Format : array('id', 'parent', 'name', 'count') * @return array the tree array. Format : array(name => array(name2 => array(count), ...) */ - static function buildTree($flat_array) { - $raw_tree = self::mapTree($flat_array); - $tree = self::cleanTree($raw_tree); - return $tree; - } + public static function buildTree($flat_array) + { + $raw_tree = self::mapTree($flat_array); + $tree = self::cleanTree($raw_tree); + return $tree; + } /** @@ -1953,20 +2076,21 @@ static function buildTree($flat_array) { * @param array $flat_array the flat array. Format : array('id', 'parent', 'name', 'count') * @return array the tree array. Format : array(orginal_keys, children => array(...) */ - static function mapTree(array &$elements, $parentId = 0) { - $branch = []; - - foreach ($elements as $element) { - if (isset($element['parent']) && $element['parent'] == $parentId) { - $children = self::mapTree($elements, $element['id']); - if ($children) { - $element['children'] = $children; + public static function mapTree(array &$elements, $parentId = 0) + { + $branch = []; + + foreach ($elements as $element) { + if (isset($element['parent']) && $element['parent'] == $parentId) { + $children = self::mapTree($elements, $element['id']); + if ($children) { + $element['children'] = $children; + } + $branch[$element['id']] = $element; } - $branch[$element['id']] = $element; - } - } - return $branch; - } + } + return $branch; + } /** @@ -1976,48 +2100,51 @@ static function mapTree(array &$elements, $parentId = 0) { * @return array the tree array. * Format : array(name => array(name2 => array(count), ...) */ - static function cleanTree($raw_tree) { - $tree = []; - - foreach ($raw_tree as $id => $node) { - if (isset($node['children'])) { - $sub = self::cleanTree($node['children']); - - if ($node['count'] > 0) { - $current = [$node['name'] => intval($node['count'])]; - $tree[$node['name']] = array_merge($current, $sub); + public static function cleanTree($raw_tree) + { + $tree = []; + + foreach ($raw_tree as $id => $node) { + if (isset($node['children'])) { + $sub = self::cleanTree($node['children']); + + if ($node['count'] > 0) { + $current = [$node['name'] => intval($node['count'])]; + $tree[$node['name']] = array_merge($current, $sub); + } else { + $tree[$node['name']] = $sub; + } } else { - $tree[$node['name']] = $sub; + $tree[$node['name']] = intval($node['count']); } - } else { - $tree[$node['name']] = intval($node['count']); - } - } - - return $tree; - } - - static function getReportIcon($report_name) { - //see font-awesome : http://fortawesome.github.io/Font-Awesome/cheatsheet/ - $icons = [ - 'pie' => "", - 'hbar' => "", - 'hgbar' => "", - 'line' => "", - 'gline' => "", - 'area' => "", - 'garea' => "", - 'vstackbar' => "", - 'sunburst' => "", - ]; - - $extract = preg_split('/(?<=\\w)(?=[A-Z])/', $report_name); - $chart_type = strtolower($extract[1]); - - return $icons[$chart_type]; - } - - static function getIcon() { - return 'fa fa-chart-pie'; - } + } + + return $tree; + } + + public static function getReportIcon($report_name) + { + //see font-awesome : http://fortawesome.github.io/Font-Awesome/cheatsheet/ + $icons = [ + 'pie' => "", + 'hbar' => "", + 'hgbar' => "", + 'line' => "", + 'gline' => "", + 'area' => "", + 'garea' => "", + 'vstackbar' => "", + 'sunburst' => "", + ]; + + $extract = preg_split('/(?<=\\w)(?=[A-Z])/', $report_name); + $chart_type = strtolower($extract[1]); + + return $icons[$chart_type]; + } + + public static function getIcon() + { + return 'fa fa-chart-pie'; + } } diff --git a/inc/config.class.php b/inc/config.class.php index 1549b6bc..c62b63b2 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -1,195 +1,201 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); + die("Sorry. You can't access directly to this file"); } -class PluginMreportingConfig extends CommonDBTM { - static $rightname = 'config'; +class PluginMreportingConfig extends CommonDBTM +{ + public static $rightname = 'config'; - static function getTypeName($nb = 0) { - return __("Configuration", 'mreporting'); - } + public static function getTypeName($nb = 0) + { + return __("Configuration", 'mreporting'); + } /** * Définition des onglets **/ - function defineTabs($options = []) { - $ong = []; - $this->addDefaultFormTab($ong); - $this->addStandardTab('PluginMreportingProfile', $ong, $options); - return $ong; - } - - - function rawSearchOptions() { - - $tab = []; - - $tab[] = [ - 'id' => 'common', - 'name' => self::getTypeName(), - ]; - - $tab[] = [ - 'id' => '1', - 'table' => $this->getTable(), - 'field' => 'name', - 'name' => __('Name'), - 'datatype' => 'itemlink', - 'itemlink_type' => $this->getType(), - ]; - - $tab[] = [ - 'id' => '2', - 'table' => $this->getTable(), - 'field' => 'is_active', - 'name' => __('Active'), - 'datatype' => 'bool', - ]; - - $tab[] = [ - 'id' => '3', - 'table' => $this->getTable(), - 'field' => 'show_area', - 'name' => __('See area', 'mreporting'), - 'datatype' => 'bool', - 'massiveaction' => false, - ]; - - $tab[] = [ - 'id' => '4', - 'table' => $this->getTable(), - 'field' => 'spline', - 'name' => __('Curve lines (SVG)', 'mreporting'), - 'datatype' => 'bool', - 'massiveaction' => false, - ]; - - $tab[] = [ - 'id' => '5', - 'table' => $this->getTable(), - 'field' => 'show_label', - 'name' => __('See values', 'mreporting'), - 'datatype' => 'specific', - 'searchtype' => 'equals', - 'massiveaction' => false, - ]; - - $tab[] = [ - 'id' => '6', - 'table' => $this->getTable(), - 'field' => 'flip_data', - 'name' => __('Reverse data array', 'mreporting'), - 'datatype' => 'bool', - 'massiveaction' => false, - ]; - - $tab[] = [ - 'id' => '7', - 'table' => $this->getTable(), - 'field' => 'unit', - 'name' => __('Unit', 'mreporting'), - 'autocomplete' => true, - ]; - - $tab[] = [ - 'id' => '8', - 'table' => $this->getTable(), - 'field' => 'default_delay', - 'name' => __('Default delay', 'mreporting'), - 'autocomplete' => true, - ]; - - $tab[] = [ - 'id' => '9', - 'table' => $this->getTable(), - 'field' => 'condition', - 'name' => __('Additional condition for MySQL', 'mreporting'), - 'autocomplete' => true, - ]; - - $tab[] = [ - 'id' => '10', - 'table' => $this->getTable(), - 'field' => 'show_graph', - 'name' => __('See graphic', 'mreporting'), - 'datatype' => 'bool', - 'massiveaction' => false, - ]; - - $tab[] = [ - 'id' => '11', - 'table' => $this->getTable(), - 'field' => 'classname', - 'name' => __('Class', 'mreporting'), - 'massiveaction' => false, - ]; - - $tab[] = [ - 'id' => '12', - 'table' => $this->getTable(), - 'field' => 'graphtype', - 'name' => __('Default chart format', 'mreporting'), - 'searchtype' => 'equals', - 'massiveaction' => true, - ]; - - $tab[] = [ - 'id' => '13', - 'table' => $this->getTable(), - 'field' => 'is_notified', - 'name' => __('Send this report with the notification', 'mreporting'), - 'datatype' => 'bool', - 'massiveaction' => true, - ]; - - return $tab; - } - - static function getSpecificValueToDisplay($field, $values, array $options = []) { - - if (!is_array($values)) { - $values = [$field => $values]; - } - switch ($field) { - case 'graphtype': - return $values[$field]; + public function defineTabs($options = []) + { + $ong = []; + $this->addDefaultFormTab($ong); + $this->addStandardTab('PluginMreportingProfile', $ong, $options); + return $ong; + } + + + public function rawSearchOptions() + { + + $tab = []; + + $tab[] = [ + 'id' => 'common', + 'name' => self::getTypeName(), + ]; + + $tab[] = [ + 'id' => '1', + 'table' => $this->getTable(), + 'field' => 'name', + 'name' => __('Name'), + 'datatype' => 'itemlink', + 'itemlink_type' => $this->getType(), + ]; + + $tab[] = [ + 'id' => '2', + 'table' => $this->getTable(), + 'field' => 'is_active', + 'name' => __('Active'), + 'datatype' => 'bool', + ]; + + $tab[] = [ + 'id' => '3', + 'table' => $this->getTable(), + 'field' => 'show_area', + 'name' => __('See area', 'mreporting'), + 'datatype' => 'bool', + 'massiveaction' => false, + ]; + + $tab[] = [ + 'id' => '4', + 'table' => $this->getTable(), + 'field' => 'spline', + 'name' => __('Curve lines (SVG)', 'mreporting'), + 'datatype' => 'bool', + 'massiveaction' => false, + ]; + + $tab[] = [ + 'id' => '5', + 'table' => $this->getTable(), + 'field' => 'show_label', + 'name' => __('See values', 'mreporting'), + 'datatype' => 'specific', + 'searchtype' => 'equals', + 'massiveaction' => false, + ]; + + $tab[] = [ + 'id' => '6', + 'table' => $this->getTable(), + 'field' => 'flip_data', + 'name' => __('Reverse data array', 'mreporting'), + 'datatype' => 'bool', + 'massiveaction' => false, + ]; + + $tab[] = [ + 'id' => '7', + 'table' => $this->getTable(), + 'field' => 'unit', + 'name' => __('Unit', 'mreporting'), + 'autocomplete' => true, + ]; + + $tab[] = [ + 'id' => '8', + 'table' => $this->getTable(), + 'field' => 'default_delay', + 'name' => __('Default delay', 'mreporting'), + 'autocomplete' => true, + ]; + + $tab[] = [ + 'id' => '9', + 'table' => $this->getTable(), + 'field' => 'condition', + 'name' => __('Additional condition for MySQL', 'mreporting'), + 'autocomplete' => true, + ]; + + $tab[] = [ + 'id' => '10', + 'table' => $this->getTable(), + 'field' => 'show_graph', + 'name' => __('See graphic', 'mreporting'), + 'datatype' => 'bool', + 'massiveaction' => false, + ]; + + $tab[] = [ + 'id' => '11', + 'table' => $this->getTable(), + 'field' => 'classname', + 'name' => __('Class', 'mreporting'), + 'massiveaction' => false, + ]; + + $tab[] = [ + 'id' => '12', + 'table' => $this->getTable(), + 'field' => 'graphtype', + 'name' => __('Default chart format', 'mreporting'), + 'searchtype' => 'equals', + 'massiveaction' => true, + ]; + + $tab[] = [ + 'id' => '13', + 'table' => $this->getTable(), + 'field' => 'is_notified', + 'name' => __('Send this report with the notification', 'mreporting'), + 'datatype' => 'bool', + 'massiveaction' => true, + ]; + + return $tab; + } + + public static function getSpecificValueToDisplay($field, $values, array $options = []) + { + + if (!is_array($values)) { + $values = [$field => $values]; + } + switch ($field) { + case 'graphtype': + return $values[$field]; break; - case 'show_label': - $labels = self::getLabelTypes(); - return $labels[$values[$field]]; + case 'show_label': + $labels = self::getLabelTypes(); + return $labels[$values[$field]]; break; - } - return parent::getSpecificValueToDisplay($field, $values, $options); - } + } + return parent::getSpecificValueToDisplay($field, $values, $options); + } /** @@ -200,317 +206,321 @@ static function getSpecificValueToDisplay($field, $values, array $options = []) * @param $values (default '') * @param $options array **/ - static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = []) { - - if (!is_array($values)) { - $values = [$field => $values]; - } - $options['display'] = false; - $options['value'] = $values[$field]; - switch ($field) { - case 'graphtype': - return Dropdown::showFromArray($name, - ['PNG'=>'PNG', 'SVG'=>'SVG'], - $options); - break; - case 'show_label': - return self::dropdownLabel($name, $options); + public static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = []) + { + + if (!is_array($values)) { + $values = [$field => $values]; + } + $options['display'] = false; + $options['value'] = $values[$field]; + switch ($field) { + case 'graphtype': + return Dropdown::showFromArray( + $name, + ['PNG' => 'PNG', 'SVG' => 'SVG'], + $options + ); + break; + case 'show_label': + return self::dropdownLabel($name, $options); break; - } - return parent::getSpecificValueToSelect($field, $name, $values, $options); - } + } + return parent::getSpecificValueToSelect($field, $name, $values, $options); + } - function getFromDBByFunctionAndClassname($function, $classname) { - global $DB; + public function getFromDBByFunctionAndClassname($function, $classname) + { + global $DB; - $query = "SELECT * - FROM `".$this->getTable()."` - WHERE `name` = '".addslashes($function)."' - AND `classname` = '".addslashes($classname)."'"; + $query = "SELECT * + FROM `" . $this->getTable() . "` + WHERE `name` = '" . addslashes($function) . "' + AND `classname` = '" . addslashes($classname) . "'"; - if ($result = $DB->query($query)) { - if ($DB->numrows($result) != 1) { - return false; - } - $this->fields = $DB->fetchAssoc($result); - if (is_array($this->fields) && count($this->fields)) { - return true; - } - } - return false; - } + if ($result = $DB->query($query)) { + if ($DB->numrows($result) != 1) { + return false; + } + $this->fields = $DB->fetchAssoc($result); + if (is_array($this->fields) && count($this->fields)) { + return true; + } + } + return false; + } /** * add First config Link - *@return nothing + *@return void **/ - static function addFirstconfigLink() { - global $CFG_GLPI; - - $buttons = []; - $title = ""; - - if (Session::haveRight('config', READ)) { - $buttons["config.php?new=1"] = __("Initialize graphics configuration", 'mreporting'); - } - Html::displayTitle(Plugin::getWebDir('mreporting') . "/pics/config2.png", - $title, $title, $buttons); - - } + public static function addFirstconfigLink() + { + global $CFG_GLPI; + + $buttons = []; + $title = ""; + + if (Session::haveRight('config', READ)) { + $buttons["config.php?new=1"] = __("Initialize graphics configuration", 'mreporting'); + } + Html::displayTitle( + Plugin::getWebDir('mreporting') . "/pics/config2.png", + $title, + $title, + $buttons + ); + } /** * create First Config for all graphs - *@return nothing + *@return void **/ - function createFirstConfig() { - //$reports = array(); - $classConfig = false; - - $inc_dir = Plugin::getPhpDir('mreporting') . "/inc"; - //parse inc dir to search report classes - $classes = PluginMreportingCommon::parseAllClasses($inc_dir); - - foreach ($classes as $classname) { - - if (!class_exists($classname)) { - $class_filedir = $inc_dir. - strtolower(str_replace('PluginMreporting', '', $classname)).".class.php"; - if (file_exists($class_filedir)) { - require_once $class_filedir; - } else { - continue; + public function createFirstConfig() + { + //$reports = array(); + $classConfig = false; + + $inc_dir = Plugin::getPhpDir('mreporting') . "/inc"; + //parse inc dir to search report classes + $classes = PluginMreportingCommon::parseAllClasses($inc_dir); + + foreach ($classes as $classname) { + if (!class_exists($classname)) { + $class_filedir = $inc_dir . + strtolower(str_replace('PluginMreporting', '', $classname)) . ".class.php"; + if (file_exists($class_filedir)) { + require_once $class_filedir; + } else { + continue; + } } - } - $functions = get_class_methods($classname); + $functions = get_class_methods($classname); - // We check if a config function exists in class - foreach ($functions as $funct_name) { - if ($funct_name == 'preconfig') { // If a preconfig exists we construct the class - $classConfig = true; - $classObject = new $classname([]); + // We check if a config function exists in class + foreach ($functions as $funct_name) { + if ($funct_name == 'preconfig') { // If a preconfig exists we construct the class + $classConfig = true; + $classObject = new $classname([]); + } } - } - foreach ($functions as $funct_name) { + foreach ($functions as $funct_name) { + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); + if ($ex_func[0] != 'report') { + continue; + } - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); - if ($ex_func[0] != 'report') { - continue; - } + $input = []; - $input = []; + if ($classConfig) { // If a preconfig exists in class we do it + $input = $classObject->preconfig($funct_name, $classname, $this); + } else {// Else we get the default preconfig + $input = $this->preconfig($funct_name, $classname); + } - if ($classConfig) { // If a preconfig exists in class we do it - $input = $classObject->preconfig($funct_name, $classname, $this); - } else {// Else we get the default preconfig - $input = $this->preconfig($funct_name, $classname); + $input["firstconfig"] = 1; + unset($input["id"]); + $newid = $this->add($input); } - - $input["firstconfig"] = 1; - unset($input["id"]); - $newid = $this->add($input); - } - } - - } + } + } /** * Preconfig datas for standard system * @graphname internal name of graph - *@return nothing + *@return void **/ - function preconfig($funct_name, $classname) { - - if ($funct_name != -1 && $classname) { - - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); - if ($ex_func[0] != 'report') { - return false; - } - $gtype = strtolower($ex_func[1]); - - switch ($gtype) { - case 'area': - case 'garea': - $this->fields["name"]=$funct_name; - $this->fields["classname"]=$classname; - $this->fields["is_active"]="1"; - $this->fields["show_area"]="1"; - $this->fields["show_graph"]="1"; - $this->fields["spline"]="1"; - $this->fields["default_delay"]="365"; - $this->fields["graphtype"]="SVG"; - break; - case 'line': - case 'gline': - $this->fields["name"]=$funct_name; - $this->fields["classname"]=$classname; - $this->fields["is_active"]="1"; - $this->fields["spline"]="1"; - $this->fields["show_area"]="0"; - $this->fields["show_graph"]="1"; - $this->fields["default_delay"]="365"; - $this->fields["graphtype"]="SVG"; - break; - case 'vstackbar': - $this->fields["name"]=$funct_name; - $this->fields["classname"]=$classname; - $this->fields["is_active"]="1"; - $this->fields["show_graph"]="1"; - $this->fields["default_delay"]="365"; - $this->fields["graphtype"]="SVG"; - break; - case 'hgbar': - $this->fields["name"]=$funct_name; - $this->fields["classname"]=$classname; - $this->fields["is_active"]="1"; - $this->fields["show_graph"]="1"; - $this->fields["show_label"]="hover"; - $this->fields["spline"]="0"; - $this->fields["show_area"]="0"; - $this->fields["default_delay"]="365"; - $this->fields["graphtype"]="SVG"; - break; - default: - $this->fields["name"]=$funct_name; - $this->fields["classname"]=$classname; - $this->fields["is_active"]="1"; - $this->fields["show_label"]="hover"; - $this->fields["spline"]="0"; - $this->fields["show_area"]="0"; - $this->fields["show_graph"]="1"; - $this->fields["default_delay"]="30"; - $this->fields["graphtype"]="SVG"; - break; - - } - } - return $this->fields; - } + public function preconfig($funct_name, $classname) + { + + if ($funct_name != -1 && $classname) { + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); + if ($ex_func[0] != 'report') { + return false; + } + $gtype = strtolower($ex_func[1]); + + switch ($gtype) { + case 'area': + case 'garea': + $this->fields["name"] = $funct_name; + $this->fields["classname"] = $classname; + $this->fields["is_active"] = "1"; + $this->fields["show_area"] = "1"; + $this->fields["show_graph"] = "1"; + $this->fields["spline"] = "1"; + $this->fields["default_delay"] = "365"; + $this->fields["graphtype"] = "SVG"; + break; + case 'line': + case 'gline': + $this->fields["name"] = $funct_name; + $this->fields["classname"] = $classname; + $this->fields["is_active"] = "1"; + $this->fields["spline"] = "1"; + $this->fields["show_area"] = "0"; + $this->fields["show_graph"] = "1"; + $this->fields["default_delay"] = "365"; + $this->fields["graphtype"] = "SVG"; + break; + case 'vstackbar': + $this->fields["name"] = $funct_name; + $this->fields["classname"] = $classname; + $this->fields["is_active"] = "1"; + $this->fields["show_graph"] = "1"; + $this->fields["default_delay"] = "365"; + $this->fields["graphtype"] = "SVG"; + break; + case 'hgbar': + $this->fields["name"] = $funct_name; + $this->fields["classname"] = $classname; + $this->fields["is_active"] = "1"; + $this->fields["show_graph"] = "1"; + $this->fields["show_label"] = "hover"; + $this->fields["spline"] = "0"; + $this->fields["show_area"] = "0"; + $this->fields["default_delay"] = "365"; + $this->fields["graphtype"] = "SVG"; + break; + default: + $this->fields["name"] = $funct_name; + $this->fields["classname"] = $classname; + $this->fields["is_active"] = "1"; + $this->fields["show_label"] = "hover"; + $this->fields["spline"] = "0"; + $this->fields["show_area"] = "0"; + $this->fields["show_graph"] = "1"; + $this->fields["default_delay"] = "30"; + $this->fields["graphtype"] = "SVG"; + break; + } + } + return $this->fields; + } /** * show not used Graphs dropdown * @name name of dropdown * @options array example $value - *@return nothing + *@return void **/ - static function dropdownGraph($name, $options = []) { - $self = new self(); - $common = new PluginMreportingCommon(); - $rand = mt_rand(); - - $select = ""; + $select .= ""; + + $i = 0; + $reports = $common->getAllReports(); + foreach ($reports as $classname => $report) { + foreach ($report['functions'] as $function) { + if (!$self->getFromDBByFunctionAndClassname($function["function"], $classname)) { + $graphs[$classname][$function['category_func']][] = $function; + } } - } - - if (isset($graphs[$classname])) { - $count = count($graphs[$classname]); - if ($count > 0) { - - $select.= ""; - $count = count($graphs[$classname]); - if ($count > 0) { - foreach ($graphs[$classname] as $cat => $graph) { - - $select.= ""; - - foreach ($graph as $k => $v) { - - $comment = ""; - if (isset($v["desc"])) { - $comment = $v["desc"]; - $desc = " (".$comment.")"; + if (isset($graphs[$classname])) { + $count = count($graphs[$classname]); + if ($count > 0) { + $select .= ""; + + $count = count($graphs[$classname]); + if ($count > 0) { + foreach ($graphs[$classname] as $cat => $graph) { + $select .= ""; + + foreach ($graph as $k => $v) { + $comment = ""; + if (isset($v["desc"])) { + $comment = $v["desc"]; + $desc = " (" . $comment . ")"; + } + + $select .= ""; + + $i++; + } + $select .= ""; } - - $select.= ""; - - $i++; - } - $select.= ""; - - } - } - $select.= ""; + } + $select .= ""; + } } - } - } + } - $select.= ""; + $select .= ""; - echo $select; - return $rand; - } + echo $select; + return $rand; + } /** * show Label dropdown * @name name of dropdown * @options array example $value - *@return nothing + *@return void **/ - static function dropdownLabel($name, $options = [], $notall = false) { - $params['value'] = 0; - $params['toadd'] = []; - $params['on_change'] = ''; - - if (is_array($options) && count($options)) { - foreach ($options as $key => $val) { - $params[$key] = $val; - } - } + public static function dropdownLabel($name, $options = [], $notall = false) + { + $params['value'] = 0; + $params['toadd'] = []; + $params['on_change'] = ''; + + if (is_array($options) && count($options)) { + foreach ($options as $key => $val) { + $params[$key] = $val; + } + } - $items = $params['toadd']; - $items += self::getLabelTypes($notall); + $items = $params['toadd']; + $items += self::getLabelTypes($notall); - return Dropdown::showFromArray($name, $items, $params); - } + return Dropdown::showFromArray($name, $items, $params); + } /** * Get label types * * @return array of types **/ - static function getLabelTypes($notall = false) { - $options['never'] = __("Never"); - $options['hover'] = __("On mouse over", 'mreporting'); - if (!$notall) { - $options['always'] = __("Always"); - } - return $options; - } + public static function getLabelTypes($notall = false) + { + $options['never'] = __("Never"); + $options['hover'] = __("On mouse over", 'mreporting'); + if (!$notall) { + $options['always'] = __("Always"); + } + return $options; + } /** * Get label Name * * @param $value type ID **/ - static function getLabelTypeName($value) { - switch ($value) { - case 'hover' : - return __("On mouse over", 'mreporting'); - case 'never' : - return __("Never"); - case 'always' : - return __("Always"); - } - } + public static function getLabelTypeName($value) + { + switch ($value) { + case 'hover': + return __("On mouse over", 'mreporting'); + case 'never': + return __("Never"); + case 'always': + return __("Always"); + } + } /** * checkVisibility @@ -519,271 +529,299 @@ static function getLabelTypeName($value) { * @param $always * @param $hover **/ - static function checkVisibility($show_label, &$always, &$hover) { - switch ($show_label) { - - case 'hover': - $always = "false"; - $hover = "true"; - break; - case 'always': - $always = "true"; - $hover = "true"; - break; - default : - $always = "false"; - $hover = "false"; - break; - } - } - - static function getColors($index = 20) { - if (isset($_SESSION['mreporting']['colors'])) { - $colors = $_SESSION['mreporting']['colors']; - } else { - /* if ($index <= 10) { + public static function checkVisibility($show_label, &$always, &$hover) + { + switch ($show_label) { + case 'hover': + $always = "false"; + $hover = "true"; + break; + case 'always': + $always = "true"; + $hover = "true"; + break; + default: + $always = "false"; + $hover = "false"; + break; + } + } + + public static function getColors($index = 20) + { + if (isset($_SESSION['mreporting']['colors'])) { + $colors = $_SESSION['mreporting']['colors']; + } else { + /* if ($index <= 10) { $colors = array( "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf" ); - } else {*/ + } else {*/ $colors = [ - "#1f77b4", "#aec7e8", "#ff7f0e", "#ffbb78", "#2ca02c", - "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5", - "#8c564b", "#c49c94", "#e377c2", "#f7b6d2", "#7f7f7f", - "#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5" + "#1f77b4", "#aec7e8", "#ff7f0e", "#ffbb78", "#2ca02c", + "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5", + "#8c564b", "#c49c94", "#e377c2", "#f7b6d2", "#7f7f7f", + "#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5" ]; // } - } + } + + //fill colors on size index + $nb = count($colors); + $tmp = $colors; + while (count($colors) < $index) { + $colors = array_merge($tmp, $colors); + } + + return $colors; + } + + + public function prepareInputForAdd($input) + { + if (isset($input["name"])) { + if ($this->getFromDBByFunctionAndClassname($input["name"], $input["classname"])) { + if (!isset($input["firstconfig"])) { + Session::addMessageAfterRedirect( + __("Object already exists", 'mreporting'), + false, + ERROR + ); + } + return []; + } + } - //fill colors on size index - $nb = count($colors); - $tmp = $colors; - while (count($colors) < $index) { - $colors = array_merge($tmp, $colors); - } + return $input; + } - return $colors; - } + public function prepareInputForUpdate($input) + { + if (isset($input["classname"]) && method_exists(new $input["classname"]([]), 'checkConfig')) { + $object = new $input["classname"]([]); + $checkConfig = $object->checkConfig($input); + if (!$checkConfig['result']) { + Session::addMessageAfterRedirect($checkConfig['message'], ERROR, true); - function prepareInputForAdd($input) { - if (isset ($input["name"])) { + return []; + } + } + + return $input; + } + + public function showForm($ID, $options = []) + { + global $LANG; - if ($this->getFromDBByFunctionAndClassname($input["name"], $input["classname"])) { - if (!isset ($input["firstconfig"])) { - Session::addMessageAfterRedirect(__("Object already exists", 'mreporting'), - false, ERROR); + $this->initForm($ID, $options); + + if ($ID <= 0) { + if (isset($_GET['name']) && isset($_GET['classname'])) { + $this->preconfig($_GET['name'], $_GET['classname']); + $_GET['preconfig'] = 1; + } else { + $_GET['name'] = -1; + $_GET['classname'] = -1; + $_GET['preconfig'] = -1; } - return []; - } - } - - return $input; - } - - function prepareInputForUpdate($input) { - - if (isset($input["classname"]) && method_exists(new $input["classname"]([]), 'checkConfig')) { - $object = new $input["classname"]([]); - $checkConfig = $object->checkConfig($input); - if (!$checkConfig['result']) { - Session::addMessageAfterRedirect($checkConfig['message'], ERROR, true); - - return []; - } - } - - return $input; - } - - function showForm($ID, $options = []) { - global $LANG; - - $this->initForm($ID, $options); - - if ($ID <= 0) { - if (isset($_GET['name']) && isset($_GET['classname'])) { - $this->preconfig($_GET['name'], $_GET['classname']); - $_GET['preconfig'] = 1; - } else { - $_GET['name'] = -1; - $_GET['classname'] = -1; - $_GET['preconfig'] = -1; - } - } - - echo ""; - echo ""; - echo ""; - echo ""; - echo "
"; - echo __("Preconfiguration")." "; - $opt = ['value' => $_GET['preconfig']]; - $rand = self::dropdownGraph('graphname', $opt); - $params = ['graphname' => '__VALUE__']; - Ajax::updateItemOnSelectEvent("dropdown_graphname$rand", "show_preconfig", - "../ajax/dropdownGraphs.php", - $params); - echo ""; - echo "
"; - - $style = ($_GET['preconfig']==-1 && $ID <= 0) ? "display:none;" : "'display:block;'"; - echo "
"; - - $this->showFormHeader($options); - - echo ""; - echo "".__("Name").""; - echo ""; - echo $this->fields["name"]; - echo "fields["name"]."\">"; - echo ""; - - echo ""; - $gtype = ''; - - $f_name = $this->fields["name"]; - - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); - if (isset($ex_func[1])) { - $gtype = strtolower($ex_func[1]); - } - - $short_classname = str_replace('PluginMreporting', '', $this->fields["classname"]); - - if (!empty($short_classname) - && !empty($f_name) - && isset($LANG['plugin_mreporting'][$short_classname][$f_name]['title'])) { + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo __("Preconfiguration") . " "; + $opt = ['value' => $_GET['preconfig']]; + $rand = self::dropdownGraph('graphname', $opt); + $params = ['graphname' => '__VALUE__']; + Ajax::updateItemOnSelectEvent( + "dropdown_graphname$rand", + "show_preconfig", + "../ajax/dropdownGraphs.php", + $params + ); + echo ""; + echo "
"; + + $style = ($_GET['preconfig'] == -1 && $ID <= 0) ? "display:none;" : "'display:block;'"; + echo "
"; + + $this->showFormHeader($options); + + echo ""; + echo "" . __("Name") . ""; + echo ""; + echo $this->fields["name"]; + echo "fields["name"] . "\">"; + echo ""; + + echo ""; + $gtype = ''; + + $f_name = $this->fields["name"]; + + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); + if (isset($ex_func[1])) { + $gtype = strtolower($ex_func[1]); + } + + $short_classname = str_replace('PluginMreporting', '', $this->fields["classname"]); + + if ( + !empty($short_classname) + && !empty($f_name) + && isset($LANG['plugin_mreporting'][$short_classname][$f_name]['title']) + ) { echo " "; - echo ""; + echo ""; echo $LANG['plugin_mreporting'][$short_classname][$f_name]['title']; echo ""; - } else { - echo __("No report is available !", 'mreporting'); - } - - echo "fields["classname"]."\">"; - echo ""; - echo ""; - - echo ""; - echo "".__("See graphic", 'mreporting').""; - echo ""; - Dropdown::showYesNo("show_graph", $this->fields["show_graph"]); - echo ""; - - echo "".__("Default chart format").""; - echo ""; - Dropdown::showFromArray("graphtype", - ['PNG'=>'PNG', 'SVG'=>'SVG'], - ['value' => $this->fields["graphtype"]]); - echo ""; - echo ""; - - echo ""; - echo "".__("Active").""; - echo ""; - Dropdown::showYesNo("is_active", $this->fields["is_active"]); - echo ""; - - echo ""; - echo __("See area", 'mreporting'); - echo ""; - echo ""; - if ($gtype == 'area' || $gtype == 'garea') { - Dropdown::showYesNo("show_area", $this->fields["show_area"]); - } else { - echo Dropdown::getYesNo($this->fields["show_area"]); - echo ""; - } - - echo ""; - echo ""; - - echo ""; - echo ""; - echo __("Curve lines (SVG)", 'mreporting'); - echo ""; - echo ""; - if ($gtype == 'area' || $gtype == 'garea' || $gtype == 'line' || $gtype == 'gline') { - Dropdown::showYesNo("spline", $this->fields["spline"]); - } else { - echo Dropdown::getYesNo($this->fields["spline"]); - echo ""; - } - echo ""; - - echo ""; - echo __("Curve lines (SVG)", 'mreporting'); - echo ""; - - echo ""; - $opt = ['value' => $this->fields["show_label"]]; - if ($gtype != 'area' && $gtype != 'garea' && $gtype != 'line' && $gtype != 'gline') { - self::dropdownLabel('show_label', $opt); - } else { - self::dropdownLabel('show_label', $opt, true); - } - echo ""; - echo ""; - - echo ""; - echo ""; - echo __("Reverse data array", 'mreporting'); - echo ""; - echo ""; - if ($gtype != 'hbar' && $gtype != 'pie' && $gtype != 'area' && $gtype != 'line') { - Dropdown::showYesNo("flip_data", $this->fields["flip_data"]); - } else { - echo Dropdown::getYesNo($this->fields["flip_data"]); - echo ""; - } - echo ""; - - echo ""; - echo __("Unit", 'mreporting'); - echo ""; - echo ""; - $opt = ['size' => 10]; - Html::autocompletionTextField($this, 'unit', $opt); - echo ""; - echo ""; - - echo ""; - echo ""; - echo __("Default delay", 'mreporting'); - echo ""; - echo ""; - $opt = ['size' => 10]; - Html::autocompletionTextField($this, 'default_delay', $opt); - echo ""; - - echo ""; - echo __("Additional condition for MySQL", 'mreporting'); - echo ""; - echo ""; - Html::autocompletionTextField($this, 'condition'); - echo ""; - echo ""; - - echo ""; - echo ""; - echo __("Send this report with the notification", 'mreporting'); - echo ""; - echo ""; - Dropdown::showYesNo("is_notified", $this->fields["is_notified"]); - echo ""; - echo " "; - echo " "; - echo ""; - - $this->showFormButtons($options); - - echo "
"; - - return true; - } + } else { + echo __("No report is available !", 'mreporting'); + } + + echo "fields["classname"] . "\">"; + echo ""; + echo ""; + + echo ""; + echo "" . __("See graphic", 'mreporting') . ""; + echo ""; + Dropdown::showYesNo("show_graph", $this->fields["show_graph"]); + echo ""; + + echo "" . __("Default chart format") . ""; + echo ""; + Dropdown::showFromArray( + "graphtype", + ['PNG' => 'PNG', 'SVG' => 'SVG'], + ['value' => $this->fields["graphtype"]] + ); + echo ""; + echo ""; + + echo ""; + echo "" . __("Active") . ""; + echo ""; + Dropdown::showYesNo("is_active", $this->fields["is_active"]); + echo ""; + + echo ""; + echo __("See area", 'mreporting'); + echo ""; + echo ""; + if ($gtype == 'area' || $gtype == 'garea') { + Dropdown::showYesNo("show_area", $this->fields["show_area"]); + } else { + echo Dropdown::getYesNo($this->fields["show_area"]); + echo ""; + } + + echo ""; + echo ""; + + echo ""; + echo ""; + echo __("Curve lines (SVG)", 'mreporting'); + echo ""; + echo ""; + if ($gtype == 'area' || $gtype == 'garea' || $gtype == 'line' || $gtype == 'gline') { + Dropdown::showYesNo("spline", $this->fields["spline"]); + } else { + echo Dropdown::getYesNo($this->fields["spline"]); + echo ""; + } + echo ""; + + echo ""; + echo __("Curve lines (SVG)", 'mreporting'); + echo ""; + + echo ""; + $opt = ['value' => $this->fields["show_label"]]; + if ($gtype != 'area' && $gtype != 'garea' && $gtype != 'line' && $gtype != 'gline') { + self::dropdownLabel('show_label', $opt); + } else { + self::dropdownLabel('show_label', $opt, true); + } + echo ""; + echo ""; + + echo ""; + echo ""; + echo __("Reverse data array", 'mreporting'); + echo ""; + echo ""; + if ($gtype != 'hbar' && $gtype != 'pie' && $gtype != 'area' && $gtype != 'line') { + Dropdown::showYesNo("flip_data", $this->fields["flip_data"]); + } else { + echo Dropdown::getYesNo($this->fields["flip_data"]); + echo ""; + } + echo ""; + + echo ""; + echo __("Unit", 'mreporting'); + echo ""; + echo ""; + echo Html::input( + 'unit', + [ + 'value' => $this->fields['unit'], + 'size' => 10 + ] + ); + echo ""; + echo ""; + + echo ""; + echo ""; + echo __("Default delay", 'mreporting'); + echo ""; + echo ""; + echo Html::input( + 'default_delay', + [ + 'value' => $this->fields['default_delay'], + 'size' => 10 + ] + ); + echo ""; + + echo ""; + echo __("Additional condition for MySQL", 'mreporting'); + echo ""; + echo ""; + echo Html::input( + 'condition', + [ + 'value' => $this->fields['condition'], + ] + ); + echo ""; + echo ""; + + echo ""; + echo ""; + echo __("Send this report with the notification", 'mreporting'); + echo ""; + echo ""; + Dropdown::showYesNo("is_notified", $this->fields["is_notified"]); + echo ""; + echo " "; + echo " "; + echo ""; + + $this->showFormButtons($options); + + echo "
"; + + return true; + } /** * initialize config for graph display options @@ -791,39 +829,41 @@ function showForm($ID, $options = []) { * @param $name of graph * @param $classname of graph **/ - static function initConfigParams($name, $classname) { - - $crit = ['area' => false, - 'spline' => false, - 'flip_data' => false, - 'unit' => '', - 'show_label' => 'never', - 'delay' => '30', - 'condition' => '', - 'show_graph' => false, - 'randname' => mt_rand(), - 'graphtype' => 'SVG']; - - $self = new self(); - if ($self->getFromDBByFunctionAndClassname($name, $classname)) { - $crit['area'] = $self->fields['show_area']; - $crit['spline'] = $self->fields['spline']; - $crit['show_label'] = $self->fields['show_label']; - $crit['flip_data'] = $self->fields['flip_data']; - $crit['unit'] = $self->fields['unit']; - $crit['delay'] = $self->fields['default_delay']; - $crit['condition'] = $self->fields['condition']; - $crit['show_graph'] = $self->fields['show_graph']; - $crit['graphtype'] = $self->fields['graphtype']; - $crit['randname'] = $classname.$name; - } - - if (DEBUG_MREPORTING) { - $crit['show_graph'] = 1; - } - - return $crit; - } + public static function initConfigParams($name, $classname) + { + + $crit = ['area' => false, + 'spline' => false, + 'flip_data' => false, + 'unit' => '', + 'show_label' => 'never', + 'delay' => '30', + 'condition' => '', + 'show_graph' => false, + 'randname' => mt_rand(), + 'graphtype' => 'SVG' + ]; + + $self = new self(); + if ($self->getFromDBByFunctionAndClassname($name, $classname)) { + $crit['area'] = $self->fields['show_area']; + $crit['spline'] = $self->fields['spline']; + $crit['show_label'] = $self->fields['show_label']; + $crit['flip_data'] = $self->fields['flip_data']; + $crit['unit'] = $self->fields['unit']; + $crit['delay'] = $self->fields['default_delay']; + $crit['condition'] = $self->fields['condition']; + $crit['show_graph'] = $self->fields['show_graph']; + $crit['graphtype'] = $self->fields['graphtype']; + $crit['randname'] = $classname . $name; + } + + if (DEBUG_MREPORTING) { + $crit['show_graph'] = 1; + } + + return $crit; + } /** * test for value of show_graph field @@ -832,15 +872,16 @@ static function initConfigParams($name, $classname) { * @param $classname of graph **/ - static function showGraphConfigValue($name, $classname) { - if (DEBUG_MREPORTING) { - return true; - } - - $self = new self(); - if ($self->getFromDBByFunctionAndClassname($name, $classname)) { - return $self->fields['show_graph']; - } - return false; - } + public static function showGraphConfigValue($name, $classname) + { + if (DEBUG_MREPORTING) { + return true; + } + + $self = new self(); + if ($self->getFromDBByFunctionAndClassname($name, $classname)) { + return $self->fields['show_graph']; + } + return false; + } } diff --git a/inc/dashboard.class.php b/inc/dashboard.class.php index e7089b62..be94469a 100644 --- a/inc/dashboard.class.php +++ b/inc/dashboard.class.php @@ -1,112 +1,119 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingDashboard extends CommonDBTM { - - function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - if (get_class($item) == 'Central' - && PluginMreportingCommon::canAccessAtLeastOneReport($_SESSION['glpiactiveprofile']['id'])) { - return [1 => __("Dashboard", 'mreporting')]; - } - return ''; - } - - - static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - global $CFG_GLPI; - - if (get_class($item) == 'Central' - && PluginMreportingCommon::canAccessAtLeastOneReport($_SESSION['glpiactiveprofile']['id'])) { - echo "
"; - - echo ""; - echo ""; - echo "
"; - } - return true; - } - - function showDashBoard($show_reports_dropdown = true) { - global $LANG, $CFG_GLPI; - - $root_ajax = Plugin::getWebDir('mreporting')."/ajax/dashboard.php"; - - if (isset($options['target'])) { - $target = $options['target']; - } else { - $target = $this->getFormURL(); - } - - $_REQUEST['f_name'] = 'option'; - PluginMreportingCommon::getSelectorValuesByUser(); - - //retrieve dashboard widgets; - $dashboard = new PluginMreportingDashboard(); - $widgets = $dashboard->find(['users_id' => $_SESSION['glpiID']], 'id'); - - //show dashboard - echo "
"; - - if ($show_reports_dropdown) { - echo "
"; - echo "".__("Select a report to display", 'mreporting')." : "; - echo PluginMreportingCommon::getSelectAllReports(true); - echo "
"; - echo "
"; - echo "
"; - echo "
"; - } - - if (empty($widgets)) { - echo "
"; - echo "
"; - echo __("Dashboard is empty. Please add reports by clicking on the icon", 'mreporting'); - echo "
"; - echo "
"; - } - - //echo ""; - echo "
"; - echo "
"; - if (!empty($widgets)) { - echo "".__("Add a report", 'mreporting'). - " "; - } - echo "
"; - echo "
".$this->getFormForColumn()."
+ echo "
"; + } + return true; + } + + public function showDashBoard($show_reports_dropdown = true) + { + global $LANG; + + $root_ajax = Plugin::getWebDir('mreporting') . "/ajax/dashboard.php"; + + if (isset($options['target'])) { + $target = $options['target']; + } else { + $target = $this->getFormURL(); + } + + $_REQUEST['f_name'] = 'option'; + PluginMreportingCommon::getSelectorValuesByUser(); + + //retrieve dashboard widgets; + $dashboard = new PluginMreportingDashboard(); + $widgets = $dashboard->find(['users_id' => $_SESSION['glpiID']], 'id'); + + //show dashboard + echo "
"; + + if ($show_reports_dropdown) { + echo "
"; + echo "" . __("Select a report to display", 'mreporting') . " : "; + echo PluginMreportingCommon::getSelectAllReports(true); + echo "
"; + echo "
"; + echo "
"; + echo "
"; + } + + if (empty($widgets)) { + echo "
"; + echo "
"; + echo __("Dashboard is empty. Please add reports by clicking on the icon", 'mreporting'); + echo "
"; + echo "
"; + } + + echo "
"; + echo ""; + echo "
"; + $modal_html = json_encode($this->getFormForColumn()); + echo " "; - if (empty($widgets)) { - echo "
"; - echo ""; - } - - echo "
"; - echo "
"; - $i = 0; - foreach ($widgets as $data) { - $i++; - - $report = new PluginMreportingConfig(); - $report->getFromDB($data['reports_id']); - - //Class may not exists: this case should only happen during development phase - if (!class_exists($report->fields["classname"]) - || !PluginMreportingProfile::canViewReports($_SESSION['glpiactiveprofile']['id'], $report->getID())) { - continue; - } - $index = str_replace('PluginMreporting', '', $report->fields['classname']); - $title = $LANG['plugin_mreporting'][$index][$report->fields['name']]['title']; - - $report_script = "Nothing to show"; - //$config = "No configuration"; + if (empty($widgets)) { + echo "
"; + echo ""; + } + + echo "
"; + echo "
"; + $i = 0; + foreach ($widgets as $data) { + $i++; + + $report = new PluginMreportingConfig(); + $report->getFromDB($data['reports_id']); + + //Class may not exists: this case should only happen during development phase + if ( + !class_exists($report->fields["classname"]) + || !PluginMreportingProfile::canViewReports($_SESSION['glpiactiveprofile']['id'], $report->getID()) + ) { + continue; + } + $index = str_replace('PluginMreporting', '', $report->fields['classname']); + $title = $LANG['plugin_mreporting'][$index][$report->fields['name']]['title']; - $f_name = $report->fields["name"]; + $report_script = "Nothing to show"; + //$config = "No configuration"; - $gtype = ''; - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); - if (isset($ex_func[1])) { - $gtype = strtolower($ex_func[1]); - } + $f_name = $report->fields["name"]; - $short_classname = str_replace('PluginMreporting', '', $report->fields["classname"]); - - $_REQUEST['f_name'] = $f_name; - $_REQUEST['short_classname'] = $short_classname; - PluginMreportingCommon::getSelectorValuesByUser(); + $gtype = ''; + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); + if (isset($ex_func[1])) { + $gtype = strtolower($ex_func[1]); + } - if (!empty($short_classname) && !empty($f_name)) { - if (isset($LANG['plugin_mreporting'][$short_classname][$f_name]['title'])) { - $opt = ['short_classname' => $short_classname, - 'f_name' => $f_name, - 'gtype' => $gtype, - 'width' => 410, - 'hide_title' => true]; - $common = new PluginMreportingCommon(); - ob_start(); - $report_script = $common->showGraph($opt); - if ($report_script === false) { - $report_script = "
"; - } - $report_script = ob_get_clean().$report_script; + $short_classname = str_replace('PluginMreporting', '', $report->fields["classname"]); + + $_REQUEST['f_name'] = $f_name; + $_REQUEST['short_classname'] = $short_classname; + PluginMreportingCommon::getSelectorValuesByUser(); + + if (!empty($short_classname) && !empty($f_name)) { + if (isset($LANG['plugin_mreporting'][$short_classname][$f_name]['title'])) { + $opt = ['short_classname' => $short_classname, + 'f_name' => $f_name, + 'gtype' => $gtype, + 'width' => 410, + 'hide_title' => true + ]; + $common = new PluginMreportingCommon(); + ob_start(); + $report_script = $common->showGraph($opt); + if ($report_script === false) { + $report_script = ""; + } + $report_script = ob_get_clean() . $report_script; + } } - } - $rand_widget = mt_rand(); + $rand_widget = mt_rand(); - echo " -
-
- - +
+
+ + - +  $title
-
+
$report_script
"; - } - - echo "
"; - echo "
"; - } - - public static function CurrentUserHaveDashboard() { - $dashboard = new PluginMreportingDashboard(); - return (count($dashboard->find(['users_id' => $_SESSION['glpiID']])) > 0); - } + } - function getFormForColumn() { - $out = ""; - $out .= PluginMreportingCommon::getSelectAllReports(false, true); - $out .= " "; - $out .= Html::closeForm(false); - $out .= "
"; + echo "
"; + echo "
"; + } - return $out; - } + public static function currentUserHaveDashboard() + { + $dashboard = new PluginMreportingDashboard(); + return (count($dashboard->find(['users_id' => $_SESSION['glpiID']])) > 0); + } - static function removeReportFromDashboard($id) { - $report = new PluginMreportingDashboard(); - return $report->delete(["id" => $id]); - } + public function getFormForColumn() + { + $out = ""; + $out .= PluginMreportingCommon::getSelectAllReports(false, true); + $out .= ""; + $out .= Html::closeForm(false); + $out .= ""; - static function updateWidget($idreport) { - global $LANG; + return $out; + } - $dashboard = new self(); - $dashboard->getFromDB($idreport); + public static function removeReportFromDashboard($id) + { + $report = new PluginMreportingDashboard(); + return $report->delete(["id" => $id]); + } - $report = new PluginMreportingConfig(); - $report->getFromDB($dashboard->fields['reports_id']); + public static function updateWidget($idreport) + { + global $LANG; - $index = str_replace('PluginMreporting', '', $report->fields['classname']); - $title = $LANG['plugin_mreporting'][$index][$report->fields['name']]['title']; + $dashboard = new self(); + $dashboard->getFromDB($idreport); - $out = "Nothing to show"; + $report = new PluginMreportingConfig(); + $report->getFromDB($dashboard->fields['reports_id']); - $f_name = $report->fields["name"]; + $index = str_replace('PluginMreporting', '', $report->fields['classname']); + $title = $LANG['plugin_mreporting'][$index][$report->fields['name']]['title']; - $gtype = ''; - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); - if (isset($ex_func[1])) { - $gtype = strtolower($ex_func[1]); - } + $out = "Nothing to show"; - $short_classname = str_replace('PluginMreporting', '', $report->fields["classname"]); + $f_name = $report->fields["name"]; - if (!empty($short_classname) && !empty($f_name)) { - if (isset($LANG['plugin_mreporting'][$short_classname][$f_name]['title'])) { - $opt = ['short_classname' => $short_classname , 'f_name' =>$f_name , 'gtype' => $gtype ]; - $dash = new PluginMreportingDashboard(); - $out = $dash->showGraphOnDashboard($opt); + $gtype = ''; + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $f_name); + if (isset($ex_func[1])) { + $gtype = strtolower($ex_func[1]); + } - } - } + $short_classname = str_replace('PluginMreporting', '', $report->fields["classname"]); - echo $out; - } + if (!empty($short_classname) && !empty($f_name)) { + if (isset($LANG['plugin_mreporting'][$short_classname][$f_name]['title'])) { + $opt = ['short_classname' => $short_classname , 'f_name' => $f_name , 'gtype' => $gtype ]; + $dash = new PluginMreportingDashboard(); + $out = $dash->showGraphOnDashboard($opt); + } + } - static function getConfig() { - PluginMreportingCommon::getSelectorValuesByUser(); + echo $out; + } - $reportSelectors = PluginMreportingCommon::getReportSelectors(true); + public static function getConfig() + { + PluginMreportingCommon::getSelectorValuesByUser(); - if ($reportSelectors == "") { - echo "No configuration for this report"; - return; - } + $reportSelectors = PluginMreportingCommon::getReportSelectors(true); - echo ""; + if ($reportSelectors == "") { + echo "No configuration for this report"; + return; + } - echo ""; - echo ""; - echo $reportSelectors; - echo "
"; + echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo $reportSelectors; + echo "
"; - Html::closeForm(); - } + echo ""; + echo ""; + echo ""; + echo ""; + Html::closeForm(); + } } diff --git a/inc/graph.class.php b/inc/graph.class.php index 7d653f7e..d5757a09 100644 --- a/inc/graph.class.php +++ b/inc/graph.class.php @@ -1,113 +1,120 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingGraph { - - const DEBUG_GRAPH = false; - protected $width = 850; +class PluginMreportingGraph +{ + const DEBUG_GRAPH = false; + protected $width = 850; /** * init Graph : Show Titles / Date selector * * @params $options ($rand, short_classname, title, desc, delay) */ - function initGraph($options) { - global $LANG, $CFG_GLPI; - - $width = $this->width + 100; - $randname = $options['randname']; - - if (!$options['showHeader']) { - echo "
"; - //Show global title - if (isset($LANG['plugin_mreporting'][$options['short_classname']]['title'])) { + public function initGraph($options) + { + global $LANG, $CFG_GLPI; + + $width = $this->width + 100; + $randname = $options['randname']; + + if (!$options['showHeader']) { + echo "
"; + //Show global title + if (isset($LANG['plugin_mreporting'][$options['short_classname']]['title'])) { + echo "
"; + echo $LANG['plugin_mreporting'][$options['short_classname']]['title']; + echo "
"; + } + //Show graph title echo "
"; - echo $LANG['plugin_mreporting'][$options['short_classname']]['title']; + $gtype = $_REQUEST['gtype']; + + echo ""; + echo $options['title']; echo "
"; - } - //Show graph title - echo "
"; - $gtype = $_REQUEST['gtype']; - - echo ""; - echo $options['title']; - echo "
"; - - $desc = ''; - if (!empty($options['desc'])) { - $desc =$options['desc']; - if (isset($_SESSION['mreporting_values']['date1'.$randname]) - && isset($_SESSION['mreporting_values']['date1'.$randname])) { - $desc.= " - "; + + $desc = ''; + if (!empty($options['desc'])) { + $desc = $options['desc']; + if ( + isset($_SESSION['mreporting_values']['date1' . $randname]) + && isset($_SESSION['mreporting_values']['date1' . $randname]) + ) { + $desc .= " - "; + } } - } - if (isset($_SESSION['mreporting_values']['date1'.$randname]) - && isset($_SESSION['mreporting_values']['date1'.$randname])) { - $desc.= Html::convdate($_SESSION['mreporting_values']['date1'.$randname])." / ". - Html::convdate($_SESSION['mreporting_values']['date2'.$randname]); - } - echo "
".$desc."
"; - - //Show date selector - echo "
"; - PluginMreportingCommon::showSelector( - $_SESSION['mreporting_values']['date1'.$randname], - $_SESSION['mreporting_values']['date2'.$randname], - $randname); - echo "
"; - - $ex_func = explode($options['short_classname'], $options['randname']); - if (!is_numeric($ex_func[0])) { - $classname = $ex_func[0].$options['short_classname']; - $functionname = $ex_func[1]; - - $config = PluginMreportingConfig::initConfigParams($functionname, $classname); - - // We check if a configuration is needed for the graph - if (method_exists(new $classname($config), 'needConfig')) { - $object = new $classname(); - $object->needConfig($config); + if ( + isset($_SESSION['mreporting_values']['date1' . $randname]) + && isset($_SESSION['mreporting_values']['date1' . $randname]) + ) { + $desc .= Html::convdate($_SESSION['mreporting_values']['date1' . $randname]) . " / " . + Html::convdate($_SESSION['mreporting_values']['date2' . $randname]); } - } - } + echo "
" . $desc . "
"; + + //Show date selector + echo "
"; + PluginMreportingCommon::showSelector( + $_SESSION['mreporting_values']['date1' . $randname], + $_SESSION['mreporting_values']['date2' . $randname], + $randname + ); + echo "
"; + + $ex_func = explode($options['short_classname'], $options['randname']); + if (!is_numeric($ex_func[0])) { + $classname = $ex_func[0] . $options['short_classname']; + $functionname = $ex_func[1]; + + $config = PluginMreportingConfig::initConfigParams($functionname, $classname); + + // We check if a configuration is needed for the graph + if (method_exists(new $classname($config), 'needConfig')) { + $object = new $classname(); + $object->needConfig($config); + } + } + } - //Script for graph display - if ($randname !== false) { - echo "
"; + //Script for graph display + if ($randname !== false) { + echo "
"; - $colors = "'".implode ("', '", PluginMreportingConfig::getColors())."'"; - echo ""; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $raw_datas['datas']; - $links = []; - if (isset($raw_datas['links'])) { - $links = $raw_datas['links']; - } - $datas = $this->initDatasSimple($datas, $unit, $links); - - $nb_bar = count($datas); - $height = 25 * $nb_bar + 50; - - $always = ''; - $hover = ''; - - $left = 240; - if ($dashboard) { - $left = 180; - if ($height > 380) { - $height = 380; - } - } + public function showHbar($params, $dashboard = false, $width = false) + { + + ob_start(); + if ($width !== false) { + $this->width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + foreach ($configs as $k => $v) { + $$k = $v; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "delay" => $delay, + "export" => $export, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $raw_datas['datas']; + $links = []; + if (isset($raw_datas['links'])) { + $links = $raw_datas['links']; + } + $datas = $this->initDatasSimple($datas, $unit, $links); + + $nb_bar = count($datas); + $height = 25 * $nb_bar + 50; + + $always = ''; + $hover = ''; + + $left = 240; + if ($dashboard) { + $left = 180; + if ($height > 380) { + $height = 380; + } + } - $always = ''; - $hover = ''; - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + $always = ''; + $hover = ''; + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - $JS = <<width}; var height_hbar = {$height}; var x = pv.Scale.linear(0, max).range(0, .67 * width_hbar); @@ -285,25 +294,26 @@ function showHbar($params, $dashboard = false, $width = false) { JAVASCRIPT; - if ($show_graph) { - echo $JS; - } + if ($show_graph) { + echo $JS; + } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); - $content = ob_get_clean(); + $content = ob_get_clean(); - if ($dashboard) { - return $content; - } else { - echo $content; - } - } + if ($dashboard) { + return $content; + } else { + echo $content; + } + } /** @@ -318,72 +328,74 @@ function showHbar($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showPie($params, $dashboard = false, $width = false) { - ob_start(); - if ($width !== false) { - $this->width = $width; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (!isset($raw_datas['datas'])) { - echo "}"; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $raw_datas['datas']; - $datas = $this->initDatasSimple($datas, $unit); + public function showPie($params, $dashboard = false, $width = false) + { + ob_start(); + if ($width !== false) { + $this->width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $raw_datas['datas']; + $datas = $this->initDatasSimple($datas, $unit); + + $nb_bar = count($datas); + $height = 15 * $nb_bar + 50; + if ($height < 300) { + $height = 300; + } + $always = ''; + $hover = ''; + $radius = 150; + $left = 10; + $right_legend = 5; - $nb_bar = count($datas); - $height = 15 * $nb_bar + 50; - if ($height < 300) { - $height = 300; - } - $always = ''; - $hover = ''; - $radius = 150; - $left = 10; - $right_legend = 5; - - if ($dashboard) { - $left = 40; - } + if ($dashboard) { + $left = 40; + } - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - $JS = <<width}; var height_pie = {$height}; var radius = {$radius}; @@ -472,26 +484,27 @@ function showPie($params, $dashboard = false, $width = false) { }, 20); JAVASCRIPT; - if ($show_graph) { - echo $JS; - } + if ($show_graph) { + echo $JS; + } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "unit" => $unit]; + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "unit" => $unit + ]; - PluginMreportingCommon::endGraph($options, $dashboard); + PluginMreportingCommon::endGraph($options, $dashboard); - $content = ob_get_clean(); + $content = ob_get_clean(); - if ($dashboard) { - return $content; - } else { - echo $content; - } - } + if ($dashboard) { + return $content; + } else { + echo $content; + } + } /** * Show a sunburst chart (see : http://mbostock.github.com/protovis/ex/sunburst.html) @@ -510,79 +523,81 @@ function showPie($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showSunburst($params, $dashboard = false, $width = false) { - ob_start(); - if ($width !== false) { - $this->width = $width; - } - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (isset($_REQUEST['export'])) { - $export_txt = "true"; - } else { - $export_txt = "false"; - } - - if (!isset($raw_datas['datas'])) { - echo "}"; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - $datas = $raw_datas['datas']; - - $labels2 = []; - if (isset($raw_datas['labels2'])) { - $labels2 = $raw_datas['labels2']; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $this->initDatasTree($datas, $unit); - - $always = ''; - $hover = ''; - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - $height = 450; - $width = $this->width; - $top = 10; - $left = 10; - if ($dashboard) { - $top = 25; - $height = 380; - $left = 50; - } + public function showSunburst($params, $dashboard = false, $width = false) + { + ob_start(); + if ($width !== false) { + $this->width = $width; + } + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (isset($_REQUEST['export'])) { + $export_txt = "true"; + } else { + $export_txt = "false"; + } + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + $datas = $raw_datas['datas']; + + $labels2 = []; + if (isset($raw_datas['labels2'])) { + $labels2 = $raw_datas['labels2']; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $this->initDatasTree($datas, $unit); + + $always = ''; + $hover = ''; + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + $height = 450; + $width = $this->width; + $top = 10; + $left = 10; + if ($dashboard) { + $top = 25; + $height = 380; + $left = 50; + } - $JS = << $opt, - "export" => $export, - "datas" => $datas, - "flip_data" => $flip_data, - "labels2" => $labels2, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - - $content = ob_get_clean(); - - if ($dashboard) { - return $content; - } else { - echo $content; - } - } + if ($show_graph) { + echo $JS; + } + + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "flip_data" => $flip_data, + "labels2" => $labels2, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + + $content = ob_get_clean(); + + if ($dashboard) { + return $content; + } else { + echo $content; + } + } /** * Show a horizontal grouped bar chart @@ -777,71 +793,73 @@ function getLevelNbNode(node) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showHgbar($params, $dashboard = false, $width = false) { - $criterias = PluginMreportingCommon::initGraphParams($params); - ob_start(); - if ($width !== false) { - $this->width = $width; - } - foreach ($criterias as $key => $val) { - $$key=$val; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (!isset($raw_datas['datas'])) { - echo "}"; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $raw_datas['datas']; - $labels2 = $raw_datas['labels2']; - $datas = $this->initDatasMultiple($datas, $labels2, $unit); - - $nb_bar = count($datas); - $nb_bar2 = count($labels2); - $height = 28 * $nb_bar * $nb_bar2 + 50; - - $always = ''; - $hover = ''; - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - $left = 240; - $bottomAxis = 5; - if ($dashboard) { - $left = 100; - if ($height > 300) { - $height = 300; - } - $bottomAxis = -15; - } + public function showHgbar($params, $dashboard = false, $width = false) + { + $criterias = PluginMreportingCommon::initGraphParams($params); + ob_start(); + if ($width !== false) { + $this->width = $width; + } + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $raw_datas['datas']; + $labels2 = $raw_datas['labels2']; + $datas = $this->initDatasMultiple($datas, $labels2, $unit); + + $nb_bar = count($datas); + $nb_bar2 = count($labels2); + $height = 28 * $nb_bar * $nb_bar2 + 50; + + $always = ''; + $hover = ''; + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + $left = 240; + $bottomAxis = 5; + if ($dashboard) { + $left = 100; + if ($height > 300) { + $height = 300; + } + $bottomAxis = -15; + } - $JS = <<width}; var height_hgbar = {$height}; var x = pv.Scale.linear(0, max).range(0, .7 * width_hgbar); @@ -961,27 +979,28 @@ function showHgbar($params, $dashboard = false, $width = false) { }, 20); JAVASCRIPT; - if ($show_graph) { - echo $JS; - } + if ($show_graph) { + echo $JS; + } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - - $content = ob_get_clean(); - - if ($dashboard) { - return $content; - } else { - echo $content; - } - } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + + $content = ob_get_clean(); + + if ($dashboard) { + return $content; + } else { + echo $content; + } + } /** @@ -996,71 +1015,73 @@ function showHgbar($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showVstackbar($params, $dashboard = false, $width = false) { - ob_start(); - if ($width !== false) { - $this->width = $width; - } - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (!isset($raw_datas['datas'])) { - echo "}"; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $raw_datas['datas']; - $labels2 = $raw_datas['labels2']; - $datas = $this->initDatasMultiple($datas, $labels2, $unit, true); - - $nb_bar = count($datas); - $nb_bar2 = count($labels2); - - $always = ''; - $hover = ''; - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - - $height = 20 * $nb_bar + 50; - if ($height < 400) { - $height = 400; - } - $width = $this->width; - if ($dashboard) { - $height = 250; - } - - $JS = <<width = $width; + } + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $raw_datas['datas']; + $labels2 = $raw_datas['labels2']; + $datas = $this->initDatasMultiple($datas, $labels2, $unit, true); + + $nb_bar = count($datas); + $nb_bar2 = count($labels2); + + $always = ''; + $hover = ''; + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + + $height = 20 * $nb_bar + 50; + if ($height < 400) { + $height = 400; + } + $width = $this->width; + if ($dashboard) { + $height = 250; + } + + $JS = << $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + + $content = ob_get_clean(); + + if ($dashboard) { + return $content; + } else { + echo $content; + } + } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - - $content = ob_get_clean(); - - if ($dashboard) { - return $content; - } else { - echo $content; - } - } /** * Show a Area chart * @@ -1219,74 +1242,76 @@ function showVstackbar($params, $dashboard = false, $width = false) { * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) * @param $area : show plain chart instead only a line (optionnal) - * @return nothing + * @return void */ - function showArea($params, $dashboard = false, $width = false) { - ob_start(); - if ($width !== false) { - $this->width = $width; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - $area = true; - if (isset($params['area'])) { - $area = $params['area']; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (!isset($raw_datas['datas'])) { - echo "}"; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $raw_datas['datas']; - $datas = $this->initDatasSimple($datas, $unit); - - $always = ''; - $hover = ''; - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - $height = 350; - $width = $this->width; - $bottom = 80; - $left = 20; - $right = 50; - if ($dashboard) { - $height = 340; - $width = 395; - $left = 30; - } - - $JS = <<width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + $area = true; + if (isset($params['area'])) { + $area = $params['area']; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $raw_datas['datas']; + $datas = $this->initDatasSimple($datas, $unit); + + $always = ''; + $hover = ''; + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + $height = 350; + $width = $this->width; + $bottom = 80; + $left = 20; + $right = 50; + if ($dashboard) { + $height = 340; + $width = 395; + $left = 30; + } + + $JS = << $opt, - "export" => $export, - "datas" => $datas, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); - $content = ob_get_clean(); + $content = ob_get_clean(); - if ($dashboard) { - return $content; - } else { - echo $content; - } - } + if ($dashboard) { + return $content; + } else { + echo $content; + } + } /** * Show a Line chart @@ -1444,16 +1470,17 @@ function showArea($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showLine($params, $dashboard = false, $width = false) { - $params['area'] = false; - if ($dashboard) { - return $this->showArea($params, $dashboard, $width); - } else { - $this->showArea($params, $dashboard, $width); - } - } + public function showLine($params, $dashboard = false, $width = false) + { + $params['area'] = false; + if ($dashboard) { + return $this->showArea($params, $dashboard, $width); + } else { + $this->showArea($params, $dashboard, $width); + } + } /** * Show a multi-area chart @@ -1467,73 +1494,75 @@ function showLine($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showGarea($params, $dashboard = false, $width = false) { - ob_start(); - if ($width !== false) { - $this->width = $width; - } - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - foreach ($configs as $k => $v) { - $$k=$v; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (!isset($raw_datas['datas'])) { - echo "}"; - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end, $dashboard); - return false; - } - - $area = true; - if (isset($params['area'])) { - $area = $params['area']; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = $raw_datas['datas']; - $labels2 = $raw_datas['labels2']; - $datas = $this->initDatasMultiple($datas, $labels2, $unit); - - $always = ''; - $hover = ''; - PluginMreportingConfig::checkVisibility($show_label, $always, $hover); - - $nb_bar = count($datas); - $height = 20 * $nb_bar + 250; - if ($height < 450) { - $height = 450; - } - if ($dashboard) { - $this->width -= 35; - $height = 350; - } - - $JS = <<width = $width; + } + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + foreach ($configs as $k => $v) { + $$k = $v; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (!isset($raw_datas['datas'])) { + echo "}"; + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end, $dashboard); + return false; + } + + $area = true; + if (isset($params['area'])) { + $area = $params['area']; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = $raw_datas['datas']; + $labels2 = $raw_datas['labels2']; + $datas = $this->initDatasMultiple($datas, $labels2, $unit); + + $always = ''; + $hover = ''; + PluginMreportingConfig::checkVisibility($show_label, $always, $hover); + + $nb_bar = count($datas); + $height = 20 * $nb_bar + 250; + if ($height < 450) { + $height = 450; + } + if ($dashboard) { + $this->width -= 35; + $height = 350; + } + + $JS = <<width}; var height_area = {$height}; var offset = 0; @@ -1674,27 +1703,28 @@ function showGarea($params, $dashboard = false, $width = false) { JAVASCRIPT; - if ($show_graph) { - echo $JS; - } - - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - - $content = ob_get_clean(); - - if ($dashboard) { - return $content; - } else { - echo $content; - } - } + if ($show_graph) { + echo $JS; + } + + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + + $content = ob_get_clean(); + + if ($dashboard) { + return $content; + } else { + echo $content; + } + } /** * Show a multi-line charts @@ -1707,67 +1737,68 @@ function showGarea($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showGline($params, $dashboard = false, $width = false) { - $params['area'] = false; - if ($dashboard) { - return $this->showGarea($params, $dashboard, $width); - } else { - $this->showGarea($params, $dashboard, $width); - } - } + public function showGline($params, $dashboard = false, $width = false) + { + $params['area'] = false; + if ($dashboard) { + return $this->showGarea($params, $dashboard, $width); + } else { + $this->showGarea($params, $dashboard, $width); + } + } /** * Compile simple datas * * @param $datas, ex : array( 'test1' => 15, 'test2' => 25) * @param $unit, ex : '%', 'Kg' (optionnal) - * @return nothing + * @return void */ - - function initDatasSimple($datas, $unit = '', $links = []) { - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - - $labels = array_keys($datas); - $values = array_values($datas); - - $out = "var datas = [\n"; - foreach ($values as $value) { - $out.= "\t".addslashes($value).",\n"; - } - $out = substr($out, 0, -2)."\n"; - $out.= "];\n"; - - $out.= "var labels = [\n"; - foreach ($labels as $label) { - $out.= "\t'".addslashes($label)."',\n"; - } - $out = substr($out, 0, -2)."\n"; - $out.= "];\n"; - - $out.= "var links = [\n"; - foreach ($links as $link) { - $out.= "\t'".addslashes($link)."',\n"; - } - $out.= "];\n"; - - echo $out; - if (count($values) > 0) { - $max = (max($values)*1.1); - } else { - $max = 1; - } - if ($unit == '%') { - $max = 110; - } - - echo "var max = $max;"; - echo "var n = ".count($values).";"; - - return $datas; - } + public function initDatasSimple($datas, $unit = '', $links = []) + { + + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + + $labels = array_keys($datas); + $values = array_values($datas); + + $out = "var datas = [\n"; + foreach ($values as $value) { + $out .= "\t" . addslashes($value) . ",\n"; + } + $out = substr($out, 0, -2) . "\n"; + $out .= "];\n"; + + $out .= "var labels = [\n"; + foreach ($labels as $label) { + $out .= "\t'" . addslashes($label) . "',\n"; + } + $out = substr($out, 0, -2) . "\n"; + $out .= "];\n"; + + $out .= "var links = [\n"; + foreach ($links as $link) { + $out .= "\t'" . addslashes($link) . "',\n"; + } + $out .= "];\n"; + + echo $out; + if (count($values) > 0) { + $max = (max($values) * 1.1); + } else { + $max = 1; + } + if ($unit == '%') { + $max = 110; + } + + echo "var max = $max;"; + echo "var n = " . count($values) . ";"; + + return $datas; + } /** * Compile multiple datas @@ -1776,86 +1807,83 @@ function initDatasSimple($datas, $unit = '', $links = []) { * @param $labels2 * @param $unit, ex : '%', 'Kg' (optionnal) * @param $stacked : if stacked graph, option to compile the max value - * @return nothing + * @return void */ + public function initDatasMultiple($datas, $labels2, $unit = '', $stacked = false) + { - function initDatasMultiple($datas, $labels2, $unit = '', $stacked = false) { + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $labels = array_keys($datas); + $values = array_values($datas); + $max = 0; - $labels = array_keys($datas); - $values = array_values($datas); - $max = 0; - - if ($stacked) { - - $tmp = []; - foreach ($values as $k => $v) { - - foreach ($v as $key => $val) { - $tmp[$key][$k] = $val; + if ($stacked) { + $tmp = []; + foreach ($values as $k => $v) { + foreach ($v as $key => $val) { + $tmp[$key][$k] = $val; + } } - } - if (count($tmp) > 0) { - foreach ($tmp as $date => $nb) { - $count = array_sum(array_values($nb)); - if ($count > $max) { - $max = $count; - } + if (count($tmp) > 0) { + foreach ($tmp as $date => $nb) { + $count = array_sum(array_values($nb)); + if ($count > $max) { + $max = $count; + } + } } - } - } - - //merge missing keys - $empty_values = array_fill_keys(array_keys($labels2), 0); - foreach ($values as $k => $v) { - $values[$k] = array_replace($empty_values, $v); - } - - $out = "var datas = [\n"; - foreach ($values as $line) { - $out.= "\t["; - foreach ($line as $label2 => $value) { - $out.= addslashes($value).","; - if ($value > $max && !$stacked) { - $max = $value; + } + + //merge missing keys + $empty_values = array_fill_keys(array_keys($labels2), 0); + foreach ($values as $k => $v) { + $values[$k] = array_replace($empty_values, $v); + } + + $out = "var datas = [\n"; + foreach ($values as $line) { + $out .= "\t["; + foreach ($line as $label2 => $value) { + $out .= addslashes($value) . ","; + if ($value > $max && !$stacked) { + $max = $value; + } } - } - $out = substr($out, 0, -1).""; - $out.= "],\n"; - } - $out = substr($out, 0, -2)."\n"; - $out.= "];\n"; - - $out.= "var labels = [\n"; - foreach ($labels as $label) { - $out.= "\t'".addslashes($label)."',\n"; - } - $out = substr($out, 0, -2)."\n"; - $out.= "];\n"; - - $out.= "var labels2 = [\n"; - foreach ($labels2 as $label) { - $out.= "\t'".addslashes($label)."',\n"; - } - $out = substr($out, 0, -2)."\n"; - $out.= "];\n"; - echo $out; - - if (!$stacked) { - $max = ($max*1.2); - } - if ($unit == '%') { - $max = 110; - } - - echo "var n = ".count($labels).";"; - echo "var m = ".count($labels2).";"; - echo "var max = $max;"; - - return $datas; - - } + $out = substr($out, 0, -1) . ""; + $out .= "],\n"; + } + $out = substr($out, 0, -2) . "\n"; + $out .= "];\n"; + + $out .= "var labels = [\n"; + foreach ($labels as $label) { + $out .= "\t'" . addslashes($label) . "',\n"; + } + $out = substr($out, 0, -2) . "\n"; + $out .= "];\n"; + + $out .= "var labels2 = [\n"; + foreach ($labels2 as $label) { + $out .= "\t'" . addslashes($label) . "',\n"; + } + $out = substr($out, 0, -2) . "\n"; + $out .= "];\n"; + echo $out; + + if (!$stacked) { + $max = ($max * 1.2); + } + if ($unit == '%') { + $max = 110; + } + + echo "var n = " . count($labels) . ";"; + echo "var m = " . count($labels2) . ";"; + echo "var max = $max;"; + + return $datas; + } /** @@ -1867,22 +1895,22 @@ function initDatasMultiple($datas, $labels2, $unit = '', $stacked = false) { * 'key2' => array('key2.1' => val, 'key2.2' => val, 'key2.3' => val) * ) * @param $unit, ex : '%', 'Kg' (optionnal) - * @return nothing + * @return void */ + public function initDatasTree($datas, $unit = '') + { - function initDatasTree($datas, $unit = '') { - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - echo "var datas = ".json_encode($datas).";"; - echo "var sum = ".PluginMreportingCommon::getArraySum($datas).";"; - - return $datas; - } + echo "var datas = " . json_encode($datas) . ";"; + echo "var sum = " . PluginMreportingCommon::getArraySum($datas) . ";"; + return $datas; + } - function legend($datas) { - } + public function legend($datas) + { + } } diff --git a/inc/graphcsv.class.php b/inc/graphcsv.class.php index eae23f64..56c2c7b0 100644 --- a/inc/graphcsv.class.php +++ b/inc/graphcsv.class.php @@ -1,246 +1,260 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingGraphcsv extends PluginMreportingGraph { - const DEBUG_CSV = false; - - function initGraph($options) { - if (!self::DEBUG_CSV) { - header("Content-type: application/csv"); - header("Content-Disposition: inline; filename=export.csv"); - } - } +class PluginMreportingGraphcsv extends PluginMreportingGraph +{ + const DEBUG_CSV = false; - function showHbar($params, $dashboard = false, $width = false) { - global $CFG_GLPI; + public function initGraph($options) + { + if (!self::DEBUG_CSV) { + header("Content-type: application/csv"); + header("Content-Disposition: inline; filename=export.csv"); + } + } - $criterias = PluginMreportingCommon::initGraphParams($params); - foreach ($criterias as $key => $val) { - $$key=$val; - } + public function showHbar($params, $dashboard = false, $width = false) + { + global $CFG_GLPI; - // Write in Log - if (self::DEBUG_CSV && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } + $criterias = PluginMreportingCommon::initGraphParams($params); + foreach ($criterias as $key => $val) { + $$key = $val; + } - $datas = isset($raw_datas['datas']) ? $raw_datas['datas'] : []; + // Write in Log + if (self::DEBUG_CSV && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } - if (count($datas) <= 0) { - return false; - } + $datas = isset($raw_datas['datas']) ? $raw_datas['datas'] : []; - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + if (count($datas) <= 0) { + return false; + } - foreach ($configs as $k => $v) { - $$k=$v; - } + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - if ($unit == '%') { - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - } + foreach ($configs as $k => $v) { + $$k = $v; + } - $values = array_values($datas); - $labels = array_keys($datas); + if ($unit == '%') { + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + } - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export]; + $values = array_values($datas); + $labels = array_keys($datas); - $this->initGraph($options); + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export + ]; - //titles - $out = $title." - ".$desc."\r\n"; - foreach ($labels as $label) { - $out.= $label.$CFG_GLPI['csv_delimiter']; - } - $out = substr($out, 0, -1)."\r\n"; + $this->initGraph($options); - //values - foreach ($values as $value) { - $out.= $value." ".$unit.$CFG_GLPI['csv_delimiter']; - } - $out = substr($out, 0, -1)."\r\n"; + //titles + $out = $title . " - " . $desc . "\r\n"; + foreach ($labels as $label) { + $out .= $label . $CFG_GLPI['csv_delimiter']; + } + $out = substr($out, 0, -1) . "\r\n"; - echo $out; - } + //values + foreach ($values as $value) { + $out .= $value . " " . $unit . $CFG_GLPI['csv_delimiter']; + } + $out = substr($out, 0, -1) . "\r\n"; - function showPie($params, $dashboard = false, $width = false) { - $this->showHbar($params); - } + echo $out; + } - function showHgbar($params, $dashboard = false, $width = false) { - global $CFG_GLPI; + public function showPie($params, $dashboard = false, $width = false) + { + $this->showHbar($params); + } - $criterias = PluginMreportingCommon::initGraphParams($params); + public function showHgbar($params, $dashboard = false, $width = false) + { + global $CFG_GLPI; - foreach ($criterias as $key => $val) { - $$key=$val; - } + $criterias = PluginMreportingCommon::initGraphParams($params); - // Write in log - if (self::DEBUG_CSV && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } + foreach ($criterias as $key => $val) { + $$key = $val; + } - $datas = isset($raw_datas['datas']) ? $raw_datas['datas'] : []; + // Write in log + if (self::DEBUG_CSV && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } - if (count($datas) <= 0) { - return false; - } + $datas = isset($raw_datas['datas']) ? $raw_datas['datas'] : []; - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + if (count($datas) <= 0) { + return false; + } - foreach ($configs as $k => $v) { - $$k=$v; - } + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - if ($unit == '%') { - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - } + foreach ($configs as $k => $v) { + $$k = $v; + } + + if ($unit == '%') { + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + } + + $labels2 = array_values($raw_datas['labels2']); + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export + ]; - $labels2 = array_values($raw_datas['labels2']); + $this->initGraph($options); - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export]; + $out = $title . " - " . $desc . "\r\n"; - $this->initGraph($options); + foreach ($datas as $label2 => $cols) { + //title + $out .= $label2 . "\r\n"; - $out = $title." - ".$desc."\r\n"; + //subtitle + $i = 0; + foreach ($cols as $value) { + $label = ""; + if (isset($labels2[$i])) { + $label = str_replace(",", "-", $labels2[$i]); + } + $out .= $label . $CFG_GLPI['csv_delimiter']; + $i++; + } + $out = substr($out, 0, -1) . "\r\n"; - foreach ($datas as $label2 => $cols) { - //title - $out.= $label2."\r\n"; + //values + foreach ($cols as $value) { + $out .= $value . " " . $unit . ";"; + } + $out = substr($out, 0, -1) . "\r\n\r\n"; + } + $out = substr($out, 0, -1) . "\r\n"; + + echo $out; + } + + public function showVstackbar($params, $dashboard = false, $width = false) + { + $this->showHGbar($params); + } + + public function showArea($params, $dashboard = false, $width = false) + { + $this->showHbar($params); + } + + public function showGarea($params, $dashboard = false, $width = false) + { + $this->showHGbar($params); + } + + public function showSunburst($params, $dashboard = false, $width = false) + { + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + if (self::DEBUG_CSV && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + if (count($datas) <= 0) { + return false; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if ($unit == '%') { + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export + ]; + + $this->initGraph($options); + + $out = $title . " - " . $desc . "\r\n"; + $out .= $this->sunburstLevel($datas); + + echo $out; + } + + public function sunburstLevel($datas, $level = 0) + { + $out = ""; + + $i = 0; + foreach ($datas as $label => $value) { + for ($j = 0; $j < $level; $j++) { + if ($i > 0) { + $out .= $CFG_GLPI['csv_delimiter']; + } + } - //subtitle - $i = 0; - foreach ($cols as $value) { - $label = ""; - if (isset($labels2[$i])) { - $label = str_replace(",", "-", $labels2[$i]); + if (is_array($value)) { + arsort($value); + $out .= $label . $CFG_GLPI['csv_delimiter']; + $out .= $this->sunburstLevel($value, $level + 1) . "\r\n"; + } else { + $out .= $label . $CFG_GLPI['csv_delimiter'] . $value . "\r\n"; } - $out.= $label.$CFG_GLPI['csv_delimiter']; $i++; - } - $out = substr($out, 0, -1)."\r\n"; - - //values - foreach ($cols as $value) { - $out.= $value." ".$unit.";"; - } - $out = substr($out, 0, -1)."\r\n\r\n"; - } - $out = substr($out, 0, -1)."\r\n"; - - echo $out; - } - - function showVstackbar($params, $dashboard = false, $width = false) { - $this->showHGbar($params); - } - - function showArea($params, $dashboard = false, $width = false) { - $this->showHbar($params); - } - - function showGarea($params, $dashboard = false, $width = false) { - $this->showHGbar($params); - } + } - function showSunburst($params, $dashboard = false, $width = false) { - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - if (self::DEBUG_CSV && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - if (count($datas) <= 0) { - return false; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if ($unit == '%') { - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export]; - - $this->initGraph($options); - - $out = $title." - ".$desc."\r\n"; - $out.= $this->sunburstLevel($datas); - - echo $out; - } - - function sunburstLevel($datas, $level = 0) { - $out = ""; - - $i = 0; - foreach ($datas as $label => $value) { - for ($j=0; $j < $level; $j++) { - if ($i > 0) { - $out.= $CFG_GLPI['csv_delimiter']; - } - } - - if (is_array($value)) { - arsort($value); - $out.= $label.$CFG_GLPI['csv_delimiter']; - $out.= $this->sunburstLevel($value, $level+1)."\r\n"; - } else { - $out.= $label.$CFG_GLPI['csv_delimiter'].$value."\r\n"; - } - $i++; - } - - return $out; - } + return $out; + } } diff --git a/inc/graphpng.class.php b/inc/graphpng.class.php index 077f0e12..01159ef7 100644 --- a/inc/graphpng.class.php +++ b/inc/graphpng.class.php @@ -1,52 +1,55 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ + require_once PLUGIN_MREPORTING_DIR . '/lib/imagesmootharc/imageSmoothArc.php'; require_once PLUGIN_MREPORTING_DIR . '/lib/cubic_splines/classes/CubicSplines.php'; -class PluginMreportingGraphpng extends PluginMreportingGraph { - - const DEBUG_GRAPH = false; +class PluginMreportingGraphpng extends PluginMreportingGraph +{ + const DEBUG_GRAPH = false; - //define common colors - private $black = "0x00000000"; - private $white = "0x00FFFFFF"; - private $grey = "0x00F2F2F2"; - private $darkgrey = "0x00B4B4B4"; + //define common colors + private $black = "0x00000000"; + private $white = "0x00FFFFFF"; + private $grey = "0x00F2F2F2"; + private $darkgrey = "0x00B4B4B4"; - //define font - private $font = ''; - private $fontsize = 8; - private $fontangle = 0; + //define font + private $font = ''; + private $fontsize = 8; + private $fontangle = 0; - function __construct() { - $this->font = PLUGIN_MREPORTING_DIR . '/fonts/FreeSans.ttf'; - } + public function __construct() + { + $this->font = PLUGIN_MREPORTING_DIR . '/fonts/FreeSans.ttf'; + } /** @@ -54,291 +57,303 @@ function __construct() { * * @params $options ($rand, short_classname, title, desc, delay) */ - function initGraph($options) { - global $LANG, $CFG_GLPI; + public function initGraph($options) + { + global $LANG, $CFG_GLPI; - $randname = $options['randname']; + $randname = $options['randname']; - if (!$options['export'] && !$options['showHeader']) { + if (!$options['export'] && !$options['showHeader']) { + $width = $this->width + 100; - $width = $this->width + 100; - - if (!isset($_REQUEST['date1'.$randname])) { - $_REQUEST['date1'.$randname] = strftime("%Y-%m-%d", time() - - ($options['delay'] * 24 * 60 * 60)); - } - if (!isset($_REQUEST['date2'.$randname])) { - $_REQUEST['date2'.$randname] = strftime("%Y-%m-%d"); - } + if (!isset($_REQUEST['date1' . $randname])) { + $_REQUEST['date1' . $randname] = strftime("%Y-%m-%d", time() + - ($options['delay'] * 24 * 60 * 60)); + } + if (!isset($_REQUEST['date2' . $randname])) { + $_REQUEST['date2' . $randname] = strftime("%Y-%m-%d"); + } - $backtrace = debug_backtrace(); - $prev_function = strtolower(str_replace('show', '', $backtrace[1]['function'])); + $backtrace = debug_backtrace(); + $prev_function = strtolower(str_replace('show', '', $backtrace[1]['function'])); - echo "
"; - if (isset($LANG['plugin_mreporting'][$options['short_classname']]['title'])) { + echo "
"; + if (isset($LANG['plugin_mreporting'][$options['short_classname']]['title'])) { + echo "
"; + echo $LANG['plugin_mreporting'][$options['short_classname']]['title']; + echo "
"; + } echo "
"; - echo $LANG['plugin_mreporting'][$options['short_classname']]['title']; + echo ""; + echo $options['title']; + echo "
"; + + $desc = ''; + if (!empty($options['desc'])) { + $desc = $options['desc']; + } + if ( + !empty($options['desc']) + && isset($_REQUEST['date1' . $randname]) + && isset($_REQUEST['date1' . $randname]) + ) { + $desc .= " - "; + } + if ( + isset($_REQUEST['date1' . $randname]) + && isset($_REQUEST['date1' . $randname]) + ) { + $desc .= Html::convdate($_REQUEST['date1' . $randname]) . " / " . + Html::convdate($_REQUEST['date2' . $randname]); + } + echo "
" . $desc . "
"; + + echo "
"; + PluginMreportingCommon::showSelector( + $_REQUEST['date1' . $randname], + $_REQUEST['date2' . $randname], + $randname + ); echo "
"; - } - echo "
"; - echo ""; - echo $options['title']; - echo "
"; - - $desc = ''; - if (!empty($options['desc'])) { - $desc =$options['desc']; - } - if (!empty($options['desc']) - &&isset($_REQUEST['date1'.$randname]) - && isset($_REQUEST['date1'.$randname])) { - $desc.= " - "; - } - if (isset($_REQUEST['date1'.$randname]) - && isset($_REQUEST['date1'.$randname])) { - $desc.= Html::convdate($_REQUEST['date1'.$randname])." / ". - Html::convdate($_REQUEST['date2'.$randname]); - } - echo "
".$desc."
"; - - echo "
"; - PluginMreportingCommon::showSelector( - $_REQUEST['date1'.$randname], $_REQUEST['date2'.$randname], $randname); - echo "
"; - } - if ($options['export']!="odt" && $options['export']!="odtall") { - echo "
"; - } - } - - - function showImage($contents, $export = "png") { - global $CFG_GLPI; - - if ($export!="odt" && $export!="odtall") { - - //test browser (if IE < 9, show img from temp dir instead base64 inline) - if (isset($_SERVER["HTTP_USER_AGENT"])) { - $ua = trim(strtolower($_SERVER["HTTP_USER_AGENT"])); - $pattern = "/msie\s(\d+)\.0/"; - if (preg_match($pattern, $ua, $arr)) { - $ie_version = $arr[1]; - if (version_compare($ie_version, '9') < 0) { - $rand=mt_rand(); - $filename = "mreporting_img_$rand.png"; - $filedir = GLPI_ROOT."/files/_plugins/mreporting/$filename"; - file_put_contents($filedir, $contents); - - echo "graph"; - return; - } - } - } - - echo "graph"; - - } - } - - - function generateImage($params) { - - // Default values of parameters - $image = ""; - $export = "png"; - $f_name = ""; - $class = ""; - $title = ""; - $unit = ''; - $raw_datas = []; - $withdata = 0; - - foreach ($params as $key => $val) { - $$key=$val; - } - - ob_start(); - - if ($export=="odt") { - $show_graph = PluginMreportingConfig::showGraphConfigValue($f_name, $class); - if ($show_graph) { - $path=GLPI_PLUGIN_DOC_DIR."/mreporting/".$f_name.".png"; - imagepng($image, $path); - } - $common = new PluginMreportingCommon(); - $options[] = ["title" => $title, - "f_name" => $f_name, - "class" => $class, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $withdata]; - $common->generateOdt($options); - return true; - - } else if ($export=="odtall") { - - $show_graph = PluginMreportingConfig::showGraphConfigValue($f_name, $class); - if ($show_graph) { - $path=GLPI_PLUGIN_DOC_DIR."/mreporting/".$f_name.".png"; - imagepng($image, $path); - } - if (isset($raw_datas['datas'])) { - $_SESSION['glpi_plugin_mreporting_odtarray'][]=["title" => $title, - "f_name" => $f_name, - "class" => $class, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $withdata]; - } - - return true; - - } else { - imagepng($image); - $contents = ob_get_contents(); - ob_end_clean(); - return $contents; - } - - } - - - static function getColors($index = 20) { - $colors = PluginMreportingConfig::getColors($index); - foreach ($colors as &$color) { - $color = str_replace('#', '', $color); - } - return $colors; - } + } + if ($options['export'] != "odt" && $options['export'] != "odtall") { + echo "
"; + } + } + + + public function showImage($contents, $export = "png") + { + global $CFG_GLPI; + + if ($export != "odt" && $export != "odtall") { + //test browser (if IE < 9, show img from temp dir instead base64 inline) + if (isset($_SERVER["HTTP_USER_AGENT"])) { + $ua = trim(strtolower($_SERVER["HTTP_USER_AGENT"])); + $pattern = "/msie\s(\d+)\.0/"; + if (preg_match($pattern, $ua, $arr)) { + $ie_version = $arr[1]; + if (version_compare($ie_version, '9') < 0) { + $rand = mt_rand(); + $filename = "mreporting_img_$rand.png"; + $filedir = GLPI_ROOT . "/files/_plugins/mreporting/$filename"; + file_put_contents($filedir, $contents); + + echo "graph"; + return; + } + } + } + + echo "graph"; + } + } + + + public function generateImage($params) + { + + // Default values of parameters + $image = ""; + $export = "png"; + $f_name = ""; + $class = ""; + $title = ""; + $unit = ''; + $raw_datas = []; + $withdata = 0; + + foreach ($params as $key => $val) { + $$key = $val; + } + + ob_start(); + + if ($export == "odt") { + $show_graph = PluginMreportingConfig::showGraphConfigValue($f_name, $class); + if ($show_graph) { + $path = GLPI_PLUGIN_DOC_DIR . "/mreporting/" . $f_name . ".png"; + imagepng($image, $path); + } + $common = new PluginMreportingCommon(); + $options[] = ["title" => $title, + "f_name" => $f_name, + "class" => $class, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $withdata + ]; + $common->generateOdt($options); + return true; + } else if ($export == "odtall") { + $show_graph = PluginMreportingConfig::showGraphConfigValue($f_name, $class); + if ($show_graph) { + $path = GLPI_PLUGIN_DOC_DIR . "/mreporting/" . $f_name . ".png"; + imagepng($image, $path); + } + if (isset($raw_datas['datas'])) { + $_SESSION['glpi_plugin_mreporting_odtarray'][] = ["title" => $title, + "f_name" => $f_name, + "class" => $class, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $withdata + ]; + } + + return true; + } else { + imagepng($image); + $contents = ob_get_contents(); + ob_end_clean(); + return $contents; + } + } + + + public static function getColors($index = 20) + { + $colors = PluginMreportingConfig::getColors($index); + foreach ($colors as &$color) { + $color = str_replace('#', '', $color); + } + return $colors; + } /** * returns an array with the rgb values **/ - static function colorHexToRGB($color) { - $hex = substr($color, 4); - - if (strlen($hex) == 3) { - $r = substr($hex, 0, 1).substr($hex, 0, 1); - $g = substr($hex, 1, 1).substr($hex, 1, 1); - $b = substr($hex, 2, 1).substr($hex, 2, 1); - } else { - $r = substr($hex, 0, 2); - $g = substr($hex, 2, 2); - $b = substr($hex, 4, 2); - } - - $alpha = substr($color, 0, 4); - return [hexdec($r), hexdec($g), hexdec($b), hexdec($alpha)]; - } - - - - static function getPalette($nb_index = 20, $alpha = "00") { - $palette = []; - foreach (self::getColors($nb_index) as $color) { - $palette[] = "0x$alpha".substr($color, 0, 6); - } - - if ($nb_index > 20) { - $nb = ceil($nb_index / 20); - $tmp = $palette; - for ($i = 0; $i <= $nb; $i++) { - $palette = array_merge($palette, $tmp); - } - } - return $palette; - } - - - - static function getDarkerPalette($nb_index = 20, $alpha = "00") { - $palette = []; - foreach (self::getColors($nb_index) as $color) { - $palette[] = "0x$alpha".substr(self::darker($color), 0, 6); - } - if ($nb_index > 20) { - $nb = ceil($nb_index / 20); - $tmp = $palette; - for ($i = 0; $i <= $nb; $i++) { - $palette = array_merge($palette, $tmp); - } - } - return $palette; - } - - - static function getLighterPalette($nb_index = 20, $alpha = "00") { - $palette = []; - foreach (self::getColors($nb_index) as $color) { - $palette[] = "0x$alpha".substr(self::lighter($color), 0, 6); - } - if ($nb_index > 20) { - $nb = ceil($nb_index / 20); - $tmp = $palette; - for ($i = 0; $i <= $nb; $i++) { - $palette = array_merge($palette, $tmp); - } - } - return $palette; - } - - static function darker($color, $factor = 50) { - if (strlen($color) == 10) { - $color = substr($color, 4); - } - - $new_hex = ''; - - $base['R'] = hexdec($color[0].$color[1]); - $base['G'] = hexdec($color[2].$color[3]); - $base['B'] = hexdec($color[4].$color[5]); - - foreach ($base as $k => $v) { - $amount = $v / 100; - $amount = round($amount * $factor); - $new_decimal = $v - $amount; - - $new_hex_component = dechex($new_decimal); - if (strlen($new_hex_component) < 2) { - $new_hex_component = "0".$new_hex_component; - } - $new_hex .= $new_hex_component; - } - - return $new_hex; - } - - - static function lighter($color, $factor = 50) { - if (strlen($color) == 10) { - $color = substr($color, 4); - } - - $new_hex = ''; - - $base['R'] = hexdec($color[0].$color[1]); - $base['G'] = hexdec($color[2].$color[3]); - $base['B'] = hexdec($color[4].$color[5]); - - foreach ($base as $k => $v) { - $amount = 255 - $v; - $amount = $amount / 100; - $amount = round($amount * $factor); - $new_decimal = $v + $amount; - - $new_hex_component = dechex($new_decimal); - if (strlen($new_hex_component) < 2) { - $new_hex_component = "0".$new_hex_component; - } - $new_hex .= $new_hex_component; - } - - return $new_hex; - } + public static function colorHexToRGB($color) + { + $hex = substr($color, 4); + + if (strlen($hex) == 3) { + $r = substr($hex, 0, 1) . substr($hex, 0, 1); + $g = substr($hex, 1, 1) . substr($hex, 1, 1); + $b = substr($hex, 2, 1) . substr($hex, 2, 1); + } else { + $r = substr($hex, 0, 2); + $g = substr($hex, 2, 2); + $b = substr($hex, 4, 2); + } + + $alpha = substr($color, 0, 4); + return [hexdec($r), hexdec($g), hexdec($b), hexdec($alpha)]; + } + + + + public static function getPalette($nb_index = 20, $alpha = "00") + { + $palette = []; + foreach (self::getColors($nb_index) as $color) { + $palette[] = "0x$alpha" . substr($color, 0, 6); + } + + if ($nb_index > 20) { + $nb = ceil($nb_index / 20); + $tmp = $palette; + for ($i = 0; $i <= $nb; $i++) { + $palette = array_merge($palette, $tmp); + } + } + return $palette; + } + + + + public static function getDarkerPalette($nb_index = 20, $alpha = "00") + { + $palette = []; + foreach (self::getColors($nb_index) as $color) { + $palette[] = "0x$alpha" . substr(self::darker($color), 0, 6); + } + if ($nb_index > 20) { + $nb = ceil($nb_index / 20); + $tmp = $palette; + for ($i = 0; $i <= $nb; $i++) { + $palette = array_merge($palette, $tmp); + } + } + return $palette; + } + + + public static function getLighterPalette($nb_index = 20, $alpha = "00") + { + $palette = []; + foreach (self::getColors($nb_index) as $color) { + $palette[] = "0x$alpha" . substr(self::lighter($color), 0, 6); + } + if ($nb_index > 20) { + $nb = ceil($nb_index / 20); + $tmp = $palette; + for ($i = 0; $i <= $nb; $i++) { + $palette = array_merge($palette, $tmp); + } + } + return $palette; + } + + public static function darker($color, $factor = 50) + { + if (strlen($color) == 10) { + $color = substr($color, 4); + } + + $new_hex = ''; + + $base['R'] = hexdec($color[0] . $color[1]); + $base['G'] = hexdec($color[2] . $color[3]); + $base['B'] = hexdec($color[4] . $color[5]); + + foreach ($base as $k => $v) { + $amount = $v / 100; + $amount = round($amount * $factor); + $new_decimal = $v - $amount; + + $new_hex_component = dechex($new_decimal); + if (strlen($new_hex_component) < 2) { + $new_hex_component = "0" . $new_hex_component; + } + $new_hex .= $new_hex_component; + } + + return $new_hex; + } + + + public static function lighter($color, $factor = 50) + { + if (strlen($color) == 10) { + $color = substr($color, 4); + } + + $new_hex = ''; + + $base['R'] = hexdec($color[0] . $color[1]); + $base['G'] = hexdec($color[2] . $color[3]); + $base['B'] = hexdec($color[4] . $color[5]); + + foreach ($base as $k => $v) { + $amount = 255 - $v; + $amount = $amount / 100; + $amount = round($amount * $factor); + $new_decimal = $v + $amount; + + $new_hex_component = dechex($new_decimal); + if (strlen($new_hex_component) < 2) { + $new_hex_component = "0" . $new_hex_component; + } + $new_hex .= $new_hex_component; + } + + return $new_hex; + } /** @@ -356,105 +371,143 @@ static function lighter($color, $factor = 50) { * * @author DASPRiD */ - function imageSmoothAlphaLine ($image, $x1, $y1, $x2, $y2, $dcol) { - - $height = imagesy($image)-1; - $width = imagesx($image)-1; - - $rgba = self::colorHexToRGB($dcol); - $r = $rgba[0]; - $g = $rgba[1]; - $b = $rgba[2]; - $alpha = $rgba[3]; - - $icr = $r; - $icg = $g; - $icb = $b; - - $m = ($y2 - $y1) / ($x2 - $x1); - $b = $y1 - $m * $x1; - - if (abs ($m) <2) { - $x = min($x1, $x2); - $endx = max($x1, $x2) + 1; - - while ($x < $endx) { - $y = $m * $x + $b; - $ya = ($y == floor($y) ? 1: $y - floor($y)); - $yb = ceil($y) - $y; - - if ($x > $width) { - break; - } - - if ($y > $height) { - $x++; - continue; - } - - $trgb = ImageColorAt($image, $x, floor($y)); - $tcr = ($trgb >> 16) & 0xFF; - $tcg = ($trgb >> 8) & 0xFF; - $tcb = $trgb & 0xFF; - imagesetpixel($image, $x, floor($y), - imagecolorallocatealpha($image, round($tcr * $ya + $icr * $yb), - ($tcg * $ya + $icg * $yb), ($tcb * $ya + $icb * $yb), hexdec($alpha))); - - $trgb = ImageColorAt($image, $x, ceil($y)); - $tcr = ($trgb >> 16) & 0xFF; - $tcg = ($trgb >> 8) & 0xFF; - $tcb = $trgb & 0xFF; - imagesetpixel($image, $x, ceil($y), - imagecolorallocatealpha($image, round($tcr * $yb + $icr * $ya), - round($tcg * $yb + $icg * $ya), round($tcb * $yb + $icb * $ya), hexdec($alpha))); - - $x++; - } - } else { - $y = min($y1, $y2); - $endy = max($y1, $y2) + 1; - - while ($y < $endy) { - $x = ($y - $b) / $m; - $xa = ($x == floor($x) ? 1: $x - floor($x)); - $xb = ceil($x) - $x; - - if ($x > $width) { - $y++; - continue; - } - - $trgb = ImageColorAt($image, floor($x), $y); - $tcr = ($trgb >> 16) & 0xFF; - $tcg = ($trgb >> 8) & 0xFF; - $tcb = $trgb & 0xFF; - imagesetpixel($image, floor($x), $y, - imagecolorallocatealpha($image, round($tcr * $xa + $icr * $xb), - round($tcg * $xa + $icg * $xb), round($tcb * $xa + $icb * $xb), hexdec($alpha))); - - $trgb = ImageColorAt($image, ceil($x), $y); - $tcr = ($trgb >> 16) & 0xFF; - $tcg = ($trgb >> 8) & 0xFF; - $tcb = $trgb & 0xFF; - imagesetpixel ($image, ceil($x), $y, - imagecolorallocatealpha($image, round($tcr * $xb + $icr * $xa), - round($tcg * $xb + $icg * $xa), round($tcb * $xb + $icb * $xa), hexdec($alpha))); - - $y ++; - } - } - } // end of 'imageSmoothAlphaLine()' function - - - function imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $color) { - imageline($image, $x1, $y1, $x2, $y2, hexdec($color)); - $this->imageSmoothAlphaLine($image, $x1-1, $y1-1, $x2-1, $y2-1, $color); - $this->imageSmoothAlphaLine($image, $x1+1, $y1+1, $x2+1, $y2+1, $color); - $this->imageSmoothAlphaLine($image, $x1, $y1+1, $x2, $y2+1, $color); - $this->imageSmoothAlphaLine($image, $x1, $y1-1, $x2, $y2-1, $color); - $this->imageSmoothAlphaLine($image, $x1-1, $y1, $x2-1, $y2, $color); - $this->imageSmoothAlphaLine($image, $x1+1, $y1, $x2+1, $y2, $color); - } + public function imageSmoothAlphaLine($image, $x1, $y1, $x2, $y2, $dcol) + { + + $height = imagesy($image) - 1; + $width = imagesx($image) - 1; + + $rgba = self::colorHexToRGB($dcol); + $r = $rgba[0]; + $g = $rgba[1]; + $b = $rgba[2]; + $alpha = $rgba[3]; + + $icr = $r; + $icg = $g; + $icb = $b; + + $m = ($y2 - $y1) / ($x2 - $x1); + $b = $y1 - $m * $x1; + + if (abs($m) < 2) { + $x = min($x1, $x2); + $endx = max($x1, $x2) + 1; + + while ($x < $endx) { + $y = $m * $x + $b; + $ya = ($y == floor($y) ? 1 : $y - floor($y)); + $yb = ceil($y) - $y; + + if ($x > $width) { + break; + } + + if ($y > $height) { + $x++; + continue; + } + + $trgb = ImageColorAt($image, $x, floor($y)); + $tcr = ($trgb >> 16) & 0xFF; + $tcg = ($trgb >> 8) & 0xFF; + $tcb = $trgb & 0xFF; + imagesetpixel( + $image, + $x, + floor($y), + imagecolorallocatealpha( + $image, + round($tcr * $ya + $icr * $yb), + ($tcg * $ya + $icg * $yb), + ($tcb * $ya + $icb * $yb), + hexdec($alpha) + ) + ); + + $trgb = ImageColorAt($image, $x, ceil($y)); + $tcr = ($trgb >> 16) & 0xFF; + $tcg = ($trgb >> 8) & 0xFF; + $tcb = $trgb & 0xFF; + imagesetpixel( + $image, + $x, + ceil($y), + imagecolorallocatealpha( + $image, + round($tcr * $yb + $icr * $ya), + round($tcg * $yb + $icg * $ya), + round($tcb * $yb + $icb * $ya), + hexdec($alpha) + ) + ); + + $x++; + } + } else { + $y = min($y1, $y2); + $endy = max($y1, $y2) + 1; + + while ($y < $endy) { + $x = ($y - $b) / $m; + $xa = ($x == floor($x) ? 1 : $x - floor($x)); + $xb = ceil($x) - $x; + + if ($x > $width) { + $y++; + continue; + } + + $trgb = ImageColorAt($image, floor($x), $y); + $tcr = ($trgb >> 16) & 0xFF; + $tcg = ($trgb >> 8) & 0xFF; + $tcb = $trgb & 0xFF; + imagesetpixel( + $image, + floor($x), + $y, + imagecolorallocatealpha( + $image, + round($tcr * $xa + $icr * $xb), + round($tcg * $xa + $icg * $xb), + round($tcb * $xa + $icb * $xb), + hexdec($alpha) + ) + ); + + $trgb = ImageColorAt($image, ceil($x), $y); + $tcr = ($trgb >> 16) & 0xFF; + $tcg = ($trgb >> 8) & 0xFF; + $tcb = $trgb & 0xFF; + imagesetpixel( + $image, + ceil($x), + $y, + imagecolorallocatealpha( + $image, + round($tcr * $xb + $icr * $xa), + round($tcg * $xb + $icg * $xa), + round($tcb * $xb + $icb * $xa), + hexdec($alpha) + ) + ); + + $y++; + } + } + } + + + public function imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $color) + { + imageline($image, $x1, $y1, $x2, $y2, hexdec($color)); + $this->imageSmoothAlphaLine($image, $x1 - 1, $y1 - 1, $x2 - 1, $y2 - 1, $color); + $this->imageSmoothAlphaLine($image, $x1 + 1, $y1 + 1, $x2 + 1, $y2 + 1, $color); + $this->imageSmoothAlphaLine($image, $x1, $y1 + 1, $x2, $y2 + 1, $color); + $this->imageSmoothAlphaLine($image, $x1, $y1 - 1, $x2, $y2 - 1, $color); + $this->imageSmoothAlphaLine($image, $x1 - 1, $y1, $x2 - 1, $y2, $color); + $this->imageSmoothAlphaLine($image, $x1 + 1, $y1, $x2 + 1, $y2, $color); + } /** @@ -466,31 +519,38 @@ function imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $color) { * @param coords array with points coordinates (x1 => y1, x2 => y2, etc) * */ - function imageCubicSmoothLine($image, $color, $coords) { + public function imageCubicSmoothLine($image, $color, $coords) + { - $oCurve = new CubicSplines(); - if ($oCurve->setInitCoords($coords, 6) !== false) { - if (!$r = $oCurve->processCoords()) { + $oCurve = new CubicSplines(); + if ($oCurve->setInitCoords($coords, 6) !== false) { + if (!$r = $oCurve->processCoords()) { + $r = $coords; + } + } else { $r = $coords; - } - } else { - $r = $coords; - } - - $iPrevX = key($r); - $iPrevY = current($r); - - while (false !== next($r)) { - $x = key($r); - $y = current($r); - - $this->imageSmoothAlphaLineLarge( - $image, round($iPrevX), round($iPrevY), round($x), round($y), $color); + } + + $iPrevX = key($r); + $iPrevY = current($r); + + while (false !== next($r)) { + $x = key($r); + $y = current($r); + + $this->imageSmoothAlphaLineLarge( + $image, + round($iPrevX), + round($iPrevY), + round($x), + round($y), + $color + ); - $iPrevX = $x; - $iPrevY = $y; - } - } + $iPrevX = $x; + $iPrevY = $y; + } + } /** @@ -504,187 +564,190 @@ function imageCubicSmoothLine($image, $color, $coords) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showHbar($params, $dashboard = false, $width = false) { - if ($width !== false) { - $this->width = $width + 50; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - //$rand = $opt['rand']; - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $raw_datas['datas'] = $datas; - - $values = array_values($datas); - $labels = array_keys($datas); - $max = max($values); - if ($max <= 1) { - $max = 1; - } - if ($max == 1 && $unit == '%') { - $max = 100; - } - - $nb_bar = count($datas); - $width = $this->width; - $height = 30 * $nb_bar + 80; - if ($dashboard) { - if ($height > 380) { - $height = 380; - } - } - $height_bar = .7 * $height / ($nb_bar+1); - - //create image - $image = imagecreatetruecolor ($width, $height); - - if ($show_graph) { - //colors - $palette = self::getPalette($nb_bar); - $darkerpalette = self::getDarkerPalette($nb_bar); - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); - - //create border on export - if ($export) { - $bg_color = hexdec($this->black); - imagerectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); - } - - //add title on export - if ($export) { - imagettftext( - $image, - $this->fontsize+2, - $this->fontangle, - 10, - 20, - hexdec($this->black), - $this->font, - $title - ); - } - - //bars - $index = 0; - foreach ($datas as $label => $data) { - $bx1 = 250; - $by1 = ($index+1) * 1.25 * $height_bar + .05 * $height + 2; - $bx2 = $bx1 + round(($data*($width -300)) / $max); - $by2 = $by1 + $height_bar; - - //createbar - ImageFilledRectangle($image, $bx1, $by1, $bx2, $by2, hexdec($palette[$index])); - imagerectangle($image, $bx1, $by1-1, $bx2+1, $by2+1, hexdec($darkerpalette[$index])); - imagerectangle($image, $bx1, $by1-2, $bx2+2, $by2+2, hexdec($darkerpalette[$index])); - - //create data label - if ($show_label == "always" || $show_label == "hover") { - imagettftext( - $image, - $this->fontsize, - $this->fontangle, - $bx2 + 6, - $by1 + 14, - hexdec($darkerpalette[$index]), - $this->font, - Html::clean($data.$unit) - ); - } - //create axis label (align right) - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $labels[$index]); - $textwidth = abs($box[4] - $box[0]); - $textheight = abs($box[5] - $box[1]); - imagettftext( - $image, - $this->fontsize, - $this->fontangle, - 245 - $textwidth, - $by1 + 14, - hexdec($this->black), - $this->font, - Html::clean($labels[$index]) - ); + public function showHbar($params, $dashboard = false, $width = false) + { + if ($width !== false) { + $this->width = $width + 50; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + //$rand = $opt['rand']; + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); + } + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $raw_datas['datas'] = $datas; + + $values = array_values($datas); + $labels = array_keys($datas); + $max = max($values); + if ($max <= 1) { + $max = 1; + } + if ($max == 1 && $unit == '%') { + $max = 100; + } + + $nb_bar = count($datas); + $width = $this->width; + $height = 30 * $nb_bar + 80; + if ($dashboard) { + if ($height > 380) { + $height = 380; + } + } + $height_bar = .7 * $height / ($nb_bar + 1); - $index++; - } - - //y axis - imageline($image, 250, 40, 250, $height-20, hexdec($this->black)); - imageline($image, 251, 40, 251, $height-20, hexdec($this->black)); - } - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - - $contents = $this->generateImage($params); - if ($show_graph) { - $this->showImage($contents, $export); - } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - } + //create image + $image = imagecreatetruecolor($width, $height); + + if ($show_graph) { + //colors + $palette = self::getPalette($nb_bar); + $darkerpalette = self::getDarkerPalette($nb_bar); + + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); + + //create border on export + if ($export) { + $bg_color = hexdec($this->black); + imagerectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); + } + + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); + } + + //bars + $index = 0; + foreach ($datas as $label => $data) { + $bx1 = 250; + $by1 = ($index + 1) * 1.25 * $height_bar + .05 * $height + 2; + $bx2 = $bx1 + round(($data * ($width - 300)) / $max); + $by2 = $by1 + $height_bar; + + //createbar + ImageFilledRectangle($image, $bx1, $by1, $bx2, $by2, hexdec($palette[$index])); + imagerectangle($image, $bx1, $by1 - 1, $bx2 + 1, $by2 + 1, hexdec($darkerpalette[$index])); + imagerectangle($image, $bx1, $by1 - 2, $bx2 + 2, $by2 + 2, hexdec($darkerpalette[$index])); + + //create data label + if ($show_label == "always" || $show_label == "hover") { + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $bx2 + 6, + $by1 + 14, + hexdec($darkerpalette[$index]), + $this->font, + Toolbox::stripTags($data . $unit) + ); + } + //create axis label (align right) + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $labels[$index]); + $textwidth = abs($box[4] - $box[0]); + $textheight = abs($box[5] - $box[1]); + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + 245 - $textwidth, + $by1 + 14, + hexdec($this->black), + $this->font, + Toolbox::stripTags($labels[$index]) + ); + + $index++; + } + + //y axis + imageline($image, 250, 40, 250, $height - 20, hexdec($this->black)); + imageline($image, 251, 40, 251, $height - 20, hexdec($this->black)); + } + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + + $contents = $this->generateImage($params); + if ($show_graph) { + $this->showImage($contents, $export); + } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + } /** @@ -699,195 +762,230 @@ function showHbar($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showPie($params, $dashboard = false, $width = false) { - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - if ($width !== false) { - $this->width = $width; - } - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $raw_datas['datas'] = $datas; - - $values = array_values($datas); - - $labels = array_keys($datas); - $max = 0; - foreach ($values as $value) { - $max += $value; - } - if ($max < 1) { - $max = 1; - } - if ($max == 1 && $unit == '%') { - $max = 100; - } - - $nb_bar = count($datas); - $width = $this->width; - - $height = 15 * $nb_bar + 50; - if ($height < 300) { - $height = 370; - } - //create image - $image = imagecreatetruecolor ($width, $height); - - if ($show_graph) { - //colors - $palette = self::getPalette($nb_bar); - $darkerpalette = self::getDarkerPalette($nb_bar); - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); - - //create border on export - if ($export) { - imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); - } - - //add title on export - if ($export) { - imagettftext($image, $this->fontsize+2, $this->fontangle, 10, 20, - hexdec($this->black), $this->font, $title); - } - - if ($export && $desc) { - imagettftext($image, $this->fontsize+2, $this->fontangle, 10, 35, - hexdec($this->black), $this->font, $desc); - } - - //pie - $index = 0; - $x = $width / 4 + .43 * $width; - $y = $height / 2; - $radius = $height / 1.5; - $start_angle = 0; - foreach ($datas as $label => $data) { - $angle = $start_angle + (360 * $data) / $max; - - //full circle need fix - if ($angle - $start_angle == 360) { - $angle = 359.999; - $start_angle = 0; - } - - if ($data != 0) { - $color_rbg = self::colorHexToRGB($palette[$index]); - imageSmoothArc($image, $x, $y, $radius+8, $radius+8, $color_rbg, - deg2rad($start_angle), deg2rad($angle)); - - //text associated with pie arc (only for angle > 2°) - if ($angle > 2 && ($show_label == "always" || $show_label == "hover")) { - $xtext = $x - 1 + cos(deg2rad(($start_angle + $angle)/2)) * ($radius / 1.7); - $ytext = $y + 5 - sin(deg2rad(($start_angle + $angle)/2)) * ($radius / 1.7); - imagettftext( - $image, - $this->fontsize, - $this->fontangle, - $xtext, - $ytext, - hexdec($darkerpalette[$index]), - $this->font, - Html::clean($data.$unit) - ); - } + public function showPie($params, $dashboard = false, $width = false) + { + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + if ($width !== false) { + $this->width = $width; + } + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); + } + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $raw_datas['datas'] = $datas; + + $values = array_values($datas); + + $labels = array_keys($datas); + $max = 0; + foreach ($values as $value) { + $max += $value; + } + if ($max < 1) { + $max = 1; + } + if ($max == 1 && $unit == '%') { + $max = 100; + } + + $nb_bar = count($datas); + $width = $this->width; + + $height = 15 * $nb_bar + 50; + if ($height < 300) { + $height = 370; + } + //create image + $image = imagecreatetruecolor($width, $height); + + if ($show_graph) { + //colors + $palette = self::getPalette($nb_bar); + $darkerpalette = self::getDarkerPalette($nb_bar); + + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); + + //create border on export + if ($export) { + imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); + } - $start_angle = $angle; + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); } - $index++; - } - - //legend (align left) - $index = 0; - foreach ($labels as $label) { - //legend label - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $label); - $textwidth = abs($box[4] - $box[0]); - $textheight = abs($box[5] - $box[1]); - imagettftext($image, $this->fontsize, $this->fontangle, - 20, 55 + $index * 14, hexdec($this->black), $this->font, $label); - - //legend circle - $color_rbg = self::colorHexToRGB($palette[$index]); - imageSmoothArc($image, 10, 50 + $index * 14, 7, 7, $color_rbg, 0, 2 * M_PI); - $index++; - } - } - - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - - $contents = $this->generateImage($params); - if ($show_graph) { - $this->showImage($contents, $export); - } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "unit" => $unit]; - - PluginMreportingCommon::endGraph($options, $dashboard); - } + if ($export && $desc) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 35, + hexdec($this->black), + $this->font, + $desc + ); + } + + //pie + $index = 0; + $x = $width / 4 + .43 * $width; + $y = $height / 2; + $radius = $height / 1.5; + $start_angle = 0; + foreach ($datas as $label => $data) { + $angle = $start_angle + (360 * $data) / $max; + + //full circle need fix + if ($angle - $start_angle == 360) { + $angle = 359.999; + $start_angle = 0; + } + + if ($data != 0) { + $color_rbg = self::colorHexToRGB($palette[$index]); + imageSmoothArc( + $image, + $x, + $y, + $radius + 8, + $radius + 8, + $color_rbg, + deg2rad($start_angle), + deg2rad($angle) + ); + + //text associated with pie arc (only for angle > 2°) + if ($angle > 2 && ($show_label == "always" || $show_label == "hover")) { + $xtext = $x - 1 + cos(deg2rad(($start_angle + $angle) / 2)) * ($radius / 1.7); + $ytext = $y + 5 - sin(deg2rad(($start_angle + $angle) / 2)) * ($radius / 1.7); + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $xtext, + $ytext, + hexdec($darkerpalette[$index]), + $this->font, + Toolbox::stripTags($data . $unit) + ); + } + + $start_angle = $angle; + } + $index++; + } + + //legend (align left) + $index = 0; + foreach ($labels as $label) { + //legend label + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $label); + $textwidth = abs($box[4] - $box[0]); + $textheight = abs($box[5] - $box[1]); + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + 20, + 55 + $index * 14, + hexdec($this->black), + $this->font, + $label + ); + + //legend circle + $color_rbg = self::colorHexToRGB($palette[$index]); + imageSmoothArc($image, 10, 50 + $index * 14, 7, 7, $color_rbg, 0, 2 * M_PI); + + $index++; + } + } + + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + + $contents = $this->generateImage($params); + if ($show_graph) { + $this->showImage($contents, $export); + } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "unit" => $unit + ]; + + PluginMreportingCommon::endGraph($options, $dashboard); + } /** @@ -907,292 +1005,320 @@ function showPie($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showSunburst($params, $dashboard = false, $width = false) { - $criterias = PluginMreportingCommon::initGraphParams($params); - foreach ($criterias as $key => $val) { - $$key=$val; - } - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - $labels2 = []; - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - if ($unit == '%') { - $raw_datas['datas'] = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - } - - $values = array_values($datas); - $labels = array_keys($datas); - - $width = $this->width-200; - $height = 500; - - //create image - $image = imagecreatetruecolor ($width, $height); - - if ($show_graph) { - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 1, 1, $width - 2, $height-2, $bg_color); - - //create border on export - if ($export) { - imagerectangle($image, 0, 0, $width - 1, $height, hexdec($this->black)); - } - - //add title on export - if ($export) { - imagettftext( - $image, - $this->fontsize+2, - $this->fontangle, - 10, - 20, - hexdec($this->black), - $this->font, - $title - ); - } - - if ($export && $desc) { - imagettftext($image, $this->fontsize+2, $this->fontangle, 10, 35, - hexdec($this->black), $this->font, $desc); - } - } - - //recursive level draw - $image = $this->drawSunburstLevel($image, $datas, [ - 'width' => $width, - 'height' => $height - ]); - - //generate image - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - $contents = $this->generateImage($params); - $this->showImage($contents, $export); - - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - } - - function drawSunburstLevel($image, $datas, $params = []) { - $width = $params['width'] - 70; - $height = $params['height'] - 120; - - $gsum = PluginMreportingCommon::getArraySum($datas); - - $index = 0; - $x = $width / 2; - $y = $height / 2 + 60; - $params['depth'] = isset($params['depth']) + public function showSunburst($params, $dashboard = false, $width = false) + { + $criterias = PluginMreportingCommon::initGraphParams($params); + foreach ($criterias as $key => $val) { + $$key = $val; + } + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); + } + return false; + } + + $labels2 = []; + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + if ($unit == '%') { + $raw_datas['datas'] = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + } + + $values = array_values($datas); + $labels = array_keys($datas); + + $width = $this->width - 200; + $height = 500; + + //create image + $image = imagecreatetruecolor($width, $height); + + if ($show_graph) { + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 1, 1, $width - 2, $height - 2, $bg_color); + + //create border on export + if ($export) { + imagerectangle($image, 0, 0, $width - 1, $height, hexdec($this->black)); + } + + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); + } + + if ($export && $desc) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 35, + hexdec($this->black), + $this->font, + $desc + ); + } + } + + //recursive level draw + $image = $this->drawSunburstLevel($image, $datas, [ + 'width' => $width, + 'height' => $height + ]); + + //generate image + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + $contents = $this->generateImage($params); + $this->showImage($contents, $export); + + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + } + + public function drawSunburstLevel($image, $datas, $params = []) + { + $width = $params['width'] - 70; + $height = $params['height'] - 120; + + $gsum = PluginMreportingCommon::getArraySum($datas); + + $index = 0; + $x = $width / 2; + $y = $height / 2 + 60; + $params['depth'] = isset($params['depth']) ? $params['depth'] : PluginMreportingCommon::getArrayDepth($datas); - $params['start_angle'] = isset($params['start_angle']) ? $params['start_angle'] : 0; - $params['max_angle'] = isset($params['max_angle']) ? $params['max_angle'] : 360; - $params['level'] = isset($params['level']) ? $params['level'] : 0; - $params['current_index'] = isset($params['current_index']) ? $params['current_index'] : false; - $step = $height / $params['depth']; - $radius = $step * ($params['level']+1); - - $darkerpalette = self::getDarkerPalette(50); - - foreach ($datas as $key => $data) { - if (is_array($data)) { - arsort($data); - - $params2 = []; - $params2 = $params; - - $sum = PluginMreportingCommon::getArraySum($data); - $angle = ($params['max_angle'] * $sum) / $gsum; - - $params2['max_angle'] = $angle; - $params2['start_angle'] = $params['start_angle']; - $params2['level'] = $params['level']+1; - $params2['current_index'] = ($params['current_index'] === false) - ? $index - : $params['current_index']; - - $this->drawSunburstLevel($image, $data, $params2); - - } else { - $angle = ($params['max_angle'] * $data) / $gsum; - } - - //get colors - $palette = $this->getPalette(50); - if ($params['current_index'] === false) { - $color = $palette[$index]; - } else { - $color = $palette[$params['current_index']]; - //get lighter color - $color = "0x00".substr(self::lighter($color, 15 * $params['level'] * $index), 0, 6); - } - $darkercolor = "0x00".substr(self::darker($color), 0, 6); - $color_rbg = self::colorHexToRGB($color); - $darkercolor_rbg = self::colorHexToRGB($darkercolor); - - //show data arc (tow arcs : 1st border color, 2nd content color) - //(Never use deg2rad() in loops, use $rad = ($deg * M_PI / 180) instead which is faster!) - imageSmoothArc( - $image, $x, $y, $radius+1, $radius+1, $darkercolor_rbg, - $params['start_angle'] * M_PI / 180, - ($params['start_angle'] + $angle) * M_PI / 180 - ); - imageSmoothArc( - $image, $x, $y, $radius-1, $radius-1, $color_rbg, - ($params['start_angle'] + 0.8 / ($params['level']+1)) * M_PI / 180, - ($params['start_angle'] + $angle - 0.8 / ($params['level']+1)) * M_PI / 180 - ); - - //text associated with pie arc (only for angle > 2°) - $am = $params['start_angle'] + $angle / 2; //mediant angle - $amr = $am * M_PI / 180; //mediant angle in radiant - - //adjust label position (in fonction of angle position) - $dx = $dy = 0; - if ($amr>=7*M_PI/4 || $amr <= M_PI/4) { - $dx=0; - } - if ($amr>=M_PI/4 && $amr <= 3*M_PI/4) { - $dx=($amr-M_PI/4)*2/M_PI; - } - if ($amr>=3*M_PI/4 && $amr <= 5*M_PI/4) { - $dx=1; - } - if ($amr>=5*M_PI/4 && $amr <= 7*M_PI/4) { - $dx=(1-($amr-M_PI*5/4)*2/M_PI); - } - - if ($amr>=7*M_PI/4) { - $dy=(($amr-M_PI)-3*M_PI/4)*2/M_PI; - } - if ($amr<=M_PI/4) { - $dy=(1-$amr*2/M_PI); - } - if ($amr>=M_PI/4 && $amr <= 3*M_PI/4) { - $dy=1; - } - if ($amr>=3*M_PI/4 && $amr <= 5*M_PI/4) { - $dy=(1-($amr-3*M_PI/4)*2/M_PI); - } - if ($amr>=5*M_PI/4 && $amr <= 7*M_PI/4) { - $dy=0; - } - - //get label size - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $key); - $tw = abs($box[4] - $box[0]); - $th = abs($box[5] - $box[1]); - - //define label position - if (is_array($data)) { - //show label inside its arc - $xtext = $x - $dx * $tw + cos($amr) * (0.5 * $radius - $step/3); - $ytext = $y + $dy * $th - sin($amr) * (0.5 * $radius - $step/4); - } else { - //show label outside of its arc - $xtext = $x + 3 - $dx * $tw + cos($amr) * (0.5 * $radius + $step/16); - $ytext = $y + $dy * $th - sin($amr) * (0.5 * $radius + $step/8); - } - - //draw label - imagettftext( - $image, - $this->fontsize, $this->fontangle, - $xtext, $ytext, - hexdec($darkercolor), - $this->font, - $key - ); - - //values labels - if ($angle > 5) { - //mediant start angle in radiant (adjusted for left align label to its arc) - $samr = ($params['start_angle'] + 10/($params['level']+1)) * M_PI / 180; - - //get label size - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, - (is_array($data)) ? $gsum : $data); + $params['start_angle'] = isset($params['start_angle']) ? $params['start_angle'] : 0; + $params['max_angle'] = isset($params['max_angle']) ? $params['max_angle'] : 360; + $params['level'] = isset($params['level']) ? $params['level'] : 0; + $params['current_index'] = isset($params['current_index']) ? $params['current_index'] : false; + $step = $height / $params['depth']; + $radius = $step * ($params['level'] + 1); + + $darkerpalette = self::getDarkerPalette(50); + + foreach ($datas as $key => $data) { + if (is_array($data)) { + arsort($data); + + $params2 = []; + $params2 = $params; + + $sum = PluginMreportingCommon::getArraySum($data); + $angle = ($params['max_angle'] * $sum) / $gsum; + + $params2['max_angle'] = $angle; + $params2['start_angle'] = $params['start_angle']; + $params2['level'] = $params['level'] + 1; + $params2['current_index'] = ($params['current_index'] === false) + ? $index + : $params['current_index']; + + $this->drawSunburstLevel($image, $data, $params2); + } else { + $angle = ($params['max_angle'] * $data) / $gsum; + } + + //get colors + $palette = $this->getPalette(50); + if ($params['current_index'] === false) { + $color = $palette[$index]; + } else { + $color = $palette[$params['current_index']]; + //get lighter color + $color = "0x00" . substr(self::lighter($color, 15 * $params['level'] * $index), 0, 6); + } + $darkercolor = "0x00" . substr(self::darker($color), 0, 6); + $color_rbg = self::colorHexToRGB($color); + $darkercolor_rbg = self::colorHexToRGB($darkercolor); + + //show data arc (tow arcs : 1st border color, 2nd content color) + //(Never use deg2rad() in loops, use $rad = ($deg * M_PI / 180) instead which is faster!) + imageSmoothArc( + $image, + $x, + $y, + $radius + 1, + $radius + 1, + $darkercolor_rbg, + $params['start_angle'] * M_PI / 180, + ($params['start_angle'] + $angle) * M_PI / 180 + ); + imageSmoothArc( + $image, + $x, + $y, + $radius - 1, + $radius - 1, + $color_rbg, + ($params['start_angle'] + 0.8 / ($params['level'] + 1)) * M_PI / 180, + ($params['start_angle'] + $angle - 0.8 / ($params['level'] + 1)) * M_PI / 180 + ); + + //text associated with pie arc (only for angle > 2°) + $am = $params['start_angle'] + $angle / 2; //mediant angle + $amr = $am * M_PI / 180; //mediant angle in radiant + + //adjust label position (in fonction of angle position) + $dx = $dy = 0; + if ($amr >= 7 * M_PI / 4 || $amr <= M_PI / 4) { + $dx = 0; + } + if ($amr >= M_PI / 4 && $amr <= 3 * M_PI / 4) { + $dx = ($amr - M_PI / 4) * 2 / M_PI; + } + if ($amr >= 3 * M_PI / 4 && $amr <= 5 * M_PI / 4) { + $dx = 1; + } + if ($amr >= 5 * M_PI / 4 && $amr <= 7 * M_PI / 4) { + $dx = (1 - ($amr - M_PI * 5 / 4) * 2 / M_PI); + } + + if ($amr >= 7 * M_PI / 4) { + $dy = (($amr - M_PI) - 3 * M_PI / 4) * 2 / M_PI; + } + if ($amr <= M_PI / 4) { + $dy = (1 - $amr * 2 / M_PI); + } + if ($amr >= M_PI / 4 && $amr <= 3 * M_PI / 4) { + $dy = 1; + } + if ($amr >= 3 * M_PI / 4 && $amr <= 5 * M_PI / 4) { + $dy = (1 - ($amr - 3 * M_PI / 4) * 2 / M_PI); + } + if ($amr >= 5 * M_PI / 4 && $amr <= 7 * M_PI / 4) { + $dy = 0; + } + + //get label size + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $key); $tw = abs($box[4] - $box[0]); $th = abs($box[5] - $box[1]); - //define label position - $xtext = $x - $dx * $tw + cos($samr) * (0.5 * $radius - $step/8); - $ytext = $y + $dy * $th - sin($samr) * (0.5 * $radius - $step/16); + //define label position + if (is_array($data)) { + //show label inside its arc + $xtext = $x - $dx * $tw + cos($amr) * (0.5 * $radius - $step / 3); + $ytext = $y + $dy * $th - sin($amr) * (0.5 * $radius - $step / 4); + } else { + //show label outside of its arc + $xtext = $x + 3 - $dx * $tw + cos($amr) * (0.5 * $radius + $step / 16); + $ytext = $y + $dy * $th - sin($amr) * (0.5 * $radius + $step / 8); + } - //draw label + //draw label imagettftext( - $image, - $this->fontsize, $this->fontangle, - $xtext, $ytext, - hexdec($this->black), - $this->font, - (is_array($data)) ? $sum : $data + $image, + $this->fontsize, + $this->fontangle, + $xtext, + $ytext, + hexdec($darkercolor), + $this->font, + $key ); - } - $params['start_angle']+= $angle; - $index++; - } + //values labels + if ($angle > 5) { + //mediant start angle in radiant (adjusted for left align label to its arc) + $samr = ($params['start_angle'] + 10 / ($params['level'] + 1)) * M_PI / 180; + + //get label size + $box = @imageTTFBbox( + $this->fontsize, + $this->fontangle, + $this->font, + (is_array($data)) ? $gsum : $data + ); + $tw = abs($box[4] - $box[0]); + $th = abs($box[5] - $box[1]); + + //define label position + $xtext = $x - $dx * $tw + cos($samr) * (0.5 * $radius - $step / 8); + $ytext = $y + $dy * $th - sin($samr) * (0.5 * $radius - $step / 16); + + //draw label + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $xtext, + $ytext, + hexdec($this->black), + $this->font, + (is_array($data)) ? $sum : $data + ); + } + + $params['start_angle'] += $angle; + $index++; + } - return $image; - } + return $image; + } /** @@ -1207,229 +1333,240 @@ function drawSunburstLevel($image, $datas, $params = []) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showHgbar($params, $dashboard = false, $width = false) { - if ($width !== false) { - $this->width = $width; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - //$rand = $opt['rand']; - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - $labels2 = $raw_datas['labels2']; - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $raw_datas['datas'] = $datas; - - $values = array_values($datas); - $labels = array_keys($datas); - - $max = 1; - foreach ($values as $line) { - foreach ($line as $label2 => $value) { - if ($value > $max) { - $max = $value; - } - } - } - if ($max == 1 && $unit == '%') { - $max = 100; - } - - $nb_bar = count($datas) * count($labels2); - $width = $this->width; - $height = 28 * $nb_bar + count($labels2) * 24; - - //create image - $image = imagecreatetruecolor ($width, $height); - - if ($show_graph) { - //colors - $palette = self::getPalette($nb_bar); - $darkerpalette = self::getDarkerPalette($nb_bar); - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); - - //create border on export - if ($export) { - imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); - } - - //add title on export - if ($export) { - imagettftext( - $image, - $this->fontsize+2, - $this->fontangle, - 10, - 20, - hexdec($this->black), - $this->font, - $title - ); - } - - if ($export && $desc) { - imagettftext($image, $this->fontsize+2, $this->fontangle, 10, 35, - hexdec($this->black), $this->font, $desc); - } - //bars - $index1 = 0; - $index2 = 0; - - foreach ($datas as $label => $data) { - $ly = $index1 * count($labels2) * 28 + count($labels2) *24 / 2 + count($labels2) * 14; - $step = $index1 * count($labels2) * 28; - - //create axis label (align right) - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $labels[$index1]); - $textwidth = abs($box[4] - $box[0]); - $textheight = abs($box[5] - $box[1]); - imagettftext( - $image, - $this->fontsize, - $this->fontangle, - 245 - $textwidth, - $ly + 14, - hexdec($this->black), - $this->font, - Html::clean($labels[$index1]) - ); + public function showHgbar($params, $dashboard = false, $width = false) + { + if ($width !== false) { + $this->width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + //$rand = $opt['rand']; + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); + } + return false; + } - foreach ($data as $subdata) { - $bx1 = 250; - $by1 = ($index2+1) * 22 + $step + count($labels2) * 14; - $bx2 = $bx1 + round(($subdata*($width - 300))/$max); - $by2 = $by1 + 16; + $labels2 = $raw_datas['labels2']; - //createbar - ImageFilledRectangle($image, $bx1, $by1, $bx2, $by2, hexdec($palette[$index2])); - imagerectangle($image, $bx1, $by1-1, $bx2+1, $by2+1, hexdec($darkerpalette[$index2])); - imagerectangle($image, $bx1, $by1-2, $bx2+2, $by2+2, hexdec($darkerpalette[$index2])); + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } - //create data label - if ($show_label == "always" || $show_label == "hover") { - imagettftext( - $image, - $this->fontsize, - $this->fontangle, - $bx2 + 6, - $by1 + 14, - hexdec($darkerpalette[$index2]), - $this->font, - $subdata.$unit - ); - } - $index2++; - } - $index1++; - $index2 = 0; - } + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $raw_datas['datas'] = $datas; - //y axis - imageline($image, 250, 40, 250, $height-6, hexdec($this->black)); - imageline($image, 251, 40, 251, $height-6, hexdec($this->black)); + $values = array_values($datas); + $labels = array_keys($datas); + + $max = 1; + foreach ($values as $line) { + foreach ($line as $label2 => $value) { + if ($value > $max) { + $max = $value; + } + } + } + if ($max == 1 && $unit == '%') { + $max = 100; + } + + $nb_bar = count($datas) * count($labels2); + $width = $this->width; + $height = 28 * $nb_bar + count($labels2) * 24; + + //create image + $image = imagecreatetruecolor($width, $height); + + if ($show_graph) { + //colors + $palette = self::getPalette($nb_bar); + $darkerpalette = self::getDarkerPalette($nb_bar); + + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); + + //create border on export + if ($export) { + imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); + } - //legend (align right) - $index = 0; - foreach ($labels2 as $label) { - $box = @imageTTFBbox($this->fontsize+1, $this->fontangle, $this->font, $label); - $textwidth = abs($box[4] - $box[0]); - $textheight = abs($box[5] - $box[1]); + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); + } - //legend label - imagettftext( - $image, - $this->fontsize, - $this->fontangle, - $width - $textwidth - 18, - 10 + $index * 15, - hexdec($this->black), - $this->font, - Html::clean($label) - ); + if ($export && $desc) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 35, + hexdec($this->black), + $this->font, + $desc + ); + } + //bars + $index1 = 0; + $index2 = 0; - //legend circle - $color_rbg = self::colorHexToRGB($palette[$index]); - imageSmoothArc($image, $width - 10, 5 + $index * 15, 8, 8, $color_rbg, 0, 2 * M_PI); + foreach ($datas as $label => $data) { + $ly = $index1 * count($labels2) * 28 + count($labels2) * 24 / 2 + count($labels2) * 14; + $step = $index1 * count($labels2) * 28; + + //create axis label (align right) + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $labels[$index1]); + $textwidth = abs($box[4] - $box[0]); + $textheight = abs($box[5] - $box[1]); + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + 245 - $textwidth, + $ly + 14, + hexdec($this->black), + $this->font, + Toolbox::stripTags($labels[$index1]) + ); + + foreach ($data as $subdata) { + $bx1 = 250; + $by1 = ($index2 + 1) * 22 + $step + count($labels2) * 14; + $bx2 = $bx1 + round(($subdata * ($width - 300)) / $max); + $by2 = $by1 + 16; + + //createbar + ImageFilledRectangle($image, $bx1, $by1, $bx2, $by2, hexdec($palette[$index2])); + imagerectangle($image, $bx1, $by1 - 1, $bx2 + 1, $by2 + 1, hexdec($darkerpalette[$index2])); + imagerectangle($image, $bx1, $by1 - 2, $bx2 + 2, $by2 + 2, hexdec($darkerpalette[$index2])); + + //create data label + if ($show_label == "always" || $show_label == "hover") { + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $bx2 + 6, + $by1 + 14, + hexdec($darkerpalette[$index2]), + $this->font, + $subdata . $unit + ); + } + $index2++; + } + $index1++; + $index2 = 0; + } - $index++; - } - } - //generate image - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - - $contents = $this->generateImage($params); - if ($show_graph) { - $this->showImage($contents, $export); - } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - } + //y axis + imageline($image, 250, 40, 250, $height - 6, hexdec($this->black)); + imageline($image, 251, 40, 251, $height - 6, hexdec($this->black)); + + //legend (align right) + $index = 0; + foreach ($labels2 as $label) { + $box = @imageTTFBbox($this->fontsize + 1, $this->fontangle, $this->font, $label); + $textwidth = abs($box[4] - $box[0]); + $textheight = abs($box[5] - $box[1]); + + //legend label + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $width - $textwidth - 18, + 10 + $index * 15, + hexdec($this->black), + $this->font, + Toolbox::stripTags($label) + ); + + //legend circle + $color_rbg = self::colorHexToRGB($palette[$index]); + imageSmoothArc($image, $width - 10, 5 + $index * 15, 8, 8, $color_rbg, 0, 2 * M_PI); + + $index++; + } + } + //generate image + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + + $contents = $this->generateImage($params); + if ($show_graph) { + $this->showImage($contents, $export); + } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + } /** @@ -1444,296 +1581,329 @@ function showHgbar($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showVstackbar($params, $dashboard = false, $width = false) { - if ($width !== false) { - $this->width = $width; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - //$rand = $opt['rand']; - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - $labels2 = $raw_datas['labels2']; - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $raw_datas['datas'] = $datas; - - $values = array_values($datas); - - $labels = array_keys($datas); - - $max = 1; - foreach ($values as $line) { - foreach ($line as $label2 => $value) { - if ($value > $max) { - $max = $value; - } - } - } - if ($max == 1 && $unit == '%') { - $max = 100; - } - - //process datas (reverse keys) - $new_datas=[]; - - foreach ($datas as $key1 => $data) { - foreach ($data as $key2 => $subdata) { - $new_datas[$key2][$key1] = $subdata; - } - } - - //calculate max cumul - $cum = 0; - foreach ($new_datas as $key1 => $data) { - $tmp_cum = 0; - foreach ($data as $key2 => $subdata) { - $tmp_cum += $subdata; - } - if ($tmp_cum > $cum) { - $cum = $tmp_cum; - } - } - - $nb_bar = count($labels2); - $nb_labels2 = count($datas); - $height = 400; - if ($dashboard) { - $height = 350; - } - $x_bar = (0.85 * $this->width / $nb_bar); - $width_bar = $x_bar * .85; - $y_labels_width = .1 * $this->width; - $x_labels_height = $height - 0.95 * $height; - $legend_height = $nb_labels2 * 15 + 10; - - //longueur du texte en dessous des barres - $index = 0; - foreach ($labels2 as $label) { - $lx = 55 + $index * $width_bar; - $box = @imageTTFBbox($this->fontsize-1, $this->fontangle, $this->font, $label); - $textwidth[$label] = abs($box[4] - $box[0]); - $index++; - } - $maxtextwidth = max($textwidth); - - //create image - $image = imagecreatetruecolor ($this->width, $height + $maxtextwidth); - - if ($show_graph) { - //colors - $palette = self::getPalette($nb_bar); - $alphapalette = self::getPalette($nb_bar, 90); - $darkerpalette = self::getDarkerPalette($nb_bar); - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 0, 0, $this->width, $height + $maxtextwidth, $bg_color); - - //create border on export - if ($export) { - imagerectangle($image, 0, 0, $this->width - 1, $height - 1 + $maxtextwidth, hexdec($this->black)); - } - - //draw x-axis grey step line and values ticks - $xstep = round(($height - $legend_height - $x_labels_height) / 12); - for ($i = 0; $i <= 12; $i++) { - $yaxis = $height - $x_labels_height - $xstep * $i; - imageLine($image, .9 * $y_labels_width, $yaxis, 0.95 * $this->width, $yaxis, hexdec($this->grey)); - - //value label - $val = round($i * $cum / 12, 1); - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $val); - $textwidth = abs($box[4] - $box[0]); - - imagettftext($image, $this->fontsize, $this->fontangle, - $y_labels_width - 2 - $textwidth, $yaxis + 5, hexdec($this->darkgrey), $this->font, $val); - } - - //draw y-axis - imageLine($image, $y_labels_width, $legend_height, $y_labels_width, $height-28, hexdec($this->black)); - - //draw x-axis - imageline($image, .9 * $y_labels_width, $height - $x_labels_height, - 0.95 * $this->width, $height - $x_labels_height, hexdec($this->black)); - - //add title on export - if ($export) { - imagettftext( - $image, - $this->fontsize+2, - $this->fontangle, - 10, - 20, - hexdec($this->black), - $this->font, - $title - ); - } + public function showVstackbar($params, $dashboard = false, $width = false) + { + if ($width !== false) { + $this->width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + //$rand = $opt['rand']; + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); + } + return false; + } - if ($export && $desc) { - imagettftext($image, $this->fontsize+2, $this->fontangle, 10, 35, - hexdec($this->black), $this->font, $desc); - } + $labels2 = $raw_datas['labels2']; - $index1 = 0; - $index2 = 0; + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } - foreach ($new_datas as $label => $data) { - $by2 = $height - $x_labels_height; + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $raw_datas['datas'] = $datas; - foreach ($data as $subdata) { - $by1 = $by2; - $bx1 = $y_labels_width + $index1 * $x_bar; - $by2 = $by1 - $subdata * ($height - $legend_height - $x_labels_height) / $cum; - $bx2 = $bx1 + $width_bar; + $values = array_values($datas); - if ($by1 != $by2) { // no draw for empty datas - imagefilledrectangle($image, $bx1, $by1, $bx2, $by2, hexdec($alphapalette[$index2])); - imagerectangle($image, $bx1, $by1, $bx2, $by2, hexdec($darkerpalette[$index2])); + $labels = array_keys($datas); - //create data label // Affichage des données à côté des barres - if (($show_label == "always" || $show_label == "hover") && $subdata>0) { - $box = @imageTTFBbox($this->fontsize-1, $this->fontangle, $this->font, $subdata.$unit); - $textwidth = abs($box[4] - $box[6]); + $max = 1; + foreach ($values as $line) { + foreach ($line as $label2 => $value) { + if ($value > $max) { + $max = $value; + } + } + } + if ($max == 1 && $unit == '%') { + $max = 100; + } - imagettftext( - $image, - $this->fontsize-1, - $this->fontangle, - $bx1 + ($width_bar / 2) - ($textwidth / 2) - 4, - $by1 - ($by1 - $by2)/2 + 5, - hexdec($darkerpalette[$index2]), - $this->font, - $subdata.$unit - ); - } - } - $tab[$index2]= $by1; - $index2++; + //process datas (reverse keys) + $new_datas = []; + + foreach ($datas as $key1 => $data) { + foreach ($data as $key2 => $subdata) { + $new_datas[$key2][$key1] = $subdata; + } + } + + //calculate max cumul + $cum = 0; + foreach ($new_datas as $key1 => $data) { + $tmp_cum = 0; + foreach ($data as $key2 => $subdata) { + $tmp_cum += $subdata; } + if ($tmp_cum > $cum) { + $cum = $tmp_cum; + } + } + + $nb_bar = count($labels2); + $nb_labels2 = count($datas); + $height = 400; + if ($dashboard) { + $height = 350; + } + $x_bar = (0.85 * $this->width / $nb_bar); + $width_bar = $x_bar * .85; + $y_labels_width = .1 * $this->width; + $x_labels_height = $height - 0.95 * $height; + $legend_height = $nb_labels2 * 15 + 10; + + //longueur du texte en dessous des barres + $index = 0; + foreach ($labels2 as $label) { + $lx = 55 + $index * $width_bar; + $box = @imageTTFBbox($this->fontsize - 1, $this->fontangle, $this->font, $label); + $textwidth[$label] = abs($box[4] - $box[0]); + $index++; + } + $maxtextwidth = max($textwidth); - //create label 2 - $box = @imageTTFBbox($this->fontsize-1, $this->fontangle, $this->font, $labels2[$label]); - $textwidth = abs($box[4] - $box[6]); - $textwidth = abs(sqrt((pow($textwidth, 2) / 2))); + //create image + $image = imagecreatetruecolor($this->width, $height + $maxtextwidth); - $lx = $y_labels_width + $index1 * $x_bar + ($width_bar / 2.5); - imagettftext( - $image, - $this->fontsize-1, - -45, - $lx, - $height - $x_labels_height + 9, - hexdec($this->black), - $this->font, - Html::clean($labels2[$label]) - ); + if ($show_graph) { + //colors + $palette = self::getPalette($nb_bar); + $alphapalette = self::getPalette($nb_bar, 90); + $darkerpalette = self::getDarkerPalette($nb_bar); - $index1++; - $index2 = 0; - } + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 0, 0, $this->width, $height + $maxtextwidth, $bg_color); - //legend (align right) - $index = 0; - foreach ($datas as $label => $data) { - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $labels[$index]); - $textwidth = abs($box[4] - $box[0]); - $textheight = abs($box[5] - $box[1]); - $y_legend = 5 + ($index + 1) * 15; + //create border on export + if ($export) { + imagerectangle($image, 0, 0, $this->width - 1, $height - 1 + $maxtextwidth, hexdec($this->black)); + } - //legend label - imagettftext( - $image, - $this->fontsize-1, - $this->fontangle, - $this->width - $textwidth - 18, - $y_legend, - hexdec($this->black), - $this->font, - Html::clean($labels[$index]) + //draw x-axis grey step line and values ticks + $xstep = round(($height - $legend_height - $x_labels_height) / 12); + for ($i = 0; $i <= 12; $i++) { + $yaxis = $height - $x_labels_height - $xstep * $i; + imageLine($image, .9 * $y_labels_width, $yaxis, 0.95 * $this->width, $yaxis, hexdec($this->grey)); + + //value label + $val = round($i * $cum / 12, 1); + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $val); + $textwidth = abs($box[4] - $box[0]); + + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $y_labels_width - 2 - $textwidth, + $yaxis + 5, + hexdec($this->darkgrey), + $this->font, + $val + ); + } + + //draw y-axis + imageLine($image, $y_labels_width, $legend_height, $y_labels_width, $height - 28, hexdec($this->black)); + + //draw x-axis + imageline( + $image, + .9 * $y_labels_width, + $height - $x_labels_height, + 0.95 * $this->width, + $height - $x_labels_height, + hexdec($this->black) ); - //legend circle - $color_rbg = self::colorHexToRGB($palette[$index]); - imageSmoothArc($image, - $this->width - 10, $y_legend - 4, 8, 8, $color_rbg, 0, 2 * M_PI); + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); + } - $index++; - } - } - //generate image - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - - $contents = $this->generateImage($params); - if ($show_graph) { - $this->showImage($contents, $export); - } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - } + if ($export && $desc) { + imagettftext( + $image, + $this->fontsize + 2, + $this->fontangle, + 10, + 35, + hexdec($this->black), + $this->font, + $desc + ); + } + + $index1 = 0; + $index2 = 0; + + foreach ($new_datas as $label => $data) { + $by2 = $height - $x_labels_height; + + foreach ($data as $subdata) { + $by1 = $by2; + $bx1 = $y_labels_width + $index1 * $x_bar; + $by2 = $by1 - $subdata * ($height - $legend_height - $x_labels_height) / $cum; + $bx2 = $bx1 + $width_bar; + + if ($by1 != $by2) { // no draw for empty datas + imagefilledrectangle($image, $bx1, $by1, $bx2, $by2, hexdec($alphapalette[$index2])); + imagerectangle($image, $bx1, $by1, $bx2, $by2, hexdec($darkerpalette[$index2])); + + //create data label // Affichage des données à côté des barres + if (($show_label == "always" || $show_label == "hover") && $subdata > 0) { + $box = @imageTTFBbox($this->fontsize - 1, $this->fontangle, $this->font, $subdata . $unit); + $textwidth = abs($box[4] - $box[6]); + + imagettftext( + $image, + $this->fontsize - 1, + $this->fontangle, + $bx1 + ($width_bar / 2) - ($textwidth / 2) - 4, + $by1 - ($by1 - $by2) / 2 + 5, + hexdec($darkerpalette[$index2]), + $this->font, + $subdata . $unit + ); + } + } + $tab[$index2] = $by1; + $index2++; + } + + //create label 2 + $box = @imageTTFBbox($this->fontsize - 1, $this->fontangle, $this->font, $labels2[$label]); + $textwidth = abs($box[4] - $box[6]); + $textwidth = abs(sqrt((pow($textwidth, 2) / 2))); + + $lx = $y_labels_width + $index1 * $x_bar + ($width_bar / 2.5); + imagettftext( + $image, + $this->fontsize - 1, + -45, + $lx, + $height - $x_labels_height + 9, + hexdec($this->black), + $this->font, + Toolbox::stripTags($labels2[$label]) + ); + + $index1++; + $index2 = 0; + } + + //legend (align right) + $index = 0; + foreach ($datas as $label => $data) { + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $labels[$index]); + $textwidth = abs($box[4] - $box[0]); + $textheight = abs($box[5] - $box[1]); + $y_legend = 5 + ($index + 1) * 15; + + //legend label + imagettftext( + $image, + $this->fontsize - 1, + $this->fontangle, + $this->width - $textwidth - 18, + $y_legend, + hexdec($this->black), + $this->font, + Toolbox::stripTags($labels[$index]) + ); + + //legend circle + $color_rbg = self::colorHexToRGB($palette[$index]); + imageSmoothArc( + $image, + $this->width - 10, + $y_legend - 4, + 8, + 8, + $color_rbg, + 0, + 2 * M_PI + ); + + $index++; + } + } + //generate image + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + + $contents = $this->generateImage($params); + if ($show_graph) { + $this->showImage($contents, $export); + } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + } /** @@ -1749,261 +1919,310 @@ function showVstackbar($params, $dashboard = false, $width = false) { * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) * @param $area : show plain chart instead only a line (optionnal) - * @return nothing + * @return void */ - function showArea($params, $dashboard = false, $width = false) { - if ($width !== false) { - $this->width = $width; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - //$rand = $opt['rand']; - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $raw_datas['datas'] = $datas; - - $values = array_values($datas); - $labels = array_keys($datas); - $max = max($values); - if ($max <= 1) { - $max = 1; - } - if ($max == 1 && $unit == '%') { - $max = 100; - } - - $nb = count($datas); - $width = $this->width; - $height = 350; - $width_line = ($width - 45) / $nb; - $step = ceil($nb / 20); - - //create image - $image = imagecreatetruecolor ($width, $height); - - if ($show_graph) { - //colors - $palette = self::getPalette($nb); - $alphapalette = self::getPalette($nb, "50"); - $darkerpalette = self::getDarkerPalette($nb); - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); - - //draw x-axis grey step line and values - $xstep = round(($height - 60) / 13); - for ($i = 0; $i< 13; $i++) { - $yaxis = $height- 30 - $xstep * $i; - - //grey lines - imageLine($image, 30, $yaxis, 30+$width_line*($nb-1), $yaxis, hexdec($this->grey)); - - //value labels - $val = round($i * $max / 12); - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $val); - $textwidth = abs($box[4] - $box[0]); - imagettftext($image, $this->fontsize, $this->fontangle, - 28-$textwidth, $yaxis+5, hexdec($this->darkgrey), $this->font, $val); - } - - //draw y-axis grey step line - for ($i = 0; $i< $nb; $i++) { - $xaxis = 30 + $width_line * $i; - imageLine($image, $xaxis, 50, $xaxis, $height-25, hexdec($this->grey)); - } - - //draw y-axis - imageLine($image, 30, 50, 30, $height-25, hexdec($this->black)); - - //draw x-axis - imageline($image, 30, $height-30, $width - 60, $height-30, hexdec($this->black)); - - //create border on export - if ($export) { - imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); - } - - //add title on export - if ($export) { - imagettftext($image, $this->fontsize+1, $this->fontangle, 10, 20, - hexdec($this->black), $this->font, $title); - } - - //on png graph, no way to draw curved polygons, force area reports to be linear - if ($area) { - $spline = false; - } - - //parse datas - $index = 0; - $old_data = 0; - $aCoords = []; - foreach ($datas as $label => $data) { - - //if first index, continue - if ($index == 0) { - $old_data = $data; - $index++; - continue; - } - - // determine coords - $x1 = $index * $width_line - $width_line + 30; - $y1 = $height - 30 - $old_data * ($height - 85) / $max; - $x2 = $x1 + $width_line; - $y2 = $height - 30 - $data * ($height - 85) / $max; - $aCoords[$x1] = $y1; - - //in case of area chart fill under point space - if ($area > 0) { - $points = [ - $x1, $y1, - $x2, $y2, - $x2, $height - 30, - $x1, $height - 30 - ]; - imagefilledpolygon($image, $points, 4, hexdec($alphapalette[0])); - } - - //trace lines between points (if linear) - if (!$spline) { - $this->imageSmoothAlphaLineLarge ($image, $x1, $y1, $x2, $y2, $palette[0]); - } - - $old_data = $data; - $index++; - } - - //if curved spline activated, draw cubic spline for the current line - if ($spline) { - $aCoords[$x2] = $y2; - $this->imageCubicSmoothLine($image, $palette[0], $aCoords); - } - - //draw labels and dots - $index = 0; - $old_label = ""; - foreach ($datas as $label => $data) { - //if first index, continue - if ($index == 0) { - $old_data = $data; - $old_label = $label; - $index++; - continue; - } - - // determine coords - $x1 = $index * $width_line - $width_line + 30; - $y1 = $height - 30 - $old_data * ($height - 85) / $max; - $x2 = $x1 + $width_line; - $y2 = $height - 30 - $data * ($height - 85) / $max; - - //trace dots - $color_rbg = self::colorHexToRGB($darkerpalette[0]); - imageSmoothArc($image, $x1-1, $y1-1, 8, 8, $color_rbg, 0, 2 * M_PI); - imageSmoothArc($image, $x1-1, $y1-1, 4, 4, [255,255,255,0], 0, 2 * M_PI); - - //display values label - if ($show_label == "always" || $show_label == "hover") { - imagettftext($image, $this->fontsize-1, $this->fontangle, - ($index == 1 ? $x1 : $x1 - 6 ), $y1 - 5, - hexdec($darkerpalette[0]), $this->font, $old_data); - } - - //display y ticks and labels - if ($step!=0 && ($index / $step) == round($index / $step)) { - imageline($image, $x1, $height-30, $x1, $height-27, hexdec($darkerpalette[0])); - - imagettftext($image, $this->fontsize, $this->fontangle, $x1 - 10, $height-10, - hexdec($this->black), $this->font, $old_label); - } - - $old_data = $data; - $old_label = $label; - $index++; - } - - //display last value, dot and axis label - if (isset($x2)) { - imagettftext($image, $this->fontsize-1, $this->fontangle, - $x2 - 6, $y2 - 5, hexdec($darkerpalette[0]), $this->font, $data); - $color_rbg = self::colorHexToRGB($darkerpalette[0]); - imageSmoothArc($image, $x2-1, $y2-1, 8, 8, $color_rbg, 0, 2 * M_PI); - imageSmoothArc($image, $x2-1, $y2-1, 4, 4, [255,255,255,0], 0, 2 * M_PI); - imagettftext($image, $this->fontsize, $this->fontangle, - $x2 - 10, $height-10, hexdec($this->black), $this->font, $label); - imageline($image, $x2, $height-30, $x2, $height-27, hexdec($darkerpalette[0])); - } - } - //generate image - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - $contents = $this->generateImage($params); - if ($show_graph) { - $this->showImage($contents, $export); - } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - } // end Area + public function showArea($params, $dashboard = false, $width = false) + { + if ($width !== false) { + $this->width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + //$rand = $opt['rand']; + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); + } + return false; + } + + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } + + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $raw_datas['datas'] = $datas; + + $values = array_values($datas); + $labels = array_keys($datas); + $max = max($values); + if ($max <= 1) { + $max = 1; + } + if ($max == 1 && $unit == '%') { + $max = 100; + } + + $nb = count($datas); + $width = $this->width; + $height = 350; + $width_line = ($width - 45) / $nb; + $step = ceil($nb / 20); + + //create image + $image = imagecreatetruecolor($width, $height); + + if ($show_graph) { + //colors + $palette = self::getPalette($nb); + $alphapalette = self::getPalette($nb, "50"); + $darkerpalette = self::getDarkerPalette($nb); + + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bg_color); + + //draw x-axis grey step line and values + $xstep = round(($height - 60) / 13); + for ($i = 0; $i < 13; $i++) { + $yaxis = $height - 30 - $xstep * $i; + + //grey lines + imageLine($image, 30, $yaxis, 30 + $width_line * ($nb - 1), $yaxis, hexdec($this->grey)); + + //value labels + $val = round($i * $max / 12); + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $val); + $textwidth = abs($box[4] - $box[0]); + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + 28 - $textwidth, + $yaxis + 5, + hexdec($this->darkgrey), + $this->font, + $val + ); + } + + //draw y-axis grey step line + for ($i = 0; $i < $nb; $i++) { + $xaxis = 30 + $width_line * $i; + imageLine($image, $xaxis, 50, $xaxis, $height - 25, hexdec($this->grey)); + } + + //draw y-axis + imageLine($image, 30, 50, 30, $height - 25, hexdec($this->black)); + + //draw x-axis + imageline($image, 30, $height - 30, $width - 60, $height - 30, hexdec($this->black)); + + //create border on export + if ($export) { + imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); + } + + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 1, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); + } + + //on png graph, no way to draw curved polygons, force area reports to be linear + if ($area) { + $spline = false; + } + + //parse datas + $index = 0; + $old_data = 0; + $aCoords = []; + foreach ($datas as $label => $data) { + //if first index, continue + if ($index == 0) { + $old_data = $data; + $index++; + continue; + } + + // determine coords + $x1 = $index * $width_line - $width_line + 30; + $y1 = $height - 30 - $old_data * ($height - 85) / $max; + $x2 = $x1 + $width_line; + $y2 = $height - 30 - $data * ($height - 85) / $max; + $aCoords[$x1] = $y1; + + //in case of area chart fill under point space + if ($area > 0) { + $points = [ + $x1, $y1, + $x2, $y2, + $x2, $height - 30, + $x1, $height - 30 + ]; + imagefilledpolygon($image, $points, 4, hexdec($alphapalette[0])); + } + + //trace lines between points (if linear) + if (!$spline) { + $this->imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $palette[0]); + } + + $old_data = $data; + $index++; + } + + //if curved spline activated, draw cubic spline for the current line + if ($spline) { + $aCoords[$x2] = $y2; + $this->imageCubicSmoothLine($image, $palette[0], $aCoords); + } + + //draw labels and dots + $index = 0; + $old_label = ""; + foreach ($datas as $label => $data) { + //if first index, continue + if ($index == 0) { + $old_data = $data; + $old_label = $label; + $index++; + continue; + } + + // determine coords + $x1 = $index * $width_line - $width_line + 30; + $y1 = $height - 30 - $old_data * ($height - 85) / $max; + $x2 = $x1 + $width_line; + $y2 = $height - 30 - $data * ($height - 85) / $max; + + //trace dots + $color_rbg = self::colorHexToRGB($darkerpalette[0]); + imageSmoothArc($image, $x1 - 1, $y1 - 1, 8, 8, $color_rbg, 0, 2 * M_PI); + imageSmoothArc($image, $x1 - 1, $y1 - 1, 4, 4, [255,255,255,0], 0, 2 * M_PI); + + //display values label + if ($show_label == "always" || $show_label == "hover") { + imagettftext( + $image, + $this->fontsize - 1, + $this->fontangle, + ($index == 1 ? $x1 : $x1 - 6 ), + $y1 - 5, + hexdec($darkerpalette[0]), + $this->font, + $old_data + ); + } + + //display y ticks and labels + if ($step != 0 && ($index / $step) == round($index / $step)) { + imageline($image, $x1, $height - 30, $x1, $height - 27, hexdec($darkerpalette[0])); + + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $x1 - 10, + $height - 10, + hexdec($this->black), + $this->font, + $old_label + ); + } + + $old_data = $data; + $old_label = $label; + $index++; + } + + //display last value, dot and axis label + if (isset($x2)) { + imagettftext( + $image, + $this->fontsize - 1, + $this->fontangle, + $x2 - 6, + $y2 - 5, + hexdec($darkerpalette[0]), + $this->font, + $data + ); + $color_rbg = self::colorHexToRGB($darkerpalette[0]); + imageSmoothArc($image, $x2 - 1, $y2 - 1, 8, 8, $color_rbg, 0, 2 * M_PI); + imageSmoothArc($image, $x2 - 1, $y2 - 1, 4, 4, [255,255,255,0], 0, 2 * M_PI); + imagettftext( + $image, + $this->fontsize, + $this->fontangle, + $x2 - 10, + $height - 10, + hexdec($this->black), + $this->font, + $label + ); + imageline($image, $x2, $height - 30, $x2, $height - 27, hexdec($darkerpalette[0])); + } + } + //generate image + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + $contents = $this->generateImage($params); + if ($show_graph) { + $this->showImage($contents, $export); + } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + } /** @@ -2018,303 +2237,356 @@ function showArea($params, $dashboard = false, $width = false) { * @param $show_label : behavior of the graph labels, * values : 'hover', 'never', 'always' (optionnal) * @param $export : keep only svg to export (optionnal) - * @return nothing + * @return void */ - function showGArea($params, $dashboard = false, $width = false) { - if ($width !== false) { - $this->width = $width; - } - - $criterias = PluginMreportingCommon::initGraphParams($params); - - foreach ($criterias as $key => $val) { - $$key=$val; - } - - //$rand = $opt['rand']; - - $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); - - foreach ($configs as $k => $v) { - $$k=$v; - } - - if (self::DEBUG_GRAPH && isset($raw_datas)) { - Toolbox::logdebug($raw_datas); - } - - if (isset($raw_datas['datas'])) { - $datas = $raw_datas['datas']; - } else { - $datas = []; - } - - $options = ["title" => $title, - "desc" => $desc, - "randname" => $randname, - "export" => $export, - "delay" => $delay, - "short_classname" => $opt["short_classname"], - "showHeader" => $dashboard]; - - $this->initGraph($options); - - if (count($datas) <= 0) { - - if ($export!="odtall") { - echo __("No data for this date range !", 'mreporting'); - $end['opt']["export"] = false; - $end['opt']["randname"] = false; - $end['opt']["f_name"] = $opt['f_name']; - $end['opt']["class"] = $opt['class']; - PluginMreportingCommon::endGraph($end); - } - return false; - } - - $labels2 = $raw_datas['labels2']; - - if (empty($unit) && !empty($raw_datas['unit'])) { - $unit = $raw_datas['unit']; - } - - $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); - $raw_datas['datas'] = $datas; - - $values = array_values($datas); - $labels = array_keys($datas); - - $max = 1; - foreach ($values as $line) { - foreach ($line as $label2 => $value) { - if ($value > $max) { - $max = $value; - } - } - } - if ($max == 1 && $unit == '%') { - $max = 100; - } - - $nb = count($labels2); - $width = $this->width; - - $nb_bar = count($labels2); - $nb_labels2 = count($datas); - - $width_line = ($this->width - 45) / $nb; - $index1 = 0; - $index3 = 1; - $step = ceil($nb / 21); - $height = 450; - if ($dashboard) { - $height = 350; - } - $y_labels_width = .1 * $this->width; - $x_labels_height = 60; - $x_bar = 30; - $legend_height = $nb_labels2 * 15 + 20; - - //create image - $image = imagecreatetruecolor ($width, $height); - - if ($show_graph) { - //colors - $palette = self::getPalette($nb_bar); - $alphapalette = self::getPalette($nb_bar, "50"); - $darkerpalette = self::getDarkerPalette($nb_bar); - - //background - $bg_color = hexdec($this->white); - imagefilledrectangle($image, 0, 0, $width - 1, $height, $bg_color); - - //draw x-axis grey step line and value ticks - $xstep = round(($height - $legend_height - $x_labels_height) / 12); - for ($i = 0; $i< 12; $i++) { - $yaxis = $height - $x_labels_height - $xstep * $i; - - //horizontal grey lines - imageLine($image, $x_bar, $yaxis, $x_bar+$width_line*($nb-1), $yaxis, hexdec($this->grey)); - - //value ticks - if ($i * $max / 12 < 10) { - $val = round($i * $max / 12, 1); - } else { - $val = round($i * $max / 12); + public function showGArea($params, $dashboard = false, $width = false) + { + if ($width !== false) { + $this->width = $width; + } + + $criterias = PluginMreportingCommon::initGraphParams($params); + + foreach ($criterias as $key => $val) { + $$key = $val; + } + + //$rand = $opt['rand']; + + $configs = PluginMreportingConfig::initConfigParams($opt['f_name'], $opt['class']); + + foreach ($configs as $k => $v) { + $$k = $v; + } + + if (self::DEBUG_GRAPH && isset($raw_datas)) { + Toolbox::logdebug($raw_datas); + } + + if (isset($raw_datas['datas'])) { + $datas = $raw_datas['datas']; + } else { + $datas = []; + } + + $options = ["title" => $title, + "desc" => $desc, + "randname" => $randname, + "export" => $export, + "delay" => $delay, + "short_classname" => $opt["short_classname"], + "showHeader" => $dashboard + ]; + + $this->initGraph($options); + + if (count($datas) <= 0) { + if ($export != "odtall") { + echo __("No data for this date range !", 'mreporting'); + $end['opt']["export"] = false; + $end['opt']["randname"] = false; + $end['opt']["f_name"] = $opt['f_name']; + $end['opt']["class"] = $opt['class']; + PluginMreportingCommon::endGraph($end); } + return false; + } - $box = @imageTTFBbox($this->fontsize-1, $this->fontangle, $this->font, $val); - $textwidth = abs($box[4] - $box[0]); - - imagettftext($image, $this->fontsize-1, $this->fontangle, - 25-$textwidth, $yaxis+5, hexdec($this->darkgrey), $this->font, $val); - } - - //draw y-axis vertical grey step line - for ($i = 0; $i< $nb; $i++) { - $xaxis = $x_bar + $width_line * $i; - imageLine($image, $xaxis, $height-$x_labels_height, $xaxis, $legend_height, hexdec($this->grey)); - } - - //draw y-axis - imageLine($image, $x_bar, $height - $x_labels_height, $x_bar, $legend_height, hexdec($this->black)); + $labels2 = $raw_datas['labels2']; - //draw y-axis - imageLine($image, $x_bar, $height - $x_labels_height, $width - 50, $height - $x_labels_height, hexdec($this->black)); - - //create border on export - if ($export) { - imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); - } - - //on png graph, no way to draw curved polygons, force area reports to be linear - if ($area) { - $spline = false; - } - - //add title on export - if ($export) { - imagettftext($image, $this->fontsize+1, $this->fontangle, 10, 20, - hexdec($this->black), $this->font, $title); - } - - //parse datas - foreach ($datas as $label => $data) { - - $aCoords = []; - $index2 = 0; - $old_data = 0; - //parse line - foreach ($data as $subdata) { - //if first index, continue - if ($index2 == 0) { - $old_data = $subdata; - $index2++; - continue; - } + if (empty($unit) && !empty($raw_datas['unit'])) { + $unit = $raw_datas['unit']; + } - // determine coords - $x1 = $index2 * $width_line - $width_line + $x_bar; - $y1 = $height - $x_labels_height - $old_data * ($height - $legend_height - $x_labels_height) / $max; - $x2 = $x1 + $width_line; - $y2 = $height - $x_labels_height - $subdata * ($height - $legend_height - $x_labels_height) / $max; + $datas = PluginMreportingCommon::compileDatasForUnit($datas, $unit); + $raw_datas['datas'] = $datas; - //in case of area chart fill under point space - if ($area > 0) { - $points = [ - $x1, $y1, - $x2, $y2, - $x2, $height - $x_labels_height, - $x1, $height - $x_labels_height - ]; - imagefilledpolygon($image, $points, 4, hexdec($alphapalette[$index1])); - } + $values = array_values($datas); + $labels = array_keys($datas); - //trace lines between points (if linear) - if (!$spline) { - $this->imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $palette[$index1]); - } - $aCoords[$x1]=$y1; + $max = 1; + foreach ($values as $line) { + foreach ($line as $label2 => $value) { + if ($value > $max) { + $max = $value; + } + } + } + if ($max == 1 && $unit == '%') { + $max = 100; + } + + $nb = count($labels2); + $width = $this->width; + + $nb_bar = count($labels2); + $nb_labels2 = count($datas); + + $width_line = ($this->width - 45) / $nb; + $index1 = 0; + $index3 = 1; + $step = ceil($nb / 21); + $height = 450; + if ($dashboard) { + $height = 350; + } + $y_labels_width = .1 * $this->width; + $x_labels_height = 60; + $x_bar = 30; + $legend_height = $nb_labels2 * 15 + 20; + + //create image + $image = imagecreatetruecolor($width, $height); + + if ($show_graph) { + //colors + $palette = self::getPalette($nb_bar); + $alphapalette = self::getPalette($nb_bar, "50"); + $darkerpalette = self::getDarkerPalette($nb_bar); + + //background + $bg_color = hexdec($this->white); + imagefilledrectangle($image, 0, 0, $width - 1, $height, $bg_color); + + //draw x-axis grey step line and value ticks + $xstep = round(($height - $legend_height - $x_labels_height) / 12); + for ($i = 0; $i < 12; $i++) { + $yaxis = $height - $x_labels_height - $xstep * $i; + + //horizontal grey lines + imageLine($image, $x_bar, $yaxis, $x_bar + $width_line * ($nb - 1), $yaxis, hexdec($this->grey)); + + //value ticks + if ($i * $max / 12 < 10) { + $val = round($i * $max / 12, 1); + } else { + $val = round($i * $max / 12); + } + + $box = @imageTTFBbox($this->fontsize - 1, $this->fontangle, $this->font, $val); + $textwidth = abs($box[4] - $box[0]); + + imagettftext( + $image, + $this->fontsize - 1, + $this->fontangle, + 25 - $textwidth, + $yaxis + 5, + hexdec($this->darkgrey), + $this->font, + $val + ); + } - //trace dots - $color_rbg = self::colorHexToRGB($darkerpalette[$index1]); - imageSmoothArc($image, $x1-1, $y1-1, 7, 7, $color_rbg, 0, 2 * M_PI); - imageSmoothArc($image, $x1-1, $y1-1, 4, 4, [255,255,255,0], 0, 2 * M_PI); + //draw y-axis vertical grey step line + for ($i = 0; $i < $nb; $i++) { + $xaxis = $x_bar + $width_line * $i; + imageLine($image, $xaxis, $height - $x_labels_height, $xaxis, $legend_height, hexdec($this->grey)); + } - //display values label - if ($show_label == "always" || $show_label == "hover") { - imagettftext($image, $this->fontsize-2, $this->fontangle, - ($index2 == 1 ? $x1 : $x1 - 6 ), $y1 - 5, - hexdec($darkerpalette[$index1]), $this->font, $old_data); - } + //draw y-axis + imageLine($image, $x_bar, $height - $x_labels_height, $x_bar, $legend_height, hexdec($this->black)); - //show x-axis ticks - if ($step!=0 && ($index3 / $step) == round($index3 / $step)) { - imageline($image, $x1, $height-$x_labels_height, $x1, - $height-$x_labels_height+3, hexdec($darkerpalette[$index1])); - } + //draw y-axis + imageLine($image, $x_bar, $height - $x_labels_height, $width - 50, $height - $x_labels_height, hexdec($this->black)); - $old_data = $subdata; - $index2++; - $index3++; + //create border on export + if ($export) { + imagerectangle($image, 0, 0, $width - 1, $height - 1, hexdec($this->black)); } - //if curved spline activated, draw cubic spline for the current line - if ($spline) { - $aCoords[$x2] = $y2; - $this->imageCubicSmoothLine($image, $palette[$index1], $aCoords); + //on png graph, no way to draw curved polygons, force area reports to be linear + if ($area) { + $spline = false; } - // display last value - if (isset($x2)) { - //trace dots - $color_rbg = self::colorHexToRGB($darkerpalette[$index1]); - imageSmoothArc($image, $x2-1, $y2-1, 7, 7, $color_rbg, 0, 2 * M_PI); - imageSmoothArc($image, $x2-1, $y2-1, 4, 4, [255,255,255,0], 0, 2 * M_PI); + //add title on export + if ($export) { + imagettftext( + $image, + $this->fontsize + 1, + $this->fontangle, + 10, + 20, + hexdec($this->black), + $this->font, + $title + ); + } - //display value label - if ($show_label == "always" || $show_label == "hover") { - imagettftext($image, $this->fontsize - 2, $this->fontangle, - ($index2 == 1 ? $x2 : $x2 - 6), $y2 - 5, - hexdec($darkerpalette[$index1]), $this->font, $old_data); - } + //parse datas + foreach ($datas as $label => $data) { + $aCoords = []; + $index2 = 0; + $old_data = 0; + //parse line + foreach ($data as $subdata) { + //if first index, continue + if ($index2 == 0) { + $old_data = $subdata; + $index2++; + continue; + } + + // determine coords + $x1 = $index2 * $width_line - $width_line + $x_bar; + $y1 = $height - $x_labels_height - $old_data * ($height - $legend_height - $x_labels_height) / $max; + $x2 = $x1 + $width_line; + $y2 = $height - $x_labels_height - $subdata * ($height - $legend_height - $x_labels_height) / $max; + + //in case of area chart fill under point space + if ($area > 0) { + $points = [ + $x1, $y1, + $x2, $y2, + $x2, $height - $x_labels_height, + $x1, $height - $x_labels_height + ]; + imagefilledpolygon($image, $points, 4, hexdec($alphapalette[$index1])); + } + + //trace lines between points (if linear) + if (!$spline) { + $this->imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $palette[$index1]); + } + $aCoords[$x1] = $y1; + + //trace dots + $color_rbg = self::colorHexToRGB($darkerpalette[$index1]); + imageSmoothArc($image, $x1 - 1, $y1 - 1, 7, 7, $color_rbg, 0, 2 * M_PI); + imageSmoothArc($image, $x1 - 1, $y1 - 1, 4, 4, [255,255,255,0], 0, 2 * M_PI); + + //display values label + if ($show_label == "always" || $show_label == "hover") { + imagettftext( + $image, + $this->fontsize - 2, + $this->fontangle, + ($index2 == 1 ? $x1 : $x1 - 6 ), + $y1 - 5, + hexdec($darkerpalette[$index1]), + $this->font, + $old_data + ); + } + + //show x-axis ticks + if ($step != 0 && ($index3 / $step) == round($index3 / $step)) { + imageline( + $image, + $x1, + $height - $x_labels_height, + $x1, + $height - $x_labels_height + 3, + hexdec($darkerpalette[$index1]) + ); + } + + $old_data = $subdata; + $index2++; + $index3++; + } + + //if curved spline activated, draw cubic spline for the current line + if ($spline) { + $aCoords[$x2] = $y2; + $this->imageCubicSmoothLine($image, $palette[$index1], $aCoords); + } + + // display last value + if (isset($x2)) { + //trace dots + $color_rbg = self::colorHexToRGB($darkerpalette[$index1]); + imageSmoothArc($image, $x2 - 1, $y2 - 1, 7, 7, $color_rbg, 0, 2 * M_PI); + imageSmoothArc($image, $x2 - 1, $y2 - 1, 4, 4, [255,255,255,0], 0, 2 * M_PI); + + //display value label + if ($show_label == "always" || $show_label == "hover") { + imagettftext( + $image, + $this->fontsize - 2, + $this->fontangle, + ($index2 == 1 ? $x2 : $x2 - 6), + $y2 - 5, + hexdec($darkerpalette[$index1]), + $this->font, + $old_data + ); + } + } + + $index1++; } - $index1++; - } + //display labels2 + $index = 0; + foreach ($labels2 as $label) { + $x = $x_bar + $index * $width_line - 2; - //display labels2 - $index = 0; - foreach ($labels2 as $label) { - $x = $x_bar + $index * $width_line - 2; + if ($step != 0 && ($index / $step) == round($index / $step)) { + imagettftext( + $image, + $this->fontsize - 1, + -45, + $x, + $height - $x_labels_height + 11, + hexdec($this->black), + $this->font, + $label + ); + } - if ($step!=0 && ($index / $step) == round($index / $step)) { - imagettftext($image, $this->fontsize-1, -45, $x, $height - $x_labels_height + 11, - hexdec($this->black), $this->font, $label); + $index++; } - $index++; - } - - //legend (align left) - $index = 0; - foreach ($labels as $label) { - //legend label - $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $label); - $textwidth = abs($box[4] - $box[0]); - $textheight = abs($box[5] - $box[1]); - imagettftext($image, $this->fontsize-1, $this->fontangle, - 20, 15 + $index * 14, hexdec($this->black), $this->font, $label); - - //legend circle - $color_rbg = self::colorHexToRGB($palette[$index]); - imageSmoothArc($image, 10, 10 + $index * 14, 7, 7, $color_rbg, 0, 2 * M_PI); - - $index++; - } - } - //generate image - $params = ["image" => $image, - "export" => $export, - "f_name" => $opt['f_name'], - "class" => $opt['class'], - "title" => $title, - "randname" => $randname, - "raw_datas" => $raw_datas, - "withdata" => $opt['withdata']]; - $contents = $this->generateImage($params); - - if ($show_graph) { - $this->showImage($contents, $export); - } - $opt['randname'] = $randname; - $options = ["opt" => $opt, - "export" => $export, - "datas" => $datas, - "labels2" => $labels2, - "flip_data" => $flip_data, - "unit" => $unit]; - PluginMreportingCommon::endGraph($options, $dashboard); - }// End Garea - -}// End Class + //legend (align left) + $index = 0; + foreach ($labels as $label) { + //legend label + $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $label); + $textwidth = abs($box[4] - $box[0]); + $textheight = abs($box[5] - $box[1]); + imagettftext( + $image, + $this->fontsize - 1, + $this->fontangle, + 20, + 15 + $index * 14, + hexdec($this->black), + $this->font, + $label + ); + + //legend circle + $color_rbg = self::colorHexToRGB($palette[$index]); + imageSmoothArc($image, 10, 10 + $index * 14, 7, 7, $color_rbg, 0, 2 * M_PI); + + $index++; + } + } + //generate image + $params = ["image" => $image, + "export" => $export, + "f_name" => $opt['f_name'], + "class" => $opt['class'], + "title" => $title, + "randname" => $randname, + "raw_datas" => $raw_datas, + "withdata" => $opt['withdata'] + ]; + $contents = $this->generateImage($params); + + if ($show_graph) { + $this->showImage($contents, $export); + } + $opt['randname'] = $randname; + $options = ["opt" => $opt, + "export" => $export, + "datas" => $datas, + "labels2" => $labels2, + "flip_data" => $flip_data, + "unit" => $unit + ]; + PluginMreportingCommon::endGraph($options, $dashboard); + } +} diff --git a/inc/helpdesk.class.php b/inc/helpdesk.class.php index 4b03d327..83980844 100644 --- a/inc/helpdesk.class.php +++ b/inc/helpdesk.class.php @@ -1,133 +1,141 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingHelpdesk Extends PluginMreportingBaseclass { +class PluginMreportingHelpdesk extends PluginMreportingBaseclass +{ + public function reportPieTicketNumberByEntity($config = []) + { + $_SESSION['mreporting_selector']['reportPieTicketNumberByEntity'] = ['dateinterval']; - function reportPieTicketNumberByEntity($config = []) { - $_SESSION['mreporting_selector']['reportPieTicketNumberByEntity'] = ['dateinterval']; + return $this->reportHbarTicketNumberByEntity($config); + } - return $this->reportHbarTicketNumberByEntity($config); - } + public function reportHbarTicketNumberByEntity($config = []) + { + global $DB; - function reportHbarTicketNumberByEntity($config = []) { - global $DB; + $_SESSION['mreporting_selector']['reportHbarTicketNumberByEntity'] = ['dateinterval', + 'limit' + ]; - $_SESSION['mreporting_selector']['reportHbarTicketNumberByEntity'] = ['dateinterval', - 'limit']; + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "`glpi_tickets`.`date`", + $config['delay'], + $config['randname'] + ); - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("`glpi_tickets`.`date`", - $config['delay'], - $config['randname']); + $datas = []; - $datas = []; - - $query = "SELECT COUNT(glpi_tickets.id) as count, + $query = "SELECT COUNT(glpi_tickets.id) as count, glpi_entities.name as name FROM glpi_tickets LEFT JOIN glpi_entities ON (glpi_tickets.entities_id = glpi_entities.id) WHERE {$this->sql_date} "; - if (Session::isMultiEntitiesMode()) { - $query.= "AND glpi_entities.id IN (".$this->where_entities.") "; - } - $query.= "AND glpi_tickets.is_deleted = '0' + if (Session::isMultiEntitiesMode()) { + $query .= "AND glpi_entities.id IN (" . $this->where_entities . ") "; + } + $query .= "AND glpi_tickets.is_deleted = '0' GROUP BY glpi_entities.name ORDER BY count DESC LIMIT 0, "; - $query .= (isset($_REQUEST['glpilist_limit'])) ? $_REQUEST['glpilist_limit'] : 20; - - $result = $DB->query($query); + $query .= (isset($_REQUEST['glpilist_limit'])) ? $_REQUEST['glpilist_limit'] : 20; - while ($ticket = $DB->fetchAssoc($result)) { - if (empty($ticket['name'])) { - $label = __("Root entity"); - } else { - $label = $ticket['name']; - } - $datas['datas'][$label] = $ticket['count']; - } + $result = $DB->query($query); - return $datas; + while ($ticket = $DB->fetchAssoc($result)) { + if (empty($ticket['name'])) { + $label = __("Root entity"); + } else { + $label = $ticket['name']; + } + $datas['datas'][$label] = $ticket['count']; + } - } + return $datas; + } - function reportHgbarTicketNumberByCatAndEntity($config = []) { - global $DB; + public function reportHgbarTicketNumberByCatAndEntity($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportHgbarTicketNumberByCatAndEntity'] + $_SESSION['mreporting_selector']['reportHgbarTicketNumberByCatAndEntity'] = ['dateinterval']; - $datas = []; - $tmp_datas = []; + $datas = []; + $tmp_datas = []; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); - //get categories used in this period - $query_cat = "SELECT DISTINCT(glpi_tickets.itilcategories_id) as itilcategories_id, + //get categories used in this period + $query_cat = "SELECT DISTINCT(glpi_tickets.itilcategories_id) as itilcategories_id, glpi_itilcategories.completename as category FROM glpi_tickets LEFT JOIN glpi_itilcategories ON glpi_tickets.itilcategories_id = glpi_itilcategories.id WHERE {$this->sql_date} "; - if (Session::isMultiEntitiesMode()) { - $query_cat.= "AND glpi_tickets.entities_id IN (".$this->where_entities.") "; - } + if (Session::isMultiEntitiesMode()) { + $query_cat .= "AND glpi_tickets.entities_id IN (" . $this->where_entities . ") "; + } - $query_cat.= "AND glpi_tickets.is_deleted = '0' + $query_cat .= "AND glpi_tickets.is_deleted = '0' ORDER BY glpi_itilcategories.id ASC"; - $res_cat = $DB->query($query_cat); + $res_cat = $DB->query($query_cat); - $categories = []; - while ($data = $DB->fetchAssoc($res_cat)) { - if (empty($data['category'])) { - $data['category'] = __("None"); - } - $categories[$data['category']] = $data['itilcategories_id']; - } + $categories = []; + while ($data = $DB->fetchAssoc($res_cat)) { + if (empty($data['category'])) { + $data['category'] = __("None"); + } + $categories[$data['category']] = $data['itilcategories_id']; + } - $labels2 = array_keys($categories); + $labels2 = array_keys($categories); - $tmp_cat = []; - foreach (array_values($categories) as $id) { - $tmp_cat[] = "cat_$id"; - } - $cat_str = "'".implode("', '", array_values($categories))."'"; + $tmp_cat = []; + foreach (array_values($categories) as $id) { + $tmp_cat[] = "cat_$id"; + } + $cat_str = "'" . implode("', '", array_values($categories)) . "'"; - //count ticket by entity and categories previously selected - $query = "SELECT + //count ticket by entity and categories previously selected + $query = "SELECT COUNT(glpi_tickets.id) as nb, glpi_entities.name as entity, glpi_tickets.itilcategories_id as cat_id @@ -136,138 +144,148 @@ function reportHgbarTicketNumberByCatAndEntity($config = []) { ON glpi_tickets.entities_id = glpi_entities.id WHERE glpi_tickets.itilcategories_id IN ($cat_str) "; - if (Session::isMultiEntitiesMode()) { - $query.= "AND glpi_tickets.entities_id IN (".$this->where_entities.")"; - } + if (Session::isMultiEntitiesMode()) { + $query .= "AND glpi_tickets.entities_id IN (" . $this->where_entities . ")"; + } - $query.= "AND ".$this->sql_date." + $query .= "AND " . $this->sql_date . " AND glpi_tickets.is_deleted = '0' GROUP BY glpi_entities.name, glpi_tickets.itilcategories_id ORDER BY glpi_entities.name ASC, glpi_tickets.itilcategories_id ASC"; - $res = $DB->query($query); - while ($data = $DB->fetchAssoc($res)) { - if (empty($data['entity'])) { - $data['entity'] = __("Root entity"); - } - $tmp_datas[$data['entity']]["cat_".$data['cat_id']] = $data['nb']; - } - - //merge missing datas (0 ticket for a category) - foreach ($tmp_datas as &$data) { - $data = $data + array_fill_keys($tmp_cat, 0); - } - - //replace cat_id by labels2 - foreach ($tmp_datas as $entity => &$subdata) { - $tmp = []; - $i = 0; - foreach ($subdata as $value) { - $cat_label = $labels2[$i]; - $tmp[$cat_label] = $value; - $i++; - } - $subdata = $tmp; - } - - $datas['datas'] = $tmp_datas; - - foreach ($categories as $key => $value) { - $datas['labels2'][$key] = $key; - } - - return $datas; - } - - function reportPieTicketOpenedAndClosed($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportPieTicketOpenedAndClosed'] - = ['dateinterval']; + $res = $DB->query($query); + while ($data = $DB->fetchAssoc($res)) { + if (empty($data['entity'])) { + $data['entity'] = __("Root entity"); + } + $tmp_datas[$data['entity']]["cat_" . $data['cat_id']] = $data['nb']; + } + + //merge missing datas (0 ticket for a category) + foreach ($tmp_datas as &$data) { + $data = $data + array_fill_keys($tmp_cat, 0); + } + + //replace cat_id by labels2 + foreach ($tmp_datas as $entity => &$subdata) { + $tmp = []; + $i = 0; + foreach ($subdata as $value) { + $cat_label = $labels2[$i]; + $tmp[$cat_label] = $value; + $i++; + } + $subdata = $tmp; + } + + $datas['datas'] = $tmp_datas; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); + foreach ($categories as $key => $value) { + $datas['labels2'][$key] = $key; + } + + return $datas; + } + + public function reportPieTicketOpenedAndClosed($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportPieTicketOpenedAndClosed'] + = ['dateinterval']; - $datas = []; - foreach ($this->filters as $filter) { + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); - $query = "SELECT COUNT(*) + $datas = []; + foreach ($this->filters as $filter) { + $query = "SELECT COUNT(*) FROM glpi_tickets - WHERE ".$this->sql_date." "; + WHERE " . $this->sql_date . " "; - if (Session::isMultiEntitiesMode()) { - $query.= "AND glpi_tickets.entities_id IN (".$this->where_entities.")"; - } + if (Session::isMultiEntitiesMode()) { + $query .= "AND glpi_tickets.entities_id IN (" . $this->where_entities . ")"; + } - $query.= "AND glpi_tickets.is_deleted = '0' - AND glpi_tickets.status IN('".implode("', '", array_keys($filter['status']))."')"; - $result = $DB->query($query); - $datas[$filter['label']] = $DB->result($result, 0, 0); - } + $query .= "AND glpi_tickets.is_deleted = '0' + AND glpi_tickets.status IN('" . implode("', '", array_keys($filter['status'])) . "')"; + $result = $DB->query($query); + $datas[$filter['label']] = $DB->result($result, 0, 0); + } - return ['datas' => $datas]; - } + return ['datas' => $datas]; + } - function reportPieTicketOpenedbyStatus($config = []) { - global $DB; + public function reportPieTicketOpenedbyStatus($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportPieTicketOpenedbyStatus'] + $_SESSION['mreporting_selector']['reportPieTicketOpenedbyStatus'] = ['dateinterval', 'allstates']; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); - - // Get status to show - if (isset($_POST['status_1'])) { - foreach ($_POST as $key => $value) { - if ((substr($key, 0, 7) == 'status_') && ($value == 1)) { - $status_to_show[] = substr($key, 7, 1); + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + + // Get status to show + if (isset($_POST['status_1'])) { + foreach ($_POST as $key => $value) { + if ((substr($key, 0, 7) == 'status_') && ($value == 1)) { + $status_to_show[] = substr($key, 7, 1); + } } - } - } else { - $status_to_show = ['1', '2', '3', '4']; - } - - $datas = []; - $status = $this->filters['open']['status'] + $this->filters['close']['status']; - foreach ($status as $key => $val) { - if (in_array($key, $status_to_show)) { - $query = "SELECT COUNT(glpi_tickets.id) as count + } else { + $status_to_show = ['1', '2', '3', '4']; + } + + $datas = []; + $status = $this->filters['open']['status'] + $this->filters['close']['status']; + foreach ($status as $key => $val) { + if (in_array($key, $status_to_show)) { + $query = "SELECT COUNT(glpi_tickets.id) as count FROM glpi_tickets WHERE {$this->sql_date} AND glpi_tickets.is_deleted = '0' AND glpi_tickets.entities_id IN ({$this->where_entities}) AND glpi_tickets.status ='{$key}'"; - $result = $DB->query($query); + $result = $DB->query($query); - while ($ticket = $DB->fetchAssoc($result)) { - $datas['datas'][$val] = $ticket['count']; + while ($ticket = $DB->fetchAssoc($result)) { + $datas['datas'][$val] = $ticket['count']; + } } - } - } + } - return $datas; - } + return $datas; + } - function reportPieTopTenAuthor($config = []) { - global $DB; + public function reportPieTopTenAuthor($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportPieTopTenAuthor'] + $_SESSION['mreporting_selector']['reportPieTopTenAuthor'] = ['dateinterval']; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); - $this->sql_closedate = PluginMreportingCommon::getSQLDate("glpi_tickets.closedate", - $config['delay'], - $config['randname']); - - $datas = []; - $query = "SELECT COUNT(glpi_tickets.id) as count, glpi_tickets_users.users_id as users_id + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + $this->sql_closedate = PluginMreportingCommon::getSQLDate( + "glpi_tickets.closedate", + $config['delay'], + $config['randname'] + ); + + $datas = []; + $query = "SELECT COUNT(glpi_tickets.id) as count, glpi_tickets_users.users_id as users_id FROM glpi_tickets LEFT JOIN glpi_tickets_users ON (glpi_tickets_users.tickets_id = glpi_tickets.id AND glpi_tickets_users.type =1) @@ -278,46 +296,51 @@ function reportPieTopTenAuthor($config = []) { GROUP BY glpi_tickets_users.users_id ORDER BY count DESC LIMIT 10"; - $result = $DB->query($query); - while ($ticket = $DB->fetchAssoc($result)) { - if ($ticket['users_id']==0) { - $label = __("Undefined", 'mreporting'); - } else { - $label = getUserName($ticket['users_id']); - } - $datas['datas'][$label] = $ticket['count']; - } - - return $datas; - } - - - function reportHgbarOpenTicketNumberByCategoryAndByType($config = []) { - $_SESSION['mreporting_selector']['reportHgbarOpenTicketNumberByCategoryAndByType'] + $result = $DB->query($query); + while ($ticket = $DB->fetchAssoc($result)) { + if ($ticket['users_id'] == 0) { + $label = __("Undefined", 'mreporting'); + } else { + $label = getUserName($ticket['users_id']); + } + $datas['datas'][$label] = $ticket['count']; + } + + return $datas; + } + + + public function reportHgbarOpenTicketNumberByCategoryAndByType($config = []) + { + $_SESSION['mreporting_selector']['reportHgbarOpenTicketNumberByCategoryAndByType'] = ['dateinterval']; - return $this->reportHgbarTicketNumberByCategoryAndByType($config, 'open'); - } + return $this->reportHgbarTicketNumberByCategoryAndByType($config, 'open'); + } - function reportHgbarCloseTicketNumberByCategoryAndByType($config = []) { - $_SESSION['mreporting_selector']['reportHgbarCloseTicketNumberByCategoryAndByType'] + public function reportHgbarCloseTicketNumberByCategoryAndByType($config = []) + { + $_SESSION['mreporting_selector']['reportHgbarCloseTicketNumberByCategoryAndByType'] = ['dateinterval']; - return $this->reportHgbarTicketNumberByCategoryAndByType($config, 'close'); - } + return $this->reportHgbarTicketNumberByCategoryAndByType($config, 'close'); + } - private function reportHgbarTicketNumberByCategoryAndByType(array $config, $filter) { - global $DB; + private function reportHgbarTicketNumberByCategoryAndByType(array $config, $filter) + { + global $DB; - $_SESSION['mreporting_selector']['reportHgbarTicketNumberByCategoryAndByType'] + $_SESSION['mreporting_selector']['reportHgbarTicketNumberByCategoryAndByType'] = ['dateinterval']; - $datas = []; + $datas = []; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); - $query = "SELECT glpi_itilcategories.id as category_id, + $query = "SELECT glpi_itilcategories.id as category_id, glpi_itilcategories.completename as category_name, glpi_tickets.type as type, COUNT(glpi_tickets.id) as count @@ -326,62 +349,63 @@ private function reportHgbarTicketNumberByCategoryAndByType(array $config, $filt ON glpi_itilcategories.id = glpi_tickets.itilcategories_id WHERE {$this->sql_date} AND glpi_tickets.entities_id IN ({$this->where_entities}) - AND glpi_tickets.status IN('".implode( - "', '", array_keys($this->filters[$filter]['status']))."') + AND glpi_tickets.status IN('" . implode("', '", array_keys($this->filters[$filter]['status'])) . "') AND glpi_tickets.is_deleted = '0' GROUP BY glpi_itilcategories.id, glpi_tickets.type ORDER BY glpi_itilcategories.name"; - $result = $DB->query($query); - - $datas['datas'] = []; - while ($ticket = $DB->fetchAssoc($result)) { - if (is_null($ticket['category_id'])) { - $ticket['category_id'] = 0; - $ticket['category_name'] = __("None"); - } - if ($ticket['type']==0) { - $type = __("Undefined", 'mreporting'); - } else { - $type = Ticket::getTicketTypeName($ticket['type']); - } - $datas['labels2'][$type] = $type; - $datas['datas'][$ticket['category_name']][$type] = $ticket['count']; - } - - return $datas; - } - - function reportHgbarTicketNumberByService($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportHgbarTicketNumberByService'] - = ['dateinterval']; + $result = $DB->query($query); - $datas = []; + $datas['datas'] = []; + while ($ticket = $DB->fetchAssoc($result)) { + if (is_null($ticket['category_id'])) { + $ticket['category_id'] = 0; + $ticket['category_name'] = __("None"); + } + if ($ticket['type'] == 0) { + $type = __("Undefined", 'mreporting'); + } else { + $type = Ticket::getTicketTypeName($ticket['type']); + } + $datas['labels2'][$type] = $type; + $datas['datas'][$ticket['category_name']][$type] = $ticket['count']; + } + + return $datas; + } - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); + public function reportHgbarTicketNumberByService($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportHgbarTicketNumberByService'] + = ['dateinterval']; - foreach ($this->filters as $class => $filter) { + $datas = []; - $datas['labels2'][$filter['label']] = $filter['label']; - $query = "SELECT COUNT(*) + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + + foreach ($this->filters as $class => $filter) { + $datas['labels2'][$filter['label']] = $filter['label']; + $query = "SELECT COUNT(*) FROM glpi_tickets WHERE id NOT IN ( SELECT tickets_id FROM glpi_groups_tickets WHERE glpi_groups_tickets.type = 1 ) - AND glpi_tickets.entities_id IN (".$this->where_entities.") + AND glpi_tickets.entities_id IN (" . $this->where_entities . ") AND {$this->sql_date} - AND status IN('".implode("', '", array_keys($filter['status']))."')"; - $result = $DB->query($query); + AND status IN('" . implode("', '", array_keys($filter['status'])) . "')"; + $result = $DB->query($query); - $datas['datas'][__("None")][$filter['label']] = $DB->result($result, 0, 0); + $datas['datas'][__("None")][$filter['label']] = $DB->result($result, 0, 0); - $query = "SELECT glpi_groups.name as group_name, + $query = "SELECT glpi_groups.name as group_name, COUNT(glpi_tickets.id) as count FROM glpi_tickets, glpi_groups_tickets, glpi_groups WHERE glpi_tickets.id = glpi_groups_tickets.tickets_id @@ -390,109 +414,115 @@ function reportHgbarTicketNumberByService($config = []) { AND glpi_groups_tickets.type = 1 AND glpi_tickets.is_deleted = '0' AND {$this->sql_date} - AND glpi_tickets.status IN('".implode("', '", array_keys($filter['status']))."') + AND glpi_tickets.status IN('" . implode("', '", array_keys($filter['status'])) . "') GROUP BY glpi_groups.id ORDER BY glpi_groups.name"; - $result = $DB->query($query); - - while ($ticket = $DB->fetchAssoc($result)) { - $datas['datas'][$ticket['group_name']][$filter['label']] = $ticket['count']; - } + $result = $DB->query($query); - } + while ($ticket = $DB->fetchAssoc($result)) { + $datas['datas'][$ticket['group_name']][$filter['label']] = $ticket['count']; + } + } - return $datas; - } + return $datas; + } - function reportHgbarOpenedTicketNumberByCategory($config = []) { - global $DB; + public function reportHgbarOpenedTicketNumberByCategory($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportHgbarOpenedTicketNumberByCategory'] + $_SESSION['mreporting_selector']['reportHgbarOpenedTicketNumberByCategory'] = ['dateinterval', 'allstates']; - $datas = []; - - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); - - // Get status to show - if (isset($_POST['status_1'])) { - foreach ($_POST as $key => $value) { - if (substr($key, 0, 7) == 'status_' && $value == 1) { - $status_to_show[] = substr($key, 7, 1); + $datas = []; + + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + + // Get status to show + if (isset($_POST['status_1'])) { + foreach ($_POST as $key => $value) { + if (substr($key, 0, 7) == 'status_' && $value == 1) { + $status_to_show[] = substr($key, 7, 1); + } } - } - } else { - $status_to_show = ['1', '2', '3', '4']; - } + } else { + $status_to_show = ['1', '2', '3', '4']; + } - $status = $this->filters['open']['status'] + $this->filters['close']['status']; - $status_keys = array_keys($status); + $status = $this->filters['open']['status'] + $this->filters['close']['status']; + $status_keys = array_keys($status); - $query = "SELECT glpi_tickets.status, + $query = "SELECT glpi_tickets.status, glpi_itilcategories.completename as category_name, COUNT(glpi_tickets.id) as count FROM glpi_tickets LEFT JOIN glpi_itilcategories ON glpi_itilcategories.id = glpi_tickets.itilcategories_id WHERE {$this->sql_date} - AND glpi_tickets.entities_id IN (".$this->where_entities.") - AND glpi_tickets.status IN('".implode("', '", $status_keys)."') + AND glpi_tickets.entities_id IN (" . $this->where_entities . ") + AND glpi_tickets.status IN('" . implode("', '", $status_keys) . "') AND glpi_tickets.is_deleted = '0' - AND status IN (".implode(',', $status_to_show).") + AND status IN (" . implode(',', $status_to_show) . ") GROUP BY glpi_itilcategories.id, glpi_tickets.status ORDER BY glpi_itilcategories.name"; - $result = $DB->query($query); - - while ($ticket = $DB->fetchAssoc($result)) { - if (is_null($ticket['category_name'])) { - $ticket['category_name'] = __("None"); - } - - if (!isset($datas['datas'][$ticket['category_name']])) { - foreach ($status as $statusKey => $statusLabel) { - if (in_array($statusKey, $status_to_show)) { - $datas['datas'][$ticket['category_name']][$statusLabel] = 0; - } + $result = $DB->query($query); + + while ($ticket = $DB->fetchAssoc($result)) { + if (is_null($ticket['category_name'])) { + $ticket['category_name'] = __("None"); } - } - $datas['datas'][$ticket['category_name']][$status[$ticket['status']]] = $ticket['count']; - } + if (!isset($datas['datas'][$ticket['category_name']])) { + foreach ($status as $statusKey => $statusLabel) { + if (in_array($statusKey, $status_to_show)) { + $datas['datas'][$ticket['category_name']][$statusLabel] = 0; + } + } + } + + $datas['datas'][$ticket['category_name']][$status[$ticket['status']]] = $ticket['count']; + } - //Define legend for all ticket status available in GLPI - foreach ($status as $key => $label) { - if (in_array($key, $status_to_show)) { - $datas['labels2'][$label] = $label; - } - } + //Define legend for all ticket status available in GLPI + foreach ($status as $key => $label) { + if (in_array($key, $status_to_show)) { + $datas['labels2'][$label] = $label; + } + } - return $datas; - } + return $datas; + } - function reportLineNbTicket($config = []) { - $_SESSION['mreporting_selector']['reportLineNbTicket'] = ['dateinterval']; + public function reportLineNbTicket($config = []) + { + $_SESSION['mreporting_selector']['reportLineNbTicket'] = ['dateinterval']; - return $this->reportAreaNbTicket($config, false); - } + return $this->reportAreaNbTicket($config, false); + } - function reportAreaNbTicket($config = [], $area = true) { - global $DB; + public function reportAreaNbTicket($config = [], $area = true) + { + global $DB; - $_SESSION['mreporting_selector']['reportAreaNbTicket'] = ['dateinterval', 'period']; + $_SESSION['mreporting_selector']['reportAreaNbTicket'] = ['dateinterval', 'period']; - $datas = []; + $datas = []; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); - $query = "SELECT - DISTINCT DATE_FORMAT(date, '".$this->period_sort."') as period, - DATE_FORMAT(date, '".$this->period_label."') as period_name, + $query = "SELECT + DISTINCT DATE_FORMAT(date, '" . $this->period_sort . "') as period, + DATE_FORMAT(date, '" . $this->period_label . "') as period_name, COUNT(id) as nb FROM glpi_tickets WHERE {$this->sql_date} @@ -500,119 +530,127 @@ function reportAreaNbTicket($config = [], $area = true) { AND glpi_tickets.is_deleted = '0' GROUP BY period ORDER BY period"; - $res = $DB->query($query); - while ($data = $DB->fetchAssoc($res)) { - $datas['datas'][$data['period_name']] = $data['nb']; - } - - return $datas; - } - - function reportVstackbarNbTicket($config = []) { - $_SESSION['mreporting_selector']['reportVstackbarNbTicket'] = ['dateinterval']; - return $this->reportGlineNbTicket($config, false); - } - - function reportGareaNbTicket($config = []) { - $_SESSION['mreporting_selector']['reportGareaNbTicket'] = ['dateinterval']; - return $this->reportGlineNbTicket($config, true); - } - - function reportGlineNbTicket($config = [], $area = false) { - global $DB; - - $_SESSION['mreporting_selector']['reportGlineNbTicket'] + $res = $DB->query($query); + while ($data = $DB->fetchAssoc($res)) { + $datas['datas'][$data['period_name']] = $data['nb']; + } + + return $datas; + } + + public function reportVstackbarNbTicket($config = []) + { + $_SESSION['mreporting_selector']['reportVstackbarNbTicket'] = ['dateinterval']; + return $this->reportGlineNbTicket($config, false); + } + + public function reportGareaNbTicket($config = []) + { + $_SESSION['mreporting_selector']['reportGareaNbTicket'] = ['dateinterval']; + return $this->reportGlineNbTicket($config, true); + } + + public function reportGlineNbTicket($config = [], $area = false) + { + global $DB; + + $_SESSION['mreporting_selector']['reportGlineNbTicket'] = ['dateinterval', 'period', 'allstates']; - $datas = []; - $tmp_datas = []; - - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); - - // Get status to show - if (isset($_POST['status_1'])) { - foreach ($_POST as $key => $value) { - if ((substr($key, 0, 7) == 'status_') && ($value == 1)) { - $status_to_show[] = substr($key, 7, 1); + $datas = []; + $tmp_datas = []; + + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + + // Get status to show + if (isset($_POST['status_1'])) { + foreach ($_POST as $key => $value) { + if ((substr($key, 0, 7) == 'status_') && ($value == 1)) { + $status_to_show[] = substr($key, 7, 1); + } } - } - } else { - $status_to_show = ['1', '2', '3', '4']; - } - - //get dates used in this period - $query_date = "SELECT DISTINCT - DATE_FORMAT(`date`, '".$this->period_sort."') AS period, - DATE_FORMAT(`date`, '".$this->period_label."') AS period_name + } else { + $status_to_show = ['1', '2', '3', '4']; + } + + //get dates used in this period + $query_date = "SELECT DISTINCT + DATE_FORMAT(`date`, '" . $this->period_sort . "') AS period, + DATE_FORMAT(`date`, '" . $this->period_label . "') AS period_name FROM `glpi_tickets` - WHERE ".$this->sql_date." - AND `glpi_tickets`.`entities_id` IN (".$this->where_entities.") + WHERE " . $this->sql_date . " + AND `glpi_tickets`.`entities_id` IN (" . $this->where_entities . ") AND `glpi_tickets`.`is_deleted` = '0' - AND status IN(".implode(',', $status_to_show).") + AND status IN(" . implode(',', $status_to_show) . ") ORDER BY `date` ASC"; - $res_date = $DB->query($query_date); - $dates = []; - while ($data = $DB->fetchAssoc($res_date)) { - $dates[$data['period']] = $data['period']; - } - - $tmp_date = []; - foreach (array_values($dates) as $id) { - $tmp_date[] = $id; - } - - $query = "SELECT DISTINCT - DATE_FORMAT(date, '".$this->period_sort."') as period, - DATE_FORMAT(date, '".$this->period_label."') as period_name, + $res_date = $DB->query($query_date); + $dates = []; + while ($data = $DB->fetchAssoc($res_date)) { + $dates[$data['period']] = $data['period']; + } + + $tmp_date = []; + foreach (array_values($dates) as $id) { + $tmp_date[] = $id; + } + + $query = "SELECT DISTINCT + DATE_FORMAT(date, '" . $this->period_sort . "') as period, + DATE_FORMAT(date, '" . $this->period_label . "') as period_name, status, COUNT(id) as nb FROM glpi_tickets - WHERE ".$this->sql_date." - AND glpi_tickets.entities_id IN (".$this->where_entities.") + WHERE " . $this->sql_date . " + AND glpi_tickets.entities_id IN (" . $this->where_entities . ") AND glpi_tickets.is_deleted = '0' - AND status IN(".implode(',', $status_to_show).") + AND status IN(" . implode(',', $status_to_show) . ") GROUP BY period, status ORDER BY period, status"; - $res = $DB->query($query); - while ($data = $DB->fetchAssoc($res)) { - $status =Ticket::getStatus($data['status']); - $datas['labels2'][$data['period']] = $data['period_name']; - $datas['datas'][$status][$data['period']] = $data['nb']; - } - - //merge missing datas (not defined status for a month) - if (isset($datas['datas'])) { - foreach ($datas['datas'] as &$data) { - $data = $data + array_fill_keys($tmp_date, 0); - } - } - - //fix order of datas - if (count($datas) > 0) { - foreach ($datas['datas'] as &$data) { - ksort($data); - } - } - return $datas; - } - - function reportSunburstTicketByCategories($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportSunburstTicketByCategories'] = ['dateinterval']; - - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); - - $flat_datas = []; - $datas = []; - - $query = "SELECT glpi_tickets.itilcategories_id as id, + $res = $DB->query($query); + while ($data = $DB->fetchAssoc($res)) { + $status = Ticket::getStatus($data['status']); + $datas['labels2'][$data['period']] = $data['period_name']; + $datas['datas'][$status][$data['period']] = $data['nb']; + } + + //merge missing datas (not defined status for a month) + if (isset($datas['datas'])) { + foreach ($datas['datas'] as &$data) { + $data = $data + array_fill_keys($tmp_date, 0); + } + } + + //fix order of datas + if (count($datas) > 0) { + foreach ($datas['datas'] as &$data) { + ksort($data); + } + } + return $datas; + } + + public function reportSunburstTicketByCategories($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportSunburstTicketByCategories'] = ['dateinterval']; + + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); + + $flat_datas = []; + $datas = []; + + $query = "SELECT glpi_tickets.itilcategories_id as id, glpi_itilcategories.name as name, glpi_itilcategories.itilcategories_id as parent, COUNT(glpi_tickets.id) as count @@ -624,52 +662,56 @@ function reportSunburstTicketByCategories($config = []) { AND glpi_tickets.is_deleted = '0' GROUP BY glpi_itilcategories.id ORDER BY glpi_itilcategories.name"; - $res = $DB->query($query); - while ($data = $DB->fetchAssoc($res)) { - $flat_datas[$data['id']] = $data; - } - - //get full parent list - krsort($flat_datas); - $itilcategory = new ITILCategory; - foreach ($flat_datas as $cat_id => $current_datas) { - if (!isset($flat_datas[$current_datas['parent']])) { - - if ($current_datas['parent'] != 0 - && $itilcategory->getFromDB($current_datas['parent'])) { - $flat_datas[$current_datas['parent']] = [ - 'id' => $current_datas['parent'], - 'name' => $itilcategory->fields['name'], - 'parent' => $itilcategory->fields['itilcategories_id'], - 'count' => 0 - ]; + $res = $DB->query($query); + while ($data = $DB->fetchAssoc($res)) { + $flat_datas[$data['id']] = $data; + } + + //get full parent list + krsort($flat_datas); + $itilcategory = new ITILCategory(); + foreach ($flat_datas as $cat_id => $current_datas) { + if (!isset($flat_datas[$current_datas['parent']])) { + if ( + $current_datas['parent'] != 0 + && $itilcategory->getFromDB($current_datas['parent']) + ) { + $flat_datas[$current_datas['parent']] = [ + 'id' => $current_datas['parent'], + 'name' => $itilcategory->fields['name'], + 'parent' => $itilcategory->fields['itilcategories_id'], + 'count' => 0 + ]; + } } - } - } + } - $tree_datas['datas'] = PluginMreportingCommon::buildTree($flat_datas); + $tree_datas['datas'] = PluginMreportingCommon::buildTree($flat_datas); - return $tree_datas; - } + return $tree_datas; + } - function reportVstackbarTicketStatusByTechnician($config = []) { - global $DB; + public function reportVstackbarTicketStatusByTechnician($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportVstackbarTicketStatusByTechnician'] = ['dateinterval']; + $_SESSION['mreporting_selector']['reportVstackbarTicketStatusByTechnician'] = ['dateinterval']; - $datas = []; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("glpi_tickets.date", - $config['delay'], - $config['randname']); + $datas = []; + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "glpi_tickets.date", + $config['delay'], + $config['randname'] + ); - $status = $this->filters['open']['status'] + $this->filters['close']['status']; - $status_keys = array_keys($status); + $status = $this->filters['open']['status'] + $this->filters['close']['status']; + $status_keys = array_keys($status); - //get technician list - $technicians = []; - $query = "SELECT + //get technician list + $technicians = []; + $query = "SELECT CONCAT(glpi_users.firstname, ' ', glpi_users.realname) as fullname, glpi_users.name as username FROM glpi_tickets @@ -682,29 +724,29 @@ function reportVstackbarTicketStatusByTechnician($config = []) { AND glpi_tickets.entities_id IN ({$this->where_entities}) AND glpi_tickets.is_deleted = '0' ORDER BY fullname, username"; - $result = $DB->query($query); - - while ($technician = $DB->fetchAssoc($result)) { - $technicians[] = ['username' => $technician['username'], - 'fullname' => $technician['fullname'], - ]; - } - - //prepare empty values with technician list - foreach ($status as $key_status => $current_status) { - foreach ($technicians as $technician) { - $datas['datas'][$current_status][$technician['username']] = 0; - - $fullname = trim($technician['fullname']); - if (!empty($fullname)) { - $datas['labels2'][$technician['username']] = $fullname; - } else { - $datas['labels2'][$technician['username']] = $technician['username']; + $result = $DB->query($query); + + while ($technician = $DB->fetchAssoc($result)) { + $technicians[] = ['username' => $technician['username'], + 'fullname' => $technician['fullname'], + ]; + } + + //prepare empty values with technician list + foreach ($status as $key_status => $current_status) { + foreach ($technicians as $technician) { + $datas['datas'][$current_status][$technician['username']] = 0; + + $fullname = trim($technician['fullname']); + if (!empty($fullname)) { + $datas['labels2'][$technician['username']] = $fullname; + } else { + $datas['labels2'][$technician['username']] = $technician['username']; + } } - } - } + } - $query = "SELECT glpi_tickets.status, + $query = "SELECT glpi_tickets.status, CONCAT(glpi_users.firstname, ' ', glpi_users.realname) as technician, glpi_users.name as username, COUNT(glpi_tickets.id) as count @@ -719,32 +761,35 @@ function reportVstackbarTicketStatusByTechnician($config = []) { AND glpi_tickets.is_deleted = '0' GROUP BY status, technician ORDER BY technician, username"; - $result = $DB->query($query); + $result = $DB->query($query); - while ($ticket = $DB->fetchAssoc($result)) { - if (is_null($ticket['technician'])) { - $ticket['technician'] = __("None"); - } - $datas['datas'][$status[$ticket['status']]][$ticket['username']] = $ticket['count']; - } + while ($ticket = $DB->fetchAssoc($result)) { + if (is_null($ticket['technician'])) { + $ticket['technician'] = __("None"); + } + $datas['datas'][$status[$ticket['status']]][$ticket['username']] = $ticket['count']; + } - return $datas; - } + return $datas; + } - function reportHbarTicketNumberByLocation($config = []) { - global $DB; + public function reportHbarTicketNumberByLocation($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportHbarTicketNumberByLocation'] + $_SESSION['mreporting_selector']['reportHbarTicketNumberByLocation'] = ['dateinterval', 'limit']; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("`glpi_tickets`.`date`", - $config['delay'], - $config['randname']); + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "`glpi_tickets`.`date`", + $config['delay'], + $config['randname'] + ); - $datas = []; + $datas = []; - $query = "SELECT COUNT(glpi_tickets.id) as count, + $query = "SELECT COUNT(glpi_tickets.id) as count, glpi_locations.name as name FROM glpi_tickets LEFT JOIN glpi_tickets_users @@ -759,22 +804,21 @@ function reportHbarTicketNumberByLocation($config = []) { GROUP BY glpi_locations.name ORDER BY count DESC LIMIT 0, "; - $query .= (isset($_REQUEST['glpilist_limit'])) ? $_REQUEST['glpilist_limit'] : 20; + $query .= (isset($_REQUEST['glpilist_limit'])) ? $_REQUEST['glpilist_limit'] : 20; - $result = $DB->query($query); + $result = $DB->query($query); - while ($ticket = $DB->fetchAssoc($result)) { - if (empty($ticket['name'])) { - $label = __("None"); - } else { - $label = $ticket['name']; - } - $datas['datas'][$label] = $ticket['count']; - } - - return $datas; + while ($ticket = $DB->fetchAssoc($result)) { + if (empty($ticket['name'])) { + $label = __("None"); + } else { + $label = $ticket['name']; + } + $datas['datas'][$label] = $ticket['count']; + } - } + return $datas; + } /** @@ -785,13 +829,14 @@ function reportHbarTicketNumberByLocation($config = []) { * @param type $functionname * @return $opt */ - function customExportDates(array $opt, $functionname) { - $config = PluginMreportingConfig::initConfigParams($functionname, __CLASS__); + public function customExportDates(array $opt, $functionname) + { + $config = PluginMreportingConfig::initConfigParams($functionname, __CLASS__); - $opt['date1'] = date('Y-m-j', strtotime($opt['date2'].' -'.$config['delay'].' days')); + $opt['date1'] = date('Y-m-j', strtotime($opt['date2'] . ' -' . $config['delay'] . ' days')); - return $opt; - } + return $opt; + } /** * Preconfig datas with your values when init config is done @@ -801,35 +846,33 @@ function customExportDates(array $opt, $functionname) { * @param PluginMreportingConfig $config * @return $config */ - function preconfig($funct_name, $classname, PluginMreportingConfig $config) { - - if ($funct_name != -1 && $classname) { - - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); - if ($ex_func[0] != 'report') { - return false; - } - $gtype = strtolower($ex_func[1]); - - switch ($gtype) { - case 'pie': - $config->fields["name"]=$funct_name; - $config->fields["classname"]=$classname; - $config->fields["is_active"]="1"; - $config->fields["show_label"]="hover"; - $config->fields["spline"]="0"; - $config->fields["show_area"]="0"; - $config->fields["show_graph"]="1"; - $config->fields["default_delay"]="30"; - $config->fields["show_label"]="hover"; - break; - default : - $config->preconfig($funct_name, $classname); - break; - - } - - } - return $config->fields; - } + public function preconfig($funct_name, $classname, PluginMreportingConfig $config) + { + + if ($funct_name != -1 && $classname) { + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); + if ($ex_func[0] != 'report') { + return false; + } + $gtype = strtolower($ex_func[1]); + + switch ($gtype) { + case 'pie': + $config->fields["name"] = $funct_name; + $config->fields["classname"] = $classname; + $config->fields["is_active"] = "1"; + $config->fields["show_label"] = "hover"; + $config->fields["spline"] = "0"; + $config->fields["show_area"] = "0"; + $config->fields["show_graph"] = "1"; + $config->fields["default_delay"] = "30"; + $config->fields["show_label"] = "hover"; + break; + default: + $config->preconfig($funct_name, $classname); + break; + } + } + return $config->fields; + } } diff --git a/inc/helpdeskplus.class.php b/inc/helpdeskplus.class.php index 3436cbd5..f8330895 100644 --- a/inc/helpdeskplus.class.php +++ b/inc/helpdeskplus.class.php @@ -1,51 +1,81 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); + die("Sorry. You can't access directly to this file"); } -class PluginMreportingHelpdeskplus Extends PluginMreportingBaseclass { - - protected $sql_group_assign, - $sql_group_request, - $sql_user_assign, - $sql_type, - $sql_itilcat, - $sql_join_cat, - $sql_join_g, - $sql_join_u, - $sql_join_tt, - $sql_join_tu, - $sql_join_gt, - $sql_join_gtr, - $sql_select_sla; - - - function __construct($config = []) { - global $LANG; - $this->sql_group_assign = "1=1"; - $this->sql_group_request = "1=1"; - $this->sql_user_assign = "1=1"; - $this->sql_type = "glpi_tickets.type IN (".Ticket::INCIDENT_TYPE.", ".Ticket::DEMAND_TYPE.")"; - $this->sql_itilcat = "1=1"; - $this->sql_join_cat = "LEFT JOIN glpi_itilcategories cat +class PluginMreportingHelpdeskplus extends PluginMreportingBaseclass +{ + protected $sql_group_assign; + protected $sql_group_request; + protected $sql_user_assign; + protected $sql_type; + protected $sql_itilcat; + protected $sql_join_cat; + protected $sql_join_g; + protected $sql_join_u; + protected $sql_join_tt; + protected $sql_join_tu; + protected $sql_join_gt; + protected $sql_join_gtr; + protected $sql_select_sla; + + + public function __construct($config = []) + { + /** @var array $LANG */ + global $LANG; + $this->sql_group_assign = "1=1"; + $this->sql_group_request = "1=1"; + $this->sql_user_assign = "1=1"; + $this->sql_type = "glpi_tickets.type IN (" . Ticket::INCIDENT_TYPE . ", " . Ticket::DEMAND_TYPE . ")"; + $this->sql_itilcat = "1=1"; + $this->sql_join_cat = "LEFT JOIN glpi_itilcategories cat ON glpi_tickets.itilcategories_id = cat.id"; - $this->sql_join_g = "LEFT JOIN glpi_groups g + $this->sql_join_g = "LEFT JOIN glpi_groups g ON gt.groups_id = g.id"; - $this->sql_join_u = "LEFT JOIN glpi_users u + $this->sql_join_u = "LEFT JOIN glpi_users u ON tu.users_id = u.id"; - $this->sql_join_tt = "LEFT JOIN glpi_tickettasks tt + $this->sql_join_tt = "LEFT JOIN glpi_tickettasks tt ON tt.tickets_id = glpi_tickets.id"; - $this->sql_join_tu = "LEFT JOIN glpi_tickets_users tu + $this->sql_join_tu = "LEFT JOIN glpi_tickets_users tu ON tu.tickets_id = glpi_tickets.id - AND tu.type = ".Ticket_User::ASSIGN; - $this->sql_join_gt = "LEFT JOIN glpi_groups_tickets gt + AND tu.type = " . Ticket_User::ASSIGN; + $this->sql_join_gt = "LEFT JOIN glpi_groups_tickets gt ON gt.tickets_id = glpi_tickets.id - AND gt.type = ".Group_Ticket::ASSIGN; - $this->sql_join_gtr = "LEFT JOIN glpi_groups_tickets gtr + AND gt.type = " . Group_Ticket::ASSIGN; + $this->sql_join_gtr = "LEFT JOIN glpi_groups_tickets gtr ON gtr.tickets_id = glpi_tickets.id - AND gtr.type = ".Group_Ticket::REQUESTER; - $this->sql_select_sla = "CASE WHEN glpi_slas.definition_time = 'day' + AND gtr.type = " . Group_Ticket::REQUESTER; + $this->sql_select_sla = "CASE WHEN glpi_slas.definition_time = 'day' AND glpi_tickets.solve_delay_stat <= glpi_slas.number_time * 86400 THEN 'ok' WHEN glpi_slas.definition_time = 'hour' @@ -57,68 +87,76 @@ function __construct($config = []) { ELSE 'nok' END AS respected_sla"; - parent::__construct($config); - - $this->lcl_slaok = $LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']; - $this->lcl_slako = $LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']; - - $mr_values = $_SESSION['mreporting_values']; - - if (isset($mr_values['groups_assign_id'])) { - if (is_array($mr_values['groups_assign_id'])) { - $this->sql_group_assign = "gt.groups_id IN (". - implode(',', $mr_values['groups_assign_id']).")"; - } else if ($mr_values['groups_assign_id'] > 0) { - $this->sql_group_assign = "gt.groups_id = ".$mr_values['groups_assign_id']; - } - } - - if (isset($mr_values['groups_request_id'])) { - if (is_array($mr_values['groups_request_id'])) { - $this->sql_group_request = "gtr.groups_id IN (". - implode(',', $mr_values['groups_request_id']).")"; - } else if ($mr_values['groups_request_id'] > 0) { - $this->sql_group_request = "gt.groups_id = ".$mr_values['groups_request_id']; - } - } - - if (isset($mr_values['users_assign_id']) - && $mr_values['users_assign_id'] > 0) { - $this->sql_user_assign = "tu.users_id = ".$mr_values['users_assign_id']; - } - - if (isset($mr_values['type']) - && $mr_values['type'] > 0) { - $this->sql_type = "glpi_tickets.type = ".$mr_values['type']; - } - - if (isset($mr_values['itilcategories_id']) - && $mr_values['itilcategories_id'] > 0) { - $this->sql_itilcat = "glpi_tickets.itilcategories_id = ".$mr_values['itilcategories_id']; - } - } - - function reportGlineBacklogs($config = []) { - global $DB, $LANG; - - $_SESSION['mreporting_selector']['reportGlineBacklogs'] = + parent::__construct($config); + + $this->lcl_slaok = $LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']; + $this->lcl_slako = $LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']; + + $mr_values = $_SESSION['mreporting_values']; + + if (isset($mr_values['groups_assign_id'])) { + if (is_array($mr_values['groups_assign_id'])) { + $this->sql_group_assign = "gt.groups_id IN (" . + implode(',', $mr_values['groups_assign_id']) . ")"; + } else if ($mr_values['groups_assign_id'] > 0) { + $this->sql_group_assign = "gt.groups_id = " . $mr_values['groups_assign_id']; + } + } + + if (isset($mr_values['groups_request_id'])) { + if (is_array($mr_values['groups_request_id'])) { + $this->sql_group_request = "gtr.groups_id IN (" . + implode(',', $mr_values['groups_request_id']) . ")"; + } else if ($mr_values['groups_request_id'] > 0) { + $this->sql_group_request = "gt.groups_id = " . $mr_values['groups_request_id']; + } + } + + if ( + isset($mr_values['users_assign_id']) + && $mr_values['users_assign_id'] > 0 + ) { + $this->sql_user_assign = "tu.users_id = " . $mr_values['users_assign_id']; + } + + if ( + isset($mr_values['type']) + && $mr_values['type'] > 0 + ) { + $this->sql_type = "glpi_tickets.type = " . $mr_values['type']; + } + + if ( + isset($mr_values['itilcategories_id']) + && $mr_values['itilcategories_id'] > 0 + ) { + $this->sql_itilcat = "glpi_tickets.itilcategories_id = " . $mr_values['itilcategories_id']; + } + } + + public function reportGlineBacklogs($config = []) + { + global $DB, $LANG; + + $_SESSION['mreporting_selector']['reportGlineBacklogs'] = ['dateinterval', 'period', 'backlogstates', 'multiplegrouprequest', - 'userassign', 'category', 'multiplegroupassign']; - - $tab = []; - $datas = []; - - $search_new = (!isset($_SESSION['mreporting_values']['show_new']) - || ($_SESSION['mreporting_values']['show_new'] == '1')) ?true:false; - $search_solved = (!isset($_SESSION['mreporting_values']['show_solved']) - || ($_SESSION['mreporting_values']['show_solved'] == '1')) ?true:false; - $search_backlogs = (!isset($_SESSION['mreporting_values']['show_backlog']) - || ($_SESSION['mreporting_values']['show_backlog'] == '1')) ?true:false; - $search_closed = (isset($_SESSION['mreporting_values']['show_closed']) - && ($_SESSION['mreporting_values']['show_closed'] == '1')) ?true:false; - - if ($search_new) { - $sql_create = "SELECT + 'userassign', 'category', 'multiplegroupassign' + ]; + + $tab = []; + $datas = []; + + $search_new = (!isset($_SESSION['mreporting_values']['show_new']) + || ($_SESSION['mreporting_values']['show_new'] == '1')) ? true : false; + $search_solved = (!isset($_SESSION['mreporting_values']['show_solved']) + || ($_SESSION['mreporting_values']['show_solved'] == '1')) ? true : false; + $search_backlogs = (!isset($_SESSION['mreporting_values']['show_backlog']) + || ($_SESSION['mreporting_values']['show_backlog'] == '1')) ? true : false; + $search_closed = (isset($_SESSION['mreporting_values']['show_closed']) + && ($_SESSION['mreporting_values']['show_closed'] == '1')) ? true : false; + + if ($search_new) { + $sql_create = "SELECT DISTINCT DATE_FORMAT(date, '{$this->period_sort}') as period, DATE_FORMAT(date, '{$this->period_label}') as period_name, COUNT(DISTINCT glpi_tickets.id) as nb @@ -137,14 +175,14 @@ function reportGlineBacklogs($config = []) { AND {$this->sql_itilcat} GROUP BY period ORDER BY period"; - foreach ($DB->request($sql_create) as $data) { - $tab[$data['period']]['open'] = $data['nb']; - $tab[$data['period']]['period_name'] = $data['period_name']; - } - } - - if ($search_solved) { - $sql_solved = "SELECT + foreach ($DB->request($sql_create) as $data) { + $tab[$data['period']]['open'] = $data['nb']; + $tab[$data['period']]['period_name'] = $data['period_name']; + } + } + + if ($search_solved) { + $sql_solved = "SELECT DISTINCT DATE_FORMAT(solvedate, '{$this->period_sort}') as period, DATE_FORMAT(solvedate, '{$this->period_label}') as period_name, COUNT(DISTINCT glpi_tickets.id) as nb @@ -162,42 +200,42 @@ function reportGlineBacklogs($config = []) { AND {$this->sql_itilcat} GROUP BY period ORDER BY period"; - foreach ($DB->request($sql_solved) as $data) { - $tab[$data['period']]['solved'] = $data['nb']; - $tab[$data['period']]['period_name'] = $data['period_name']; - } - } + foreach ($DB->request($sql_solved) as $data) { + $tab[$data['period']]['solved'] = $data['nb']; + $tab[$data['period']]['period_name'] = $data['period_name']; + } + } /** * Backlog : Tickets Ouverts à la date en cours... */ - if ($search_backlogs) { - $date_array1=explode("-", $_SESSION['mreporting_values']['date1'.$config['randname']]); - $time1=mktime(0, 0, 0, $date_array1[1], $date_array1[2], $date_array1[0]); - - $date_array2=explode("-", $_SESSION['mreporting_values']['date2'.$config['randname']]); - $time2=mktime(0, 0, 0, $date_array2[1], $date_array2[2], $date_array2[0]); - - //if data inverted, reverse it - if ($time1 > $time2) { - list($time1, $time2) = [$time2, $time1]; - list($_SESSION['mreporting_values']['date1'.$config['randname']], $_SESSION['mreporting_values']['date2'.$config['randname']]) = [ - $_SESSION['mreporting_values']['date2'.$config['randname']], - $_SESSION['mreporting_values']['date1'.$config['randname']] - ]; - } - - $sql_itilcat_backlog = isset($_SESSION['mreporting_values']['itilcategories_id']) + if ($search_backlogs) { + $date_array1 = explode("-", $_SESSION['mreporting_values']['date1' . $config['randname']]); + $time1 = mktime(0, 0, 0, $date_array1[1], $date_array1[2], $date_array1[0]); + + $date_array2 = explode("-", $_SESSION['mreporting_values']['date2' . $config['randname']]); + $time2 = mktime(0, 0, 0, $date_array2[1], $date_array2[2], $date_array2[0]); + + //if data inverted, reverse it + if ($time1 > $time2) { + list($time1, $time2) = [$time2, $time1]; + list($_SESSION['mreporting_values']['date1' . $config['randname']], $_SESSION['mreporting_values']['date2' . $config['randname']]) = [ + $_SESSION['mreporting_values']['date2' . $config['randname']], + $_SESSION['mreporting_values']['date1' . $config['randname']] + ]; + } + + $sql_itilcat_backlog = isset($_SESSION['mreporting_values']['itilcategories_id']) && $_SESSION['mreporting_values']['itilcategories_id'] > 0 - ? " AND tic.itilcategories_id = ".$_SESSION['mreporting_values']['itilcategories_id'] + ? " AND tic.itilcategories_id = " . $_SESSION['mreporting_values']['itilcategories_id'] : ""; - $begin=strftime($this->period_sort_php, $time1); - $end=strftime($this->period_sort_php, $time2); - $sql_date_backlog = "DATE_FORMAT(list_date.period_l, '{$this->period_sort}') >= '$begin' + $begin = date($this->period_sort_php, $time1); + $end = date($this->period_sort_php, $time2); + $sql_date_backlog = "DATE_FORMAT(list_date.period_l, '{$this->period_sort}') >= '$begin' AND DATE_FORMAT(list_date.period_l, '{$this->period_sort}') <= '$end'"; - $sql_list_date2 = str_replace('date', 'solvedate', $this->sql_list_date); - $sql_backlog = "SELECT + $sql_list_date2 = str_replace('date', 'solvedate', $this->sql_list_date); + $sql_backlog = "SELECT DISTINCT(DATE_FORMAT(list_date.period_l, '$this->period_sort')) as period, DATE_FORMAT(list_date.period_l, '$this->period_label') as period_name, COUNT(DISTINCT(glpi_tickets.id)) as nb @@ -228,15 +266,14 @@ function reportGlineBacklogs($config = []) { AND {$this->sql_itilcat} AND $sql_date_backlog GROUP BY period"; - foreach ($DB->request($sql_backlog) as $data) { - $tab[$data['period']]['backlog'] = $data['nb']; - $tab[$data['period']]['period_name'] = $data['period_name']; - } - - } + foreach ($DB->request($sql_backlog) as $data) { + $tab[$data['period']]['backlog'] = $data['nb']; + $tab[$data['period']]['period_name'] = $data['period_name']; + } + } - if ($search_closed) { - $sql_closed = "SELECT + if ($search_closed) { + $sql_closed = "SELECT DISTINCT DATE_FORMAT(closedate, '{$this->period_sort}') as period, DATE_FORMAT(closedate, '{$this->period_label}') as period_name, COUNT(DISTINCT glpi_tickets.id) as nb @@ -254,51 +291,53 @@ function reportGlineBacklogs($config = []) { AND {$this->sql_itilcat} GROUP BY period ORDER BY period"; - foreach ($DB->request($sql_closed) as $data) { - $tab[$data['period']]['closed'] = $data['nb']; - $tab[$data['period']]['period_name'] = $data['period_name']; - } - } - - ksort($tab); - - foreach ($tab as $period => $data) { - if ($search_new) { - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['opened']][] = (isset($data['open'])) ? $data['open'] : 0; - } - if ($search_solved) { - $datas['datas'][_x('status', 'Solved')][] = (isset($data['solved'])) ? $data['solved'] : 0; - } - if ($search_closed) { - $datas['datas'][_x('status', 'Closed')][] = (isset($data['closed'])) ? $data['closed'] : 0; - } - if ($search_backlogs) { - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['backlogs']][] = (isset($data['backlog'])) ? $data['backlog'] : 0; - } - $datas['labels2'][] = $data['period_name']; - } - - return $datas; - } - - - - function reportVstackbarLifetime($config = []) { - global $DB; - - $tab = $datas = $labels2 = []; - $_SESSION['mreporting_selector']['reportVstackbarLifetime'] + foreach ($DB->request($sql_closed) as $data) { + $tab[$data['period']]['closed'] = $data['nb']; + $tab[$data['period']]['period_name'] = $data['period_name']; + } + } + + ksort($tab); + + foreach ($tab as $period => $data) { + if ($search_new) { + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['opened']][] = (isset($data['open'])) ? $data['open'] : 0; + } + if ($search_solved) { + $datas['datas'][_x('status', 'Solved')][] = (isset($data['solved'])) ? $data['solved'] : 0; + } + if ($search_closed) { + $datas['datas'][_x('status', 'Closed')][] = (isset($data['closed'])) ? $data['closed'] : 0; + } + if ($search_backlogs) { + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['backlogs']][] = (isset($data['backlog'])) ? $data['backlog'] : 0; + } + $datas['labels2'][] = $data['period_name']; + } + + return $datas; + } + + + + public function reportVstackbarLifetime($config = []) + { + global $DB; + + $tab = $datas = $labels2 = []; + $_SESSION['mreporting_selector']['reportVstackbarLifetime'] = ['dateinterval', 'period', 'allstates', 'multiplegrouprequest', - 'multiplegroupassign', 'userassign', 'category']; + 'multiplegroupassign', 'userassign', 'category' + ]; - if (!isset($_SESSION['mreporting_values']['date2'.$config['randname']])) { - $_SESSION['mreporting_values']['date2'.$config['randname']] = strftime("%Y-%m-%d"); - } + if (!isset($_SESSION['mreporting_values']['date2' . $config['randname']])) { + $_SESSION['mreporting_values']['date2' . $config['randname']] = date("Y-m-d"); + } - foreach ($this->status as $current_status) { - if ($_SESSION['mreporting_values']['status_'.$current_status] == '1') { - $status_name = Ticket::getStatus($current_status); - $sql_status = "SELECT + foreach ($this->status as $current_status) { + if ($_SESSION['mreporting_values']['status_' . $current_status] == '1') { + $status_name = Ticket::getStatus($current_status); + $sql_status = "SELECT DISTINCT DATE_FORMAT(date, '{$this->period_sort}') as period, DATE_FORMAT(date, '{$this->period_label}') as period_name, COUNT(DISTINCT glpi_tickets.id) as nb @@ -317,42 +356,43 @@ function reportVstackbarLifetime($config = []) { AND {$this->sql_user_assign} GROUP BY period ORDER BY period"; - $res = $DB->query($sql_status); - while ($data = $DB->fetchAssoc($res)) { - $tab[$data['period']][$status_name] = $data['nb']; - $labels2[$data['period']] = $data['period_name']; + $res = $DB->query($sql_status); + while ($data = $DB->fetchAssoc($res)) { + $tab[$data['period']][$status_name] = $data['nb']; + $labels2[$data['period']] = $data['period_name']; + } } - } - } + } - //ascending order of datas by date - ksort($tab); + //ascending order of datas by date + ksort($tab); - //fill missing datas with zeros - $datas = $this->fillStatusMissingValues($tab, $labels2); + //fill missing datas with zeros + $datas = $this->fillStatusMissingValues($tab, $labels2); - return $datas; - } + return $datas; + } - function reportVstackbarTicketsgroups($config = []) { - global $DB; + public function reportVstackbarTicketsgroups($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportVstackbarTicketsgroups'] = + $_SESSION['mreporting_selector']['reportVstackbarTicketsgroups'] = ['dateinterval', 'allstates', 'multiplegroupassign', 'category']; - $tab = []; - $datas = []; + $tab = []; + $datas = []; - if (!isset($_SESSION['mreporting_values']['date2'.$config['randname']])) { - $_SESSION['mreporting_values']['date2'.$config['randname']] = strftime("%Y-%m-%d"); - } + if (!isset($_SESSION['mreporting_values']['date2' . $config['randname']])) { + $_SESSION['mreporting_values']['date2' . $config['randname']] = date("Y-m-d"); + } - foreach ($this->status as $current_status) { - if ($_SESSION['mreporting_values']['status_'.$current_status] == '1') { - $status_name = Ticket::getStatus($current_status); - $sql_status = "SELECT + foreach ($this->status as $current_status) { + if ($_SESSION['mreporting_values']['status_' . $current_status] == '1') { + $status_name = Ticket::getStatus($current_status); + $sql_status = "SELECT DISTINCT g.completename AS group_name, COUNT(DISTINCT glpi_tickets.id) AS nb FROM glpi_tickets @@ -367,45 +407,46 @@ function reportVstackbarTicketsgroups($config = []) { AND {$this->sql_group_assign} GROUP BY group_name ORDER BY group_name"; - $res = $DB->query($sql_status); - while ($data = $DB->fetchAssoc($res)) { - if (empty($data['group_name'])) { - $data['group_name'] = __("None"); - } - $tab[$data['group_name']][$status_name] = $data['nb']; + $res = $DB->query($sql_status); + while ($data = $DB->fetchAssoc($res)) { + if (empty($data['group_name'])) { + $data['group_name'] = __("None"); + } + $tab[$data['group_name']][$status_name] = $data['nb']; + } } - } - } + } - //ascending order of datas by date - ksort($tab); + //ascending order of datas by date + ksort($tab); - //fill missing datas with zeros - $datas = $this->fillStatusMissingValues($tab); + //fill missing datas with zeros + $datas = $this->fillStatusMissingValues($tab); - return $datas; - } + return $datas; + } - function reportVstackbarTicketstech($config = []) { - global $DB; + public function reportVstackbarTicketstech($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportVstackbarTicketstech'] + $_SESSION['mreporting_selector']['reportVstackbarTicketstech'] = ['dateinterval', 'multiplegroupassign', 'allstates', 'category']; - $tab = []; - $datas = []; + $tab = []; + $datas = []; - if (!isset($_SESSION['mreporting_values']['date2'.$config['randname']])) { - $_SESSION['mreporting_values']['date2'.$config['randname']] = strftime("%Y-%m-%d"); - } + if (!isset($_SESSION['mreporting_values']['date2' . $config['randname']])) { + $_SESSION['mreporting_values']['date2' . $config['randname']] = date("Y-m-d"); + } - foreach ($this->status as $current_status) { - if ($_SESSION['mreporting_values']['status_'.$current_status] == '1') { - $status_name = Ticket::getStatus($current_status); + foreach ($this->status as $current_status) { + if ($_SESSION['mreporting_values']['status_' . $current_status] == '1') { + $status_name = Ticket::getStatus($current_status); - $sql_create = "SELECT + $sql_create = "SELECT DISTINCT CONCAT(u.firstname, ' ', u.realname) AS completename, u.name as name, u.id as u_id, @@ -425,38 +466,39 @@ function reportVstackbarTicketstech($config = []) { AND {$this->sql_itilcat} GROUP BY name ORDER BY name"; - $res = $DB->query($sql_create); - while ($data = $DB->fetchAssoc($res)) { - $data['name'] = empty($data['completename']) ? __("None") : $data['completename']; + $res = $DB->query($sql_create); + while ($data = $DB->fetchAssoc($res)) { + $data['name'] = empty($data['completename']) ? __("None") : $data['completename']; - if (!isset($tab[$data['name']][$status_name])) { - $tab[$data['name']][$status_name] = 0; - } + if (!isset($tab[$data['name']][$status_name])) { + $tab[$data['name']][$status_name] = 0; + } - $tab[$data['name']][$status_name]+= $data['nb']; + $tab[$data['name']][$status_name] += $data['nb']; + } } - } - } + } - //ascending order of datas by date - ksort($tab); + //ascending order of datas by date + ksort($tab); - //fill missing datas with zeros - $datas = $this->fillStatusMissingValues($tab); + //fill missing datas with zeros + $datas = $this->fillStatusMissingValues($tab); - return $datas; - } + return $datas; + } - function reportHbarTopcategory($config = []) { - global $DB; + public function reportHbarTopcategory($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportHbarTopcategory'] + $_SESSION['mreporting_selector']['reportHbarTopcategory'] = ['dateinterval', 'limit', 'userassign', 'multiplegrouprequest', 'multiplegroupassign', 'type']; - $tab = []; - $datas = []; + $tab = []; + $datas = []; - $sql_create = "SELECT DISTINCT glpi_tickets.itilcategories_id, + $sql_create = "SELECT DISTINCT glpi_tickets.itilcategories_id, COUNT(DISTINCT glpi_tickets.id) as nb, cat.completename FROM glpi_tickets @@ -474,29 +516,30 @@ function reportHbarTopcategory($config = []) { GROUP BY cat.completename ORDER BY nb DESC LIMIT 0, "; - $sql_create .= (isset($_SESSION['mreporting_values']['glpilist_limit'])) + $sql_create .= (isset($_SESSION['mreporting_values']['glpilist_limit'])) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20; - $res = $DB->query($sql_create); - while ($data = $DB->fetchAssoc($res)) { - if (empty($data['completename'])) { - $data['completename'] = __("None"); - } - $datas['datas'][$data['completename']] = $data['nb']; - } + $res = $DB->query($sql_create); + while ($data = $DB->fetchAssoc($res)) { + if (empty($data['completename'])) { + $data['completename'] = __("None"); + } + $datas['datas'][$data['completename']] = $data['nb']; + } - return $datas; - } + return $datas; + } - function reportHbarTopapplicant($config = []) { - global $DB; + public function reportHbarTopapplicant($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportHbarTopapplicant'] = ['dateinterval', 'limit', 'type']; + $_SESSION['mreporting_selector']['reportHbarTopapplicant'] = ['dateinterval', 'limit', 'type']; - $tab = []; - $datas = []; + $tab = []; + $datas = []; - $sql_create = "SELECT DISTINCT gt.groups_id, + $sql_create = "SELECT DISTINCT gt.groups_id, COUNT(DISTINCT glpi_tickets.id) AS nb, g.completename FROM glpi_tickets @@ -509,30 +552,32 @@ function reportHbarTopapplicant($config = []) { GROUP BY g.completename ORDER BY nb DESC LIMIT 0, "; - $sql_create .= (isset($_SESSION['mreporting_values']['glpilist_limit'])) + $sql_create .= (isset($_SESSION['mreporting_values']['glpilist_limit'])) ? $_SESSION['mreporting_values']['glpilist_limit'] : 20; - $res = $DB->query($sql_create); - while ($data = $DB->fetchAssoc($res)) { - if (empty($data['completename'])) { - $data['completename'] = __("None"); - } - $datas['datas'][$data['completename']] = $data['nb']; - } + $res = $DB->query($sql_create); + while ($data = $DB->fetchAssoc($res)) { + if (empty($data['completename'])) { + $data['completename'] = __("None"); + } + $datas['datas'][$data['completename']] = $data['nb']; + } - return $datas; - } + return $datas; + } - function reportVstackbarGroupChange($config = []) { - global $DB; + public function reportVstackbarGroupChange($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportVstackbarGroupChange'] + $_SESSION['mreporting_selector']['reportVstackbarGroupChange'] = ['dateinterval', 'userassign', 'category', - 'multiplegrouprequest', 'multiplegroupassign']; + 'multiplegrouprequest', 'multiplegroupassign' + ]; - $datas = []; + $datas = []; - $query = "SELECT COUNT(DISTINCT ticc.id) as nb_ticket, + $query = "SELECT COUNT(DISTINCT ticc.id) as nb_ticket, ticc.nb_add_group - 1 as nb_add_group FROM ( SELECT @@ -559,28 +604,30 @@ function reportVstackbarGroupChange($config = []) { GROUP BY glpi_tickets.id HAVING nb_add_group > 0 ) as ticc - GROUP BY nb_add_group"; + GROUP BY ticc.nb_add_group"; - $result = $DB->query($query); + $result = $DB->query($query); - $datas['datas'] = []; - while ($ticket = $DB->fetchAssoc($result)) { - $datas['labels2'][$ticket['nb_add_group']] = $ticket['nb_add_group']; - $datas['datas'][__("Number of tickets")][$ticket['nb_add_group']] = $ticket['nb_ticket']; - } + $datas['datas'] = []; + while ($ticket = $DB->fetchAssoc($result)) { + $datas['labels2'][$ticket['nb_add_group']] = $ticket['nb_add_group']; + $datas['datas'][__("Number of tickets")][$ticket['nb_add_group']] = $ticket['nb_ticket']; + } - return $datas; - } + return $datas; + } - function reportLineActiontimeVsSolvedelay($config = []) { - global $DB; + public function reportLineActiontimeVsSolvedelay($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportLineActiontimeVsSolvedelay'] = + $_SESSION['mreporting_selector']['reportLineActiontimeVsSolvedelay'] = ['dateinterval', 'period', 'multiplegrouprequest', - 'userassign', 'category', 'multiplegroupassign']; + 'userassign', 'category', 'multiplegroupassign' + ]; - $query = "SELECT + $query = "SELECT DATE_FORMAT(glpi_tickets.date, '{$this->period_sort}') as period, DATE_FORMAT(glpi_tickets.date, '{$this->period_label}') as period_name, ROUND(AVG(actiontime_vs_solvedelay.time_percent), 1) as time_percent @@ -610,56 +657,55 @@ function reportLineActiontimeVsSolvedelay($config = []) { WHERE {$this->sql_date_create} GROUP BY period ORDER BY period"; - $data = []; - foreach ($DB->request($query) as $result) { - $data['datas'][$result['period_name']] = floatval($result['time_percent']); - $data['labels2'][$result['period_name']] = $result['period_name']; - } - - return $data; - } + $data = []; + foreach ($DB->request($query) as $result) { + $data['datas'][$result['period_name']] = floatval($result['time_percent']); + $data['labels2'][$result['period_name']] = $result['period_name']; + } + return $data; + } - function reportGlineNbTicketBySla($config = []) { - global $DB; + public function reportGlineNbTicketBySla($config = []) + { + global $DB; - $area = false; - $datas = []; + $area = false; + $datas = []; - $_SESSION['mreporting_selector']['reportGlineNbTicketBySla'] + $_SESSION['mreporting_selector']['reportGlineNbTicketBySla'] = ['dateinterval', 'period', 'allSlasWithTicket']; - if (isset($_SESSION['mreporting_values']['slas']) - && !empty($_SESSION['mreporting_values']['slas'])) { - //get dates used in this period - $query_date = "SELECT DISTINCT DATE_FORMAT(`glpi_tickets`.`date`, '{$this->period_sort}') AS period, + if ( + isset($_SESSION['mreporting_values']['slas']) + && !empty($_SESSION['mreporting_values']['slas']) + ) { + //get dates used in this period + $query_date = "SELECT DISTINCT DATE_FORMAT(`glpi_tickets`.`date`, '{$this->period_sort}') AS period, DATE_FORMAT(`glpi_tickets`.`date`, '{$this->period_label}') AS period_name FROM `glpi_tickets` INNER JOIN `glpi_slas` ON `glpi_tickets`.slas_id_ttr = `glpi_slas`.id WHERE {$this->sql_date_create} - AND `glpi_tickets`.status IN (" . implode( - ',', - array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray()) - ) . ") + AND `glpi_tickets`.status IN (" . implode(',', array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray())) . ") AND `glpi_tickets`.`entities_id` IN (" . $this->where_entities . ") AND `glpi_tickets`.`is_deleted` = '0' - AND `glpi_slas`.id IN (".implode(',', $_SESSION['mreporting_values']['slas']).") + AND `glpi_slas`.id IN (" . implode(',', $_SESSION['mreporting_values']['slas']) . ") ORDER BY `glpi_tickets`.`date` ASC"; - $res_date = $DB->query($query_date); + $res_date = $DB->query($query_date); - $dates = []; - while ($data = $DB->fetchAssoc($res_date)) { - $dates[$data['period']] = $data['period']; - } + $dates = []; + while ($data = $DB->fetchAssoc($res_date)) { + $dates[$data['period']] = $data['period']; + } - $tmp_date = []; - foreach (array_values($dates) as $id) { - $tmp_date[] = $id; - } + $tmp_date = []; + foreach (array_values($dates) as $id) { + $tmp_date[] = $id; + } - $query = "SELECT DISTINCT + $query = "SELECT DISTINCT DATE_FORMAT(`glpi_tickets`.`date`, '{$this->period_sort}') AS period, DATE_FORMAT(`glpi_tickets`.`date`, '{$this->period_label}') AS period_name, count(`glpi_tickets`.id) AS nb, @@ -669,62 +715,60 @@ function reportGlineNbTicketBySla($config = []) { INNER JOIN `glpi_slas` ON `glpi_tickets`.slas_id_ttr = `glpi_slas`.id WHERE {$this->sql_date_create} - AND `glpi_tickets`.status IN (" . implode( - ',', - array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray()) - ) . ") + AND `glpi_tickets`.status IN (" . implode(',', array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray())) . ") AND `glpi_tickets`.entities_id IN (" . $this->where_entities . ") AND `glpi_tickets`.is_deleted = '0'"; - if (isset($_SESSION['mreporting_values']['slas'])) { - $query .= " AND `glpi_slas`.id IN (".implode(',', $_SESSION['mreporting_values']['slas']).") "; - } - $query .= "GROUP BY `glpi_slas`.name, period, respected_sla"; - - $result = $DB->query($query); - while ($data = $DB->fetchAssoc($result)) { - $datas['labels2'][$data['period']] = $data['period_name']; - if ($data['respected_sla'] == 'ok') { - $value = $this->lcl_slaok; - } else { - $value = $this->lcl_slako; + if (isset($_SESSION['mreporting_values']['slas'])) { + $query .= " AND `glpi_slas`.id IN (" . implode(',', $_SESSION['mreporting_values']['slas']) . ") "; + } + $query .= "GROUP BY `glpi_slas`.name, period, respected_sla"; + + $result = $DB->query($query); + while ($data = $DB->fetchAssoc($result)) { + $datas['labels2'][$data['period']] = $data['period_name']; + if ($data['respected_sla'] == 'ok') { + $value = $this->lcl_slaok; + } else { + $value = $this->lcl_slako; + } + $datas['datas'][$data['name'] . ' ' . $value][$data['period']] = $data['nb']; } - $datas['datas'][$data['name'] . ' ' . $value][$data['period']] = $data['nb']; - } - if (isset($datas['datas'])) { - foreach ($datas['datas'] as &$data) { - $data = $data + array_fill_keys($tmp_date, 0); + if (isset($datas['datas'])) { + foreach ($datas['datas'] as &$data) { + $data = $data + array_fill_keys($tmp_date, 0); + } } - } - } + } - return $datas; - } + return $datas; + } - public function reportHgbarRespectedSlasByTopCategory($config = []) { - global $DB; + public function reportHgbarRespectedSlasByTopCategory($config = []) + { + global $DB; - $area = false; + $area = false; - $_SESSION['mreporting_selector']['reportHgbarRespectedSlasByTopCategory'] + $_SESSION['mreporting_selector']['reportHgbarRespectedSlasByTopCategory'] = ['dateinterval', 'limit', 'categories']; - $datas = []; - $categories = []; + $datas = []; + $categories = []; - if (isset($_POST['categories']) && $_POST['categories'] > 0) { - $category = $_POST['categories']; - } else { - $category = false; - } + if (isset($_POST['categories']) && $_POST['categories'] > 0) { + $category = $_POST['categories']; + } else { + $category = false; + } - $category_limit = isset($_POST['glpilist_limit']) ? $_POST['glpilist_limit'] : 10; + $category_limit = isset($_POST['glpilist_limit']) ? $_POST['glpilist_limit'] : 10; - $_SESSION['glpilist_limit'] = $category_limit; + $_SESSION['glpilist_limit'] = $category_limit; - if (!$category) { - $query_categories = "SELECT + if (!$category) { + $query_categories = "SELECT count(`glpi_tickets`.id) as nb, `glpi_itilcategories`.id FROM `glpi_tickets` @@ -739,13 +783,13 @@ public function reportHgbarRespectedSlasByTopCategory($config = []) { ORDER BY nb DESC LIMIT " . $category_limit; - $result_categories = $DB->query($query_categories); - while ($data = $DB->fetchAssoc($result_categories)) { - $categories[] = $data['id']; - } - } + $result_categories = $DB->query($query_categories); + while ($data = $DB->fetchAssoc($result_categories)) { + $categories[] = $data['id']; + } + } - $query = "SELECT COUNT(`glpi_tickets`.id) as nb, + $query = "SELECT COUNT(`glpi_tickets`.id) as nb, {$this->sql_select_sla}, `glpi_itilcategories`.id, `glpi_itilcategories`.name @@ -757,41 +801,43 @@ public function reportHgbarRespectedSlasByTopCategory($config = []) { WHERE " . $this->sql_date_create . " AND `glpi_tickets`.entities_id IN (" . $this->where_entities . ") AND `glpi_tickets`.is_deleted = '0'"; - if ($category) { - $query .= " AND `glpi_itilcategories`.id = " . $category; - } else if (!empty($categories)) { - $query .= " AND `glpi_itilcategories`.id IN (" . implode(',', $categories) . ")"; - } + if ($category) { + $query .= " AND `glpi_itilcategories`.id = " . $category; + } else if (!empty($categories)) { + $query .= " AND `glpi_itilcategories`.id IN (" . implode(',', $categories) . ")"; + } $query .= " GROUP BY respected_sla, `glpi_itilcategories`.id ORDER BY nb DESC"; - $result = $DB->query($query); - while ($data = $DB->fetchAssoc($result)) { - $value = ($data['respected_sla'] == 'ok') ? $this->lcl_slaok + $result = $DB->query($query); + while ($data = $DB->fetchAssoc($result)) { + $value = ($data['respected_sla'] == 'ok') ? $this->lcl_slaok : $this->lcl_slako; - $datas['datas'][$data['name']][$value] = $data['nb']; - } - $datas['labels2'] = [$this->lcl_slaok => $this->lcl_slaok, - $this->lcl_slako => $this->lcl_slako]; + $datas['datas'][$data['name']][$value] = $data['nb']; + } + $datas['labels2'] = [$this->lcl_slaok => $this->lcl_slaok, + $this->lcl_slako => $this->lcl_slako + ]; - if (isset($datas['datas'])) { - foreach ($datas['datas'] as &$data) { - $data = $data + array_fill_keys($datas['labels2'], 0); - } - } + if (isset($datas['datas'])) { + foreach ($datas['datas'] as &$data) { + $data = $data + array_fill_keys($datas['labels2'], 0); + } + } - return $datas; - } + return $datas; + } - public function reportHgbarRespectedSlasByTechnician($config = []) { - global $DB; + public function reportHgbarRespectedSlasByTechnician($config = []) + { + global $DB; - $area = false; - $datas = []; + $area = false; + $datas = []; - $_SESSION['mreporting_selector']['reportHgbarRespectedSlasByTechnician'] = ['dateinterval']; + $_SESSION['mreporting_selector']['reportHgbarRespectedSlasByTechnician'] = ['dateinterval']; - $query = "SELECT + $query = "SELECT CONCAT(`glpi_users`.firstname, ' ', `glpi_users`.realname) as fullname, `glpi_users`.id, COUNT(`glpi_tickets`.id) as nb, @@ -810,258 +856,233 @@ public function reportHgbarRespectedSlasByTechnician($config = []) { GROUP BY respected_sla, `glpi_users`.id ORDER BY nb DESC"; - $result = $DB->query($query); - while ($data = $DB->fetchAssoc($result)) { - if ($data['respected_sla'] == 'ok') { - $value = $this->lcl_slaok; - } else { - $value = $this->lcl_slako; - } - $datas['datas'][$data['fullname']][$value] = $data['nb']; - } - $datas['labels2'] = [$this->lcl_slaok => $this->lcl_slaok, - $this->lcl_slako => $this->lcl_slako]; - - if (isset($datas['datas'])) { - foreach ($datas['datas'] as &$data) { - $data = $data + array_fill_keys($datas['labels2'], 0); - } - } - - return $datas; - } - - function fillStatusMissingValues($tab, $labels2 = []) { - $datas = []; - foreach ($tab as $name => $data) { - foreach ($this->status as $current_status) { - if (!isset($_SESSION['mreporting_values']['status_'.$current_status]) - || ($_SESSION['mreporting_values']['status_'.$current_status] == '1')) { - - $status_name = Ticket::getStatus($current_status); - if (isset($data[$status_name])) { - $datas['datas'][$status_name][] = $data[$status_name]; - } else { - $datas['datas'][$status_name][] = 0; - } + $result = $DB->query($query); + while ($data = $DB->fetchAssoc($result)) { + if ($data['respected_sla'] == 'ok') { + $value = $this->lcl_slaok; + } else { + $value = $this->lcl_slako; + } + $datas['datas'][$data['fullname']][$value] = $data['nb']; + } + $datas['labels2'] = [$this->lcl_slaok => $this->lcl_slaok, + $this->lcl_slako => $this->lcl_slako + ]; + + if (isset($datas['datas'])) { + foreach ($datas['datas'] as &$data) { + $data = $data + array_fill_keys($datas['labels2'], 0); } - } - if (empty($labels2)) { - $datas['labels2'][] = $name; - } else { - $datas['labels2'][] = $labels2[$name]; - } - } - return $datas; - } - - static function selectorBacklogstates() { - global $LANG; - - echo "
".$LANG['plugin_mreporting']['Helpdeskplus']['backlogstatus']." :
"; - - // Opened - echo ''; - echo "
"; + echo "
"; - // Backlog - echo ''; - - // Closed - echo ''; + + // Closed + echo ''; - } + echo ' /> '; + echo _x('status', 'Closed'); + echo ''; + } - function reportVstackbarRespectedSlasByGroup($config = []) { - global $DB, $LANG; + public function reportVstackbarRespectedSlasByGroup($config = []) + { + global $DB, $LANG; - $datas = []; + $datas = []; - $_SESSION['mreporting_selector']['reportVstackbarRespectedSlasByGroup'] + $_SESSION['mreporting_selector']['reportVstackbarRespectedSlasByGroup'] = ['dateinterval', 'allSlasWithTicket']; - $this->sql_date_create = PluginMreportingCommon::getSQLDate("`glpi_tickets`.date", - $config['delay'], - $config['randname']); - - if (isset($_SESSION['mreporting_values']['slas']) - && !empty($_SESSION['mreporting_values']['slas'])) { - - $query = "SELECT COUNT(`glpi_tickets`.id) AS nb, + $this->sql_date_create = PluginMreportingCommon::getSQLDate( + "`glpi_tickets`.date", + $config['delay'], + $config['randname'] + ); + + if ( + isset($_SESSION['mreporting_values']['slas']) + && !empty($_SESSION['mreporting_values']['slas']) + ) { + $query = "SELECT COUNT(`glpi_tickets`.id) AS nb, `glpi_groups_tickets`.groups_id as groups_id, `glpi_slas`.name, {$this->sql_select_sla} FROM `glpi_tickets` INNER JOIN `glpi_groups_tickets` ON `glpi_groups_tickets`.tickets_id = `glpi_tickets`.id - AND `glpi_groups_tickets`.type = ".CommonITILActor::ASSIGN." + AND `glpi_groups_tickets`.type = " . CommonITILActor::ASSIGN . " INNER JOIN `glpi_slas` ON `glpi_tickets`.slas_id_ttr = `glpi_slas`.id WHERE {$this->sql_date_create} - AND `glpi_tickets`.status IN (" . implode( - ',', - array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray()) - ) . ") + AND `glpi_tickets`.status IN (" . implode(',', array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray())) . ") AND `glpi_tickets`.entities_id IN ({$this->where_entities}) AND `glpi_tickets`.is_deleted = '0' - AND `glpi_slas`.id IN (".implode(',', $_SESSION['mreporting_values']['slas']).") + AND `glpi_slas`.id IN (" . implode(',', $_SESSION['mreporting_values']['slas']) . ") GROUP BY `glpi_groups_tickets`.groups_id, respected_sla;"; - $result = $DB->query($query); + $result = $DB->query($query); - while ($data = $DB->fetchAssoc($result)) { - $gp = new Group(); - $gp->getFromDB($data['groups_id']); + while ($data = $DB->fetchAssoc($result)) { + $gp = new Group(); + $gp->getFromDB($data['groups_id']); - $datas['labels2'][$gp->fields['name']] = $gp->fields['name']; + $datas['labels2'][$gp->fields['name']] = $gp->fields['name']; - if ($data['respected_sla'] == 'ok') { - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$gp->fields['name']] = $data['nb']; - } else { - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$gp->fields['name']] = $data['nb']; + if ($data['respected_sla'] == 'ok') { + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$gp->fields['name']] = $data['nb']; + } else { + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$gp->fields['name']] = $data['nb']; + } } - } - - // Ajout des '0' manquants : - $gp = new Group(); - $gp_found = $gp->find([], "name"); //Tri précose qui n'est pas utile - - foreach ($gp_found as $group) { - $group_name = $group['name']; - if (!isset($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$group_name])) { - $datas['labels2'][$group_name] = $group_name; - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$group_name] = 0; - } - if (!isset($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$group_name])) { - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$group_name] = 0; + // Ajout des '0' manquants : + $gp = new Group(); + $gp_found = $gp->find([], "name"); //Tri précose qui n'est pas utile + + foreach ($gp_found as $group) { + $group_name = $group['name']; + if (!isset($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$group_name])) { + $datas['labels2'][$group_name] = $group_name; + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$group_name] = 0; + } + if (!isset($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$group_name])) { + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$group_name] = 0; + } } - } - - //Flip array to have observed SLA first - arsort($datas['datas']); - //Array alphabetic sort - //For PNG mode, it is important to sort by date on each item - ksort($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']]); - ksort($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']]); + //Flip array to have observed SLA first + arsort($datas['datas']); - //For SVG mode, labels2 sort is ok - asort($datas['labels2']); + //Array alphabetic sort + //For PNG mode, it is important to sort by date on each item + ksort($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']]); + ksort($datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']]); - $datas['unit'] = '%'; - } + //For SVG mode, labels2 sort is ok + asort($datas['labels2']); - return $datas; - } + $datas['unit'] = '%'; + } - function reportVstackbarNbTicketBySla($config = []) { - global $DB, $LANG; + return $datas; + } - $area = false; + public function reportVstackbarNbTicketBySla($config = []) + { + global $DB, $LANG; - $_SESSION['mreporting_selector']['reportVstackbarNbTicketBySla'] = ['dateinterval', 'allSlasWithTicket']; + $area = false; - $datas = []; - $tmp_datas = []; + $_SESSION['mreporting_selector']['reportVstackbarNbTicketBySla'] = ['dateinterval', 'allSlasWithTicket']; - $this->sql_date_create = PluginMreportingCommon::getSQLDate("`glpi_tickets`.date", - $config['delay'], - $config['randname']); + $datas = []; + $tmp_datas = []; - if (isset($_SESSION['mreporting_values']['slas']) - && !empty($_SESSION['mreporting_values']['slas'])) { + $this->sql_date_create = PluginMreportingCommon::getSQLDate( + "`glpi_tickets`.date", + $config['delay'], + $config['randname'] + ); - $query = "SELECT count(`glpi_tickets`.id) AS nb, `glpi_slas`.name, + if ( + isset($_SESSION['mreporting_values']['slas']) + && !empty($_SESSION['mreporting_values']['slas']) + ) { + $query = "SELECT count(`glpi_tickets`.id) AS nb, `glpi_slas`.name, {$this->sql_select_sla} FROM `glpi_tickets` INNER JOIN `glpi_slas` ON `glpi_tickets`.slas_id_ttr = `glpi_slas`.id WHERE {$this->sql_date_create} - AND `glpi_tickets`.status IN (" . implode(',', - array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray()) - ) . ") + AND `glpi_tickets`.status IN (" . implode(',', array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray())) . ") AND `glpi_tickets`.entities_id IN ({$this->where_entities}) AND `glpi_tickets`.is_deleted = '0' - AND `glpi_slas`.id IN (".implode(',', $_SESSION['mreporting_values']['slas']).") + AND `glpi_slas`.id IN (" . implode(',', $_SESSION['mreporting_values']['slas']) . ") GROUP BY `glpi_slas`.name, respected_sla;"; - $result = $DB->query($query); - while ($data = $DB->fetchAssoc($result)) { - $tmp_datas[$data['name']][$data['respected_sla']] = $data['nb']; - } - - foreach ($tmp_datas as $key => $value) { - $datas['labels2'][$key] = $key; - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$key] - = !empty($value['ok']) ? $value['ok'] : 0; - $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$key] - = !empty($value['nok']) ? $value['nok'] : 0; - } - } - - return $datas; - } - - - private function _getPeriod() { - if (isset($_REQUEST['period']) && !empty($_REQUEST['period'])) { - switch ($_REQUEST['period']) { - case 'day': - $this->_period_sort = '%y%m%d'; - $this->_period_label = '%d %b %Y'; - break; - case 'week': - $this->_period_sort = '%y%u'; - $this->_period_label = 'S-%u %Y'; - break; - case 'month': - $this->_period_sort = '%y%m'; - $this->_period_label = '%b %Y'; - break; - case 'year': - $this->_period_sort = '%Y'; - $this->_period_label = '%Y'; - break; - default : - $this->_period_sort = '%y%m'; - $this->_period_label = '%b %Y'; - break; - } - } else { - $this->_period_sort = '%y%m'; - $this->_period_label = '%b %Y'; - } - } + $result = $DB->query($query); + while ($data = $DB->fetchAssoc($result)) { + $tmp_datas[$data['name']][$data['respected_sla']] = $data['nb']; + } + + foreach ($tmp_datas as $key => $value) { + $datas['labels2'][$key] = $key; + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slaobserved']][$key] + = !empty($value['ok']) ? $value['ok'] : 0; + $datas['datas'][$LANG['plugin_mreporting']['Helpdeskplus']['slanotobserved']][$key] + = !empty($value['nok']) ? $value['nok'] : 0; + } + } + + return $datas; + } } diff --git a/inc/inventory.class.php b/inc/inventory.class.php index 3bdd34d9..1d1e2941 100644 --- a/inc/inventory.class.php +++ b/inc/inventory.class.php @@ -1,110 +1,120 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingInventory Extends PluginMreportingBaseclass { +class PluginMreportingInventory extends PluginMreportingBaseclass +{ /* ==== SPECIFIC SELECTORS FOR INVENTORY ==== */ - static function selectorMultipleStates() { - self::selectorForMultipleStates('states_id', [], _sx("item", "State")); - } - - static function selectorForMultipleStates($field, $condition = [], $label = '') { - global $DB; - - $selected_states = []; - if (isset($_SESSION['mreporting_values'][$field])) { - $selected_states = $_SESSION['mreporting_values'][$field]; - } else { - $selected_states = self::getDefaultState(); - } - $datas = []; - foreach (getAllDataFromTable('glpi_states', $condition) as $data) { - $datas[$data['id']] = $data['completename']; - } - - $param = ['multiple' => true, - 'display' => true, - 'size' => count($selected_states), - 'values' => $selected_states]; - - echo "
".$label." :
"; - Dropdown::showFromArray($field, $datas, $param); - } - - static function getDefaultState() { - global $DB; - - $states = []; - $query = "SELECT `id`FROM `glpi_states` WHERE `name` IN ('En service')"; - foreach ($DB->request($query) as $data) { - $states[] = $data['id']; - } - return $states; - } - - static function getStateCondition($field, $as_array = false) { - $sql_states = ($as_array ? [] : ""); - if (isset($_SESSION['mreporting_values']['states_id'])) { - if (is_array($_SESSION['mreporting_values']['states_id'])) { - if ($as_array) { - $sql_states[$field] = $_SESSION['mreporting_values']['states_id']; - } else { - $sql_states = " AND $field IN (".implode(',', $_SESSION['mreporting_values']['states_id']).")"; - } - } else if ($_SESSION['mreporting_values']['states_id'] > 0) { - if ($as_array) { - $sql_states[$field] = $_SESSION['mreporting_values']['states_id']; - } else { - $sql_states = " AND $field = ".$_SESSION['mreporting_values']['states_id']; + public static function selectorMultipleStates() + { + self::selectorForMultipleStates('states_id', [], _sx("item", "State")); + } + + public static function selectorForMultipleStates($field, $condition = [], $label = '') + { + global $DB; + + $selected_states = []; + if (isset($_SESSION['mreporting_values'][$field])) { + $selected_states = $_SESSION['mreporting_values'][$field]; + } else { + $selected_states = self::getDefaultState(); + } + $datas = []; + foreach (getAllDataFromTable('glpi_states', $condition) as $data) { + $datas[$data['id']] = $data['completename']; + } + + $param = ['multiple' => true, + 'display' => true, + 'size' => count($selected_states), + 'values' => $selected_states + ]; + + echo "
" . $label . " :
"; + Dropdown::showFromArray($field, $datas, $param); + } + + public static function getDefaultState() + { + global $DB; + + $states = []; + $query = "SELECT `id`FROM `glpi_states` WHERE `name` IN ('En service')"; + foreach ($DB->request($query) as $data) { + $states[] = $data['id']; + } + return $states; + } + + public static function getStateCondition($field, $as_array = false) + { + $sql_states = ($as_array ? [] : ""); + if (isset($_SESSION['mreporting_values']['states_id'])) { + if (is_array($_SESSION['mreporting_values']['states_id'])) { + if ($as_array) { + $sql_states[$field] = $_SESSION['mreporting_values']['states_id']; + } else { + $sql_states = " AND $field IN (" . implode(',', $_SESSION['mreporting_values']['states_id']) . ")"; + } + } else if ($_SESSION['mreporting_values']['states_id'] > 0) { + if ($as_array) { + $sql_states[$field] = $_SESSION['mreporting_values']['states_id']; + } else { + $sql_states = " AND $field = " . $_SESSION['mreporting_values']['states_id']; + } } - } - } - return $sql_states; - } + } + return $sql_states; + } /* ==== MANUFACTURERS REPORTS ==== */ - function reportPieComputersByFabricant($config = []) { - $_SESSION['mreporting_selector']['reportPieComputersByFabricant'] = ['multiplestates']; - return $this->computersByFabricant($config); - } - - function reportHbarComputersByFabricant($config = []) { - $_SESSION['mreporting_selector']['reportHbarComputersByFabricant'] = ['multiplestates']; - return $this->computersByFabricant($config); - } - - function computersByFabricant($config = []) { - global $DB; - - $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; - $sql_states = self::getStateCondition('c.states_id'); - - $query = "SELECT m.`name` as Manufacturer, + public function reportPieComputersByFabricant($config = []) + { + $_SESSION['mreporting_selector']['reportPieComputersByFabricant'] = ['multiplestates']; + return $this->computersByFabricant($config); + } + + public function reportHbarComputersByFabricant($config = []) + { + $_SESSION['mreporting_selector']['reportHbarComputersByFabricant'] = ['multiplestates']; + return $this->computersByFabricant($config); + } + + public function computersByFabricant($config = []) + { + global $DB; + + $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; + $sql_states = self::getStateCondition('c.states_id'); + + $query = "SELECT m.`name` as Manufacturer, count(*) as Total, count(*) * 100 / (SELECT count(*) FROM glpi_computers as c, @@ -123,36 +133,39 @@ function computersByFabricant($config = []) { AND c.`is_template` = 0 GROUP BY m.`name` ORDER BY Total DESC"; - $result = $DB->query($query); + $result = $DB->query($query); - $datas = []; - while ($computer = $DB->fetchAssoc($result)) { - if ($computer['Total']) { - $percent = round($computer['Percent'], 2); - $datas['datas'][$computer['Manufacturer']." ($percent %)"] = $computer['Total']; - } - } + $datas = []; + while ($computer = $DB->fetchAssoc($result)) { + if ($computer['Total']) { + $percent = round($computer['Percent'], 2); + $datas['datas'][$computer['Manufacturer'] . " ($percent %)"] = $computer['Total']; + } + } - return $datas; - } + return $datas; + } /* ==== COMPUTER'S TYPE REPORTS ==== */ - function reportPieComputersByType($config = []) { - $_SESSION['mreporting_selector']['reportPieComputersByType'] = ['multiplestates']; - return $this->computersByType($config); - } - - function reportHbarComputersByType($config = []) { - $_SESSION['mreporting_selector']['reportHbarComputersByType'] = ['multiplestates']; - return $this->computersByType($config); - } - - function computersByType($config = []) { - global $DB; - - $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; - $sql_states = self::getStateCondition('c.states_id'); - $query = "SELECT t.`name` as Type, + public function reportPieComputersByType($config = []) + { + $_SESSION['mreporting_selector']['reportPieComputersByType'] = ['multiplestates']; + return $this->computersByType($config); + } + + public function reportHbarComputersByType($config = []) + { + $_SESSION['mreporting_selector']['reportHbarComputersByType'] = ['multiplestates']; + return $this->computersByType($config); + } + + public function computersByType($config = []) + { + global $DB; + + $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; + $sql_states = self::getStateCondition('c.states_id'); + $query = "SELECT t.`name` as Type, count(*) as Total, count(*) * 100 / (SELECT count(*) FROM glpi_computers as c, @@ -171,35 +184,38 @@ function computersByType($config = []) { AND c.`is_template` = 0 GROUP BY t.`name` ORDER BY Total DESC"; - $result = $DB->query($query); - $datas = []; - while ($computer = $DB->fetchAssoc($result)) { - $percent = round($computer['Percent'], 2); - $datas['datas'][$computer['Type']." ($percent %)"] = $computer['Total']; - } + $result = $DB->query($query); + $datas = []; + while ($computer = $DB->fetchAssoc($result)) { + $percent = round($computer['Percent'], 2); + $datas['datas'][$computer['Type'] . " ($percent %)"] = $computer['Total']; + } - return $datas; - } + return $datas; + } /* ==== COMPUTER'S AGE REPORTS ==== */ - function reportPieComputersByAge($config = []) { - $_SESSION['mreporting_selector']['reportPieComputersByAge'] = ['multiplestates']; - return $this->computersByAge($config); - } - - function reportHbarComputersByAge($config = []) { - $_SESSION['mreporting_selector']['reportHbarComputersByAge'] = ['multiplestates']; - return $this->computersByAge($config); - } - - function computersByAge($config = []) { - global $DB; - - $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; - $sql_states = self::getStateCondition('c.states_id'); - $datas = []; + public function reportPieComputersByAge($config = []) + { + $_SESSION['mreporting_selector']['reportPieComputersByAge'] = ['multiplestates']; + return $this->computersByAge($config); + } + + public function reportHbarComputersByAge($config = []) + { + $_SESSION['mreporting_selector']['reportHbarComputersByAge'] = ['multiplestates']; + return $this->computersByAge($config); + } + + public function computersByAge($config = []) + { + global $DB; + + $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; + $sql_states = self::getStateCondition('c.states_id'); + $datas = []; - $query = "SELECT '< 1 year' Age, count(*) Total, count(*) * 100 / (SELECT count(*) + $query = "SELECT '< 1 year' Age, count(*) Total, count(*) * 100 / (SELECT count(*) FROM glpi_computers as c, glpi_infocoms as i WHERE c.`id` = i.`items_id` @@ -291,50 +307,53 @@ function computersByAge($config = []) { AND i.`warranty_date` IS NULL $sql_entities $sql_states"; - $result = $DB->query($query); - - while ($computer = $DB->fetchAssoc($result)) { - $percent = round($computer['Percent'], 2); + $result = $DB->query($query); - $datas['datas'][__($computer['Age'], 'mreporting')." ($percent %)"] = $computer['Total']; - } + while ($computer = $DB->fetchAssoc($result)) { + $percent = round($computer['Percent'], 2); - return $datas; + $datas['datas'][__($computer['Age'], 'mreporting') . " ($percent %)"] = $computer['Total']; + } - } + return $datas; + } /* === OS REPORTS === */ - function reportPieComputersByOS($config = []) { - $_SESSION['mreporting_selector']['reportPieComputersByOS'] = ['multiplestates']; - return $this->computersByOS($config); - } - - function reportHbarComputersByOS($config = []) { - $_SESSION['mreporting_selector']['reportHbarComputersByOS'] = ['multiplestates']; - return $this->computersByOS($config); - } - - function computersByOS($config = []) { - global $DB; - - $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; - $sql_states = self::getStateCondition('c.states_id'); - $oses = ['Windows' => 'Windows', - 'Linux' => 'Linux|Ubuntu|openSUSE', - 'Solaris' => 'Solaris', - 'AIX' => 'AIX', - 'BSD' => 'BSD', - 'VMWare' => 'VMWare', - 'MAC' => 'MAC', - 'Android' => 'Android', - 'HP-UX' => 'HP-UX']; - $query = ""; - $first = true; - $notlike = ""; - foreach ($oses as $os => $search) { - $query.=(!$first?" UNION ":"") - ."\n SELECT '$os' AS OS, count(*) AS Total, count(*) * 100 / (SELECT count(*) + public function reportPieComputersByOS($config = []) + { + $_SESSION['mreporting_selector']['reportPieComputersByOS'] = ['multiplestates']; + return $this->computersByOS($config); + } + + public function reportHbarComputersByOS($config = []) + { + $_SESSION['mreporting_selector']['reportHbarComputersByOS'] = ['multiplestates']; + return $this->computersByOS($config); + } + + public function computersByOS($config = []) + { + global $DB; + + $sql_entities = " AND c.`entities_id` IN ({$this->where_entities})"; + $sql_states = self::getStateCondition('c.states_id'); + $oses = ['Windows' => 'Windows', + 'Linux' => 'Linux|Ubuntu|openSUSE', + 'Solaris' => 'Solaris', + 'AIX' => 'AIX', + 'BSD' => 'BSD', + 'VMWare' => 'VMWare', + 'MAC' => 'MAC', + 'Android' => 'Android', + 'HP-UX' => 'HP-UX' + ]; + $query = ""; + $first = true; + $notlike = ""; + foreach ($oses as $os => $search) { + $query .= (!$first ? " UNION " : "") + . "\n SELECT '$os' AS OS, count(*) AS Total, count(*) * 100 / (SELECT count(*) FROM glpi_computers as c, glpi_operatingsystems as os, glpi_items_operatingsystems as ios @@ -356,11 +375,11 @@ function computersByOS($config = []) { $sql_entities $sql_states"; - $notlike.= " AND os.`name` NOT REGEXP '$search'"; - $first = false; - } + $notlike .= " AND os.`name` NOT REGEXP '$search'"; + $first = false; + } $query .= " UNION - SELECT '".__("Others")."' AS OS, count(*) Total, count(*) * 100 / (SELECT count(*) + SELECT '" . __("Others") . "' AS OS, count(*) Total, count(*) * 100 / (SELECT count(*) FROM glpi_computers as c, glpi_operatingsystems as os, glpi_items_operatingsystems as ios @@ -382,343 +401,365 @@ function computersByOS($config = []) { $sql_entities $sql_states"; - $query.=" ORDER BY Total DESC"; + $query .= " ORDER BY Total DESC"; $result = $DB->query($query); $datas = []; - while ($computer = $DB->fetchAssoc($result)) { - $percent = round($computer['Percent'], 2); - if ($computer['Total']) { - $datas['datas'][$computer['OS']." ($percent %)"] = $computer['Total']; - } - } + while ($computer = $DB->fetchAssoc($result)) { + $percent = round($computer['Percent'], 2); + if ($computer['Total']) { + $datas['datas'][$computer['OS'] . " ($percent %)"] = $computer['Total']; + } + } return $datas; - } - - - function reportHbarWindows($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportHbarWindows'] = ['multiplestates']; - - $sql_states = self::getStateCondition('glpi_computers.states_id', true); - $total_computers = countElementsInTable( - 'glpi_computers', [ - 'is_deleted' => 0, - 'is_template' => 0, - 'entities_id' => $this->where_entities_array - ] - ); - - $list_windows = ['Windows 3.1', 'Windows 95', 'Windows 98', 'Windows 2000 Pro', - 'Windows XP', 'Windows 7', 'Windows Vista', 'Windows 8', 'Windows 10', - 'Windows 2000 Server', 'Server 2003', 'Server 2008', 'Server 2012']; - $data = []; - foreach ($list_windows as $windows) { - $oses = []; - $ositerator = $DB->request('glpi_operatingsystems', ['name' => ['LIKE', "%$windows%"]]); - while ($os = $ositerator->next()) { - $oses[] = $os['id']; - } - if (!empty($oses)) { - $number = countElementsInTable( - 'glpi_computers', [ - 'INNER JOIN' => [ - 'glpi_items_operatingsystems' => [ + } + + + public function reportHbarWindows($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportHbarWindows'] = ['multiplestates']; + + $sql_states = self::getStateCondition('glpi_computers.states_id', true); + $total_computers = countElementsInTable( + 'glpi_computers', + [ + 'is_deleted' => 0, + 'is_template' => 0, + 'entities_id' => $this->where_entities_array + ] + ); + + $oses = $DB->request( + [ + 'SELECT' => [ + 'glpi_operatingsystems' => 'name AS os_name', + 'glpi_operatingsystemversions' => 'name AS os_version', + ], + 'FROM' => 'glpi_items_operatingsystems', + 'COUNT' => 'os_qty', + 'INNER JOIN' => [ + 'glpi_computers' => [ + 'FKEY' => [ + 'glpi_items_operatingsystems' => 'items_id', + 'glpi_computers' => 'id' + ] + ], + 'glpi_operatingsystems' => [ + 'FKEY' => [ + 'glpi_operatingsystems' => 'id', + 'glpi_items_operatingsystems' => 'operatingsystems_id' + ] + ] + ], + 'LEFT JOIN' => [ + 'glpi_operatingsystemversions' => [ 'FKEY' => [ - 'glpi_computers' => 'id', - 'glpi_items_operatingsystems' => 'items_id' + 'glpi_operatingsystemversions' => 'id', + 'glpi_items_operatingsystems' => 'operatingsystemversions_id' + ] + ] + ], + 'WHERE' => [ + 'glpi_operatingsystems.name' => ['LIKE', '%windows%'], + 'glpi_items_operatingsystems.itemtype' => 'Computer', + 'glpi_computers.is_deleted' => 0, + 'glpi_computers.is_template' => 0, + 'glpi_computers.entities_id' => $this->where_entities_array, + ] + $sql_states, + 'GROUPBY' => ['os_name', 'os_version'], + 'ORDER' => ['os_name', 'os_version'] + ] + ); + $data = []; + foreach ($oses as $version) { + $key = $version['os_name'] . ' ' . $version['os_version'] . ' (' . round($version['os_qty'] / $total_computers * 100) . '%)'; + $data['datas'][$key] = $version['os_qty']; + } + if (isset($data['datas']) && !empty($data['datas'])) { + arsort($data['datas']); + } + return $data; + } + + public function reportHbarLinux($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportHbarLinux'] = ['multiplestates']; + $sql_states = self::getStateCondition('glpi_computers.states_id', true); + $sql_states2 = self::getStateCondition('c.states_id', true); + + $data = []; + foreach ($DB->request('glpi_operatingsystems', "name LIKE '%Linux%' OR name LIKE '%Ubuntu%' OR name LIKE '%openSUSE%'") as $os) { + $iterator = $DB->request( + 'glpi_computers', + [ + 'SELECT' => [ + 'glpi_operatingsystemversions.name' + ], + 'COUNT' => 'cpt', + 'INNER JOIN' => [ + 'glpi_items_operatingsystems' => [ + 'FKEY' => [ + 'glpi_computers' => 'id', + 'glpi_items_operatingsystems' => 'items_id' + ] ] - ] - ], - 'WHERE' => [ - 'glpi_items_operatingsystems.operatingsystems_id' => $oses, - 'glpi_items_operatingsystems.itemtype' => 'Computer', - 'glpi_computers.is_deleted' => 0, - 'glpi_computers.is_template' => 0, - 'glpi_computers.entities_id' => $this->where_entities_array - ] + $sql_states - ] + ], + 'LEFT JOIN' => [ + 'glpi_operatingsystemversions' => [ + 'FKEY' => [ + 'glpi_items_operatingsystems' => 'operatingsystemversions_id', + 'glpi_operatingsystemversions' => 'id' + ] + ] + ], + 'WHERE' => [ + 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], + 'glpi_items_operatingsystems.itemtype' => 'Computer', + 'glpi_computers.is_deleted' => 0, + 'glpi_computers.is_template' => 0, + 'glpi_computers.entities_id' => $this->where_entities_array, + ] + $sql_states + $sql_states2, + 'GROUPBY' => ['operatingsystemversions_id'], + 'ORDER' => ['glpi_operatingsystemversions.name'] + ] ); - $percent = round($number * 100 / $total_computers). " % du parc"; - if ($number) { - $data['datas'][$windows." ($percent)"] = $number; + foreach ($iterator as $version) { + if ($version['name'] != '' && $version['cpt']) { + $data['datas'][$os['name'] . " " . $version['name']] = $version['cpt']; + } } - } - } - if (isset($data['datas']) && !empty($data['datas'])) { - arsort($data['datas']); - } - return $data; - } - - function reportHbarLinux($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportHbarLinux'] = ['multiplestates']; - $sql_states = self::getStateCondition('glpi_computers.states_id', true); - $sql_states2 = self::getStateCondition('c.states_id', true); - - $data = []; - foreach ($DB->request('glpi_operatingsystems', "name LIKE '%Linux%' OR name LIKE '%Ubuntu%' OR name LIKE '%openSUSE%'") as $os) { - $iterator = $DB->request( - 'glpi_computers', [ - 'SELECT' => [ - 'glpi_operatingsystemversions.name' - ], - 'COUNT' => 'cpt', - 'INNER JOIN' => [ - 'glpi_items_operatingsystems' => [ - 'FKEY' => [ - 'glpi_computers' => 'id', - 'glpi_items_operatingsystems' => 'items_id' - ] - ] - ], - 'LEFT JOIN' => [ - 'glpi_operatingsystemversions' => [ - 'FKEY' => [ - 'glpi_items_operatingsystems' => 'operatingsystemversions_id', - 'glpi_operatingsystemversions' => 'id' - ] - ] - ], - 'WHERE' => [ - 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], - 'glpi_items_operatingsystems.itemtype' => 'Computer', - 'glpi_computers.is_deleted' => 0, - 'glpi_computers.is_template' => 0, - 'glpi_computers.entities_id' => $this->where_entities_array, - ] + $sql_states + $sql_states2, - 'GROUPBY' => ['operatingsystemversions_id'], - 'ORDER' => ['glpi_operatingsystemversions.name'] - ] - ); + } + if (isset($data['datas']) && !empty($data['datas'])) { + arsort($data['datas']); + } + return $data; + } + + public function reportHbarLinuxDistro($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportHbarLinuxDistro'] = ['multiplestates']; + $sql_states = self::getStateCondition('glpi_computers.states_id', true); + + $data = []; + foreach ($DB->request('glpi_operatingsystems', "name LIKE '%Linux%' OR name LIKE '%Ubuntu%' OR name LIKE '%openSUSE%'") as $os) { + $number = countElementsInTable( + 'glpi_computers', + [ + 'INNER JOIN' => [ + 'glpi_items_operatingsystems' => [ + 'FKEY' => [ + 'glpi_computers' => 'id', + 'glpi_items_operatingsystems' => 'items_id' + ] + ] + ], + 'WHERE' => [ + 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], + 'glpi_items_operatingsystems.itemtype' => 'Computer', + 'glpi_computers.is_deleted' => 0, + 'glpi_computers.is_template' => 0, + 'glpi_computers.entities_id' => $this->where_entities_array + ] + $sql_states + ] + ); - while ($version = $iterator->next()) { - if ($version['name'] != '' && $version['cpt']) { - $data['datas'][$os['name']. " ".$version['name']] = $version['cpt']; + if ($number) { + $data['datas'][$os['name']] = $number; } - } - } - if (isset($data['datas']) && !empty($data['datas'])) { - arsort($data['datas']); - } - return $data; - } - - function reportHbarLinuxDistro($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportHbarLinuxDistro'] = ['multiplestates']; - $sql_states = self::getStateCondition('glpi_computers.states_id', true); - - $data = []; - foreach ($DB->request('glpi_operatingsystems', "name LIKE '%Linux%' OR name LIKE '%Ubuntu%' OR name LIKE '%openSUSE%'") as $os) { - $number = countElementsInTable( - 'glpi_computers', [ - 'INNER JOIN' => [ - 'glpi_items_operatingsystems' => [ - 'FKEY' => [ - 'glpi_computers' => 'id', - 'glpi_items_operatingsystems' => 'items_id' - ] - ] - ], - 'WHERE' => [ - 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], - 'glpi_items_operatingsystems.itemtype' => 'Computer', - 'glpi_computers.is_deleted' => 0, - 'glpi_computers.is_template' => 0, - 'glpi_computers.entities_id' => $this->where_entities_array - ] + $sql_states - ] - ); - - if ($number) { - $data['datas'][$os['name']] = $number; - } - } - if (isset($data['datas']) && !empty($data['datas'])) { - arsort($data['datas']); - } - return $data; - } - - function reportHbarMac($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportHbarMac'] = ['multiplestates']; - $sql_states = self::getStateCondition('glpi_computers.states_id', true); - $sql_states2 = self::getStateCondition('c.states_id', true); - - $data = []; - $ositerator = $DB->request('glpi_operatingsystems', ['name' => ['LIKE', '%Mac OS%']]); - while ($os = $ositerator->next()) { - $iterator = $DB->request( - 'glpi_computers', [ - 'SELECT' => [ - 'glpi_operatingsystemversions.name' - ], - 'COUNT' => 'cpt', - 'INNER JOIN' => [ - 'glpi_items_operatingsystems' => [ - 'FKEY' => [ - 'glpi_computers' => 'id', - 'glpi_items_operatingsystems' => 'items_id' - ] - ] - ], - 'LEFT JOIN' => [ - 'glpi_operatingsystemversions' => [ - 'FKEY' => [ - 'glpi_items_operatingsystems' => 'operatingsystemversions_id', - 'glpi_operatingsystemversions' => 'id' - ] - ] - ], - 'WHERE' => [ - 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], - 'glpi_items_operatingsystems.itemtype' => 'Computer', - 'glpi_computers.is_deleted' => 0, - 'glpi_computers.is_template' => 0, - 'glpi_computers.entities_id' => $this->where_entities_array, - ] + $sql_states + $sql_states2, - 'GROUPBY' => ['operatingsystemversions_id'], - 'ORDER' => ['glpi_operatingsystemversions.name'] - ] - ); + } + if (isset($data['datas']) && !empty($data['datas'])) { + arsort($data['datas']); + } + return $data; + } + + public function reportHbarMac($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportHbarMac'] = ['multiplestates']; + $sql_states = self::getStateCondition('glpi_computers.states_id', true); + $sql_states2 = self::getStateCondition('c.states_id', true); + + $data = []; + $ositerator = $DB->request('glpi_operatingsystems', ['name' => ['LIKE', '%Mac OS%']]); + foreach ($ositerator as $os) { + $iterator = $DB->request( + 'glpi_computers', + [ + 'SELECT' => [ + 'glpi_operatingsystemversions.name' + ], + 'COUNT' => 'cpt', + 'INNER JOIN' => [ + 'glpi_items_operatingsystems' => [ + 'FKEY' => [ + 'glpi_computers' => 'id', + 'glpi_items_operatingsystems' => 'items_id' + ] + ] + ], + 'LEFT JOIN' => [ + 'glpi_operatingsystemversions' => [ + 'FKEY' => [ + 'glpi_items_operatingsystems' => 'operatingsystemversions_id', + 'glpi_operatingsystemversions' => 'id' + ] + ] + ], + 'WHERE' => [ + 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], + 'glpi_items_operatingsystems.itemtype' => 'Computer', + 'glpi_computers.is_deleted' => 0, + 'glpi_computers.is_template' => 0, + 'glpi_computers.entities_id' => $this->where_entities_array, + ] + $sql_states + $sql_states2, + 'GROUPBY' => ['operatingsystemversions_id'], + 'ORDER' => ['glpi_operatingsystemversions.name'] + ] + ); - while ($version = $iterator->next()) { - if ($version['name'] != '' && $version['cpt']) { - $data['datas'][$os['name']. " ".$version['name']] = $version['cpt']; + foreach ($iterator as $version) { + if ($version['name'] != '' && $version['cpt']) { + $data['datas'][$os['name'] . " " . $version['name']] = $version['cpt']; + } } - } - } - return $data; - } - - function reportHbarMacFamily($config = []) { - global $DB; - - $_SESSION['mreporting_selector']['reportHbarMacFamily'] = ['multiplestates']; - $sql_states = self::getStateCondition('glpi_computers.states_id', true); - $sql_states2 = self::getStateCondition('c.states_id', true); - - $data = []; - $ositerator = $DB->request('glpi_operatingsystems', ['name' => ['LIKE', '%Mac OS%']]); - while ($os = $ositerator->next()) { - $iterator = $DB->request( - 'glpi_computers', [ - 'SELECT' => [ - 'glpi_operatingsystemversions.name' - ], - 'COUNT' => 'cpt', - 'INNER JOIN' => [ - 'glpi_items_operatingsystems' => [ - 'FKEY' => [ - 'glpi_computers' => 'id', - 'glpi_items_operatingsystems' => 'items_id' - ] - ] - ], - 'LEFT JOIN' => [ - 'glpi_operatingsystemversions' => [ - 'FKEY' => [ - 'glpi_items_operatingsystems' => 'operatingsystemversions_id', - 'glpi_operatingsystemversions' => 'id' - ] - ] - ], - 'WHERE' => [ - 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], - 'glpi_items_operatingsystems.itemtype' => 'Computer', - 'glpi_computers.is_deleted' => 0, - 'glpi_computers.is_template' => 0, - 'glpi_computers.entities_id' => $this->where_entities_array, - ] + $sql_states + $sql_states2, - 'GROUPBY' => ['operatingsystemversions_id'], - 'ORDER' => ['glpi_operatingsystemversions.name'] - ] - ); - - while ($version = $iterator->next()) { - if ($version['name'] != '' && $version['cpt']) { - if (preg_match("/(10.[0-9]+)/", $version['name'], $results)) { - if (!isset($data['datas'][$os['name']. " ".$results[1]])) { - $data['datas'][$os['name']. " ".$results[1]] = $version['cpt']; - } else { - $data['datas'][$os['name']. " ".$results[1]] += $version['cpt']; - } - } + } + return $data; + } + + public function reportHbarMacFamily($config = []) + { + global $DB; + + $_SESSION['mreporting_selector']['reportHbarMacFamily'] = ['multiplestates']; + $sql_states = self::getStateCondition('glpi_computers.states_id', true); + $sql_states2 = self::getStateCondition('c.states_id', true); + + $data = []; + $ositerator = $DB->request('glpi_operatingsystems', ['name' => ['LIKE', '%Mac OS%']]); + foreach ($ositerator as $os) { + $iterator = $DB->request( + 'glpi_computers', + [ + 'SELECT' => [ + 'glpi_operatingsystemversions.name' + ], + 'COUNT' => 'cpt', + 'INNER JOIN' => [ + 'glpi_items_operatingsystems' => [ + 'FKEY' => [ + 'glpi_computers' => 'id', + 'glpi_items_operatingsystems' => 'items_id' + ] + ] + ], + 'LEFT JOIN' => [ + 'glpi_operatingsystemversions' => [ + 'FKEY' => [ + 'glpi_items_operatingsystems' => 'operatingsystemversions_id', + 'glpi_operatingsystemversions' => 'id' + ] + ] + ], + 'WHERE' => [ + 'glpi_items_operatingsystems.operatingsystems_id' => $os['id'], + 'glpi_items_operatingsystems.itemtype' => 'Computer', + 'glpi_computers.is_deleted' => 0, + 'glpi_computers.is_template' => 0, + 'glpi_computers.entities_id' => $this->where_entities_array, + ] + $sql_states + $sql_states2, + 'GROUPBY' => ['operatingsystemversions_id'], + 'ORDER' => ['glpi_operatingsystemversions.name'] + ] + ); + + foreach ($iterator as $version) { + if ($version['name'] != '' && $version['cpt']) { + if (preg_match("/(10.[0-9]+)/", $version['name'], $results)) { + if (!isset($data['datas'][$os['name'] . " " . $results[1]])) { + $data['datas'][$os['name'] . " " . $results[1]] = $version['cpt']; + } else { + $data['datas'][$os['name'] . " " . $results[1]] += $version['cpt']; + } + } + } } - } - } - if (isset($data['datas']) && count($data['datas'])) { - arsort($data['datas']); - } - return $data; - } + } + if (isset($data['datas']) && count($data['datas'])) { + arsort($data['datas']); + } + return $data; + } /* ==== FUSIONINVENTORY REPORTS ==== */ - function reportPieFusionInventory($config = []) { - $_SESSION['mreporting_selector']['reportPieFusionInventory'] = ['multiplestates']; - return $this->fusionInventory($config); - } - - function reportHbarFusionInventory($config = []) { - $_SESSION['mreporting_selector']['reportHbarFusionInventory'] = ['multiplestates']; - return $this->fusionInventory($config); - } - - function fusionInventory($config = []) { - global $DB; - - $plugin = new Plugin(); - if (!$plugin->isActivated('fusioninventory')) { - return []; - } - $sql_states = self::getStateCondition('glpi_computers.states_id', true); - $total_computers = countElementsInTable( - 'glpi_computers', - [ - 'is_deleted' => 0, - 'is_template' => 0, - 'entities_id' => $this->where_entities_array, - ] + $sql_states - ); - - $query = "SELECT count(*) AS cpt, `useragent` + public function reportPieFusionInventory($config = []) + { + $_SESSION['mreporting_selector']['reportPieFusionInventory'] = ['multiplestates']; + return $this->fusionInventory($config); + } + + public function reportHbarFusionInventory($config = []) + { + $_SESSION['mreporting_selector']['reportHbarFusionInventory'] = ['multiplestates']; + return $this->fusionInventory($config); + } + + public function fusionInventory($config = []) + { + global $DB; + + $plugin = new Plugin(); + if (!$plugin->isActivated('fusioninventory')) { + return []; + } + $sql_states = self::getStateCondition('glpi_computers.states_id', true); + $total_computers = countElementsInTable( + 'glpi_computers', + [ + 'is_deleted' => 0, + 'is_template' => 0, + 'entities_id' => $this->where_entities_array, + ] + $sql_states + ); + + $query = "SELECT count(*) AS cpt, `useragent` FROM `glpi_plugin_fusioninventory_agents` WHERE `computers_id` > 0 GROUP BY `useragent` ORDER BY cpt DESC"; - $data = []; - foreach ($DB->request($query) as $agent) { - $values = []; - if (preg_match('/FusionInventory-Agent_v(.*)/i', $agent['useragent'], $values)) { - $useragent = $values['1']; - } else { - $useragent = $agent['useragent']; - } - $data['datas'][$useragent] = $agent['cpt']; - - } - return $data; - } + $data = []; + foreach ($DB->request($query) as $agent) { + $values = []; + if (preg_match('/FusionInventory-Agent_v(.*)/i', $agent['useragent'], $values)) { + $useragent = $values['1']; + } else { + $useragent = $agent['useragent']; + } + $data['datas'][$useragent] = $agent['cpt']; + } + return $data; + } /* ==== MONITOR REPORST ==== */ - function reportHbarMonitors($config = []) { - global $DB; + public function reportHbarMonitors($config = []) + { + global $DB; - $_SESSION['mreporting_selector']['reportHbarMonitors'] = ['multiplestates']; - $sql_states = self::getStateCondition('c.`states_id`'); + $_SESSION['mreporting_selector']['reportHbarMonitors'] = ['multiplestates']; + $sql_states = self::getStateCondition('c.`states_id`'); - $query = "SELECT COUNT(*) AS cpt + $query = "SELECT COUNT(*) AS cpt FROM `glpi_computers_items` AS ci, `glpi_computers` AS c WHERE `ci`.`itemtype` = 'Monitor' @@ -729,23 +770,24 @@ function reportHbarMonitors($config = []) { $sql_states GROUP BY `ci`.`computers_id` ORDER BY `cpt`"; - $data = []; - foreach ($DB->request($query) as $result) { - $label = $result['cpt']." "._n('Monitor', 'Monitors', $result['cpt']); - if (!isset($data['datas'][$label])) { - $data['datas'][$label] = 0; - } - $data['datas'][$label] = $data['datas'][$label]+1; - } - - return $data; - } + $data = []; + foreach ($DB->request($query) as $result) { + $label = $result['cpt'] . " " . _n('Monitor', 'Monitors', $result['cpt']); + if (!isset($data['datas'][$label])) { + $data['datas'][$label] = 0; + } + $data['datas'][$label] = $data['datas'][$label] + 1; + } + + return $data; + } /* ==== COMPUTER'S STATE REPORTS ==== */ - function reportHbarComputersByStatus($config = []) { - global $DB; + public function reportHbarComputersByStatus($config = []) + { + global $DB; - $query = "SELECT t.`name` status, count(*) Total, count(*) * 100 / (SELECT count(*) + $query = "SELECT t.`name` status, count(*) Total, count(*) * 100 / (SELECT count(*) FROM glpi_computers as c, glpi_states as t WHERE c.`states_id` = t.`id` @@ -759,24 +801,25 @@ function reportHbarComputersByStatus($config = []) { AND c.`is_deleted` = 0 AND c.`is_template` = 0 GROUP BY t.`name`"; - $result = $DB->query($query); - $datas = []; - while ($computer = $DB->fetchAssoc($result)) { - $percent = round($computer['Percent'], 2); - $datas['datas'][$computer['status']." ($percent %)"] = $computer['Total']; - } + $result = $DB->query($query); + $datas = []; + while ($computer = $DB->fetchAssoc($result)) { + $percent = round($computer['Percent'], 2); + $datas['datas'][$computer['status'] . " ($percent %)"] = $computer['Total']; + } - return $datas; - } + return $datas; + } - function reportHbarPrintersByStatus($config = []) { - global $DB; + public function reportHbarPrintersByStatus($config = []) + { + global $DB; - $datas = []; + $datas = []; - $condition = " AND c.entities_id IN (".$this->where_entities.")"; + $condition = " AND c.entities_id IN (" . $this->where_entities . ")"; - $query = "SELECT t.name status, count(*) Total, count(*)*100/( + $query = "SELECT t.name status, count(*) Total, count(*)*100/( SELECT count(*) FROM glpi_printers c, glpi_states t WHERE c.`is_deleted`=0 AND c.`is_template`=0 @@ -784,49 +827,49 @@ function reportHbarPrintersByStatus($config = []) { FROM glpi_printers c, glpi_states t WHERE c.states_id = t.id $condition AND c.`is_deleted`=0 AND c.`is_template`=0 GROUP BY t.name"; - $result = $DB->query($query); - - while ($printer = $DB->fetchAssoc($result)) { - $pourcentage = round($printer['Pourcentage'], 2); - $datas['datas'][$printer['status']." ($pourcentage %)"] = $printer['Total']; - } + $result = $DB->query($query); - return $datas; + while ($printer = $DB->fetchAssoc($result)) { + $pourcentage = round($printer['Pourcentage'], 2); + $datas['datas'][$printer['status'] . " ($pourcentage %)"] = $printer['Total']; + } - } + return $datas; + } /* ==== COMPUTER'S ENTITIES REPORTS ==== */ - function reportHbarComputersByEntity($config = []) { - global $DB, $CFG_GLPI; + public function reportHbarComputersByEntity($config = []) + { + global $DB, $CFG_GLPI; - $_SESSION['mreporting_selector']['reportHbarComputersByEntity'] = ['multiplestates', - 'entityLevel']; + $_SESSION['mreporting_selector']['reportHbarComputersByEntity'] = ['multiplestates', + 'entityLevel' + ]; - $this->where_entities_level = PluginMreportingCommon::getSQLEntityLevel("`glpi_entities`.`level`"); + $this->where_entities_level = PluginMreportingCommon::getSQLEntityLevel("`glpi_entities`.`level`"); - $datas = []; + $datas = []; - $entity = new Entity(); - $entity->getFromDB($_SESSION['glpiactive_entity']); - $entities_first_level = [$_SESSION['glpiactive_entity'] => $entity->getName()]; + $entity = new Entity(); + $entity->getFromDB($_SESSION['glpiactive_entity']); + $entities_first_level = [$_SESSION['glpiactive_entity'] => $entity->getName()]; - $query = "SELECT `id`, `name` + $query = "SELECT `id`, `name` FROM `glpi_entities` - WHERE `entities_id` = '".$_SESSION['glpiactive_entity']."' - AND {$this->where_entities_level} + WHERE {$this->where_entities_level} ORDER BY `name`"; - $result = $DB->query($query); + $result = $DB->query($query); - while ($data = $DB->fetchAssoc($result)) { - $entities_first_level[$data['id']] = $data['name']; - } + while ($data = $DB->fetchAssoc($result)) { + $entities_first_level[$data['id']] = $data['name']; + } $entities = []; - foreach ($entities_first_level as $entities_id=>$entities_name) { - if ($entities_id == $_SESSION['glpiactive_entity']) { - $restrict = " = '".$entities_id."'"; - } else { - $restrict = "IN (".implode(',', getSonsOf('glpi_entities', $entities_id)).")"; - } + foreach ($entities_first_level as $entities_id => $entities_name) { + if ($entities_id == $_SESSION['glpiactive_entity']) { + $restrict = " = '" . $entities_id . "'"; + } else { + $restrict = "IN (" . implode(',', getSonsOf('glpi_entities', $entities_id)) . ")"; + } $query = "SELECT count(*) Total FROM `glpi_computers` WHERE `entities_id` " . $restrict . " @@ -834,29 +877,29 @@ function reportHbarComputersByEntity($config = []) { AND `is_template` = 0"; $result = $DB->query($query); - while ($computer = $DB->fetchAssoc($result)) { - $datas['tmp'][$entities_name." (pourcentage %)"] = $computer['Total']; - $entities[$entities_name." (pourcentage %)"] = $entities_id; - } - } + while ($computer = $DB->fetchAssoc($result)) { + $datas['tmp'][$entities_name . " (pourcentage %)"] = $computer['Total']; + $entities[$entities_name . " (pourcentage %)"] = $entities_id; + } + } $total = array_sum($datas['tmp']); - foreach ($datas['tmp'] as $key=>$value) { - if ($value == 0) { - $percent = 0; - } else { - $percent = round((100 * $value) / $total); - } - $ent_id = $entities[$key]; - $key = str_replace('pourcentage', $percent, $key); - $datas['datas'][$key] = $value; - $type = 'under'; - if ($ent_id == $_SESSION['glpiactive_entity']) { - $type = 'equals'; - } - $datas['links'][$key] = $CFG_GLPI["root_doc"].'/front/computer.php?is_deleted=0&criteria[0][field]=80&criteria[0][searchtype]='.$type.'&criteria[0][value]='.$ent_id.'&itemtype=Computer&start=0'; - } + foreach ($datas['tmp'] as $key => $value) { + if ($value == 0) { + $percent = 0; + } else { + $percent = round((100 * $value) / $total); + } + $ent_id = $entities[$key]; + $key = str_replace('pourcentage', $percent, $key); + $datas['datas'][$key] = $value; + $type = 'under'; + if ($ent_id == $_SESSION['glpiactive_entity']) { + $type = 'equals'; + } + $datas['links'][$key] = $CFG_GLPI["root_doc"] . '/front/computer.php?is_deleted=0&criteria[0][field]=80&criteria[0][searchtype]=' . $type . '&criteria[0][value]=' . $ent_id . '&itemtype=Computer&start=0'; + } unset($datas['tmp']); return $datas; - } + } } diff --git a/inc/notification.class.php b/inc/notification.class.php index 72d96ef7..b1a198f8 100644 --- a/inc/notification.class.php +++ b/inc/notification.class.php @@ -1,11 +1,39 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +class PluginMreportingNotification extends CommonDBTM +{ /** * @var boolean activate the history for the plugin */ - public $dohistory = true; + public $dohistory = true; /** * Return the localized name of the current Type (PluginMreporting) @@ -14,106 +42,109 @@ class PluginMreportingNotification extends CommonDBTM { * @param string $nb * @return string name of the plugin */ - static function getTypeName($nb = 0) { - return __("More Reporting", 'mreporting'); - } + public static function getTypeName($nb = 0) + { + return __("More Reporting", 'mreporting'); + } /** * Install mreporting notifications. * * @return array 'success' => true on success */ - static function install($migration) { - global $DB; - - // Création du template de la notification - $template = new NotificationTemplate(); - $found_template = $template->find(['itemtype' => 'PluginMreportingNotification']); - if (empty($found_template)) { - $template_id = $template->add([ - 'name' => __('Notification for "More Reporting"', 'mreporting'), - 'comment' => "", - 'itemtype' => __CLASS__, - ]); - - $content_html = __("\n

Hello,

\n\n

GLPI reports are available.
\nYou will find attached in this email.

\n\n", 'mreporting'); - - // Ajout d'une traduction (texte) en Français - $translation = new NotificationTemplateTranslation(); - $translation->add([ - 'notificationtemplates_id' => $template_id, - 'language' => '', - 'subject' => __("GLPI statistics reports", 'mreporting'), - 'content_text' => __("Hello,\n\nGLPI reports are available.\nYou will find attached in this email.\n\n", 'mreporting'), - 'content_html' => $content_html] - ); - - // Création de la notification - $notification = new Notification(); - $notification_id = $notification->add( - [ - 'name' => __('Notification for "More Reporting"', 'mreporting'), - 'comment' => "", - 'entities_id' => 0, - 'is_recursive' => 1, - 'is_active' => 1, - 'itemtype' => __CLASS__, - 'event' => 'sendReporting', - ] - ); - - $n_n_template = new Notification_NotificationTemplate(); - $n_n_template->add( - [ - 'notifications_id' => $notification_id, - 'mode' => Notification_NotificationTemplate::MODE_MAIL, - 'notificationtemplates_id' => $template_id, - ] - ); - - $DB->query('INSERT INTO glpi_notificationtargets (items_id, type, notifications_id) + public static function install($migration) + { + global $DB; + + // Création du template de la notification + $template = new NotificationTemplate(); + $found_template = $template->find(['itemtype' => 'PluginMreportingNotification']); + if (empty($found_template)) { + $template_id = $template->add([ + 'name' => __('Notification for "More Reporting"', 'mreporting'), + 'comment' => "", + 'itemtype' => __CLASS__, + ]); + + $content_html = __("\n

Hello,

\n\n

GLPI reports are available.
\nYou will find attached in this email.

\n\n", 'mreporting'); + + // Ajout d'une traduction (texte) en Français + $translation = new NotificationTemplateTranslation(); + $translation->add([ + 'notificationtemplates_id' => $template_id, + 'language' => '', + 'subject' => __("GLPI statistics reports", 'mreporting'), + 'content_text' => __("Hello,\n\nGLPI reports are available.\nYou will find attached in this email.\n\n", 'mreporting'), + 'content_html' => $content_html + ]); + + // Création de la notification + $notification = new Notification(); + $notification_id = $notification->add( + [ + 'name' => __('Notification for "More Reporting"', 'mreporting'), + 'comment' => "", + 'entities_id' => 0, + 'is_recursive' => 1, + 'is_active' => 1, + 'itemtype' => __CLASS__, + 'event' => 'sendReporting', + ] + ); + + $n_n_template = new Notification_NotificationTemplate(); + $n_n_template->add( + [ + 'notifications_id' => $notification_id, + 'mode' => Notification_NotificationTemplate::MODE_MAIL, + 'notificationtemplates_id' => $template_id, + ] + ); + + $DB->query('INSERT INTO glpi_notificationtargets (items_id, type, notifications_id) VALUES (1, 1, ' . $notification_id . ');'); - } + } - return ['success' => true]; - } + return ['success' => true]; + } /** * Remove mreporting notifications from GLPI. * * @return array 'success' => true on success */ - static function uninstall() { - global $DB; - - $queries = []; - - // Remove NotificationTargets and Notifications - $notification = new Notification(); - $result = $notification->find(['itemtype' => 'PluginMreportingNotification']); - foreach ($result as $row) { - $notification_id = $row['id']; - $queries[] = "DELETE FROM glpi_notificationtargets WHERE notifications_id = " . $notification_id; - $queries[] = "DELETE FROM glpi_notifications WHERE id = " . $notification_id; - } - - // Remove NotificationTemplateTranslations and NotificationTemplates - $template = new NotificationTemplate(); - $result = $template->find(['itemtype' => 'PluginMreportingNotification']); - foreach ($result as $row) { - $template_id = $row['id']; - $queries[] = "DELETE FROM glpi_notificationtemplatetranslations + public static function uninstall() + { + global $DB; + + $queries = []; + + // Remove NotificationTargets and Notifications + $notification = new Notification(); + $result = $notification->find(['itemtype' => 'PluginMreportingNotification']); + foreach ($result as $row) { + $notification_id = $row['id']; + $queries[] = "DELETE FROM glpi_notificationtargets WHERE notifications_id = " . $notification_id; + $queries[] = "DELETE FROM glpi_notifications WHERE id = " . $notification_id; + } + + // Remove NotificationTemplateTranslations and NotificationTemplates + $template = new NotificationTemplate(); + $result = $template->find(['itemtype' => 'PluginMreportingNotification']); + foreach ($result as $row) { + $template_id = $row['id']; + $queries[] = "DELETE FROM glpi_notificationtemplatetranslations WHERE notificationtemplates_id = " . $template_id; - $queries[] = "DELETE FROM glpi_notificationtemplates + $queries[] = "DELETE FROM glpi_notificationtemplates WHERE id = " . $template_id; - } + } - foreach ($queries as $query) { - $DB->query($query); - } + foreach ($queries as $query) { + $DB->query($query); + } - return ['success' => true]; - } + return ['success' => true]; + } /** * Give localized information about 1 task @@ -122,22 +153,24 @@ static function uninstall() { * * @return array of strings */ - static function cronInfo($name) { - switch ($name) { - case 'SendNotifications' : - return ['description' => __('Notification for "More Reporting"', 'mreporting')]; - } - return []; - } + public static function cronInfo($name) + { + switch ($name) { + case 'SendNotifications': + return ['description' => __('Notification for "More Reporting"', 'mreporting')]; + } + return []; + } /** * @param $mailing_options **/ - static function send($mailing_options, $additional_options) { + public static function send($mailing_options, $additional_options) + { - $mail = new PluginMreportingNotificationMail(); - $mail->sendNotification(array_merge($mailing_options, $additional_options)); - } + $mail = new PluginMreportingNotificationMail(); + $mail->sendNotification(array_merge($mailing_options, $additional_options)); + } /** * Execute 1 task manage by the plugin @@ -149,9 +182,10 @@ static function send($mailing_options, $additional_options) { * <0 : to be run again (not finished) * 0 : nothing to do */ - static function cronSendNotifications($task) { - $task->log(__("Notification(s) sent !", 'mreporting')); - PluginMreportingNotificationEvent::raiseEvent('sendReporting', new self(), $task->fields); - return 1; - } + public static function cronSendNotifications($task) + { + $task->log(__("Notification(s) sent !", 'mreporting')); + PluginMreportingNotificationEvent::raiseEvent('sendReporting', new self(), $task->fields); + return 1; + } } diff --git a/inc/notificationevent.class.php b/inc/notificationevent.class.php index e337ae0a..d76046ae 100644 --- a/inc/notificationevent.class.php +++ b/inc/notificationevent.class.php @@ -1,121 +1,161 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); + die("Sorry. You can't access directly to this file"); } /** * Class which manages notification events **/ -class PluginMreportingNotificationEvent extends NotificationEvent { - - /** - * Raise a notification event event - * - * @param $event the event raised for the itemtype - * @param $item the object which raised the event - * @param $options array of options used - * @param $label used for debugEvent() (default '') - **/ - static function raiseEvent($event, $item, $options = [], $label = '') { - global $CFG_GLPI; - - //If notifications are enabled in GLPI's configuration - if ($CFG_GLPI["use_notifications"]) { - $email_processed = []; - $email_notprocessed = []; - - $options['entities_id'] = 0; //New code - $notificationtarget = NotificationTarget::getInstance($item, $event, $options); - if (!$notificationtarget) { - return false; - } - - //Get template's information - $template = new NotificationTemplate(); - - $entity = $notificationtarget->getEntity(); - //Foreach notification - foreach (Notification::getNotificationsByEventAndType($event, $item->getType(), $entity) - as $data) { - $targets = getAllDataFromTable( - 'glpi_notificationtargets', - ['notifications_id' => $data['id']] - ); - $eventClass = Notification_NotificationTemplate::getModeClass($data['mode'], 'event'); - $notificationtarget->setMode($data['mode']); - $notificationtarget->setEvent($eventClass); - $notificationtarget->clearAddressesList(); - - //Process more infos (for example for tickets) - $notificationtarget->addAdditionnalInfosForTarget(); - - $template->getFromDB($data['notificationtemplates_id']); - $template->resetComputedTemplates(); - - //Set notification's signature (the one which corresponds to the entity) - $template->setSignature(Notification::getMailingSignature($entity)); - - $notify_me = Session::isCron() ? true : $_SESSION['glpinotification_to_myself']; - - //Foreach notification targets - foreach ($targets as $target) { - //Get all users affected by this notification - $notificationtarget->addForTarget($target, $options); +class PluginMreportingNotificationEvent extends NotificationEvent +{ + /** + * Raise a notification event event + * + * @param string $event the event raised for the itemtype + * @param CommonDBTM $item the object which raised the event + * @param array $options options used + * @param string $label used for debugEvent() (default '') + **/ + public static function raiseEvent($event, $item, $options = [], $label = '') + { + /** @var array $CFG_GLPI */ + global $CFG_GLPI; + + //If notifications are enabled in GLPI's configuration + if ($CFG_GLPI["use_notifications"]) { + $email_processed = []; + $email_notprocessed = []; + + $options['entities_id'] = 0; //New code + $notificationtarget = NotificationTarget::getInstance($item, $event, $options); + if (!$notificationtarget) { + return false; + } - foreach ($notificationtarget->getTargets() as $user_email => $users_infos) { - if ($label - || $notificationtarget->validateSendTo($event, $users_infos, $notify_me)) { - //If the user have not yet been notified - if (!isset($email_processed[$users_infos['language']][$users_infos['email']])) { - //If ther user's language is the same as the template's one - if (isset($email_notprocessed[$users_infos['language']] - [$users_infos['email']])) { - unset($email_notprocessed[$users_infos['language']] + //Get template's information + $template = new NotificationTemplate(); + + $entity = $notificationtarget->getEntity(); + //Foreach notification + $notifications = Notification::getNotificationsByEventAndType($event, $item->getType(), $entity); + foreach ($notifications as $data) { + $targets = getAllDataFromTable( + 'glpi_notificationtargets', + ['notifications_id' => $data['id']] + ); + $eventClass = Notification_NotificationTemplate::getModeClass($data['mode'], 'event'); + $notificationtarget->setMode($data['mode']); + $notificationtarget->setEvent($eventClass); + $notificationtarget->clearAddressesList(); + + //Process more infos (for example for tickets) + $notificationtarget->addAdditionnalInfosForTarget(); + + $template->getFromDB($data['notificationtemplates_id']); + $template->resetComputedTemplates(); + + //Set notification's signature (the one which corresponds to the entity) + $template->setSignature(Notification::getMailingSignature($entity)); + + $notify_me = Session::isCron() ? true : $_SESSION['glpinotification_to_myself']; + + //Foreach notification targets + foreach ($targets as $target) { + //Get all users affected by this notification + $notificationtarget->addForTarget($target, $options); + + foreach ($notificationtarget->getTargets() as $user_email => $users_infos) { + if ( + $label + || $notificationtarget->validateSendTo($event, $users_infos, $notify_me) + ) { + //If the user have not yet been notified + if (!isset($email_processed[$users_infos['language']][$users_infos['email']])) { + //If ther user's language is the same as the template's one + if ( + isset($email_notprocessed[$users_infos['language']] + [$users_infos['email']]) + ) { + unset($email_notprocessed[$users_infos['language']] [$users_infos['email']]); - } - if ($tid = $template->getTemplateByLanguage($notificationtarget, $users_infos, - $event, $options)) { - //Send notification to the user - if ($label == '') { - PluginMreportingNotification::send( - $template->getDataToSend( - $notificationtarget, - $tid, - $users_infos[$eventClass::getTargetFieldName()], - $users_infos, - $options - ), - $notificationtarget->additionalData - ); - } else { - $notificationtarget->getFromDB($target['id']); - echo ""; - echo "".$label.""; - echo "".$notificationtarget->getNameID().""; - echo "".sprintf(__('%1$s (%2$s)'), $template->getName(), - $users_infos['language']).""; - echo "".$users_infos['email'].""; - echo ""; - } - $email_processed[$users_infos['language']][$users_infos['email']] + } + if ( + $tid = $template->getTemplateByLanguage( + $notificationtarget, + $users_infos, + $event, + $options + ) + ) { + //Send notification to the user + if ($label == '') { + PluginMreportingNotification::send( + $template->getDataToSend( + $notificationtarget, + $tid, + $users_infos[$eventClass::getTargetFieldName()], + $users_infos, + $options + ), + $notificationtarget->additionalData + ); + } else { + $notificationtarget->getFromDB($target['id']); + echo ""; + echo "" . $label . ""; + echo "" . $notificationtarget->getNameID() . ""; + echo "" . sprintf( + __('%1$s (%2$s)'), + $template->getName(), + $users_infos['language'] + ) . ""; + echo "" . $users_infos['email'] . ""; + echo ""; + } + $email_processed[$users_infos['language']][$users_infos['email']] = $users_infos; - - } else { - $email_notprocessed[$users_infos['language']][$users_infos['email']] + } else { + $email_notprocessed[$users_infos['language']][$users_infos['email']] = $users_infos; + } + } } - } - } - } + } + } } - } - } - unset($email_processed); - unset($email_notprocessed); - $template = null; - return true; - } - + } + unset($email_processed); + unset($email_notprocessed); + $template = null; + return true; + } } - diff --git a/inc/notificationmail.class.php b/inc/notificationmail.class.php index fea8fd29..786f5586 100644 --- a/inc/notificationmail.class.php +++ b/inc/notificationmail.class.php @@ -1,64 +1,93 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); + die("Sorry. You can't access directly to this file"); } /** * NotificationMailing class extends phpmail and implements the NotificationInterface **/ -class PluginMreportingNotificationMail extends NotificationMailing { - +class PluginMreportingNotificationMail extends NotificationMailing +{ /** * @param $options array **/ - function sendNotification($options = []) { + public function sendNotification($options = []) + { - $mmail = new GLPIMailer(); - $mmail->AddCustomHeader("Auto-Submitted: auto-generated"); - // For exchange - $mmail->AddCustomHeader("X-Auto-Response-Suppress: OOF, DR, NDR, RN, NRN"); + $mmail = new GLPIMailer(); + $mmail->AddCustomHeader("Auto-Submitted: auto-generated"); + // For exchange + $mmail->AddCustomHeader("X-Auto-Response-Suppress: OOF, DR, NDR, RN, NRN"); - $mmail->SetFrom($options['from'], $options['fromname'], false); + $mmail->SetFrom($options['from'], $options['fromname'], false); - if ($options['replyto']) { - $mmail->AddReplyTo($options['replyto'], $options['replytoname']); - } - $mmail->Subject = $options['subject']; + if ($options['replyto']) { + $mmail->AddReplyTo($options['replyto'], $options['replytoname']); + } + $mmail->Subject = $options['subject']; - if (empty($options['content_html'])) { - $mmail->isHTML(false); - $mmail->Body = $options['content_text']; - } else { - $mmail->isHTML(true); - $mmail->Body = $options['content_html']; - $mmail->AltBody = $options['content_text']; - } + if (empty($options['content_html'])) { + $mmail->isHTML(false); + $mmail->Body = $options['content_text']; + } else { + $mmail->isHTML(true); + $mmail->Body = $options['content_html']; + $mmail->AltBody = $options['content_text']; + } - $mmail->AddAddress($options['to'], $options['toname']); + $mmail->AddAddress($options['to'], $options['toname']); - if (!empty($options['messageid'])) { - $mmail->MessageID = "<".$options['messageid'].">"; - } + if (!empty($options['messageid'])) { + $mmail->MessageID = "<" . $options['messageid'] . ">"; + } - // Attach pdf to mail - $mmail->AddAttachment($options['attachment']['path'], $options['attachment']['name']); + // Attach pdf to mail + $mmail->AddAttachment($options['attachment']['path'], $options['attachment']['name']); - $messageerror = __('Error in sending the email'); + $messageerror = __('Error in sending the email'); - if (!$mmail->Send()) { - $senderror = true; - Session::addMessageAfterRedirect($messageerror."
".$mmail->ErrorInfo, true); - } else { - //TRANS to be written in logs %1$s is the to email / %2$s is the subject of the mail - Toolbox::logInFile("mail", sprintf(__('%1$s: %2$s'), - sprintf(__('An email was sent to %s'), $options['to']), - $options['subject']."\n")); - } - - $mmail->ClearAddresses(); - return true; - } + if (!$mmail->Send()) { + $senderror = true; + Session::addMessageAfterRedirect($messageerror . "
" . $mmail->ErrorInfo, true); + } else { + //TRANS to be written in logs %1$s is the to email / %2$s is the subject of the mail + Toolbox::logInFile("mail", sprintf( + __('%1$s: %2$s'), + sprintf(__('An email was sent to %s'), $options['to']), + $options['subject'] . "\n" + )); + } + $mmail->ClearAddresses(); + return true; + } } - diff --git a/inc/notificationtargetnotification.class.php b/inc/notificationtargetnotification.class.php index 977dbf1a..dd8e5a3f 100644 --- a/inc/notificationtargetnotification.class.php +++ b/inc/notificationtargetnotification.class.php @@ -1,33 +1,65 @@ __('More Reporting', 'mreporting')]; - } - - function getTags() { - $this->addTagToList(['tag' => 'mreporting.file_url', - 'label' => __('Link'), - 'value' => true]); - - asort($this->tag_descriptions); - } - - function addDataForTemplate($event, $options = []) { - global $CFG_GLPI; - - $file_name = $this->_buildPDF(mt_rand().'_'); - - $this->data['##lang.mreporting.file_url##'] = __('Link'); - $this->data['##mreporting.file_url##'] = $CFG_GLPI['url_base']. +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +class PluginMreportingNotificationTargetNotification extends NotificationTarget +{ + public $additionalData; + + public function getEvents() + { + return ['sendReporting' => __('More Reporting', 'mreporting')]; + } + + public function getTags() + { + $this->addTagToList(['tag' => 'mreporting.file_url', + 'label' => __('Link'), + 'value' => true + ]); + + asort($this->tag_descriptions); + } + + public function addDataForTemplate($event, $options = []) + { + global $CFG_GLPI; + + $file_name = $this->buildPDF(mt_rand() . '_'); + + $this->data['##lang.mreporting.file_url##'] = __('Link'); + $this->data['##mreporting.file_url##'] = $CFG_GLPI['url_base'] . "/index.php?redirect=plugin_mreporting_$file_name"; - $this->additionalData['attachment']['path'] = GLPI_PLUGIN_DOC_DIR."/mreporting/notifications/".$file_name; - $this->additionalData['attachment']['name'] = $file_name; - } + $this->additionalData['attachment']['path'] = GLPI_PLUGIN_DOC_DIR . "/mreporting/notifications/" . $file_name; + $this->additionalData['attachment']['name'] = $file_name; + } /** @@ -35,104 +67,107 @@ function addDataForTemplate($event, $options = []) { * * @return string hash Name of the created file */ - private function _buildPDF($user_name = '') { - global $CFG_GLPI, $DB, $LANG; + private function buildPDF($user_name = '') + { + global $CFG_GLPI, $DB, $LANG; - $dir = GLPI_PLUGIN_DOC_DIR.'/mreporting/notifications'; + $dir = GLPI_PLUGIN_DOC_DIR . '/mreporting/notifications'; - if (!is_dir($dir)) { - return false; - } + if (!is_dir($dir)) { + return false; + } - setlocale(LC_TIME, 'fr_FR.utf8', 'fra'); - ini_set('memory_limit', '256M'); - set_time_limit(300); + setlocale(LC_TIME, 'fr_FR.utf8', 'fra'); + ini_set('memory_limit', '256M'); + set_time_limit(300); - $images = []; + $images = []; - $result = $DB->query('SELECT id, name, classname, default_delay + $result = $DB->query('SELECT id, name, classname, default_delay FROM glpi_plugin_mreporting_configs WHERE is_notified = 1 AND is_active = 1'); - $graphs = []; - while ($graph = $result->fetch_array()) { - $type = preg_split('/(?<=\\w)(?=[A-Z])/', $graph['name']); - - $graphs[] = [ - 'class' => substr($graph['classname'], 16), - 'classname' => $graph['classname'], - 'method' => $graph['name'], - 'type' => $type[1], - 'start' => date('Y-m-d', strtotime(date('Y-m-d 00:00:00'). - ' -'.$graph['default_delay'].' day')), - 'end' => date('Y-m-d', strtotime(date('Y-m-d 00:00:00').' -1 day')), - ]; - } - - foreach ($graphs as $graph) { - $_REQUEST = ['switchto' => 'png', - 'short_classname' => $graph['class'], - 'f_name' => $graph['method'], - 'gtype' => $graph['type'], - 'date1PluginMreporting'.$graph['class'].$graph['method'] => $graph['start'], - 'date2PluginMreporting'.$graph['class'].$graph['method'] => $graph['end'], - 'randname' => 'PluginMreporting'.$graph['class'].$graph['method'], - 'hide_title' => false]; //New code - - ob_start(); - $common = new PluginMreportingCommon(); - $common->showGraph($_REQUEST, false, 'PNG'); - $content = ob_get_clean(); - - preg_match_all('/fetch_array()) { + $type = preg_split('/(?<=\\w)(?=[A-Z])/', $graph['name']); + + $graphs[] = [ + 'class' => substr($graph['classname'], 16), + 'classname' => $graph['classname'], + 'method' => $graph['name'], + 'type' => $type[1], + 'start' => date('Y-m-d', strtotime(date('Y-m-d 00:00:00') . + ' -' . $graph['default_delay'] . ' day')), + 'end' => date('Y-m-d', strtotime(date('Y-m-d 00:00:00') . ' -1 day')), + ]; + } + + foreach ($graphs as $graph) { + $_REQUEST = ['switchto' => 'png', + 'short_classname' => $graph['class'], + 'f_name' => $graph['method'], + 'gtype' => $graph['type'], + 'date1PluginMreporting' . $graph['class'] . $graph['method'] => $graph['start'], + 'date2PluginMreporting' . $graph['class'] . $graph['method'] => $graph['end'], + 'randname' => 'PluginMreporting' . $graph['class'] . $graph['method'], + 'hide_title' => false + ]; //New code + + ob_start(); + $common = new PluginMreportingCommon(); + $common->showGraph($_REQUEST, false, 'PNG'); + $content = ob_get_clean(); + + preg_match_all('/ $image_title, - 'base64' => $image_base64, - 'width' => $image_width, - 'height' => $image_height]); - } - - $file_name = 'glpi_report_'.$user_name.date('d-m-Y').'.pdf'; - - $pdf = new PluginMreportingPdf(); - $pdf->Init(); - $pdf->Content($images); - $pdf->Output($dir.'/'.$file_name, 'F'); - - // Return the generated filename - return $file_name; - } + + $image_title = $LANG['plugin_mreporting'][$graph['class']][$graph['method']]['title']; + $image_title .= " du " . strftime($format, strtotime($graph['start'])); + $image_title .= " au " . strftime('%e %B %Y', strtotime($graph['end'])); + + array_push($images, ['title' => $image_title, + 'base64' => $image_base64, + 'width' => $image_width, + 'height' => $image_height + ]); + } + + $file_name = 'glpi_report_' . $user_name . date('d-m-Y') . '.pdf'; + + $pdf = new PluginMreportingPdf(); + $pdf->Init(); + $pdf->Content($images); + $pdf->Output($dir . '/' . $file_name, 'F'); + + // Return the generated filename + return $file_name; + } } diff --git a/inc/other.class.php b/inc/other.class.php index 9e35a3c5..cb4caef5 100644 --- a/inc/other.class.php +++ b/inc/other.class.php @@ -1,124 +1,129 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingOther Extends PluginMreportingBaseclass { - - function reportHbarLogs($configs = []) { - global $DB; +class PluginMreportingOther extends PluginMreportingBaseclass +{ + public function reportHbarLogs($configs = []) + { + global $DB; - //Init delay value - $this->sql_date = PluginMreportingCommon::getSQLDate("`glpi_tickets`.`date`", - $configs['delay'], $configs['randname']); + //Init delay value + $this->sql_date = PluginMreportingCommon::getSQLDate( + "`glpi_tickets`.`date`", + $configs['delay'], + $configs['randname'] + ); - $prefix = "SELECT count(*) as cpt FROM `glpi_logs` WHERE "; - //Add/remove a software on a computer - $query_software = "$prefix `linked_action` IN (4,5)"; + $prefix = "SELECT count(*) as cpt FROM `glpi_logs` WHERE "; + //Add/remove a software on a computer + $query_software = "$prefix `linked_action` IN (4,5)"; - //Add/remove a software on a computer - $query_computer_software = "$prefix `linked_action` IN (4,5)"; + //Add/remove a software on a computer + $query_computer_software = "$prefix `linked_action` IN (4,5)"; - $query_software_version = "$prefix `itemtype`='Software' + $query_software_version = "$prefix `itemtype`='Software' AND `itemtype_link`='SoftwareVersion' AND `linked_action` IN (17, 18, 19)"; - $query_add_infocom = "$prefix `itemtype`='Software' + $query_add_infocom = "$prefix `itemtype`='Software' AND `itemtype_link`='Infocom' AND `linked_action` IN (17)"; - $query_user_profiles = "$prefix `itemtype`='User' + $query_user_profiles = "$prefix `itemtype`='User' AND `itemtype_link`='Profile_User' AND `linked_action` IN (17, 18, 19)"; - $query_user_groups = "$prefix `itemtype`='User' + $query_user_groups = "$prefix `itemtype`='User' AND `itemtype_link`='Group_User' AND `linked_action` IN (17, 18, 19)"; - $query_user_deleted = "$prefix `itemtype`='User' AND `linked_action` IN (12)"; + $query_user_deleted = "$prefix `itemtype`='User' AND `linked_action` IN (12)"; - $query_ocs = "$prefix `linked_action` IN (8, 9, 10, 11)"; - $query_device = "$prefix `linked_action` IN (1, 2, 3, 6, 7)"; - $query_relation = "$prefix `linked_action` IN (15, 16)"; - $query_item = "$prefix `linked_action` IN (13, 14, 17, 18, 19, 20)"; - $query_other = "$prefix `id_search_option` IN (16, 19)"; + $query_ocs = "$prefix `linked_action` IN (8, 9, 10, 11)"; + $query_device = "$prefix `linked_action` IN (1, 2, 3, 6, 7)"; + $query_relation = "$prefix `linked_action` IN (15, 16)"; + $query_item = "$prefix `linked_action` IN (13, 14, 17, 18, 19, 20)"; + $query_other = "$prefix `id_search_option` IN (16, 19)"; - $datas = []; + $datas = []; - $result = $DB->query($query_computer_software); - $datas['datas'][__('Add/remove software on a computer', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_computer_software); + $datas['datas'][__('Add/remove software on a computer', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_software_version); - $datas['datas'][__('Add/remove version on a software', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_software_version); + $datas['datas'][__('Add/remove version on a software', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_add_infocom); - $datas['datas'][__('Add infocom', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_add_infocom); + $datas['datas'][__('Add infocom', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_user_profiles); - $datas['datas'][__('Add/remove profile on a user', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_user_profiles); + $datas['datas'][__('Add/remove profile on a user', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_user_groups); - $datas['datas'][__('Add/remove group on a user', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_user_groups); + $datas['datas'][__('Add/remove group on a user', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_user_deleted); - $datas['datas'][__('User deleted from LDAP', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_user_deleted); + $datas['datas'][__('User deleted from LDAP', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $plugin = new Plugin(); - if ($plugin->isActivated("webservices")) { - $query_webservice = "$prefix `itemtype`='PluginWebservicesClient'"; + $plugin = new Plugin(); + if ($plugin->isActivated("webservices")) { + $query_webservice = "$prefix `itemtype`='PluginWebservicesClient'"; - // Display this information is not usefull if webservices is not activated - $result = $DB->query($query_webservice); - $datas['datas'][__('Webservice logs', 'mreporting')] = $DB->result($result, 0, 'cpt'); - } + // Display this information is not usefull if webservices is not activated + $result = $DB->query($query_webservice); + $datas['datas'][__('Webservice logs', 'mreporting')] = $DB->result($result, 0, 'cpt'); + } - $result = $DB->query($query_ocs); - $datas['datas'][__('OCS Infos', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_ocs); + $datas['datas'][__('OCS Infos', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_device); - $datas['datas'][__('Add/update/remove device', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_device); + $datas['datas'][__('Add/update/remove device', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_relation); - $datas['datas'][__('Add/remove relation', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_relation); + $datas['datas'][__('Add/remove relation', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_item); - $datas['datas'][__('Add/remove item', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_item); + $datas['datas'][__('Add/remove item', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $result = $DB->query($query_other); - $datas['datas'][__('Comments & date_mod changes', 'mreporting')] = $DB->result($result, 0, 'cpt'); + $result = $DB->query($query_other); + $datas['datas'][__('Comments & date_mod changes', 'mreporting')] = $DB->result($result, 0, 'cpt'); - $plugin = new Plugin(); - if ($plugin->isActivated("genericobject")) { - $query_genericobject = "$prefix `itemtype` LIKE '%PluginGenericobject%'"; + $plugin = new Plugin(); + if ($plugin->isActivated("genericobject")) { + $query_genericobject = "$prefix `itemtype` LIKE '%PluginGenericobject%'"; - // Display this information is not usefull if genericobject is not activated - $result = $DB->query($query_genericobject); - $datas['datas'][__('Genericobject plugin logs', 'mreporting')] = $DB->result($result, 0, 'cpt'); - } + // Display this information is not usefull if genericobject is not activated + $result = $DB->query($query_genericobject); + $datas['datas'][__('Genericobject plugin logs', 'mreporting')] = $DB->result($result, 0, 'cpt'); + } - return $datas; - } + return $datas; + } /** * Preconfig datas with your values when init config is done @@ -128,36 +133,33 @@ function reportHbarLogs($configs = []) { * @param PluginMreportingConfig $config * @return $config */ - function preconfig($funct_name, $classname, PluginMreportingConfig $config) { - - if ($funct_name != -1 && $classname) { - - $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); - if ($ex_func[0] != 'report') { - return false; - } - $gtype = strtolower($ex_func[1]); - - switch ($gtype) { - case 'pie': - $config->fields["name"]=$funct_name; - $config->fields["classname"]=$classname; - $config->fields["is_active"]="1"; - $config->fields["show_label"]="hover"; - $config->fields["spline"]="0"; - $config->fields["show_area"]="0"; - $config->fields["show_graph"]="1"; - $config->fields["default_delay"]="30"; - $config->fields["show_label"]="hover"; - break; - default : - $config->preconfig($funct_name, $classname); - break; - - } - - } - return $config->fields; - } - + public function preconfig($funct_name, $classname, PluginMreportingConfig $config) + { + + if ($funct_name != -1 && $classname) { + $ex_func = preg_split('/(?<=\\w)(?=[A-Z])/', $funct_name); + if ($ex_func[0] != 'report') { + return false; + } + $gtype = strtolower($ex_func[1]); + + switch ($gtype) { + case 'pie': + $config->fields["name"] = $funct_name; + $config->fields["classname"] = $classname; + $config->fields["is_active"] = "1"; + $config->fields["show_label"] = "hover"; + $config->fields["spline"] = "0"; + $config->fields["show_area"] = "0"; + $config->fields["show_graph"] = "1"; + $config->fields["default_delay"] = "30"; + $config->fields["show_label"] = "hover"; + break; + default: + $config->preconfig($funct_name, $classname); + break; + } + } + return $config->fields; + } } diff --git a/inc/pdf.class.php b/inc/pdf.class.php index 61c24896..0eb7668b 100644 --- a/inc/pdf.class.php +++ b/inc/pdf.class.php @@ -1,70 +1,107 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); + die("Sorry. You can't access directly to this file"); } -class PluginMreportingPdf extends TCPDF { - +class PluginMreportingPdf extends TCPDF +{ /** * Create PDF header and initialize presentation */ - function Init() { - global $CFG_GLPI; + // @codingStandardsIgnoreStart + public function Init() + { + // @codingStandardsIgnoreEnd + global $CFG_GLPI; - $title = __("GLPI statistics reports", 'mreporting'); - $creator = __("Automaticaly generated by GLPI", 'mreporting'); - $version = plugin_version_mreporting(); - $author = $CFG_GLPI["version"].' - ' . $version['name'].' v' . $version['version']; + $title = __("GLPI statistics reports", 'mreporting'); + $creator = __("Automaticaly generated by GLPI", 'mreporting'); + $version = plugin_version_mreporting(); + $author = $CFG_GLPI["version"] . ' - ' . $version['name'] . ' v' . $version['version']; - $this->SetCreator($creator); - $this->SetAuthor($author); - $this->SetTitle($title); + $this->SetCreator($creator); + $this->SetAuthor($author); + $this->SetTitle($title); - $this->SetFontSize(10); - $this->SetMargins(20, 25); + $this->SetFontSize(10); + $this->SetMargins(20, 25); - $this->SetAutoPageBreak(true); + $this->SetAutoPageBreak(true); - $this->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]); - $this->SetHeaderMargin(PDF_MARGIN_HEADER); - $this->AddPage(); - } + $this->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]); + $this->SetHeaderMargin(PDF_MARGIN_HEADER); + $this->AddPage(); + } /** * Insert content and graphs * * @param array $images Array of reports */ - function Content($images) { - $images_lengh = sizeof($images); - $i = 0; - foreach ($images as $image) { - $i++; - $file = '@' . base64_decode($image['base64']); - $w = 210 - PDF_MARGIN_LEFT * 2; + // @codingStandardsIgnoreStart + public function Content($images) + { + // @codingStandardsIgnoreEnd + $images_lengh = sizeof($images); + $i = 0; + foreach ($images as $image) { + $i++; + $file = '@' . base64_decode($image['base64']); + $w = 210 - PDF_MARGIN_LEFT * 2; - if ($image['width'] == 0) { - continue; - } + if ($image['width'] == 0) { + continue; + } - $h = floor(($image['height'] * $w) / $image['width']); - $this->Image($file, '', '', $w, $h); - $this->Ln($h); + $h = floor(($image['height'] * $w) / $image['width']); + $this->Image($file, '', '', $w, $h); + $this->Ln($h); - $this->writeHTMLCell('', '', '', '', $image['title'], 0, 1, false, true, 'C'); - if ($i < $images_lengh) { - $this->AddPage(); - } - } - } + $this->writeHTMLCell('', '', '', '', $image['title'], 0, 1, false, true, 'C'); + if ($i < $images_lengh) { + $this->AddPage(); + } + } + } /** * Create the PDF footer */ - function Footer() { - $this->SetY(-15); - $this->SetFontSize(8); - $this->writeHTMLCell('', '', '', '', date('Y-m-d H:i:s'), 0, 0, false, true, 'R'); - } + // @codingStandardsIgnoreStart + public function Footer() + { + + $this->SetY(-15); + $this->SetFontSize(8); + $this->writeHTMLCell('', '', '', '', date('Y-m-d H:i:s'), 0, 0, false, true, 'R'); + } } diff --git a/inc/preference.class.php b/inc/preference.class.php index ee0168ba..6e6dd546 100644 --- a/inc/preference.class.php +++ b/inc/preference.class.php @@ -1,49 +1,52 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingPreference extends CommonDBTM { - - static function checkIfPreferenceExists($users_id) { - return self::checkPreferenceValue('id', $users_id); - } - - function addDefaultPreference($users_id) { - $id = self::checkIfPreferenceExists($users_id); - if (!$id) { - $input["users_id"] = $users_id; - $input["template"] = ""; - $input["selectors"] = null; - - $id = $this->add($input); - } - return $id; - } +class PluginMreportingPreference extends CommonDBTM +{ + public static function checkIfPreferenceExists($users_id) + { + return self::checkPreferenceValue('id', $users_id); + } + + public function addDefaultPreference($users_id) + { + $id = self::checkIfPreferenceExists($users_id); + if (!$id) { + $input["users_id"] = $users_id; + $input["template"] = ""; + $input["selectors"] = null; + + $id = $this->add($input); + } + return $id; + } /** * @@ -52,29 +55,36 @@ function addDefaultPreference($users_id) { * @param unknown_type user ID * @return preference value or 0 */ - static function checkPreferenceValue($field, $users_id = 0) { - $data = getAllDataFromTable(getTableForItemType(__CLASS__), ['users_id' => $users_id]); - if (!empty($data)) { - $first = array_pop($data); - return $first[$field]; - } else { - return 0; - } - } - - static function checkPreferenceTemplateValue($users_id) { - return self::checkPreferenceValue('template', $users_id); - } + public static function checkPreferenceValue($field, $users_id = 0) + { + $data = getAllDataFromTable(getTableForItemType(__CLASS__), ['users_id' => $users_id]); + if (!empty($data)) { + $first = array_pop($data); + return $first[$field]; + } else { + return 0; + } + } + + public static function checkPreferenceTemplateValue($users_id) + { + return self::checkPreferenceValue('template', $users_id); + } /** * * Display a dropdown of all ODT template files available * @param $value default value */ - static function dropdownFileTemplates($value = '') { - return self::dropdownListFiles('template', PLUGIN_MREPORTING_TEMPLATE_EXTENSION, - PLUGIN_MREPORTING_TEMPLATE_DIR, $value); - } + public static function dropdownFileTemplates($value = '') + { + return self::dropdownListFiles( + 'template', + PLUGIN_MREPORTING_TEMPLATE_EXTENSION, + PLUGIN_MREPORTING_TEMPLATE_DIR, + $value + ); + } /** @@ -85,116 +95,122 @@ static function dropdownFileTemplates($value = '') { * @param $directory directory in which to look for files * @param $value default value */ - static function dropdownListFiles($name, $extension, $directory, $value = '') { - $files = self::getFiles($directory, $extension); - $values = []; - if (empty($files)) { - $values[0] = Dropdown::EMPTY_VALUE; - } - foreach ($files as $file) { - $values[$file[0]] = $file[0]; - } - return Dropdown::showFromArray($name, $values, ['value' => $value]); - } + public static function dropdownListFiles($name, $extension, $directory, $value = '') + { + $files = self::getFiles($directory, $extension); + $values = []; + if (empty($files)) { + $values[0] = Dropdown::EMPTY_VALUE; + } + foreach ($files as $file) { + $values[$file[0]] = $file[0]; + } + return Dropdown::showFromArray($name, $values, ['value' => $value]); + } /** * * Check if at least one template exists * @return true if at least one template exists, false otherwise */ - static function atLeastOneTemplateExists() { - $files = self::getFiles(PLUGIN_MREPORTING_TEMPLATE_DIR, PLUGIN_MREPORTING_TEMPLATE_EXTENSION); - return (!empty($files)); - } - - function showForm($ID) { - $this->getFromDB($ID); - - $version = plugin_version_mreporting(); - - echo ""; - echo "
"; - - echo ""; - - echo ""; - - echo ""; - echo ""; - echo ""; - - echo ""; - echo ""; - echo ""; - - echo "
" . $version['name'] . " - ". $version['version'] . "
";__("Please, select a model in your preferences", 'mreporting').""; - self::dropdownFileTemplates($this->fields["template"]); - echo "
"; - echo ""; - echo ""; - echo ""; - echo "
"; - echo "
"; - Html::closeForm(); - } - - static function getFiles($directory, $ext) { - - $array_dir = []; - $array_file = []; - - if (is_dir($directory)) { - if ($dh = opendir($directory)) { - while (($file = readdir($dh)) !== false) { - $filename = $file; - $filetype = filetype($directory. $file); - $filedate = Html::convDate(date ("Y-m-d", filemtime($directory . $file))); - $basename = explode('.', basename($filename)); - $extension = array_pop($basename); - switch ($filename) { - case '..': - case '.': - echo ""; - break; - - default: - if ($filetype == 'file' && $extension ==$ext) { - $array_file[] = [$filename, $filedate, $extension]; - } else if ($filetype == "dir") { - $array_dir[] = $filename; - } - break; - } + public static function atLeastOneTemplateExists() + { + $files = self::getFiles(PLUGIN_MREPORTING_TEMPLATE_DIR, PLUGIN_MREPORTING_TEMPLATE_EXTENSION); + return (!empty($files)); + } + + public function showForm($ID, array $options = []) + { + $this->getFromDB($ID); + + $version = plugin_version_mreporting(); + + echo ""; + echo "
"; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo "
" . $version['name'] . " - " . $version['version'] . "
"; + __("Please, select a model in your preferences", 'mreporting') . ""; + self::dropdownFileTemplates($this->fields["template"]); + echo "
"; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "
"; + Html::closeForm(); + } + + public static function getFiles($directory, $ext) + { + + $array_dir = []; + $array_file = []; + + if (is_dir($directory)) { + if ($dh = opendir($directory)) { + while (($file = readdir($dh)) !== false) { + $filename = $file; + $filetype = filetype($directory . $file); + $filedate = Html::convDate(date("Y-m-d", filemtime($directory . $file))); + $basename = explode('.', basename($filename)); + $extension = array_pop($basename); + switch ($filename) { + case '..': + case '.': + echo ""; + break; + + default: + if ($filetype == 'file' && $extension == $ext) { + $array_file[] = [$filename, $filedate, $extension]; + } else if ($filetype == "dir") { + $array_dir[] = $filename; + } + break; + } + } + closedir($dh); } - closedir($dh); - } - } - - rsort($array_file); - - return $array_file; - } - - - function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - switch (get_class($item)) { - case 'Preference': - return [1 => __("More Reporting", 'mreporting')]; - default: - return ''; - } - } - - - static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - switch (get_class($item)) { - case 'Preference': - $pref = new self(); - $id = $pref->addDefaultPreference(Session::getLoginUserID()); - $pref->showForm($id); - break; - } - return true; - } - + } + + rsort($array_file); + + return $array_file; + } + + + public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) + { + switch (get_class($item)) { + case 'Preference': + return [1 => __("More Reporting", 'mreporting')]; + default: + return ''; + } + } + + + public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) + { + switch (get_class($item)) { + case 'Preference': + $pref = new self(); + $id = $pref->addDefaultPreference(Session::getLoginUserID()); + $pref->showForm($id); + break; + } + return true; + } } diff --git a/inc/profile.class.php b/inc/profile.class.php index 096a82dc..2525a171 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -1,196 +1,218 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); + die("Sorry. You can't access directly to this file"); } -class PluginMreportingProfile extends CommonDBTM { - static $rightname = 'profile'; +class PluginMreportingProfile extends CommonDBTM +{ + public static $rightname = 'profile'; - static function getTypeName($nb = 0) { - return __("More Reporting", 'mreporting'); - } + public static function getTypeName($nb = 0) + { + return __("More Reporting", 'mreporting'); + } //if profile deleted - static function purgeProfiles(Profile $prof) { - $plugprof = new self(); - $plugprof->deleteByCriteria(['profiles_id' => $prof->getField("id")]); - } + public static function purgeProfiles(Profile $prof) + { + $plugprof = new self(); + $plugprof->deleteByCriteria(['profiles_id' => $prof->getField("id")]); + } //if reports add - static function addReport(PluginMreportingConfig $config) { - $plugprof = new self(); - $plugprof->addRightToReports($config->getField("id")); - } + public static function addReport(PluginMreportingConfig $config) + { + $plugprof = new self(); + $plugprof->addRightToReports($config->getField("id")); + } //if reports deleted - static function purgeProfilesByReports(PluginMreportingConfig $config) { - $plugprof = new self(); - $plugprof->deleteByCriteria(['reports' => $config->getField("id")]); - } - - function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - if ($item->getField('interface') == 'helpdesk') { - return false; - } - - switch ($item->getType()) { - case 'Profile': - return self::getTypeName(); - case 'PluginMreportingConfig': - return __("Rights management", 'mreporting'); - default: - return ''; - } - } - - - static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - global $CFG_GLPI; - - if ($item->getType()=='Profile' && $item->getField('interface') != 'helpdesk') { - $ID = $item->getField('id'); - $prof = new self(); - - if (!$prof->getFromDBByProfile($item->getField('id'))) { - $prof->createAccess($item->getField('id')); - } - $prof->showForm($item->getField('id')); - } else if ($item->getType()=='PluginMreportingConfig') { - $reportProfile = new self(); - $reportProfile->showFormForManageProfile($item); - } - return true; - } - - function getFromDBByProfile($profiles_id) { - global $DB; - - $query = "SELECT * FROM `{$this->getTable()}` - WHERE `profiles_id` = '".$profiles_id."'"; - if ($result = $DB->query($query)) { - if ($DB->numrows($result) != 1) { + public static function purgeProfilesByReports(PluginMreportingConfig $config) + { + $plugprof = new self(); + $plugprof->deleteByCriteria(['reports' => $config->getField("id")]); + } + + public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) + { + if ($item->getField('interface') == 'helpdesk') { return false; - } - $this->fields = $DB->fetchAssoc($result); - return (is_array($this->fields) && count($this->fields)); - } - return false; - } + } + + switch ($item->getType()) { + case 'Profile': + return self::getTypeName(); + case 'PluginMreportingConfig': + return __("Rights management", 'mreporting'); + default: + return ''; + } + } + + + public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) + { + global $CFG_GLPI; + + if ($item->getType() == 'Profile' && $item->getField('interface') != 'helpdesk') { + $ID = $item->getField('id'); + $prof = new self(); + + if (!$prof->getFromDBByProfile($item->getField('id'))) { + $prof->createAccess($item->getField('id')); + } + $prof->showForm($item->getField('id')); + } else if ($item->getType() == 'PluginMreportingConfig') { + $reportProfile = new self(); + $reportProfile->showFormForManageProfile($item); + } + return true; + } + + public function getFromDBByProfile($profiles_id) + { + global $DB; + + $query = "SELECT * FROM `{$this->getTable()}` + WHERE `profiles_id` = '" . $profiles_id . "'"; + if ($result = $DB->query($query)) { + if ($DB->numrows($result) != 1) { + return false; + } + $this->fields = $DB->fetchAssoc($result); + return (is_array($this->fields) && count($this->fields)); + } + return false; + } /** * @param $right array */ - static function addRightToAllProfiles() { - global $DB; - - $result_config = $DB->request("SELECT `id` FROM `glpi_plugin_mreporting_configs`"); - foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) { - foreach ($result_config as $report) { - $DB->query("REPLACE INTO `glpi_plugin_mreporting_profiles` - (`profiles_id`,`reports`,`right`) - VALUES - ('".$prof['id']."','".$report['id']."',NULL)"); - } - } - } - - - static function getRight() { - global $DB; - - $query = "SELECT `profiles_id` + public static function addRightToAllProfiles() + { + global $DB; + + $result_config = $DB->request("SELECT `id` FROM `glpi_plugin_mreporting_configs`"); + foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) { + foreach ($result_config as $report) { + $DB->updateOrInsert('glpi_plugin_mreporting_profiles', [ + 'profiles_id' => $prof['id'], + 'reports' => $report['id'], + 'right' => null + ], [ + 'profiles_id' => $prof['id'], + 'reports' => $report['id'], + ]); + } + } + } + + + public static function getRight() + { + global $DB; + + $query = "SELECT `profiles_id` FROM `glpi_plugin_mreporting_profiles` - WHERE `reports` = ".READ; + WHERE `reports` = " . READ; - $right = []; - foreach ($DB->request($query) as $profile) { - $right[] = $profile['profiles_id']; - } + $right = []; + foreach ($DB->request($query) as $profile) { + $right[] = $profile['profiles_id']; + } - return $right; - } + return $right; + } /** * Function to add right on report to a profile * @param $idProfile */ - public static function addRightToProfile($idProfile) { - global $DB; - - //get all reports - $config = new PluginMreportingConfig(); - foreach ($config->find() as $report) { - // add right for any reports for profile - // Add manual request because Add function get error : right is set to NULL - $query = "REPLACE INTO `glpi_plugin_mreporting_profiles` SET - `profiles_id` = $idProfile, - `reports` = {$report['id']}, - `right` = " . READ; - $DB->query($query) or die('An error occurs during profile initialisation.'); - } - - } + public static function addRightToProfile($idProfile) + { + global $DB; + + //get all reports + $config = new PluginMreportingConfig(); + foreach ($config->find() as $report) { + // add right for any reports for profile + // Add manual request because Add function get error : right is set to NULL + $DB->updateOrInsert('glpi_plugin_mreporting_profiles', [ + 'profiles_id' => $idProfile, + 'reports' => $report['id'], + 'right' => READ + ], [ + 'profiles_id' => $idProfile, + 'reports' => $report['id'], + ]) or die('An error occurs during profile initialisation.'); + } + } /** * Function to add right of a new report * @param $report_id */ - function addRightToReports($report_id) { - global $DB; - - $reportProfile = new self(); - - foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) { - $reportProfile->add(['profiles_id' => $prof['id'], - 'reports' => $report_id, - 'right' => READ]); - } - } - - function createAccess($ID) { - $this->add(['profiles_id' => $ID]); - } - - static function changeProfile() { - $prof = new self(); - if ($prof->getFromDBByProfile($_SESSION['glpiactiveprofile']['id'])) { - $_SESSION["glpi_plugin_mreporting_profile"] = $prof->fields; - } else { - unset($_SESSION["glpi_plugin_mreporting_profile"]); - } - } + public function addRightToReports($report_id) + { + global $DB; + + $reportProfile = new self(); + + foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) { + $reportProfile->add(['profiles_id' => $prof['id'], + 'reports' => $report_id, + 'right' => READ + ]); + } + } + + public function createAccess($ID) + { + $this->add(['profiles_id' => $ID]); + } + + public static function changeProfile() + { + $prof = new self(); + if ($prof->getFromDBByProfile($_SESSION['glpiactiveprofile']['id'])) { + $_SESSION["glpi_plugin_mreporting_profile"] = $prof->fields; + } else { + unset($_SESSION["glpi_plugin_mreporting_profile"]); + } + } /** * Form to manage report right on profile @@ -198,184 +220,196 @@ static function changeProfile() { * @param array $options * @return bool */ - function showForm($ID, $options = []) { - global $LANG, $CFG_GLPI; + public function showForm($ID, $options = []) + { + global $LANG, $CFG_GLPI; - if (!Session::haveRight("profile", READ)) { - return false; - } + if (!Session::haveRight("profile", READ)) { + return false; + } - echo ''; - echo '
'; - echo ''; + echo ''; + echo '
'; + echo '
'; - echo ''; + echo ''; - Plugin::doHook("pre_item_form", ['item' => $this, 'options' => &$options]); + Plugin::doHook("pre_item_form", ['item' => $this, 'options' => &$options]); - echo "\n"; + echo "\n"; - $config = new PluginMreportingConfig(); - foreach ($config->find() as $report) { - $mreportingConfig = new PluginMreportingConfig(); - $mreportingConfig->getFromDB($report['id']); + $config = new PluginMreportingConfig(); + foreach ($config->find() as $report) { + $mreportingConfig = new PluginMreportingConfig(); + $mreportingConfig->getFromDB($report['id']); - // If classname doesn't exists, don't display the report - if (class_exists($mreportingConfig->fields['classname'])) { - $profile = $this->findByProfileAndReport($ID, $report['id']); - $index = str_replace('PluginMreporting', '', $mreportingConfig->fields['classname']); - $title = $LANG['plugin_mreporting'][$index][$report['name']]['title']; + // If classname doesn't exists, don't display the report + if (class_exists($mreportingConfig->fields['classname'])) { + $profile = $this->findByProfileAndReport($ID, $report['id']); + $index = str_replace('PluginMreporting', '', $mreportingConfig->fields['classname']); + $title = $LANG['plugin_mreporting'][$index][$report['name']]['title']; - echo ""; - echo ""; - echo ""; - echo "\n"; - } - } + echo ""; + echo ""; + echo ""; + echo "\n"; + } + } - echo ""; - echo ""; + echo ""; - echo "
' . self::getTypeName() . '
' . self::getTypeName() . '
".__("Rights management", 'mreporting')."
" . __("Rights management", 'mreporting') . "
".$mreportingConfig->getLink()." (".$title."): "; - Profile::dropdownRight($report['id'], - ['value' => $profile->fields['right'], - 'nonone' => 0, - 'noread' => 0, - 'nowrite' => 1]); - echo "
" . $mreportingConfig->getLink() . " (" . $title . "): "; + Profile::dropdownRight( + $report['id'], + ['value' => $profile->fields['right'], + 'nonone' => 0, + 'noread' => 0, + 'nowrite' => 1 + ] + ); + echo "
"; + echo "
"; - echo "
"; - echo ""; - echo "
"; + echo "
"; + echo ""; + echo "
"; - echo ""; + echo ""; - echo "
"; - echo ""; + echo "
"; + echo ""; - echo ""; + echo ""; - echo "

"; + echo "

"; - echo "
"; + echo "
"; - echo "
"; - echo "
"; - Html::closeForm(); - } + echo ""; + echo ""; + echo "
"; + Html::closeForm(); + } /** * Form to manage right on reports * @param $items */ - function showFormForManageProfile($items, $options = []) { - global $DB, $CFG_GLPI; + public function showFormForManageProfile($items, $options = []) + { + global $DB, $CFG_GLPI; - if (!Session::haveRight("config", READ)) { - return false; - } + if (!Session::haveRight("config", READ)) { + return false; + } - $target = isset($options['target']) ? $options['target'] : $this->getFormURL(); + $target = isset($options['target']) ? $options['target'] : $this->getFormURL(); - echo ''; - echo "\n"; - echo "\n"; + echo ''; + echo "
".__("Rights management", 'mreporting')."
\n"; + echo "\n"; - $query = "SELECT `id`, `name` + $query = "SELECT `id`, `name` FROM `glpi_profiles` ORDER BY `name`"; - foreach ($DB->request($query) as $profile) { - $reportProfiles = new self(); - $reportProfiles = $reportProfiles->findByProfileAndReport($profile['id'], $items->fields['id']); - - $prof = new Profile(); - $prof->getFromDB($profile['id']); - - echo ""; - echo ""; - echo ""; - } - - echo ""; - echo ""; - echo "
" . __("Rights management", 'mreporting') . "
".$prof->getLink().""; - Profile::dropdownRight($profile['id'], - ['value' => $reportProfiles->fields['right'], - 'nonone' => 0, - 'noread' => 0, - 'nowrite' => 1]); - echo "
"; - echo "
"; - echo ""; - - echo "

"; - echo "
"; - - echo "
"; - echo ""; - echo ""; - echo "
"; - - echo "
\n"; - Html::closeForm(); - } - - - function findByProfileAndReport($profil_id, $report_id) { - $prof = new self(); - $prof->getFromDBByCrit( - [ - 'profiles_id' => $profil_id, - 'reports' => $report_id, - ] - ); - return $prof; - } - - function findReportByProfiles($profil_id) { - $prof = new self(); - $prof->getFromDBByCrit( - [ - 'profiles_id' => $profil_id, - ] - ); - return $prof; - } - - - static function canViewReports($profil_id, $report_id) { - $prof = new self(); - $res = $prof->getFromDBByCrit( - [ - 'profiles_id' => $profil_id, - 'reports' => $report_id, - ] - ); - - if ($res && $prof->fields['right'] == READ) { - return true; - } - - return false; - } + foreach ($DB->request($query) as $profile) { + $reportProfiles = new self(); + $reportProfiles = $reportProfiles->findByProfileAndReport($profile['id'], $items->fields['id']); - // Hook done on add item case - static function addProfiles(Profile $item) { - if ($item->getType()=='Profile' && $item->getField('interface') != 'helpdesk') { - PluginMreportingProfile::addRightToProfile($item->getID()); - } + $prof = new Profile(); + $prof->getFromDB($profile['id']); - return true; - } + echo ""; + echo "" . $prof->getLink() . ""; + echo ""; + Profile::dropdownRight( + $profile['id'], + ['value' => $reportProfiles->fields['right'], + 'nonone' => 0, + 'noread' => 0, + 'nowrite' => 1 + ] + ); + echo ""; + } + + echo ""; + echo ""; + echo "
"; + echo ""; + + echo "

"; + echo "
"; + + echo "
"; + echo ""; + echo ""; + echo "
"; + + echo ""; + echo "\n"; + Html::closeForm(); + } + + + public function findByProfileAndReport($profil_id, $report_id) + { + $prof = new self(); + $prof->getFromDBByCrit( + [ + 'profiles_id' => $profil_id, + 'reports' => $report_id, + ] + ); + return $prof; + } + + public function findReportByProfiles($profil_id) + { + $prof = new self(); + $prof->getFromDBByCrit( + [ + 'profiles_id' => $profil_id, + ] + ); + return $prof; + } + + + public static function canViewReports($profil_id, $report_id) + { + $prof = new self(); + $res = $prof->getFromDBByCrit( + [ + 'profiles_id' => $profil_id, + 'reports' => $report_id, + ] + ); + + if ($res && $prof->fields['right'] == READ) { + return true; + } + + return false; + } + + // Hook done on add item case + public static function addProfiles(Profile $item) + { + if ($item->getType() == 'Profile' && $item->getField('interface') != 'helpdesk') { + PluginMreportingProfile::addRightToProfile($item->getID()); + } + + return true; + } } diff --git a/inc/tag.class.php b/inc/tag.class.php index ef72face..d66aefe4 100644 --- a/inc/tag.class.php +++ b/inc/tag.class.php @@ -1,34 +1,35 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -class PluginMreportingTag Extends PluginMreportingBaseclass { - +class PluginMreportingTag extends PluginMreportingBaseclass +{ /** * Default pie graph for the use of tags. * For all linked itemtypes without filter. @@ -36,30 +37,30 @@ class PluginMreportingTag Extends PluginMreportingBaseclass { * @param array $config (optionnal) * @return array $datas array of query results (tag => count number) */ - function reportPieTag($config = []) { - global $DB; + public function reportPieTag($config = []) + { + global $DB; - $plugin = new Plugin(); - if (!$plugin->isActivated('tag')) { - return []; - } + if (!Plugin::isPluginActive('tag')) { + return []; + } - $_SESSION['mreporting_selector'][__FUNCTION__] = []; + $_SESSION['mreporting_selector'][__FUNCTION__] = []; - $datas = []; + $datas = []; - $result = $DB->query("SELECT COUNT(*) as count_tag, glpi_plugin_tag_tags.name as name + $result = $DB->query("SELECT COUNT(*) as count_tag, glpi_plugin_tag_tags.name as name FROM glpi_plugin_tag_tagitems LEFT JOIN glpi_plugin_tag_tags ON plugin_tag_tags_id = glpi_plugin_tag_tags.id GROUP BY plugin_tag_tags_id ORDER BY count_tag DESC"); - while ($datas_tag = $DB->fetchAssoc($result)) { - $label = $datas_tag['name']; - $datas['datas'][$label] = $datas_tag['count_tag']; - } + while ($datas_tag = $DB->fetchAssoc($result)) { + $label = $datas_tag['name']; + $datas['datas'][$label] = $datas_tag['count_tag']; + } - return $datas; - } + return $datas; + } /** * Pie graph for the use of tags in Ticket, @@ -68,22 +69,22 @@ function reportPieTag($config = []) { * @param array $config (optionnal) * @return array $datas array of query results (tag => count number) */ - function reportPieTagOnTicket($config = []) { - global $DB; + public function reportPieTagOnTicket($config = []) + { + global $DB; - $plugin = new Plugin(); - if (!$plugin->isActivated('tag')) { - return []; - } + if (!Plugin::isPluginActive('tag')) { + return []; + } - $_SESSION['mreporting_selector'][__FUNCTION__] = ['category']; + $_SESSION['mreporting_selector'][__FUNCTION__] = ['category']; - $sql_itilcat = isset($_SESSION['mreporting_values']['itilcategories_id']) && $_SESSION['mreporting_values']['itilcategories_id'] > 0 ? - " AND glpi_tickets.itilcategories_id = ".$_SESSION['mreporting_values']['itilcategories_id'] : ""; + $sql_itilcat = isset($_SESSION['mreporting_values']['itilcategories_id']) && $_SESSION['mreporting_values']['itilcategories_id'] > 0 ? + " AND glpi_tickets.itilcategories_id = " . $_SESSION['mreporting_values']['itilcategories_id'] : ""; - $datas = []; + $datas = []; - $result = $DB->query("SELECT COUNT(*) as count_tag, glpi_plugin_tag_tags.name + $result = $DB->query("SELECT COUNT(*) as count_tag, glpi_plugin_tag_tags.name FROM glpi_plugin_tag_tagitems LEFT JOIN glpi_plugin_tag_tags ON plugin_tag_tags_id = glpi_plugin_tag_tags.id LEFT JOIN glpi_tickets ON glpi_tickets.id = glpi_plugin_tag_tagitems.items_id @@ -91,12 +92,11 @@ function reportPieTagOnTicket($config = []) { $sql_itilcat GROUP BY plugin_tag_tags_id ORDER BY count_tag DESC"); - while ($datas_tag = $DB->fetchAssoc($result)) { - $label = $datas_tag['name']; - $datas['datas'][$label] = $datas_tag['count_tag']; - } - - return $datas; - } - -} \ No newline at end of file + while ($datas_tag = $DB->fetchAssoc($result)) { + $label = $datas_tag['name']; + $datas['datas'][$label] = $datas_tag['count_tag']; + } + + return $datas; + } +} diff --git a/index.php b/index.php index e9ffab8f..bdc43b80 100644 --- a/index.php +++ b/index.php @@ -1,2 +1,31 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + header('Location: front/central.php'); diff --git a/js/helpdesk-menu.js b/js/helpdesk-menu.js index e7ba28f2..ac3eed4b 100644 --- a/js/helpdesk-menu.js +++ b/js/helpdesk-menu.js @@ -1,3 +1,31 @@ +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + $( document ).ready(function() { var urlAjax = CFG_GLPI.root_doc+"/"+GLPI_PLUGINS_PATH.mreporting+"/ajax/homepage_link.php"; $.post( urlAjax, function( data ) { diff --git a/lib/imagesmootharc/example.php b/lib/imagesmootharc/example.php old mode 100755 new mode 100644 diff --git a/locales/cs_CZ.mo b/locales/cs_CZ.mo index 3aec7337..6e285e6f 100644 Binary files a/locales/cs_CZ.mo and b/locales/cs_CZ.mo differ diff --git a/locales/cs_CZ.po b/locales/cs_CZ.po index b4392f96..43224f85 100644 --- a/locales/cs_CZ.po +++ b/locales/cs_CZ.po @@ -9,266 +9,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-06-28 11:42+0000\n" -"Last-Translator: Pavel Borecki \n" -"Language-Team: Czech (Czech Republic) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/cs_CZ/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Pavel Borecki , 2018\n" +"Language-Team: Czech (Czech Republic) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/cs_CZ/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: cs_CZ\n" "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Rozšířené výkazy" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Není k dispozici žádný výkaz!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Obecný výkaz – ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Přidat/odebrat software v počítači" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Dobrý den,

\n\n

Jsou k dispozici výkazy z GLPI.
\nNaleznete je v příloze tohoto e-mailu.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Přidat/odebrat verzi software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Přidat výkaz" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Přidat finanční informace" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Přidat/odebrat profil uživatele" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Přidat/odebrat skupinu uživatele" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Uživatel smazán z LDAP adresáře" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Přidat/odebrat položku" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Záznam událostí (log) z webových služeb" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Přidat/odebrat profil uživatele" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informace z OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Přidat/odebrat sezení" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Přidat/odebrat software v počítači" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Přidat/odebrat verzi software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Přidat/aktualizovat/odebrat zařízení" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Přidat/odebrat sezení" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Dodatečná podmínka pro MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Přidat/odebrat položku" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automaticky vytvořeno systémem GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Třída" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Komentáře a date_mod změny" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Záznamy (log) zásuvného modulu Obecný objekt" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Nastavení" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Správa práv" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Nastavit výkaz" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Ve svých předvolbách vyberte model" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Křivky (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Přehled" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Seznam výkazů" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Přehled je prázdný. Přidejte výkaz kliknutím na ikonu" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Bez dat" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Výchozí formát grafu" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "S daty" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Výchozí prodleva" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Počet" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Statistické výkazy z GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "data" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Obecný výkaz – ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Není k dispozici žádný model" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Záznamy (log) zásuvného modulu Obecný objekt" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Nebyl vybrán žádný obrázek" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Dobrý den,\n\nJsou k dispozici výkazy z GLPI.\nNaleznete je v příloze tohoto e-mailu.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Týden" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializovat nastavení grafiky" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Maximální hloubka ve stromu entit" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Měsíc" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Maximální hloubka ve stromu entit" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Rozšířené výkazy" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Oznámení pro „Rozšířené výkazy“" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Nebyla nalezena žádná data pro toto časové rozmezí!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Dobrý den,

\n\n

Jsou k dispozici výkazy z GLPI.
\nNaleznete je v příloze tohoto e-mailu.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Nebyl vybrán žádný obrázek" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Statistické výkazy z GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Není k dispozici žádný model" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Dobrý den,\n\nJsou k dispozici výkazy z GLPI.\nNaleznete je v příloze tohoto e-mailu.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Není k dispozici žádný výkaz!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Oznámení pro „Rozšířené výkazy“" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Oznámení odeslána!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Nebyla nalezena žádná data pro toto časové rozmezí!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Počet" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Neurčeno" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informace z OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Nastavení" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Objekt už existuje" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Zobrazit oblast" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Při najetí kurzorem" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Křivky (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Ve svých předvolbách vyberte model" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Zobrazit hodnoty" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Seznam výkazů" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Reverzní pole dat" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Jednotka" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Výchozí prodleva" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Správa práv" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Dodatečná podmínka pro MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Zobrazit oblast" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Zobrazit grafiku" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Třída" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Zobrazit hodnoty" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Výchozí formát grafu" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Vyberte výkaz, který chcete přidat" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Vyberte výkaz, který chcete zobrazit" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Odeslat tento výkaz s oznámením" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inicializovat nastavení grafiky" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Při najetí kurzorem" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Neurčeno" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Objekt už existuje" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Jednotka" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Vyberte výkaz, který chcete zobrazit" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Uživatel smazán z LDAP adresáře" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Přehled je prázdný. Přidejte výkaz kliknutím na ikonu" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Záznam událostí (log) z webových služeb" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Přidat výkaz" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Týden" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Vyberte výkaz, který chcete přidat" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "S daty" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Nastavit výkaz" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Bez dat" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automaticky vytvořeno systémem GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "data" diff --git a/locales/de_DE.mo b/locales/de_DE.mo index ecb64dd3..c2b560ed 100644 Binary files a/locales/de_DE.mo and b/locales/de_DE.mo differ diff --git a/locales/de_DE.po b/locales/de_DE.po index e0976400..c40d47a5 100644 --- a/locales/de_DE.po +++ b/locales/de_DE.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-10-22 07:04+0000\n" -"Last-Translator: Stephan \n" -"Language-Team: German (Germany) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/de_DE/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Stephan , 2018\n" +"Language-Team: German (Germany) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/de_DE/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de_DE\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "More Reporting" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Kein Report verfügbar!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Allgemeiner Bericht - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Software einem Computer hinzufügen/entfernen" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hallo,

\n\n

es sind GLPI-Berichte verfügbar.
\nDiese sind im Anhang dieser E-Mail.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Version einer Software hinzufügen/entfernen" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Bericht hinzufügen" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Infocom hinzufügen" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Profil eines Nutzers hinzufügen/entfernen" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Gruppe eines Nutzers hinzufügen/entfernen" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Nutzer vom LDAP gelöscht" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Element hinzufügen/entfernen" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Webservice Logs" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Profil eines Nutzers hinzufügen/entfernen" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS Informationen" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Beziehung hinzufügen/entfernen" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Software einem Computer hinzufügen/entfernen" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Version einer Software hinzufügen/entfernen" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Gerät hinzufügen/aktualisieren/entfernen" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Beziehung hinzufügen/entfernen" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Zusätzliche MySQL-Bedingungen" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Element hinzufügen/entfernen" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automatisch von GLPI erstellt" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Klasse" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Kommentare & date_mod Änderungen" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Genericobject Plugin Logs" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Konfiguration" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Rechteverwaltung" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Bericht konfigurieren" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Bitte wählen Sie ein Modell in den Einstellungen aus" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Liniendiagramm (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Dashboard" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Liste aller Berichte" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Das Dashboard ist noch leer. Bitte einen Bericht mit einem Klick auf das Icon hinzufügen." -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Ohne Daten" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Standarddiagrammformat" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Mit Daten" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Zeitraum in Tagen" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Anzahl" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI Statistik Report" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "Daten" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Allgemeiner Bericht - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Kein Modell verfügbar" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Genericobject Plugin Logs" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Keine Grafik ausgewählt" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hallo,\n\nes sind GLPI-Berichte verfügbar.\nDiese sind im Anhang dieser E-Mail.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Woche" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Grafikkonfiguration initialisieren" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Max. Tiefe der Einheiten" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Monat" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Max. Tiefe der Einheiten" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "More Reporting" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Benachrichtigung für \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Keine Daten für diesen Bereich verfügbar!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Hallo,

\n\n

es sind GLPI-Berichte verfügbar.
\nDiese sind im Anhang dieser E-Mail.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Keine Grafik ausgewählt" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "GLPI Statistik Report" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Kein Modell verfügbar" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Hallo,\n\nes sind GLPI-Berichte verfügbar.\nDiese sind im Anhang dieser E-Mail.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Kein Report verfügbar!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Benachrichtigung für \"More Reporting\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Benachrichtigung(en) gesendet!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Keine Daten für diesen Bereich verfügbar!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Anzahl" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Nicht definiert" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS Informationen" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Konfiguration" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Objekt existiert bereits" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Bereich anzeigen" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Beim Mause-Over" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Liniendiagramm (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Bitte wählen Sie ein Modell in den Einstellungen aus" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Werte anzeigen" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Liste aller Berichte" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Umgekehrtes Daten-Array" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Einheit" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Zeitraum in Tagen" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Rechteverwaltung" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Zusätzliche MySQL-Bedingungen" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Bereich anzeigen" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Grafik anzeigen" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Klasse" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Werte anzeigen" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Standarddiagrammformat" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Einen Bericht zum Hinzufügen auswählen" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Berichtsauswahl" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Diesen Bericht mit einer Benachrichtigung senden" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Grafikkonfiguration initialisieren" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Beim Mause-Over" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Nicht definiert" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Objekt existiert bereits" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Einheit" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Berichtsauswahl" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Nutzer vom LDAP gelöscht" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Das Dashboard ist noch leer. Bitte einen Bericht mit einem Klick auf das Icon hinzufügen." +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Webservice Logs" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Bericht hinzufügen" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Woche" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Einen Bericht zum Hinzufügen auswählen" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Mit Daten" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Bericht konfigurieren" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Ohne Daten" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automatisch von GLPI erstellt" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "Daten" diff --git a/locales/en_GB.mo b/locales/en_GB.mo index 68dbdd6c..bbe3cb0d 100644 Binary files a/locales/en_GB.mo and b/locales/en_GB.mo differ diff --git a/locales/en_GB.po b/locales/en_GB.po index ab86c67d..a88ece54 100644 --- a/locales/en_GB.po +++ b/locales/en_GB.po @@ -1,14 +1,14 @@ # English translations for PACKAGE package. -# Copyright (C) 2021 THE PACKAGE'S COPYRIGHT HOLDER +# Copyright (C) 2023 THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# Automatically generated, 2021. +# Automatically generated, 2023. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2021-03-09 15:12+0000\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2023-09-14 12:49+0000\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en_GB\n" @@ -17,155 +17,117 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "More Reporting" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "No report is available !" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "General Report - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Add/remove software on a computer" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Add/remove version on a software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Add a report" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Add infocom" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Add/remove profile on a user" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Add/remove group on a user" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "User deleted from LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Add/remove item" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Webservice logs" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Add/remove profile on a user" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS Infos" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Add/remove relation" -#: inc/other.class.php:100 +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Add/remove software on a computer" + +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Add/remove version on a software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Add/update/remove device" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Add/remove relation" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Additional condition for MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Add/remove item" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automaticaly generated by GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Class" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Comments & date_mod changes" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Genericobject plugin logs" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuration" -#: inc/profile.class.php:70 inc/profile.class.php:216 inc/profile.class.php:288 -msgid "Rights management" -msgstr "Rights management" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configure report" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Please, select a model in your preferences" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Curve lines (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Dashboard" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Reports list" - -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Without data" - -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "With data" - -#: inc/common.class.php:929 -msgid "Number" -msgstr "Number" - -#: inc/common.class.php:950 inc/common.class.php:1253 inc/common.class.php:1269 -msgid "data" -msgstr "data" - -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "No model available" - -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "No graphic selected" - -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Week" - -#: inc/common.class.php:1407 -msgid "Month" -msgstr "Month" - -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Max depth entity level" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Dashboard is empty. Please add reports by clicking on the icon" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notification for \"More Reporting\"" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Default chart format" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Default delay" -#: inc/notification.class.php:46 inc/pdf.class.php:15 +#: inc/pdf.class.php:44 inc/notification.class.php:75 msgid "GLPI statistics reports" msgstr "GLPI statistics reports" -#: inc/notification.class.php:47 +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "General Report - ODT" + +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Genericobject plugin logs" + +#: inc/notification.class.php:76 msgid "" "Hello,\n" "\n" @@ -179,103 +141,142 @@ msgstr "" "You will find attached in this email.\n" "\n" -#: inc/notification.class.php:153 -msgid "Notification(s) sent !" -msgstr "Notification(s) sent !" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Initialize graphics configuration" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Max depth entity level" + +#: inc/common.class.php:1421 +msgid "Month" +msgstr "Month" + +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "More Reporting" + +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 msgid "No data for this date range !" msgstr "No data for this date range !" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Undefined" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "No graphic selected" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuration" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "No model available" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "See area" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "No report is available !" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Curve lines (SVG)" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notification for \"More Reporting\"" -#: inc/config.class.php:100 -msgid "See values" -msgstr "See values" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" +msgstr "Notification(s) sent !" + +#: inc/common.class.php:942 +msgid "Number" +msgstr "Number" + +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS Infos" + +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Object already exists" + +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "On mouse over" + +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Please, select a model in your preferences" + +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Reports list" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Reverse data array" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unit" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Default delay" +#: inc/profile.class.php:72 inc/profile.class.php:224 inc/profile.class.php:296 +msgid "Rights management" +msgstr "Rights management" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Additional condition for MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "See area" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "See graphic" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Class" +#: inc/config.class.php:102 +msgid "See values" +msgstr "See values" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Default chart format" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Select a report to add" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Select a report to display" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Send this report with the notification" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Initialize graphics configuration" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "On mouse over" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Undefined" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Object already exists" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unit" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Select a report to display" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "User deleted from LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Webservice logs" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Add a report" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Week" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Select a report to add" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "With data" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configure report" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Without data" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automaticaly generated by GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 inc/common.class.php:1282 +msgid "data" +msgstr "data" diff --git a/locales/en_US.mo b/locales/en_US.mo index e4d4e1a0..c8a91e7c 100644 Binary files a/locales/en_US.mo and b/locales/en_US.mo differ diff --git a/locales/en_US.po b/locales/en_US.po index 5c32c5ad..cdca5f41 100644 --- a/locales/en_US.po +++ b/locales/en_US.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2019-02-07 13:56+0000\n" -"Last-Translator: Shawn Long \n" -"Language-Team: English (United States) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/en_US/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Shawn Long , 2017-2019\n" +"Language-Team: English (United States) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/en_US/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: en_US\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "More Reporting" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "No report is available !" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "General Report - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Add/remove software on a computer" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hello,

\n\n

GLPI reports are available.
\nYou will find attached in this email.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Add/remove version on a software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Add a report" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Add infocom" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Add/Remove profile on a user" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Add/Remove group on a user" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "User deleted from LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Add/Remove item" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Webservice logs" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Add/Remove profile on a user" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS Infos" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Add/Remove relation" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Add/remove software on a computer" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Add/remove version on a software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Add/Update/Remove device" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Add/Remove relation" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Additional Condition for MySQL/MariaDB" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Add/Remove item" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automatically generated by GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Class" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Comments & date_mod changes" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Generic object plugin logs" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuration" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Rights Management" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configure report" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Please, select a model in your preferences" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Curve Lines (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Dashboard" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Reports List" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Dashboard is empty. Please add reports by clicking on the icon" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Without Data" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Default Chart Format" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "With Data" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Default Delay" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Number" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI Statistics Reports" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "data" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "General Report - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "No model available" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Generic object plugin logs" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "No graphic selected" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hello,\n\nGLPI reports are available.\nYou will find attached in this email.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Week" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Initialize graphics configuration" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Max depth entity level" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Month" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Max depth entity level" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "More Reporting" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notification for \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "No data for this date range !" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Hello,

\n\n

GLPI reports are available.
\nYou will find attached in this email.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "No graphic selected" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "GLPI Statistics Reports" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "No model available" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Hello,\n\nGLPI reports are available.\nYou will find attached in this email.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "No report is available !" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notification for \"More Reporting\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Notification(s) sent !" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "No data for this date range !" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Number" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Undefined" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS Infos" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuration" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Object already exists" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "See Area" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "On mouse over" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Curve Lines (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Please, select a model in your preferences" -#: inc/config.class.php:100 -msgid "See values" -msgstr "See Values" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Reports List" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Reverse data array" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unit" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Default Delay" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Rights Management" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Additional Condition for MySQL/MariaDB" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "See Area" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "See graphic" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Class" +#: inc/config.class.php:102 +msgid "See values" +msgstr "See Values" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Default Chart Format" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Select a report to add" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Select a report to display" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Send this report with the notification" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Initialize graphics configuration" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "On mouse over" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Undefined" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Object already exists" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unit" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Select a report to display" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "User deleted from LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Webservice logs" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Add a report" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Week" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Select a report to add" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "With Data" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configure report" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Without Data" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automatically generated by GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "data" diff --git a/locales/es_AR.mo b/locales/es_AR.mo index 8b7591c8..cf2e290d 100644 Binary files a/locales/es_AR.mo and b/locales/es_AR.mo differ diff --git a/locales/es_AR.po b/locales/es_AR.po index 401b8bd6..1b421765 100644 --- a/locales/es_AR.po +++ b/locales/es_AR.po @@ -1,257 +1,273 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Spanish (Argentina) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_AR/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Spanish (Argentina) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_AR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_AR\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/common.class.php:910 -msgid "Number" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/common.class.php:1132 -msgid "No model available" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/common.class.php:1140 -msgid "No graphic selected" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" msgstr "" -#: inc/config.class.php:38 +#: inc/config.class.php:40 msgid "Configuration" msgstr "" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" msgstr "" -#: inc/config.class.php:82 -msgid "See values" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" msgstr "" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" msgstr "" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/config.class.php:113 -msgid "Class" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" msgstr "" -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/config.class.php:525 -msgid "Object already exists" +#: inc/common.class.php:1421 +msgid "Month" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/es_CO.mo b/locales/es_CO.mo index 5e783858..6fa82874 100644 Binary files a/locales/es_CO.mo and b/locales/es_CO.mo differ diff --git a/locales/es_CO.po b/locales/es_CO.po index ec65e8a2..1bef09e3 100644 --- a/locales/es_CO.po +++ b/locales/es_CO.po @@ -3,271 +3,272 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# Haider Ilich López Areiza , 2018-2019 +# Haider López , 2018-2019 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2019-04-03 23:33+0000\n" -"Last-Translator: Haider Ilich López Areiza \n" -"Language-Team: Spanish (Colombia) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_CO/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Haider López , 2018-2019\n" +"Language-Team: Spanish (Colombia) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_CO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_CO\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Más informes" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Reporte no esta disponible!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Reporte general - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Agregar/eliminar software en una computadora" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hola,

\n\n

Los reportes GLPI están disponibles
\nLo encontrará adjunto en este correo electrónico.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Agregar/eliminar versión en un software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Agregar un reporte" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Agregar información" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Añadir/eliminar perfil en un usuario" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Agregar/eliminar grupo en un usuario" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Usuario eliminado de LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Agregar/eliminar elemento" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Registros de servicios web" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Añadir/eliminar perfil en un usuario" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informaciones de OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Agregar/eliminar relación" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Agregar/eliminar software en una computadora" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Agregar/eliminar versión en un software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Agregar/actualizar/remover dispositivo" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Agregar/eliminar relación" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condición adicional para MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Agregar/eliminar elemento" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Generado automáticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Clase" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Comentarios y cambios de date_mod" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Registros del complemento Genericobject" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuración" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Gestión de permisos" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar reporte" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Por favor, seleccione un modelo en sus preferencias" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Líneas curvas (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Tablero" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Lista de informes" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "El tablero está vacío. Agregue informes haciendo clic en el icono" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Sin datos" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato de gráfico predeterminado" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Con datos" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Retraso predeterminado" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Número" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Informes de estadísticas GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "Datos" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Reporte general - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Modelo no disponible" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Registros del complemento Genericobject" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Gráfico no seleccionado" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hola,\n\nLos informes GLPI están disponibles.\nLo encontrará adjunto en este correo electrónico.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Semana" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializar la configuración de gráficos" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Máxima profundidad a nivel de entidad" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Mes" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Máxima profundidad a nivel de entidad" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Más informes" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notificación para \"Más informes\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "¡Sin datos para este rango de fechas!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Hola,

\n\n

Los reportes GLPI están disponibles
\nLo encontrará adjunto en este correo electrónico.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Gráfico no seleccionado" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Informes de estadísticas GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Modelo no disponible" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Hola,\n\nLos informes GLPI están disponibles.\nLo encontrará adjunto en este correo electrónico.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Reporte no esta disponible!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificación para \"Más informes\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Notificación(es) enviada(s)!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "¡Sin datos para este rango de fechas!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Número" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Indefinido" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informaciones de OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuración" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "El objeto ya existe" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Mirar área" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "El ratón por encima" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Líneas curvas (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, seleccione un modelo en sus preferencias" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Ver valores" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista de informes" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Matriz de datos invertida" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unidad" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Retraso predeterminado" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestión de permisos" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Condición adicional para MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Mirar área" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Ver gráfico" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Clase" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Formato de gráfico predeterminado" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Seleccionar un reporte para agregar" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Seleccione un informe para mostrar" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Envíe este informe con la notificación" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inicializar la configuración de gráficos" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "El ratón por encima" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "El objeto ya existe" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidad" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Seleccione un informe para mostrar" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Usuario eliminado de LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "El tablero está vacío. Agregue informes haciendo clic en el icono" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Registros de servicios web" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Agregar un reporte" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semana" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Seleccionar un reporte para agregar" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Con datos" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configurar reporte" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sin datos" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Generado automáticamente por GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "Datos" diff --git a/locales/es_EC.mo b/locales/es_EC.mo new file mode 100644 index 00000000..02d70523 Binary files /dev/null and b/locales/es_EC.mo differ diff --git a/locales/es_EC.po b/locales/es_EC.po new file mode 100644 index 00000000..33cbd7a2 --- /dev/null +++ b/locales/es_EC.po @@ -0,0 +1,274 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# Soporte Infraestructura Standby, 2023 +msgid "" +msgstr "" +"Project-Id-Version: GLPI Plugin - MReporting\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Soporte Infraestructura Standby, 2023\n" +"Language-Team: Spanish (Ecuador) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_EC/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: es_EC\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hola,

\n\n

Los informes GLPI están disponibles.
\nUsted encontrará adjunto en este correo electrónico.

\n\n" + +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Agregar un informe" + +#: inc/other.class.php:78 +msgid "Add infocom" +msgstr "Agregar infocom" + +#: inc/other.class.php:84 +msgid "Add/remove group on a user" +msgstr "Agregar/quitar grupo a un usuario" + +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Agregar /quitar elemento" + +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Agregar /quitar perfil en un usuario" + +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Agregar /quitar relación" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Agregar/quitar software en un equipo" + +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Agregar/eliminar versión de un software" + +#: inc/other.class.php:102 +msgid "Add/update/remove device" +msgstr "Agregar/actualizar/quitar dispositivo" + +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condición adicional para MySQL" + +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Generado automáticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Clase" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "Comentarios y cambios en date_mod" + +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuración " + +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar informe" + +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Líneas curvas (SVG)" + +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" +msgstr "Cuadro de mandos" + +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "El panel de control está vacío. Añada informes haciendo clic en el icono" + +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato de gráfico predeterminado" + +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Retraso predeterminado" + +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Informes estadísticos GLPI" + +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Informe General - ODT" + +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Registros de plugin de objetos genéricos" + +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hola\n\nLos informes GLPI están disponibles.\nLo encontrará adjunto en este correo electrónico.\n\n" + +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializar la configuración gráfica" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Nivel de entidad de profundidad máxima" + +#: inc/common.class.php:1421 +msgid "Month" +msgstr "Mes" + +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Más informes" + +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "¡No hay datos para este rango de fechas!" + +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "No se ha seleccionado ningún gráfico" + +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "No hay modelo disponible" + +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "¡No hay ningún informe disponible!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificación para \"Más informes\"" + +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" +msgstr "Notificación(es) enviada!" + +#: inc/common.class.php:942 +msgid "Number" +msgstr "Número" + +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Información de OCS" + +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "El objeto ya existe" + +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Al pasar el mouse por encima" + +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, seleccione un modelo en sus preferencias" + +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista de informes" + +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" +msgstr "Matriz de datos inversa" + +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestión de derechos" + +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Ver área" + +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" +msgstr "Ver gráfico" + +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" + +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Seleccione un informe para agregar" + +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Seleccione un informe para mostrar" + +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" +msgstr "Enviar este informe con la notificación" + +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" + +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidad" + +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Usuario eliminado de LDAP" + +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Registro de servicios web" + +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semana" + +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Con datos" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sin datos" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "datos" diff --git a/locales/es_ES.mo b/locales/es_ES.mo index b6f68d6e..b937fade 100644 Binary files a/locales/es_ES.mo and b/locales/es_ES.mo differ diff --git a/locales/es_ES.po b/locales/es_ES.po index 4a97578b..02e7a26f 100644 --- a/locales/es_ES.po +++ b/locales/es_ES.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-06-28 08:41+0000\n" -"Last-Translator: Cédric Anne\n" -"Language-Team: Spanish (Spain) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_ES/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: 5b63a00e0726b96d7ef35c99d5553cd0_b787b5f <8bb2d0f7e8927228f17fba8639d787be_31711>, 2016\n" +"Language-Team: Spanish (Spain) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_ES/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_ES\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Más Informes" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "¡No hay reporte disponible!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Reporte General - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Agregar/eliminar software en un computador" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hola,

\n\n

Los reportes GLPI están disponibles.
\nTu puedes buscar los adjuntos en este email.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Agregar/eliminar versión de un software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Agregar reporte" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Agregar información" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Agregar/eliminar perfil en un usuario" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Agregar/eliminar grupo sobre un usuario" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Usuario borrado desde LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Agregar/eliminar item" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Registros del servicio Web" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Agregar/eliminar perfil en un usuario" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informaciones OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Agregar/eliminar relación" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Agregar/eliminar software en un computador" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Agregar/eliminar versión de un software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Agregar/actualizar dispositivo" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Agregar/eliminar relación" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condición adicional para MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Agregar/eliminar item" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Generado autom´ticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Clase" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Comentarios y cambios date_mod" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Registro del plugin de objeto genérico" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuración" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Gestión de derechos" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar reporte" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Por favor, seleccione un modelo en tus preferencias" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Dashboard" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Lista de reportes" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Sin data" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Con data" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Retraso predeterminado" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Números" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "reportes de estadísticas GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "data" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Reporte General - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "No modelo disponible" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Registro del plugin de objeto genérico" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "No hay gráfico seleccionado" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hola,\n\nLos reportes GLPI están disponibles.\nTu puedes buscar los adjuntos en este email\n\n" -#: inc/common.class.php:1406 -msgid "Week" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializar configuración de gráficos" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/common.class.php:1407 +#: inc/common.class.php:1421 msgid "Month" msgstr "" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Más Informes" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notificación para \"Más informes\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "No hay data para este rango" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Hola,

\n\n

Los reportes GLPI están disponibles.
\nTu puedes buscar los adjuntos en este email.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "No hay gráfico seleccionado" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "reportes de estadísticas GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "No modelo disponible" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Hola,\n\nLos reportes GLPI están disponibles.\nTu puedes buscar los adjuntos en este email\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "¡No hay reporte disponible!" -#: inc/notification.class.php:153 +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificación para \"Más informes\"" + +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "¡Notificacion(es) enviada(s)!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "No hay data para este rango" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Números" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Indefinido" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informaciones OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuración" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Ya existe el objeto" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Ver area" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Cuando el ratón esté por encima" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, seleccione un modelo en tus preferencias" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Ver valores" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista de reportes" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Matriz de datos invertida" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unidad" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Retraso predeterminado" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestión de derechos" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Condición adicional para MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Ver area" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Ver gráfico" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Clase" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Seleccione un reporte para agregar" + +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Selecciona un reporte para mostrar" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Enviar este reporte con la notificación" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inicializar configuración de gráficos" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Cuando el ratón esté por encima" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidad" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Ya existe el objeto" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Usuario borrado desde LDAP" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Selecciona un reporte para mostrar" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Registros del servicio Web" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Agregar reporte" - -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Seleccione un reporte para agregar" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Con data" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configurar reporte" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sin data" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Generado autom´ticamente por GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "data" diff --git a/locales/es_MX.mo b/locales/es_MX.mo index 902cd767..9eff8245 100644 Binary files a/locales/es_MX.mo and b/locales/es_MX.mo differ diff --git a/locales/es_MX.po b/locales/es_MX.po index 964c112c..e437f21f 100644 --- a/locales/es_MX.po +++ b/locales/es_MX.po @@ -1,257 +1,274 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: +# Jesus Fernandez , 2021 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Spanish (Mexico) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_MX/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Jesus Fernandez , 2021\n" +"Language-Team: Spanish (Mexico) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_MX/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es_MX\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" -msgstr "" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" -msgstr "" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hola,

\n\n

Reportes del GLPI disponibles.
\nLos encontrara adjuntos en este correo.

\n" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" -msgstr "" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Agregar un reporte" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" -msgstr "" +#: inc/other.class.php:78 +msgid "Add infocom" +msgstr "Agregar infocom" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" -msgstr "" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" +msgstr "Agregar / remover grupo en un usuario" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" -msgstr "" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Agregar / remover articulo" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" -msgstr "" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Agregar / remover perfil en un usuario" -#: inc/common.class.php:910 -msgid "Number" -msgstr "" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Agregar / remover relación" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" -msgstr "" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Agregar / remover software en la computadora" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" -msgstr "" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Agregar / remover versión del software" -#: inc/common.class.php:1132 -msgid "No model available" -msgstr "" +#: inc/other.class.php:102 +msgid "Add/update/remove device" +msgstr "Agregar / actualizar / remover dispositivo" -#: inc/common.class.php:1140 -msgid "No graphic selected" -msgstr "" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condición adicional para el Mysql" + +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Generado automáticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Clase" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "Comentarios y cambios en date_mod" -#: inc/config.class.php:38 +#: inc/config.class.php:40 msgid "Configuration" -msgstr "" +msgstr "Configuración" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" -msgstr "" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar reporte" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" -msgstr "" +msgstr "Lineas curvas (SVG)" -#: inc/config.class.php:82 -msgid "See values" -msgstr "" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" +msgstr "Tablero" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" -msgstr "" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Tablero vacío. Por favor agregue reportes haciendo click en el icono." -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" -msgstr "" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato por defecto de los caracteres" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" -msgstr "" +msgstr "Retardo por defecto" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" -msgstr "" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Reportes estadísticos GLPI" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" -msgstr "" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Reporte general - ODT" -#: inc/config.class.php:113 -msgid "Class" -msgstr "" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Bitácoras del complemento objeto genérico" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" -msgstr "" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hola,\n\nReportes del GLPI disponibles.\nLos encontrara adjuntos en este correo.\n\n" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" -msgstr "" - -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" -msgstr "" - -#: inc/config.class.php:525 -msgid "Object already exists" -msgstr "" +msgstr "Inicializar la configuración de los gráficos" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Máximo nivel de profundidad de entidades" + +#: inc/common.class.php:1421 +msgid "Month" +msgstr "Mes" + +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Más reportes" + +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "¡No hay datos para este rango de fechas!" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "No selecciono grafico" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Sin modelo disponible" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "¡Sin reportes disponibles!" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificación para \"más reportes\"" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" +msgstr "¡Notificación(es) enviadas!" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" -msgstr "" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Numero" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" -msgstr "" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Información del OCS" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" -msgstr "" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "El objeto ya existe" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Al poner el mouse encima" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, seleccione un modelo de su preferencia" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Listado de reportes" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" -msgstr "" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" +msgstr "Arreglo de datos Inverso" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Administración de permisos" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Ver área" -#: inc/other.class.php:76 -msgid "Add infocom" -msgstr "" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" +msgstr "Ver grafica" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" -msgstr "" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Seleccione el reporte a agregar" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Seleccione un reporte a mostrar" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" +msgstr "Mandar el reporte con la notificación" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" -#: inc/other.class.php:100 -msgid "Add/update/remove device" -msgstr "" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidad" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Usuario borrado del LDAP" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Bitácoras del webservice" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" -msgstr "" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semana" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Con datos" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sin datos" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" -msgstr "" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "datos" diff --git a/locales/es_VE.mo b/locales/es_VE.mo new file mode 100644 index 00000000..47de9637 Binary files /dev/null and b/locales/es_VE.mo differ diff --git a/locales/es_VE.po b/locales/es_VE.po new file mode 100644 index 00000000..cbd7a513 --- /dev/null +++ b/locales/es_VE.po @@ -0,0 +1,274 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# Francisco Bolivar, 2022 +msgid "" +msgstr "" +"Project-Id-Version: GLPI Plugin - MReporting\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Francisco Bolivar, 2022\n" +"Language-Team: Spanish (Venezuela) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/es_VE/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: es_VE\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hola,

\n\n

Los reportes GLPI están disponibles.
\nTu puedes buscar los adjuntos en este correo.

\n\n" + +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Agregar reporte" + +#: inc/other.class.php:78 +msgid "Add infocom" +msgstr "Agregar información" + +#: inc/other.class.php:84 +msgid "Add/remove group on a user" +msgstr "Agregar/eliminar grupo sobre un usuario" + +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Agregar/eliminar item" + +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Agregar/eliminar perfil en un usuario" + +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Agregar/eliminar relación" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Agregar/eliminar software en un computador" + +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Agregar/eliminar versión de un software" + +#: inc/other.class.php:102 +msgid "Add/update/remove device" +msgstr "Agregar/actualizar dispositivo" + +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condición adicional para MySQL" + +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Generado automaticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Clase" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "Comentarios y cambios date_mod" + +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuración" + +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar reporte" + +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Curvilíneas (SVG)" + +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" +msgstr "Tablero" + +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "El Tablero esta vacio. Por favor agrege reportes dando clic en el icono" + +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato gráfico predeterminado" + +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Retraso predeterminado" + +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Reportes de estadísticas GLPI" + +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Reporte General - ODT" + +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Registro del plugin de objeto genérico" + +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hola,\n\nLos reportes GLPI están disponibles.\nTu puedes buscar los adjuntos en este correo\n\n" + +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializar configuración de gráficos" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Profundidad máxima de nivel de entidad" + +#: inc/common.class.php:1421 +msgid "Month" +msgstr "Mes" + +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Más Informes" + +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "¡No hay data para este rango!" + +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "No hay gráfico seleccionado" + +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Ningún modelo disponible" + +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "¡No hay reporte disponible!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificación para \"Más informes\"" + +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" +msgstr "¡Notificacion(es) enviada(s)!" + +#: inc/common.class.php:942 +msgid "Number" +msgstr "Número" + +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informaciones OCS" + +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Ya existe el objeto" + +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Cuando el ratón esté por encima" + +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, seleccione un modelo en tus preferencias" + +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista de reportes" + +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" +msgstr "Matriz de datos invertida" + +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestión de derechos" + +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Ver area" + +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" +msgstr "Ver gráfico" + +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" + +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Seleccione un reporte para agregar" + +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Selecciona un reporte para mostrar" + +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" +msgstr "Enviar este reporte con la notificación" + +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" + +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidad" + +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Usuario borrado desde LDAP" + +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Registros del servicio Web" + +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semana" + +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Con data" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sin data" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "data" diff --git a/locales/fi_FI.mo b/locales/fi_FI.mo index 15f97d61..29432db7 100644 Binary files a/locales/fi_FI.mo and b/locales/fi_FI.mo differ diff --git a/locales/fi_FI.po b/locales/fi_FI.po index e000dcfb..9f43be36 100644 --- a/locales/fi_FI.po +++ b/locales/fi_FI.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-08-19 06:25+0000\n" -"Last-Translator: Markku Vepsä\n" -"Language-Team: Finnish (Finland) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/fi_FI/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Markku Vepsä, 2018\n" +"Language-Team: Finnish (Finland) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/fi_FI/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fi_FI\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Lisää Raportteja" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Raporttia ei ole saatavilla!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Yleisraportti - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Lisää/poista ohjelmisto tietokoneesta" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Hei,

\n\n

GLPI raportteja on saatavilla.
\nLöydät ne tämän sähköpostiviestin liitteinä.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Lisää/poista versio ohjelmistosta" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Lisää raportti" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Lisää \"infocom\" tietoja" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Lisää/poista profiili käyttäjältä" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Lisää/poista ryhmä käyttäjältä" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Käyttäjä poistettu LDAP:stä" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Lisää/poista kohde" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "WWW-sovelluspalvelun lokit" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Lisää/poista profiili käyttäjältä" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS tiedot" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Lisää/poista yhteys" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Lisää/poista ohjelmisto tietokoneesta" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Lisää/poista versio ohjelmistosta" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Lisää/päivitä/poista laite" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Lisää/poista yhteys" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "MySQL lisäehdot" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Lisää/poista kohde" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "GLPI:n automaattisesti luoma" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Luokka" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Kommentit & date_mod muutokset" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Genericobject liitännäisen lokit" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Asetukset" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Käyttöoikeuksien hallinta" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Määritä raportti" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Valitse malli \"Omissa asetuksissa\"" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Käyrät (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Hallintapaneeli" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Raporttiluettelo" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Hallintapaneeli on tyhjä. Lisää raportteja klikkaamalla kuvaketta" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Ilman tietoja" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Oletuskaavion muoto" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Tiedoilla" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Oletusviive" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Määrä" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI tilastoraportit" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "tiedot" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Yleisraportti - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Mallia ei ole saatavilla" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Genericobject liitännäisen lokit" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Kuvaa ei ole valittu" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Hei,\n\nGLPI raportteja on saatavilla.\nLöydät ne tämän sähköpostiviestin liitteinä.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Viikko" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Alusta grafiikka-asetukset" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Suurin yksikkösyvyys" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Kuukausi" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Suurin yksikkösyvyys" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Lisää Raportteja" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "\"Lisää Raportteja\" -ilmoitukset" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Tälle ajanjaksolle ei ole tietoja!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Hei,

\n\n

GLPI raportteja on saatavilla.
\nLöydät ne tämän sähköpostiviestin liitteinä.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Kuvaa ei ole valittu" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "GLPI tilastoraportit" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Mallia ei ole saatavilla" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Hei,\n\nGLPI raportteja on saatavilla.\nLöydät ne tämän sähköpostiviestin liitteinä.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Raporttia ei ole saatavilla!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "\"Lisää Raportteja\" -ilmoitukset" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Ilmoitus/ilmoitukset lähetetty!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Tälle ajanjaksolle ei ole tietoja!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Määrä" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Määrittelemätön" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS tiedot" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Asetukset" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Kohde on jo olemassa" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Näytä alue" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Hiirellä" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Käyrät (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Valitse malli \"Omissa asetuksissa\"" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Näytä arvot" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Raporttiluettelo" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Käänteinen tietorakenne" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Yksikkö esim. kpl" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Oletusviive" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Käyttöoikeuksien hallinta" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "MySQL lisäehdot" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Näytä alue" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Näytä kuva" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Luokka" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Näytä arvot" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Oletuskaavion muoto" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Valitse lisättävä raportti" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Valitse näytettävä raportti" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Lähetä tämä raportti ilmoituksessa" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Alusta grafiikka-asetukset" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Hiirellä" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Määrittelemätön" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Kohde on jo olemassa" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Yksikkö esim. kpl" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Valitse näytettävä raportti" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Käyttäjä poistettu LDAP:stä" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Hallintapaneeli on tyhjä. Lisää raportteja klikkaamalla kuvaketta" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "WWW-sovelluspalvelun lokit" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Lisää raportti" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Viikko" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Valitse lisättävä raportti" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Tiedoilla" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Määritä raportti" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Ilman tietoja" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "GLPI:n automaattisesti luoma" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "tiedot" diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo index dd54b0e4..aaf97baa 100644 Binary files a/locales/fr_FR.mo and b/locales/fr_FR.mo differ diff --git a/locales/fr_FR.po b/locales/fr_FR.po index 03c67b38..4c8801fa 100644 --- a/locales/fr_FR.po +++ b/locales/fr_FR.po @@ -6,271 +6,272 @@ # alexandre delaunay , 2016 # Cédric Anne, 2018 # 06c8e5f1ec78ded2ceb41498ec52b068, 2015 -# Johan Cwiklinski , 2017 +# Johan Cwiklinski, 2017 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-06-28 09:31+0000\n" -"Last-Translator: Cédric Anne\n" -"Language-Team: French (France) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/fr_FR/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Cédric Anne, 2018\n" +"Language-Team: French (France) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/fr_FR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr_FR\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Plus de rapports" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Aucun rapport disponible !" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Rapport général - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Ajout/suppression d'un logiciel sur un ordinateur" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n\n

Bonjour,

\n\n

Les rapports de GLPI sont disponibles.
\nVous les trouverez en pièce jointe dans cet e-mail.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Ajout/suppression d'une version sur un logiciel" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Ajouter un rapport" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Ajout des informations financières" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Ajout/suppression d'un profil à un utilisateur" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Ajout/suppression d'un groupe à un utilisateur" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Utilisateur supprimé depuis LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Ajout/suppression d'un élément" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Logs Webservices" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Ajout/suppression d'un profil à un utilisateur" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Infos OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Ajout/suppression d'une relation" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Ajout/suppression d'un logiciel sur un ordinateur" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Ajout/suppression d'une version sur un logiciel" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Ajout/mise à jour/suppression d'un périphérique" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Ajout/suppression d'une relation" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condition supplémentaire Mysql" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Ajout/suppression d'un élément" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Généré automatiquement par GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Classe" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Modifications commentaires & date_mod" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Logs plugin Genericobjec" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuration" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Gestion des droits" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurer le rapport" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Merci de sélectionner un modèle dans vos préférences" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Incurver les lignes (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Tableau de bord" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Liste des rapports" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Le tableau de bord est vide. Merci d'ajouter des rapports en cliquant sur l'icône" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Sans les données" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Format de graphique par défaut" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Avec les données" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Délai par défaut" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Nombre" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Rapports statistiques de GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "Données" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Rapport général - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Aucun modèle n'existe" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Logs plugin Genericobjec" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "aucun graphique sélectionné" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Bonjour,\n\nLes rapports de GLPI sont disponibles.\nVous les trouverez en pièce jointe dans cet e-mail.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Semaine" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Initialiser la configuration des graphiques" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Profondeur maxi dans l'arborescence d'entités" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Mois" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Profondeur maxi dans l'arborescence d'entités" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Plus de rapports" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notification \"plus de rapports\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Aucune données pour cette plage de date !" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n\n

Bonjour,

\n\n

Les rapports de GLPI sont disponibles.
\nVous les trouverez en pièce jointe dans cet e-mail.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "aucun graphique sélectionné" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Rapports statistiques de GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Aucun modèle n'existe" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Bonjour,\n\nLes rapports de GLPI sont disponibles.\nVous les trouverez en pièce jointe dans cet e-mail.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Aucun rapport disponible !" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notification \"plus de rapports\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Notification(s) envoyée(s) !" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Aucune données pour cette plage de date !" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Nombre" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Non défini" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Infos OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuration" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "L'objet existe déjà" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Voir l'aire" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Au passage de la souris" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Incurver les lignes (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Merci de sélectionner un modèle dans vos préférences" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Voir les valeurs" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Liste des rapports" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Inverser le tableau de données" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unité" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Délai par défaut" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestion des droits" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Condition supplémentaire Mysql" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Voir l'aire" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Voir le graphique" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Classe" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Voir les valeurs" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Format de graphique par défaut" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Sélectionnez un rapport à ajouter" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Sélectionnez un rapport à afficher" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Envoyer ce rapport avec les notifications" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Initialiser la configuration des graphiques" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Au passage de la souris" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Non défini" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "L'objet existe déjà" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unité" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Sélectionnez un rapport à afficher" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Utilisateur supprimé depuis LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Le tableau de bord est vide. Merci d'ajouter des rapports en cliquant sur l'icône" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Logs Webservices" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Ajouter un rapport" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semaine" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Sélectionnez un rapport à ajouter" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Avec les données" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configurer le rapport" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sans les données" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Généré automatiquement par GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "Données" diff --git a/locales/hr_HR.mo b/locales/hr_HR.mo index 1c325944..71bd7eb3 100644 Binary files a/locales/hr_HR.mo and b/locales/hr_HR.mo differ diff --git a/locales/hr_HR.po b/locales/hr_HR.po index 27bf3c00..b6bddb62 100644 --- a/locales/hr_HR.po +++ b/locales/hr_HR.po @@ -3,272 +3,273 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# milotype , 2020 -# milotype , 2020 +# Milo Ivir , 2020 +# Milo Ivir , 2020 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2020-11-10 12:43+0000\n" -"Last-Translator: milotype \n" -"Language-Team: Croatian (Croatia) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/hr_HR/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Milo Ivir , 2020\n" +"Language-Team: Croatian (Croatia) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/hr_HR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hr_HR\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Prošireni izvještaji" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Nema izvještaja!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Opći izvještaj – ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Dodaj/ukloni softver za računalo" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Pozdrav,

\n\n

dostupni su GLPI izvještaji.
\nNalaze se u privitku ovog e-maila.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Dodaj/ukloni verziju za softver" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Dodaj izvještaj" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Dodaj infocom" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Dodaj/ukloni profil za korisnika" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Dodaj/ukloni grupu za korisnika" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Korisnik izbrisan iz LDAP-a" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Dodaj/ukloni predmet" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Log-zapisi web-usluge" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Dodaj/ukloni profil za korisnika" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS informacije" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Dodaj/ukloni odnos" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Dodaj/ukloni softver za računalo" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Dodaj/ukloni verziju za softver" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Dodaj/aktualiziraj/ukloni uređaje" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Dodaj/ukloni odnos" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Dodatni uvjeti za MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Dodaj/ukloni predmet" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automatski stvoreno od GLPI-a" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Klasa" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Komentari i date_mod promjene" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Log-zapisi dodatka genericobject" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Konfiguracija" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Upravljanje pravima" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Konfiguriraj izvještaj" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Odaberi jedan model u svojim postavkama" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Krivulje (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Nadzorna ploča" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Popis izvještaja" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Nadzorna ploča je prazna. Dodaj izvještaje klikom na ikonu" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Bez podataka" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Standardni oblik grafikona" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "S podacima" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Standardno kašnjenje" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Broj" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Izvještaji o GLPI statistici" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "podaci" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Opći izvještaj – ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Nema modela" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Log-zapisi dodatka genericobject" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Nijedna grafika nije odabrana" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Pozdrav,\n\ndostupni su GLPI izvještaji.\nNalaze se u privitku ovog e-maila.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Tjedan" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Pokreni konfiguraciju grafika" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Maksimalna dubina razine entiteta" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Mjesec" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Maksimalna dubina razine entiteta" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Prošireni izvještaji" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Obavijest za „Prošireni izvještaji”" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Nema podataka za ovaj raspon datuma!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Pozdrav,

\n\n

dostupni su GLPI izvještaji.
\nNalaze se u privitku ovog e-maila.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Nijedna grafika nije odabrana" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Izvještaji o GLPI statistici" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Nema modela" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Pozdrav,\n\ndostupni su GLPI izvještaji.\nNalaze se u privitku ovog e-maila.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Nema izvještaja!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Obavijest za „Prošireni izvještaji”" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Obavijesti su poslane!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Nema podataka za ovaj raspon datuma!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Broj" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Nedefinirano" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS informacije" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Konfiguracija" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Objekt već postoji" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Vidi područje" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Kad se miš nalazi iznad" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Krivulje (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Odaberi jedan model u svojim postavkama" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Vidi vrijednosti" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Popis izvještaja" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Obrnuti niz podataka" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Jedinica" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Standardno kašnjenje" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Upravljanje pravima" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Dodatni uvjeti za MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Vidi područje" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Vidi grafiku" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Klasa" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Vidi vrijednosti" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Standardni oblik grafikona" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Odaberi izvještaj koji želiš dodati" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Odaberi izvještaj koji želiš prikazati" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Pošalji ovaj izvještaj s obavijesti" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Pokreni konfiguraciju grafika" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Kad se miš nalazi iznad" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Nedefinirano" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Objekt već postoji" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Jedinica" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Odaberi izvještaj koji želiš prikazati" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Korisnik izbrisan iz LDAP-a" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Nadzorna ploča je prazna. Dodaj izvještaje klikom na ikonu" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Log-zapisi web-usluge" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Dodaj izvještaj" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Tjedan" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Odaberi izvještaj koji želiš dodati" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "S podacima" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Konfiguriraj izvještaj" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Bez podataka" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automatski stvoreno od GLPI-a" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "podaci" diff --git a/locales/hu_HU.mo b/locales/hu_HU.mo index 1d28e9a2..fd9469dd 100644 Binary files a/locales/hu_HU.mo and b/locales/hu_HU.mo differ diff --git a/locales/hu_HU.po b/locales/hu_HU.po index db176b9c..26f38ca1 100644 --- a/locales/hu_HU.po +++ b/locales/hu_HU.po @@ -1,257 +1,273 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Hungarian (Hungary) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/hu_HU/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Hungarian (Hungary) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/hu_HU/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: hu_HU\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/common.class.php:910 -msgid "Number" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/common.class.php:1132 -msgid "No model available" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/common.class.php:1140 -msgid "No graphic selected" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" msgstr "" -#: inc/config.class.php:38 +#: inc/config.class.php:154 +msgid "Class" +msgstr "" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "" + +#: inc/config.class.php:40 msgid "Configuration" msgstr "" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" msgstr "" -#: inc/config.class.php:82 -msgid "See values" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" msgstr "" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" msgstr "" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/config.class.php:113 -msgid "Class" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" msgstr "" -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/config.class.php:525 -msgid "Object already exists" +#: inc/common.class.php:1421 +msgid "Month" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/it_IT.mo b/locales/it_IT.mo index b8c3722f..efc486e7 100644 Binary files a/locales/it_IT.mo and b/locales/it_IT.mo differ diff --git a/locales/it_IT.po b/locales/it_IT.po index 306d4b3e..96bc7ce7 100644 --- a/locales/it_IT.po +++ b/locales/it_IT.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-09-25 13:34+0000\n" -"Last-Translator: Pierfrancesco Passerini \n" -"Language-Team: Italian (Italy) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/it_IT/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Pierfrancesco Passerini , 2018\n" +"Language-Team: Italian (Italy) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/it_IT/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: it_IT\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "More Reporting" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Nessun report disponibile!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Report generale - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Aggiungi/rimuovi software sul computer" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Ciao,

\n\n

i report GLPI sono disponibili.
\nLi trovi allegati alla presente e-mail.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Aggiungi/rimuovi versione di software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Aggiungi un report" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Aggiungi/rimuovi profilo all'utente" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Aggiungi/rimuovi gruppo all'utente" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Aggiungi/rimuovi elemento" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Log Webservice" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Aggiungi/rimuovi profilo all'utente" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informazioni OCS-NG" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Aggiungi/rimuovi relazione" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Aggiungi/rimuovi software sul computer" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Aggiungi/rimuovi versione di software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Aggiungi/aggiorna/rimuovi dispositivo" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Aggiungi/rimuovi relazione" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Ulteriori condizioni per MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Aggiungi/rimuovi elemento" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Log plugin Genericobject" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configurazione" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Gestione dei permessi" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configura il report" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Per favore, seleziona un modello nelle tue preferenze" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Linee curve (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Dashboard" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Lista dei report" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Senza dati" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato grafico predefinito" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Con dati" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Intervallo predefinito (giorni)" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Numero" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "dati" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Report generale - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Nessun modello disponibile" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Log plugin Genericobject" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Nessun grafico selezionato" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Ciao,\n\ni report GLPI sono disponibili.\nLi trovi allegati alla presente e-mail.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Settimana" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inizializza la configurazione grafica" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Mese" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "More Reporting" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notifiche per \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Nessuna informazione per questo intervallo di date!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Ciao,

\n\n

i report GLPI sono disponibili.
\nLi trovi allegati alla presente e-mail.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Nessun grafico selezionato" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Nessun modello disponibile" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Ciao,\n\ni report GLPI sono disponibili.\nLi trovi allegati alla presente e-mail.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Nessun report disponibile!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notifiche per \"More Reporting\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Notifiche inviate!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Nessuna informazione per questo intervallo di date!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Numero" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Non definito" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informazioni OCS-NG" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configurazione" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "L'oggetto esiste già" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Mostra area" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Al passaggio del mouse" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Linee curve (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Per favore, seleziona un modello nelle tue preferenze" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Mostra valori" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista dei report" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Intervallo predefinito (giorni)" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestione dei permessi" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Ulteriori condizioni per MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Mostra area" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Mostra grafico" -#: inc/config.class.php:152 -msgid "Class" -msgstr "" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Mostra valori" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Formato grafico predefinito" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Selezioni un report da aggiungere" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Selezionea un report da visualizzare" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Invia questo report con la notifica" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inizializza la configurazione grafica" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Al passaggio del mouse" - -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "L'oggetto esiste già" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Non definito" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Selezionea un report da visualizzare" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Aggiungi un report" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Log Webservice" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Selezioni un report da aggiungere" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Settimana" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configura il report" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Con dati" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Senza dati" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "dati" diff --git a/locales/ja_JP.mo b/locales/ja_JP.mo new file mode 100644 index 00000000..f1ec9957 Binary files /dev/null and b/locales/ja_JP.mo differ diff --git a/locales/ja_JP.po b/locales/ja_JP.po new file mode 100644 index 00000000..32ece81a --- /dev/null +++ b/locales/ja_JP.po @@ -0,0 +1,274 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# INOUE Daisuke, 2023 +msgid "" +msgstr "" +"Project-Id-Version: GLPI Plugin - MReporting\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: INOUE Daisuke, 2023\n" +"Language-Team: Japanese (Japan) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/ja_JP/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ja_JP\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

こんにちは

\n\n

GLPI レポートの準備ができました。
\nこのメールの末尾で確認してください。

\n\n" + +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "レポートの追加" + +#: inc/other.class.php:78 +msgid "Add infocom" +msgstr "Infocom の追加" + +#: inc/other.class.php:84 +msgid "Add/remove group on a user" +msgstr "グループのユーザーを追加・削除" + +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "アイテムの追加・削除" + +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "ユーザーのプロファイルを追加・削除" + +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "関係を追加・削除" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "コンピューターのソフトウェアの追加・削除" + +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "ソフトウェアのバージョンの追加・削除" + +#: inc/other.class.php:102 +msgid "Add/update/remove device" +msgstr "デバイスの追加・更新・削除" + +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "MySQL への追加条件" + +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "GLPI による自動生成" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "クラス" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "コメントと変更日の変更" + +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "設定" + +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "レポート設定" + +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "曲線(SVG)" + +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" +msgstr "ダッシュボード" + +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "ダッシュボードが空です。アイコンをクリックしてレポートを追加してください" + +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "標準グラフ形式" + +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "標準期間" + +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI 統計レポート" + +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "総合レポート - ODT" + +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "「Genelicobject」プラグイン ログ" + +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "こんにちは\n\nGLPI レポートの準備ができました。\nこのメールにファイルを添付しています。\n\n" + +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "画像設定の初期化" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "エンティティーレベル最大深度" + +#: inc/common.class.php:1421 +msgid "Month" +msgstr "月" + +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "追加レポート" + +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "この日付範囲にはデータがありません!" + +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "画像を選択していません" + +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "有効なモデルがありません" + +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "有効なレポートがありません!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "「追加レポート」通知" + +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" +msgstr "通知を送信しました!" + +#: inc/common.class.php:942 +msgid "Number" +msgstr "数" + +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS 情報" + +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "オブジェクトがすでに存在します" + +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "マウスオーバー時" + +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "設定でモデルを選択してください" + +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "レポート一覧" + +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" +msgstr "日付逆順" + +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "権限管理" + +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "エリアを表示" + +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" +msgstr "画像を表示" + +#: inc/config.class.php:102 +msgid "See values" +msgstr "値を表示" + +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "追加するレポートを選択" + +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "表示するレポートを選択" + +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" +msgstr "" + +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "" + +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "" + +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "" + +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "" + +#: inc/common.class.php:1420 +msgid "Week" +msgstr "" + +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "" diff --git a/locales/ko_KR.mo b/locales/ko_KR.mo index e878ee19..c86ffc21 100644 Binary files a/locales/ko_KR.mo and b/locales/ko_KR.mo differ diff --git a/locales/ko_KR.po b/locales/ko_KR.po index afa7ed58..bf333a17 100644 --- a/locales/ko_KR.po +++ b/locales/ko_KR.po @@ -3,271 +3,272 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# SeongHyeon Cho , 2017,2020 +# 조성현 (jaymz9634) , 2017,2020 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2020-01-22 23:48+0000\n" -"Last-Translator: SeongHyeon Cho \n" -"Language-Team: Korean (Korea) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/ko_KR/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: 조성현 (jaymz9634) , 2017,2020\n" +"Language-Team: Korean (Korea) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/ko_KR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ko_KR\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "보고서 더 보기" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "사용 가능한 보고서가 없습니다!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "일반 보고서 - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "컴퓨터에 소프트웨어 추가/제거" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

안녕하세요,

\n\n

GLPI 보고서를 사용할 수 있습니다.
\n이 이메일에 첨부되어 있습니다.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "소프트웨어에 버전 추가/제거" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "보고서 추가" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "인포컴 추가" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "사용자에 프로필 추가/제거" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "사용자에 그룹 추가/제거" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "LDAP에서 사용자 삭제됨" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "품목 추가/제거" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "웹서비스 로그" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "사용자에 프로필 추가/제거" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS 정보" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "연관 추가/제거" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "컴퓨터에 소프트웨어 추가/제거" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "소프트웨어에 버전 추가/제거" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "장치 추가/갱신/제거" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "연관 추가/제거" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "MySQL의 추가 조건" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "품목 추가/제거" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "GLPI가 자동으로 생성함" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "클래스" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "의견 & date_mod 변경" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "일반객체 플러그인 로그" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "구성" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "저작권 관리" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "구성 보고서" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "사용자 설정 모델을 선택해 주세요" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "곡선 (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "대시보드" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "보고서 목록" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "대시보드가 비었습니다. 아이콘 위를 클릭하여 보고서를 추가하세요" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "자료 제외" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "기본 도표 형식" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "자료 포함" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "기본 지연" -#: inc/common.class.php:929 -msgid "Number" -msgstr "연번" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI 통계 보고서" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "자료" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "일반 보고서 - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "사용 가능한 모델 없음" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "일반객체 플러그인 로그" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "선택된 시각화 없음" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "안녕하세요,\n\nGLPI 보고서를 사용할 수 있습니다.\n이 이메일에 첨부되어 있습니다.\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "주" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "시각화 구성 초기화" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "최대 심도 개체 수준" + +#: inc/common.class.php:1421 msgid "Month" msgstr "월" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "최대 심도 개체 수준" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "보고서 더 보기" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "\"보고서 더 보기\"에 대한 알림" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "이 날짜 범위에는 자료가 없습니다!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

안녕하세요,

\n\n

GLPI 보고서를 사용할 수 있습니다.
\n이 이메일에 첨부되어 있습니다.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "선택된 시각화 없음" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "GLPI 통계 보고서" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "사용 가능한 모델 없음" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "안녕하세요,\n\nGLPI 보고서를 사용할 수 있습니다.\n이 이메일에 첨부되어 있습니다.\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "사용 가능한 보고서가 없습니다!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "\"보고서 더 보기\"에 대한 알림" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "알림(들) 발송!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "이 날짜 범위에는 자료가 없습니다!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "연번" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "지정되지 않음" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS 정보" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "구성" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "객체가 이미 존재함" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "영역 보기" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "마우스를 위로 올릴때" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "곡선 (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "사용자 설정 모델을 선택해 주세요" -#: inc/config.class.php:100 -msgid "See values" -msgstr "가치 보기" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "보고서 목록" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "역 자료 배열" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "단위" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "기본 지연" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "저작권 관리" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "MySQL의 추가 조건" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "영역 보기" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "시각화 보기" -#: inc/config.class.php:152 -msgid "Class" -msgstr "클래스" +#: inc/config.class.php:102 +msgid "See values" +msgstr "가치 보기" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "기본 도표 형식" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "추가할 보고서 선택" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "표시할 보고서 선택" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "이 보고서를 알림으로 보내기" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "시각화 구성 초기화" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "마우스를 위로 올릴때" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "지정되지 않음" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "객체가 이미 존재함" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "단위" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "표시할 보고서 선택" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "LDAP에서 사용자 삭제됨" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "대시보드가 비었습니다. 아이콘 위를 클릭하여 보고서를 추가하세요" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "웹서비스 로그" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "보고서 추가" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "주" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "추가할 보고서 선택" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "자료 포함" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "구성 보고서" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "자료 제외" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "GLPI가 자동으로 생성함" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "자료" diff --git a/locales/lv_LV.mo b/locales/lv_LV.mo index aabc5ce9..4a2bdca5 100644 Binary files a/locales/lv_LV.mo and b/locales/lv_LV.mo differ diff --git a/locales/lv_LV.po b/locales/lv_LV.po index c682e036..c7903f91 100644 --- a/locales/lv_LV.po +++ b/locales/lv_LV.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-06-28 08:41+0000\n" -"Last-Translator: Cédric Anne\n" -"Language-Team: Latvian (Latvia) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/lv_LV/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Andrejs , 2016\n" +"Language-Team: Latvian (Latvia) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/lv_LV/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: lv_LV\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "More Reporting" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Nav pieejami pārskati !" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Vispārīgs Pārskats - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Pievienot/noņemt programmatūru uz datora" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Sveicināti,

\n\n

GLPI pārskati sagatavoti.
\nJūs atradīsiet tos epasta vēstules pielikumā.

\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Pievienot/noņemt programmatūras versiju" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Pievienot pārskatu" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Pievienot Infocom" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Pievienot/noņemt profilu lietotājam" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Pievienot/noņemt grupu lietotājam" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Lietotājs izdzēsts no LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Pievienot/noņemt objektu" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Web servisu žurnāls" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Pievienot/noņemt profilu lietotājam" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS Informācija" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Pievienot/noņemt sasaisti" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Pievienot/noņemt programmatūru uz datora" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Pievienot/noņemt programmatūras versiju" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Pievienot/atjaunināt/noņemt ierīci" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Pievienot/noņemt sasaisti" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Papildus MySQL nosacījumi" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Pievienot/noņemt objektu" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automātiski ģenerēts ar GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Klase" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Komentāri & date_mode izmaiņas" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Papildspraudņa Genericobject žurnāls" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Konfigurācija" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Tiesību pārvaldība" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Nokonfigurēt pārskatu" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Lūdzu, izvelieties modeli savos iestatījumos" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Informācijas panelis" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Pārskatu saraksts" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Bez datiem" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Ar datiem" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Noklusēta aizkave" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Skaits" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI statistikas pārskati" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "dati" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Vispārīgs Pārskats - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Nav pieejamu modeļu" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Papildspraudņa Genericobject žurnāls" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Nav izvēlēts grafiks" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Sveicināti,\n\nGLPI pārskati sagatavoti.\nJūs atradīsiet tos epasta vēstules pielikumā.\n\n" -#: inc/common.class.php:1406 -msgid "Week" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializēt grafisko konfigurāciju" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/common.class.php:1407 +#: inc/common.class.php:1421 msgid "Month" msgstr "" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "More Reporting" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Paziņojums par \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Nav datu par šo laika periodu !" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Sveicināti,

\n\n

GLPI pārskati sagatavoti.
\nJūs atradīsiet tos epasta vēstules pielikumā.

\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Nav izvēlēts grafiks" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "GLPI statistikas pārskati" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Nav pieejamu modeļu" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Sveicināti,\n\nGLPI pārskati sagatavoti.\nJūs atradīsiet tos epasta vēstules pielikumā.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Nav pieejami pārskati !" -#: inc/notification.class.php:153 +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Paziņojums par \"More Reporting\"" + +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Paziņojums(i) nosūtīti !" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Nav datu par šo laika periodu !" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Skaits" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Nav definēts" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS Informācija" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Konfigurācija" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Objekts jau eksistē" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Redzamais apgabals" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Uz peles pāri" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Lūdzu, izvelieties modeli savos iestatījumos" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Redzamas vērtības" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Pārskatu saraksts" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Apgriezt datu masīvu" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Vienība" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Noklusēta aizkave" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Tiesību pārvaldība" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Papildus MySQL nosacījumi" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Redzamais apgabals" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Redzamais grafiks" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Klase" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Redzamas vērtības" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Izvēlēties pārskatu lai pievienot" + +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Izvēlēties pārskatu kuru attēlot" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Nosūtīt šo pārskatu ar paziņojumu" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inicializēt grafisko konfigurāciju" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Nav definēts" -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Uz peles pāri" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Vienība" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Objekts jau eksistē" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Lietotājs izdzēsts no LDAP" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Izvēlēties pārskatu kuru attēlot" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Web servisu žurnāls" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Pievienot pārskatu" - -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Izvēlēties pārskatu lai pievienot" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Ar datiem" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Nokonfigurēt pārskatu" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Bez datiem" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automātiski ģenerēts ar GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "dati" diff --git a/locales/mreporting.pot b/locales/mreporting.pot index b9a224ab..b22fa8db 100644 --- a/locales/mreporting.pot +++ b/locales/mreporting.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,254 +17,255 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: inc/other.class.php:79 +#: inc/other.class.php:81 msgid "Add/remove profile on a user" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:154 +msgid "Class" msgstr "" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/config.class.php:40 +msgid "Configuration" msgstr "" -#: inc/profile.class.php:70 inc/profile.class.php:216 inc/profile.class.php:288 -msgid "Rights management" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" msgstr "" -#: inc/common.class.php:929 -msgid "Number" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/common.class.php:950 inc/common.class.php:1253 inc/common.class.php:1269 -msgid "data" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/common.class.php:1155 -msgid "No model available" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/common.class.php:1163 -msgid "No graphic selected" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/common.class.php:1406 -msgid "Week" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/common.class.php:1407 +#: inc/common.class.php:1421 msgid "Month" msgstr "" -#: inc/common.class.php:1520 -msgid "Max depth entity level" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/notification.class.php:153 -msgid "Notification(s) sent !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/config.class.php:38 -msgid "Configuration" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/config.class.php:100 -msgid "See values" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/config.class.php:110 inc/config.class.php:733 -msgid "Reverse data array" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" +#: inc/profile.class.php:72 inc/profile.class.php:224 inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "" -#: inc/config.class.php:152 -msgid "Class" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/config.class.php:160 -msgid "Default chart format" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/config.class.php:169 inc/config.class.php:772 -msgid "Send this report with the notification" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/config.class.php:575 -msgid "Object already exists" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/nl_NL.mo b/locales/nl_NL.mo index 597eae4d..f8f219cd 100644 Binary files a/locales/nl_NL.mo and b/locales/nl_NL.mo differ diff --git a/locales/nl_NL.po b/locales/nl_NL.po index c06efa54..6535b230 100644 --- a/locales/nl_NL.po +++ b/locales/nl_NL.po @@ -1,257 +1,273 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Dutch (Netherlands) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/nl_NL/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Dutch (Netherlands) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/nl_NL/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/common.class.php:910 -msgid "Number" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/common.class.php:1132 -msgid "No model available" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/common.class.php:1140 -msgid "No graphic selected" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" msgstr "" -#: inc/config.class.php:38 +#: inc/config.class.php:154 +msgid "Class" +msgstr "" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "" + +#: inc/config.class.php:40 msgid "Configuration" msgstr "" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" msgstr "" -#: inc/config.class.php:82 -msgid "See values" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" msgstr "" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" msgstr "" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/config.class.php:113 -msgid "Class" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" msgstr "" -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/config.class.php:525 -msgid "Object already exists" +#: inc/common.class.php:1421 +msgid "Month" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/pl_PL.mo b/locales/pl_PL.mo index 4a2c192b..2ed0008c 100644 Binary files a/locales/pl_PL.mo and b/locales/pl_PL.mo differ diff --git a/locales/pl_PL.po b/locales/pl_PL.po index 69122fc7..f3d41f49 100644 --- a/locales/pl_PL.po +++ b/locales/pl_PL.po @@ -9,266 +9,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-06-28 08:41+0000\n" -"Last-Translator: Cédric Anne\n" -"Language-Team: Polish (Poland) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/pl_PL/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Jacek Maciol , 2017\n" +"Language-Team: Polish (Poland) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/pl_PL/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pl_PL\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Dodatkowe raporty" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Brak dostępnych raportów!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Raport ogólny - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Dodaj/Usuń oprogramowani na komputerze" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Raporty GLPI są dostępne.
\nZostały dołącznone do tego maila

\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Dodaj/usuń wersję oprogramowania" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Dodaj raport" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Dodaj informacje finansowe" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Dodaj/usuń profil użytkownika" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Dodaj/usuń grupę użytkownika" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Użytkownik usunięty z LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Dodaj/usuń pozycje" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Logi Webserwisów" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Dodaj/usuń profil użytkownika" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informacje OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Dodaj/usuń relacje" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Dodaj/Usuń oprogramowani na komputerze" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Dodaj/usuń wersję oprogramowania" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Dodaj/zaktualizuj/usuń urządzenie" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Dodaj/usuń relacje" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Dodatkowy warunek dla MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Dodaj/usuń pozycje" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Automatycznie wygenerowane przez GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Klasa" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Komentarze & date_mod zmiany" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Logi dodatku Genericobject" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Konfiguracja" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Zarządzanie uprawnieniami" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Skonfiguruj raport" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Proszę wybrać model w ustawieniach" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Linie wektorowe (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Pulpit" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Lista raportów" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Pulpit nawigacyjny jest pusty. Dodaj raporty, klikając ikonę" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Bez danych" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Z danymi" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Domyślne opóźnienie" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Liczba" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Raport statystyczny GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "dane" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Raport ogólny - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Brak dostępnego modelu" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Logi dodatku Genericobject" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Brak wybranej grafiki" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "

Raporty GLPI są dostępne.
\nZostały dołącznone do tego maila

\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Tydzień" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Zainicjuj konfigurcję grafiki" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Maksymalna głębokość w drzewie encji" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Miesiąc" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Maksymalna głębokość w drzewie encji" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Dodatkowe raporty" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Powiadomienia dla Dodatkowych raportów" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Brak danych dkla tego zakresu!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Raporty GLPI są dostępne.
\nZostały dołącznone do tego maila

\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Brak wybranej grafiki" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Raport statystyczny GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Brak dostępnego modelu" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "

Raporty GLPI są dostępne.
\nZostały dołącznone do tego maila

\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Brak dostępnych raportów!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Powiadomienia dla Dodatkowych raportów" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Wysłano powiadomienia" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Brak danych dkla tego zakresu!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Liczba" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Niezdefiniowane" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informacje OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Konfiguracja" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Obiekt już istnieje" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Pokaż obszar" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "W trakcie przeciągania myszką" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Linie wektorowe (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Proszę wybrać model w ustawieniach" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Pokaż wartości" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista raportów" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Odwróć tablicę danych" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Jednostka" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Domyślne opóźnienie" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Zarządzanie uprawnieniami" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Dodatkowy warunek dla MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Pokaż obszar" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Pokaż grafikę" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Klasa" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Pokaż wartości" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Wybierz raport do dodania" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Wybierz raport do wyświetlenia" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Wyślij ten raport z powiadomieniam" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Zainicjuj konfigurcję grafiki" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "W trakcie przeciągania myszką" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Niezdefiniowane" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Obiekt już istnieje" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Jednostka" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Wybierz raport do wyświetlenia" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Użytkownik usunięty z LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Pulpit nawigacyjny jest pusty. Dodaj raporty, klikając ikonę" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Logi Webserwisów" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Dodaj raport" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Tydzień" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Wybierz raport do dodania" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Z danymi" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Skonfiguruj raport" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Bez danych" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Automatycznie wygenerowane przez GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "dane" diff --git a/locales/pt_BR.mo b/locales/pt_BR.mo index 28fec6b8..3e273003 100644 Binary files a/locales/pt_BR.mo and b/locales/pt_BR.mo differ diff --git a/locales/pt_BR.po b/locales/pt_BR.po index 109306bc..221016e5 100644 --- a/locales/pt_BR.po +++ b/locales/pt_BR.po @@ -10,266 +10,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2019-09-30 13:31+0000\n" -"Last-Translator: Thiago Passamani \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/pt_BR/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Thiago Passamani , 2016-2017,2019\n" +"Language-Team: Portuguese (Brazil) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_BR\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Mais Relatórios" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Nenhum relatório disponível!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Relatório geral - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Adicionar/remover software do computador" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Olá,

\n\n

Os relatórios estão disponíveis no GLPI.
\nVocê vai encontrar anexo a este e-mail.

\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Adicionar/remover versão do software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Adicionar um relatório" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Adicionar infocom" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Adicionar/remover perfil do usuário" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Adicionar/remover grupo do usuário" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Usuário excluído do LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Adicionar/remover item" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Logs do Webservice" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Adicionar/remover perfil do usuário" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informações do OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Adicionar/remover relação" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Adicionar/remover software do computador" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Adicionar/remover versão do software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Adicionar/alterar/remover dispositivo" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Adicionar/remover relação" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condição adicional para MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Adicionar/remover item" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Gereado automaticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Classe" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Alterar comentários e data de modificação" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Logs do complemento Objetos Genéricos" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuração" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Gerenciar direitos" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar relatório" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Por favor, selecione um modelo de sua preferência" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Linhas curvas (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Painel" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Lista de relatórios" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Painel está vazio. Por favor adicione relatórios clicando no ícone" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Sem dados" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato de gráfico padrão" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Com dados" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Delay padrão" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Número" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Relatórios de estatísticas GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "dados" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Relatório geral - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Nenhum modelo disponível!" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Logs do complemento Objetos Genéricos" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Gráfico não selecionado" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Olá,\n\nOs relatórios estão disponíveis no GLPI.\nVocê vai encontrar anexo a este e-mail.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Semana" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializar configurações gráticas" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Nível máximo de entidade" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Mês" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Nível máximo de entidade" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Mais Relatórios" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notificação por \"Mais Relatórios\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Não existem dados para este intervalo de datas!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Olá,

\n\n

Os relatórios estão disponíveis no GLPI.
\nVocê vai encontrar anexo a este e-mail.

\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Gráfico não selecionado" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Relatórios de estatísticas GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Nenhum modelo disponível!" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Olá,\n\nOs relatórios estão disponíveis no GLPI.\nVocê vai encontrar anexo a este e-mail.\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Nenhum relatório disponível!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificação por \"Mais Relatórios\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Notificação(es) enviada(s)!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Não existem dados para este intervalo de datas!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Número" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Indefinido" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informações do OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuração" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Objeto já existe" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Ver área" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "com o mouse em cima" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Linhas curvas (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, selecione um modelo de sua preferência" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Ver valores" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista de relatórios" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Matriz de dados reversa" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unidade" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Delay padrão" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gerenciar direitos" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Condição adicional para MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Ver área" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Ver gráfico" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Classe" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Formato de gráfico padrão" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Selecionar um relatório para adicionar" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Selecione um relatório para exibição" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Enviar este relatório com a notificação" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inicializar configurações gráticas" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "com o mouse em cima" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Objeto já existe" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidade" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Selecione um relatório para exibição" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Usuário excluído do LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Painel está vazio. Por favor adicione relatórios clicando no ícone" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Logs do Webservice" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Adicionar um relatório" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semana" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Selecionar um relatório para adicionar" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Com dados" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configurar relatório" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sem dados" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Gereado automaticamente por GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "dados" diff --git a/locales/pt_PT.mo b/locales/pt_PT.mo index 6c06c057..e321febc 100644 Binary files a/locales/pt_PT.mo and b/locales/pt_PT.mo differ diff --git a/locales/pt_PT.po b/locales/pt_PT.po index ace46705..d4693008 100644 --- a/locales/pt_PT.po +++ b/locales/pt_PT.po @@ -7,266 +7,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2019-02-26 12:16+0000\n" -"Last-Translator: Rui Melo \n" -"Language-Team: Portuguese (Portugal) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/pt_PT/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Portuguese (Portugal) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/pt_PT/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: pt_PT\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "More Reporting" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Nenhum reporte disponível !" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Relatório geral-ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Adicionar/remover software num computador" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Olá,

\n\n

Reportes GLPI estão disponíveis
\nVai encontrá-los anexados a este email.

\n\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Adicionar/remover versão a um software" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Adicionar um reporte" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Adicionar infocom" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Adicionar/remover perfil a um utilizador" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Adicionar/remover grupo a um utilizador" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Utilizador removido do LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Adicionar/remover item" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Registros do webservice" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Adicionar/remover perfil a um utilizador" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "Informações OCS" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Adicionar/remover relação" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Adicionar/remover software num computador" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Adicionar/remover versão a um software" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Adicionar/actualizar/remover aparelho" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Adicionar/remover relação" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Condição adicional para MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Adicionar/remover item" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Gerado automaticamente por GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Classe" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Comentários & alterações date_mod" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Registros do plugin Genericobject" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Configuração" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Gestão de direitos" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Configurar reporte" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Por favor, escolha um modelo nas suas preferências" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Linhas curvas (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Painel" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Lista de reportes" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Painel está vazio. Adicione um reporte clicando no ícone." -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Sem dados" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Formato de gráfico predefinido" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Com dados" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Atraso por defeito" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Número" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Reporte de estatísticas GLPI" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "dados" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Relatório geral-ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Nenhum modelo disponivel" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Registros do plugin Genericobject" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Nenhum gráfico seleccionado" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Olá,\n\nReportes GLPI estão disponíveis.\nVai encontrá-los anexados a este email.

\n\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Semana" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Inicializar configuração de gráficos" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Nível máximo de entidade de profundidade" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Mês" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Nível máximo de entidade de profundidade" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "More Reporting" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Notificações para \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Sem dados para este período !" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Olá,

\n\n

Reportes GLPI estão disponíveis
\nVai encontrá-los anexados a este email.

\n\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Nenhum gráfico seleccionado" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Reporte de estatísticas GLPI" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Nenhum modelo disponivel" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Olá,\n\nReportes GLPI estão disponíveis.\nVai encontrá-los anexados a este email.

\n\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Nenhum reporte disponível !" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Notificações para \"More Reporting\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Notificação(ões) enviada(s) !" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Sem dados para este período !" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Número" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Indefinido" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "Informações OCS" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Configuração" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Objecto já existe" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Ver area" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Com rato por cima" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Linhas curvas (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Por favor, escolha um modelo nas suas preferências" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Ver valores" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Lista de reportes" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Inverter array de dados" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Unidade" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Atraso por defeito" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Gestão de direitos" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Condição adicional para MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Ver area" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Ver gráfico" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Classe" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Ver valores" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Formato de gráfico predefinido" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Seleccione um reporte para adicionar" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Seleccione um reporte para ver" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Enviar este reporte com a notificação" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Inicializar configuração de gráficos" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Com rato por cima" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Indefinido" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Objecto já existe" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Unidade" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Seleccione um reporte para ver" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Utilizador removido do LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Painel está vazio. Adicione um reporte clicando no ícone." +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Registros do webservice" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Adicionar um reporte" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Semana" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Seleccione um reporte para adicionar" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Com dados" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Configurar reporte" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Sem dados" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Gerado automaticamente por GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "dados" diff --git a/locales/reports_locales/helpdesk_cs_CZ.php b/locales/reports_locales/helpdesk_cs_CZ.php index 7468e432..dc1f22a2 100644 --- a/locales/reports_locales/helpdesk_cs_CZ.php +++ b/locales/reports_locales/helpdesk_cs_CZ.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ diff --git a/locales/reports_locales/helpdesk_de_DE.php b/locales/reports_locales/helpdesk_de_DE.php index afd92fd5..14611ffb 100644 --- a/locales/reports_locales/helpdesk_de_DE.php +++ b/locales/reports_locales/helpdesk_de_DE.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ diff --git a/locales/reports_locales/helpdesk_en_GB.php b/locales/reports_locales/helpdesk_en_GB.php index fe294c74..85221a18 100644 --- a/locales/reports_locales/helpdesk_en_GB.php +++ b/locales/reports_locales/helpdesk_en_GB.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ diff --git a/locales/reports_locales/helpdesk_es_VE.php b/locales/reports_locales/helpdesk_es_VE.php new file mode 100644 index 00000000..32ee0e82 --- /dev/null +++ b/locales/reports_locales/helpdesk_es_VE.php @@ -0,0 +1,143 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Helpdesk'] = [ + 'title' => "Soporte", + + 'reportHbarTicketNumberByEntity' => [ + 'title' => "Número de casos por entidad", + 'desc' => "Barras", + 'category' => "Por entidad", + ], + + 'reportPieTicketNumberByEntity' => [ + 'title' => "Número de casos por entidad", + 'desc' => "Torta", + 'category' => "Por entidad", + ], + + 'reportHgbarTicketNumberByCatAndEntity' => [ + 'title' => "Número de casos por categoría y entidad", + 'desc' => "Barra agrupada", + 'category' => "Por entidad", + ], + + 'reportPieTopTenAuthor' => [ + 'title' => "Primeros 10 con mas solicitudes", + 'desc' => "Torta", + 'category' => "Por solicitantes", + ], + + 'reportHgbarOpenTicketNumberByCategoryAndByType' => [ + 'title' => "Casos abiertos por categoría y tipo", + 'desc' => "Barra agrupada", + 'category' => "por categoria", + ], + + 'reportHgbarCloseTicketNumberByCategoryAndByType' => [ + 'title' => "Casos cerrados por categoría y tipo", + 'desc' => "Barra agrupada", + 'category' => "por categoria", + ], + + 'reportHgbarOpenedTicketNumberByCategory' => [ + 'title' => "Casos abiertos por categoría y estado", + 'desc' => "Barra agrupada", + 'category' => "por categoria", + ], + + 'reportHgbarTicketNumberByService' => [ + 'title' => "Casos abiertos y cerrados por unidad solicitante", + 'desc' => "Barra agrupada", + 'category' => "Por unidad solicitante", + ], + + 'reportPieTicketOpenedAndClosed' => [ + 'title' => "Numero de casos abiertos y cerrados", + 'desc' => "Torta", + 'category' => "Por casos", + ], + + 'reportPieTicketOpenedbyStatus' => [ + 'title' => "Casos abiertos por estado", + 'desc' => "Torta", + 'category' => "Por casos", + ], + + 'reportAreaNbTicket' => [ + 'title' => "Evolución de casos por periodo", + 'desc' => "Area", + 'category' => "Por casos", + ], + + 'reportLineNbTicket' => [ + 'title' => "Evolución de casos por periodo", + 'desc' => "Linea", + 'category' => "Por casos", + ], + + 'reportGlineNbTicket' => [ + 'title' => "Evolución de casos por periodo (por estado)", + 'desc' => "Lineas", + 'category' => "Por casos", + ], + + 'reportGareaNbTicket' => [ + 'title' => "Evolución de casos por periodo (por estado)", + 'desc' => "Area", + 'category' => "Por casos", + ], + + 'reportVstackbarNbTicket' => [ + 'title' => "Evolución de casos por periodo (por estado)", + 'desc' => "Barras apiladas", + 'category' => "Por casos", + ], + + 'reportSunburstTicketByCategories' => [ + 'title' => "Distribución de caso por categorías y subcategorías", + 'desc' => "Dona", + 'category' => "por categoria", + ], + + 'reportVstackbarTicketStatusByTechnician' => [ + 'title' => "Numero de casos por tecnico (por estado)", + 'desc' => "Barras apiladas", + 'category' => "Por casos", + ], + + 'reportHbarTicketNumberByLocation' => [ + 'title' => "Numero de casos por ubicación del solicitante", + 'desc' => "Bars", + 'category' => "Per requester", + ], +]; diff --git a/locales/reports_locales/helpdesk_fr_FR.php b/locales/reports_locales/helpdesk_fr_FR.php index 3deb0ea7..39774bdb 100644 --- a/locales/reports_locales/helpdesk_fr_FR.php +++ b/locales/reports_locales/helpdesk_fr_FR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ diff --git a/locales/reports_locales/helpdesk_hr_HR.php b/locales/reports_locales/helpdesk_hr_HR.php index b453526e..d4849a0c 100644 --- a/locales/reports_locales/helpdesk_hr_HR.php +++ b/locales/reports_locales/helpdesk_hr_HR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ diff --git a/locales/reports_locales/helpdesk_pl_PL.php b/locales/reports_locales/helpdesk_pl_PL.php new file mode 100644 index 00000000..adf0986f --- /dev/null +++ b/locales/reports_locales/helpdesk_pl_PL.php @@ -0,0 +1,143 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Helpdesk'] = [ + 'title' => "Zgłoszenia", + + 'reportHbarTicketNumberByEntity' => [ + 'title' => "Zgłoszenia na jednostkę", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg jednostki", + ], + + 'reportPieTicketNumberByEntity' => [ + 'title' => "Zgłoszenia na jednostkę", + 'desc' => "wykres kołowy", + 'category' => "Raporty wg jednostki", + ], + + 'reportHgbarTicketNumberByCatAndEntity' => [ + 'title' => "Zgłoszenia wg ich kategorii i jednostki", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg jednostki", + ], + + 'reportPieTopTenAuthor' => [ + 'title' => "10 najbardziej aktywnych zgłaszających", + 'desc' => "wykres kołowy", + 'category' => "Raporty wg zgłaszającego", + ], + + 'reportHgbarOpenTicketNumberByCategoryAndByType' => [ + 'title' => "Zgłoszenia otwarte wg ich kategorii i typu", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg kategorii", + ], + + 'reportHgbarCloseTicketNumberByCategoryAndByType' => [ + 'title' => "Zgłoszenia zamknięte wg ich kategorii i typu", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg kategorii", + ], + + 'reportHgbarOpenedTicketNumberByCategory' => [ + 'title' => "Zgłoszenia otwarte wg ich kategorii i statusu", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg kategorii", + ], + + 'reportHgbarTicketNumberByService' => [ + 'title' => "Zgłoszenia otwarte i zamknięte wg usługi", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg usługi", + ], + + 'reportPieTicketOpenedAndClosed' => [ + 'title' => "Zgłoszenia otwarte i zamknięte", + 'desc' => "wykres kołowy", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportPieTicketOpenedbyStatus' => [ + 'title' => "Zgłoszenia otwarte wg ich statusu", + 'desc' => "wykres kołowy", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportAreaNbTicket' => [ + 'title' => "Zmiana ilości zgłoszeń w czasie", + 'desc' => "wykres obszarowy", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportLineNbTicket' => [ + 'title' => "Zmiana ilości zgłoszeń w czasie", + 'desc' => "wykres liniowy", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportGlineNbTicket' => [ + 'title' => "Zmiana ilości zgłoszeń w czasie (wg ich statusu)", + 'desc' => "wykres liniowy", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportGareaNbTicket' => [ + 'title' => "Zmiana ilości zgłoszeń w czasie (wg ich statusu)", + 'desc' => "wykres obszarowy", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportVstackbarNbTicket' => [ + 'title' => "Zmiana ilości zgłoszeń w czasie (wg ich statusu)", + 'desc' => "wykres kolumnowy zestawiony", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportSunburstTicketByCategories' => [ + 'title' => "Dystrybucja zgłoszeń wg kategorii i podkategorii", + 'desc' => "Donut", + 'category' => "Raporty wg kategorii", + ], + + 'reportVstackbarTicketStatusByTechnician' => [ + 'title' => "Zgłoszenia wg statusu z rozbiciem na przypisanych techników", + 'desc' => "wykres kolumnowy zestawiony", + 'category' => "Raporty wg zgłoszeń", + ], + + 'reportHbarTicketNumberByLocation' => [ + 'title' => "Zgłoszenia wg lokalizacji zgłaszających", + 'desc' => "wykres słupkowy", + 'category' => "Raporty wg zgłaszających", + ], +]; diff --git a/locales/reports_locales/helpdesk_pt_BR.php b/locales/reports_locales/helpdesk_pt_BR.php index b1c405c2..599dee10 100644 --- a/locales/reports_locales/helpdesk_pt_BR.php +++ b/locales/reports_locales/helpdesk_pt_BR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk']['title'] = "Helpdesk"; diff --git a/locales/reports_locales/helpdesk_pt_PT.php b/locales/reports_locales/helpdesk_pt_PT.php index 31c1f667..37cea60b 100644 --- a/locales/reports_locales/helpdesk_pt_PT.php +++ b/locales/reports_locales/helpdesk_pt_PT.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ 'title' => "Helpdesk", diff --git a/locales/reports_locales/helpdesk_ru_RU.php b/locales/reports_locales/helpdesk_ru_RU.php index 808401df..32b6cace 100644 --- a/locales/reports_locales/helpdesk_ru_RU.php +++ b/locales/reports_locales/helpdesk_ru_RU.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdesk'] = [ diff --git a/locales/reports_locales/helpdeskplus_cs_CZ.php b/locales/reports_locales/helpdeskplus_cs_CZ.php index 3ab8aab1..035ca7ad 100644 --- a/locales/reports_locales/helpdeskplus_cs_CZ.php +++ b/locales/reports_locales/helpdeskplus_cs_CZ.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ diff --git a/locales/reports_locales/helpdeskplus_de_DE.php b/locales/reports_locales/helpdeskplus_de_DE.php index 7d1ad232..2194560b 100644 --- a/locales/reports_locales/helpdeskplus_de_DE.php +++ b/locales/reports_locales/helpdeskplus_de_DE.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ diff --git a/locales/reports_locales/helpdeskplus_en_GB.php b/locales/reports_locales/helpdeskplus_en_GB.php index 9fd149f1..a8ce3a14 100644 --- a/locales/reports_locales/helpdeskplus_en_GB.php +++ b/locales/reports_locales/helpdeskplus_en_GB.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ diff --git a/locales/reports_locales/helpdeskplus_es_VE.php b/locales/reports_locales/helpdeskplus_es_VE.php new file mode 100644 index 00000000..73054048 --- /dev/null +++ b/locales/reports_locales/helpdeskplus_es_VE.php @@ -0,0 +1,140 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Helpdeskplus'] = [ + 'title' => 'Soporte avanzado', + + // MISC LOCALES + 'backlogs' => "Atrasos", + 'opened' => "Abierto", + 'period' => "Período", + 'backlogstatus' => "Estado para mostrar", + 'slaobserved' => "ANS supervisado", + 'slanotobserved'=> "ANS no supervisado", + 'observed' => "supervisado", + 'notobserved' => "no supervisado", + + + // SELECTOR + 'selector' => [ + 'slas' => "ANSs", + 'categories' => "Categorias", + ], + + + // GENERAL REPORTS + 'reportGlineBacklogs' => [ + 'title' => "Atraso", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarLifetime' => [ + 'title' => "Antiguedad del caso", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarTicketsgroups' => [ + 'title' => "Casos por grupo", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarTicketstech' => [ + 'title' => "Casos por técnico", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarWorkflow' => [ + 'title' => "Orientation queues", + 'desc' => "", + 'category' => "General", + ], + + 'reportHbarTopcategory' => [ + 'title' => "TOP categorías", + 'desc' => "", + 'category' => "General", + ], + + 'reportHbarTopapplicant' => [ + 'title' => "TOP grupos de solicitantes", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarGroupChange' => [ + 'title' => "Caso por numero de cambios de grupos", + 'desc' => "Agrupa los casos segun el numero de cambios de grupos", + 'category' => "General", + ], + + 'reportLineActiontimeVsSolvedelay' => [ + 'title' => "Comparativa entre el retrazo de la solución y tiempo de ejecución", + 'desc' => "", + 'category' => "General", + ], + + + // SLA REPORTS + 'reportVstackbarNbTicketBySla' => [ + 'title' => "Casos por ANS", + 'desc' => "", + 'category' => "Por ANS", + ], + + 'reportGlineNbTicketBySla' => [ + 'title' => "Evolución de casos por ANS", + 'desc' => "", + 'category' => "Por ANS", + ], + + 'reportHgbarRespectedSlasByTopCategory' => [ + 'title' => "Casos por ANS ordenados por categorias", + 'desc' => "", + 'category' => "Por ANS", + ], + + 'reportHgbarRespectedSlasByTechnician' => [ + 'title' => "Casos por ANS ordenados por técnicos", + 'desc' => "", + 'category' => "Por ANS", + ], + + 'reportVstackbarRespectedSlasByGroup' => [ + 'title' => "Casos por ANS ordenados por grupos", + 'desc' => "", + 'category' => "Por ANS", + ], +]; diff --git a/locales/reports_locales/helpdeskplus_fr_FR.php b/locales/reports_locales/helpdeskplus_fr_FR.php index 538ec863..5757b2fd 100644 --- a/locales/reports_locales/helpdeskplus_fr_FR.php +++ b/locales/reports_locales/helpdeskplus_fr_FR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ diff --git a/locales/reports_locales/helpdeskplus_hr_HR.php b/locales/reports_locales/helpdeskplus_hr_HR.php index f87ba708..37a692d3 100644 --- a/locales/reports_locales/helpdeskplus_hr_HR.php +++ b/locales/reports_locales/helpdeskplus_hr_HR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ diff --git a/locales/reports_locales/helpdeskplus_pl_PL.php b/locales/reports_locales/helpdeskplus_pl_PL.php new file mode 100644 index 00000000..ed00a51d --- /dev/null +++ b/locales/reports_locales/helpdeskplus_pl_PL.php @@ -0,0 +1,140 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Helpdeskplus'] = [ + 'title' => 'Zgłoszenia - rozszerzone', + + // MISC LOCALES + 'backlogs' => "Backlogs", + 'opened' => "Otwarte", + 'period' => "Period", + 'backlogstatus' => "Status to display", + 'slaobserved' => "SLA observed", + 'slanotobserved'=> "SLA not observed", + 'observed' => "observed", + 'notobserved' => "not observed", + + + // SELECTOR + 'selector' => [ + 'slas' => "SLAS", + 'categories' => "Categories", + ], + + + // GENERAL REPORTS + 'reportGlineBacklogs' => [ + 'title' => "Backlog", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarLifetime' => [ + 'title' => "Wiek nierozwiązanych zgłoszeń", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarTicketsgroups' => [ + 'title' => "Zgłoszenia nierozwiązane wg grup", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarTicketstech' => [ + 'title' => "Zgłoszenia nierozwiązane wg przypisanego technika", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarWorkflow' => [ + 'title' => "Orientation queues", + 'desc' => "", + 'category' => "General", + ], + + 'reportHbarTopcategory' => [ + 'title' => "Najbardziej popularne kategorie", + 'desc' => "", + 'category' => "General", + ], + + 'reportHbarTopapplicant' => [ + 'title' => "Najbardziej popularne grupy techników", + 'desc' => "", + 'category' => "General", + ], + + 'reportVstackbarGroupChange' => [ + 'title' => "Number of group changes", + 'desc' => "", + 'category' => "General", + ], + + 'reportLineActiontimeVsSolvedelay' => [ + 'title' => "Task action times and solve delay comparison", + 'desc' => "", + 'category' => "General", + ], + + + // SLA REPORTS + 'reportVstackbarNbTicketBySla' => [ + 'title' => "Zgłoszenia wg SLA", + 'desc' => "", + 'category' => "Per SLA", + ], + + 'reportGlineNbTicketBySla' => [ + 'title' => "Zmiana zgłoszeń wg SLA", + 'desc' => "", + 'category' => "Per SLA", + ], + + 'reportHgbarRespectedSlasByTopCategory' => [ + 'title' => "Zgłoszenia wg SLA uporządkowane po kategorii", + 'desc' => "", + 'category' => "Per SLA", + ], + + 'reportHgbarRespectedSlasByTechnician' => [ + 'title' => "Zgłoszenia wg SLA uporządkowane po przypisanym techniku", + 'desc' => "", + 'category' => "Per SLA", + ], + + 'reportVstackbarRespectedSlasByGroup' => [ + 'title' => "Zgłoszenia wg SLA uporządkowane po grupach", + 'desc' => "", + 'category' => "Per SLA", + ], +]; \ No newline at end of file diff --git a/locales/reports_locales/helpdeskplus_pt_BR.php b/locales/reports_locales/helpdeskplus_pt_BR.php index 81508a1f..c7eafe15 100644 --- a/locales/reports_locales/helpdeskplus_pt_BR.php +++ b/locales/reports_locales/helpdeskplus_pt_BR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus']['title'] = 'Helpdesk Avançado'; diff --git a/locales/reports_locales/helpdeskplus_pt_PT.php b/locales/reports_locales/helpdeskplus_pt_PT.php index 8c28f352..68b7fafb 100644 --- a/locales/reports_locales/helpdeskplus_pt_PT.php +++ b/locales/reports_locales/helpdeskplus_pt_PT.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ 'title' => 'Helpdesk Avançado', diff --git a/locales/reports_locales/helpdeskplus_ru_RU.php b/locales/reports_locales/helpdeskplus_ru_RU.php index 9467d700..b88d42ee 100644 --- a/locales/reports_locales/helpdeskplus_ru_RU.php +++ b/locales/reports_locales/helpdeskplus_ru_RU.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Helpdeskplus'] = [ diff --git a/locales/reports_locales/inventory_cs_CZ.php b/locales/reports_locales/inventory_cs_CZ.php index f00caf79..662a0d13 100644 --- a/locales/reports_locales/inventory_cs_CZ.php +++ b/locales/reports_locales/inventory_cs_CZ.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ diff --git a/locales/reports_locales/inventory_de_DE.php b/locales/reports_locales/inventory_de_DE.php index 36b8ac30..ae2af7d4 100644 --- a/locales/reports_locales/inventory_de_DE.php +++ b/locales/reports_locales/inventory_de_DE.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ diff --git a/locales/reports_locales/inventory_en_GB.php b/locales/reports_locales/inventory_en_GB.php index a48c56c0..4f2ae423 100644 --- a/locales/reports_locales/inventory_en_GB.php +++ b/locales/reports_locales/inventory_en_GB.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ diff --git a/locales/reports_locales/inventory_es_VE.php b/locales/reports_locales/inventory_es_VE.php new file mode 100644 index 00000000..370a646a --- /dev/null +++ b/locales/reports_locales/inventory_es_VE.php @@ -0,0 +1,150 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Inventory'] = [ + + 'title' => "Inventario", + + 'reportHbarComputersByOS' => [ + 'title' => "Computadoras por sistema operativo", + 'desc' => "Barras", + 'category' => "Sistema Operativo", + ], + + 'reportPieComputersByOS' => [ + 'title' => "Computadoras por sistema operativo", + 'desc' => "Torta con corte", + 'category' => "Sistema Operativo", + ], + + 'reportHbarComputersByFabricant' => [ + 'title' => "Computadoras por fabricante", + 'desc' => "Barras", + 'category' => "Fabricante", + ], + + 'reportPieComputersByFabricant' => [ + 'title' => "Computadoras por fabricante", + 'desc' => "Pie", + 'category' => "Fabricante", + ], + + 'reportHbarComputersByType' => [ + 'title' => "Computadoras por tipo", + 'desc' => "Barras", + 'category' => "Tipo", + ], + + 'reportPieComputersByType' => [ + 'title' => "Computadoras por tipo", + 'desc' => "Pie", + 'category' => "Tipo", + ], + + 'reportHbarComputersByStatus' => [ + 'title' => "Computadoras por estado", + 'desc' => "Barras", + 'category' => "Estado", + ], + + 'reportHbarPrintersByStatus' => [ + 'title' => "Impresoras por estado", + 'desc' => "Barras", + 'category' => "Estado", + ], + + 'reportHbarWindows' => [ + 'title' => "Distribución Windows", + 'desc' => "Barras", + 'category' => "Sistema Operativo", + ], + + 'reportHbarLinux' => [ + 'title' => "Detalle distribución Linux", + 'desc' => "Barras", + 'category' => "Sistema Operativo", + ], + + 'reportHbarLinuxDistro' => [ + 'title' => "Detalle distribución Linux", + 'desc' => "Barras", + 'category' => "Sistema Operativo", + ], + + 'reportHbarMac' => [ + 'title' => "Detalle versiones MAC OS X", + 'desc' => "Barras", + 'category' => "Sistema Operativo", + ], + + 'reportHbarMacFamily' => [ + 'title' => "Vista general versiones MAC OS X", + 'desc' => "Barras", + 'category' => "Sistema Operativo", + ], + + 'reportHbarComputersByAge' => [ + 'title' => "Computadoras por antiguedad", + 'desc' => "Barras", + 'category' => "Activos", + ], + + 'reportPieComputersByAge' => [ + 'title' => "Computadoras por antiguedad", + 'desc' => "Pie", + 'category' => "Activos", + ], + + 'reportHbarFusionInventory' => [ + 'title' => "Distribución de agentes FusionInventory", + 'desc' => "Barras", + 'category' => "Agente", + ], + + 'reportPieFusionInventory' => [ + 'title' => "Distribución de agentes FusionInventory", + 'desc' => "Pie", + 'category' => "Agente", + ], + + 'reportHbarMonitors' => [ + 'title' => "Distribución de computadoras por Numero de Monitores", + 'desc' => "Barras", + 'category' => "Activos", + ], + + 'reportHbarComputersByEntity' => [ + 'title' => "Computadoras por entidad", + 'desc' => "Barras", + 'category' => "Entidad", + ], +]; diff --git a/locales/reports_locales/inventory_fr_FR.php b/locales/reports_locales/inventory_fr_FR.php index 397878be..574abf14 100644 --- a/locales/reports_locales/inventory_fr_FR.php +++ b/locales/reports_locales/inventory_fr_FR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ diff --git a/locales/reports_locales/inventory_hr_HR.php b/locales/reports_locales/inventory_hr_HR.php index 133dddbb..7816a629 100644 --- a/locales/reports_locales/inventory_hr_HR.php +++ b/locales/reports_locales/inventory_hr_HR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ diff --git a/locales/reports_locales/inventory_pl_PL.php b/locales/reports_locales/inventory_pl_PL.php new file mode 100644 index 00000000..4169beca --- /dev/null +++ b/locales/reports_locales/inventory_pl_PL.php @@ -0,0 +1,150 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Inventory'] = [ + + 'title' => "Zasoby", + + 'reportHbarComputersByOS' => [ + 'title' => "Komputery wg OS", + 'desc' => "wykres słupkowy", + 'category' => "OS", + ], + + 'reportPieComputersByOS' => [ + 'title' => "Komputery wg OS", + 'desc' => "wykres kołowy", + 'category' => "OS", + ], + + 'reportHbarComputersByFabricant' => [ + 'title' => "Komputery wg producenta", + 'desc' => "wykres słupkowy", + 'category' => "Producent", + ], + + 'reportPieComputersByFabricant' => [ + 'title' => "Komputery wg producenta", + 'desc' => "wykres kołowy", + 'category' => "Producent", + ], + + 'reportHbarComputersByType' => [ + 'title' => "Komputery wg typu", + 'desc' => "wykres słupkowy", + 'category' => "Typ", + ], + + 'reportPieComputersByType' => [ + 'title' => "Komputery wg typu", + 'desc' => "wykres kołowy", + 'category' => "Typ", + ], + + 'reportHbarComputersByStatus' => [ + 'title' => "Komputery wg statusu", + 'desc' => "wykres słupkowy", + 'category' => "Status", + ], + + 'reportHbarPrintersByStatus' => [ + 'title' => "Komputery wg statusu", + 'desc' => "wykres słupkowy", + 'category' => "Status", + ], + + 'reportHbarWindows' => [ + 'title' => "Windows - wersje", + 'desc' => "wykres słupkowy", + 'category' => "OS", + ], + + 'reportHbarLinux' => [ + 'title' => "Linux - wersje", + 'desc' => "wykres słupkowy", + 'category' => "OS", + ], + + 'reportHbarLinuxDistro' => [ + 'title' => "Linux - wersje", + 'desc' => "wykres słupkowy", + 'category' => "OS", + ], + + 'reportHbarMac' => [ + 'title' => "Mac OS X versions details", + 'desc' => "wykres słupkowy", + 'category' => "OS", + ], + + 'reportHbarMacFamily' => [ + 'title' => "MAC OS X version overview", + 'desc' => "wykres słupkowy", + 'category' => "OS", + ], + + 'reportHbarComputersByAge' => [ + 'title' => "Komputery wg wieku", + 'desc' => "wykres słupkowy", + 'category' => "Inne", + ], + + 'reportPieComputersByAge' => [ + 'title' => "Komputery wg wieku", + 'desc' => "wykres kołowy", + 'category' => "Inne", + ], + + 'reportHbarFusionInventory' => [ + 'title' => "FusionInventory agent - wersje", + 'desc' => "wykres słupkowy", + 'category' => "Agent", + ], + + 'reportPieFusionInventory' => [ + 'title' => "FusionInventory agent - wersje", + 'desc' => "wykres kołowy", + 'category' => "Agent", + ], + + 'reportHbarMonitors' => [ + 'title' => "Ilość monitorów na komputer", + 'desc' => "wykres słupkowy", + 'category' => "Inne", + ], + + 'reportHbarComputersByEntity' => [ + 'title' => "Komputery wg jednostki", + 'desc' => "wykres słupkowy", + 'category' => "Entity", + ], +]; diff --git a/locales/reports_locales/inventory_pt_BR.php b/locales/reports_locales/inventory_pt_BR.php index fdf548bc..efe5a29c 100644 --- a/locales/reports_locales/inventory_pt_BR.php +++ b/locales/reports_locales/inventory_pt_BR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory']['title'] = "Inventário"; diff --git a/locales/reports_locales/inventory_pt_PT.php b/locales/reports_locales/inventory_pt_PT.php index 22651f04..b010459c 100644 --- a/locales/reports_locales/inventory_pt_PT.php +++ b/locales/reports_locales/inventory_pt_PT.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ 'title' => "Inventário", diff --git a/locales/reports_locales/inventory_ru_RU.php b/locales/reports_locales/inventory_ru_RU.php index d69614d3..0a0d198b 100644 --- a/locales/reports_locales/inventory_ru_RU.php +++ b/locales/reports_locales/inventory_ru_RU.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Inventory'] = [ diff --git a/locales/reports_locales/other_cs_CZ.php b/locales/reports_locales/other_cs_CZ.php index e2ed87c2..6a622eda 100644 --- a/locales/reports_locales/other_cs_CZ.php +++ b/locales/reports_locales/other_cs_CZ.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ diff --git a/locales/reports_locales/other_de_DE.php b/locales/reports_locales/other_de_DE.php index 8690d7af..87aa8f52 100644 --- a/locales/reports_locales/other_de_DE.php +++ b/locales/reports_locales/other_de_DE.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ diff --git a/locales/reports_locales/other_en_GB.php b/locales/reports_locales/other_en_GB.php index 06819eef..dd12711d 100644 --- a/locales/reports_locales/other_en_GB.php +++ b/locales/reports_locales/other_en_GB.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ diff --git a/locales/reports_locales/other_es_VE.php b/locales/reports_locales/other_es_VE.php new file mode 100644 index 00000000..eb3a3793 --- /dev/null +++ b/locales/reports_locales/other_es_VE.php @@ -0,0 +1,41 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Other'] = [ + 'title' => "Otro", + + 'reportHbarLogs' => [ + 'title' => "Distribución de eventos", + 'desc' => "Barras", + 'category' => "Eventos", + ] +]; diff --git a/locales/reports_locales/other_fr_FR.php b/locales/reports_locales/other_fr_FR.php index 4999f88c..232399a1 100644 --- a/locales/reports_locales/other_fr_FR.php +++ b/locales/reports_locales/other_fr_FR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ diff --git a/locales/reports_locales/other_hr_HR.php b/locales/reports_locales/other_hr_HR.php index 56dca95b..3883f96b 100644 --- a/locales/reports_locales/other_hr_HR.php +++ b/locales/reports_locales/other_hr_HR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ diff --git a/locales/reports_locales/other_pl_PL.php b/locales/reports_locales/other_pl_PL.php new file mode 100644 index 00000000..490a2e0f --- /dev/null +++ b/locales/reports_locales/other_pl_PL.php @@ -0,0 +1,41 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Other'] = [ + 'title' => "Inne", + + 'reportHbarLogs' => [ + 'title' => "Statystyka logów", + 'desc' => "wykres słupkowy", + 'category' => "Logi", + ] +]; \ No newline at end of file diff --git a/locales/reports_locales/other_pt_BR.php b/locales/reports_locales/other_pt_BR.php index 2f499534..917e6c51 100644 --- a/locales/reports_locales/other_pt_BR.php +++ b/locales/reports_locales/other_pt_BR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other']['title'] = "Outros"; diff --git a/locales/reports_locales/other_pt_PT.php b/locales/reports_locales/other_pt_PT.php index 60893bf8..0e81c3ff 100644 --- a/locales/reports_locales/other_pt_PT.php +++ b/locales/reports_locales/other_pt_PT.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ 'title' => "Outros", diff --git a/locales/reports_locales/other_ru_RU.php b/locales/reports_locales/other_ru_RU.php index 0a248fcf..85f09fd2 100644 --- a/locales/reports_locales/other_ru_RU.php +++ b/locales/reports_locales/other_ru_RU.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Other'] = [ diff --git a/locales/reports_locales/tag_cs_CZ.php b/locales/reports_locales/tag_cs_CZ.php index f757a6f4..0774bb2f 100644 --- a/locales/reports_locales/tag_cs_CZ.php +++ b/locales/reports_locales/tag_cs_CZ.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Tag'] = [ diff --git a/locales/reports_locales/tag_de_DE.php b/locales/reports_locales/tag_de_DE.php index 3364bfb4..616467d1 100644 --- a/locales/reports_locales/tag_de_DE.php +++ b/locales/reports_locales/tag_de_DE.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Tag'] = [ diff --git a/locales/reports_locales/tag_en_GB.php b/locales/reports_locales/tag_en_GB.php index 27ff3a76..ac5f4f78 100644 --- a/locales/reports_locales/tag_en_GB.php +++ b/locales/reports_locales/tag_en_GB.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Tag'] = [ diff --git a/locales/reports_locales/tag_es_VE.php b/locales/reports_locales/tag_es_VE.php new file mode 100644 index 00000000..5a311e07 --- /dev/null +++ b/locales/reports_locales/tag_es_VE.php @@ -0,0 +1,49 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Tag'] = [ + + 'title' => "Complemento Etiqueta", + + 'reportPieTag' => [ + 'title' => "Numero de Etiquetas usadas", + 'desc' => "Torta", + 'category' => "Para todos los objetos GLPI", + ], + + 'reportPieTagOnTicket' => [ + 'title' => "Numero de Etiquetas usadas", + 'desc' => "Torta", + 'category' => "Por casos", + ] + +]; diff --git a/locales/reports_locales/tag_fr_FR.php b/locales/reports_locales/tag_fr_FR.php index 2bec34d8..b1fececf 100644 --- a/locales/reports_locales/tag_fr_FR.php +++ b/locales/reports_locales/tag_fr_FR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Tag'] = [ diff --git a/locales/reports_locales/tag_hr_HR.php b/locales/reports_locales/tag_hr_HR.php index a44b7a7c..e601b184 100644 --- a/locales/reports_locales/tag_hr_HR.php +++ b/locales/reports_locales/tag_hr_HR.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Tag'] = [ diff --git a/locales/reports_locales/tag_pl_PL.php b/locales/reports_locales/tag_pl_PL.php new file mode 100644 index 00000000..c8792250 --- /dev/null +++ b/locales/reports_locales/tag_pl_PL.php @@ -0,0 +1,49 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + +global $LANG; + +$LANG['plugin_mreporting']['Tag'] = [ + + 'title' => "Wtyczka TAG", + + 'reportPieTag' => [ + 'title' => "Liczba użytych tagów", + 'desc' => "wykres kołowy", + 'category' => "Dla wszystkich obiektów w GLPI", + ], + + 'reportPieTagOnTicket' => [ + 'title' => "Liczba użytych tagów", + 'desc' => "wykres kołowy", + 'category' => "Dla zgłoszeń", + ] + +]; \ No newline at end of file diff --git a/locales/reports_locales/tag_ru_RU.php b/locales/reports_locales/tag_ru_RU.php index 83055110..4a9698f8 100644 --- a/locales/reports_locales/tag_ru_RU.php +++ b/locales/reports_locales/tag_ru_RU.php @@ -1,4 +1,33 @@ . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- + */ + global $LANG; $LANG['plugin_mreporting']['Tag'] = [ diff --git a/locales/ro_RO.mo b/locales/ro_RO.mo index 5c3cc2cf..641f4d4e 100644 Binary files a/locales/ro_RO.mo and b/locales/ro_RO.mo differ diff --git a/locales/ro_RO.po b/locales/ro_RO.po index 88041b15..c83819b9 100644 --- a/locales/ro_RO.po +++ b/locales/ro_RO.po @@ -1,257 +1,273 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Romanian (Romania) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/ro_RO/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Romanian (Romania) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/ro_RO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ro_RO\n" "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/common.class.php:910 -msgid "Number" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/common.class.php:1132 -msgid "No model available" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/common.class.php:1140 -msgid "No graphic selected" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" msgstr "" -#: inc/config.class.php:38 +#: inc/config.class.php:154 +msgid "Class" +msgstr "" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "" + +#: inc/config.class.php:40 msgid "Configuration" msgstr "" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" msgstr "" -#: inc/config.class.php:82 -msgid "See values" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" msgstr "" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" msgstr "" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/config.class.php:113 -msgid "Class" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" msgstr "" -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/config.class.php:525 -msgid "Object already exists" +#: inc/common.class.php:1421 +msgid "Month" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/ru_RU.mo b/locales/ru_RU.mo index 9e2ccd41..1a967a53 100644 Binary files a/locales/ru_RU.mo and b/locales/ru_RU.mo differ diff --git a/locales/ru_RU.po b/locales/ru_RU.po index 2ef40192..6c5aa22f 100644 --- a/locales/ru_RU.po +++ b/locales/ru_RU.po @@ -10,266 +10,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2019-02-21 13:40+0000\n" -"Last-Translator: Denis Arkhipov \n" -"Language-Team: Russian (Russia) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/ru_RU/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Denis Arkhipov , 2019\n" +"Language-Team: Russian (Russia) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/ru_RU/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru_RU\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Подробные отчеты" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Нет доступных отчетов!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Общий отчет - ODT" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Добавление/удаление ПО компьютера" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Здравствуйте,

\n\n

Отчеты GLPI готовы.
\nВы их найдете во вложении данного письма.

\n" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Добавление/удаление версии ПО" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Добавить отчет" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "Добавление инфоком" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "Добавление/удаление профиля у пользователя" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "Добавление/удаление группы пользователя" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Пользователь удален из LDAP" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Добавление/удаление элемента" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Логи плагина Webservice" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "Добавление/удаление профиля у пользователя" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS Информация" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "Добавление/удаление связи" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Добавление/удаление ПО компьютера" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Добавление/удаление версии ПО" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "Добавление/обновление/удаление устройства" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "Добавление/удаление связи" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "Дополнительные условия для MySQL" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Добавление/удаление элемента" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "Автоматически создано GLPI" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Класс" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" msgstr "Комментарии & дата правки изменений" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Логи плагина Genericobject" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Настройки" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "Управление правами" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Настроить отчет" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Выберите, пожалуйста, модель в свойствах" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Кривые линии (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Панель состояния" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Список отчетов" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Приборная панель пустая. Пожалуйста, добавьте отчеты нажав на иконку." -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Без данных" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Формат диаграммы по умолчанию" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "С данными" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Задержка по умолчанию" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Номер" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "Отчеты GLPI статистики" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "данные" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Общий отчет - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Нет доступных моделей" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Логи плагина Genericobject" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "График не выбран" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Привет,\nОтчет из GLPI доступен.\nВы найдете его в вложении этого сообщения.\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Неделя" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Инициализировать графическую настройку" -#: inc/common.class.php:1407 +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "Максимальная глубина уровня организации" + +#: inc/common.class.php:1421 msgid "Month" msgstr "Месяц" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "Максимальная глубина уровня организации" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Подробные отчеты" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "Уведомления для \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Нет данных за этот период!" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Здравствуйте,

\n\n

Отчеты GLPI готовы.
\nВы их найдете во вложении данного письма.

\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "График не выбран" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "Отчеты GLPI статистики" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Нет доступных моделей" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Привет,\nОтчет из GLPI доступен.\nВы найдете его в вложении этого сообщения.\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Нет доступных отчетов!" + +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "Уведомления для \"More Reporting\"" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" msgstr "Уведомление(я) отправлено(ы)!" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Нет данных за этот период!" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Номер" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Неопределено" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS Информация" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Настройки" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Объект уже существует" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Смотреть область" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "При наведении курсора" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Кривые линии (SVG)" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Выберите, пожалуйста, модель в свойствах" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Смотреть значения" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Список отчетов" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Обратная сортировка" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Единица" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Задержка по умолчанию" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "Управление правами" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "Дополнительные условия для MySQL" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Смотреть область" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Смотреть график" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Класс" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Смотреть значения" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Формат диаграммы по умолчанию" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Выбрать отчет для добавления" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Выбрать отчет для отображения" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Отправить отчет с уведомлением" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Инициализировать графическую настройку" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "При наведении курсора" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Неопределено" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Объект уже существует" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Единица" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Выбрать отчет для отображения" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Пользователь удален из LDAP" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Приборная панель пустая. Пожалуйста, добавьте отчеты нажав на иконку." +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Логи плагина Webservice" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Добавить отчет" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Неделя" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Выбрать отчет для добавления" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "С данными" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Настроить отчет" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Без данных" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "Автоматически создано GLPI" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "данные" diff --git a/locales/ru_lv.mo b/locales/ru_lv.mo index faf318ea..1388032f 100644 Binary files a/locales/ru_lv.mo and b/locales/ru_lv.mo differ diff --git a/locales/ru_lv.po b/locales/ru_lv.po index e3f28aa5..334a1a8e 100644 --- a/locales/ru_lv.po +++ b/locales/ru_lv.po @@ -1,257 +1,273 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Russian (Latvia) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/ru_lv/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Russian (Latvia) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/ru_lv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru_lv\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/common.class.php:910 -msgid "Number" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/common.class.php:1132 -msgid "No model available" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/common.class.php:1140 -msgid "No graphic selected" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" msgstr "" -#: inc/config.class.php:38 +#: inc/config.class.php:154 +msgid "Class" +msgstr "" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" +msgstr "" + +#: inc/config.class.php:40 msgid "Configuration" msgstr "" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" msgstr "" -#: inc/config.class.php:82 -msgid "See values" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" msgstr "" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" msgstr "" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/config.class.php:113 -msgid "Class" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" msgstr "" -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/config.class.php:525 -msgid "Object already exists" +#: inc/common.class.php:1421 +msgid "Month" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/tr_TR.mo b/locales/tr_TR.mo index d4d66e73..71d36f4b 100644 Binary files a/locales/tr_TR.mo and b/locales/tr_TR.mo differ diff --git a/locales/tr_TR.po b/locales/tr_TR.po index b85b0b88..52610f26 100644 --- a/locales/tr_TR.po +++ b/locales/tr_TR.po @@ -3,271 +3,272 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# Kaya Zeren , 2015-2019 +# Kaya Zeren , 2015-2019,2021,2023 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2019-07-30 23:48+0000\n" -"Last-Translator: Kaya Zeren \n" -"Language-Team: Turkish (Turkey) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/tr_TR/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: Kaya Zeren , 2015-2019,2021,2023\n" +"Language-Team: Turkish (Turkey) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/tr_TR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: tr_TR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "Diğer Raporlar" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "Kullanılabilecek bir rapor yok !" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "\n

Merhaba,

\n\n

Size GLPI raporları gönderildi.
\nBu e-postanın ekinde bulabilirsiniz.

\n\n" -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "Genel Rapor - ODT" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "Rapor ekle" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "Bir bilgisayara yazılım yükleyin ya da kaldırın" +#: inc/other.class.php:78 +msgid "Add infocom" +msgstr "Infocom ekle" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "Bir yazılıma sürüm yükleyin ya da kaldırın" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" +msgstr "Bir kullanıcıyı bir gruba ekle ya da çıkar" -#: inc/other.class.php:76 -msgid "Add infocom" -msgstr "Infocom ekleyin" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "Öge ekleme ya da kaldırma" -#: inc/other.class.php:79 +#: inc/other.class.php:81 msgid "Add/remove profile on a user" -msgstr "Bir kullanıcıya profil ekleyin ya da kaldırın" - -#: inc/other.class.php:82 -msgid "Add/remove group on a user" -msgstr "Bir kullanıcıyı bir gruba ekleyin ya da çıkarın" +msgstr "Bir kullanıcıya profil ekle ya da kaldır" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "Kullanıcı LDAP üzerinden silindi" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "İlişki ekleme ya da kaldırma" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Web hizmeti günlükleri" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "Bir bilgisayara yazılım kur ya da kaldır" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS Bilgileri" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "Bir yazılıma sürüm kur ya da kaldır" -#: inc/other.class.php:100 +#: inc/other.class.php:102 msgid "Add/update/remove device" -msgstr "Aygır ekleme/güncelleme/silme" +msgstr "Aygıt ekleme/güncelleme/silme" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "İlişki ekleme ya da kaldırma" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "MySQL için ek koşul" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "Öge ekleme ya da kaldırma" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "GLPI tarafından otomatik olarak oluşturuldu" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "Sınıf" -#: inc/other.class.php:109 +#: inc/other.class.php:111 msgid "Comments & date_mod changes" -msgstr "Yorumlar ve date_mod değişiklikler" +msgstr "Açıklamalar ve date_mod değişiklikleri" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" -msgstr "Genel nesne uygulama eki günlükleri" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "Yapılandırma" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "İzin yönetimi" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "Rapor yapılandırması" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" -msgstr "Lütfen ayarlarınızdan bir model seçin" +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" +msgstr "Çizelge çizgileri (SVG)" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "Pano" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" -msgstr "Rapor listesi" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" +msgstr "Pano boş. Lütfen simge üzerine tıklayarak raporlar ekleyin" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" -msgstr "Veriler olmadan" +#: inc/config.class.php:162 +msgid "Default chart format" +msgstr "Varsayılan çizelge biçimi" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" -msgstr "Veriler ile" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" +msgstr "Varsayılan gecikme" -#: inc/common.class.php:929 -msgid "Number" -msgstr "Sayı" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" +msgstr "GLPI istatistik raporları" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" -msgstr "veri" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "Genel rapor - ODT" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "Kullanılabilecek bir model yok" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" +msgstr "Genel nesne uygulama eki günlükleri" -#: inc/common.class.php:1163 -msgid "No graphic selected" -msgstr "Seçilmiş bir çizelge yok" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "Merhaba,\n\nSize GLPI raporları gönderildi.\nBu e-postanın ekinde bulabilirsiniz.\n\n" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "Hafta" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" +msgstr "Çizelge yapılandırmasını başlat" + +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "En yüksek varlık düzeyi" -#: inc/common.class.php:1407 +#: inc/common.class.php:1421 msgid "Month" msgstr "Ay" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "En yüksek varlık düzeyi" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "Diğer raporlar" + +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" +msgstr "Bu tarih aralığında bir veri yok!" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" -msgstr "\"Diğer Raporlar\" bildirimi" +#: inc/common.class.php:1176 +msgid "No graphic selected" +msgstr "Seçilmiş bir çizelge yok" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" -msgstr "\n

Merhaba,

\n\n

Size GLPI raporları gönderildi.
\nBu e-postanın ekinde bulabilirsiniz.

\n\n" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "Kullanılabilecek bir model yok" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "GLPI istatistik raporları" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "Kullanılabilecek bir rapor yok!" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "Merhaba,\n\nSize GLPI raporları gönderildi.\nBu e-postanın ekinde bulabilirsiniz.\n\n" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" +msgstr "\"Diğer raporlar\" bildirimi" -#: inc/notification.class.php:153 +#: inc/notification.class.php:182 msgid "Notification(s) sent !" -msgstr "Bildirimler gönderildi !" - -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" -msgstr "Bu tarih aralığında bir veri yok !" +msgstr "Bildirimler gönderildi!" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" -msgstr "Belirtilmemiş" +#: inc/common.class.php:942 +msgid "Number" +msgstr "Sayı" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "Yapılandırma" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS bilgileri" -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "Alanı görüntüle" +#: inc/config.class.php:577 +msgid "Object already exists" +msgstr "Nesne zaten var" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" -msgstr "Çizelge çizgileri (SVG)" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" +msgstr "Fare ile üzerine gelindiğinde" -#: inc/config.class.php:100 -msgid "See values" -msgstr "Değerleri görüntüle" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" +msgstr "Lütfen ayarlarınızdan bir model seçin" + +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" +msgstr "Rapor listesi" -#: inc/config.class.php:110 inc/config.class.php:733 +#: inc/config.class.php:112 inc/config.class.php:735 msgid "Reverse data array" msgstr "Veri dizisi tersten" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" -msgstr "Birim" - -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" -msgstr "Varsayılan gecikme" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "İzin yönetimi" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" -msgstr "MySQL için ek koşul" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "Alanı görüntüle" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "Çizelgeyi görüntüle" -#: inc/config.class.php:152 -msgid "Class" -msgstr "Sınıf" +#: inc/config.class.php:102 +msgid "See values" +msgstr "Değerleri görüntüle" -#: inc/config.class.php:160 -msgid "Default chart format" -msgstr "Varsayılan çizelge biçimi" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" +msgstr "Eklenecek bir rapor seçin" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/dashboard.class.php:87 +msgid "Select a report to display" +msgstr "Görüntülenecek raporu seçin" + +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "Bu raporu bildirim ile gönder" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" -msgstr "Çizelge yapılandırmasını başlat" - -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" -msgstr "Fare ile üzerine gelindiğinde" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" +msgstr "Belirtilmemiş" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "Nesne zaten var" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" +msgstr "Birim" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "Görüntülenecek raporu seçin" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "Kullanıcı LDAP üzerinden silindi" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "Pano boş. Lütfen simge üzerine tıklayarak raporlar ekleyin" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "İnternet hizmeti günlükleri" -#: inc/dashboard.class.php:105 -msgid "Add a report" -msgstr "Rapor ekle" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "Hafta" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" -msgstr "Eklenecek bir rapor seçin" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "Veriler ile" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "Rapor yapılandırması" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "Veriler olmadan" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "GLPI tarafından otomatik olarak oluşturuldu" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "veri" diff --git a/locales/uk_UA.mo b/locales/uk_UA.mo index 0ca0f6ec..4be6b9a8 100644 Binary files a/locales/uk_UA.mo and b/locales/uk_UA.mo differ diff --git a/locales/uk_UA.po b/locales/uk_UA.po index c05ecf71..c50d1431 100644 --- a/locales/uk_UA.po +++ b/locales/uk_UA.po @@ -1,257 +1,273 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR Mreporting Development Team -# This file is distributed under the same license as the GLPI - Mreporting plugin package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-02 14:27+0200\n" -"PO-Revision-Date: 2016-06-02 12:27+0000\n" -"Last-Translator: Alexandre DELAUNAY \n" -"Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/uk_UA/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Ukrainian (Ukraine) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/uk_UA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: uk_UA\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: setup.php:139 test.php:4 front/central.php:33 front/config.form.php:53 -#: front/config.php:45 front/dashboard.form.php:34 front/graph.php:37 -#: front/preference.form.php:43 inc/common.class.php:47 -#: inc/notification.class.php:18 -#: inc/notificationtargetnotification.class.php:8 inc/preference.class.php:182 -#: inc/profile.class.php:38 -msgid "More Reporting" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" + +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" msgstr "" -#: ajax/dropdownExport.php:45 inc/common.class.php:494 -msgid "With data" +#: inc/dashboard.class.php:105 +msgid "Add a report" msgstr "" -#: ajax/dropdownExport.php:46 inc/common.class.php:493 -msgid "Without data" +#: inc/other.class.php:78 +msgid "Add infocom" msgstr "" -#: ajax/homepage_link.php:6 inc/common.class.php:58 inc/common.class.php:59 -#: inc/common.class.php:71 inc/dashboard.class.php:35 -msgid "Dashboard" +#: inc/other.class.php:84 +msgid "Add/remove group on a user" msgstr "" -#: front/central.php:73 front/central.php:80 inc/common.class.php:316 -#: inc/common.class.php:383 inc/common.class.php:417 inc/config.class.php:613 -msgid "No report is available !" +#: inc/other.class.php:108 +msgid "Add/remove item" msgstr "" -#: front/popup.php:38 inc/common.class.php:1124 inc/common.class.php:1131 -#: inc/common.class.php:1139 -msgid "General Report - ODT" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:80 -msgid "Reports list" +#: inc/other.class.php:105 +msgid "Add/remove relation" msgstr "" -#: inc/common.class.php:910 -msgid "Number" +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" msgstr "" -#: inc/common.class.php:931 inc/common.class.php:1230 -#: inc/common.class.php:1246 -msgid "data" +#: inc/other.class.php:75 +msgid "Add/remove version on a software" msgstr "" -#: inc/common.class.php:1125 inc/preference.class.php:123 -msgid "Please, select a model in your preferences" +#: inc/other.class.php:102 +msgid "Add/update/remove device" msgstr "" -#: inc/common.class.php:1132 -msgid "No model available" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" msgstr "" -#: inc/common.class.php:1140 -msgid "No graphic selected" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "" + +#: inc/config.class.php:154 +msgid "Class" +msgstr "" + +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" msgstr "" -#: inc/config.class.php:38 +#: inc/config.class.php:40 msgid "Configuration" msgstr "" -#: inc/config.class.php:70 inc/config.class.php:641 -msgid "See area" +#: inc/dashboard.class.php:202 +msgid "Configure report" msgstr "" -#: inc/config.class.php:76 inc/config.class.php:656 inc/config.class.php:668 +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 msgid "Curve lines (SVG)" msgstr "" -#: inc/config.class.php:82 -msgid "See values" +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 +msgid "Dashboard" msgstr "" -#: inc/config.class.php:89 inc/config.class.php:683 -msgid "Reverse data array" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/config.class.php:95 inc/config.class.php:695 -msgid "Unit" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/config.class.php:99 inc/config.class.php:705 +#: inc/config.class.php:129 inc/config.class.php:762 msgid "Default delay" msgstr "" -#: inc/config.class.php:103 inc/config.class.php:713 -msgid "Additional condition for MySQL" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/config.class.php:107 inc/config.class.php:621 -msgid "See graphic" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" msgstr "" -#: inc/config.class.php:113 -msgid "Class" +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/config.class.php:125 inc/config.class.php:722 -msgid "Send this report with the notification" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" msgstr "" -#: inc/config.class.php:209 +#: inc/config.class.php:257 msgid "Initialize graphics configuration" msgstr "" -#: inc/config.class.php:442 inc/config.class.php:457 -msgid "On mouse over" +#: inc/common.class.php:1534 +msgid "Max depth entity level" msgstr "" -#: inc/config.class.php:525 -msgid "Object already exists" +#: inc/common.class.php:1421 +msgid "Month" msgstr "" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" msgstr "" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:1168 +msgid "No model available" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" msgstr "" -#: inc/graph.class.php:155 inc/graph.class.php:354 inc/graph.class.php:548 -#: inc/graph.class.php:808 inc/graph.class.php:1029 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:530 -#: inc/graphpng.class.php:717 inc/graphpng.class.php:911 -#: inc/graphpng.class.php:1202 inc/graphpng.class.php:1433 -#: inc/graphpng.class.php:1736 inc/graphpng.class.php:1999 -msgid "No data for this date range !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/helpdesk.class.php:278 inc/helpdesk.class.php:337 -msgid "Undefined" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/notification.class.php:34 inc/notification.class.php:54 -#: inc/notification.class.php:119 -msgid "Notification for \"More Reporting\"" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/other.class.php:99 +msgid "OCS Infos" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/notification.class.php:144 -msgid "Notification(s) sent !" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/other.class.php:76 -msgid "Add infocom" +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" msgstr "" -#: inc/other.class.php:82 -msgid "Add/remove group on a user" +#: inc/config.class.php:145 inc/config.class.php:673 +msgid "See graphic" msgstr "" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" +#: inc/config.class.php:102 +msgid "See values" msgstr "" -#: inc/other.class.php:93 -msgid "Webservice logs" +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/other.class.php:97 -msgid "OCS Infos" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/other.class.php:100 -msgid "Add/update/remove device" +#: inc/config.class.php:171 inc/config.class.php:789 +msgid "Send this report with the notification" msgstr "" -#: inc/other.class.php:103 -msgid "Add/remove relation" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:95 +msgid "Webservice logs" msgstr "" -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" +#: inc/common.class.php:1420 +msgid "Week" msgstr "" -#: inc/profile.class.php:66 inc/profile.class.php:212 -#: inc/profile.class.php:280 -msgid "Rights management" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" +msgstr "" + +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" +msgstr "" + +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" msgstr "" diff --git a/locales/zh_CN.mo b/locales/zh_CN.mo index 02100e43..3f185c07 100644 Binary files a/locales/zh_CN.mo and b/locales/zh_CN.mo differ diff --git a/locales/zh_CN.po b/locales/zh_CN.po index 97b2f4b6..ed4b1fcf 100644 --- a/locales/zh_CN.po +++ b/locales/zh_CN.po @@ -8,266 +8,267 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - MReporting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-03-09 15:12+0000\n" -"PO-Revision-Date: 2018-07-07 04:52+0000\n" -"Last-Translator: liAnGjiA \n" -"Language-Team: Chinese (China) (http://www.transifex.com/teclib/glpi-project-plugin-mreporting/language/zh_CN/)\n" +"POT-Creation-Date: 2023-09-14 12:49+0000\n" +"PO-Revision-Date: 2015-09-18 08:41+0000\n" +"Last-Translator: liAnGjiA , 2018\n" +"Language-Team: Chinese (China) (http://app.transifex.com/teclib/glpi-project-plugin-mreporting/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: front/dashboard.form.php:34 front/dashboard.form.php:39 front/config.php:45 -#: front/preference.form.php:45 front/graph.php:39 front/central.php:33 -#: front/config.form.php:56 inc/profile.class.php:38 -#: inc/preference.class.php:182 inc/notificationtargetnotification.class.php:8 -#: inc/common.class.php:49 inc/notification.class.php:18 setup.php:177 -msgid "More Reporting" -msgstr "更多报表" - -#: front/central.php:73 front/central.php:80 inc/common.class.php:329 -#: inc/common.class.php:396 inc/config.class.php:663 -msgid "No report is available !" -msgstr "没有可用报表!" - -#: front/popup.php:38 inc/common.class.php:1147 inc/common.class.php:1154 -#: inc/common.class.php:1162 -msgid "General Report - ODT" -msgstr "生成ODT - 报表" - -#: inc/other.class.php:70 -msgid "Add/remove software on a computer" -msgstr "添加/移除计算机中的软件" +#: inc/notification.class.php:68 +msgid "" +"\n" +"

Hello,

\n" +"\n" +"

GLPI reports are available.
\n" +"You will find attached in this email.

\n" +"\n" +msgstr "" -#: inc/other.class.php:73 -msgid "Add/remove version on a software" -msgstr "添加/移除软件版本" +#: inc/dashboard.class.php:105 +msgid "Add a report" +msgstr "" -#: inc/other.class.php:76 +#: inc/other.class.php:78 msgid "Add infocom" msgstr "" -#: inc/other.class.php:79 -msgid "Add/remove profile on a user" -msgstr "添加/移除用户配置" - -#: inc/other.class.php:82 +#: inc/other.class.php:84 msgid "Add/remove group on a user" msgstr "添加/移除群组中的用户" -#: inc/other.class.php:85 -msgid "User deleted from LDAP" -msgstr "从LDAP中删除用户" +#: inc/other.class.php:108 +msgid "Add/remove item" +msgstr "添加/移除项目" -#: inc/other.class.php:93 -msgid "Webservice logs" -msgstr "Web服务日志" +#: inc/other.class.php:81 +msgid "Add/remove profile on a user" +msgstr "添加/移除用户配置" -#: inc/other.class.php:97 -msgid "OCS Infos" -msgstr "OCS 信息" +#: inc/other.class.php:105 +msgid "Add/remove relation" +msgstr "添加/移除关系" + +#: inc/other.class.php:72 +msgid "Add/remove software on a computer" +msgstr "添加/移除计算机中的软件" -#: inc/other.class.php:100 +#: inc/other.class.php:75 +msgid "Add/remove version on a software" +msgstr "添加/移除软件版本" + +#: inc/other.class.php:102 msgid "Add/update/remove device" msgstr "添加/更新/移除设备" -#: inc/other.class.php:103 -msgid "Add/remove relation" -msgstr "添加/移除关系" +#: inc/config.class.php:137 inc/config.class.php:775 +msgid "Additional condition for MySQL" +msgstr "" -#: inc/other.class.php:106 -msgid "Add/remove item" -msgstr "添加/移除项目" +#: inc/pdf.class.php:45 +msgid "Automaticaly generated by GLPI" +msgstr "由GLPI自动生成" -#: inc/other.class.php:109 -msgid "Comments & date_mod changes" +#: inc/config.class.php:154 +msgid "Class" msgstr "" -#: inc/other.class.php:117 -msgid "Genericobject plugin logs" +#: inc/other.class.php:111 +msgid "Comments & date_mod changes" msgstr "" -#: inc/profile.class.php:70 inc/profile.class.php:216 -#: inc/profile.class.php:288 -msgid "Rights management" -msgstr "权限管理" +#: inc/config.class.php:40 +msgid "Configuration" +msgstr "配置" -#: inc/preference.class.php:123 inc/common.class.php:1148 -msgid "Please, select a model in your preferences" +#: inc/dashboard.class.php:202 +msgid "Configure report" +msgstr "配置报表" + +#: inc/config.class.php:93 inc/config.class.php:708 inc/config.class.php:720 +msgid "Curve lines (SVG)" msgstr "" -#: inc/common.class.php:61 inc/common.class.php:62 inc/common.class.php:77 -#: inc/dashboard.class.php:35 ajax/homepage_link.php:8 +#: inc/dashboard.class.php:37 inc/common.class.php:63 inc/common.class.php:64 +#: inc/common.class.php:80 ajax/homepage_link.php:38 msgid "Dashboard" msgstr "视图" -#: inc/common.class.php:64 inc/common.class.php:65 inc/common.class.php:86 -msgid "Reports list" +#: inc/dashboard.class.php:98 +msgid "Dashboard is empty. Please add reports by clicking on the icon" msgstr "" -#: inc/common.class.php:507 ajax/dropdownExport.php:42 -msgid "Without data" +#: inc/config.class.php:162 +msgid "Default chart format" msgstr "" -#: inc/common.class.php:508 ajax/dropdownExport.php:41 -msgid "With data" +#: inc/config.class.php:129 inc/config.class.php:762 +msgid "Default delay" msgstr "" -#: inc/common.class.php:929 -msgid "Number" +#: inc/pdf.class.php:44 inc/notification.class.php:75 +msgid "GLPI statistics reports" msgstr "" -#: inc/common.class.php:950 inc/common.class.php:1253 -#: inc/common.class.php:1269 -msgid "data" +#: inc/common.class.php:1160 inc/common.class.php:1167 +#: inc/common.class.php:1175 front/popup.php:40 +msgid "General Report - ODT" +msgstr "生成ODT - 报表" + +#: inc/other.class.php:119 +msgid "Genericobject plugin logs" msgstr "" -#: inc/common.class.php:1155 -msgid "No model available" -msgstr "没有可用模型" +#: inc/notification.class.php:76 +msgid "" +"Hello,\n" +"\n" +"GLPI reports are available.\n" +"You will find attached in this email.\n" +"\n" +msgstr "您好,\n\nGLPI 报表正常。\n您可在电子邮件附件中看到她的身影。\n\n" -#: inc/common.class.php:1163 -msgid "No graphic selected" +#: inc/config.class.php:257 +msgid "Initialize graphics configuration" msgstr "" -#: inc/common.class.php:1406 -msgid "Week" -msgstr "周" +#: inc/common.class.php:1534 +msgid "Max depth entity level" +msgstr "" -#: inc/common.class.php:1407 +#: inc/common.class.php:1421 msgid "Month" msgstr "月" -#: inc/common.class.php:1520 -msgid "Max depth entity level" -msgstr "" +#: inc/profile.class.php:40 inc/preference.class.php:184 +#: inc/notification.class.php:47 inc/common.class.php:51 +#: inc/notificationtargetnotification.class.php:37 front/config.php:48 +#: front/config.form.php:58 front/central.php:35 front/graph.php:41 +#: front/preference.form.php:48 front/dashboard.form.php:63 +#: front/dashboard.form.php:68 setup.php:178 +msgid "More Reporting" +msgstr "更多报表" -#: inc/notification.class.php:34 inc/notification.class.php:55 -#: inc/notification.class.php:128 -msgid "Notification for \"More Reporting\"" +#: inc/graphpng.class.php:554 inc/graphpng.class.php:748 +#: inc/graphpng.class.php:948 inc/graphpng.class.php:1257 +#: inc/graphpng.class.php:1494 inc/graphpng.class.php:1799 +#: inc/graphpng.class.php:2068 inc/graph.class.php:156 inc/graph.class.php:355 +#: inc/graph.class.php:552 inc/graph.class.php:812 inc/graph.class.php:1032 +#: inc/graph.class.php:1261 inc/graph.class.php:1502 +msgid "No data for this date range !" msgstr "" -#: inc/notification.class.php:39 -msgid "" -"\n" -"

Hello,

\n" -"\n" -"

GLPI reports are available.
\n" -"You will find attached in this email.

\n" -"\n" +#: inc/common.class.php:1176 +msgid "No graphic selected" msgstr "" -#: inc/notification.class.php:46 inc/pdf.class.php:15 -msgid "GLPI statistics reports" -msgstr "" +#: inc/common.class.php:1168 +msgid "No model available" +msgstr "没有可用模型" -#: inc/notification.class.php:47 -msgid "" -"Hello,\n" -"\n" -"GLPI reports are available.\n" -"You will find attached in this email.\n" -"\n" -msgstr "您好,\n\nGLPI 报表正常。\n您可在电子邮件附件中看到她的身影。\n\n" +#: inc/config.class.php:665 inc/common.class.php:332 inc/common.class.php:399 +#: front/central.php:75 front/central.php:82 +msgid "No report is available !" +msgstr "没有可用报表!" -#: inc/notification.class.php:153 -msgid "Notification(s) sent !" +#: inc/notification.class.php:63 inc/notification.class.php:84 +#: inc/notification.class.php:157 +msgid "Notification for \"More Reporting\"" msgstr "" -#: inc/graph.class.php:154 inc/graph.class.php:353 inc/graph.class.php:550 -#: inc/graph.class.php:810 inc/graph.class.php:1030 inc/graph.class.php:1259 -#: inc/graph.class.php:1500 inc/graphpng.class.php:551 -#: inc/graphpng.class.php:745 inc/graphpng.class.php:945 -#: inc/graphpng.class.php:1254 inc/graphpng.class.php:1491 -#: inc/graphpng.class.php:1796 inc/graphpng.class.php:2065 -msgid "No data for this date range !" +#: inc/notification.class.php:182 +msgid "Notification(s) sent !" msgstr "" -#: inc/helpdesk.class.php:284 inc/helpdesk.class.php:343 -msgid "Undefined" +#: inc/common.class.php:942 +msgid "Number" msgstr "" -#: inc/config.class.php:38 -msgid "Configuration" -msgstr "配置" - -#: inc/config.class.php:82 inc/config.class.php:691 -msgid "See area" -msgstr "查看区域" +#: inc/other.class.php:99 +msgid "OCS Infos" +msgstr "OCS 信息" -#: inc/config.class.php:91 inc/config.class.php:706 inc/config.class.php:718 -msgid "Curve lines (SVG)" +#: inc/config.class.php:577 +msgid "Object already exists" msgstr "" -#: inc/config.class.php:100 -msgid "See values" -msgstr "查看值" - -#: inc/config.class.php:110 inc/config.class.php:733 -msgid "Reverse data array" +#: inc/config.class.php:494 inc/config.class.php:509 +msgid "On mouse over" msgstr "" -#: inc/config.class.php:119 inc/config.class.php:745 -msgid "Unit" +#: inc/preference.class.php:125 inc/common.class.php:1161 +msgid "Please, select a model in your preferences" msgstr "" -#: inc/config.class.php:127 inc/config.class.php:755 -msgid "Default delay" +#: inc/common.class.php:66 inc/common.class.php:67 inc/common.class.php:89 +msgid "Reports list" msgstr "" -#: inc/config.class.php:135 inc/config.class.php:763 -msgid "Additional condition for MySQL" +#: inc/config.class.php:112 inc/config.class.php:735 +msgid "Reverse data array" msgstr "" -#: inc/config.class.php:143 inc/config.class.php:671 +#: inc/profile.class.php:72 inc/profile.class.php:224 +#: inc/profile.class.php:296 +msgid "Rights management" +msgstr "权限管理" + +#: inc/config.class.php:84 inc/config.class.php:693 +msgid "See area" +msgstr "查看区域" + +#: inc/config.class.php:145 inc/config.class.php:673 msgid "See graphic" msgstr "" -#: inc/config.class.php:152 -msgid "Class" +#: inc/config.class.php:102 +msgid "See values" +msgstr "查看值" + +#: inc/dashboard.class.php:131 +msgid "Select a report to add" msgstr "" -#: inc/config.class.php:160 -msgid "Default chart format" +#: inc/dashboard.class.php:87 +msgid "Select a report to display" msgstr "" -#: inc/config.class.php:169 inc/config.class.php:772 +#: inc/config.class.php:171 inc/config.class.php:789 msgid "Send this report with the notification" msgstr "" -#: inc/config.class.php:255 -msgid "Initialize graphics configuration" +#: inc/helpdesk.class.php:286 inc/helpdesk.class.php:345 +msgid "Undefined" msgstr "" -#: inc/config.class.php:492 inc/config.class.php:507 -msgid "On mouse over" +#: inc/config.class.php:121 inc/config.class.php:747 +msgid "Unit" msgstr "" -#: inc/config.class.php:575 -msgid "Object already exists" -msgstr "" +#: inc/other.class.php:87 +msgid "User deleted from LDAP" +msgstr "从LDAP中删除用户" -#: inc/dashboard.class.php:85 -msgid "Select a report to display" -msgstr "" +#: inc/other.class.php:95 +msgid "Webservice logs" +msgstr "Web服务日志" -#: inc/dashboard.class.php:96 -msgid "Dashboard is empty. Please add reports by clicking on the icon" -msgstr "" +#: inc/common.class.php:1420 +msgid "Week" +msgstr "周" -#: inc/dashboard.class.php:105 -msgid "Add a report" +#: inc/common.class.php:521 ajax/dropdownExport.php:43 +msgid "With data" msgstr "" -#: inc/dashboard.class.php:134 -msgid "Select a report to add" +#: inc/common.class.php:520 ajax/dropdownExport.php:44 +msgid "Without data" msgstr "" -#: inc/dashboard.class.php:223 -msgid "Configure report" -msgstr "配置报表" - -#: inc/pdf.class.php:16 -msgid "Automaticaly generated by GLPI" -msgstr "由GLPI自动生成" +#: inc/common.class.php:963 inc/common.class.php:1266 +#: inc/common.class.php:1282 +msgid "data" +msgstr "" diff --git a/mreporting.xml b/mreporting.xml index 39a4b69b..263f6542 100644 --- a/mreporting.xml +++ b/mreporting.xml @@ -2,7 +2,7 @@ More Reporting mreporting stable - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/pics/chart-garea.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/pics/chart-garea.png Přidání (a vytváření) nových výkazů s grafy pro glpi @@ -92,12 +92,47 @@ Voir documentation : https://github.com/PluginsGLPI/mreporting/wiki https://github.com/pluginsGLPI/mreporting/ https://github.com/pluginsGLPI/mreporting/releases https://github.com/pluginsGLPI/mreporting/issues - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/README.md + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/README.md Teclib' Infotel + + 1.8.5 + ~10.0.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.8.5/glpi-mreporting-1.8.5.tar.bz2 + + + 1.8.4 + ~10.0.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.8.4/glpi-mreporting-1.8.4.tar.bz2 + + + 1.8.3 + ~10.0.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.8.3/glpi-mreporting-1.8.3.tar.bz2 + + + 1.8.2 + ~10.0.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.8.2/glpi-mreporting-1.8.2.tar.bz2 + + + 1.8.1 + ~10.0.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.8.1/glpi-mreporting-1.8.1.tar.bz2 + + + 1.8.0 + ~10.0.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.8.0/glpi-mreporting-1.8.0.tar.bz2 + + + 1.7.4 + ~9.5.0 + https://github.com/pluginsGLPI/mreporting/releases/download/1.7.4/glpi-mreporting-1.7.4.tar.bz2 + 1.7.3 ~9.5.0 @@ -223,13 +258,13 @@ Voir documentation : https://github.com/PluginsGLPI/mreporting/wiki - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/dashboard.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_area.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_garea.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_gline.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_hbar.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_hgbar.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_line.png - https://raw.githubusercontent.com/pluginsGLPI/mreporting/master/screenshots/mreporting_pie.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/dashboard.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_area.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_garea.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_gline.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_hbar.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_hgbar.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_line.png + https://raw.githubusercontent.com/pluginsGLPI/mreporting/main/screenshots/mreporting_pie.png diff --git a/pics/check24.png b/pics/check24.png old mode 100755 new mode 100644 diff --git a/pics/cross24.png b/pics/cross24.png old mode 100755 new mode 100644 diff --git a/setup.php b/setup.php index 0ff04e15..07dec4b8 100644 --- a/setup.php +++ b/setup.php @@ -1,58 +1,60 @@ . - -------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Mreporting plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Mreporting. + * + * Mreporting is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Mreporting is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Mreporting. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2003-2023 by Mreporting plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/mreporting + * ------------------------------------------------------------------------- */ -define ('PLUGIN_MREPORTING_VERSION', '1.7.3'); +define('PLUGIN_MREPORTING_VERSION', '1.8.5'); // Minimal GLPI version, inclusive -define("PLUGIN_MREPORTING_MIN_GLPI", "9.5"); +define("PLUGIN_MREPORTING_MIN_GLPI", "10.0.0"); // Maximum GLPI version, exclusive -define("PLUGIN_MREPORTING_MAX_GLPI", "9.6"); +define("PLUGIN_MREPORTING_MAX_GLPI", "10.0.99"); if (!defined('PLUGIN_MREPORTING_DIR')) { - define("PLUGIN_MREPORTING_DIR", __DIR__ ); + define("PLUGIN_MREPORTING_DIR", __DIR__); } if (!defined('PLUGIN_MREPORTING_TEMPLATE_DIR')) { - define("PLUGIN_MREPORTING_TEMPLATE_DIR", PLUGIN_MREPORTING_DIR . "/templates/"); + define("PLUGIN_MREPORTING_TEMPLATE_DIR", PLUGIN_MREPORTING_DIR . "/templates/"); } if (!defined('PLUGIN_MREPORTING_TEMPLATE_EXTENSION')) { - define("PLUGIN_MREPORTING_TEMPLATE_EXTENSION", "odt"); + define("PLUGIN_MREPORTING_TEMPLATE_EXTENSION", "odt"); } if (isset($_SESSION['glpi_use_mode']) && $_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) { - define('DEBUG_MREPORTING', true); + define('DEBUG_MREPORTING', true); } else { - define('DEBUG_MREPORTING', false); + define('DEBUG_MREPORTING', false); } if (!defined('PCLZIP_TEMPORARY_DIR')) { - define('PCLZIP_TEMPORARY_DIR', GLPI_DOC_DIR . '/_tmp/pclzip'); + define('PCLZIP_TEMPORARY_DIR', GLPI_DOC_DIR . '/_tmp/pclzip'); } include_once __DIR__ . "/vendor/autoload.php"; @@ -63,107 +65,114 @@ * * @return void */ -function plugin_init_mreporting() { - global $PLUGIN_HOOKS, $CFG_GLPI; - - $PLUGIN_HOOKS['csrf_compliant']['mreporting'] = true; - - $plugin = new Plugin(); - if ($plugin->isInstalled("mreporting") - && $plugin->isActivated("mreporting")) { - - // *Direct* access to rapport file (from e-mail) : - if (isset($_GET['redirect']) && strpos($_GET['redirect'], 'plugin_mreporting') !== false) { - $filename = str_replace('plugin_mreporting_', '', $_GET['redirect']); - Html::redirect($CFG_GLPI["root_doc"]."/files/_plugins/mreporting/notifications/".$filename); - } - - //Load additionnal language files in needed - includeAdditionalLanguageFiles(); - - if (Session::getCurrentInterface()) { - /* Profile */ - $PLUGIN_HOOKS['change_profile']['mreporting'] = ['PluginMreportingProfile', - 'changeProfile']; - $PLUGIN_HOOKS['redirect_page']['mreporting'] = 'front/download.php'; - - Plugin::registerClass('PluginMreportingNotification', - ['notificationtemplates_types' => true]); - - Plugin::registerClass('PluginMreportingDashboard', - ['addtabon' => ['Central']]); - - Plugin::registerClass('PluginMreportingProfile', - ['addtabon' => 'Profile']); - - Plugin::registerClass('PluginMreportingPreference', - ['addtabon' => 'Preference']); +function plugin_init_mreporting() +{ + global $PLUGIN_HOOKS, $CFG_GLPI; + + $PLUGIN_HOOKS['csrf_compliant']['mreporting'] = true; + + if (Plugin::isPluginActive("mreporting")) { + // *Direct* access to rapport file (from e-mail) : + if (isset($_GET['redirect']) && strpos($_GET['redirect'], 'plugin_mreporting') !== false) { + $filename = str_replace('plugin_mreporting_', '', $_GET['redirect']); + Html::redirect($CFG_GLPI["root_doc"] . "/files/_plugins/mreporting/notifications/" . $filename); + } + + //Load additionnal language files in needed + includeAdditionalLanguageFiles(); + + if (Session::getCurrentInterface()) { + /* Profile */ + $PLUGIN_HOOKS['change_profile']['mreporting'] = ['PluginMreportingProfile', + 'changeProfile' + ]; + $PLUGIN_HOOKS['redirect_page']['mreporting'] = 'front/download.php'; + + Plugin::registerClass( + 'PluginMreportingNotification', + ['notificationtemplates_types' => true] + ); + + Plugin::registerClass( + 'PluginMreportingDashboard', + ['addtabon' => ['Central']] + ); + + Plugin::registerClass( + 'PluginMreportingProfile', + ['addtabon' => 'Profile'] + ); + + Plugin::registerClass( + 'PluginMreportingPreference', + ['addtabon' => 'Preference'] + ); + + $mreporting_profile = new PluginMreportingProfile(); + $reports_profiles = $mreporting_profile->find( + [ + 'profiles_id' => $_SESSION['glpiactiveprofile']['id'], + 'right' => READ, + ] + ); + + /* Menu */ + $PLUGIN_HOOKS['config_page']['mreporting'] = 'front/config.php'; + if (count($reports_profiles) > 0) { + $PLUGIN_HOOKS['menu_toadd']['mreporting'] = ['tools' => 'PluginMreportingCommon']; + } - $mreporting_profile = new PluginMreportingProfile; - $reports_profiles = $mreporting_profile->find( - [ - 'profiles_id' => $_SESSION['glpiactiveprofile']['id'], - 'right' => READ, - ] - ); - - /* Menu */ - $PLUGIN_HOOKS['config_page']['mreporting'] = 'front/config.php'; - if (count($reports_profiles) > 0) { - $PLUGIN_HOOKS['menu_toadd']['mreporting'] = ['tools' => 'PluginMreportingCommon']; - } - - /* Show Reports in standart stats page */ - if (preg_match('#front/stat.*\.php#', $_SERVER['SCRIPT_NAME'])) { - $mreporting_common = new PluginMreportingCommon(); - $reports = $mreporting_common->getAllReports(); - if ($reports !== false) { - foreach ($reports as $report) { - foreach ($report['functions'] as $func) { - $PLUGIN_HOOKS['stats']['mreporting'][$func['min_url_graph']] = $func['title']; - } - } + /* Show Reports in standart stats page */ + if (preg_match('#front/stat.*\.php#', $_SERVER['SCRIPT_NAME'])) { + $mreporting_common = new PluginMreportingCommon(); + $reports = $mreporting_common->getAllReports(); + if ($reports !== false) { + foreach ($reports as $report) { + foreach ($report['functions'] as $func) { + $PLUGIN_HOOKS['stats']['mreporting'][$func['min_url_graph']] = $func['title']; + } + } + } } - } - $PLUGIN_HOOKS['pre_item_purge']['mreporting'] + $PLUGIN_HOOKS['pre_item_purge']['mreporting'] = ['Profile' => ['PluginMreportingProfile', 'purgeProfiles'], - 'PluginMreportingConfig' => ['PluginMreportingProfile', 'purgeProfilesByReports']]; - $PLUGIN_HOOKS['item_add']['mreporting'] + 'PluginMreportingConfig' => ['PluginMreportingProfile', 'purgeProfilesByReports'] + ]; + $PLUGIN_HOOKS['item_add']['mreporting'] = ['Profile' => ['PluginMreportingProfile', 'addProfiles'], - 'PluginMreportingConfig' => ['PluginMreportingProfile', 'addReport']]; - - } - - if (isset($_SESSION['glpiactiveprofile']['id']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { - if (PluginMreportingCommon::canAccessAtLeastOneReport($_SESSION['glpiactiveprofile']['id'])) { - $PLUGIN_HOOKS['add_javascript']['mreporting'][] = 'js/helpdesk-menu.js'; //This need Ext js lib ! - $PLUGIN_HOOKS["helpdesk_menu_entry"]['mreporting'] = false; - } - } else { - $PLUGIN_HOOKS["helpdesk_menu_entry"]['mreporting'] = true; - } - - if (strpos($_SERVER['REQUEST_URI'], "/mreporting/") !== false) { - // Add specific files to add to the header : javascript - $PLUGIN_HOOKS['add_javascript']['mreporting'] = [ - "lib/protovis/protovis.js", - "lib/jquery.tipsy/jquery.tipsy.js", - "lib/jquery.tipsy/tipsy.js" - ]; - - //Add specific files to add to the header : css - $PLUGIN_HOOKS['add_css']['mreporting'] = [ - "css/mreporting.css", - "lib/jquery.tipsy/jquery.tipsy.css" - ]; - } - - if (DEBUG_MREPORTING && isset($_SESSION['glpimenu'])) { - unset($_SESSION['glpimenu']); - } - } - + 'PluginMreportingConfig' => ['PluginMreportingProfile', 'addReport'] + ]; + } + + if (isset($_SESSION['glpiactiveprofile']['id']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') { + if (PluginMreportingCommon::canAccessAtLeastOneReport($_SESSION['glpiactiveprofile']['id'])) { + $PLUGIN_HOOKS['add_javascript']['mreporting'][] = 'js/helpdesk-menu.js'; //This need Ext js lib ! + $PLUGIN_HOOKS["helpdesk_menu_entry"]['mreporting'] = false; + } + } else { + $PLUGIN_HOOKS["helpdesk_menu_entry"]['mreporting'] = true; + } + + if (strpos($_SERVER['REQUEST_URI'] ?? '', "/mreporting/") !== false) { + // Add specific files to add to the header : javascript + $PLUGIN_HOOKS['add_javascript']['mreporting'] = [ + "lib/protovis/protovis.js", + "lib/jquery.tipsy/jquery.tipsy.js", + "lib/jquery.tipsy/tipsy.js" + ]; + + //Add specific files to add to the header : css + $PLUGIN_HOOKS['add_css']['mreporting'] = [ + "css/mreporting.css", + "lib/jquery.tipsy/jquery.tipsy.css" + ]; + } + + if (DEBUG_MREPORTING && isset($_SESSION['glpimenu'])) { + unset($_SESSION['glpimenu']); + } + } } /** @@ -172,34 +181,36 @@ function plugin_init_mreporting() { * * @return array */ -function plugin_version_mreporting() { - return [ - 'name' => __('More Reporting', 'mreporting'), - 'version' => PLUGIN_MREPORTING_VERSION, - 'author' => "Teclib' & Infotel", - 'homepage' => "https://github.com/pluginsGLPI/mreporting", - 'license' => 'GPLv2+', - 'requirements' => [ - 'glpi' => [ - 'min' => PLUGIN_MREPORTING_MIN_GLPI, - 'max' => PLUGIN_MREPORTING_MAX_GLPI, - ] - ] - ]; +function plugin_version_mreporting() +{ + return [ + 'name' => __('More Reporting', 'mreporting'), + 'version' => PLUGIN_MREPORTING_VERSION, + 'author' => "Teclib' & Infotel", + 'homepage' => "https://github.com/pluginsGLPI/mreporting", + 'license' => 'GPLv2+', + 'requirements' => [ + 'glpi' => [ + 'min' => PLUGIN_MREPORTING_MIN_GLPI, + 'max' => PLUGIN_MREPORTING_MAX_GLPI, + ] + ] + ]; } -function includeAdditionalLanguageFiles() { - $translations_path = __DIR__ . "/locales/reports_locales/"; +function includeAdditionalLanguageFiles() +{ + $translations_path = __DIR__ . "/locales/reports_locales/"; // Load default translations - foreach (glob($translations_path . "*_en_GB.php") as $path) { - include_once($path); - } + foreach (glob($translations_path . "*_en_GB.php") as $path) { + include_once($path); + } // if isset user langage, overload translations by user langage ones if presents - if (isset($_SESSION["glpilanguage"])) { - foreach (glob($translations_path . "*_" . $_SESSION["glpilanguage"] . ".php") as $path) { - include_once($path); - } - } + if (isset($_SESSION["glpilanguage"])) { + foreach (glob($translations_path . "*_" . $_SESSION["glpilanguage"] . ".php") as $path) { + include_once($path); + } + } } diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 1691499f..00000000 --- a/todo.txt +++ /dev/null @@ -1,4 +0,0 @@ -(icons lib :farm fresh) - -- Test upgrade 0.83->0.84 -- SVG export seems broken \ No newline at end of file diff --git a/tools/HEADER b/tools/HEADER new file mode 100644 index 00000000..96d5775d --- /dev/null +++ b/tools/HEADER @@ -0,0 +1,25 @@ +------------------------------------------------------------------------- +Mreporting plugin for GLPI +------------------------------------------------------------------------- + +LICENSE + +This file is part of Mreporting. + +Mreporting is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Mreporting is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Mreporting. If not, see . +------------------------------------------------------------------------- +@copyright Copyright (C) 2003-2023 by Mreporting plugin team. +@license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html +@link https://github.com/pluginsGLPI/mreporting +-------------------------------------------------------------------------