From 792acdc5b56f9e9cc4d4e6302c8236e2d43427c5 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Dec 2016 08:20:55 +0100 Subject: [PATCH 01/40] Backport empty plugin stuff --- .gitignore | 5 + .travis.yml | 66 +++ README.md | 5 +- RoboFile.php | 13 + RoboFilePlugin.php | 146 ++++++ composer.json | 7 + composer.lock | 1049 +++++++++++++++++++++++++++++++++++++ hook.php | 28 +- setup.php | 48 +- tools/HEADER | 13 +- tools/extract_template.sh | 26 +- tools/make_release.sh | 10 - tools/move_to_po.php | 304 ----------- tools/phpcs-rules.xml | 22 + tools/release | 667 +++++++++++++++++++++++ tools/update_mo.pl | 29 - tools/update_po.pl | 30 -- 17 files changed, 2059 insertions(+), 409 deletions(-) create mode 100644 .travis.yml create mode 100644 RoboFile.php create mode 100644 RoboFilePlugin.php create mode 100644 composer.json create mode 100644 composer.lock delete mode 100755 tools/make_release.sh delete mode 100644 tools/move_to_po.php create mode 100644 tools/phpcs-rules.xml create mode 100755 tools/release delete mode 100755 tools/update_mo.pl delete mode 100755 tools/update_po.pl diff --git a/.gitignore b/.gitignore index d56fee56..c5a6bb23 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ log_filter.settings.php +dist/ +vendor/ +.gh_token +*.min.* + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..60000794 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,66 @@ +language: php + +env: + - DB=mysql + +before_script: + - composer self-update + - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.4" ]]; then sed -e "s|.*"consolidation/robo".*$||" -i composer.json && composer update; fi + - composer install -o +# - mysql -u root -e 'create database glpitest;' +# - php tools/cliinstall.php --lang=en_US --db=glpitest --user=root --tests + - pear install pear/PHP_CodeSniffer + - phpenv rehash + +script: +# - mysql -u root -e 'select version();' +# - phpunit --verbose + - phpcs -p --ignore=vendor --ignore=js --ignore=css --standard=tools/phpcs-rules.xml . + +matrix: + include: + - php: 5.4 + addons: + mariadb: 5.5 + - php: 5.5 + addons: + mariadb: 5.5 +# - php: 5.6 +# addons: +# mariadb: 5.5 +# - php: 5.6 +# addons: +# mariadb: 10.0 + - php: 5.6 + addons: + mariadb: 10.1 +# - php: 7.0 +# addons: +# mariadb: 10.0 + - php: 7.0 + addons: + mariadb: 10.1 +# - php: 7.1 +# addons: +# mariadb: 10.0 + - php: 7.1 + addons: + mariadb: 10.1 + - php: nightly + addons: + mariadb: 10.1 + allow_failures: + - php: nightly + +cache: + directories: + - $HOME/.composer/cache + +#notifications: +# irc: +# channels: +# - "irc.freenode.org#channel" +# on_success: change +# on_failure: always +# use_notice: true +# skip_join: true diff --git a/README.md b/README.md index 7654dea4..15b1c22e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# Genericobject GLPi plugin + [![Join the chat at https://gitter.im/TECLIB/genericobject](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TECLIB/genericobject?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) The genericobject plugin allows to extends GLPi to manage new types of objects. @@ -5,8 +7,7 @@ The genericobject plugin allows to extends GLPi to manage new types of objects. See [Wiki](https://github.com/pluginsGLPI/genericobject/wiki/) for Usage and customisation -Contributing ------------- +## Contributing * Open a ticket for each bug/feature so it can be discussed * Follow [development guidelines](http://glpi-developer-documentation.readthedocs.io/en/latest/plugins.html) diff --git a/RoboFile.php b/RoboFile.php new file mode 100644 index 00000000..047d37ad --- /dev/null +++ b/RoboFile.php @@ -0,0 +1,13 @@ +minifyCSS() + ->minifyJS(); + } + + /** + * Minify CSS stylesheets + * + * @return void + */ + public function minifyCSS() + { + $css_dir = __DIR__ . '/css'; + if (is_dir($css_dir)) { + foreach(glob("$css_dir/*.css") as $css_file) { + if (!$this->endsWith($css_file, 'min.css')) { + $this->taskMinify($css_file) + ->to(str_replace('.css', '.min.css', $css_file)) + ->type('css') + ->run(); + } + } + } + return $this; + } + + /** + * Minify JavaScript files stylesheets + * + * @return void + */ + public function minifyJS() + { + $js_dir = __DIR__ . '/js'; + if (is_dir($js_dir)) { + foreach(glob("$js_dir/*.js") as $js_file) { + if (!$this->endsWith($js_file, 'min.js')) { + $this->taskMinify($js_file) + ->to(str_replace('.js', '.min.js', $js_file)) + ->type('js') + ->run(); + } + } + } + return $this; + } + + /** + * Extract translatable strings + * + * @return void + */ + public function localesExtract() + { + $this->_exec('tools/extract_template.sh'); + return $this; + } + + /** + * Push locales to transifex + * + * @return void + */ + public function localesPush() + { + $this->_exec('tx push -s'); + return $this; + } + + /** + * Pull locales from transifex. + * + * @return void + */ + public function localesPull($percent = 70) + { + $this->_exec('tx pull -s --minimum-perc=' .$percent); + return $this; + } + + /** + * Build MO files + * + * @return void + */ + public function localesMo() + { + $this->_exec('./tools/release --compile-mo'); + return $this; + } + + /** + * Extract and send locales + * + * @return void + */ + public function localesSend() + { + $this->localesExtract() + ->localesPush(); + return $this; + } + + /** + * Retrieve locales and generate mo files + * + * @return void + */ + public function localesGenerate($percent = 70) { + $this->localesPull($percent) + ->localesMo(); + return $this; + } + + /** + * Checks if a string ends with another string + * + * @param string $haystack Full string + * @param string $needle Ends string + * + * @return boolean + * @see http://stackoverflow.com/a/834355 + */ + private function endsWith($haystack, $needle) { + $length = strlen($needle); + if ($length == 0) { + return true; + } + + return (substr($haystack, -$length) === $needle); + } +} diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..e9f1a3ee --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "require-dev": { + "consolidation/robo": "dev-master@dev", + "patchwork/jsqueeze": "~1.0", + "natxet/CssMin": "~3.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..776bdd54 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1049 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "0cf7f5dd3afb59e98200bf7e7bcbb494", + "content-hash": "d5210b4cf8ca3c160925a3d33444a705", + "packages": [], + "packages-dev": [ + { + "name": "consolidation/annotated-command", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "2a6ef0b39ed904dabefd796eeaf5f8feeaa881c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/2a6ef0b39ed904dabefd796eeaf5f8feeaa881c4", + "reference": "2a6ef0b39ed904dabefd796eeaf5f8feeaa881c4", + "shasum": "" + }, + "require": { + "consolidation/output-formatters": "~2", + "php": ">=5.4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "psr/log": "~1.0", + "symfony/console": "~2.5|~3.0", + "symfony/event-dispatcher": "~2.5|~3.0", + "symfony/finder": "~2.5|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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.", + "time": "2016-10-05 04:09:14" + }, + { + "name": "consolidation/log", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "74ba81b4edc585616747cc5c5309ce56fec41254" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/74ba81b4edc585616747cc5c5309ce56fec41254", + "reference": "74ba81b4edc585616747cc5c5309ce56fec41254", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/log": "~1.0", + "symfony/console": "~2.5|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2016-03-23 23:46:42" + }, + { + "name": "consolidation/output-formatters", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/output-formatters.git", + "reference": "8bce15438a97afba5dcf036a71d961977b64fa3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/8bce15438a97afba5dcf036a71d961977b64fa3e", + "reference": "8bce15438a97afba5dcf036a71d961977b64fa3e", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "symfony/console": "~2.5|~3.0", + "symfony/finder": "~2.5|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "^1.0", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\OutputFormatters\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Format text by applying transformations provided by plug-in formatters.", + "time": "2016-10-05 04:05:17" + }, + { + "name": "consolidation/robo", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/consolidation/Robo.git", + "reference": "8febe755fba56b195dc6f050ecee31805c78a661" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/8febe755fba56b195dc6f050ecee31805c78a661", + "reference": "8febe755fba56b195dc6f050ecee31805c78a661", + "shasum": "" + }, + "require": { + "consolidation/annotated-command": "~2", + "consolidation/log": "~1", + "consolidation/output-formatters": "~2", + "league/container": "^2.2", + "php": ">=5.5.0", + "symfony/console": "~2.5|~3.0", + "symfony/event-dispatcher": "~2.5|~3.0", + "symfony/filesystem": "~2.5|~3.0", + "symfony/finder": "~2.5|~3.0", + "symfony/process": "~2.5|~3.0" + }, + "replace": { + "codegyre/robo": "< 1.0" + }, + "require-dev": { + "codeception/aspect-mock": "~1", + "codeception/base": "^2.1.5", + "codeception/verify": "^0.3.2", + "henrikbjorn/lurker": "~1", + "natxet/cssmin": "~3", + "patchwork/jsqueeze": "~2", + "pear/archive_tar": "~1", + "phpunit/php-code-coverage": "~4", + "satooshi/php-coveralls": "~1", + "squizlabs/php_codesniffer": "~2" + }, + "suggest": { + "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", + "natxet/CssMin": "For minifying JS 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." + }, + "bin": [ + "robo" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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", + "time": "2016-11-01 23:37:29" + }, + { + "name": "container-interop/container-interop", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", + "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "time": "2014-12-30 15:22:37" + }, + { + "name": "league/container", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "c0e7d947b690891f700dc4967ead7bdb3d6708c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/c0e7d947b690891f700dc4967ead7bdb3d6708c1", + "reference": "c0e7d947b690891f700dc4967ead7bdb3d6708c1", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": ">=5.4.0" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.1" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "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", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league", + "provider", + "service" + ], + "time": "2016-03-17 11:07:59" + }, + { + "name": "natxet/CssMin", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/natxet/CssMin.git", + "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/92de3fe3ccb4f8298d31952490ef7d5395855c39", + "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39", + "shasum": "" + }, + "require": { + "php": ">=5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ], + "time": "2015-09-25 11:13:11" + }, + { + "name": "patchwork/jsqueeze", + "version": "v1.0.7", + "source": { + "type": "git", + "url": "https://github.com/tchwork/jsqueeze.git", + "reference": "f90a933213534b93e4ff3c2c3026ff7458f7721b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tchwork/jsqueeze/zipball/f90a933213534b93e4ff3c2c3026ff7458f7721b", + "reference": "f90a933213534b93e4ff3c2c3026ff7458f7721b", + "shasum": "" + }, + "require": { + "php": ">=5.1.4" + }, + "type": "library", + "autoload": { + "psr-0": { + "JSqueeze": "class/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "(Apache-2.0 or GPL-2.0)" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + } + ], + "description": "Efficient JavaScript minification in PHP", + "homepage": "https://github.com/tchwork/jsqueeze", + "keywords": [ + "compression", + "javascript", + "minification" + ], + "time": "2015-03-25 10:11:08" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30 07:12:33" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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" + ], + "time": "2016-10-10 12:19:37" + }, + { + "name": "symfony/console", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/c99da1119ae61e15de0e4829196b9fba6f73d065", + "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "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" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2016-10-06 01:44:51" + }, + { + "name": "symfony/debug", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", + "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2016-09-06 11:02:40" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/28b0832b2553ffb80cabef6a7a812ff1e670c0bc", + "reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2016-10-13 06:28:43" + }, + { + "name": "symfony/filesystem", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0565b61bf098cb4dc09f4f103f033138ae4f42c6", + "reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2016-10-18 04:30:12" + }, + { + "name": "symfony/finder", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "205b5ffbb518a98ba2ae60a52656c4a31ab00c6f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/205b5ffbb518a98ba2ae60a52656c4a31ab00c6f", + "reference": "205b5ffbb518a98ba2ae60a52656c4a31ab00c6f", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2016-09-28 00:11:12" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, + { + "name": "symfony/process", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "66de154ae86b1a07001da9fbffd620206e4faf94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/66de154ae86b1a07001da9fbffd620206e4faf94", + "reference": "66de154ae86b1a07001da9fbffd620206e4faf94", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2016-09-29 14:13:09" + }, + { + "name": "webmozart/assert", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-08-09 15:02:57" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "consolidation/robo": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/hook.php b/hook.php index 6ae6e3ca..dd39c1c9 100644 --- a/hook.php +++ b/hook.php @@ -1,13 +1,22 @@ $value) { @@ -89,6 +99,11 @@ function plugin_uninstall_addUninstallTypes($uninstal_types = array()) { //----------------------- INSTALL / UNINSTALL FUNCTION -------------------------------// +/** + * Plugin install process + * + * @return boolean + */ function plugin_genericobject_install() { global $DB; @@ -133,6 +148,11 @@ function plugin_genericobject_install() { return true; } +/** + * Plugin uninstall process + * + * @return boolean + */ function plugin_genericobject_uninstall() { global $DB; diff --git a/setup.php b/setup.php index 2681f807..7547726e 100644 --- a/setup.php +++ b/setup.php @@ -1,13 +1,22 @@ register(); -// Init the hooks of the plugins -Needed +/** + * Init hooks of the plugin. + * REQUIRED + * + * @return void + */ function plugin_init_genericobject() { global $PLUGIN_HOOKS, $CFG_GLPI, $GO_BLACKLIST_FIELDS, $GO_FIELDS, $GENERICOBJECT_PDF_TYPES, $GO_LINKED_TYPES, $GO_READONLY_FIELDS, $LOADED_PLUGINS; @@ -165,7 +180,12 @@ function plugin_post_init_genericobject() { } } -// Get the name and the version of the plugin - Needed +/** + * Get the name and the version of the plugin + * REQUIRED + * + * @return array + */ function plugin_version_genericobject() { return array ('name' => __("Objects management", "genericobject"), 'version' => PLUGIN_GENERICOBJECT_VERSION, @@ -175,7 +195,12 @@ function plugin_version_genericobject() { 'minGlpiVersion' => '0.85.3'); } -// Optional : check prerequisites before install : may print errors or add to message after redirect +/** + * Check pre-requisites before install + * OPTIONNAL, but recommanded + * + * @return boolean + */ function plugin_genericobject_check_prerequisites() { if (version_compare(GLPI_VERSION,'0.85.3','lt')) { echo "This plugin requires GLPI 0.85.3 or higher"; @@ -184,8 +209,13 @@ function plugin_genericobject_check_prerequisites() { return true; } -// Check configuration process for plugin : need to return true if succeeded -// Can display a message only if failure and $verbose is true +/** + * Check configuration process + * + * @param boolean $verbose Whether to display message on failure. Defaults to false + * + * @return boolean + */ function plugin_genericobject_check_config($verbose = false) { if (true) { // Your configuration check return true; diff --git a/tools/HEADER b/tools/HEADER index 409553f9..bbf1aa7b 100644 --- a/tools/HEADER +++ b/tools/HEADER @@ -1,25 +1,24 @@ - * @version $Id: HEADER 15930 2011-10-25 10:47:55Z jmd $ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique - Copyright (C) 2003-2011 by the INDEPNET Development Team. + Copyright (C) 2003-2016 by the Teclib Development Team. - http://indepnet.net/ http://glpi-project.org + http://teclib.com/ http://glpi-project.org ------------------------------------------------------------------------- LICENSE - This file is part of GLPI. + This file is part of Genericobject. - GLPI is free software; you can redistribute it and/or modify + Genericobject 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. - GLPI is distributed in the hope that it will be useful, + Genericobject 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 GLPI. If not, see . + along with Genericobject. If not, see . -------------------------------------------------------------------------- diff --git a/tools/extract_template.sh b/tools/extract_template.sh index 3e191612..aeb1964b 100755 --- a/tools/extract_template.sh +++ b/tools/extract_template.sh @@ -1,22 +1,20 @@ #!/bin/bash -soft='GLPI - Escalade plugin' -version='0.84' -email=adelaunay@teclib.com -copyright='INDEPNET Development Team' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../" +pushd $DIR > /dev/null -#xgettext *.php */*.php -copyright-holder='$copyright' --package-name=$soft --package-version=$version --msgid-bugs-address=$email -o locales/en_GB.po -L PHP --from-code=UTF-8 --force-po -i --keyword=_n:1,2 --keyword=__ --keyword=_e +NAME='Genericobject' +POTFILE=${NAME,,}.pot -# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) +PHP_SOURCES=`find ./ -name \*.php ! -path ./vendor ! -path ./lib` + +if [ ! -d "locales" ]; then + mkdir locales +fi -xgettext *.php */*.php -o locales/genericobject.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ +# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) +xgettext $PHP_SOURCES -o locales/$POTFILE -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t \ --keyword=_sx:1c,2,3t --keyword=_nx:1c,2,3,5t - -### for using tx : -##tx set --execute --auto-local -r GLPI_example.glpi-084-current 'locales/.po' --source-lang en --source-file locales/glpi.pot -## tx push -s -## tx pull -a - - +popd > /dev/null diff --git a/tools/make_release.sh b/tools/make_release.sh deleted file mode 100755 index 97258bfb..00000000 --- a/tools/make_release.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -topdir=$(git rev-parse --show-toplevel) -prefix="genericobject" -tag=$1 -generated_tag=$(git describe --tags HEAD 2>/dev/null) - -export GZIP=-9 -export TAR_OPTIONS=--mode=u=rwX,g=rwX,o=rX -git archive --prefix=${prefix}/ -o ${topdir}/../${prefix}-${tag:=${generated_tag}}.tar.gz ${tag:=${generated_tag}} diff --git a/tools/move_to_po.php b/tools/move_to_po.php deleted file mode 100644 index 0ee8312a..00000000 --- a/tools/move_to_po.php +++ /dev/null @@ -1,304 +0,0 @@ -. - -------------------------------------------------------------------------- - */ - -// ---------------------------------------------------------------------- -// Original Author of file: Julien Dombre -// Purpose of file: -// ---------------------------------------------------------------------- - -chdir(dirname($_SERVER["SCRIPT_FILENAME"])); - -if ($argv) { - for ($i=1 ; $i'.$sing_trans.' '.$current_string_plural.'->'.$plural_trans."\n"; - if (!strlen($sing_trans) || !strlen($plural_trans)) { -// echo "clean\n"; - $sing_trans = ''; - $plural_trans = ''; - } - $content = "msgstr[0] \"$sing_trans\"\n"; - $content .= "msgstr[1] \"$plural_trans\"\n"; - } - } else { - $content=''; - } - } - $context = ''; - } - // Standard replacement - $content = preg_replace('/charset=CHARSET/','charset=UTF-8',$content); - - if (preg_match('/Plural-Forms/',$content)) { - $content = "\"Plural-Forms: nplurals=2; plural=(n != 1)\\n\"\n"; - } - - if (fwrite($po, $content) === FALSE) { - echo "unable to write in po file"; - exit; - } - - } -} -fclose($pot); -fclose($po); - - -function search_in_dict($string, $context) { - global $REFLANG, $LANG; - - if ($context) { - $string = "$context/$string"; - } - - $ponctmatch = "([\.: \(\)]*)"; - $varmatch = "(%s)*"; - - if (preg_match("/$varmatch$ponctmatch(.*)$ponctmatch$varmatch$/U",$string,$reg)) { -// print_r($reg); - $left = $reg[1]; - $left .= $reg[2]; - $string = $reg[3]; - $right = $reg[4]; - if (isset($reg[5])) { - $right .= $reg[5]; - } - } - -// echo $left.' <- '.$string.' -> '.$right."\n"; - foreach ($REFLANG as $mod => $data) { - - foreach ($data as $key => $val) { - - if (!is_array($val)){ - if (!isset($LANG[$mod][$key])) { - continue; - } - - // Search same case with punc - if (strcmp($val,$left.$string.$right) === 0) { - return $LANG[$mod][$key]; - } - // Search same case with punc - if (strcasecmp($val,$left.$string.$right) === 0) { - return $LANG[$mod][$key]; - } - - // Search same case with left punc - if (strcmp($val,$left.$string) === 0) { - return $LANG[$mod][$key].$right; - } - // Search same case with left punc - if (strcasecmp($val,$left.$string) === 0) { - return $LANG[$mod][$key].$right; - } - - // Search same case with right punc - if (strcmp($val,$string.$right) === 0) { - return $left.$LANG[$mod][$key]; - } - // Search same case with right punc - if (strcasecmp($val,$string.$right) === 0) { - return $left.$LANG[$mod][$key]; - } - - // Search same case without punc - if (strcmp($val,$string) === 0) { - return $left.$LANG[$mod][$key].$right; - } - // Search non case sensitive - if (strcasecmp($val,$string) === 0) { - return $left.$LANG[$mod][$key].$right; - } - } else { - foreach ($val as $k => $v) { - if (!isset($LANG[$mod][$key][$k])) { - continue; - } - - // Search same case with punc - if (strcmp($v,$left.$string.$right) === 0) { - return $LANG[$mod][$key][$k]; - } - // Search same case with punc - if (strcasecmp($v,$left.$string.$right) === 0) { - return $LANG[$mod][$key][$k]; - } - - // Search same case with left punc - if (strcmp($v,$left.$string) === 0) { - return $LANG[$mod][$key][$k].$right; - } - // Search same case with left punc - if (strcasecmp($v,$left.$string) === 0) { - return $LANG[$mod][$key][$k].$right; - } - - // Search same case with right punc - if (strcmp($v,$string.$right) === 0) { - return $left.$LANG[$mod][$key][$k]; - } - // Search same case with right punc - if (strcasecmp($v,$string.$right) === 0) { - return $left.$LANG[$mod][$key][$k]; - } - - // Search same case without punc - if (strcmp($v,$string) === 0) { - return $left.$LANG[$mod][$key][$k].$right; - } - // Search non case sensitive - if (strcasecmp($v,$string) === 0) { - return $left.$LANG[$mod][$key][$k].$right; - } - } - } - } - } - - return ""; -} -?> \ No newline at end of file diff --git a/tools/phpcs-rules.xml b/tools/phpcs-rules.xml new file mode 100644 index 00000000..f3314a0e --- /dev/null +++ b/tools/phpcs-rules.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/release b/tools/release new file mode 100755 index 00000000..2b92f5ec --- /dev/null +++ b/tools/release @@ -0,0 +1,667 @@ +#!/usr/bin/python +# Adapted from Galette release script + +import os, sys, argparse, re, git, subprocess +import tarfile, shutil, gitdb, time, urllib2, json +from datetime import datetime +from termcolor import colored +from lxml import etree + +plugin_dir = os.path.dirname( + os.path.dirname(os.path.abspath(__file__)) +) +dist_dir = os.path.join( + plugin_dir, + 'dist' +) +verbose = False +tagrefs = None +force = False +commit = None +extra = None +sign = True +github = True +assume_yes = False +banned = [ + 'dist', + 'vendor', + '.git', + '.gitignore', + '.gh_token', + '.tx', + 'tools', + 'tests' +] +gh_orga = 'pluginsGLPI' + +def print_err(msg): + """ + Display colored error message + """ + print colored(msg, 'red', attrs=['bold']) + +def get_numeric_version(ver): + """ + Returns all numeric version + """ + return re.findall(r'\d+', ver) + +def valid_version(ver): + """ + Check if provided version is valid. + + Takes all digits in passed version, then reassemble them with dots + to check if it is the same as original given one. + """ + return '.'.join(get_numeric_version(ver)) == ver + +def incr_version(ver): + """ + Increment version number + """ + version = get_numeric_version(ver) + version[-1] = str(int(version[-1]) + 1) + return version + +def propose_version(): + """ + Propose new minor and major versions, + according to existing git tags + """ + last_major = '0' + last_minor = '0' + + for tagref in tagrefs: + if valid_version(tagref.name): + #last minor version is always the last one :) + if tagref.name > last_minor: + last_minor = tagref.name + + #last major version + if len(tagref.name) == 5 and tagref.name > last_major: + last_major = tagref.name + + if verbose: + print 'last minor: %s | last major %s' % (last_minor, last_major) + + #no version provided. propose one + new_minor = None + new_major = None + + if len(last_minor) == 5: + #if the latest is a major version + new_minor = last_minor + ('.1') + else: + new_minor = '.'.join(incr_version(last_minor)) + + new_major = '.'.join(incr_version(last_major)) + + print """Proposed versions: + minor: %s + major: %s + """ % (new_minor, new_major) + +def get_latest_version(): + """ + Look for latest version + """ + last = None + for tagref in tagrefs: + if valid_version(tagref.name): + #last created minor version is always the last one :) + if tagref.name > last: + last = tagref.name + + return last + +def is_existing_version(ver): + """ + Look specified version exists + """ + for tagref in tagrefs: + if valid_version(tagref.name): + if tagref.name == ver: + return True + return False + +def ask_user_confirm(msg): + """ + Ask user his confirmation + """ + if assume_yes: + return True + else: + while True: + sys.stdout.write(msg) + choice = raw_input().lower() + if choice == 'y' or choice == 'yes': + return True + elif choice == 'n' or choice == 'no': + return False + else: + print_err( + "Invalid input. Please enter 'yes' or 'no' (or 'y' or 'n')." + ) + +def get_rel_name(buildver): + """ + Build archive name from command line parameters + That would be used for git archiving prefix and archive name + """ + archive_name = None + + if commit and extra: + now = datetime.now() + archive_name = 'glpi-%s-%s-%s-%s-%s' % ( + plugin_name, + buildver, + extra, + now.strftime('%Y%m%d'), + commit + ) + else: + archive_name = 'glpi-%s-%s' % (plugin_name, buildver) + + return archive_name + +def _do_build(repo, ver): + """ + Proceed build + """ + exists = False + ascexists = False + rel_name = get_rel_name(ver) + archive_name = rel_name + '.tar.bz2' + archive = os.path.join( + dist_dir, + archive_name + ) + + if not force: + #first check if a version + local = False + ascLocal = False + + #check if a release exists upstream + #FIXME: this retrieve only publicated release, not drafts + url = 'https://api.github.com/repos/%s/%s/releases/tags/%s' % (gh_orga, plugin_name, ver) + + exists = False + gh_id = None + + try: + request = urllib2.Request(url) + handle = urllib2.urlopen(request) + contents = json.loads(handle.read()) + + for asset in contents['assets']: + if archive_name == asset['name']: + exists = True + gh_id = contents['id'] + break + except (urllib2.URLError, urllib2.HTTPError): + pass + + if exists: + #we know a release exists for this tag. Check if files have been uploaded yet + pass + + if not exists: + #also check from local repo + exists = os.path.exists(archive) + if exists: + local = True + + #also check from local repo + ascexists = os.path.exists( + os.path.join( + dist_dir, + archive_name + '.asc' + ) + ) + + if exists or ascexists: + msg = None + if exists: + loctxt = '' + if local: + loctxt = 'locally ' + msg = 'Relase %s already %sexists' % (rel_name, loctxt) + + if ascexists: + loctxt = '' + if ascLocal: + loctxt = ' locally' + if msg is not None: + msg += ' and has been %ssigned!' % loctxt + else: + msg += 'Release has been %ssigned!' % loctxt + + msg += '\n\nYou will *NOT* build another one :)' + print_err(msg) + else: + print 'Building %s...' % rel_name + + if verbose: + typestr = 'Tag' + typever = ver + + if commit and extra: + typestr = 'Commit' + typever = commit + + print 'Release name: %s, %s: %s, Dest: %s' % ( + rel_name, + typestr, + typever, + archive + ) + + paths = os.listdir(plugin_dir) + paths = list(set(paths) - set(banned)) + + if commit and extra: + print 'Archiving GIT commit %s' % commit + with open(archive, 'wb') as stream: + repo.archive(stream, commit, prefix=plugin_name+'/', path=paths) + else: + print 'Archiving GIT tag %s' % ver + with open(archive, 'wb') as stream: + repo.archive(stream, ver, prefix=plugin_name+'/', path=paths) + + print 'Adding vendor libraries' + prepare(plugin_name, archive) + + if sign: + do_sign(archive) + + if github: + create_gh_release(archive, gh_id, plugin_name, ver) + +def do_sign(archive): + sign_cmd = 'gpg --no-use-agent --detach-sign --armor %s' % archive + p1 = subprocess.Popen(sign_cmd, shell=True) + p1.communicate() + +def create_gh_release(archive, gh_id, plugin_name, ver): + with open(gh_cred_file, 'r') as fd: + token = fd.readline().strip() + + gh = github.Github(token) + gh_user = gh.get_user() + + for gh_repo in gh_user.get_repos(): + if gh_repo.full_name == '%s/%s' % (gh_orga, plugin_name): + break + + gh_release = None + + #check in all releases (including drafts) if nothing has been found yet + if gh_id is None: + for gh_rel in gh_repo.get_releases(): + if gh_rel.tag_name == ver: + gh_release = gh_rel + break + + #create release if it does not exists + if gh_id is None and gh_release is None: + is_prerelease = False if commit else True + gh_release = gh_repo.create_git_release( + ver, + 'GLPi %s %s' % (plugin_name, ver), + 'Automated release from release script', + True, + is_prerelease + ) + elif gh_id is not None: + gh_release = gh_repo.get_release(gh_id) + + #upload = ask_user_confirm( + # 'Do you want to upload archive %s? [yes/No] ' % archive + #) + + #if upload: + # do_upload(archive, gh_id, plugin_name, ver) + +#def do_upload(archive, gh_id, plugin_name, ver): + #from uritemplate import URITemplate + #import requests + #import mimetypes + + #Upload asset + #template = URITemplate(gh_release.upload_url) + + #headers = {'Content-Type': 'application/octet-stream', 'Authorization': 'token %s' % token} + #params = {'name': '%s-%s.tar.bz2' % (plugin_name, ver)} + #url = template.expand(params) + + ## Bad request :'( + #f = open('/var/www/webapps/glpi/plugins/order/dist/glpi-order-1.9.5.tar.bz2', 'rb') + #r = requests.post( + # url, + # data=f, + # headers=headers + #) + #print r.json() + #r.raise_for_status() + +def prepare(rel_name, archive): + """ + Add external libraries to the archive, if any + """ + + plugin = tarfile.open(archive, 'r') + src_dir = os.path.join(dist_dir, 'src') + if not os.path.exists(src_dir): + os.makedirs(src_dir) + plugin.extractall(path=src_dir) + plugin.close() + + build_dir = os.path.join(src_dir, plugin_name) + if os.path.exists(os.path.join(build_dir, 'composer.lock')): + composer = ['composer', 'install', '-o', '--no-dev'] + + if not verbose: + composer.insert(-1, '-q') + + p1 = subprocess.Popen( + composer, + cwd=build_dir + ) + p1.communicate() + + compile_mo(build_dir) + + minify(build_dir) + + plugin = tarfile.open(archive, 'w|bz2') + + for i in os.listdir(src_dir): + plugin.add( + os.path.join(src_dir, i), + arcname=rel_name + ) + + plugin.close() + shutil.rmtree(src_dir) + +def compile_mo(build_dir): + locales_dir = os.path.join(build_dir, 'locales') + if verbose: + print 'Locales dir: %s' % locales_dir + if os.path.exists(locales_dir): + for file in os.listdir(locales_dir): + if file.endswith('.po'): + if verbose: + print 'Compiling %s...' % file + p1 = subprocess.Popen( + ['msgfmt', file, '-o', file.replace('.po', '.mo')], + cwd=locales_dir + ) + p1.communicate() + +def minify(build_dir): + if os.path.exists(os.path.join(plugin_dir, 'vendor')): + robo = [os.path.join(plugin_dir, 'vendor', 'bin', 'robo'), 'minify'] + if not verbose: + robo.insert(-1, '-q') + + if verbose: + print robo + + p1 = subprocess.Popen( + robo, + cwd=build_dir + ) + p1.communicate() + elif verbose: + print_err("Robo.li is not installed; cannot minify!") + +def valid_commit(repo, c): + """ + Validate commit existance in repository + """ + global commit + + try: + dformat = '%a, %d %b %Y %H:%M' + repo_commit = repo.commit(c) + + commit = repo_commit.hexsha[:10] + print colored("""Commit informations: + Hash: %s + Author: %s + Authored date: %s + Commiter: %s + Commit date: %s + Message: %s""" % ( + commit, + repo_commit.author, + time.strftime(dformat, time.gmtime(repo_commit.authored_date)), + repo_commit.committer, + time.strftime(dformat, time.gmtime(repo_commit.committed_date)), + repo_commit.message + ), None, 'on_grey', attrs=['bold']) + return True + except gitdb.exc.BadObject: + return False + +def guess_plugin_name(): + """ + Tries to guess plugin name, ask user at last + """ + name = None + + filename = os.path.join( + os.path.dirname(os.path.abspath(__file__)), + 'extract_template.sh' + ) + + #try to get configured plugin name + if os.path.exists(filename): + with file(filename) as input: + for count, line in enumerate(input): + results = re.match(r"^NAME='(.+)'$", line) + if results: + name = results.group(1) + break + + if name is None: + #No configured name found. Let's use current directory name + name = os.path.split(plugin_dir)[-1] + + return name.lower() + +def check_version(buildver): + if verbose: + print 'Checking for version %s' % buildver + + filename = os.path.join( + plugin_dir, + 'setup.php' + ) + + found = None + #find version constant + if os.path.exists(filename): + with file(filename) as input: + for count, line in enumerate(input): + regexp = ".*('|\")PLUGIN_%s_VERSION('|\"), ('|\")(.+)('|\")" % plugin_name.upper() + results = re.match(regexp, line) + if results: + found = results.group(4) + break + + if not found == buildver: + print_err('Plugin version check has failed (%s but %s found)!' % (buildver, found)) + return False + + #check plugins website XML file + xmlfile = os.path.join(plugin_dir, '%s.xml' % plugin_name) + if not os.path.exists(xmlfile): + xmlfile = os.path.join(plugin_dir, 'plugin.xml') + if not os.path.exists(xmlfile): + xmlfile = None + + if xmlfile != None: + if verbose: + print 'XML file found in %s' % xmlfile + xmldoc = etree.parse(xmlfile) + else: + print_err('Plugins website configuration file has not been found!') + return False + +def main(): + """ + Main method + """ + global verbose, tagrefs, force, extra, assume_yes, sign, plugin_name, github, gh_cred_file + + parser = argparse.ArgumentParser(description='Release plugin') + group = parser.add_mutually_exclusive_group() + group.add_argument( + '-v', + '--version', + help='Version to release' + ) + parser.add_argument( + '-g', + '--nogithub', + help="DO NOT Create github draft release", + action='store_false' + ) + parser.add_argument( + '-C', + '--check-only', + help="Only do chec, does not release anything", + action='store_true' + ) + group.add_argument( + '-p', + '--propose', + help='Calculate and propose next possible versions', + action='store_true' + ) + parser.add_argument( + '-c', + '--commit', + help='Specify commit to archive (-v required)' + ) + parser.add_argument( + '-e', + '--extra', + help='Extra version informations (-c required)' + ) + parser.add_argument( + '-m', + '--compile-mo', + help="Compile MO files from PO files (exclusive)", + action='store_true' + ) + parser.add_argument( + '-M', + '--minify', + help="Minify CSS ans JS files", + action='store_true' + ) + parser.add_argument( + '-S', + '--nosign', + help="Do not sign release tarball", + action="store_false" + ) + parser.add_argument( + '-Y', + '--assume-yes', + help='Assume YES to all questions. Be sure to understand what you are doing!', + action='store_true' + ) + parser.add_argument( + '-V', + '--verbose', + help='Be more verbose', + action="store_true" + ) + parser.add_argument('-f', action='store_true') + args = parser.parse_args() + + verbose=args.verbose + sign=args.nosign + github=args.nogithub + + if verbose: + print args + + if github: + import github + gh_cred_file = os.path.join(plugin_dir, '.gh_token') + if not os.path.exists(gh_cred_file): + print_err('GitHub credential file does not exists! Either create it or use the --nogithub option.') + sys.exit(1) + + plugin_name = guess_plugin_name() + + plugin_repo = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + repo = git.Repo(plugin_repo) + tagrefs = repo.tags + + if args.f == True: + force = ask_user_confirm( + 'Are you *REALLY* sure you mean -f when you typed -f? [yes/No] ' + ) + assume_yes=args.assume_yes + + if args.check_only: + print '*** Entering *check-only* mode ***' + + #check if dist_dir exists + if not os.path.exists(dist_dir): + os.makedirs(dist_dir) + + build = False + buildver = None + if args.compile_mo or args.minify: + if args.compile_mo: + compile_mo(plugin_repo) + if args.minify: + minify(plugin_repo) + elif (args.extra or args.commit) and (not args.extra or not args.commit or not args.version): + print_err('You have to specify --version --commit and --extra all together') + sys.exit(1) + elif args.commit and args.version and args.extra: + if valid_commit(repo, args.commit): + if verbose: + print 'Commit is valid' + build = True + buildver = args.version + extra = args.extra + else: + print_err('Invalid commit ref %s' % args.commit) + elif args.version: + if not valid_version(args.version): + print_err('%s is not a valid version number!' % args.version) + sys.exit(1) + else: + #check if specified version exists + if not is_existing_version(args.version): + print_err('%s does not exist!' % args.version) + else: + build = True + buildver = args.version + elif args.propose: + propose_version() + else: + buildver = get_latest_version() + if force: + build = True + else: + build = ask_user_confirm( + 'Do you want to build version %s? [Yes/no] ' % buildver + ) + + if build: + if check_version(buildver) and args.check_only == False: + _do_build(repo, buildver) + +if __name__ == "__main__": + main() diff --git a/tools/update_mo.pl b/tools/update_mo.pl deleted file mode 100755 index ed44da6f..00000000 --- a/tools/update_mo.pl +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/perl -#!/usr/bin/perl -w - -if (@ARGV!=0){ -print "USAGE update_mo.pl\n\n"; - -exit(); -} - - -opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; -foreach (readdir(DIRHANDLE)){ - if ($_ ne '..' && $_ ne '.'){ - - if(!(-l "$dir/$_")){ - if (index($_,".po",0)==length($_)-3) { - $lang=$_; - $lang=~s/\.po//; - - `msgfmt locales/$_ -o locales/$lang.mo`; - } - } - - } -} -closedir DIRHANDLE; - -# -# diff --git a/tools/update_po.pl b/tools/update_po.pl deleted file mode 100755 index ce44ea7a..00000000 --- a/tools/update_po.pl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/perl -#!/usr/bin/perl -w - -if (@ARGV!=2){ -print "USAGE update_po.pl transifex_login transifex_password\n\n"; - -exit(); -} -$user = $ARGV[0]; -$password = $ARGV[1]; - -opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n"; -foreach (readdir(DIRHANDLE)){ - if ($_ ne '..' && $_ ne '.'){ - - if(!(-l "$dir/$_")){ - if (index($_,".po",0)==length($_)-3) { - $lang=$_; - $lang=~s/\.po//; - - `wget --user=$user --password=$password --output-document=locales/$_ http://www.transifex.net/api/2/project/GLPI_example/resource/glpipot/translation/$lang/?file=$_`; - } - } - - } -} -closedir DIRHANDLE; - -# -# From e6ae175d6d647bfb7a6e442b52946d11748cb1d5 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Dec 2016 08:39:30 +0100 Subject: [PATCH 02/40] CS --- front/commondropdown.php | 2 +- front/familylist.php | 26 +++++++++---------- front/field.form.php | 6 ++--- front/object.form.php | 8 +++--- front/object.php | 6 ++--- front/type.form.php | 16 ++++++------ hook.php | 7 +++--- inc/commondropdown.class.php | 2 +- inc/field.class.php | 32 +++++++++++------------ inc/functions.php | 38 ++++++++++++++-------------- inc/object.class.php | 34 ++++++++++++------------- inc/object_item.class.php | 2 +- inc/profile.class.php | 33 +++++++++++------------- inc/type.class.php | 49 ++++++++++++++++++------------------ inc/typefamily.class.php | 2 +- index.php | 7 +++--- 16 files changed, 132 insertions(+), 138 deletions(-) diff --git a/front/commondropdown.php b/front/commondropdown.php index a40be0e9..6f5ecec8 100644 --- a/front/commondropdown.php +++ b/front/commondropdown.php @@ -1,6 +1,6 @@ getFromDB($_GET['id'])) { - Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "assets", - "genericobject"); + Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "assets", + "genericobject"); - echo ""; + echo "
"; echo ""; - echo "
".__("Empty family","genericobject")."
"; + echo ""; } else { - $family->getFromDB($_GET['id']); - Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "assets", - $family->getName()); + $family->getFromDB($_GET['id']); + Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "assets", + $family->getName()); - echo ""; - $types = PluginGenericobjectTypeFamily::getItemtypesByFamily($_GET['id']); + echo "
"; + $types = PluginGenericobjectTypeFamily::getItemtypesByFamily($_GET['id']); echo ""; - foreach ($types as $type) { - $itemtype = $type['itemtype']; + foreach ($types as $type) { + $itemtype = $type['itemtype']; echo ""; - } - echo "
".Dropdown::getDropdownName("glpi_plugin_genericobject_typefamilies", $_GET['id'])."
"; echo ""; echo $itemtype::getTypeName(); echo "
"; + } + echo ""; } Html::footer(); diff --git a/front/field.form.php b/front/field.form.php index 61eb8640..32bfd2da 100644 --- a/front/field.form.php +++ b/front/field.form.php @@ -32,7 +32,7 @@ $type->getFromDB($_POST["id"]); $itemtype = $type->fields['itemtype']; PluginGenericobjectType::registerOneType($itemtype); - + foreach ($_POST["fields"] as $field => $value) { if ($type->can($_POST["id"], PURGE) && $value == 1 @@ -42,7 +42,7 @@ } } } -} elseif (isset ($_POST["add_field"])) { +} else if (isset ($_POST["add_field"])) { $type = new PluginGenericobjectType(); if ($_POST["new_field"] && $type->can($_POST["id"], UPDATE)) { $itemtype = $type->fields['itemtype']; @@ -50,7 +50,7 @@ PluginGenericobjectField::addNewField(getTableForItemType($itemtype), $_POST["new_field"]); Session::addMessageAfterRedirect(__("Field added successfully", "genericobject")); } -} elseif (isset($_POST['action'])) { +} else if (isset($_POST['action'])) { //Move field PluginGenericobjectField::changeFieldOrder($_POST); } diff --git a/front/object.form.php b/front/object.form.php index b1fa1d23..dacf6504 100644 --- a/front/object.form.php +++ b/front/object.form.php @@ -80,19 +80,19 @@ } else { Html::back(); } - } elseif (isset ($_POST["update"])) { + } else if (isset ($_POST["update"])) { $item->check($id, UPDATE); $item->update($_POST); Html::back(); - } elseif (isset ($_POST["restore"])) { + } else if (isset ($_POST["restore"])) { $item->check($id, DELETE); $item->restore($_POST); Html::back(); - } elseif (isset($_POST["purge"])) { + } else if (isset($_POST["purge"])) { $item->check($id, PURGE); $item->delete($_POST, 1); $item->redirectToList(); - } elseif (isset($_POST["delete"])) { + } else if (isset($_POST["delete"])) { $item->check($id, DELETE); $item->delete($_POST); $item->redirectToList(); diff --git a/front/object.php b/front/object.php index 1e3f24f9..6e6b0596 100644 --- a/front/object.php +++ b/front/object.php @@ -24,14 +24,14 @@ @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ - + include ("../../../inc/includes.php"); if (isset($_GET['itemtype'])) { Session::checkRight(PluginGenericobjectProfile::getProfileNameForItemtype($_GET['itemtype']), READ); $menu = PluginGenericobjectType::getFamilyNameByItemtype($_GET['itemtype']); - Html::header(__("Type of objects", "genericobject"), - $_SERVER['PHP_SELF'], "assets", ($menu!==false?$menu:strtolower($_GET['itemtype'])), strtolower($_GET['itemtype'])); + Html::header(__("Type of objects", "genericobject"), + $_SERVER['PHP_SELF'], "assets", ($menu!==false?$menu:strtolower($_GET['itemtype'])), strtolower($_GET['itemtype'])); Search::Show($_GET['itemtype']); } diff --git a/front/type.form.php b/front/type.form.php index 8a80f3c0..e06c8528 100644 --- a/front/type.form.php +++ b/front/type.form.php @@ -44,26 +44,26 @@ $_GET["action"]); Html::back(); -//Add a new itemtype -} elseif (isset ($_POST["add"])) { +} else if (isset ($_POST["add"])) { + //Add a new itemtype $new_id = $type->add($_POST); Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType')."?id=$new_id"); -//Update an existing itemtype -} elseif (isset ($_POST["update"])) { +} else if (isset ($_POST["update"])) { + //Update an existing itemtype if (isset($_POST['itemtypes']) && is_array($_POST['itemtypes'])) { $_POST['linked_itemtypes'] = json_encode($_POST['itemtypes']); } $type->update($_POST); Html::back(); -//Delete an itemtype -} elseif (isset ($_POST["purge"])) { +} else if (isset ($_POST["purge"])) { + //Delete an itemtype $type->delete($_POST); $type->redirectToList(); -//Regenerate files for an itemtype -} elseif (isset($_POST['regenerate'])) { +} else if (isset($_POST['regenerate'])) { + //Regenerate files for an itemtype $type->getFromDB($_POST["id"]); PluginGenericobjectType::checkClassAndFilesForOneItemType($type->fields['itemtype'], $type->fields['name'], true); diff --git a/hook.php b/hook.php index dd39c1c9..8eb7dfd6 100644 --- a/hook.php +++ b/hook.php @@ -75,7 +75,7 @@ function plugin_genericobject_getDatabaseRelations() { $dropdowns = array(); //TODO : purt here relations -/* + /* $plugin = new Plugin(); if ($plugin->isActivated("genericobject")) { foreach(getAllDatasFromTable(getTableForItemType('PluginGenericobjectType'), @@ -90,10 +90,11 @@ function plugin_genericobject_getDatabaseRelations() { } function plugin_uninstall_addUninstallTypes($uninstal_types = array()) { - foreach (PluginGenericobjectType::getTypes() as $tmp => $type) + foreach (PluginGenericobjectType::getTypes() as $tmp => $type) { if ($type["use_plugin_uninstall"]) { $uninstal_types[] = $type["itemtype"]; } + } return $uninstal_types; } @@ -214,7 +215,7 @@ function plugin_genericobject_MassiveActions($type) { $objecttype = PluginGenericobjectType::getInstance($type); if ($objecttype->isTransferable()) { return array('PluginGenericobjectObject'. - MassiveAction::CLASS_ACTION_SEPARATOR.'plugin_genericobject_transfer' => __("Transfer")); + MassiveAction::CLASS_ACTION_SEPARATOR.'plugin_genericobject_transfer' => __("Transfer")); } else { return array(); } diff --git a/inc/commondropdown.class.php b/inc/commondropdown.class.php index 4b8fe76f..c725878f 100644 --- a/inc/commondropdown.class.php +++ b/inc/commondropdown.class.php @@ -29,7 +29,7 @@ class PluginGenericobjectCommonDropdown extends CommonDropdown { //Get itemtype name static function getTypeName($nb=0) { - $class=get_called_class(); + $class=get_called_class(); return dropdown_getTypeName($class,$nb); } diff --git a/inc/field.class.php b/inc/field.class.php index 02a39540..9f36aa40 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -122,7 +122,7 @@ public static function showObjectFieldsForm($id) { } /** - * Method to set fields as read only, when the depend on some features + * Method to set fields as read only, when the depend on some features * that are enabled * @since 0.85+2.4.0 */ @@ -130,19 +130,19 @@ static function addReadOnlyFields(PluginGenericobjectType $type) { global $GO_READONLY_FIELDS; if ($type->canBeReserved()) { - $GO_READONLY_FIELDS[] = 'users_id'; - $GO_READONLY_FIELDS[] = 'locations_id'; + $GO_READONLY_FIELDS[] = 'users_id'; + $GO_READONLY_FIELDS[] = 'locations_id'; } if ($type->canUseGlobalSearch()) { - $GO_READONLY_FIELDS[] = 'serial'; - $GO_READONLY_FIELDS[] = 'otherserial'; - $GO_READONLY_FIELDS[] = 'locations_id'; - $GO_READONLY_FIELDS[] = 'states_id'; - $GO_READONLY_FIELDS[] = 'users_id'; - $GO_READONLY_FIELDS[] = 'groups_id'; - $GO_READONLY_FIELDS[] = 'manufacturers_id'; - $GO_READONLY_FIELDS[] = 'users_id_tech'; + $GO_READONLY_FIELDS[] = 'serial'; + $GO_READONLY_FIELDS[] = 'otherserial'; + $GO_READONLY_FIELDS[] = 'locations_id'; + $GO_READONLY_FIELDS[] = 'states_id'; + $GO_READONLY_FIELDS[] = 'users_id'; + $GO_READONLY_FIELDS[] = 'groups_id'; + $GO_READONLY_FIELDS[] = 'manufacturers_id'; + $GO_READONLY_FIELDS[] = 'users_id_tech'; } } @@ -215,14 +215,14 @@ static function dropdownFields($name,$itemtype, $used = array()) { //meaning that a dropdown can be useful in all types (for example type, model, etc.) if (isset($values['input_type']) && $values['input_type'] == 'dropdown') { if (isset($values['entities_id'])) { - $field_options[] = __("Entity")." : ".Dropdown::getYesNo($values['entities_id']); + $field_options[] = __("Entity")." : ".Dropdown::getYesNo($values['entities_id']); if ($values['entities_id']) { if (isset($values['is_recursive'])) { $field_options[] = __("Child entities")." : ".Dropdown::getYesNo($values['is_recursive']); } } } else { - $field_options[] = __("Entity")." : ".Dropdown::getYesNo(0); + $field_options[] = __("Entity")." : ".Dropdown::getYesNo(0); } if (isset($values['is_tree'])) { $field_options[] = __("tree structure")." : ".Dropdown::getYesNo($values['is_tree']); @@ -390,7 +390,7 @@ public static function addNewField($table, $field, $after=false) { } // Invalidate menu data in current session unset($_SESSION['glpimenu']); - + PluginGenericobjectSingletonObjectField::getInstance($itemtype, true); } } @@ -432,11 +432,11 @@ static function deleteDisplayPreferences($table, $field) { $itemtype = getItemTypeForTable($table); $searchopt = Search::getCleanedOptions($itemtype); foreach ($searchopt as $num => $option) { - if ( (isset($option['field']) && ($option['field'] == $field)) + if ( (isset($option['field']) && ($option['field'] == $field)) || (isset($option['field']) && $option['linkfield'] == $field)) { $criteria = array('itemtype' => $itemtype, 'num' => $num); $pref->deleteByCriteria($criteria); - break; + break; } } } diff --git a/inc/functions.php b/inc/functions.php index e8d63434..cca61391 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -7,23 +7,23 @@ * - PluginGenericobjectCommonTreeDropdown */ function dropdown_getTypeName($class,$nb=0) { - global $GO_FIELDS; - $fk = getForeignKeyFieldForTable(getTableForItemType($class)); - $instance = new $class(); - $options = PluginGenericobjectField::getFieldOptions($fk, $instance->linked_itemtype); - $dropdown_type = isset($options['dropdown_type']) - ? $options['dropdown_type'] - : null; - $label = $options['name']; - if (!is_null($dropdown_type) and $dropdown_type==='isolated') { - $linked_itemtype_object = new $instance->linked_itemtype(); - $label .= " (" . __($linked_itemtype_object::getTypeName(), 'genericobject') . ")"; - } - if($label != '') { - return $label; - } else { - return $class; - } + global $GO_FIELDS; + $fk = getForeignKeyFieldForTable(getTableForItemType($class)); + $instance = new $class(); + $options = PluginGenericobjectField::getFieldOptions($fk, $instance->linked_itemtype); + $dropdown_type = isset($options['dropdown_type']) + ? $options['dropdown_type'] + : null; + $label = $options['name']; + if (!is_null($dropdown_type) and $dropdown_type==='isolated') { + $linked_itemtype_object = new $instance->linked_itemtype(); + $label .= " (" . __($linked_itemtype_object::getTypeName(), 'genericobject') . ")"; + } + if($label != '') { + return $label; + } else { + return $class; + } } global $LOG_FILTER; $LOG_FILTER = array(); @@ -35,12 +35,12 @@ function dropdown_getTypeName($class,$nb=0) { function _log() { global $LOG_FILTER; $trace = debug_backtrace(); -// call_user_func_array("Toolbox::logInFile", array('generic-object', print_r($trace,true) . "\n", true)); + //call_user_func_array("Toolbox::logInFile", array('generic-object', print_r($trace,true) . "\n", true)); if (count($trace)>0) { $glpi_root = str_replace( "\\", "/", GLPI_ROOT ); $trace_file = str_replace( "\\", "/", $trace[0]['file'] ); $filename = preg_replace("|^".$glpi_root."/plugins/genericobject/|", "", $trace_file); -// call_user_func_array("Toolbox::logInFile", array('generic-object', $filename . "\n", true)); + //call_user_func_array("Toolbox::logInFile", array('generic-object', $filename . "\n", true)); } if (count($trace) > 1) { $caller = $trace[1]; diff --git a/inc/object.class.php b/inc/object.class.php index 0150a109..4794160b 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -190,7 +190,7 @@ static function registerType() { PluginGeninventorynumberConfigField::registerNewItemType($class); array_push($GENINVENTORYNUMBER_TYPES, $class); } - } elseif ($plugin->isActivated('geninventorynumber')) { + } else if ($plugin->isActivated('geninventorynumber')) { include_once (GLPI_ROOT.'/plugins/geninventorynumber/inc/profile.class.php'); PluginGeninventorynumberConfigField::unregisterNewItemType($class); } @@ -306,7 +306,7 @@ function defineTabs($options=array()) { $this->addStandardTab('Ticket', $ong, $options); $this->addStandardTab('Item_Problem', $ong, $options); $this->addStandardTab('Change_Item', $ong, $options); - } + } if ($this->canUseNotepad()) { $this->addStandardTab('Notepad', $ong, $options); @@ -474,7 +474,6 @@ function showForm($id, $options=array(), $previsualisation = false) { echo ""; } - //Reset fields definition only to keep the itemtype ones $GO_FIELDS = array(); plugin_genericobject_includeCommonFields(true); @@ -768,7 +767,7 @@ function getObjectSearchOptions($with_linkfield = false) { $currentindex = $index; if (isset($index_exceptions[$field])) { $currentindex = $index_exceptions[$field]; - } elseif (in_array($currentindex, $index_exceptions)) { + } else if (in_array($currentindex, $index_exceptions)) { //If this index is reserved, jump to next $currentindex++; } @@ -825,7 +824,6 @@ function getObjectSearchOptions($with_linkfield = false) { = $searchoption['massiveaction']; } - //Datainjection option if (!in_array($field, $datainjection_blacklisted)) { $options[$currentindex]['injectable'] = 1; @@ -1021,7 +1019,7 @@ function transfer($new_entity) { return true; } - /** + /** * @since version 0.85 * * @see CommonDBTM::showMassiveActionsSubForm() @@ -1040,7 +1038,7 @@ static function showMassiveActionsSubForm(MassiveAction $ma) { default : break; } - // } + //} return true; } @@ -1070,17 +1068,17 @@ static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBT switch ($ma->action) { case "plugin_genericobject_transfer" : foreach ($ma->items as $itemtype => $val) { - foreach ($val as $key => $item_id) { - $item = new $itemtype; - $item->getFromDB($item_id); - $item->transfer($_POST['new_entity']); - $results['ok']++; - } - } - break; - - default : - break; + foreach ($val as $key => $item_id) { + $item = new $itemtype; + $item->getFromDB($item_id); + $item->transfer($_POST['new_entity']); + $results['ok']++; + } + } + break; + + default : + break; } $ma->results=$results; } diff --git a/inc/object_item.class.php b/inc/object_item.class.php index 0ad72f07..04272efc 100644 --- a/inc/object_item.class.php +++ b/inc/object_item.class.php @@ -117,7 +117,7 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtempl $itemtypes = self::getLinkedItemTypes(); if (get_class($item) == self::getItemType1()) { self::showItemsForSource($item); - } elseif (in_array(get_class($item), $itemtypes)) { + } else if (in_array(get_class($item), $itemtypes)) { self::showItemsForTarget($item); } return true; diff --git a/inc/profile.class.php b/inc/profile.class.php index ea397838..ca2116fc 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -31,7 +31,7 @@ class PluginGenericobjectProfile extends Profile { function cleanProfiles($id) { $this->deleteByCriteria(array('id' => $id)); } - + function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { switch($item->getType()) { @@ -105,7 +105,6 @@ static function showForItemtype($type) { echo ""; } - echo ""; Html::closeForm(); } @@ -131,7 +130,6 @@ function showForm($profiles_id, $options = array()) { $profile = new Profile(); $profile->getFromDB($profiles_id); - echo "
"; echo ""; @@ -151,7 +149,7 @@ function showForm($profiles_id, $options = array()) { $title = __('Objects', 'genericobject'); if (count($types_rights) == 0) { $title .= __(" (No types defined yet)", "genericobject"); - } + } $profile->displayRightsChoiceMatrix( $types_rights, @@ -222,7 +220,6 @@ function saveProfileToDB($params) { $query.=", `open_ticket`='".$params[$profile['itemtype'].'_open_ticket']."' "; } - $query.="WHERE `profiles_id`='".$params['profiles_id']."' " . "AND `itemtype`='".$profile['itemtype']."'"; $DB->query($query); @@ -273,14 +270,14 @@ public static function createAccess($profiles_id, $itemtype, $first=false) { $rights = getAllDatasFromTable('glpi_profiles'); $profile_right = new ProfileRight(); $itemtype_rightname = self::getProfileNameForItemtype($itemtype); - + foreach ($rights as $right) { if ($right['id'] == $profiles_id) { - $r = ALLSTANDARDRIGHT | READNOTE | UPDATENOTE; + $r = ALLSTANDARDRIGHT | READNOTE | UPDATENOTE; } else { $r = 0; } - $profile_right->updateProfileRights($right['id'], + $profile_right->updateProfileRights($right['id'], array($itemtype_rightname => $r)); } } @@ -370,7 +367,7 @@ public static function changeProfile() { if (preg_match("/plugin_genericobject_/", $str_right)) { unset($_SESSION['glpiactiveprofile'][$str_right]); if (!empty($db_rights) && isset($db_rights[$str_right])) { - $_SESSION['glpiactiveprofile'][$str_right] = $db_rights[$str_right]; + $_SESSION['glpiactiveprofile'][$str_right] = $db_rights[$str_right]; } } } @@ -387,8 +384,8 @@ static function install(Migration $migration) { foreach (getAllDatasFromTable('glpi_plugin_genericobject_profiles') as $right) { if (preg_match("/PluginGenericobject(.*)/", $right['itemtype'], $results)) { $newrightname = 'plugin_genericobject_'.strtolower($results[1]).'s'; - if (!countElementsInTable('glpi_profilerights', - "`profiles_id`='".$right['profiles_id']."' + if (!countElementsInTable('glpi_profilerights', + "`profiles_id`='".$right['profiles_id']."' AND `name`='$newrightname'")) { switch ($right['right']) { case NULL: @@ -403,15 +400,15 @@ static function install(Migration $migration) { break; } - $profileRight->add(array('profiles_id' => $right['profiles_id'], - 'name' => $newrightname, + $profileRight->add(array('profiles_id' => $right['profiles_id'], + 'name' => $newrightname, 'rights' => $rightvalue)); - if (!countElementsInTable('glpi_profilerights', - "`profiles_id`='".$right['profiles_id']."' + if (!countElementsInTable('glpi_profilerights', + "`profiles_id`='".$right['profiles_id']."' AND `name`='plugin_genericobject_types'")) { - $profileRight->add(array('profiles_id' => $right['profiles_id'], - 'name' => 'plugin_genericobject_types', + $profileRight->add(array('profiles_id' => $right['profiles_id'], + 'name' => 'plugin_genericobject_types', 'rights' => 23)); } } @@ -435,7 +432,7 @@ static function install(Migration $migration) { } //$migration->dropTable('glpi_plugin_genericobject_profiles'); } - if (!countElementsInTable('glpi_profilerights', + if (!countElementsInTable('glpi_profilerights', "`name` LIKE '%genericobject%'")) { self::createFirstAccess(); } diff --git a/inc/type.class.php b/inc/type.class.php index 831ead7e..032b1f75 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -161,7 +161,7 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtempl break; case 5: - PluginGenericobjectObject::showPrevisualisationForm($item); + PluginGenericobjectObject::showPrevisualisationForm($item); break; case 6: @@ -297,9 +297,9 @@ function pre_deleteItem() { } } - + public function post_deleteItem() { - + } function getSearchOptions() { @@ -513,7 +513,7 @@ function showBehaviorForm($ID, $options=array()) { ); $plugins = array("use_plugin_datainjection" => __("injection file plugin", "genericobject"), - // "use_plugin_pdf" => __("PDF plugin", "genericobject"), + //"use_plugin_pdf" => __("PDF plugin", "genericobject"), "use_plugin_geninventorynumber" => __("geninventorynumber plugin", "genericobject"), "use_plugin_order" => __("order plugin", "genericobject"), "use_plugin_uninstall" => __("item's uninstallation plugin", "genericobject"), @@ -626,7 +626,7 @@ function showBehaviorForm($ID, $options=array()) { echo "\n"; } break; - case 'use_plugin_geninventorynumber' : + case 'use_plugin_geninventorynumber' : if ($plugin->isActivated('geninventorynumber')) { Html::showCheckbox(array('name' => $right, 'checked' => $this->fields[$right])); @@ -740,7 +740,7 @@ static function addNewObject($name, $itemtype, $options = array()) { //Write object class on the filesystem self::addClassFile($name, $itemtype); - //Write the form on the filesystem + //Write the form on the filesystem self::addFormFile($name, $itemtype); self::addSearchFile($name, $itemtype); @@ -1481,10 +1481,10 @@ public static function deleteNotepad($itemtype) { * @return nothing */ static function deleteNetworking($itemtype) { - $networkport = new NetworkPort(); - foreach ($networkport->find("`itemtype`='$itemtype'") as $port) { + $networkport = new NetworkPort(); + foreach ($networkport->find("`itemtype`='$itemtype'") as $port) { $networkport->delete($port); - } + } } /** @@ -1512,7 +1512,7 @@ static function deleteReservations($itemtype) { static function deleteReservationItems($itemtype) { $reservationItem = new ReservationItem(); $reservationItem->deleteByCriteria(array('itemtype' => $itemtype), true); - } + } /** * Filter values inserted by users : remove accented chars @@ -1549,14 +1549,14 @@ static function getFamilyNameByItemtype($itemtype) { if (empty($types)) { return false; } else { - $type = array_pop($types); - if ($type['plugin_genericobject_typefamilies_id'] > 0) { + $type = array_pop($types); + if ($type['plugin_genericobject_typefamilies_id'] > 0) { $family = new PluginGenericobjectTypeFamily(); $family->getFromDB($type['plugin_genericobject_typefamilies_id']); - return $family->getName(); - } else { - return false; - } + return $family->getName(); + } else { + return false; + } } } @@ -1628,11 +1628,12 @@ static function includeLocales($name) { } else { if (file_exists($prefix . ".en_GB.php")) { include_once ($prefix . ".en_GB.php"); - } else - if (file_exists($prefix . ".fr_FR.php")) { - include_once ($prefix . ".fr_FR.php"); - } else { - return false; + } else { + if (file_exists($prefix . ".fr_FR.php")) { + include_once ($prefix . ".fr_FR.php"); + } else { + return false; + } } } return true; @@ -1810,7 +1811,7 @@ function canUsePluginUninstall() { if (!$plugin->isInstalled("uninstall") || !$plugin->isActivated("uninstall")) { return false; } - return $this->fields['use_plugin_uninstall']; + return $this->fields['use_plugin_uninstall']; } function canUsePluginSimcard() { @@ -1859,7 +1860,7 @@ static function canViewAtLeastOneType() { /** * Display debug information for current object **/ - function showDebug() { + function showDebug() { $this->showFilesForm(); //NotificationEvent::debugEvent($this); } @@ -1987,8 +1988,6 @@ static function uninstall() { self::deleteItemTypeFilesAndClasses($type['name'], getTableForItemType($type['itemtype']), $type['itemtype']); } - - //Delete table $query = "DROP TABLE IF EXISTS `glpi_plugin_genericobject_types`"; $DB->query($query) or die($DB->error()); diff --git a/inc/typefamily.class.php b/inc/typefamily.class.php index 2793c86c..63061858 100644 --- a/inc/typefamily.class.php +++ b/inc/typefamily.class.php @@ -79,7 +79,7 @@ static function getFamilies() { foreach($DB->request($query) as $fam) { $itemtype = $fam['itemtype']; if ($itemtype::canCreate()) { - $families[$fam['id']] = $fam['name']; + $families[$fam['id']] = $fam['name']; } } return $families; diff --git a/index.php b/index.php index bc73a7e7..96527c4f 100644 --- a/index.php +++ b/index.php @@ -44,10 +44,9 @@ //There's only one family if (count($types) == 1) { - - //There's only one itemtype ? If yes, then automatically - //redirect to the search engine - if(key($types) == NULL) { + //There's only one itemtype ? If yes, then automatically + //redirect to the search engine + if(key($types) == NULL) { $mytypes = $types; $tmp = array_pop($mytypes); if (count($tmp) == 1) { From f9ba4ffa58edcaf697330804d0601d80928013ea Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Dec 2016 12:03:21 +0100 Subject: [PATCH 03/40] Fix doc link --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 15b1c22e..4e73bc01 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ The genericobject plugin allows to extends GLPi to manage new types of objects. - -See [Wiki](https://github.com/pluginsGLPI/genericobject/wiki/) for Usage and customisation +See [the documentation](http://glpi-plugins.readthedocs.io/en/latest/genericobject/index.html) for Usage and customisation ## Contributing From ca2e6f2cdc9604e032da127a674024596f0c3ee3 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 8 Dec 2016 16:14:57 +0100 Subject: [PATCH 04/40] Tru with phpcs from composer --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60000794..9742bed3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,12 @@ before_script: - composer install -o # - mysql -u root -e 'create database glpitest;' # - php tools/cliinstall.php --lang=en_US --db=glpitest --user=root --tests - - pear install pear/PHP_CodeSniffer - - phpenv rehash + - composer require squizlabs/php_codesniffer script: # - mysql -u root -e 'select version();' # - phpunit --verbose - - phpcs -p --ignore=vendor --ignore=js --ignore=css --standard=tools/phpcs-rules.xml . + - ./vendor/bin/phpcs -p --ignore=vendor --ignore=js --ignore=css --standard=tools/phpcs-rules.xml . matrix: include: From 381eb4e24bc5ad2efd6188abe2965852ccecdf46 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Fri, 16 Dec 2016 12:21:35 +0100 Subject: [PATCH 05/40] Update release script --- tools/release | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/tools/release b/tools/release index 2b92f5ec..2f0b3ee7 100755 --- a/tools/release +++ b/tools/release @@ -33,6 +33,7 @@ banned = [ 'tests' ] gh_orga = 'pluginsGLPI' +script_version = '1.0.0' def print_err(msg): """ @@ -506,7 +507,19 @@ def check_version(buildver): if xmlfile != None: if verbose: print 'XML file found in %s' % xmlfile - xmldoc = etree.parse(xmlfile) + try: + xmldoc = etree.parse(xmlfile) + for version in xmldoc.getiterator('num'): + if version.text == buildver: + if verbose: + print '%s found in the XML file!' % buildver + return True + print_err('%s *NOT* found in the XML file %s' % (buildver, xmlfile)) + except etree.XMLSyntaxError as err: + print_err('%s is *NOT* XML valid!' % (xmlfile)) + if verbose: + print format(err) + return False else: print_err('Plugins website configuration file has not been found!') return False @@ -517,11 +530,11 @@ def main(): """ global verbose, tagrefs, force, extra, assume_yes, sign, plugin_name, github, gh_cred_file - parser = argparse.ArgumentParser(description='Release plugin') + parser = argparse.ArgumentParser(description='GLPi plugins release script', version=script_version) group = parser.add_mutually_exclusive_group() group.add_argument( - '-v', - '--version', + '-r', + '--release', help='Version to release' ) parser.add_argument( @@ -625,29 +638,29 @@ def main(): compile_mo(plugin_repo) if args.minify: minify(plugin_repo) - elif (args.extra or args.commit) and (not args.extra or not args.commit or not args.version): + elif (args.extra or args.commit) and (not args.extra or not args.commit or not args.release): print_err('You have to specify --version --commit and --extra all together') sys.exit(1) - elif args.commit and args.version and args.extra: + elif args.commit and args.release and args.extra: if valid_commit(repo, args.commit): if verbose: print 'Commit is valid' build = True - buildver = args.version + buildver = args.release extra = args.extra else: print_err('Invalid commit ref %s' % args.commit) - elif args.version: - if not valid_version(args.version): - print_err('%s is not a valid version number!' % args.version) + elif args.release: + if not valid_version(args.release): + print_err('%s is not a valid version number!' % args.release) sys.exit(1) else: #check if specified version exists - if not is_existing_version(args.version): - print_err('%s does not exist!' % args.version) + if not is_existing_version(args.release): + print_err('%s does not exist!' % args.release) else: build = True - buildver = args.version + buildver = args.release elif args.propose: propose_version() else: From 7d37cad0d271575ef6f6f1cb41ef181b81fcf771 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Fri, 16 Dec 2016 12:21:46 +0100 Subject: [PATCH 06/40] Fix locales pull argument --- RoboFilePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RoboFilePlugin.php b/RoboFilePlugin.php index a3fab2bb..7aa9732d 100644 --- a/RoboFilePlugin.php +++ b/RoboFilePlugin.php @@ -88,7 +88,7 @@ public function localesPush() */ public function localesPull($percent = 70) { - $this->_exec('tx pull -s --minimum-perc=' .$percent); + $this->_exec('tx pull -a --minimum-perc=' .$percent); return $this; } From 93af05de3890079dd81a94e8affde3886629365d Mon Sep 17 00:00:00 2001 From: dethegeek Date: Fri, 7 Oct 2016 23:21:06 +0200 Subject: [PATCH 07/40] attempt to repair field unicity feature - add linkfield to search options only when needed - this makes the argument on PluginGenericobjectObject::getobjectSearchOptions() useless - re-enable the checkbox to enable field unicity - reorder search options by key (very important) --- inc/object.class.php | 15 +++++---------- inc/type.class.php | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/inc/object.class.php b/inc/object.class.php index 4794160b..4a28c9a7 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -352,7 +352,6 @@ function canUseUnicity() { // Disable unicity feature (for GLPI 0.85 onward) : see issue #16 // Related code : search for #16 // FIXME : The bug may be in GLPI itself - return false; return ($this->objecttype->canUseUnicity() && Session::haveRight("config", READ)); } @@ -737,11 +736,11 @@ static function showPrevisualisationForm(PluginGenericobjectType $type) { function getSearchOptions() { - return $this->getObjectSearchOptions(true); + return $this->getObjectSearchOptions(); } - function getObjectSearchOptions($with_linkfield = false) { + function getObjectSearchOptions() { global $DB, $GO_FIELDS, $GO_BLACKLIST_FIELDS; $datainjection_blacklisted = array('id', 'date_mod', 'entities_id', 'date_creation'); @@ -788,12 +787,8 @@ function getObjectSearchOptions($with_linkfield = false) { $tmp = ''; } - if ($with_linkfield) { - if (preg_match("/(s_id$|s_id_)/", $field)) { - $options[$currentindex]['linkfield'] = $field; - } else { - $options[$currentindex]['linkfield'] = $field; - } + if (preg_match("/(s_id_)/", $field)) { + $options[$currentindex]['linkfield'] = $field; } if ($tmp != '') { @@ -916,7 +911,7 @@ function getObjectSearchOptions($with_linkfield = false) { } $index = $currentindex + 1; } - asort($options); + ksort($options); return $options; } diff --git a/inc/type.class.php b/inc/type.class.php index 032b1f75..f304f65b 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -506,7 +506,7 @@ function showBehaviorForm($ID, $options=array()) { "use_loans" => _n("Reservation", "Reservations", 2), // Disable unicity feature; see #16 // Related code : search for #16 - // "use_unicity" => __("Fields unicity"), + "use_unicity" => __("Fields unicity"), "use_global_search" => __("Global search"), "use_projects" => _n("Project", "Projects", 2), "use_network_ports" => __("Network connections", "genericobject"), From 54266264b393f9fa2e2aca343056cfc1be3b2f71 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 8 Feb 2017 12:00:50 +0100 Subject: [PATCH 08/40] Use external tools --- .travis.yml | 64 ++-- RoboFile.php | 4 +- RoboFilePlugin.php | 146 -------- composer.json | 6 +- composer.lock | 360 ++++++++++++++------ tools/extract_template.sh | 20 -- tools/modify_headers.pl | 102 ------ tools/phpcs-rules.xml | 22 -- tools/release | 680 -------------------------------------- 9 files changed, 294 insertions(+), 1110 deletions(-) delete mode 100644 RoboFilePlugin.php delete mode 100755 tools/extract_template.sh delete mode 100755 tools/modify_headers.pl delete mode 100644 tools/phpcs-rules.xml delete mode 100755 tools/release diff --git a/.travis.yml b/.travis.yml index 9742bed3..f2963c95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,53 +1,39 @@ language: php +php: + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - nightly -env: - - DB=mysql +#env: +# global: +# - DB=mysql +# matrix: +# - GLPIVER=9.1/bugfixes +# - GLPIVER=master before_script: - composer self-update - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.4" ]]; then sed -e "s|.*"consolidation/robo".*$||" -i composer.json && composer update; fi - - composer install -o +# - git clone --depth=1 https://github.com/glpi-project/glpi -b $GLPIVER ../glpi && cd ../glpi +# - composer install --no-dev # - mysql -u root -e 'create database glpitest;' -# - php tools/cliinstall.php --lang=en_US --db=glpitest --user=root --tests - - composer require squizlabs/php_codesniffer +# - php tools/cliinstall.php --db=glpi-test --user=travis --tests +# - mv ../{LNAME} plugins/{LNAME} +# - cd plugins/{LNAME} + - composer install -o + script: + - vendor/bin/robo --no-interaction code:cs # - mysql -u root -e 'select version();' -# - phpunit --verbose - - ./vendor/bin/phpcs -p --ignore=vendor --ignore=js --ignore=css --standard=tools/phpcs-rules.xml . +# - ./vendor/bin/atoum -bf tests/bootstrap.php -d tests/units/ + matrix: - include: - - php: 5.4 - addons: - mariadb: 5.5 - - php: 5.5 - addons: - mariadb: 5.5 -# - php: 5.6 -# addons: -# mariadb: 5.5 -# - php: 5.6 -# addons: -# mariadb: 10.0 - - php: 5.6 - addons: - mariadb: 10.1 -# - php: 7.0 -# addons: -# mariadb: 10.0 - - php: 7.0 - addons: - mariadb: 10.1 -# - php: 7.1 -# addons: -# mariadb: 10.0 - - php: 7.1 - addons: - mariadb: 10.1 - - php: nightly - addons: - mariadb: 10.1 +# exclude: +# - php: 5.4 +# env: GLPIVER=master allow_failures: - php: nightly diff --git a/RoboFile.php b/RoboFile.php index 047d37ad..f6360f5a 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -5,9 +5,9 @@ * @see http://robo.li/ */ -require_once 'RoboFilePlugin.php'; +require_once 'vendor/autoload.php'; -class RoboFile extends RoboFilePlugin +class RoboFile extends Glpi\Tools\RoboFile { //Own plugin's robo stuff } diff --git a/RoboFilePlugin.php b/RoboFilePlugin.php deleted file mode 100644 index 7aa9732d..00000000 --- a/RoboFilePlugin.php +++ /dev/null @@ -1,146 +0,0 @@ -minifyCSS() - ->minifyJS(); - } - - /** - * Minify CSS stylesheets - * - * @return void - */ - public function minifyCSS() - { - $css_dir = __DIR__ . '/css'; - if (is_dir($css_dir)) { - foreach(glob("$css_dir/*.css") as $css_file) { - if (!$this->endsWith($css_file, 'min.css')) { - $this->taskMinify($css_file) - ->to(str_replace('.css', '.min.css', $css_file)) - ->type('css') - ->run(); - } - } - } - return $this; - } - - /** - * Minify JavaScript files stylesheets - * - * @return void - */ - public function minifyJS() - { - $js_dir = __DIR__ . '/js'; - if (is_dir($js_dir)) { - foreach(glob("$js_dir/*.js") as $js_file) { - if (!$this->endsWith($js_file, 'min.js')) { - $this->taskMinify($js_file) - ->to(str_replace('.js', '.min.js', $js_file)) - ->type('js') - ->run(); - } - } - } - return $this; - } - - /** - * Extract translatable strings - * - * @return void - */ - public function localesExtract() - { - $this->_exec('tools/extract_template.sh'); - return $this; - } - - /** - * Push locales to transifex - * - * @return void - */ - public function localesPush() - { - $this->_exec('tx push -s'); - return $this; - } - - /** - * Pull locales from transifex. - * - * @return void - */ - public function localesPull($percent = 70) - { - $this->_exec('tx pull -a --minimum-perc=' .$percent); - return $this; - } - - /** - * Build MO files - * - * @return void - */ - public function localesMo() - { - $this->_exec('./tools/release --compile-mo'); - return $this; - } - - /** - * Extract and send locales - * - * @return void - */ - public function localesSend() - { - $this->localesExtract() - ->localesPush(); - return $this; - } - - /** - * Retrieve locales and generate mo files - * - * @return void - */ - public function localesGenerate($percent = 70) { - $this->localesPull($percent) - ->localesMo(); - return $this; - } - - /** - * Checks if a string ends with another string - * - * @param string $haystack Full string - * @param string $needle Ends string - * - * @return boolean - * @see http://stackoverflow.com/a/834355 - */ - private function endsWith($haystack, $needle) { - $length = strlen($needle); - if ($length == 0) { - return true; - } - - return (substr($haystack, -$length) === $needle); - } -} diff --git a/composer.json b/composer.json index e9f1a3ee..1ac36cb3 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { + "minimum-stability": "dev", + "prefer-stable": true, "require-dev": { - "consolidation/robo": "dev-master@dev", - "patchwork/jsqueeze": "~1.0", - "natxet/CssMin": "~3.0" + "glpi-project/tools": "^0.1.0" } } diff --git a/composer.lock b/composer.lock index 776bdd54..df8bdc91 100644 --- a/composer.lock +++ b/composer.lock @@ -4,37 +4,36 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0cf7f5dd3afb59e98200bf7e7bcbb494", - "content-hash": "d5210b4cf8ca3c160925a3d33444a705", + "content-hash": "8a6db7f45e083d6f582cc8949facfebb", "packages": [], "packages-dev": [ { "name": "consolidation/annotated-command", - "version": "2.0.1", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "2a6ef0b39ed904dabefd796eeaf5f8feeaa881c4" + "reference": "80afffd362bd1cf83bef60db690a8c50d8390803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/2a6ef0b39ed904dabefd796eeaf5f8feeaa881c4", - "reference": "2a6ef0b39ed904dabefd796eeaf5f8feeaa881c4", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/80afffd362bd1cf83bef60db690a8c50d8390803", + "reference": "80afffd362bd1cf83bef60db690a8c50d8390803", "shasum": "" }, "require": { - "consolidation/output-formatters": "~2", + "consolidation/output-formatters": "^3.1.5", "php": ">=5.4.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "psr/log": "~1.0", - "symfony/console": "~2.5|~3.0", - "symfony/event-dispatcher": "~2.5|~3.0", - "symfony/finder": "~2.5|~3.0" + "psr/log": "~1", + "symfony/console": "^2.8|~3", + "symfony/event-dispatcher": "^2.5|~3", + "symfony/finder": "^2.5|~3" }, "require-dev": { "phpunit/phpunit": "4.*", "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "2.*" + "squizlabs/php_codesniffer": "^2.7" }, "type": "library", "extra": { @@ -58,7 +57,7 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2016-10-05 04:09:14" + "time": "2017-02-04T06:13:54+00:00" }, { "name": "consolidation/log", @@ -105,20 +104,20 @@ } ], "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "time": "2016-03-23 23:46:42" + "time": "2016-03-23T23:46:42+00:00" }, { "name": "consolidation/output-formatters", - "version": "2.0.1", + "version": "3.1.7", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "8bce15438a97afba5dcf036a71d961977b64fa3e" + "reference": "da39a0f14d5aaaee06732bb7cef2aea1de056b40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/8bce15438a97afba5dcf036a71d961977b64fa3e", - "reference": "8bce15438a97afba5dcf036a71d961977b64fa3e", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/da39a0f14d5aaaee06732bb7cef2aea1de056b40", + "reference": "da39a0f14d5aaaee06732bb7cef2aea1de056b40", "shasum": "" }, "require": { @@ -129,7 +128,8 @@ "require-dev": { "phpunit/phpunit": "4.*", "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "2.*" + "squizlabs/php_codesniffer": "2.*", + "victorjonsson/markdowndocs": "^1.3" }, "type": "library", "extra": { @@ -153,7 +153,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2016-10-05 04:05:17" + "time": "2017-01-21T06:26:40+00:00" }, { "name": "consolidation/robo", @@ -161,21 +161,21 @@ "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "8febe755fba56b195dc6f050ecee31805c78a661" + "reference": "cdc15c0059a1b2d5287910df678e8a73cbaa8ed6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/8febe755fba56b195dc6f050ecee31805c78a661", - "reference": "8febe755fba56b195dc6f050ecee31805c78a661", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/cdc15c0059a1b2d5287910df678e8a73cbaa8ed6", + "reference": "cdc15c0059a1b2d5287910df678e8a73cbaa8ed6", "shasum": "" }, "require": { - "consolidation/annotated-command": "~2", + "consolidation/annotated-command": "^2.2", "consolidation/log": "~1", - "consolidation/output-formatters": "~2", + "consolidation/output-formatters": "^3.1.5", "league/container": "^2.2", "php": ">=5.5.0", - "symfony/console": "~2.5|~3.0", + "symfony/console": "~2.8|~3.0", "symfony/event-dispatcher": "~2.5|~3.0", "symfony/filesystem": "~2.5|~3.0", "symfony/finder": "~2.5|~3.0", @@ -186,13 +186,13 @@ }, "require-dev": { "codeception/aspect-mock": "~1", - "codeception/base": "^2.1.5", + "codeception/base": "^2.2.6", "codeception/verify": "^0.3.2", "henrikbjorn/lurker": "~1", "natxet/cssmin": "~3", "patchwork/jsqueeze": "~2", - "pear/archive_tar": "~1", - "phpunit/php-code-coverage": "~4", + "pear/archive_tar": "^1.4.2", + "phpunit/php-code-coverage": "~2|~4", "satooshi/php-coveralls": "~1", "squizlabs/php_codesniffer": "~2" }, @@ -212,6 +212,9 @@ } }, "autoload": { + "classmap": [ + "scripts/composer/ScriptHandler.php" + ], "psr-4": { "Robo\\": "src" } @@ -227,7 +230,7 @@ } ], "description": "Modern task runner", - "time": "2016-11-01 23:37:29" + "time": "2017-02-08T01:45:50+00:00" }, { "name": "container-interop/container-interop", @@ -254,7 +257,94 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "time": "2014-12-30 15:22:37" + "time": "2014-12-30T15:22:37+00:00" + }, + { + "name": "glpi-project/coding-standard", + "version": "0.5", + "source": { + "type": "git", + "url": "https://github.com/glpi-project/coding-standard.git", + "reference": "e19495c896a01199a2fec2e65b7613310598cf96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/glpi-project/coding-standard/zipball/e19495c896a01199a2fec2e65b7613310598cf96", + "reference": "e19495c896a01199a2fec2e65b7613310598cf96", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPLv3" + ], + "authors": [ + { + "name": "Teclib'", + "email": "contact@teclib.com", + "homepage": "https://teclib.com" + } + ], + "description": "GLPI PHP CodeSniffer Coding Standard", + "keywords": [ + "codesniffer", + "glpi", + "phpcs" + ], + "time": "2017-01-06T11:10:46+00:00" + }, + { + "name": "glpi-project/tools", + "version": "0.1.1", + "source": { + "type": "git", + "url": "https://github.com/glpi-project/tools.git", + "reference": "89083f6e71fac05190c7cc76a9c5afd8b1f421ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/89083f6e71fac05190c7cc76a9c5afd8b1f421ef", + "reference": "89083f6e71fac05190c7cc76a9c5afd8b1f421ef", + "shasum": "" + }, + "require": { + "consolidation/robo": "dev-master@dev", + "glpi-project/coding-standard": "0.5", + "natxet/cssmin": "~3.0", + "patchwork/jsqueeze": "~1.0" + }, + "bin": [ + "tools/plugin-release", + "tools/extract_template.sh", + "tools/modify_headers.pl" + ], + "type": "library", + "autoload": { + "psr-4": { + "Glpi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPLv3" + ], + "authors": [ + { + "name": "Teclib'", + "email": "glpi@teclib.com", + "homepage": "https://teclib.com" + } + ], + "description": "Various tools for GLPI and its plugins", + "keywords": [ + "glpi", + "plugins", + "tools" + ], + "time": "2017-02-08T08:20:09+00:00" }, { "name": "league/container", @@ -318,7 +408,7 @@ "provider", "service" ], - "time": "2016-03-17 11:07:59" + "time": "2016-03-17T11:07:59+00:00" }, { "name": "natxet/CssMin", @@ -365,7 +455,7 @@ "css", "minify" ], - "time": "2015-09-25 11:13:11" + "time": "2015-09-25T11:13:11+00:00" }, { "name": "patchwork/jsqueeze", @@ -407,7 +497,7 @@ "javascript", "minification" ], - "time": "2015-03-25 10:11:08" + "time": "2015-03-25T10:11:08+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -461,7 +551,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -506,20 +596,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "shasum": "" }, "require": { @@ -553,7 +643,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-06-10 07:14:17" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "psr/log", @@ -600,20 +690,98 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "86dd55a522238211f9f3631e3361703578941d9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a", + "reference": "86dd55a522238211f9f3631e3361703578941d9a", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "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": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-02-02T03:30:00+00:00" }, { "name": "symfony/console", - "version": "v3.1.6", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065" + "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c99da1119ae61e15de0e4829196b9fba6f73d065", - "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065", + "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936", + "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936", "shasum": "" }, "require": { @@ -624,17 +792,19 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -661,20 +831,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-10-06 01:44:51" + "time": "2017-02-06T12:04:21+00:00" }, { "name": "symfony/debug", - "version": "v3.1.6", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8" + "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", - "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", + "url": "https://api.github.com/repos/symfony/debug/zipball/b4d9818f127c60ce21ed62c395da7df868dc8477", + "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477", "shasum": "" }, "require": { @@ -691,7 +861,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -718,20 +888,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-09-06 11:02:40" + "time": "2017-01-28T02:37:08+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.1.6", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc" + "reference": "9137eb3a3328e413212826d63eeeb0217836e2b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/28b0832b2553ffb80cabef6a7a812ff1e670c0bc", - "reference": "28b0832b2553ffb80cabef6a7a812ff1e670c0bc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9137eb3a3328e413212826d63eeeb0217836e2b6", + "reference": "9137eb3a3328e413212826d63eeeb0217836e2b6", "shasum": "" }, "require": { @@ -751,7 +921,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -778,20 +948,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-10-13 06:28:43" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/filesystem", - "version": "v3.1.6", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6" + "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0565b61bf098cb4dc09f4f103f033138ae4f42c6", - "reference": "0565b61bf098cb4dc09f4f103f033138ae4f42c6", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", + "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", "shasum": "" }, "require": { @@ -800,7 +970,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -827,20 +997,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2017-01-08T20:47:33+00:00" }, { "name": "symfony/finder", - "version": "v3.1.6", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "205b5ffbb518a98ba2ae60a52656c4a31ab00c6f" + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/205b5ffbb518a98ba2ae60a52656c4a31ab00c6f", - "reference": "205b5ffbb518a98ba2ae60a52656c4a31ab00c6f", + "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6", + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6", "shasum": "" }, "require": { @@ -849,7 +1019,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -876,20 +1046,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-09-28 00:11:12" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "shasum": "" }, "require": { @@ -901,7 +1071,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -935,20 +1105,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", - "version": "v3.1.6", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "66de154ae86b1a07001da9fbffd620206e4faf94" + "reference": "32646a7cf53f3956c76dcb5c82555224ae321858" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/66de154ae86b1a07001da9fbffd620206e4faf94", - "reference": "66de154ae86b1a07001da9fbffd620206e4faf94", + "url": "https://api.github.com/repos/symfony/process/zipball/32646a7cf53f3956c76dcb5c82555224ae321858", + "reference": "32646a7cf53f3956c76dcb5c82555224ae321858", "shasum": "" }, "require": { @@ -957,7 +1127,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -984,24 +1154,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-09-29 14:13:09" + "time": "2017-02-03T12:11:38+00:00" }, { "name": "webmozart/assert", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", - "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", "shasum": "" }, "require": { - "php": "^5.3.3|^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -1010,7 +1180,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1034,15 +1204,13 @@ "check", "validate" ], - "time": "2016-08-09 15:02:57" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "consolidation/robo": 20 - }, - "prefer-stable": false, + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, "prefer-lowest": false, "platform": [], "platform-dev": [] diff --git a/tools/extract_template.sh b/tools/extract_template.sh deleted file mode 100755 index aeb1964b..00000000 --- a/tools/extract_template.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../" -pushd $DIR > /dev/null - -NAME='Genericobject' -POTFILE=${NAME,,}.pot - -PHP_SOURCES=`find ./ -name \*.php ! -path ./vendor ! -path ./lib` - -if [ ! -d "locales" ]; then - mkdir locales -fi - -# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) -xgettext $PHP_SOURCES -o locales/$POTFILE -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ - --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t \ - --keyword=_sx:1c,2,3t --keyword=_nx:1c,2,3,5t - -popd > /dev/null diff --git a/tools/modify_headers.pl b/tools/modify_headers.pl deleted file mode 100755 index 71719e28..00000000 --- a/tools/modify_headers.pl +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/perl -#!/usr/bin/perl -w - -# ---------------------------------------------------------------------- -# GLPI - Gestionnaire Libre de Parc Informatique -# Copyright (C) 2003-2006 by the INDEPNET Development Team. -# -# http://indepnet.net/ http://glpi-project.org -# ---------------------------------------------------------------------- -# -# LICENSE -# -# This file is part of GLPI. -# -# GLPI 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. -# -# GLPI 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 GLPI; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# ------------------------------------------------------------------------ - - -do_dir(".."); - - -sub do_dir{ -local ($dir)=@_; -print "Entering $dir\n"; - -opendir(DIRHANDLE,$dir)||die "ERROR: can not read current directory\n"; -foreach (readdir(DIRHANDLE)){ - if ($_ ne '..' && $_ ne '.'){ - if (-d "$dir/$_"){ - if ($_ !~ m/.svn/i && $_ !~ m/CVS/i && $_ !~ m/lib/i){ - - do_dir("$dir/$_"); - } - } else { - if(!(-l "$dir/$_")){ - if ((index($_,".php",0)!=-1)||(index($_,".txt",0)!=-1)||(index($_,".css",0)!=-1)){ - do_file("$dir/$_"); - } - } - } - } -} -closedir DIRHANDLE; - -} - -sub do_file{ - local ($file)=@_; - print $file."\n"; - ### DELETE HEADERS - open(INIT_FILE,$file); - @lines=; - close(INIT_FILE); - - open(TMP_FILE,">/tmp/tmp_glpi.txt"); - - $status=''; - foreach (@lines){ - if ($_ =~ m/\*\//){ - $status="END"; - } - - if ($status =~ m/END/||$status !~ m/BEGIN/){ - print TMP_FILE $_; - } - - if ($status !~ m/END/){ - if ($_ =~ m/\/\*/){ - $status="BEGIN"; - ##### ADD NEW HEADERS - open(HEADER_FILE,"HEADER"); - @headers=; - foreach (@headers){ - print TMP_FILE $_; - } - close(HEADER_FILE) ; - - } - } - } - close(TMP_FILE); - - system("cp -f /tmp/tmp_glpi.txt $file"); - - - -} - - - diff --git a/tools/phpcs-rules.xml b/tools/phpcs-rules.xml deleted file mode 100644 index f3314a0e..00000000 --- a/tools/phpcs-rules.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/release b/tools/release deleted file mode 100755 index 2f0b3ee7..00000000 --- a/tools/release +++ /dev/null @@ -1,680 +0,0 @@ -#!/usr/bin/python -# Adapted from Galette release script - -import os, sys, argparse, re, git, subprocess -import tarfile, shutil, gitdb, time, urllib2, json -from datetime import datetime -from termcolor import colored -from lxml import etree - -plugin_dir = os.path.dirname( - os.path.dirname(os.path.abspath(__file__)) -) -dist_dir = os.path.join( - plugin_dir, - 'dist' -) -verbose = False -tagrefs = None -force = False -commit = None -extra = None -sign = True -github = True -assume_yes = False -banned = [ - 'dist', - 'vendor', - '.git', - '.gitignore', - '.gh_token', - '.tx', - 'tools', - 'tests' -] -gh_orga = 'pluginsGLPI' -script_version = '1.0.0' - -def print_err(msg): - """ - Display colored error message - """ - print colored(msg, 'red', attrs=['bold']) - -def get_numeric_version(ver): - """ - Returns all numeric version - """ - return re.findall(r'\d+', ver) - -def valid_version(ver): - """ - Check if provided version is valid. - - Takes all digits in passed version, then reassemble them with dots - to check if it is the same as original given one. - """ - return '.'.join(get_numeric_version(ver)) == ver - -def incr_version(ver): - """ - Increment version number - """ - version = get_numeric_version(ver) - version[-1] = str(int(version[-1]) + 1) - return version - -def propose_version(): - """ - Propose new minor and major versions, - according to existing git tags - """ - last_major = '0' - last_minor = '0' - - for tagref in tagrefs: - if valid_version(tagref.name): - #last minor version is always the last one :) - if tagref.name > last_minor: - last_minor = tagref.name - - #last major version - if len(tagref.name) == 5 and tagref.name > last_major: - last_major = tagref.name - - if verbose: - print 'last minor: %s | last major %s' % (last_minor, last_major) - - #no version provided. propose one - new_minor = None - new_major = None - - if len(last_minor) == 5: - #if the latest is a major version - new_minor = last_minor + ('.1') - else: - new_minor = '.'.join(incr_version(last_minor)) - - new_major = '.'.join(incr_version(last_major)) - - print """Proposed versions: - minor: %s - major: %s - """ % (new_minor, new_major) - -def get_latest_version(): - """ - Look for latest version - """ - last = None - for tagref in tagrefs: - if valid_version(tagref.name): - #last created minor version is always the last one :) - if tagref.name > last: - last = tagref.name - - return last - -def is_existing_version(ver): - """ - Look specified version exists - """ - for tagref in tagrefs: - if valid_version(tagref.name): - if tagref.name == ver: - return True - return False - -def ask_user_confirm(msg): - """ - Ask user his confirmation - """ - if assume_yes: - return True - else: - while True: - sys.stdout.write(msg) - choice = raw_input().lower() - if choice == 'y' or choice == 'yes': - return True - elif choice == 'n' or choice == 'no': - return False - else: - print_err( - "Invalid input. Please enter 'yes' or 'no' (or 'y' or 'n')." - ) - -def get_rel_name(buildver): - """ - Build archive name from command line parameters - That would be used for git archiving prefix and archive name - """ - archive_name = None - - if commit and extra: - now = datetime.now() - archive_name = 'glpi-%s-%s-%s-%s-%s' % ( - plugin_name, - buildver, - extra, - now.strftime('%Y%m%d'), - commit - ) - else: - archive_name = 'glpi-%s-%s' % (plugin_name, buildver) - - return archive_name - -def _do_build(repo, ver): - """ - Proceed build - """ - exists = False - ascexists = False - rel_name = get_rel_name(ver) - archive_name = rel_name + '.tar.bz2' - archive = os.path.join( - dist_dir, - archive_name - ) - - if not force: - #first check if a version - local = False - ascLocal = False - - #check if a release exists upstream - #FIXME: this retrieve only publicated release, not drafts - url = 'https://api.github.com/repos/%s/%s/releases/tags/%s' % (gh_orga, plugin_name, ver) - - exists = False - gh_id = None - - try: - request = urllib2.Request(url) - handle = urllib2.urlopen(request) - contents = json.loads(handle.read()) - - for asset in contents['assets']: - if archive_name == asset['name']: - exists = True - gh_id = contents['id'] - break - except (urllib2.URLError, urllib2.HTTPError): - pass - - if exists: - #we know a release exists for this tag. Check if files have been uploaded yet - pass - - if not exists: - #also check from local repo - exists = os.path.exists(archive) - if exists: - local = True - - #also check from local repo - ascexists = os.path.exists( - os.path.join( - dist_dir, - archive_name + '.asc' - ) - ) - - if exists or ascexists: - msg = None - if exists: - loctxt = '' - if local: - loctxt = 'locally ' - msg = 'Relase %s already %sexists' % (rel_name, loctxt) - - if ascexists: - loctxt = '' - if ascLocal: - loctxt = ' locally' - if msg is not None: - msg += ' and has been %ssigned!' % loctxt - else: - msg += 'Release has been %ssigned!' % loctxt - - msg += '\n\nYou will *NOT* build another one :)' - print_err(msg) - else: - print 'Building %s...' % rel_name - - if verbose: - typestr = 'Tag' - typever = ver - - if commit and extra: - typestr = 'Commit' - typever = commit - - print 'Release name: %s, %s: %s, Dest: %s' % ( - rel_name, - typestr, - typever, - archive - ) - - paths = os.listdir(plugin_dir) - paths = list(set(paths) - set(banned)) - - if commit and extra: - print 'Archiving GIT commit %s' % commit - with open(archive, 'wb') as stream: - repo.archive(stream, commit, prefix=plugin_name+'/', path=paths) - else: - print 'Archiving GIT tag %s' % ver - with open(archive, 'wb') as stream: - repo.archive(stream, ver, prefix=plugin_name+'/', path=paths) - - print 'Adding vendor libraries' - prepare(plugin_name, archive) - - if sign: - do_sign(archive) - - if github: - create_gh_release(archive, gh_id, plugin_name, ver) - -def do_sign(archive): - sign_cmd = 'gpg --no-use-agent --detach-sign --armor %s' % archive - p1 = subprocess.Popen(sign_cmd, shell=True) - p1.communicate() - -def create_gh_release(archive, gh_id, plugin_name, ver): - with open(gh_cred_file, 'r') as fd: - token = fd.readline().strip() - - gh = github.Github(token) - gh_user = gh.get_user() - - for gh_repo in gh_user.get_repos(): - if gh_repo.full_name == '%s/%s' % (gh_orga, plugin_name): - break - - gh_release = None - - #check in all releases (including drafts) if nothing has been found yet - if gh_id is None: - for gh_rel in gh_repo.get_releases(): - if gh_rel.tag_name == ver: - gh_release = gh_rel - break - - #create release if it does not exists - if gh_id is None and gh_release is None: - is_prerelease = False if commit else True - gh_release = gh_repo.create_git_release( - ver, - 'GLPi %s %s' % (plugin_name, ver), - 'Automated release from release script', - True, - is_prerelease - ) - elif gh_id is not None: - gh_release = gh_repo.get_release(gh_id) - - #upload = ask_user_confirm( - # 'Do you want to upload archive %s? [yes/No] ' % archive - #) - - #if upload: - # do_upload(archive, gh_id, plugin_name, ver) - -#def do_upload(archive, gh_id, plugin_name, ver): - #from uritemplate import URITemplate - #import requests - #import mimetypes - - #Upload asset - #template = URITemplate(gh_release.upload_url) - - #headers = {'Content-Type': 'application/octet-stream', 'Authorization': 'token %s' % token} - #params = {'name': '%s-%s.tar.bz2' % (plugin_name, ver)} - #url = template.expand(params) - - ## Bad request :'( - #f = open('/var/www/webapps/glpi/plugins/order/dist/glpi-order-1.9.5.tar.bz2', 'rb') - #r = requests.post( - # url, - # data=f, - # headers=headers - #) - #print r.json() - #r.raise_for_status() - -def prepare(rel_name, archive): - """ - Add external libraries to the archive, if any - """ - - plugin = tarfile.open(archive, 'r') - src_dir = os.path.join(dist_dir, 'src') - if not os.path.exists(src_dir): - os.makedirs(src_dir) - plugin.extractall(path=src_dir) - plugin.close() - - build_dir = os.path.join(src_dir, plugin_name) - if os.path.exists(os.path.join(build_dir, 'composer.lock')): - composer = ['composer', 'install', '-o', '--no-dev'] - - if not verbose: - composer.insert(-1, '-q') - - p1 = subprocess.Popen( - composer, - cwd=build_dir - ) - p1.communicate() - - compile_mo(build_dir) - - minify(build_dir) - - plugin = tarfile.open(archive, 'w|bz2') - - for i in os.listdir(src_dir): - plugin.add( - os.path.join(src_dir, i), - arcname=rel_name - ) - - plugin.close() - shutil.rmtree(src_dir) - -def compile_mo(build_dir): - locales_dir = os.path.join(build_dir, 'locales') - if verbose: - print 'Locales dir: %s' % locales_dir - if os.path.exists(locales_dir): - for file in os.listdir(locales_dir): - if file.endswith('.po'): - if verbose: - print 'Compiling %s...' % file - p1 = subprocess.Popen( - ['msgfmt', file, '-o', file.replace('.po', '.mo')], - cwd=locales_dir - ) - p1.communicate() - -def minify(build_dir): - if os.path.exists(os.path.join(plugin_dir, 'vendor')): - robo = [os.path.join(plugin_dir, 'vendor', 'bin', 'robo'), 'minify'] - if not verbose: - robo.insert(-1, '-q') - - if verbose: - print robo - - p1 = subprocess.Popen( - robo, - cwd=build_dir - ) - p1.communicate() - elif verbose: - print_err("Robo.li is not installed; cannot minify!") - -def valid_commit(repo, c): - """ - Validate commit existance in repository - """ - global commit - - try: - dformat = '%a, %d %b %Y %H:%M' - repo_commit = repo.commit(c) - - commit = repo_commit.hexsha[:10] - print colored("""Commit informations: - Hash: %s - Author: %s - Authored date: %s - Commiter: %s - Commit date: %s - Message: %s""" % ( - commit, - repo_commit.author, - time.strftime(dformat, time.gmtime(repo_commit.authored_date)), - repo_commit.committer, - time.strftime(dformat, time.gmtime(repo_commit.committed_date)), - repo_commit.message - ), None, 'on_grey', attrs=['bold']) - return True - except gitdb.exc.BadObject: - return False - -def guess_plugin_name(): - """ - Tries to guess plugin name, ask user at last - """ - name = None - - filename = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - 'extract_template.sh' - ) - - #try to get configured plugin name - if os.path.exists(filename): - with file(filename) as input: - for count, line in enumerate(input): - results = re.match(r"^NAME='(.+)'$", line) - if results: - name = results.group(1) - break - - if name is None: - #No configured name found. Let's use current directory name - name = os.path.split(plugin_dir)[-1] - - return name.lower() - -def check_version(buildver): - if verbose: - print 'Checking for version %s' % buildver - - filename = os.path.join( - plugin_dir, - 'setup.php' - ) - - found = None - #find version constant - if os.path.exists(filename): - with file(filename) as input: - for count, line in enumerate(input): - regexp = ".*('|\")PLUGIN_%s_VERSION('|\"), ('|\")(.+)('|\")" % plugin_name.upper() - results = re.match(regexp, line) - if results: - found = results.group(4) - break - - if not found == buildver: - print_err('Plugin version check has failed (%s but %s found)!' % (buildver, found)) - return False - - #check plugins website XML file - xmlfile = os.path.join(plugin_dir, '%s.xml' % plugin_name) - if not os.path.exists(xmlfile): - xmlfile = os.path.join(plugin_dir, 'plugin.xml') - if not os.path.exists(xmlfile): - xmlfile = None - - if xmlfile != None: - if verbose: - print 'XML file found in %s' % xmlfile - try: - xmldoc = etree.parse(xmlfile) - for version in xmldoc.getiterator('num'): - if version.text == buildver: - if verbose: - print '%s found in the XML file!' % buildver - return True - print_err('%s *NOT* found in the XML file %s' % (buildver, xmlfile)) - except etree.XMLSyntaxError as err: - print_err('%s is *NOT* XML valid!' % (xmlfile)) - if verbose: - print format(err) - return False - else: - print_err('Plugins website configuration file has not been found!') - return False - -def main(): - """ - Main method - """ - global verbose, tagrefs, force, extra, assume_yes, sign, plugin_name, github, gh_cred_file - - parser = argparse.ArgumentParser(description='GLPi plugins release script', version=script_version) - group = parser.add_mutually_exclusive_group() - group.add_argument( - '-r', - '--release', - help='Version to release' - ) - parser.add_argument( - '-g', - '--nogithub', - help="DO NOT Create github draft release", - action='store_false' - ) - parser.add_argument( - '-C', - '--check-only', - help="Only do chec, does not release anything", - action='store_true' - ) - group.add_argument( - '-p', - '--propose', - help='Calculate and propose next possible versions', - action='store_true' - ) - parser.add_argument( - '-c', - '--commit', - help='Specify commit to archive (-v required)' - ) - parser.add_argument( - '-e', - '--extra', - help='Extra version informations (-c required)' - ) - parser.add_argument( - '-m', - '--compile-mo', - help="Compile MO files from PO files (exclusive)", - action='store_true' - ) - parser.add_argument( - '-M', - '--minify', - help="Minify CSS ans JS files", - action='store_true' - ) - parser.add_argument( - '-S', - '--nosign', - help="Do not sign release tarball", - action="store_false" - ) - parser.add_argument( - '-Y', - '--assume-yes', - help='Assume YES to all questions. Be sure to understand what you are doing!', - action='store_true' - ) - parser.add_argument( - '-V', - '--verbose', - help='Be more verbose', - action="store_true" - ) - parser.add_argument('-f', action='store_true') - args = parser.parse_args() - - verbose=args.verbose - sign=args.nosign - github=args.nogithub - - if verbose: - print args - - if github: - import github - gh_cred_file = os.path.join(plugin_dir, '.gh_token') - if not os.path.exists(gh_cred_file): - print_err('GitHub credential file does not exists! Either create it or use the --nogithub option.') - sys.exit(1) - - plugin_name = guess_plugin_name() - - plugin_repo = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - repo = git.Repo(plugin_repo) - tagrefs = repo.tags - - if args.f == True: - force = ask_user_confirm( - 'Are you *REALLY* sure you mean -f when you typed -f? [yes/No] ' - ) - assume_yes=args.assume_yes - - if args.check_only: - print '*** Entering *check-only* mode ***' - - #check if dist_dir exists - if not os.path.exists(dist_dir): - os.makedirs(dist_dir) - - build = False - buildver = None - if args.compile_mo or args.minify: - if args.compile_mo: - compile_mo(plugin_repo) - if args.minify: - minify(plugin_repo) - elif (args.extra or args.commit) and (not args.extra or not args.commit or not args.release): - print_err('You have to specify --version --commit and --extra all together') - sys.exit(1) - elif args.commit and args.release and args.extra: - if valid_commit(repo, args.commit): - if verbose: - print 'Commit is valid' - build = True - buildver = args.release - extra = args.extra - else: - print_err('Invalid commit ref %s' % args.commit) - elif args.release: - if not valid_version(args.release): - print_err('%s is not a valid version number!' % args.release) - sys.exit(1) - else: - #check if specified version exists - if not is_existing_version(args.release): - print_err('%s does not exist!' % args.release) - else: - build = True - buildver = args.release - elif args.propose: - propose_version() - else: - buildver = get_latest_version() - if force: - build = True - else: - build = ask_user_confirm( - 'Do you want to build version %s? [Yes/no] ' % buildver - ) - - if build: - if check_version(buildver) and args.check_only == False: - _do_build(repo, buildver) - -if __name__ == "__main__": - main() From 9a3806eae95e8a97d67148186e0e5651fbb03ebd Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 8 Feb 2017 12:03:14 +0100 Subject: [PATCH 09/40] CS fixes (from phpcbf) --- css/styles.css | 1 - front/commondropdown.form.php | 2 +- front/commondropdown.php | 2 +- front/commontreedropdown.form.php | 2 +- front/familylist.php | 2 +- front/field.form.php | 2 +- front/object.form.php | 4 +-- front/profile.form.php | 8 ++--- hook.php | 10 +++--- inc/autoload.php | 21 +++++------- inc/commondropdown.class.php | 4 +-- inc/commontreedropdown.class.php | 4 +-- inc/field.class.php | 30 +++++++++--------- inc/functions.php | 15 ++++----- inc/object.class.php | 37 +++++++++++----------- inc/object_item.class.php | 8 ++--- inc/profile.class.php | 24 +++++++------- inc/singletonobjectfield.class.php | 1 - inc/type.class.php | 51 ++++++++++++++---------------- inc/typefamily.class.php | 2 +- index.php | 12 +++---- setup.php | 22 ++++++------- 22 files changed, 126 insertions(+), 138 deletions(-) diff --git a/css/styles.css b/css/styles.css index 09214aa0..2881af8f 100644 --- a/css/styles.css +++ b/css/styles.css @@ -61,4 +61,3 @@ .genericobject_type_profiles tr > td { width : 10%; } - diff --git a/front/commondropdown.form.php b/front/commondropdown.form.php index d0785d97..9a15312c 100644 --- a/front/commondropdown.form.php +++ b/front/commondropdown.form.php @@ -27,7 +27,7 @@ include ("../../../inc/includes.php"); -if ( isset($_REQUEST['itemtype']) ) { +if (isset($_REQUEST['itemtype'])) { $itemtype = $_REQUEST['itemtype']; if (class_exists($itemtype)) { $dropdown = new $itemtype(); diff --git a/front/commondropdown.php b/front/commondropdown.php index 6f5ecec8..e516cc98 100644 --- a/front/commondropdown.php +++ b/front/commondropdown.php @@ -2,7 +2,7 @@ include ("../../../inc/includes.php"); -if ( isset($_REQUEST['itemtype']) ) { +if (isset($_REQUEST['itemtype'])) { $itemtype = $_REQUEST['itemtype']; if (class_exists($itemtype)) { $dropdown = new $itemtype(); diff --git a/front/commontreedropdown.form.php b/front/commontreedropdown.form.php index d0785d97..9a15312c 100644 --- a/front/commontreedropdown.form.php +++ b/front/commontreedropdown.form.php @@ -27,7 +27,7 @@ include ("../../../inc/includes.php"); -if ( isset($_REQUEST['itemtype']) ) { +if (isset($_REQUEST['itemtype'])) { $itemtype = $_REQUEST['itemtype']; if (class_exists($itemtype)) { $dropdown = new $itemtype(); diff --git a/front/familylist.php b/front/familylist.php index a7b43ded..591bd556 100644 --- a/front/familylist.php +++ b/front/familylist.php @@ -34,7 +34,7 @@ "genericobject"); echo "
"; - echo ""; + echo ""; echo "
".__("Empty family","genericobject")."
".__("Empty family", "genericobject")."
"; } else { $family->getFromDB($_GET['id']); diff --git a/front/field.form.php b/front/field.form.php index 32bfd2da..6b0cc167 100644 --- a/front/field.form.php +++ b/front/field.form.php @@ -36,7 +36,7 @@ foreach ($_POST["fields"] as $field => $value) { if ($type->can($_POST["id"], PURGE) && $value == 1 - && PluginGenericobjectField::checkNecessaryFieldsDelete($itemtype, $field)) { + && PluginGenericobjectField::checkNecessaryFieldsDelete($itemtype, $field)) { PluginGenericobjectField::deleteField(getTableForItemType($itemtype), $field); Session::addMessageAfterRedirect(__("Field(s) deleted successfully", "genericobject"), true, INFO); } diff --git a/front/object.form.php b/front/object.form.php index dacf6504..8105cc2f 100644 --- a/front/object.form.php +++ b/front/object.form.php @@ -38,7 +38,7 @@ $requested_type = $_REQUEST['itemtype']; $error = array(); - if (!in_array($requested_type, $types) ){ + if (!in_array($requested_type, $types)) { $error[] = __('The requested type has not been defined yet!'); if (!PluginGenericobjectType::canCreate()) { $error[] = __('Please ask your administrator to create this type of object'); @@ -48,7 +48,7 @@ $error[]= __('You might need to regenerate the files under '.GENERICOBJECT_DOC_DIR.'.'); } - if(count($error) > 0) { + if (count($error) > 0) { Html::header(__('Type not found!')); Html::displayErrorAndDie(implode('
', $error)); diff --git a/front/profile.form.php b/front/profile.form.php index e454d783..aeef17b0 100644 --- a/front/profile.form.php +++ b/front/profile.form.php @@ -26,7 +26,7 @@ ---------------------------------------------------------------------- */ include ("../../../inc/includes.php"); -Session::checkRight("profile",UPDATE); +Session::checkRight("profile", UPDATE); _log($_POST); $prof = new Profile(); @@ -34,8 +34,8 @@ /* save profile */ if (isset($_POST['update_all_rights']) && isset($_POST['itemtype'])) { $profiles = array(); - foreach($_POST as $key => $val) { - if (preg_match("/^profile_/", $key) ){ + foreach ($_POST as $key => $val) { + if (preg_match("/^profile_/", $key)) { $id = preg_replace("/^profile_/", "", $key); $profiles[$id] = array( "id" => $id, @@ -44,7 +44,7 @@ } } _log($profiles); - foreach( $profiles as $profile_id => $input) { + foreach ($profiles as $profile_id => $input) { $prof->update($input); } } diff --git a/hook.php b/hook.php index 8eb7dfd6..98e0aa0f 100644 --- a/hook.php +++ b/hook.php @@ -113,8 +113,7 @@ function plugin_genericobject_install() { $migration = new Migration('0.85+1.1'); - foreach ( - array( + foreach (array( 'PluginGenericobjectField', 'PluginGenericobjectCommonDropdown', 'PluginGenericobjectCommonTreeDropdown', @@ -129,7 +128,7 @@ function plugin_genericobject_install() { $item = strtolower($plug['class']); if (file_exists("$dir$item.class.php")) { include_once ("$dir$item.class.php"); - if ( method_exists($itemtype, 'install') ) { + if (method_exists($itemtype, 'install')) { $itemtype::install($migration); } } @@ -168,8 +167,7 @@ function plugin_genericobject_uninstall() { } } - foreach ( - array( + foreach (array( 'PluginGenericobjectType', 'PluginGenericobjectProfile', 'PluginGenericobjectField', @@ -202,7 +200,7 @@ function plugin_genericobject_uninstall() { function plugin_datainjection_populate_genericobject() { global $INJECTABLE_TYPES; $type = new PluginGenericobjectType(); - foreach($type->find("`use_plugin_datainjection`='1' AND `is_active`='1'") as $data) { + foreach ($type->find("`use_plugin_datainjection`='1' AND `is_active`='1'") as $data) { if (class_exists($data ['itemtype']."Injection")) { $INJECTABLE_TYPES[$data ['itemtype']."Injection"] = 'genericobject'; } diff --git a/inc/autoload.php b/inc/autoload.php index 8b179577..da0d171e 100644 --- a/inc/autoload.php +++ b/inc/autoload.php @@ -6,15 +6,13 @@ class PluginGenericobjectAutoloader implements SplAutoloader { protected $paths = array(); - public function __construct($options = null) - { + public function __construct($options = null) { if (null !== $options) { $this->setOptions($options); } } - public function setOptions($options) - { + public function setOptions($options) { if (!is_array($options) && !($options instanceof \Traversable)) { throw new \InvalidArgumentException(); } @@ -27,9 +25,8 @@ public function setOptions($options) return $this; } - public function processClassname($classname) - { - preg_match("/Plugin([A-Z][a-z0-9]+)([A-Z]\w+)/",$classname,$matches); + public function processClassname($classname) { + preg_match("/Plugin([A-Z][a-z0-9]+)([A-Z]\w+)/", $classname, $matches); if (count($matches) < 3) { return false; @@ -39,15 +36,14 @@ public function processClassname($classname) } - public function autoload($classname) - { + public function autoload($classname) { $matches = $this->processClassname($classname); - if($matches !== false) { + if ($matches !== false) { $plugin_name = strtolower($matches[1]); $class_name = strtolower($matches[2]); - if ( $plugin_name !== "genericobject" ) { + if ($plugin_name !== "genericobject") { return false; } @@ -67,8 +63,7 @@ public function autoload($classname) return false; } - public function register() - { + public function register() { spl_autoload_register(array($this, 'autoload')); } } diff --git a/inc/commondropdown.class.php b/inc/commondropdown.class.php index c725878f..dc71daa6 100644 --- a/inc/commondropdown.class.php +++ b/inc/commondropdown.class.php @@ -30,7 +30,7 @@ class PluginGenericobjectCommonDropdown extends CommonDropdown { //Get itemtype name static function getTypeName($nb=0) { $class=get_called_class(); - return dropdown_getTypeName($class,$nb); + return dropdown_getTypeName($class, $nb); } static function getFormURL($full=true) { @@ -38,7 +38,7 @@ static function getFormURL($full=true) { "?itemtype=".get_called_class(); } static function getSearchURL($full=true) { - return Toolbox::getItemTypeSearchURL( get_parent_class(get_called_class()) , $full) . + return Toolbox::getItemTypeSearchURL( get_parent_class(get_called_class()), $full) . "?itemtype=".get_called_class(); } diff --git a/inc/commontreedropdown.class.php b/inc/commontreedropdown.class.php index c14d4b9d..ed780d9d 100644 --- a/inc/commontreedropdown.class.php +++ b/inc/commontreedropdown.class.php @@ -30,7 +30,7 @@ class PluginGenericobjectCommonTreeDropdown extends CommonTreeDropdown { //Get itemtype name static function getTypeName($nb=0) { $class=get_called_class(); - return dropdown_getTypeName($class,$nb); + return dropdown_getTypeName($class, $nb); } static function getFormURL($full=true) { @@ -40,7 +40,7 @@ static function getFormURL($full=true) { } static function getSearchURL($full=true) { _log("PluginGenericobjectCommonTreeDropdown::getSearchURL", get_parent_class(get_called_class())); - return Toolbox::getItemTypeSearchURL( get_parent_class(get_called_class()) , $full) . + return Toolbox::getItemTypeSearchURL( get_parent_class(get_called_class()), $full) . "?itemtype=".get_called_class(); } diff --git a/inc/field.class.php b/inc/field.class.php index 9f36aa40..0e3daf18 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -112,7 +112,7 @@ public static function showObjectFieldsForm($id) { echo $dropdownFields; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; } @@ -156,7 +156,7 @@ static function getFieldName($field, $itemtype, $options, $remove_prefix = false $input_type = isset($options['input_type']) ? $options['input_type'] : null; - switch($input_type) { + switch ($input_type) { case 'dropdown': $dropdown_type = isset($options['dropdown_type']) @@ -164,26 +164,26 @@ static function getFieldName($field, $itemtype, $options, $remove_prefix = false : null; $fk = getForeignKeyFieldForTable(getTableForItemType($itemtype)); - if ( $dropdown_type == 'isolated' ) { + if ($dropdown_type == 'isolated') { if (!$remove_prefix) { - $field = preg_replace("/s_id$/",$field, $fk); + $field = preg_replace("/s_id$/", $field, $fk); } else { - $fk = preg_replace("/s_id$/","", $fk); - $field = preg_replace("/".$fk."/","", $field); + $fk = preg_replace("/s_id$/", "", $fk); + $field = preg_replace("/".$fk."/", "", $field); } } $field_table = getTableNameForForeignKeyField($field); //Prepend plugin's table prefix if this dropdown is not already handled by GLPI natively - if ( - substr($field, 0, strlen('plugin_genericobject')) !== 'plugin_genericobject' + if (substr($field, 0, strlen('plugin_genericobject')) !== 'plugin_genericobject' and ( substr($field_table, strlen('glpi_')) - === substr($field, 0, strlen($field) -strlen('_id')) + === substr($field, 0, strlen($field) -strlen('_id')) ) and !TableExists($field_table) ) { - if (!$remove_prefix) { $field = 'plugin_genericobject_' . $field;} + if (!$remove_prefix) { + $field = 'plugin_genericobject_' . $field;} } break; @@ -209,7 +209,7 @@ static function dropdownFields($name,$itemtype, $used = array()) { $message = ""; $field_options = array(); $field = self::getFieldName($field, $itemtype, $values, false); - if(!in_array($field, $used)) { + if (!in_array($field, $used)) { if (!isset($dropdown_types[$field])) { //Global management : //meaning that a dropdown can be useful in all types (for example type, model, etc.) @@ -236,7 +236,7 @@ static function dropdownFields($name,$itemtype, $used = array()) { //} } if (!empty($field_options)) { - $message = "(".trim( implode(", ",$field_options)).")"; + $message = "(".trim( implode(", ", $field_options)).")"; } } $dropdown_types[$field] = $values['name']." ".$message; @@ -265,7 +265,7 @@ static function dropdownFields($name,$itemtype, $used = array()) { static function getFieldOptions($field, $itemtype="") { global $GO_FIELDS; - $cleaned_field = preg_replace("/^plugin_genericobject_/",'', $field); + $cleaned_field = preg_replace("/^plugin_genericobject_/", '', $field); if (!isset($GO_FIELDS[$cleaned_field]) && !empty($itemtype)) { // This field has been dynamically defined because it's an isolated dropdown $tmpfield = self::getFieldName( @@ -379,7 +379,7 @@ public static function addNewField($table, $field, $after=false) { if ($table != '' && !TableExists($table)) { //Cannot use standard methods because class doesn't exists yet ! - $name = str_replace("glpi_plugin_genericobject_","", $table); + $name = str_replace("glpi_plugin_genericobject_", "", $table); $name = getSingular($name); $options['linked_itemtype'] = $itemtype; @@ -432,7 +432,7 @@ static function deleteDisplayPreferences($table, $field) { $itemtype = getItemTypeForTable($table); $searchopt = Search::getCleanedOptions($itemtype); foreach ($searchopt as $num => $option) { - if ( (isset($option['field']) && ($option['field'] == $field)) + if ((isset($option['field']) && ($option['field'] == $field)) || (isset($option['field']) && $option['linkfield'] == $field)) { $criteria = array('itemtype' => $itemtype, 'num' => $num); $pref->deleteByCriteria($criteria); diff --git a/inc/functions.php b/inc/functions.php index cca61391..d6afcc42 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -19,7 +19,7 @@ function dropdown_getTypeName($class,$nb=0) { $linked_itemtype_object = new $instance->linked_itemtype(); $label .= " (" . __($linked_itemtype_object::getTypeName(), 'genericobject') . ")"; } - if($label != '') { + if ($label != '') { return $label; } else { return $class; @@ -50,15 +50,14 @@ function _log() { $msg = _format_trace($trace, func_get_args()); $msg .= "\n"; $show_log = false; - if ( - !is_null($caller) and + if (!is_null($caller) and isset($caller['class']) and in_array($caller['class'], $LOG_FILTER) ) { $callee = array_shift($trace); $show_log = true; } - if ( in_array($filename, $LOG_FILTER) ) { + if (in_array($filename, $LOG_FILTER)) { $show_log = true; } if ($show_log) { @@ -71,7 +70,7 @@ function _format_trace($bt, $args) { $msg = ""; $msg = "From \n"; if (count($bt) > 0) { - foreach(array_reverse($bt) as $idx => $trace) { + foreach (array_reverse($bt) as $idx => $trace) { $msg .= sprintf(" [%d] ", $idx); if (isset($trace['class'])) { $msg .= $trace['class'].'::'; @@ -85,13 +84,13 @@ function _format_trace($bt, $args) { } if ($tps && function_exists('memory_get_usage')) { - $msg .= ' ('.number_format(microtime(true)-$tps,3).'", '. - number_format(memory_get_usage()/1024/1024,2).'Mio)'; + $msg .= ' ('.number_format(microtime(true)-$tps, 3).'", '. + number_format(memory_get_usage()/1024/1024, 2).'Mio)'; } $msg .= "\n "; foreach ($args as $arg) { if (is_array($arg) || is_object($arg)) { - $msg .= " ".str_replace("\n", "\n ",print_r($arg, true)); + $msg .= " ".str_replace("\n", "\n ", print_r($arg, true)); } else if (is_null($arg)) { $msg .= 'NULL '; } else if (is_bool($arg)) { diff --git a/inc/object.class.php b/inc/object.class.php index 4a28c9a7..92b64abc 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -37,13 +37,13 @@ static function getTypeName($nb=0) { global $LANG; $class = get_called_class(); //Datainjection : Don't understand why I need this trick : need to be investigated ! - if(preg_match("/Injection$/i",$class)) { + if (preg_match("/Injection$/i", $class)) { $class = str_replace("Injection", "", $class); } $item = new $class(); //Itemtype name can be contained in a specific locale field : try to load it PluginGenericobjectType::includeLocales($item->objecttype->fields['name']); - if(isset($LANG['genericobject'][$class][0])) { + if (isset($LANG['genericobject'][$class][0])) { $type_name = $LANG['genericobject'][$class][0]; } else { $type_name = $item->objecttype->fields['name']; @@ -137,7 +137,7 @@ static function registerType() { //Add configuration icon, if user has right if (Session::haveRight('config', UPDATE)) { $PLUGIN_HOOKS['submenu_entry']['genericobject']['options'][$class]['links']['config'] - = Toolbox::getItemTypeSearchURL('PluginGenericobjectType',false)."?itemtype=$class"; + = Toolbox::getItemTypeSearchURL('PluginGenericobjectType', false)."?itemtype=$class"; } if ($item->canUsePluginUninstall()) { @@ -196,9 +196,9 @@ static function registerType() { } } - foreach(PluginGenericobjectType::getDropdownForItemtype($class) as $table) { + foreach (PluginGenericobjectType::getDropdownForItemtype($class) as $table) { $itemtype = getItemTypeForTable($table); - if (class_exists($itemtype) ) { + if (class_exists($itemtype)) { $item = new $itemtype(); //If entity dropdown, check rights to view & create if ($itemtype::canView()) { @@ -223,12 +223,12 @@ static function getMenuIcon($itemtype) { ); $finfo = new finfo(FILEINFO_MIME); $icon_found = null; - foreach($itemtype_icons as $icon) { - if ( preg_match("|^image/|", $finfo->file($icon)) ) { + foreach ($itemtype_icons as $icon) { + if (preg_match("|^image/|", $finfo->file($icon))) { $icon_found = preg_replace("|^".GLPI_ROOT."|", "", $icon); } } - if ( !is_null($icon_found)) { + if (!is_null($icon_found)) { $icon_path = $CFG_GLPI['root_doc'] . $icon_found; } else { $icon_path = $CFG_GLPI['root_doc'] . $default_icon; @@ -241,19 +241,19 @@ static function getMenuIcon($itemtype) { } static function checkItemtypeRight($class = null, $right) { - if (!is_null($class) and class_exists($class) ) { + if (!is_null($class) and class_exists($class)) { $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( $class ); - return Session::haveRight($right_name,$right); + return Session::haveRight($right_name, $right); } } static function canCreate() { $class = get_called_class(); //Datainjection : Don't understand why I need this trick : need to be investigated ! - if(preg_match("/Injection$/i",$class)) { + if (preg_match("/Injection$/i", $class)) { $class = str_replace("Injection", "", $class); } return static::checkItemtypeRight($class, CREATE); @@ -317,7 +317,7 @@ function defineTabs($options=array()) { } if ($this->canUseHistory()) { - $this->addStandardTab('Log',$ong, $options); + $this->addStandardTab('Log', $ong, $options); } } return $ong; @@ -463,7 +463,7 @@ function showForm($id, $options=array(), $previsualisation = false) { } $this->fields['id'] = $id; - $this->initForm($id,$options); + $this->initForm($id, $options); $this->showFormHeader($options); if ($previsualisation) { @@ -541,7 +541,7 @@ function displayField($canedit, $name, $value, $template, $description = array() if ($dropdown->maybeRecursive()) { $parameters['entity_sons'] = true; } - if(isset($searchoption['condition'])) { + if (isset($searchoption['condition'])) { $parameters['condition'] = $searchoption['condition']; } if ($dropdown instanceof User) { @@ -753,8 +753,7 @@ function getObjectSearchOptions() { $table = getTableForItemType(get_called_class()); - foreach ( - PluginGenericobjectSingletonObjectField::getInstance(get_called_class()) + foreach (PluginGenericobjectSingletonObjectField::getInstance(get_called_class()) as $field => $values ) { $searchoption = PluginGenericobjectField::getFieldOptions( @@ -771,7 +770,7 @@ function getObjectSearchOptions() { $currentindex++; } - if (in_array($field,array('is_deleted'))) { + if (in_array($field, array('is_deleted'))) { continue; } @@ -1028,7 +1027,7 @@ static function showMassiveActionsSubForm(MassiveAction $ma) { case "plugin_genericobject_transfer" : Dropdown::show('Entity', array('name' => 'new_entity')); echo " "; + _sx('button', 'Post') . "\" >"; break; default : break; @@ -1080,7 +1079,7 @@ static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBT static function getMenuContent() { $types = PluginGenericobjectType::getTypes(); - foreach($types as $type) { + foreach ($types as $type) { $itemtype = $type['itemtype']; $item = new $itemtype(); diff --git a/inc/object_item.class.php b/inc/object_item.class.php index 04272efc..e889438a 100644 --- a/inc/object_item.class.php +++ b/inc/object_item.class.php @@ -41,13 +41,13 @@ static function getTypeName($nb=0) { global $LANG; $class = get_called_class(); //Datainjection : Don't understand why I need this trick : need to be investigated ! - if(preg_match("/Injection$/i",$class)) { + if (preg_match("/Injection$/i", $class)) { $class = str_replace("Injection", "", $class); } $item = new $class(); //Itemtype name can be contained in a specific locale field : try to load it PluginGenericobjectType::includeLocales($item->objecttype->fields['name']); - if(isset($LANG['genericobject'][$class][0])) { + if (isset($LANG['genericobject'][$class][0])) { return $LANG['genericobject'][$class][0]; } else { return $item->objecttype->fields['name']; @@ -55,11 +55,11 @@ static function getTypeName($nb=0) { } static function canView() { - return Session::haveRight($this->$itemtype_1, READ); + return Session::haveRight(self::$itemtype_1, READ); } static function canCreate() { - return Session::haveRight($this->$itemtype_1, CREATE); + return Session::haveRight(self::$itemtype_1, CREATE); } /** diff --git a/inc/profile.class.php b/inc/profile.class.php index ca2116fc..7b2d43d0 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -34,7 +34,7 @@ function cleanProfiles($id) { function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { - switch($item->getType()) { + switch ($item->getType()) { case 'Profile': return self::createTabEntry(__('Objects management', 'genericobject')); break; @@ -45,7 +45,7 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { - switch($item->getType()) { + switch ($item->getType()) { case 'Profile': $profile = new self(); $profile->showForm($item->getID()); @@ -110,7 +110,7 @@ static function showForItemtype($type) { } static function getProfileNameForItemtype($itemtype) { - return preg_replace("/^glpi_/","",getTableForItemType($itemtype)); + return preg_replace("/^glpi_/", "", getTableForItemType($itemtype)); } @@ -189,7 +189,9 @@ function getProfilesFromDB($id, $config = true) { } } - if (empty($prof_datas) && !$config) return false; + if (empty($prof_datas) && !$config) { + return false; + } $prof_datas['profiles_id'] = $id; $this->fields = $prof_datas; @@ -235,7 +237,7 @@ function saveProfileToDB($params) { */ public static function createFirstAccess() { if (!self::profileExists($_SESSION["glpiactiveprofile"]["id"], 'PluginGenericobjectType')) { - self::createAccess($_SESSION["glpiactiveprofile"]["id"],"PluginGenericobjectType",true); + self::createAccess($_SESSION["glpiactiveprofile"]["id"], "PluginGenericobjectType", true); } } @@ -250,7 +252,7 @@ public static function profileExists($profiles_id, $itemtype = false) { $profile->getFromDB($profiles_id); $rights = ProfileRight::getProfileRights($profiles_id); $itemtype_rightname = self::getProfileNameForItemtype($itemtype); - if($itemtype) { + if ($itemtype) { _log( "get rights on itemtype ".$itemtype." for profile ".$profile->fields['name'], ':', isset($rights[$itemtype_rightname]) ? $rights[$itemtype_rightname] : "NONE" @@ -298,7 +300,7 @@ public static function getTypesRights() { include_once(GLPI_ROOT."/plugins/genericobject/inc/type.class.php"); $types = PluginGenericobjectType::getTypes(true); - if ( count( $types) > 0 ) { + if (count( $types) > 0) { foreach ($types as $_ => $type) { $itemtype = $type['itemtype']; $field = self::getProfileNameForItemtype($itemtype); @@ -324,21 +326,21 @@ public static function installRights($first=false) { // Add types' rights $types = PluginGenericobjectType::getTypes(true); - foreach($types as $_ => $type) { + foreach ($types as $_ => $type) { $itemtype = $type['itemtype']; $right_names[] = self::getProfileNameForItemtype($itemtype); } // Check for already defined rights - foreach($right_names as $right_name) { + foreach ($right_names as $right_name) { _log($right_name, isset($installed_rights[$right_name])); - if ( !isset($installed_rights[$right_name]) ) { + if (!isset($installed_rights[$right_name])) { $missing_rights[] = $right_name; } } //Install missing rights in profile and update the object - if ( count($missing_rights) > 0) { + if (count($missing_rights) > 0) { ProfileRight::addProfileRights($missing_rights); self::changeProfile(); } diff --git a/inc/singletonobjectfield.class.php b/inc/singletonobjectfield.class.php index 04efaae9..0ca826b1 100644 --- a/inc/singletonobjectfield.class.php +++ b/inc/singletonobjectfield.class.php @@ -52,7 +52,6 @@ public static function getInstance($itemtype, $reload = false) { global $DB; if (!isset(self::$_dbfields[$itemtype]) || $reload) { self::$_dbfields[$itemtype] = $DB->list_fields(getTableForItemType($itemtype)); - } else { } return self::$_dbfields[$itemtype]; } diff --git a/inc/type.class.php b/inc/type.class.php index f304f65b..d77274e0 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -80,28 +80,28 @@ static function canPurge() { $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( __CLASS__ ); - return Session::haveRight($right_name,PURGE); + return Session::haveRight($right_name, PURGE); } static function canCreate() { $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( __CLASS__ ); - return Session::haveRight($right_name,CREATE); + return Session::haveRight($right_name, CREATE); } static function canView() { $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( __CLASS__ ); - return Session::haveRight($right_name,READ); + return Session::haveRight($right_name, READ); } static function canUpdate() { $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( __CLASS__ ); - return Session::haveRight($right_name,UPDATE); + return Session::haveRight($right_name, UPDATE); } function getFromDBByType($itemtype) { global $DB; @@ -189,7 +189,7 @@ function prepareInputForAdd($input) { } //Name must start with a letter - if (!preg_match("/^[a-zA-Z]+/i",$input['name'])) { + if (!preg_match("/^[a-zA-Z]+/i", $input['name'])) { Session::addMessageAfterRedirect(__("Type must start with a letter", "genericobject"), ERROR, true); return array(); } @@ -322,32 +322,32 @@ function getSearchOptions() { $sopt[9]['table'] = $this->getTable(); $sopt[9]['field'] = 'use_history'; - $sopt[9]['name'] = _sx('button','Use')." ".__("Historical"); + $sopt[9]['name'] = _sx('button', 'Use')." ".__("Historical"); $sopt[9]['datatype'] = 'bool'; $sopt[13]['table'] = $this->getTable(); $sopt[13]['field'] = 'use_infocoms'; - $sopt[13]['name'] = _sx('button','Use')." ".__("Financial and administratives information"); + $sopt[13]['name'] = _sx('button', 'Use')." ".__("Financial and administratives information"); $sopt[13]['datatype'] = 'bool'; $sopt[14]['table'] = $this->getTable(); $sopt[14]['field'] = 'use_documents'; - $sopt[14]['name'] = _sx('button','Use')." "._n("Document", "Documents", 2); + $sopt[14]['name'] = _sx('button', 'Use')." "._n("Document", "Documents", 2); $sopt[14]['datatype'] = 'bool'; $sopt[15]['table'] = $this->getTable(); $sopt[15]['field'] = 'use_loans'; - $sopt[15]['name'] = _sx('button','Use')." "._n("Reservation", "Reservations", 2); + $sopt[15]['name'] = _sx('button', 'Use')." "._n("Reservation", "Reservations", 2); $sopt[15]['datatype'] = 'bool'; $sopt[16]['table'] = $this->getTable(); $sopt[16]['field'] = 'use_contracts'; - $sopt[16]['name'] = _sx('button','Use')." "._n("Contract", "Contracts", 2); + $sopt[16]['name'] = _sx('button', 'Use')." "._n("Contract", "Contracts", 2); $sopt[16]['datatype'] = 'bool'; $sopt[17]['table'] = $this->getTable(); $sopt[17]['field'] = 'use_unicity'; - $sopt[17]['name'] = _sx('button','Use')." ".__("Fields unicity"); + $sopt[17]['name'] = _sx('button', 'Use')." ".__("Fields unicity"); $sopt[17]['datatype'] = 'bool'; $sopt[18]['table'] = $this->getTable(); @@ -469,15 +469,14 @@ function showBehaviorForm($ID, $options=array()) { echo ""; if (!$ID) { echo __("No"); - } - else { + } else { Dropdown::showYesNo("is_active", $this->fields["is_active"]); } echo ""; echo ""; echo ""; - echo "".__("Family of type of objects",'genericobject').""; + echo "".__("Family of type of objects", 'genericobject').""; echo ""; PluginGenericobjectTypeFamily::dropdown( array('value' => $this->fields["plugin_genericobject_typefamilies_id"])); @@ -525,7 +524,7 @@ function showBehaviorForm($ID, $options=array()) { if (!$odd) { echo ""; } - echo "" . _sx('button','Use') . " " . $label . ""; + echo "" . _sx('button', 'Use') . " " . $label . ""; echo ""; switch ($right) { @@ -574,7 +573,7 @@ function showBehaviorForm($ID, $options=array()) { if (!$odd) { echo ""; } - echo "" . _sx('button','Use') . " " . $label . ""; + echo "" . _sx('button', 'Use') . " " . $label . ""; echo ""; switch ($right) { case 'use_plugin_datainjection' : @@ -756,7 +755,7 @@ static function addNewObject($name, $itemtype, $options = array()) { PluginGenericobjectProfile::installRights(); if ($params['create_default_profile']) { //Create rights for this new object - PluginGenericobjectProfile::createAccess($_SESSION["glpiactiveprofile"]["id"], $itemtype,true); + PluginGenericobjectProfile::createAccess($_SESSION["glpiactiveprofile"]["id"], $itemtype, true); //Reload profiles PluginGenericobjectProfile::changeProfile(); } @@ -1208,16 +1207,15 @@ static function checkClassAndFilesForOneItemType($itemtype, $name, $overwrite = $dropdownclass = getItemTypeForTable($dropdowntable); if (TableExists($dropdowntable) && ! class_exists($dropdownclass)) { - $name = str_replace("glpi_plugin_genericobject_","", $dropdowntable); + $name = str_replace("glpi_plugin_genericobject_", "", $dropdowntable); $name = getSingular($name); $params= PluginGenericobjectField::getFieldOptions($field, $dropdownclass); - if ( - isset($params['dropdown_type']) + if (isset($params['dropdown_type']) and $params['dropdown_type'] === 'isolated' ) { $params['linked_itemtype'] = $itemtype; } - self::addNewDropdown($name, 'PluginGenericobject'.ucfirst($name),$params); + self::addNewDropdown($name, 'PluginGenericobject'.ucfirst($name), $params); } } } @@ -1232,7 +1230,7 @@ static function checkClassAndFilesForOneItemType($itemtype, $name, $overwrite = static function deleteItemTypeFilesAndClasses($name, $table, $itemtype) { global $DB; - _log("Delete Type",array( + _log("Delete Type", array( "table"=>$table, "name"=>$name, "itemtype" => $itemtype, @@ -1243,7 +1241,7 @@ static function deleteItemTypeFilesAndClasses($name, $table, $itemtype) { if (preg_match("/plugin_genericobject_(.*)_id/", $field, $results)) { $table = getTableNameForForeignKeyField($field); - if($table != getTableForItemType("PluginGenericobjectTypeFamily")) { + if ($table != getTableForItemType("PluginGenericobjectTypeFamily")) { self::deleteFilesAndClassesForOneItemtype(getSingular($results[1])); $DB->query("DROP TABLE IF EXISTS `$table`"); } @@ -1524,8 +1522,8 @@ static function filterInput($value) { //Itemtype must always be singular, otherwise it breaks when using GLPI's framework $value = getSingular($value); - $search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u"); - $replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u"); + $search = explode(",", "ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u"); + $replace = explode(",", "c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u"); $value = str_replace($search, $replace, $value); $value = preg_replace("/[^a-zA-Z0-9]/", '', $value); @@ -1665,8 +1663,7 @@ static function getDropdownForItemtype($itemtype) { foreach (PluginGenericobjectSingletonObjectField::getInstance($itemtype) as $field => $value) { $table = getTableNameForForeignKeyField($field); $options = PluginGenericobjectField::getFieldOptions($field, $itemtype); - if ( - isset($options['input_type']) + if (isset($options['input_type']) and $options['input_type'] === 'dropdown' and preg_match('/^glpi_plugin_genericobject/', $table) ) { diff --git a/inc/typefamily.class.php b/inc/typefamily.class.php index 63061858..73d9a4e0 100644 --- a/inc/typefamily.class.php +++ b/inc/typefamily.class.php @@ -76,7 +76,7 @@ static function getFamilies() { FROM glpi_plugin_genericobject_types WHERE is_active=1)"; $families = array(); - foreach($DB->request($query) as $fam) { + foreach ($DB->request($query) as $fam) { $itemtype = $fam['itemtype']; if ($itemtype::canCreate()) { $families[$fam['id']] = $fam['name']; diff --git a/index.php b/index.php index 96527c4f..d6e105aa 100644 --- a/index.php +++ b/index.php @@ -35,7 +35,7 @@ } else { $types = PluginGenericobjectType::getTypesByFamily(); foreach ($types as $family => $typeData) { - foreach($typeData as $ID => $value) { + foreach ($typeData as $ID => $value) { if (!Session::haveRight($value['itemtype'], READ)) { unset($types[$family][$ID]); } @@ -46,7 +46,7 @@ if (count($types) == 1) { //There's only one itemtype ? If yes, then automatically //redirect to the search engine - if(key($types) == NULL) { + if (key($types) == NULL) { $mytypes = $types; $tmp = array_pop($mytypes); if (count($tmp) == 1) { @@ -58,21 +58,21 @@ Html::header(__("Objects management", "genericobject"), $_SERVER['PHP_SELF'], "plugins", "genericobject"); - foreach($types as $family => $typeData) { + foreach ($types as $family => $typeData) { $PluginGenericobjectTypefamily = new PluginGenericobjectTypefamily(); $PluginGenericobjectTypefamily->getFromDB($family); echo ""; - if($family == 0) { - echo ""; + if ($family == 0) { + echo ""; } else { echo ""; } if (!count($types)) { echo ""; } else { - foreach($typeData as $ID => $value) { + foreach ($typeData as $ID => $value) { echo "
".__("Empty family","genericobject")."
".__("Empty family", "genericobject")."
".$PluginGenericobjectTypefamily->getField("name")."
".__("No item to display")."
"; echo ""; $itemtype = $value['itemtype']; diff --git a/setup.php b/setup.php index 7547726e..4e98dcf6 100644 --- a/setup.php +++ b/setup.php @@ -38,52 +38,52 @@ define ('PLUGIN_GENERICOBJECT_VERSION', '2.4.0'); if (!defined("GENERICOBJECT_DIR")) { - define("GENERICOBJECT_DIR",GLPI_ROOT . "/plugins/genericobject"); + define("GENERICOBJECT_DIR", GLPI_ROOT . "/plugins/genericobject"); } -if (!defined("GENERICOBJECT_DOC_DIR") ) { +if (!defined("GENERICOBJECT_DOC_DIR")) { define("GENERICOBJECT_DOC_DIR", GLPI_PLUGIN_DOC_DIR . "/genericobject"); - if(!file_exists(GENERICOBJECT_DOC_DIR)) { + if (!file_exists(GENERICOBJECT_DOC_DIR)) { mkdir(GENERICOBJECT_DOC_DIR); } } if (!defined("GENERICOBJECT_FRONT_PATH")) { define("GENERICOBJECT_FRONT_PATH", GENERICOBJECT_DOC_DIR."/front"); - if(!file_exists(GENERICOBJECT_FRONT_PATH)) { + if (!file_exists(GENERICOBJECT_FRONT_PATH)) { mkdir(GENERICOBJECT_FRONT_PATH); } } if (!defined("GENERICOBJECT_AJAX_PATH")) { define("GENERICOBJECT_AJAX_PATH", GENERICOBJECT_DOC_DIR . "/ajax"); - if(!file_exists(GENERICOBJECT_AJAX_PATH)) { + if (!file_exists(GENERICOBJECT_AJAX_PATH)) { mkdir(GENERICOBJECT_AJAX_PATH); } } if (!defined("GENERICOBJECT_CLASS_PATH")) { define("GENERICOBJECT_CLASS_PATH", GENERICOBJECT_DOC_DIR . "/inc"); - if(!file_exists(GENERICOBJECT_CLASS_PATH)) { + if (!file_exists(GENERICOBJECT_CLASS_PATH)) { mkdir(GENERICOBJECT_CLASS_PATH); } } if (!defined("GENERICOBJECT_LOCALES_PATH")) { define("GENERICOBJECT_LOCALES_PATH", GENERICOBJECT_DOC_DIR . "/locales"); - if(!file_exists(GENERICOBJECT_LOCALES_PATH)) { + if (!file_exists(GENERICOBJECT_LOCALES_PATH)) { mkdir(GENERICOBJECT_LOCALES_PATH); } } if (!defined("GENERICOBJECT_FIELDS_PATH")) { define("GENERICOBJECT_FIELDS_PATH", GENERICOBJECT_DOC_DIR . "/fields"); - if(!file_exists(GENERICOBJECT_FIELDS_PATH)) { + if (!file_exists(GENERICOBJECT_FIELDS_PATH)) { mkdir(GENERICOBJECT_FIELDS_PATH); } } if (!defined("GENERICOBJECT_PICS_PATH")) { define("GENERICOBJECT_PICS_PATH", GENERICOBJECT_DOC_DIR . "/pics"); - if(!file_exists(GENERICOBJECT_PICS_PATH)) { + if (!file_exists(GENERICOBJECT_PICS_PATH)) { mkdir(GENERICOBJECT_PICS_PATH); } } @@ -91,7 +91,7 @@ // Autoload class generated in files/_plugins/genericobject/inc/ include_once( GENERICOBJECT_DIR . "/inc/autoload.php"); include_once( GENERICOBJECT_DIR . "/inc/functions.php"); -if (file_exists(GENERICOBJECT_DIR . "/log_filter.settings.php") ){ +if (file_exists(GENERICOBJECT_DIR . "/log_filter.settings.php")) { include_once(GENERICOBJECT_DIR . "/log_filter.settings.php"); } @@ -202,7 +202,7 @@ function plugin_version_genericobject() { * @return boolean */ function plugin_genericobject_check_prerequisites() { - if (version_compare(GLPI_VERSION,'0.85.3','lt')) { + if (version_compare(GLPI_VERSION, '0.85.3', 'lt')) { echo "This plugin requires GLPI 0.85.3 or higher"; return false; } From cf14d3653a64681419bb0ca3c4d33f317491b540 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 8 Feb 2017 12:04:00 +0100 Subject: [PATCH 10/40] Default parameters values No need to have a default value, since calls always send something --- inc/object.class.php | 2 +- inc/type.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/object.class.php b/inc/object.class.php index 92b64abc..b48180d7 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -240,7 +240,7 @@ static function getMenuIcon($itemtype) { "/>"; } - static function checkItemtypeRight($class = null, $right) { + static function checkItemtypeRight($class, $right) { if (!is_null($class) and class_exists($class)) { $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( $class diff --git a/inc/type.class.php b/inc/type.class.php index d77274e0..3b5d795c 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -1045,7 +1045,7 @@ public static function deleteLocales($name, $itemtype) { } - public static function addFileFromTemplate($mappings = array(), $template, $directory, + public static function addFileFromTemplate($mappings, $template, $directory, $filename) { if (!empty($mappings)) { $file_read = @fopen(GENERICOBJECT_DIR.$template, "rt"); From f954952203e1d0375a8ac4b169742973486934bc Mon Sep 17 00:00:00 2001 From: dethegeek Date: Thu, 3 Nov 2016 14:15:18 +0100 Subject: [PATCH 11/40] Add an upgrade warning if the plugin cannot load clases in upgrade time --- inc/type.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inc/type.class.php b/inc/type.class.php index 3b5d795c..3b3c88ff 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -1926,6 +1926,15 @@ static function install(Migration $migration) { $notepad = new Notepad(); foreach ($allGenericObjectTypes as $genericObjectType => $genericObjectData) { + $itemtype = $genericObjectData['itemtype']; + if (! class_exists($itemtype, true)) { + // TRANS: %1$s is itemtype name + $warning = sprintf(__('Unable to load the class %1$s.', 'genericobject'), $itemtype); + // TRANS: %1$s is itemtype name + $warning .= sprintf(__('You probably have garbage data in your database for this plugin and missing files in %1$s', 'genericobject'), GENERICOBJECT_DOC_DIR); + $migration->displayWarning($warning, true); + die(); + } $genericObjectTypeInstance = new $genericObjectType(); if (FieldExists($genericObjectTypeInstance->getTable(), "notepad")) { $query = "INSERT INTO `" . $notepad->getTable() . "` From 98b8201e2783a7367cc9c8c82020fcc0e9db46d1 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 11:57:59 +0100 Subject: [PATCH 12/40] Prevent a minor translation issue; refs #48 --- inc/profile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/profile.class.php b/inc/profile.class.php index 7b2d43d0..b794f543 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -148,7 +148,7 @@ function showForm($profiles_id, $options = array()) { $title = __('Objects', 'genericobject'); if (count($types_rights) == 0) { - $title .= __(" (No types defined yet)", "genericobject"); + $title .= ' ' . __("(No types defined yet)", "genericobject"); } $profile->displayRightsChoiceMatrix( From 18a3c96f7238e15dd2d7e5ce02226ef10c88e55e Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 12:04:00 +0100 Subject: [PATCH 13/40] Update locales; fix #48 --- locales/en_GB.mo | Bin 2583 -> 511 bytes locales/es_ES.mo | Bin 0 -> 2677 bytes locales/es_ES.po | 144 +++++++++++++++++++++++++++++++++++++++++++++++ locales/fr_FR.mo | Bin 2764 -> 2709 bytes locales/it_IT.mo | Bin 0 -> 2609 bytes locales/ro_RO.mo | Bin 0 -> 2591 bytes locales/ro_RO.po | 144 +++++++++++++++++++++++++++++++++++++++++++++++ locales/tr_TR.mo | Bin 0 -> 2580 bytes 8 files changed, 288 insertions(+) create mode 100644 locales/es_ES.mo create mode 100644 locales/es_ES.po create mode 100644 locales/it_IT.mo create mode 100644 locales/ro_RO.mo create mode 100644 locales/ro_RO.po create mode 100644 locales/tr_TR.mo diff --git a/locales/en_GB.mo b/locales/en_GB.mo index 3a654265c8d0f9dc0add421ff216dced80a2e580..d3387b8fab9a78d19c92437d81559c5a2956e9a5 100644 GIT binary patch literal 511 zcmZ8e!A=`75CxUf9y#|gNIfKi$$D251xL96A&N?9gqHSLIlF^nzbxgtG>JP>9Am z3Dc{^3>J2yjRS-!ISQus%TAZwQ0qg&dDN!CvyF~ec?sF#dxhtLRN@ABp%O_bMR9`S z6pLdhN_ku!ic$y`;tf5RZqWa_uTTgnibKK3u2f7|1?8eu$p;BPl{F1q`^}1LPH&VZ ztVpdTOq{kRuAq18Ori$98K)b+?n7^tQY-U(yWI{_*UH?{*uHI` zeF=>E-?+Jb8l-95{Q3*1}Q~EgM^T1BTBw+_iR(7q@c)1b05#{d-LA+z1i{2lgFp-+`k0Cs6!<0Y&%k zpzMDO6x}mOO6=!A(R~RN-JgIjg5QG@=T}g4{{>3^B?N`++*j7p>l2tyV?Ki^J~E!i zl(T|z=K3YJ49N{gL7}aOL-a`vB#sQpSH=?sa-E`G>h&NdB;?uvDSNKxv@9_0Eud7D z!eqpxQ^z`)5bqlwJnfmVO<|kK>mifHkE-^1>^)`O_qi8THA%?w9`y~UiK=>^^^6Wo z!Sr?*8-xt*=FohZxAm^c#!khQ92$NOT)1b)MeUpCg^U;)Scuh?{SwryIpqkYAuf=PPt03$lt3q zNt|?&a6*2ZYwM3w*pxpl*4V`deR4ilcQ2iE3*#e*+CdeQBGB}ft}SUnS^aH zsF_oB-Q`r(jor!3QEPYLq?%H6C|q4uO%8jR+o4`&Eox*k>s1pGq-P2DjpanO@|MuZ z@vh;$>C)3sTRq?*BC0kI*s_xb^$p6XI^v%f&LGkck z1(Yq&uKWNDdy&l3M#|bV^|rGN&^9YHTUJ-IaghvE_RU}{Zf3Au z93!@QbLB7|D1;becOfiu6FVMuQM%$xC}ZVxqDr~W!>56Vv!2HAg4{IKxy95abIFna zhRbAwsFp-m*m-PJp^fUwJJt1=uEg!lTB})V^C)v6YWRUkqUG_xN1d!frHxi6TERyo zdq=A%b%oBC7hjIbm!k5kwD?NpLit?ze7Ow6sEtm^=2N??akU*aTG48i-fC4EwR7*a znsKSFeTX_vTaSe0Gg;fJ*Qr@;#B@1sRBQF6>gsAc-rRf>rgkt!v!f2{VTJ0|=K7YT ze7Rmx}sKfO*4?-H6`CezDOu95%fUik-r%)(Is diff --git a/locales/es_ES.mo b/locales/es_ES.mo new file mode 100644 index 0000000000000000000000000000000000000000..d496f460c2d2a9e9d458df5e98f68c725c3972ca GIT binary patch literal 2677 zcmZvdOK%)S5XTz`By7SfJQAKM3klnV@$TA66gEmk;@FYFaZIvFKp>&so!;FhGu=aX zk2lT@ZhQa`NF2zK0|#CbAUGg@0>p(ALYz3l5y*jm_3ZiqY3=TBdU~d->R;8hzwF=j zp1^nt-zV_hcbgE?;7yRn$F~b{0K5TCf!~1lfWLuvgMWbgz`wyq!QFQVaS)sUp9EXr z1o#TL8@vua2)+Z}3BC_L41NUGz|TkP--GvJ{v*im{R-{}e+Tae{{f!?_wB0e%z+PK z{xWzU*aKe#*T6dX1IYgU39`MtFwXH#fb9QC@H@o(68J3Udtj8`n*$#KyCC~>eZ+Uc z$1(o^d>Z_6#Gk>(Fuw`nBM$7T>>UE}5l8UD`kVw=*DK%ypdHQM2Kl`YLDuO8$U1%n zPJusxP4MRE{tS}9@h*d}fv0~pD>C>Ir_z*+8d6WI zEET8KK(1+9Iqb_H$cP1OxvEb?n4(-ek%+3hOtdu7J2@WPaz zhFh5mw_Noky|-O0d3n>dYG-j)8RcXqmP}C2$c%KVOwe%CiDlVQnON55Dg{dx0l7_w zRyZLZqYFVnn@oAp zhHg&1RVvT^rp^|r9U4k4v^O@4G!|_ngYwb`@O2|QPgZFIfK$^(QKo6G-)=H*(21PYt0@#+?Z`N@L+NQNoGUapKCmyH1S-c z)o31WVAPhS4@uieU&kCIsqrfXsl2}#aDC^nCLS6Yc7B1GOYv-2EEo=$Y zoN3hNEslVJk4Surg1Q#!MF#uFk#Fg|3MVeL7n5UK&#@;x<&p){wJGYWMaMciYzEV! zXsZU@aln#A>vG>B1NSiXCuWaxZgF{H%Fx6KYEB=oq0O{yiq0SjiSBQFYbfZ#;%vur zhf<2oN2hjLT>9VIx~$Fy3KZ3&GOqjF;>_e7hX%CqnM}1q2~k((*wmD2&5C)8YZuUX zxEQMr1oLaMyYZ>qoWcQigqz>U6E7CB(MG)zXCdyMT9|eY<%g38HN`wz;_l?j!s#52 z^W+xKaF5~^mBI#^5Z5NWiIvLDY1EUtSa;|;+^Vc-Z+zl%jf(}7$!-<34Gue0uY0i) zL&y1}4xd{%pQ83Wf;Q;X_=y2Im5R&g+p=m`63=aVa6UTX;fW7=;|sK*EdeU;9N&ss zQU=pK-9=A;jb-$rxM`|2=Hxi6@#BcXb~4@PW2GU>j*5XJ@TxKpqm35+-}BbT9nYh7s*cCWn4$KTGl&8O z#1fB-YHM-a_uwqcP$;Cv^M!PhB>u3tMIiu`);6gH4l%^xVzJzp{?ik8EHCY7j60WZ R)g5;{u|0oPYj{0nP+^qBwv literal 0 HcmV?d00001 diff --git a/locales/es_ES.po b/locales/es_ES.po new file mode 100644 index 00000000..536fd53a --- /dev/null +++ b/locales/es_ES.po @@ -0,0 +1,144 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# Le Rohellec Benoit , 2015 +msgid "" +msgstr "" +"Project-Id-Version: GLPI Plugin - Genericobject\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-10-25 13:26+0200\n" +"PO-Revision-Date: 2016-09-15 10:01+0000\n" +"Last-Translator: Walid Nouh\n" +"Language-Team: Spanish (Spain) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/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" + +#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 +#: front/type.form.php:73 inc/object_item.class.php:110 +#: inc/profile.class.php:39 inc/type.class.php:306 inc/type.class.php:389 +msgid "Objects management" +msgstr "Gestión de objetos" + +#: index.php:69 front/familylist.php:37 +msgid "Empty family" +msgstr "Familia vacía" + +#: front/commondropdown.form.php:36 front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 +msgid "The requested dropdown does not exists" +msgstr "La lista desplegable requerida no existe" + +#: front/field.form.php:41 +msgid "Field(s) deleted successfully" +msgstr "Campo(s) suprimido(s) correctamente" + +#: front/field.form.php:51 +msgid "Field added successfully" +msgstr "El campo fue añadido correctamente" + +#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 +#: inc/type.class.php:68 +msgid "Type of objects" +msgstr "Tipo de objetos" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campos asociados al objeto" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Término" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nombre en base de datos" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Añadir un campo nuevo" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Vista previa del objeto" + +#: inc/object.class.php:734 +msgid "You must configure rights to enable the preview" +msgstr "Tiene que configurar los permisos para acceder a la vista previa" + +#: inc/profile.class.php:145 +msgid "General" +msgstr "General" + +#: inc/profile.class.php:151 +msgid "Objects" +msgstr "Objetos" + +#: inc/profile.class.php:153 +msgid " (No types defined yet)" +msgstr " (Todavia ningún tipo de objeto definido)" + +#: inc/type.class.php:180 +msgid "Type name is missing" +msgstr "Nombre de tipo es obligatorio" + +#: inc/type.class.php:186 +msgid "" +"Types 'field', 'object' and 'type' are reserved. Please choose another one" +msgstr "Los nombres de tipo 'field', 'object' y 'type' son reservados. Tiene que elegir otro nombre" + +#: inc/type.class.php:193 +msgid "Type must start with a letter" +msgstr "El nombre de tipo tiene que empezar con una letra" + +#: inc/type.class.php:200 +msgid "A type already exists with the same name" +msgstr "Un tipo de objeto ya existe con el mismo nombre" + +#: inc/type.class.php:360 inc/type.class.php:480 inc/typefamily.class.php:36 +msgid "Family of type of objects" +msgstr "Familia de tipos de objetos" + +#: inc/type.class.php:440 +msgid "Internal identifier" +msgstr "Identificador interno" + +#: inc/type.class.php:494 +msgid "Behaviour" +msgstr "Comportamiento" + +#: inc/type.class.php:512 +msgid "Network connections" +msgstr "Conexiones de red" + +#: inc/type.class.php:515 +msgid "injection file plugin" +msgstr "complemento Injection file" + +#: inc/type.class.php:517 +msgid "geninventorynumber plugin" +msgstr "complemento Geninventorynumber" + +#: inc/type.class.php:518 +msgid "order plugin" +msgstr "complemento Gestión de pedidos" + +#: inc/type.class.php:519 +msgid "item's uninstallation plugin" +msgstr "complemento Item's uninstallation" + +#: inc/type.class.php:520 +msgid "simcard plugin" +msgstr "" + +#: inc/type.class.php:671 +msgid "Regenerate files" +msgstr "Generar de nuevo los ficheros" + +#: inc/type.class.php:684 +msgid "Link to other objects" +msgstr "Enlace con otros objetos" diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo index 85817fc60cf86774b889aeb6b05410497e9a14a4..b503803afb42a922b724be1889fc278388b5371b 100644 GIT binary patch delta 1350 zcmYk)&2Jk;7zf~SlRAmh0)?h2NlRa7sBPMfKNKp}C4n{~QKGb1ZH163RIR;Zd(!pn zvNIbeTr3c9pb|o?xN<5;RylxjL7WgiA>e?-jT4AJ0QH1~1pMBOkr>&2W_P_a@5lTw z^YP4w3;kIk#FvMJD8TRFQTPx}K`|!85s-sV!dZ9{R^Vy437>`?I04^>Pr#4hVfY!G zfuF-1{C4#GNB9V?e;pJ3^u<4L<8j>h6Fvr~$AvftPeI;j6&{B!d=&1$P52%x!Ji-p zn8B{R;XFJAE07bo4tc}d@aK#W+mP3NaiT9o9+TG*K4+|`0pcSr;fDjb3c12}AXlab^Y9+b!u>uboblI?1Na_tNq>jW!Yo$j z%r8LB;0nA6>+l-94;}ar@`i*u7vVDG>o(-|-+@RxO#-CV=1TUtY#bS9&4bJG6uziv znmI4RV;Wy{C+*`IzA+k{9an+}2grj1#t}*@!C7)*h%X%+3=ckM$2eB*7Z0>VoZtx+ zt_NiILTSj8Ev2PLd(sw@FAkkQ>v^PQk6KFlp13MI?v4uLNW9z)?H;w#(W#W3>hn}7*OtoX%NV&W*I4IPJGn ZYl7jv+tvpKuneq?;Sp#J}Cl8jSz| delta 1413 zcmZY7PmB{)90%~X+lB5fDy~=-Mb{sSmSvr81=qw8%}(fmmHx8@;=cpanYX)doz86L z%`9+gqVXUXG!u*_XuM&)80F^0#A?EUs~1ijk$CoGg5Te?sEIFaK7G?S^WN|GohyZ# zg-;Il4+$Z@pA_Ojcx&t(NSOZ#XW)EJhzH;Scn+4}WAHNE2M6#;_%l2JZ^K96n`uM?>{tk=quknI|=sUM|1wIQKkSmWN zcj#l-fuF-V`~w=$L|^#;8*mYRG@gG4QFzuhE{x;m!uwnWpPbvpV*%f%@I^5a*yS6o+W zO<{Lay0Nf4j{?nE0XV_)-@sT%#>NSyut|5*<@l()mcmPS=;zy@(AkmtE2_ z+Llo%-J471ux&U#qb6VJIQ=x&+TFnAi(8UBxuyc?rMGkQ>Al>-^~%)z#51iZmWoR&_{q?*+@d4^ANtWc}1`l=L0>;En?DIM&5H+?UE_$}8Rexqsl zHTgx32nlV5Nlacb2`C7YZRsTBZaBTIaab}!H;~gfFWl(LIO`nWq=Ic3#15iLzs&FN zBRZKxWD-&#FVtG0QU6a55BN`bUUEM?FI4OwiN68F)h#Xn diff --git a/locales/it_IT.mo b/locales/it_IT.mo new file mode 100644 index 0000000000000000000000000000000000000000..0a176078559e566f4f4293fd8e831ca1de30e04d GIT binary patch literal 2609 zcmchXJ&YSg6vrnJz8pUDK?n)(LV<0CJ=>Q6!QoJHm%GT(<#M_>L5Kp4cgO2VW@pUK zteuMxB?T2CqN0HYQBVZBbP;KwprA;L1QjJhLQ2X1t?j!=NzF*>pLb{Gef;Om`+fJ$ zF9pUccn;y&yF-XN_~b+Q!MFkL2Y&!-;4k1);6LCKpm-Q-feLs4+z-A0w!oLbv*2NH z06qqO2JQjB03QLr1^0p9gB9?n>HM$Y(|G>_+X6ZMHIV&%0N#NHm%-=peiF{v&wC)-{{-axuY39^=VK#uF*>HHonVta=`*6k?BIxT?DftNtmWdQQJk3nn|*Qf7af$aB3 zunOJ+o8Vs{fd^oe^KOI7;92l3@N0gB!MU<7 z95W9bN2!aT+M1)VIaHn!)z?-fw5dW}oGL$(G`W(=CaJ612Tx-i1{4O0yv!6?{D@OY zLRO8bua!x}q8iANc113hvtihzzRa}Q6e}gj^(R(A*SoCZ;Kd4WBbg*{?29;7-uDZ` zTX>@8>j=xJ@W5G5(t8(c$Fabrt~gZ9>ism7v-n94H zrjw8Nh{`5BRm&r(zE0JNBvq0&p(-CX{^lHvSNTXKbF^-h^ortvbAUuNr6g8~_gygw z1|sxzTJScV4p0kFPFdMAsw{|^AjnzU5%PEWrY*7_lpUHP)mCWBCk_!yIkvtAl~p|z z*oAbBk>!f%7MCa6`@PO$nJ2T2>$zilQ74HmsocYEo6fARcaRIaqln51(D5Ys%7z-c zJVfVws*`B3NPX0GZK|xF??y|gadsP>MkTdrzS(*+YQ7z{j!|pAeQf?nbH3Tc!e|3$ z&W`R~*J?(sqtrUuKK90uCPrmd`Ve(=YnxT${ zQ$;4?MP>EP(r=ilhlUOxcDjvvEP<(;`9rOkc`8{z$%AJgKMBXI+LPQ-~L*hN>g3f zRFf^-$Wbh_p%Y6Ezj?rwK~a{SD22E*DqN6TuVRVUk}M6Nvf0tJ9l-+6)pQ+|pE)>g z==W%x(YY%Q!UR@Lc2yvk-u0pEvZRO_jG& zbPPeK+cybDv`06VNID*9>}9>}RBm2Zst-@Ivl^j)xJ+C0W7IkeSlC(HlJ{?5W4FKK zM(S}eN_5K;-_E(icJ%|An3}aP@2o>~+{18v=jcMriJ{pmcrF!mVo`gSA`FC6b}tT% b70Y!9nuh2uvZswkqg7<8a;Bj8-`d!JYP!3g{QmudptdO++bLA7tF&s zsN#Uc32_8*-~b2y0gwX)!B4;%_(iq;EqEX1KZ3mP7w{l>1H2#n6Fda&-&5K-0zQQK zYv2KJ0KN)tf-Uenkp24|WPAHyoa3DV+5eN^4a9sN@tzEkmi@CiKs z7<>f$5@Zd(ub$ro@hA4&UHY{j#GjbK7whvP$nh?K>~9a`c-{he-+LhI{sG8we-1ti zehoek{scY%{tdDo2at?qkihfcWsu|e3S@gffE@45YJL}tbBZ|z9&CgC;60olj+qDN zkmG`Eg9l#c>+8XduVhY>A};WZTq{o&=af~MG-BBXm04*>C&~s5H#4y!H2ztX-8mX{+R@xA)H%|fJ9@Z1*KXs*XdOvrL$|)yJ|1=OUc1}w z9ByOOR-_M6KauE>Tff(?DCMGSbT2+v^uv&D!en>f)|Oo!NG6 z!QmEIxQX0%DX43ql^Ut-38Y+RUWNIK{iW#G?tARXKxNUQja`Bg>(a3e9d_dBQemqG z>2b%RC6|qTmn_`F)XyI|!Rf`%`G%dJ@0@CP8;yp2q0?@k>>O`izg|t|=iALghZ=SU zY&K8Lbvw=GiJEBibgXkrL8oO;(g7DTmQ8W7S3Hb!lCd(s^5RImds!CkD3;?C zH!2qkZp<}++k*R8^dPNhQzx>TNIot%xyD{J0FCleVu5$dMCL;o2&T%eR6Nd2BhPS` zo4A@NL0p)BFJ~GZsccAOWOd?hC#o7y%w>XzxG#ytpyQDWlDkoiRwDy$m^5e_Q-69K zV%d<8Ml@pF6G8&8Xtf?) zk^8~4V~Mj>cZ%?)cLoUwP{Zbx)}qh45q#aqA*q*~ASF}Dia0VFu}M*Q&RH}%_1yKU zZB=A!n$KZHsm@6&dlfs2U&wA9o9jq`4e)Iny$aWL_L8Iwxfw$x_!}U(3AqvdU02WEga}9<>c(MVTZ?}HN?^;U literal 0 HcmV?d00001 diff --git a/locales/ro_RO.po b/locales/ro_RO.po new file mode 100644 index 00000000..3bb01c56 --- /dev/null +++ b/locales/ro_RO.po @@ -0,0 +1,144 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# Doru DEACONU , 2015 +msgid "" +msgstr "" +"Project-Id-Version: GLPI Plugin - Genericobject\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-10-25 13:26+0200\n" +"PO-Revision-Date: 2016-09-15 10:01+0000\n" +"Last-Translator: Walid Nouh\n" +"Language-Team: Romanian (Romania) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/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" + +#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 +#: front/type.form.php:73 inc/object_item.class.php:110 +#: inc/profile.class.php:39 inc/type.class.php:306 inc/type.class.php:389 +msgid "Objects management" +msgstr "Managementul obiectelor" + +#: index.php:69 front/familylist.php:37 +msgid "Empty family" +msgstr "Familie vida" + +#: front/commondropdown.form.php:36 front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 +msgid "The requested dropdown does not exists" +msgstr "Dropdown-ul solicitat nu exista" + +#: front/field.form.php:41 +msgid "Field(s) deleted successfully" +msgstr "Campul(urile) sterse cu succes" + +#: front/field.form.php:51 +msgid "Field added successfully" +msgstr "Camp adaugat cu succes" + +#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 +#: inc/type.class.php:68 +msgid "Type of objects" +msgstr "Tipul obiectelor" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campuri asociate la obiect" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Eticheta" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nume in DB" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Add camp nou" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Previzualizeaza un obiect de acest tip" + +#: inc/object.class.php:734 +msgid "You must configure rights to enable the preview" +msgstr "Trebuie sa configurati drepturi pe acest obiect pentru a putea previzualiza" + +#: inc/profile.class.php:145 +msgid "General" +msgstr "General" + +#: inc/profile.class.php:151 +msgid "Objects" +msgstr "Obiecte" + +#: inc/profile.class.php:153 +msgid " (No types defined yet)" +msgstr "(Niciun tip definit inca)" + +#: inc/type.class.php:180 +msgid "Type name is missing" +msgstr "Nume tip lipseste" + +#: inc/type.class.php:186 +msgid "" +"Types 'field', 'object' and 'type' are reserved. Please choose another one" +msgstr "Tipurile 'camp', 'obiect', si 'tip' sunt rezervate.Va rugam alegeti altul" + +#: inc/type.class.php:193 +msgid "Type must start with a letter" +msgstr "Tipul trebuie sa inceapa cu o litera" + +#: inc/type.class.php:200 +msgid "A type already exists with the same name" +msgstr "UN tip cu acelasi nume exista deja" + +#: inc/type.class.php:360 inc/type.class.php:480 inc/typefamily.class.php:36 +msgid "Family of type of objects" +msgstr "Familia tipului de obiecte" + +#: inc/type.class.php:440 +msgid "Internal identifier" +msgstr "Identificator intern" + +#: inc/type.class.php:494 +msgid "Behaviour" +msgstr "Comportament" + +#: inc/type.class.php:512 +msgid "Network connections" +msgstr "Conexiuni retea" + +#: inc/type.class.php:515 +msgid "injection file plugin" +msgstr "Plugin injectare fisiere" + +#: inc/type.class.php:517 +msgid "geninventorynumber plugin" +msgstr "geninventorynumber plugin" + +#: inc/type.class.php:518 +msgid "order plugin" +msgstr "Plugin gestiune comenzi" + +#: inc/type.class.php:519 +msgid "item's uninstallation plugin" +msgstr "Plugin dezinstalare elemente" + +#: inc/type.class.php:520 +msgid "simcard plugin" +msgstr "" + +#: inc/type.class.php:671 +msgid "Regenerate files" +msgstr "Fisiere regenerate" + +#: inc/type.class.php:684 +msgid "Link to other objects" +msgstr "Linck catre alte obiecte" diff --git a/locales/tr_TR.mo b/locales/tr_TR.mo new file mode 100644 index 0000000000000000000000000000000000000000..5ffc10dbb8b1a7be1ffd4243adb40a16a9b47640 GIT binary patch literal 2580 zcmZvcO>7%Q6vwBue7Sspt6;{Vo8(g34ue!KJa{_j8I_v3+m zp9{1n@f^l;aE}mE;9a-iAKF#$5V!$Of;Ygs!9Tz|L9rKeffD!#cnEwLtb&h&XTYbx zHh4Su5%>W3DR?XR1^6I%1uTJIkH^0Q@4@#^Ag}ukJOKU$-UsgAC&Ur(FvxLEfd@ee z-V64?GvJ3{8T=k(eR~j;<2?p)zEzO*FM}NK9q?OtZ~bsGWDz*S<}@t;oqlk-n?cEb2H6N;2okd1?J9F-b51iHt_sc+!Zbozo^7 zb>3tuZ{cX7IFgCyXkui^1W6Op1RpkDEsJr=_Eb1cE3uMJQL~+0AZKlQ$Un8Y$&v<~?Z#Q8jnIZq93~caZ1;MVOgPH0 z3hBnNEM|%FxTBFj+xq5I4cbvlpbGS)0nyFM@3@R@N)uU9MsU4kpwlY(xU}CU} zGv`46p7#RJd;Zw76|~ZlbUvtCX&iD%ZH?ZLxumz1Rfb;a;C+o>UyBl{Y43m*QQB+QTY^2w!QDx%H@8)Kka#A-BK5MY1yl0tQ+Mh?&_dB_G4sS zP~5$(Z|3c(%Hqc^EiS0e*?_;e?#$N3=fdZKc? zBqm>1W^jFt8rqWAUGmZlHxj5$WHQ{?Tt_|1(Ste>yGkbP7l{{dCfR9l*r*a*7@Ovz=hRbHdv<#Wk=I& zC}xN2H%-Crm^V@}xMuWPjH0rg$9N#ei1IqoVlH(#L}3l8x8X`hX`F4Ydlcf~Rn!}U z9yz!?++d?Rna`+^#Tn{|3=yXe%h^;MbgM|ZAvd8lk#HO1s5+RyGvTq*opJcW#sAcp zp4uug7-!E(=Fk-v=Ll6{HeAn;HOs)y9Tsq)wP{)!T=y-= hH8{8ysa#V>#%usq>>5Q3TwUI1cehTk0yTSA??3C!?B@Ug literal 0 HcmV?d00001 From 07fdeaea5810ce713c5134b14c1360960a61c383 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 12:04:08 +0100 Subject: [PATCH 14/40] Update tools --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index df8bdc91..6b54bc48 100644 --- a/composer.lock +++ b/composer.lock @@ -230,7 +230,7 @@ } ], "description": "Modern task runner", - "time": "2017-02-08T01:45:50+00:00" + "time": "2017-02-08 01:45:50" }, { "name": "container-interop/container-interop", @@ -298,16 +298,16 @@ }, { "name": "glpi-project/tools", - "version": "0.1.1", + "version": "0.1.2", "source": { "type": "git", "url": "https://github.com/glpi-project/tools.git", - "reference": "89083f6e71fac05190c7cc76a9c5afd8b1f421ef" + "reference": "55b3ba30c9c7f32acf5d9e8d6747e1e369809b13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/89083f6e71fac05190c7cc76a9c5afd8b1f421ef", - "reference": "89083f6e71fac05190c7cc76a9c5afd8b1f421ef", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/55b3ba30c9c7f32acf5d9e8d6747e1e369809b13", + "reference": "55b3ba30c9c7f32acf5d9e8d6747e1e369809b13", "shasum": "" }, "require": { @@ -344,7 +344,7 @@ "plugins", "tools" ], - "time": "2017-02-08T08:20:09+00:00" + "time": "2017-03-03T14:40:45+00:00" }, { "name": "league/container", From 5d6dc6fb309b2d40f2d1b008c9ea465f27d25833 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 12:08:50 +0100 Subject: [PATCH 15/40] Extract new strings; update to tx --- locales/es_ES.mo | Bin 2677 -> 2619 bytes locales/es_ES.po | 134 ++++++++++++++++++++----------------- locales/fr_FR.mo | Bin 2709 -> 3033 bytes locales/fr_FR.po | 136 +++++++++++++++++++++----------------- locales/genericobject.pot | 130 ++++++++++++++++++++---------------- locales/it_IT.mo | Bin 2609 -> 2546 bytes locales/it_IT.po | 136 +++++++++++++++++++++----------------- locales/ro_RO.mo | Bin 2591 -> 2550 bytes locales/ro_RO.po | 134 ++++++++++++++++++++----------------- locales/tr_TR.mo | Bin 2580 -> 2509 bytes locales/tr_TR.po | 136 +++++++++++++++++++++----------------- 11 files changed, 445 insertions(+), 361 deletions(-) diff --git a/locales/es_ES.mo b/locales/es_ES.mo index d496f460c2d2a9e9d458df5e98f68c725c3972ca..d2026bdfb62338479af15aec8bad0a6e82661bf4 100644 GIT binary patch delta 775 zcmX}qPe>GD7{~F)bysb*f7_awnOh6tB9rf|Ex{79R1kPj@mOGNwB(?S;4T&g?!A*D z9=v$(ycelM;i;~LN9|DEI&`SR5{Td5H2JVIpLvIweV;$`C;KkjJj^7wj2Py)!jbGS zE8tI5tS8JyaRX1|TRepyu@67vAb!P5*hc+Vrqk>iI_$o=$ucQJz>@Em@@8~7cyQE$>Liv>K3lQ@ObIF8$>1V14g+Ba08ZR}%zyGT0w zRGUY=(C*?M7T8^hRAOgvi1j??@n!4|US_?A{Oo{}Hu`}*_!rfgB#QwY#`9Rxn*Hqo z7kcqAszuLGmA%4I+(sYw;`_f*m1da3BfO3kT*IsQ9+l7`Y6NW@!6DilPnFfbB$}#F z*{Man9168Z3D9Aq8Bx^`jfwF_^Vj-+s9V}lp>IT?LNqoNrg^J!@{U5uEBJo;qnT=c z3PuvOuC<%^l_=fz+=N$jIlowTx5k|BTzYoKo2#t`^sRliFnKD3$JLO?2PwJON~Sbpq1^=C zxhsgG;KF_dqu}d8`~>30m53{M)`j3p7XF_k9%k~p_a>8b?>X~2^E1=@JT`FO5GT0D zxzl~d6tRtpCkbP+xPt|JiF@%Y?!jG5;~zYNL;c3&FptNvig~<@L%4+p@eU@9X_^NN z4zchUQ~0#^gSWVk`3Ka4UvLb+;VAyalb9apCMsiw`9<81D|j9^@D#p7ZSV&w-w4^q z$#3!ubb>j2!>KRe6!T%S>cKJ|#%0uowtC*hW6U4oBtGl;36C;wBbUhzcN0z^mzm{5 z6`I2=`OOl80~l!mZ=)W3geuhzs+7;MfFIGrc5i)#KIp{rcm=QGS$u(N>u=PCa+FuC zDB}cP!lv4+FBK}U{zzp~VpT<<p{(K263^qo!Cu`RvgcDO0(80 zS4)*?w{&kinVYFN?rFzk(XG1Pv`eJs{YLC8uKV@Isvk$|RlDS`hBdno-MZ2Go=o*k p*}`H}^EX1@*2DVs_pj\n" "Language-Team: Spanish (Spain) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/es_ES/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,21 +18,26 @@ msgstr "" "Language: es_ES\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 -#: front/type.form.php:73 inc/object_item.class.php:110 -#: inc/profile.class.php:39 inc/type.class.php:306 inc/type.class.php:389 +#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 +#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 +#: inc/object_item.class.php:110 index.php:58 setup.php:190 msgid "Objects management" msgstr "Gestión de objetos" -#: index.php:69 front/familylist.php:37 +#: front/familylist.php:37 index.php:68 msgid "Empty family" msgstr "Familia vacía" -#: front/commondropdown.form.php:36 front/commondropdown.php:11 -#: front/commontreedropdown.form.php:36 +#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 +#: front/commondropdown.php:11 msgid "The requested dropdown does not exists" msgstr "La lista desplegable requerida no existe" +#: front/type.php:37 front/object.php:33 inc/type.class.php:68 +#: inc/profile.class.php:291 +msgid "Type of objects" +msgstr "Tipo de objetos" + #: front/field.form.php:41 msgid "Field(s) deleted successfully" msgstr "Campo(s) suprimido(s) correctamente" @@ -41,47 +46,6 @@ msgstr "Campo(s) suprimido(s) correctamente" msgid "Field added successfully" msgstr "El campo fue añadido correctamente" -#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 -#: inc/type.class.php:68 -msgid "Type of objects" -msgstr "Tipo de objetos" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Campos asociados al objeto" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Término" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nombre en base de datos" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Añadir un campo nuevo" - -#: inc/object.class.php:471 -msgid "Object preview" -msgstr "Vista previa del objeto" - -#: inc/object.class.php:734 -msgid "You must configure rights to enable the preview" -msgstr "Tiene que configurar los permisos para acceder a la vista previa" - -#: inc/profile.class.php:145 -msgid "General" -msgstr "General" - -#: inc/profile.class.php:151 -msgid "Objects" -msgstr "Objetos" - -#: inc/profile.class.php:153 -msgid " (No types defined yet)" -msgstr " (Todavia ningún tipo de objeto definido)" - #: inc/type.class.php:180 msgid "Type name is missing" msgstr "Nombre de tipo es obligatorio" @@ -99,7 +63,7 @@ msgstr "El nombre de tipo tiene que empezar con una letra" msgid "A type already exists with the same name" msgstr "Un tipo de objeto ya existe con el mismo nombre" -#: inc/type.class.php:360 inc/type.class.php:480 inc/typefamily.class.php:36 +#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 msgid "Family of type of objects" msgstr "Familia de tipos de objetos" @@ -107,38 +71,88 @@ msgstr "Familia de tipos de objetos" msgid "Internal identifier" msgstr "Identificador interno" -#: inc/type.class.php:494 +#: inc/type.class.php:493 msgid "Behaviour" msgstr "Comportamiento" -#: inc/type.class.php:512 +#: inc/type.class.php:511 msgid "Network connections" msgstr "Conexiones de red" -#: inc/type.class.php:515 +#: inc/type.class.php:514 msgid "injection file plugin" msgstr "complemento Injection file" -#: inc/type.class.php:517 +#: inc/type.class.php:516 msgid "geninventorynumber plugin" msgstr "complemento Geninventorynumber" -#: inc/type.class.php:518 +#: inc/type.class.php:517 msgid "order plugin" msgstr "complemento Gestión de pedidos" -#: inc/type.class.php:519 +#: inc/type.class.php:518 msgid "item's uninstallation plugin" msgstr "complemento Item's uninstallation" -#: inc/type.class.php:520 +#: inc/type.class.php:519 msgid "simcard plugin" msgstr "" -#: inc/type.class.php:671 +#: inc/type.class.php:670 msgid "Regenerate files" msgstr "Generar de nuevo los ficheros" -#: inc/type.class.php:684 +#: inc/type.class.php:683 msgid "Link to other objects" msgstr "Enlace con otros objetos" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1932 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1934 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "" + +#: inc/object.class.php:470 +msgid "Object preview" +msgstr "Vista previa del objeto" + +#: inc/object.class.php:732 +msgid "You must configure rights to enable the preview" +msgstr "Tiene que configurar los permisos para acceder a la vista previa" + +#: inc/profile.class.php:143 +msgid "General" +msgstr "General" + +#: inc/profile.class.php:149 +msgid "Objects" +msgstr "Objetos" + +#: inc/profile.class.php:151 +msgid "(No types defined yet)" +msgstr "" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campos asociados al objeto" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Término" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nombre en base de datos" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Añadir un campo nuevo" diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo index b503803afb42a922b724be1889fc278388b5371b..4d5af5594b634db2f238c73407f2127a8ab3160b 100644 GIT binary patch delta 1126 zcmY+?O-vI(6u|MN7WotvK|WL*4N!1zYGw;3GmF`bHi(fmVD-P`x z|Kt1z8ysg0&qlb=w(uzaz!ABz&v6dGD7N4vw&P{&!)ffr9G<`>l(nB=6TZPCxQUI9 zv*>)G)6I?V*owdF6QWVa>0sQ8@?s1-aSRXP6&%J{l#Ld!3m@Y_T*Vvs8V9hM-6XLX z&fz`mV}Iu*9SPtaN(H{5Wb_v$fVTaP^O36bqdfmfG%;*%u4OubGXG}X`zQftu^)Xr zjSuk{uA)?K6T8^o`9O!Cv&BU=*v200V3w3>7-hpLBnBsiQUMR8)C(vjUdADOg;I&n zC<*++S^QUjK1-QzGOpmFrL#dNju+c%0k}BIc&R>qfwJLSq!88fhutRUE}x5JD;r8O z5|A7VuT+DPqm%5VNfJ^q)|C8fn;u3v25EAB#8l0m&!O6+B65zL%AO`4Cr7-eon$1H zkw((h<4`gfnf6s!DVjjJCgWM-uB}HpA_I4AVgCHIy6-&Mm)> zCgQYK)jdFFUm1kAOFPEx=ln#u__$Aiy0#(eHvpm(-RRu2y zJeyS+FHZ#Al;s~aZd{m*C(g&m6Dm1Am6$k_NG1}kw`StE&AbRGB$?9u0rBx0b5)k&y|jv_@+st!6-6sIiOp>77( zE|xCMP{|@r;!qIjP;e1J5L`M{oH~_$f7kdY&wZYR%l%)TyGZP{6s{Vp_6*U?!fO{c^PcVUP=;2cw!!BIJYW#>zxQh{E3g!!&7JevU z3{NUI{J>hiU!(qbi;egP>oHzsOb@0|iAJy)=dcdfaST7;OZ0l>}i}ub+(PV|5L@U$j2OVN#Zd+!%J+(zobKYie*&CN2mhMP$Rv;ZjADDb^Zd?z%WkZB)-AV=;9sfh#khq9dV@Q~q5&A1-dj#*4Z5{y%eYMlk>Y diff --git a/locales/fr_FR.po b/locales/fr_FR.po index dd57bf05..15d7f8fb 100644 --- a/locales/fr_FR.po +++ b/locales/fr_FR.po @@ -4,15 +4,15 @@ # # Translators: # Manu1400 , 2016 -# Johan Cwiklinski , 2016 +# Johan Cwiklinski , 2016-2017 # Le Rohellec Benoit , 2015 # Walid Nouh, 2015 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:42+0200\n" -"PO-Revision-Date: 2016-10-25 10:40+0000\n" +"POT-Creation-Date: 2017-03-20 12:04+0100\n" +"PO-Revision-Date: 2017-03-20 11:07+0000\n" "Last-Translator: Johan Cwiklinski \n" "Language-Team: French (France) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/fr_FR/)\n" "MIME-Version: 1.0\n" @@ -21,21 +21,26 @@ msgstr "" "Language: fr_FR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 -#: front/type.form.php:73 inc/object_item.class.php:110 -#: inc/profile.class.php:39 inc/type.class.php:302 inc/type.class.php:385 +#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 +#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 +#: inc/object_item.class.php:110 index.php:58 setup.php:190 msgid "Objects management" msgstr "Gestion d'objets" -#: index.php:69 front/familylist.php:37 +#: front/familylist.php:37 index.php:68 msgid "Empty family" msgstr "Famille vide" -#: front/commondropdown.form.php:36 front/commondropdown.php:11 -#: front/commontreedropdown.form.php:36 +#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 +#: front/commondropdown.php:11 msgid "The requested dropdown does not exists" msgstr "L'intitulé demandé n'existe pas" +#: front/type.php:37 front/object.php:33 inc/type.class.php:68 +#: inc/profile.class.php:291 +msgid "Type of objects" +msgstr "Types d'objets" + #: front/field.form.php:41 msgid "Field(s) deleted successfully" msgstr "Champ(s) supprimé(s) avec succès" @@ -44,47 +49,6 @@ msgstr "Champ(s) supprimé(s) avec succès" msgid "Field added successfully" msgstr "Champ ajouté avec succès" -#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 -#: inc/type.class.php:68 -msgid "Type of objects" -msgstr "Types d'objets" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Champs associés à l'objet" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Libellé" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nom en base de données" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Ajout d'un nouveau champ" - -#: inc/object.class.php:471 -msgid "Object preview" -msgstr "Prévisualisation d'un objet de ce type" - -#: inc/object.class.php:734 -msgid "You must configure rights to enable the preview" -msgstr "Vous devez configurer les droits sur cet objet pour voir la prévisualisation" - -#: inc/profile.class.php:145 -msgid "General" -msgstr "Général" - -#: inc/profile.class.php:151 -msgid "Objects" -msgstr "Objets" - -#: inc/profile.class.php:153 -msgid " (No types defined yet)" -msgstr " (Aucun type d'objet défini)" - #: inc/type.class.php:180 msgid "Type name is missing" msgstr "Nom du type manquant" @@ -102,46 +66,96 @@ msgstr "Le type doit commencer par une lettre" msgid "A type already exists with the same name" msgstr "Un type avec le même nom existe déjà" -#: inc/type.class.php:356 inc/type.class.php:476 inc/typefamily.class.php:36 +#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 msgid "Family of type of objects" msgstr "Famille" -#: inc/type.class.php:436 +#: inc/type.class.php:440 msgid "Internal identifier" msgstr "Indentifiant interne" -#: inc/type.class.php:490 +#: inc/type.class.php:493 msgid "Behaviour" msgstr "Comportement" -#: inc/type.class.php:508 +#: inc/type.class.php:511 msgid "Network connections" msgstr "Connexions réseaux" -#: inc/type.class.php:511 +#: inc/type.class.php:514 msgid "injection file plugin" msgstr "Plugin injection de fichiers" -#: inc/type.class.php:513 +#: inc/type.class.php:516 msgid "geninventorynumber plugin" msgstr "Plugin génération des numéros d'inventaire" -#: inc/type.class.php:514 +#: inc/type.class.php:517 msgid "order plugin" msgstr "Plugin gestion des commandes" -#: inc/type.class.php:515 +#: inc/type.class.php:518 msgid "item's uninstallation plugin" msgstr "Plugin de désinstallation des matériels" -#: inc/type.class.php:516 +#: inc/type.class.php:519 msgid "simcard plugin" msgstr "Plugin carte SIM" -#: inc/type.class.php:667 +#: inc/type.class.php:670 msgid "Regenerate files" msgstr "Regénérer les fichiers" -#: inc/type.class.php:680 +#: inc/type.class.php:683 msgid "Link to other objects" msgstr "Liaison avec d'autres objets" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1932 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "Impossible de charger la classe %1$s." + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1934 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "Vous avez probablement d'anciennes données dans votre base pour ce plugin ou des fichiers manquants dans %1$s" + +#: inc/object.class.php:470 +msgid "Object preview" +msgstr "Prévisualisation d'un objet de ce type" + +#: inc/object.class.php:732 +msgid "You must configure rights to enable the preview" +msgstr "Vous devez configurer les droits sur cet objet pour voir la prévisualisation" + +#: inc/profile.class.php:143 +msgid "General" +msgstr "Général" + +#: inc/profile.class.php:149 +msgid "Objects" +msgstr "Objets" + +#: inc/profile.class.php:151 +msgid "(No types defined yet)" +msgstr "(Aucun type d'objet défini)" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Champs associés à l'objet" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Libellé" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nom en base de données" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Ajout d'un nouveau champ" diff --git a/locales/genericobject.pot b/locales/genericobject.pot index 20c7b3cc..dd78722a 100644 --- a/locales/genericobject.pot +++ b/locales/genericobject.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-10-25 13:26+0200\n" +"POT-Creation-Date: 2017-03-20 12:04+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,21 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 -#: front/type.form.php:73 inc/object_item.class.php:110 -#: inc/profile.class.php:39 inc/type.class.php:306 inc/type.class.php:389 +#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 +#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 +#: inc/object_item.class.php:110 index.php:58 setup.php:190 msgid "Objects management" msgstr "" -#: index.php:69 front/familylist.php:37 +#: front/familylist.php:37 index.php:68 msgid "Empty family" msgstr "" -#: front/commondropdown.form.php:36 front/commondropdown.php:11 -#: front/commontreedropdown.form.php:36 +#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 +#: front/commondropdown.php:11 msgid "The requested dropdown does not exists" msgstr "" +#: front/type.php:37 front/object.php:33 inc/type.class.php:68 +#: inc/profile.class.php:291 +msgid "Type of objects" +msgstr "" + #: front/field.form.php:41 msgid "Field(s) deleted successfully" msgstr "" @@ -40,47 +45,6 @@ msgstr "" msgid "Field added successfully" msgstr "" -#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 -#: inc/type.class.php:68 -msgid "Type of objects" -msgstr "" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "" - -#: inc/object.class.php:471 -msgid "Object preview" -msgstr "" - -#: inc/object.class.php:734 -msgid "You must configure rights to enable the preview" -msgstr "" - -#: inc/profile.class.php:145 -msgid "General" -msgstr "" - -#: inc/profile.class.php:151 -msgid "Objects" -msgstr "" - -#: inc/profile.class.php:153 -msgid " (No types defined yet)" -msgstr "" - #: inc/type.class.php:180 msgid "Type name is missing" msgstr "" @@ -98,7 +62,7 @@ msgstr "" msgid "A type already exists with the same name" msgstr "" -#: inc/type.class.php:360 inc/type.class.php:480 inc/typefamily.class.php:36 +#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 msgid "Family of type of objects" msgstr "" @@ -106,38 +70,88 @@ msgstr "" msgid "Internal identifier" msgstr "" -#: inc/type.class.php:494 +#: inc/type.class.php:493 msgid "Behaviour" msgstr "" -#: inc/type.class.php:512 +#: inc/type.class.php:511 msgid "Network connections" msgstr "" -#: inc/type.class.php:515 +#: inc/type.class.php:514 msgid "injection file plugin" msgstr "" -#: inc/type.class.php:517 +#: inc/type.class.php:516 msgid "geninventorynumber plugin" msgstr "" -#: inc/type.class.php:518 +#: inc/type.class.php:517 msgid "order plugin" msgstr "" -#: inc/type.class.php:519 +#: inc/type.class.php:518 msgid "item's uninstallation plugin" msgstr "" -#: inc/type.class.php:520 +#: inc/type.class.php:519 msgid "simcard plugin" msgstr "" -#: inc/type.class.php:671 +#: inc/type.class.php:670 msgid "Regenerate files" msgstr "" -#: inc/type.class.php:684 +#: inc/type.class.php:683 msgid "Link to other objects" msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1932 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1934 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "" + +#: inc/object.class.php:470 +msgid "Object preview" +msgstr "" + +#: inc/object.class.php:732 +msgid "You must configure rights to enable the preview" +msgstr "" + +#: inc/profile.class.php:143 +msgid "General" +msgstr "" + +#: inc/profile.class.php:149 +msgid "Objects" +msgstr "" + +#: inc/profile.class.php:151 +msgid "(No types defined yet)" +msgstr "" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "" diff --git a/locales/it_IT.mo b/locales/it_IT.mo index 0a176078559e566f4f4293fd8e831ca1de30e04d..49c5e9745cc7587bc09338822299e949152390a8 100644 GIT binary patch delta 824 zcmX}qOKTHR7{>9}SX-0ETT^YdUPi%cDWfN;QXIS#Z;K+{2)Gepf!ipm|nN zq`&oZp@u{Fp47)t4SMOW4UT62;;U?yvQ9HJX+M(aL z0ekpJiT*agg&sVD+_P#nzl>^};2yk>4yVw=IaK1GcnUk|GK?2ci65d8zd$9PK^@r# zRFHXWWyj2Pc~!chRq6ws43%D1GIreB8A`3vv2pB6>Gc2kR|>Nwn<#)vXRl*aKsMNV z7_56YET@oKoz7U>uHvYc5=_tL{^VN2z8mr@&MQ{}cVN(!ohzI_=U#bYO(@Y^5-SFUg6I%5gNhDLr#E zAFnZi9|j9P<366hqh9=l6S#xpm>e?ZIOb4^E?^p6+>fhR$47Vyzn~5nBdhYwV2=F8 zVWJ8esD!t0i!R*9DW2!au0%Ic2_B+4&_%6(iMw$FXYd`Wn_H-Z{T}?DVv+XCp*mN= zEcwlOCI|2asx^zKg%6N-O?UA89F_Pjp1}85!k=hynq5_S4KHFH&)^eO! z4t7-eBz;#U$B@F!L54!@)`ogn2h&=GsyfV|qx}PFGewfY?ewov9rz#me$*L-@+j0v zKA|i9){XF>kA?&FL-(stwd#yct>8xboiR4w2yC>r?1gs0yX&{S1-s@&h2D$!pZNG( zv2?cRRIO94Rm-!ba`(+}_R?I@DHWZHbt<*$>DdyIxa@{e@%oC}3Y%^etkmo^x4EjB zXRo%yFtF$R=I!?SdN6-)$@QBj?*vP|v5{nKD&O$Ju-&qeza0F_??*wQml^#U{|hoG BUTgpW diff --git a/locales/it_IT.po b/locales/it_IT.po index 4630e1b2..ffcfbbd1 100644 --- a/locales/it_IT.po +++ b/locales/it_IT.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:42+0200\n" -"PO-Revision-Date: 2016-10-13 13:45+0000\n" -"Last-Translator: Salvatore Russo \n" +"POT-Creation-Date: 2017-03-20 12:04+0100\n" +"PO-Revision-Date: 2017-03-20 11:05+0000\n" +"Last-Translator: Johan Cwiklinski \n" "Language-Team: Italian (Italy) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/it_IT/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,21 +18,26 @@ msgstr "" "Language: it_IT\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 -#: front/type.form.php:73 inc/object_item.class.php:110 -#: inc/profile.class.php:39 inc/type.class.php:302 inc/type.class.php:385 +#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 +#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 +#: inc/object_item.class.php:110 index.php:58 setup.php:190 msgid "Objects management" msgstr "Gestione degli Oggetti" -#: index.php:69 front/familylist.php:37 +#: front/familylist.php:37 index.php:68 msgid "Empty family" msgstr "Famiglia vuota" -#: front/commondropdown.form.php:36 front/commondropdown.php:11 -#: front/commontreedropdown.form.php:36 +#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 +#: front/commondropdown.php:11 msgid "The requested dropdown does not exists" msgstr "Il menù a discesa richiesto non esiste" +#: front/type.php:37 front/object.php:33 inc/type.class.php:68 +#: inc/profile.class.php:291 +msgid "Type of objects" +msgstr "Tipo di oggetti" + #: front/field.form.php:41 msgid "Field(s) deleted successfully" msgstr "Campo(i) rimosso/i con successo" @@ -41,47 +46,6 @@ msgstr "Campo(i) rimosso/i con successo" msgid "Field added successfully" msgstr "Campo aggiunto con successo" -#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 -#: inc/type.class.php:68 -msgid "Type of objects" -msgstr "Tipo di oggetti" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Campi associati con l'oggetto" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Etichetta" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nome nel DataBase" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Aggiungi nuovo campo" - -#: inc/object.class.php:471 -msgid "Object preview" -msgstr "Anteprima dell'oggetto" - -#: inc/object.class.php:734 -msgid "You must configure rights to enable the preview" -msgstr "Bisogna configurare i diritti per abilitare l'anteprima" - -#: inc/profile.class.php:145 -msgid "General" -msgstr "Generale" - -#: inc/profile.class.php:151 -msgid "Objects" -msgstr "Oggetti" - -#: inc/profile.class.php:153 -msgid " (No types defined yet)" -msgstr "(Nessun tipo definito)" - #: inc/type.class.php:180 msgid "Type name is missing" msgstr "Il nome del tipo non è presente" @@ -99,46 +63,96 @@ msgstr "Il nome del tipo deve cominciare con una lettera" msgid "A type already exists with the same name" msgstr "Un tipo con lo stesso nome esiste già" -#: inc/type.class.php:356 inc/type.class.php:476 inc/typefamily.class.php:36 +#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 msgid "Family of type of objects" msgstr "Famiglia" -#: inc/type.class.php:436 +#: inc/type.class.php:440 msgid "Internal identifier" msgstr "Identificatore interno" -#: inc/type.class.php:490 +#: inc/type.class.php:493 msgid "Behaviour" msgstr "Comportamento" -#: inc/type.class.php:508 +#: inc/type.class.php:511 msgid "Network connections" msgstr "Connessioni di rete" -#: inc/type.class.php:511 +#: inc/type.class.php:514 msgid "injection file plugin" msgstr "injection file plugin" -#: inc/type.class.php:513 +#: inc/type.class.php:516 msgid "geninventorynumber plugin" msgstr "geninventorynumber plugin" -#: inc/type.class.php:514 +#: inc/type.class.php:517 msgid "order plugin" msgstr "order plugin" -#: inc/type.class.php:515 +#: inc/type.class.php:518 msgid "item's uninstallation plugin" msgstr "item's uninstallation plugin" -#: inc/type.class.php:516 +#: inc/type.class.php:519 msgid "simcard plugin" msgstr "simcard plugin" -#: inc/type.class.php:667 +#: inc/type.class.php:670 msgid "Regenerate files" msgstr "Rigenera file" -#: inc/type.class.php:680 +#: inc/type.class.php:683 msgid "Link to other objects" msgstr "Collega ad altri oggetti" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1932 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1934 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "" + +#: inc/object.class.php:470 +msgid "Object preview" +msgstr "Anteprima dell'oggetto" + +#: inc/object.class.php:732 +msgid "You must configure rights to enable the preview" +msgstr "Bisogna configurare i diritti per abilitare l'anteprima" + +#: inc/profile.class.php:143 +msgid "General" +msgstr "Generale" + +#: inc/profile.class.php:149 +msgid "Objects" +msgstr "Oggetti" + +#: inc/profile.class.php:151 +msgid "(No types defined yet)" +msgstr "" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campi associati con l'oggetto" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Etichetta" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nome nel DataBase" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Aggiungi nuovo campo" diff --git a/locales/ro_RO.mo b/locales/ro_RO.mo index 56244fed58fc05735d7eb46dad88d430522be716..a9b506a194f5e7375259a7dfe82adf5daa4a20bf 100644 GIT binary patch delta 775 zcmX}qKTK0m6vy$?(#l^I%3l$s$e%#W)7xq>X$+CTpqKz5aUm`xG~osEn$QLrOuCa8 zHHN{-I2k90E`+Hgj{eyQFkqYs{A@2DCSu!0T%q;R zViB`3{DF!WQL|BeiRW<_8*vX?@H1Y*BkaLb)VmUOW&`N39v8437cq_jcAAx~#6uGU zTj7Llyg>gwYT*thu!^nt1xN53YNO_uSqF~cMV!DHoW+~?8g;;r$cA=|O7s+4*x$N1 zPJ~kr;x&F4W>;l)KlD-P6817)z%JavtN1n?uOc7Y=Sv4V#s>V2s!W8A675ADbQnk2 z-!eRC;bZK^WmLvbu^*q~5PrZm{EDi?cYJ`q@F7leFUs^8YQuM^Osir40K;2l^xwP6 zDzzqSVKYskMJg>7wsW-0G=)x2p=$T9{{K)lR2hZ-BMRNMl2Bs0ZzaY#YoY8FRJpU3 ziOQwmN@{mh*@>P+Gj}|9%S*dtDxGz=ue+3UP4jc!LVm+9`h~!o&Xw}nWZI?9=B2VO z^XeepJvdWX$py)&C;sZ19~4*p2-?Aaz<}t`p{tX1>QqXnc4}Q5`~iJ`lJns%ulrtdd7kI{+^>Q6gN^O}_-jL) z=N#oscNmkyzo_^SGv*AgVHUsQ3EaglJj68q#$ikzGiC@gcn(XL!TXrRCpdu5Fkwu? zyy4;$H{M|iKSe)S$CIo#Q4j85Kki{K{=rL_j<*v{;vnn0*n@L;8z18p+&~rh6P2%< z?4#s287|bp4cw#aY19v|lJz2bsP7jepGLmG5$?am)7V7q;YnnJJ%{qf1>E-WD2dZY5hM`^x0^k5h^qqUXj)g zbfOBPj_c5_Uh2hCN1Bg(!PYHV+cT dj^V5q%m&L<8wLyQG(l*C>a3q@jwOG@jsPr^S9SmZ diff --git a/locales/ro_RO.po b/locales/ro_RO.po index 3bb01c56..7a5bf524 100644 --- a/locales/ro_RO.po +++ b/locales/ro_RO.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-10-25 13:26+0200\n" -"PO-Revision-Date: 2016-09-15 10:01+0000\n" -"Last-Translator: Walid Nouh\n" +"POT-Creation-Date: 2017-03-20 12:04+0100\n" +"PO-Revision-Date: 2017-03-20 11:05+0000\n" +"Last-Translator: Johan Cwiklinski \n" "Language-Team: Romanian (Romania) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/ro_RO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,21 +18,26 @@ msgstr "" "Language: ro_RO\n" "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" -#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 -#: front/type.form.php:73 inc/object_item.class.php:110 -#: inc/profile.class.php:39 inc/type.class.php:306 inc/type.class.php:389 +#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 +#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 +#: inc/object_item.class.php:110 index.php:58 setup.php:190 msgid "Objects management" msgstr "Managementul obiectelor" -#: index.php:69 front/familylist.php:37 +#: front/familylist.php:37 index.php:68 msgid "Empty family" msgstr "Familie vida" -#: front/commondropdown.form.php:36 front/commondropdown.php:11 -#: front/commontreedropdown.form.php:36 +#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 +#: front/commondropdown.php:11 msgid "The requested dropdown does not exists" msgstr "Dropdown-ul solicitat nu exista" +#: front/type.php:37 front/object.php:33 inc/type.class.php:68 +#: inc/profile.class.php:291 +msgid "Type of objects" +msgstr "Tipul obiectelor" + #: front/field.form.php:41 msgid "Field(s) deleted successfully" msgstr "Campul(urile) sterse cu succes" @@ -41,47 +46,6 @@ msgstr "Campul(urile) sterse cu succes" msgid "Field added successfully" msgstr "Camp adaugat cu succes" -#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 -#: inc/type.class.php:68 -msgid "Type of objects" -msgstr "Tipul obiectelor" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Campuri asociate la obiect" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Eticheta" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nume in DB" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Add camp nou" - -#: inc/object.class.php:471 -msgid "Object preview" -msgstr "Previzualizeaza un obiect de acest tip" - -#: inc/object.class.php:734 -msgid "You must configure rights to enable the preview" -msgstr "Trebuie sa configurati drepturi pe acest obiect pentru a putea previzualiza" - -#: inc/profile.class.php:145 -msgid "General" -msgstr "General" - -#: inc/profile.class.php:151 -msgid "Objects" -msgstr "Obiecte" - -#: inc/profile.class.php:153 -msgid " (No types defined yet)" -msgstr "(Niciun tip definit inca)" - #: inc/type.class.php:180 msgid "Type name is missing" msgstr "Nume tip lipseste" @@ -99,7 +63,7 @@ msgstr "Tipul trebuie sa inceapa cu o litera" msgid "A type already exists with the same name" msgstr "UN tip cu acelasi nume exista deja" -#: inc/type.class.php:360 inc/type.class.php:480 inc/typefamily.class.php:36 +#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 msgid "Family of type of objects" msgstr "Familia tipului de obiecte" @@ -107,38 +71,88 @@ msgstr "Familia tipului de obiecte" msgid "Internal identifier" msgstr "Identificator intern" -#: inc/type.class.php:494 +#: inc/type.class.php:493 msgid "Behaviour" msgstr "Comportament" -#: inc/type.class.php:512 +#: inc/type.class.php:511 msgid "Network connections" msgstr "Conexiuni retea" -#: inc/type.class.php:515 +#: inc/type.class.php:514 msgid "injection file plugin" msgstr "Plugin injectare fisiere" -#: inc/type.class.php:517 +#: inc/type.class.php:516 msgid "geninventorynumber plugin" msgstr "geninventorynumber plugin" -#: inc/type.class.php:518 +#: inc/type.class.php:517 msgid "order plugin" msgstr "Plugin gestiune comenzi" -#: inc/type.class.php:519 +#: inc/type.class.php:518 msgid "item's uninstallation plugin" msgstr "Plugin dezinstalare elemente" -#: inc/type.class.php:520 +#: inc/type.class.php:519 msgid "simcard plugin" msgstr "" -#: inc/type.class.php:671 +#: inc/type.class.php:670 msgid "Regenerate files" msgstr "Fisiere regenerate" -#: inc/type.class.php:684 +#: inc/type.class.php:683 msgid "Link to other objects" msgstr "Linck catre alte obiecte" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1932 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1934 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "" + +#: inc/object.class.php:470 +msgid "Object preview" +msgstr "Previzualizeaza un obiect de acest tip" + +#: inc/object.class.php:732 +msgid "You must configure rights to enable the preview" +msgstr "Trebuie sa configurati drepturi pe acest obiect pentru a putea previzualiza" + +#: inc/profile.class.php:143 +msgid "General" +msgstr "General" + +#: inc/profile.class.php:149 +msgid "Objects" +msgstr "Obiecte" + +#: inc/profile.class.php:151 +msgid "(No types defined yet)" +msgstr "" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campuri asociate la obiect" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Eticheta" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nume in DB" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Add camp nou" diff --git a/locales/tr_TR.mo b/locales/tr_TR.mo index 5ffc10dbb8b1a7be1ffd4243adb40a16a9b47640..4200aab1fb26136896d4b4c572473e64030fa429 100644 GIT binary patch delta 824 zcmX}qO=}ZT6vpvmtc{8BEv>d%m9bz^%IKX`5eJcC>!uVd(v2HoN{4i8onU5sSs4^R zfS_*NSQkk)f}iR7JSuUO>gv>?HW+s9FQ5uep(ZekDtrTv;5{UTEur$h#%_F%1NZ?o zi64^sw#q^Yid)V2SRY@y_fQWw9K=cVuz^ba5Vf&qSjSfwV3l2aIF9NxMm2OF_u?XI z5^u0Y!yB=il@jY5HL`773MEkjCf@Eun^LGa$KIZj-k<-WBKtcxdS?{sSjR}O?dkL( z`_;hybt^Saow3HN;HcU=U0x~tEwoPiZp5!SFQ|p?k;;={UL`dXL7s*Ospo-xbyY_|aLr delta 860 zcmXxiKWGzS7{~E9Y13+I?Z0TNjrvxwB$Q|_)_=i4=pt1!xl}@3?!P=Y8(o7Zb4Xo!7` zBqI?qCXL&o{1Gp36q}gBb?nEVxD`zo&q5q`;V6!wgL`lmC-55f;vF2p`xrB(VV*MC z!HpG+`E|)+VLW)&|97Bd#J>ZQ0qKH74QlV;5%d~^9{BBFYLjt zEfhh16KA59Om@tp7APP;bE$J(#Br_{aX&7j#h0jsKcWizf<^p+4$e`v#k;6ayn@=$ zIyQDP`N~8s`GaiS>}Dv`ZWW@osX*;cp_lhE=xF=XXi-HUgRj#rLg(p!==`W~g$h-u zV;rG#?H#HeIyB^OhrX{u2W^O<;uLD53N|)XsMxT+;MMHBceNCF^S17V>DH6z-{|1c zO!h>^nYK\n" +"POT-Creation-Date: 2017-03-20 12:04+0100\n" +"PO-Revision-Date: 2017-03-20 11:05+0000\n" +"Last-Translator: Johan Cwiklinski \n" "Language-Team: Turkish (Turkey) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/tr_TR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,21 +18,26 @@ msgstr "" "Language: tr_TR\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: index.php:59 setup.php:168 front/familylist.php:33 front/familylist.php:41 -#: front/type.form.php:73 inc/object_item.class.php:110 -#: inc/profile.class.php:39 inc/type.class.php:302 inc/type.class.php:385 +#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 +#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 +#: inc/object_item.class.php:110 index.php:58 setup.php:190 msgid "Objects management" msgstr "Nesne yönetimi" -#: index.php:69 front/familylist.php:37 +#: front/familylist.php:37 index.php:68 msgid "Empty family" msgstr "Aile boş" -#: front/commondropdown.form.php:36 front/commondropdown.php:11 -#: front/commontreedropdown.form.php:36 +#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 +#: front/commondropdown.php:11 msgid "The requested dropdown does not exists" msgstr "İstenen açılan kutu bulunamadı" +#: front/type.php:37 front/object.php:33 inc/type.class.php:68 +#: inc/profile.class.php:291 +msgid "Type of objects" +msgstr "Nesne tipi" + #: front/field.form.php:41 msgid "Field(s) deleted successfully" msgstr "Alanlar silindi" @@ -41,47 +46,6 @@ msgstr "Alanlar silindi" msgid "Field added successfully" msgstr "Alan eklendi" -#: front/object.php:33 front/type.php:37 inc/profile.class.php:292 -#: inc/type.class.php:68 -msgid "Type of objects" -msgstr "Nesne tipi" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Nesne ile ilişkilendirilmiş alanlar" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Etiket" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Veritabanındaki Ad" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Alan ekle" - -#: inc/object.class.php:471 -msgid "Object preview" -msgstr "Nesne önizleme" - -#: inc/object.class.php:734 -msgid "You must configure rights to enable the preview" -msgstr "Önizleyebilmek için izinleri ayarlamalısınız" - -#: inc/profile.class.php:145 -msgid "General" -msgstr "Genel" - -#: inc/profile.class.php:151 -msgid "Objects" -msgstr "Nesneler" - -#: inc/profile.class.php:153 -msgid " (No types defined yet)" -msgstr "(Henüz bir tip tanımlanmamış)" - #: inc/type.class.php:180 msgid "Type name is missing" msgstr "Tip adı eksik" @@ -99,46 +63,96 @@ msgstr "Tip bir harf ile başlamalıdır" msgid "A type already exists with the same name" msgstr "Aynı adlı bir tip zaten var" -#: inc/type.class.php:356 inc/type.class.php:476 inc/typefamily.class.php:36 +#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 msgid "Family of type of objects" msgstr "Nesnelerin aile tipi" -#: inc/type.class.php:436 +#: inc/type.class.php:440 msgid "Internal identifier" msgstr "İç belirteç" -#: inc/type.class.php:490 +#: inc/type.class.php:493 msgid "Behaviour" msgstr "Davranış" -#: inc/type.class.php:508 +#: inc/type.class.php:511 msgid "Network connections" msgstr "Ağ bağlantıları" -#: inc/type.class.php:511 +#: inc/type.class.php:514 msgid "injection file plugin" msgstr "dosya gönderme uygulama eki" -#: inc/type.class.php:513 +#: inc/type.class.php:516 msgid "geninventorynumber plugin" msgstr "stoknumarasiolustur uygulama eki" -#: inc/type.class.php:514 +#: inc/type.class.php:517 msgid "order plugin" msgstr "sıralama uygulama eki" -#: inc/type.class.php:515 +#: inc/type.class.php:518 msgid "item's uninstallation plugin" msgstr "ögeyi kaldırma uygulama eki" -#: inc/type.class.php:516 +#: inc/type.class.php:519 msgid "simcard plugin" msgstr "sim kart uygulama eki" -#: inc/type.class.php:667 +#: inc/type.class.php:670 msgid "Regenerate files" msgstr "Dosyaları yeniden oluştur" -#: inc/type.class.php:680 +#: inc/type.class.php:683 msgid "Link to other objects" msgstr "Diğer nesnelere bağlantı" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1932 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1934 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "" + +#: inc/object.class.php:470 +msgid "Object preview" +msgstr "Nesne önizleme" + +#: inc/object.class.php:732 +msgid "You must configure rights to enable the preview" +msgstr "Önizleyebilmek için izinleri ayarlamalısınız" + +#: inc/profile.class.php:143 +msgid "General" +msgstr "Genel" + +#: inc/profile.class.php:149 +msgid "Objects" +msgstr "Nesneler" + +#: inc/profile.class.php:151 +msgid "(No types defined yet)" +msgstr "" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Nesne ile ilişkilendirilmiş alanlar" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Etiket" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Veritabanındaki Ad" + +#: inc/field.class.php:110 +msgid "Add new field" +msgstr "Alan ekle" From fbe04704e68fb042b54bcd2ba53e9e850b92c0bf Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Tue, 7 Mar 2017 15:23:57 +0100 Subject: [PATCH 16/40] Add zend loader (dropped on GLPI 9.2) --- composer.json | 3 +++ composer.lock | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- setup.php | 1 + 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 1ac36cb3..68f6004b 100644 --- a/composer.json +++ b/composer.json @@ -3,5 +3,8 @@ "prefer-stable": true, "require-dev": { "glpi-project/tools": "^0.1.0" + }, + "require": { + "zendframework/zend-loader": "^2.5" } } diff --git a/composer.lock b/composer.lock index 6b54bc48..294e0485 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,53 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "8a6db7f45e083d6f582cc8949facfebb", - "packages": [], + "content-hash": "71f59e2b593e3119c06d98aaacfd48ef", + "packages": [ + { + "name": "zendframework/zend-loader", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-loader.git", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Loader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-loader", + "keywords": [ + "loader", + "zf2" + ], + "time": "2015-06-03T14:05:47+00:00" + } + ], "packages-dev": [ { "name": "consolidation/annotated-command", diff --git a/setup.php b/setup.php index 4e98dcf6..43cd524b 100644 --- a/setup.php +++ b/setup.php @@ -89,6 +89,7 @@ } // Autoload class generated in files/_plugins/genericobject/inc/ +include_once( GENERICOBJECT_DIR . "/vendor/autoload.php"); include_once( GENERICOBJECT_DIR . "/inc/autoload.php"); include_once( GENERICOBJECT_DIR . "/inc/functions.php"); if (file_exists(GENERICOBJECT_DIR . "/log_filter.settings.php")) { From b1ebc906c3b2b525567cdfd277409dd844955320 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 09:23:58 +0100 Subject: [PATCH 17/40] Fix templates header --- objects/front.form.tpl | 6 +++--- objects/front.tpl | 4 ++-- objects/generic.class.tpl | 4 ++-- objects/generic.dropdown.class.tpl | 4 ++-- objects/generic.form.tpl | 6 +++--- objects/locale.tpl | 6 +++--- objects/object_item.class.tpl | 4 ++-- objects/objectinjection.class.tpl | 6 +++--- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/objects/front.form.tpl b/objects/front.form.tpl index 8fdc3072..d1d50e6c 100644 --- a/objects/front.form.tpl +++ b/objects/front.form.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ @@ -32,4 +32,4 @@ include ("../../../inc/includes.php"); $dropdown = new %%CLASSNAME%%(); -include (GLPI_ROOT . "/front/dropdown.common.form.php"); \ No newline at end of file +include (GLPI_ROOT . "/front/dropdown.common.form.php"); diff --git a/objects/front.tpl b/objects/front.tpl index f448f056..6a132b91 100644 --- a/objects/front.tpl +++ b/objects/front.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ diff --git a/objects/generic.class.tpl b/objects/generic.class.tpl index 94287bbd..cfcab8f2 100644 --- a/objects/generic.class.tpl +++ b/objects/generic.class.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ diff --git a/objects/generic.dropdown.class.tpl b/objects/generic.dropdown.class.tpl index 477397a6..de972f69 100644 --- a/objects/generic.dropdown.class.tpl +++ b/objects/generic.dropdown.class.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ diff --git a/objects/generic.form.tpl b/objects/generic.form.tpl index 6b909e60..e0e91e8d 100644 --- a/objects/generic.form.tpl +++ b/objects/generic.form.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ @@ -32,4 +32,4 @@ include ("../../../inc/includes.php"); $item = new %%CLASSNAME%%(); -include (GLPI_ROOT."/plugins/genericobject/front/object.form.php"); \ No newline at end of file +include (GLPI_ROOT."/plugins/genericobject/front/object.form.php"); diff --git a/objects/locale.tpl b/objects/locale.tpl index e9360db4..b74683ef 100644 --- a/objects/locale.tpl +++ b/objects/locale.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ @@ -29,4 +29,4 @@ * This file is automatically managed by genericobject plugin. Do not edit it ! */ -$LANG['genericobject']['%%CLASSNAME%%'][0]="%%NAME%%"; \ No newline at end of file +$LANG['genericobject']['%%CLASSNAME%%'][0]="%%NAME%%"; diff --git a/objects/object_item.class.tpl b/objects/object_item.class.tpl index 5189e84d..0131e4fd 100644 --- a/objects/object_item.class.tpl +++ b/objects/object_item.class.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ diff --git a/objects/objectinjection.class.tpl b/objects/objectinjection.class.tpl index 098fc51c..edaf5682 100644 --- a/objects/objectinjection.class.tpl +++ b/objects/objectinjection.class.tpl @@ -17,10 +17,10 @@ -------------------------------------------------------------------------- @package genericobject @author the genericobject plugin team - @copyright Copyright (c) 2010-2011 Order plugin team + @copyright Copyright (c) 2010-2017 Genericobject plugin team @license GPLv2+ http://www.gnu.org/licenses/gpl.txt - @link https://forge.indepnet.net/projects/genericobject + @link https://github.com/pluginsGLPI/genericobject @link http://www.glpi-project.org/ @since 2009 ---------------------------------------------------------------------- */ @@ -76,4 +76,4 @@ class %%INJECTIONCLASS%% extends %%CLASSNAME%% return $parentclass->getObjectSearchOptions(true); } -} \ No newline at end of file +} From 6e5a20a3e5d7190b126a7546031defc7ab4190dd Mon Sep 17 00:00:00 2001 From: dethegeek Date: Fri, 11 Nov 2016 11:38:09 +0100 Subject: [PATCH 18/40] add check when adding a new object --- inc/type.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/type.class.php b/inc/type.class.php index 3b3c88ff..18a74a69 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -181,7 +181,13 @@ function prepareInputForAdd($input) { return array(); } - //Name must not be empty + // Name must be more than 1 char + if (isset($input['name']) && strlen($input['name']) < 2) { + Session::addMessageAfterRedirect(__("Type name must be longer", "genericobject"), ERROR, true); + return array(); + } + + //Name must not match specific names if (in_array($input['name'], array('field', 'object', 'type'))) { Session::addMessageAfterRedirect(__("Types 'field', 'object' and 'type' are reserved. Please choose another one", "genericobject"), ERROR, true); From 64eea785b3afeeb741d80f706f0df47b8ba90db7 Mon Sep 17 00:00:00 2001 From: dethegeek Date: Fri, 11 Nov 2016 14:15:48 +0100 Subject: [PATCH 19/40] avoid overwrite of CommonDBTM::$rightname from subclasses --- inc/object.class.php | 4 ++-- objects/generic.class.tpl | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/object.class.php b/inc/object.class.php index b48180d7..e9fa27cf 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -62,9 +62,9 @@ public function __construct() { if (preg_match("/PluginGenericobject(.*)/", $class, $results)) { if (preg_match("/^(.*)y$/i", $results[1], $end_results)) { - self::$rightname = 'plugin_genericobject_'.strtolower($end_results[1]).'ies'; + static::$rightname = 'plugin_genericobject_'.strtolower($end_results[1]).'ies'; } else { - self::$rightname = 'plugin_genericobject_'.strtolower($results[1]).'s'; + static::$rightname = 'plugin_genericobject_'.strtolower($results[1]).'s'; } } diff --git a/objects/generic.class.tpl b/objects/generic.class.tpl index cfcab8f2..b1276dcb 100644 --- a/objects/generic.class.tpl +++ b/objects/generic.class.tpl @@ -30,6 +30,8 @@ */ class %%CLASSNAME%% extends PluginGenericobjectObject { + static $rightname = ''; + static function getFormURL($full=true) { return Toolbox::getItemTypeFormURL( get_parent_class() , $full) . "?itemtype=".get_called_class(); From dafd23d617b9363597b8f2b2863b5f19fb3548e8 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 09:45:07 +0100 Subject: [PATCH 20/40] Bump version; drop dead link; use current version for migration version --- hook.php | 2 +- setup.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hook.php b/hook.php index 98e0aa0f..7250a28b 100644 --- a/hook.php +++ b/hook.php @@ -111,7 +111,7 @@ function plugin_genericobject_install() { include_once(GLPI_ROOT."/plugins/genericobject/inc/object.class.php"); include_once(GLPI_ROOT."/plugins/genericobject/inc/type.class.php"); - $migration = new Migration('0.85+1.1'); + $migration = new Migration(PLUGIN_GENERICOBJECT_VERSION); foreach (array( 'PluginGenericobjectField', diff --git a/setup.php b/setup.php index 43cd524b..fc58cb36 100644 --- a/setup.php +++ b/setup.php @@ -35,7 +35,7 @@ ---------------------------------------------------------------------- */ -define ('PLUGIN_GENERICOBJECT_VERSION', '2.4.0'); +define ('PLUGIN_GENERICOBJECT_VERSION', '2.4.1'); if (!defined("GENERICOBJECT_DIR")) { define("GENERICOBJECT_DIR", GLPI_ROOT . "/plugins/genericobject"); @@ -190,8 +190,8 @@ function plugin_post_init_genericobject() { function plugin_version_genericobject() { return array ('name' => __("Objects management", "genericobject"), 'version' => PLUGIN_GENERICOBJECT_VERSION, - 'author' => "Teclib' & siprossii", - 'homepage' => 'https://github.com/teclib/genericobject', + 'author' => "Teclib' & siprossii", + 'homepage' => 'https://github.com/pluginsGLPI/genericobject', 'license' => 'GPLv2+', 'minGlpiVersion' => '0.85.3'); } From fb5858c4fcd267abfeffe5ec849ff6f8d0f3677b Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 11:00:46 +0100 Subject: [PATCH 21/40] Handle migration from plural names in the db --- inc/type.class.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/inc/type.class.php b/inc/type.class.php index 18a74a69..5a04d5b2 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -1564,6 +1564,29 @@ static function getFamilyNameByItemtype($itemtype) { } } + /** + * Ensure names are singular at upgrade + * + * @return void + */ + static function singularTypes() { + global $DB; + $table = getTableForItemType(__CLASS__); + if (TableExists($table)) { + $query = "SELECT id, name, itemtype FROM $table"; + foreach ($DB->query($query) as $data) { + $singularname = self::filterInput($data['name']); + $singulartype = getSingular($data['itemtype']); + if ($data['name'] != $singularname || $data['itemtype'] != $singulartype) { + //do not use objects here to prevent pre/post issues + $update = "UPDATE $table SET name='$singularname', itemtype='$singulartype' WHERE id={$data['id']}"; + $DB->query($update); + self::deleteFilesAndClassesForOneItemtype($data['name']); + } + } + } + } + /** * Get all types of active&published objects */ @@ -1982,6 +2005,8 @@ static function install(Migration $migration) { } } + self::singularTypes(); + //If files are missing, recreate them! self::checkClassAndFilesForItemType(); } From 6195e9faf6aa13a7ccea6a84648843c69f1f24b4 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 11:01:18 +0100 Subject: [PATCH 22/40] 777 is not needed --- hook.php | 2 +- inc/type.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hook.php b/hook.php index 7250a28b..3a242136 100644 --- a/hook.php +++ b/hook.php @@ -136,7 +136,7 @@ function plugin_genericobject_install() { } if (!is_dir(GENERICOBJECT_CLASS_PATH)) { - @ mkdir(GENERICOBJECT_CLASS_PATH, 0777, true) + @ mkdir(GENERICOBJECT_CLASS_PATH, 0755, true) or die("Can't create folder " . GENERICOBJECT_CLASS_PATH); } diff --git a/inc/type.class.php b/inc/type.class.php index 5a04d5b2..b47a0437 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -1025,7 +1025,7 @@ public static function addLocales($name, $itemtype) { global $CFG_GLPI; $locale_dir = GENERICOBJECT_LOCALES_PATH."/".$name; if (!is_dir($locale_dir)) { - @ mkdir($locale_dir, 0777, true); + @ mkdir($locale_dir, 0755, true); } $locale_file = $name.".".$_SESSION['glpilanguage']; self::addFileFromTemplate(array('NAME' => $name, From 358843eaacb635aa08fded1f0c1feb64f2c93c7e Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Mon, 20 Mar 2017 11:14:50 +0100 Subject: [PATCH 23/40] Ensure old files have been removed --- inc/type.class.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/inc/type.class.php b/inc/type.class.php index b47a0437..d0fef96a 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -1172,14 +1172,33 @@ public static function addSearchFile($name, $classname) { /** - * * Create, if needed files for an itemtype and it's dropdown + * * @since 2.2.0 + * + * @return void */ static function checkClassAndFilesForItemType() { global $DB; foreach (self::getTypes(true) as $type) { + //ensure old files has been removed + if (file_exists(GENERICOBJECT_DIR . "/inc/{$type['name']}.class.php")) { + unlink(GENERICOBJECT_CLASS_PATH . "/inc/{$type['name']}.class.php"); + } + if (file_exists(GENERICOBJECT_DIR . "/front/{$type['name']}.form.php")) { + unlink(GENERICOBJECT_DIR . "/front/{$type['name']}.form.php"); + } + if (file_exists(GENERICOBJECT_DIR . "/front/{$type['name']}.php")) { + unlink(GENERICOBJECT_DIR . "/front/{$type['name']}.form.php"); + } + if (file_exists(GENERICOBJECT_DIR . "/ajax/{$type['name']}.tabs.php")) { + unlink(GENERICOBJECT_DIR . "/ajax/{$type['name']}.tabs.php"); + } + if (file_exists(GENERICOBJECT_DIR . "/inc/{$type['name']}.injection.class.php")) { + unlink(GENERICOBJECT_DIR . "/inc/{$type['name']}.injection.class.php"); + } + self::checkClassAndFilesForOneItemType($type['itemtype'], $type['name'], true, false); } } From ab33d74972c8b82d824e1e5df4c8cf074fde9b5f Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 24 May 2017 15:59:45 +0200 Subject: [PATCH 24/40] Fix doc link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e73bc01..77d60842 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See [the documentation](http://glpi-plugins.readthedocs.io/en/latest/genericobje ## Contributing * Open a ticket for each bug/feature so it can be discussed -* Follow [development guidelines](http://glpi-developer-documentation.readthedocs.io/en/latest/plugins.html) +* Follow [development guidelines](http://glpi-developer-documentation.readthedocs.io/en/latest/plugins/index.html) * Refer to [GitFlow](http://git-flow.readthedocs.io/) process for branching * Work on a new branch on your own fork * Open a PR that will be reviewed by a developer From 9e00c47ef1652edfcaab964956e300dbb576c1af Mon Sep 17 00:00:00 2001 From: yllen Date: Sun, 2 Jul 2017 18:10:13 +0200 Subject: [PATCH 25/40] display types - #139 --- front/type.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/front/type.php b/front/type.php index 0e7cc634..e94bbf90 100644 --- a/front/type.php +++ b/front/type.php @@ -33,9 +33,13 @@ $type = new PluginGenericobjectType(); $type->getFromDBByType($_GET['itemtype']); Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType').'?id='.$type->getID()); -} else { + +} else if (Session::haveRightsOr('plugin_genericobject_types', array(READ, CREATE, UPDATE, PURGE))) { Html::header(__("Type of objects", "genericobject"), $_SERVER['PHP_SELF'], "config", "PluginGenericobjectType"); Search::Show('PluginGenericobjectType'); Html::footer(); + +} else { + Html::redirect($CFG_GLPI['root_doc']."/front/central.php"); } From 206eda5415b66b847167811accb17742cf790c93 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 31 Aug 2017 08:51:04 +0200 Subject: [PATCH 26/40] TableExists and FieldExists are deprecated --- hook.php | 2 +- inc/field.class.php | 9 +++++---- inc/profile.class.php | 2 +- inc/type.class.php | 34 ++++++++++++++++++++-------------- inc/typefamily.class.php | 4 ++-- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/hook.php b/hook.php index 3a242136..8563b0ff 100644 --- a/hook.php +++ b/hook.php @@ -187,7 +187,7 @@ function plugin_genericobject_uninstall() { // Delete all models of datainjection about genericobject $table_datainjection_model = 'glpi_plugin_datainjection_models'; - if (TableExists($table_datainjection_model)) { + if ($DB->tableExists($table_datainjection_model)) { $DB->query("DELETE FROM $table_datainjection_model WHERE itemtype LIKE 'PluginGenericobject%'"); } diff --git a/inc/field.class.php b/inc/field.class.php index 0e3daf18..5405a297 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -151,6 +151,7 @@ static function addReadOnlyFields(PluginGenericobjectType $type) { * The name may be the same, or not depending if it's an isolated dropdown or not */ static function getFieldName($field, $itemtype, $options, $remove_prefix = false) { + global $DB; $field_orig = $field; $field_table = null; $input_type = isset($options['input_type']) @@ -180,7 +181,7 @@ static function getFieldName($field, $itemtype, $options, $remove_prefix = false substr($field_table, strlen('glpi_')) === substr($field, 0, strlen($field) -strlen('_id')) ) - and !TableExists($field_table) + and !$DB->tableExists($field_table) ) { if (!$remove_prefix) { $field = 'plugin_genericobject_' . $field;} @@ -334,7 +335,7 @@ public static function addNewField($table, $field, $after=false) { _log("add", $field, "from", $table); $itemtype = getItemTypeForTable($table); - if (!FieldExists($table, $field, false)) { + if (!$DB->fieldExists($table, $field, false)) { $options = self::getFieldOptions($field, $itemtype); $query = "ALTER TABLE `$table` ADD `$field` "; switch ($options['input_type']) { @@ -377,7 +378,7 @@ public static function addNewField($table, $field, $after=false) { $table = getTableNameForForeignKeyField($field); - if ($table != '' && !TableExists($table)) { + if ($table != '' && !$DB->tableExists($table)) { //Cannot use standard methods because class doesn't exists yet ! $name = str_replace("glpi_plugin_genericobject_", "", $table); $name = getSingular($name); @@ -408,7 +409,7 @@ static function deleteField($table, $field) { self::deleteDisplayPreferences($table, $field); //If field exists, drop it ! - if (FieldExists($table, $field)) { + if ($DB->fieldExists($table, $field)) { $DB->query("ALTER TABLE `$table` DROP `$field`"); } diff --git a/inc/profile.class.php b/inc/profile.class.php index b794f543..7ff65b37 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -382,7 +382,7 @@ static function install(Migration $migration) { $profile = new Profile(); //Update needed - if (TableExists('glpi_plugin_genericobject_profiles')) { + if ($DB->tableExists('glpi_plugin_genericobject_profiles')) { foreach (getAllDatasFromTable('glpi_plugin_genericobject_profiles') as $right) { if (preg_match("/PluginGenericobject(.*)/", $right['itemtype'], $results)) { $newrightname = 'plugin_genericobject_'.strtolower($results[1]).'s'; diff --git a/inc/type.class.php b/inc/type.class.php index d0fef96a..33c5dcd8 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -841,8 +841,8 @@ function checkNecessaryFieldsUpdate() { if (!$this->canBeReserved()) { PluginGenericobjectField::deleteField($table, 'is_deleted'); } else { - _log(FieldExists($table, 'is_deleted')); - if (FieldExists($table, 'is_deleted')) { + _log($DB->fieldExists($table, 'is_deleted')); + if ($DB->fieldExists($table, 'is_deleted')) { Session::addMessageAfterRedirect( __("Dustbin can't be removed since Reservations are used on this type."), false, @@ -1217,7 +1217,7 @@ static function checkClassAndFilesForOneItemType($itemtype, $name, $overwrite = $table = getTableForItemType($itemtype); //If class doesn't exist but table exists, create class - if (TableExists($table) && ($overwrite || !class_exists($itemtype))) { + if ($DB->tableExists($table) && ($overwrite || !class_exists($itemtype))) { self::addNewObject($name, $itemtype, array('add_table' => false, 'create_default_profile' => false, 'add_injection_file' => false, @@ -1231,7 +1231,7 @@ static function checkClassAndFilesForOneItemType($itemtype, $name, $overwrite = $dropdowntable = getTableNameForForeignKeyField($field); $dropdownclass = getItemTypeForTable($dropdowntable); - if (TableExists($dropdowntable) && ! class_exists($dropdownclass)) { + if ($DB->tableExists($dropdowntable) && ! class_exists($dropdownclass)) { $name = str_replace("glpi_plugin_genericobject_", "", $dropdowntable); $name = getSingular($name); $params= PluginGenericobjectField::getFieldOptions($field, $dropdownclass); @@ -1334,7 +1334,7 @@ public static function addDropdownTable($table, $options = array()) { $params[$key] = $value; } - if (!TableExists($table)) { + if (!$DB->tableExists($table)) { $query = "CREATE TABLE IF NOT EXISTS `$table` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) collate utf8_unicode_ci default NULL, @@ -1591,7 +1591,7 @@ static function getFamilyNameByItemtype($itemtype) { static function singularTypes() { global $DB; $table = getTableForItemType(__CLASS__); - if (TableExists($table)) { + if ($DB->tableExists($table)) { $query = "SELECT id, name, itemtype FROM $table"; foreach ($DB->query($query) as $data) { $singularname = self::filterInput($data['name']); @@ -1610,8 +1610,9 @@ static function singularTypes() { * Get all types of active&published objects */ static function getTypes($all = false) { + global $DB; $table = getTableForItemType(__CLASS__); - if (TableExists($table)) { + if ($DB->tableExists($table)) { $mytypes = array(); foreach (getAllDatasFromTable($table, (!$all?" is_active=" . self::ACTIVE:""), 'false', 'name') as $data) { //If class is not present on the filesystem, do not list itemtype @@ -1628,8 +1629,9 @@ static function getTypes($all = false) { * order by family */ static function getTypesByFamily($all = false) { + global $DB; $table = getTableForItemType(__CLASS__); - if (TableExists($table)) { + if ($DB->tableExists($table)) { $mytypes = array(); foreach (getAllDatasFromTable($table, (!$all?" is_active=" . self::ACTIVE:"")) as $data) { //If class is not present on the filesystem, do not list itemtype @@ -1752,7 +1754,8 @@ function canBeLinked() { } function canUseTemplate() { - return FieldExists(getTableForItemType($this->fields['itemtype']), 'is_template'); + global $DB; + return $DB->fieldExists(getTableForItemType($this->fields['itemtype']), 'is_template'); } @@ -1762,17 +1765,20 @@ function canUseUnicity() { function canBeDeleted() { - return FieldExists(getTableForItemType($this->fields['itemtype']), 'is_deleted'); + global $DB; + return $DB->fieldExists(getTableForItemType($this->fields['itemtype']), 'is_deleted'); } function canBeEntityAssigned() { - return FieldExists(getTableForItemType($this->fields['itemtype']), 'entities_id'); + global $DB; + return $DB->fieldExists(getTableForItemType($this->fields['itemtype']), 'entities_id'); } function canBeRecursive() { - return FieldExists(getTableForItemType($this->fields['itemtype']), 'is_recursive'); + global $DB; + return $DB->fieldExists(getTableForItemType($this->fields['itemtype']), 'is_recursive'); } @@ -1916,7 +1922,7 @@ static function install(Migration $migration) { global $DB; $table = getTableForItemType(__CLASS__); - if (!TableExists($table)) { + if (!$DB->tableExists($table)) { $query = "CREATE TABLE `$table` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT, `entities_id` INT( 11 ) NOT NULL DEFAULT 0, @@ -1984,7 +1990,7 @@ static function install(Migration $migration) { die(); } $genericObjectTypeInstance = new $genericObjectType(); - if (FieldExists($genericObjectTypeInstance->getTable(), "notepad")) { + if ($DB->fieldExists($genericObjectTypeInstance->getTable(), "notepad")) { $query = "INSERT INTO `" . $notepad->getTable() . "` (`items_id`, `itemtype`, diff --git a/inc/typefamily.class.php b/inc/typefamily.class.php index 73d9a4e0..2cce7e83 100644 --- a/inc/typefamily.class.php +++ b/inc/typefamily.class.php @@ -40,7 +40,7 @@ static function install(Migration $migration) { global $DB; $table = getTableForItemType(__CLASS__); - if (!TableExists($table)) { + if (!$DB->tableExists($table)) { $query = "CREATE TABLE `$table` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT, `name` varchar(255) collate utf8_unicode_ci default NULL, @@ -59,7 +59,7 @@ static function uninstall() { global $DB; $table = getTableForItemType(__CLASS__); - if (TableExists($table)) { + if ($DB->tableExists($table)) { $query = "DROP TABLE IF EXISTS `$table`"; $DB->query($query) or die($DB->error()); } From 026df40da59afa5f1aaaf1e89b56a255f6fbda91 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 31 Aug 2017 08:52:32 +0200 Subject: [PATCH 27/40] Set compat to 9.2 --- genericobject.xml | 4 ++++ setup.php | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/genericobject.xml b/genericobject.xml index efd87fd6..3db321eb 100644 --- a/genericobject.xml +++ b/genericobject.xml @@ -22,6 +22,10 @@ Walid Nouh + + 2.5.0 + 9.2 + 2.4.0 0.85 diff --git a/setup.php b/setup.php index fc58cb36..42a5124b 100644 --- a/setup.php +++ b/setup.php @@ -193,7 +193,13 @@ function plugin_version_genericobject() { 'author' => "Teclib' & siprossii", 'homepage' => 'https://github.com/pluginsGLPI/genericobject', 'license' => 'GPLv2+', - 'minGlpiVersion' => '0.85.3'); + 'requirements' => [ + 'glpi' => [ + 'min' => '9.2', + 'dev' => true + ] + ] + ); } /** @@ -203,8 +209,9 @@ function plugin_version_genericobject() { * @return boolean */ function plugin_genericobject_check_prerequisites() { - if (version_compare(GLPI_VERSION, '0.85.3', 'lt')) { - echo "This plugin requires GLPI 0.85.3 or higher"; + $version = rtrim(GLPI_VERSION, '-dev'); + if (version_compare($version, '9.2', 'lt')) { + echo "This plugin requires GLPI 9.2 or higher"; return false; } return true; From 4233377230f75b2792d3d8bcc050c0f5a1ba785c Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 31 Aug 2017 08:55:17 +0200 Subject: [PATCH 28/40] Replace deprecated showInteger; fixes #145 --- inc/object.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/object.class.php b/inc/object.class.php index e9fa27cf..d4701a8a 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -568,7 +568,14 @@ function displayField($canedit, $name, $value, $template, $description = array() } else { $step = 1; } - Dropdown::showInteger($name, $value, $min, $max, $step); + Dropdown::showNumber( + $name, [ + 'value' => $value, + 'min' => $min, + 'max' => $max, + 'step' => $step + ] + ); } break; From fa1832657bd47cffa10885612408f04573c3cdf1 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 31 Aug 2017 09:01:07 +0200 Subject: [PATCH 29/40] Replace deprecated showDateFormItem and showDateTimeFormItem; fixes #146 --- inc/object.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/inc/object.class.php b/inc/object.class.php index d4701a8a..4c2266a2 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -600,11 +600,23 @@ function displayField($canedit, $name, $value, $template, $description = array() break; case "date": - Html::showDateFormItem($name, $value, true, true); + Html::showDateField( + $name, [ + 'value' => $value, + 'maybeempty' => true, + 'canedit' => true + ] + ); break; case "datetime": - Html::showDateTimeFormItem($name, $value, true, true); + Html::showDateTimeField( + $name, [ + 'value' => $value, + 'timestep' => true, + 'maybeempty' => true + ] + ); break; default: From ad897b03f25701bf381dde2802cc93130e662b9d Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Thu, 31 Aug 2017 10:02:23 +0200 Subject: [PATCH 30/40] Bookmark has been renamed --- inc/type.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/type.class.php b/inc/type.class.php index 33c5dcd8..35e4b433 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -1308,7 +1308,7 @@ static function deleteFilesAndClassesForOneItemtype($name) { static function deleteItemtypeReferencesInGLPI($itemtype) { //Delete references to PluginGenericobjectType in the following tables - $itemtypes = array ("Contract_Item", "DisplayPreference", "Document_Item", "Bookmark", "Log"); + $itemtypes = array ("Contract_Item", "DisplayPreference", "Document_Item", "SavedSearch", "Log"); foreach ($itemtypes as $type) { $item = new $type(); $item->deleteByCriteria(array('itemtype' => $itemtype)); From 89d039ddc061dba9fee4a53bdaf2f81403faa40e Mon Sep 17 00:00:00 2001 From: yllen Date: Sun, 2 Jul 2017 19:58:37 +0200 Subject: [PATCH 31/40] Better management of rights --- inc/type.class.php | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/inc/type.class.php b/inc/type.class.php index 35e4b433..a5264695 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -45,14 +45,12 @@ class PluginGenericobjectType extends CommonDBTM { const OBJECTINJECTION_TEMPLATE = "/objects/objectinjection.class.tpl"; const OBJECTITEM_TEMPLATE = "/objects/object_item.class.tpl"; - const CAN_OPEN_TICKET = 1024; + const CAN_OPEN_TICKET = 1024; - function getRights($interface = 'central') { - $values = parent::getRights(); - return $values; - } + var $dohistory = true; + + static $rightname = 'plugin_genericobject_types'; - var $dohistory = true; function __construct($itemtype = false) { if ($itemtype) { @@ -76,35 +74,10 @@ static function &getInstance($itemtype, $refresh = false) { return $singleton[$itemtype]; } - static function canPurge() { - $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( - __CLASS__ - ); - return Session::haveRight($right_name, PURGE); - } - - static function canCreate() { - $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( - __CLASS__ - ); - return Session::haveRight($right_name, CREATE); - } - static function canView() { - $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( - __CLASS__ - ); - return Session::haveRight($right_name, READ); - } - - static function canUpdate() { - $right_name = PluginGenericobjectProfile::getProfileNameForItemtype( - __CLASS__ - ); - return Session::haveRight($right_name, UPDATE); - } function getFromDBByType($itemtype) { global $DB; + $query = "SELECT * FROM `" . getTableForItemType(__CLASS__) . "` " . "WHERE `itemtype`='$itemtype'"; $result = $DB->query($query); From 3e4c06625a9d1b927e12b38e535a6b97f384b91f Mon Sep 17 00:00:00 2001 From: Thierry Bugier Pineau Date: Mon, 11 Dec 2017 14:32:50 +0100 Subject: [PATCH 32/40] fix use of global var --- inc/type.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/inc/type.class.php b/inc/type.class.php index a5264695..307f8ddc 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -743,10 +743,9 @@ static function addNewObject($name, $itemtype, $options = array()) { /** * * Add a new dropdown :class & files - * @since - * @param unknown_type $name - * @param unknown_type $itemtype - * @param unknown_type $options + * @param string $name + * @param string $itemtype + * @param array $options */ static function addNewDropdown($name, $itemtype, $options = array()) { $params['entities_id'] = false; @@ -770,10 +769,10 @@ static function addNewDropdown($name, $itemtype, $options = array()) { * * Add or delete, if needed some fields to make sure that the itemtype is compatible with * GLPI framework - * - * @return nothing */ function checkNecessaryFieldsUpdate() { + global $DB; + $itemtype = $this->fields["itemtype"]; $item = new $itemtype(); $item->getEmpty(); From 24608517d9dd2fb407e22d706a8eeb553386180d Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Tue, 12 Dec 2017 10:35:27 +0100 Subject: [PATCH 33/40] remove deprecated --- inc/field.class.php | 22 ++++++++++++++++++++-- setup.php | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/inc/field.class.php b/inc/field.class.php index 5405a297..5a22c626 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -98,13 +98,29 @@ public static function showObjectFieldsForm($id) { } echo "
"; if ($haveCheckbox) { - Html::openArrowMassives('fieldslist', true); - Html::closeArrowMassives(array('delete' => __("Delete permanently"))); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "".__('Check all')."/"; + echo "".__('Uncheck all').""; + echo Html::submit(__("Delete permanently"), [ + 'name' => 'delete', + ]); + echo "
"; } $dropdownFields = self::dropdownFields("new_field", $itemtype, $used_fields); if ($dropdownFields) { + echo "
"; echo ""; echo ""; echo ""; @@ -299,6 +315,8 @@ public static function displayFieldDefinition($target, $itemtype, $field, $index echo ""; echo ""; diff --git a/setup.php b/setup.php index 42a5124b..f567b02f 100644 --- a/setup.php +++ b/setup.php @@ -35,7 +35,7 @@ ---------------------------------------------------------------------- */ -define ('PLUGIN_GENERICOBJECT_VERSION', '2.4.1'); +define ('PLUGIN_GENERICOBJECT_VERSION', '2.5.0'); if (!defined("GENERICOBJECT_DIR")) { define("GENERICOBJECT_DIR", GLPI_ROOT . "/plugins/genericobject"); From fecad556e5a59c4a0945596c2a56b4d75e664b84 Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Tue, 12 Dec 2017 10:39:38 +0100 Subject: [PATCH 34/40] better display for rights --- inc/profile.class.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/inc/profile.class.php b/inc/profile.class.php index 7ff65b37..33fd8f19 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -76,24 +76,23 @@ static function showForItemtype($type) { echo ""; echo ""; echo ""; From 4dc620a69828bc2ad62aab6ca08495cc8bab96d9 Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Tue, 12 Dec 2017 11:15:36 +0100 Subject: [PATCH 35/40] short arrays --- front/object.form.php | 4 +- front/profile.form.php | 6 +- front/type.php | 2 +- hook.php | 46 +++--- inc/autoload.php | 8 +- inc/field.class.php | 36 ++--- inc/functions.php | 8 +- inc/object.class.php | 115 +++++++------- inc/object_item.class.php | 5 +- inc/profile.class.php | 54 +++---- inc/singletonobjectfield.class.php | 2 +- inc/type.class.php | 236 ++++++++++++++--------------- inc/typefamily.class.php | 2 +- objects/objectinjection.class.tpl | 10 +- setup.php | 21 ++- 15 files changed, 274 insertions(+), 281 deletions(-) diff --git a/front/object.form.php b/front/object.form.php index 8105cc2f..a6cad978 100644 --- a/front/object.form.php +++ b/front/object.form.php @@ -36,7 +36,7 @@ $types = array_keys(PluginGenericobjectType::getTypes()); $requested_type = $_REQUEST['itemtype']; - $error = array(); + $error = []; if (!in_array($requested_type, $types)) { $error[] = __('The requested type has not been defined yet!'); @@ -101,7 +101,7 @@ Html::header($itemtype::getTypeName(), $_SERVER['PHP_SELF'], "assets", ($menu!==false?$menu:$itemtype), strtolower($itemtype)); - $item->display($_GET, array( 'withtemplate' => $_GET["withtemplate"])); + $item->display($_GET, ['withtemplate' => $_GET["withtemplate"]]); Html::footer(); } else { diff --git a/front/profile.form.php b/front/profile.form.php index aeef17b0..c69b8243 100644 --- a/front/profile.form.php +++ b/front/profile.form.php @@ -33,14 +33,14 @@ /* save profile */ if (isset($_POST['update_all_rights']) && isset($_POST['itemtype'])) { - $profiles = array(); + $profiles = []; foreach ($_POST as $key => $val) { if (preg_match("/^profile_/", $key)) { $id = preg_replace("/^profile_/", "", $key); - $profiles[$id] = array( + $profiles[$id] = [ "id" => $id, "_".PluginGenericobjectProfile::getProfileNameForItemtype($_POST['itemtype']) => $val - ); + ]; } } _log($profiles); diff --git a/front/type.php b/front/type.php index e94bbf90..5f91dbcd 100644 --- a/front/type.php +++ b/front/type.php @@ -34,7 +34,7 @@ $type->getFromDBByType($_GET['itemtype']); Html::redirect(Toolbox::getItemTypeFormURL('PluginGenericobjectType').'?id='.$type->getID()); -} else if (Session::haveRightsOr('plugin_genericobject_types', array(READ, CREATE, UPDATE, PURGE))) { +} else if (Session::haveRightsOr('plugin_genericobject_types', [READ, CREATE, UPDATE, PURGE])) { Html::header(__("Type of objects", "genericobject"), $_SERVER['PHP_SELF'], "config", "PluginGenericobjectType"); Search::Show('PluginGenericobjectType'); diff --git a/hook.php b/hook.php index 8563b0ff..34dc5876 100644 --- a/hook.php +++ b/hook.php @@ -52,7 +52,7 @@ function plugin_genericobject_AssignToTicket($types) { // Define Dropdown tables to be manage in GLPI : function plugin_genericobject_getDropdown() { - $dropdowns = array('PluginGenericobjectTypeFamily' => PluginGenericobjectTypeFamily::getTypeName(2)); + $dropdowns = ['PluginGenericobjectTypeFamily' => PluginGenericobjectTypeFamily::getTypeName(2)]; $plugin = new Plugin(); if ($plugin->isActivated("genericobject")) { @@ -72,7 +72,7 @@ function plugin_genericobject_getDropdown() { // Define dropdown relations function plugin_genericobject_getDatabaseRelations() { - $dropdowns = array(); + $dropdowns = []; //TODO : purt here relations /* @@ -81,7 +81,7 @@ function plugin_genericobject_getDatabaseRelations() { foreach(getAllDatasFromTable(getTableForItemType('PluginGenericobjectType'), "`is_active`='1'") as $itemtype) { foreach(PluginGenericobjectType::getDropdownForItemtype($itemtype) as $table) { - $dropdowns[$table][] = array() + $dropdowns[$table][] = [] } } } @@ -89,7 +89,7 @@ function plugin_genericobject_getDatabaseRelations() { return $dropdowns; } -function plugin_uninstall_addUninstallTypes($uninstal_types = array()) { +function plugin_uninstall_addUninstallTypes($uninstal_types = []) { foreach (PluginGenericobjectType::getTypes() as $tmp => $type) { if ($type["use_plugin_uninstall"]) { $uninstal_types[] = $type["itemtype"]; @@ -113,15 +113,14 @@ function plugin_genericobject_install() { $migration = new Migration(PLUGIN_GENERICOBJECT_VERSION); - foreach (array( - 'PluginGenericobjectField', - 'PluginGenericobjectCommonDropdown', - 'PluginGenericobjectCommonTreeDropdown', - 'PluginGenericobjectProfile', - 'PluginGenericobjectType', - 'PluginGenericobjectTypeFamily' - ) as $itemtype - ) { + foreach ([ + 'PluginGenericobjectField', + 'PluginGenericobjectCommonDropdown', + 'PluginGenericobjectCommonTreeDropdown', + 'PluginGenericobjectProfile', + 'PluginGenericobjectType', + 'PluginGenericobjectTypeFamily' + ] as $itemtype) { if ($plug=isPluginItemType($itemtype)) { $plugname = strtolower($plug['plugin']); $dir = GLPI_ROOT . "/plugins/$plugname/inc/"; @@ -167,13 +166,12 @@ function plugin_genericobject_uninstall() { } } - foreach (array( - 'PluginGenericobjectType', - 'PluginGenericobjectProfile', - 'PluginGenericobjectField', - 'PluginGenericobjectTypeFamily' - ) as $itemtype - ) { + foreach ([ + 'PluginGenericobjectType', + 'PluginGenericobjectProfile', + 'PluginGenericobjectField', + 'PluginGenericobjectTypeFamily' + ] as $itemtype) { if ($plug=isPluginItemType($itemtype)) { $plugname = strtolower($plug['plugin']); $dir = GLPI_ROOT . "/plugins/$plugname/inc/"; @@ -212,12 +210,12 @@ function plugin_genericobject_MassiveActions($type) { if (isset($types[$type])) { $objecttype = PluginGenericobjectType::getInstance($type); if ($objecttype->isTransferable()) { - return array('PluginGenericobjectObject'. - MassiveAction::CLASS_ACTION_SEPARATOR.'plugin_genericobject_transfer' => __("Transfer")); + return ['PluginGenericobjectObject'. + MassiveAction::CLASS_ACTION_SEPARATOR.'plugin_genericobject_transfer' => __("Transfer")]; } else { - return array(); + return []; } } else { - return array(); + return []; } } diff --git a/inc/autoload.php b/inc/autoload.php index da0d171e..3d85ebd6 100644 --- a/inc/autoload.php +++ b/inc/autoload.php @@ -4,7 +4,7 @@ class PluginGenericobjectAutoloader implements SplAutoloader { - protected $paths = array(); + protected $paths = []; public function __construct($options = null) { if (null !== $options) { @@ -47,11 +47,11 @@ public function autoload($classname) { return false; } - $filename = implode(".", array( + $filename = implode(".", [ $class_name, "class", "php" - )); + ]); foreach ($this->paths as $path) { $test = $path . DIRECTORY_SEPARATOR . $filename; @@ -64,6 +64,6 @@ public function autoload($classname) { } public function register() { - spl_autoload_register(array($this, 'autoload')); + spl_autoload_register([$this, 'autoload']); } } diff --git a/inc/field.class.php b/inc/field.class.php index 5a22c626..210c58cf 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -40,10 +40,10 @@ public static function showObjectFieldsForm($id) { $object_type->getFromDB($id); $itemtype = $object_type->fields['itemtype']; $fields_in_db = PluginGenericobjectSingletonObjectField::getInstance($itemtype); - $used_fields = array(); + $used_fields = []; //Reset fields definition only to keep the itemtype ones - $GO_FIELDS = array(); + $GO_FIELDS = []; plugin_genericobject_includeCommonFields(true); PluginGenericobjectType::includeConstants($object_type->fields['name'], true); @@ -218,13 +218,13 @@ static function getFieldName($field, $itemtype, $options, $remove_prefix = false * * @return the dropdown random ID */ - static function dropdownFields($name,$itemtype, $used = array()) { + static function dropdownFields($name,$itemtype, $used = []) { global $GO_FIELDS; - $dropdown_types = array(); + $dropdown_types = []; foreach ($GO_FIELDS as $field => $values) { $message = ""; - $field_options = array(); + $field_options = []; $field = self::getFieldName($field, $itemtype, $values, false); if (!in_array($field, $used)) { if (!isset($dropdown_types[$field])) { @@ -266,7 +266,7 @@ static function dropdownFields($name,$itemtype, $used = array()) { } ksort($dropdown_types); - return Dropdown::showFromArray($name, $dropdown_types, array('display' => false)); + return Dropdown::showFromArray($name, $dropdown_types, ['display' => false]); } /** @@ -287,10 +287,10 @@ static function getFieldOptions($field, $itemtype="") { // This field has been dynamically defined because it's an isolated dropdown $tmpfield = self::getFieldName( $field, $itemtype, - array( + [ 'dropdown_type' => 'isolated', - 'input_type' => 'dropdown' - ), + 'input_type' => 'dropdown' + ], true ); $options = $GO_FIELDS[$tmpfield]; @@ -325,16 +325,16 @@ public static function displayFieldDefinition($target, $itemtype, $field, $index echo ""; echo ""; @@ -453,8 +453,10 @@ static function deleteDisplayPreferences($table, $field) { foreach ($searchopt as $num => $option) { if ((isset($option['field']) && ($option['field'] == $field)) || (isset($option['field']) && $option['linkfield'] == $field)) { - $criteria = array('itemtype' => $itemtype, 'num' => $num); - $pref->deleteByCriteria($criteria); + $pref->deleteByCriteria([ + 'itemtype' => $itemtype, + 'num' => $num + ]); break; } } @@ -465,7 +467,7 @@ static function deleteDisplayPreferences($table, $field) { * @params an array which contains the itemtype, the field to move and the action (up/down) * @return nothing */ - static function changeFieldOrder($params = array()) { + static function changeFieldOrder($params = []) { global $DB; $itemtype = $params['itemtype']; $field = $params['field']; @@ -510,7 +512,7 @@ public static function checkNecessaryFieldsDelete($itemtype,$field) { } /* if ($type->fields['use_direct_connections']) { - foreach(array('users_id','groups_id',' states_id','locations_id') as $tmp_field) { + foreach(['users_id','groups_id',' states_id','locations_id'] as $tmp_field) { if ($tmp_field == $field) { return false; } diff --git a/inc/functions.php b/inc/functions.php index d6afcc42..4e828885 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -26,7 +26,7 @@ function dropdown_getTypeName($class,$nb=0) { } } global $LOG_FILTER; -$LOG_FILTER = array(); +$LOG_FILTER = []; /* * a simple logger function * You can disable logging by using the global $LOG_FILTER @@ -35,12 +35,12 @@ function dropdown_getTypeName($class,$nb=0) { function _log() { global $LOG_FILTER; $trace = debug_backtrace(); - //call_user_func_array("Toolbox::logInFile", array('generic-object', print_r($trace,true) . "\n", true)); + //call_user_func_array("Toolbox::logInFile", ['generic-object', print_r($trace,true) . "\n", true]); if (count($trace)>0) { $glpi_root = str_replace( "\\", "/", GLPI_ROOT ); $trace_file = str_replace( "\\", "/", $trace[0]['file'] ); $filename = preg_replace("|^".$glpi_root."/plugins/genericobject/|", "", $trace_file); - //call_user_func_array("Toolbox::logInFile", array('generic-object', $filename . "\n", true)); + //call_user_func_array("Toolbox::logInFile", ['generic-object', $filename . "\n", true]); } if (count($trace) > 1) { $caller = $trace[1]; @@ -61,7 +61,7 @@ function _log() { $show_log = true; } if ($show_log) { - call_user_func_array("Toolbox::logInFile", array('generic-object', $msg, true)); + call_user_func_array("Toolbox::logInFile", ['generic-object', $msg, true]); } } diff --git a/inc/object.class.php b/inc/object.class.php index 4c2266a2..c4f029f3 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -94,20 +94,21 @@ static function registerType() { PluginGenericobjectType::includeLocales($item->getObjectTypeName()); PluginGenericobjectType::includeConstants($item->getObjectTypeName()); - $options = array("document_types" => $item->canUseDocuments(), - "helpdesk_visible_types" => $item->canUseTickets(), - "linkgroup_types" => isset ($fields["groups_id"]), - "linkuser_types" => isset ($fields["users_id"]), - "linkgroup_tech_types" => isset ($fields["groups_id_tech"]), - "linkuser_tech_types" => isset ($fields["users_id_tech"]), - "ticket_types" => $item->canUseTickets(), - "infocom_types" => $item->canUseInfocoms(), - "networkport_types" => $item->canUseNetworkPorts(), - "reservation_types" => $item->canBeReserved(), - "contract_types" => $item->canUseContracts(), - "unicity_types" => $item->canUseUnicity(), - "location_types" => isset($fields['locations_id'])); - Plugin::registerClass($class, $options); + Plugin::registerClass($class, [ + "document_types" => $item->canUseDocuments(), + "helpdesk_visible_types" => $item->canUseTickets(), + "linkgroup_types" => isset($fields["groups_id"]), + "linkuser_types" => isset($fields["users_id"]), + "linkgroup_tech_types" => isset($fields["groups_id_tech"]), + "linkuser_tech_types" => isset($fields["users_id_tech"]), + "ticket_types" => $item->canUseTickets(), + "infocom_types" => $item->canUseInfocoms(), + "networkport_types" => $item->canUseNetworkPorts(), + "reservation_types" => $item->canBeReserved(), + "contract_types" => $item->canUseContracts(), + "unicity_types" => $item->canUseUnicity(), + "location_types" => isset($fields['locations_id']) + ]); if (plugin_genericobject_haveRight($class, READ)) { //Change url for adding a new object, depending on template management activation @@ -279,8 +280,8 @@ static function canPurge() { return static::checkItemtypeRight($class, PURGE); } - function defineTabs($options=array()) { - $ong = array (); + function defineTabs($options = []) { + $ong = []; $this->addDefaultFormTab($ong); @@ -432,7 +433,7 @@ function title() { } - function showForm($id, $options=array(), $previsualisation = false) { + function showForm($id, $options = [], $previsualisation = false) { global $DB; $display_date = (!method_exists('CommonDBTM', 'showDates')); @@ -474,7 +475,7 @@ function showForm($id, $options=array(), $previsualisation = false) { } //Reset fields definition only to keep the itemtype ones - $GO_FIELDS = array(); + $GO_FIELDS = []; plugin_genericobject_includeCommonFields(true); PluginGenericobjectType::includeConstants($this->getObjectTypeName(), true); @@ -508,12 +509,12 @@ function showForm($id, $options=array(), $previsualisation = false) { static function getFieldsToHide() { - return array('id', 'is_recursive', 'is_template', 'template_name', 'is_deleted', - 'entities_id', 'notepad', 'date_mod', 'date_creation'); + return ['id', 'is_recursive', 'is_template', 'template_name', 'is_deleted', + 'entities_id', 'notepad', 'date_mod', 'date_creation']; } - function displayField($canedit, $name, $value, $template, $description = array()) { + function displayField($canedit, $name, $value, $template, $description = []) { global $GO_BLACKLIST_FIELDS; $searchoption = PluginGenericobjectField::getFieldOptions($name, get_called_class()); @@ -534,7 +535,7 @@ function displayField($canedit, $name, $value, $template, $description = array() if ($fk_table != '') { $itemtype = getItemTypeForTable($fk_table); $dropdown = new $itemtype(); - $parameters = array('name' => $name, 'value' => $value, 'comments' => true); + $parameters = ['name' => $name, 'value' => $value, 'comments' => true]; if ($dropdown->isEntityAssign()) { $parameters["entity"] = $this->fields['entities_id']; } @@ -590,7 +591,7 @@ function displayField($canedit, $name, $value, $template, $description = array() } else { $objectName = $this->fields[$name]; } - Html::autocompletionTextField($this, $name, array('value' => $objectName)); + Html::autocompletionTextField($this, $name, ['value' => $objectName]); break; case "longtext": @@ -717,17 +718,16 @@ function post_addItem() { function cleanDBonPurge() { - $parameters = array('items_id' => $this->getID(), 'itemtype' => get_called_class()); - $types = array('Computer_Item', - 'ReservationItem', 'Document_Item', 'Infocom', 'Contract_Item'); + $parameters = ['items_id' => $this->getID(), 'itemtype' => get_called_class()]; + $types = ['Computer_Item', 'ReservationItem', 'Document_Item', 'Infocom', 'Contract_Item']; foreach ($types as $type) { $item = new $type(); $item->deleteByCriteria($parameters); } - foreach (array('NetworkPort', 'Computer_Item', 'ReservationItem', - 'ReservationItem', 'Document_Item', 'Infocom', 'Contract_Item', - 'Item_Problem', 'Change_Item', 'Item_Project', ) as $itemtype) { + foreach (['NetworkPort', 'Computer_Item', 'ReservationItem', + 'ReservationItem', 'Document_Item', 'Infocom', 'Contract_Item', + 'Item_Problem', 'Change_Item', 'Item_Project'] as $itemtype) { $ip = new $itemtype(); $ip->cleanDBonItemDelete(get_called_class(), $this->getID()); } @@ -746,7 +746,7 @@ static function showPrevisualisationForm(PluginGenericobjectType $type) { ); if (Session::haveRight($right_name, READ) && Session::haveRight($right_name, CREATE)) { - $item->showForm(-1, array(), true); + $item->showForm(-1, [], true); } else { echo "
" . __("You must configure rights to enable the preview", "genericobject") . "
"; @@ -762,12 +762,12 @@ function getSearchOptions() { function getObjectSearchOptions() { global $DB, $GO_FIELDS, $GO_BLACKLIST_FIELDS; - $datainjection_blacklisted = array('id', 'date_mod', 'entities_id', 'date_creation'); - $index_exceptions = array('name' => 1, 'id' => 2, 'comment' => 16, 'date_mod' => 19, - 'entities_id' => 80, 'is_recursive' => 86, 'notepad' => 90, - 'date_creation' => 121); + $datainjection_blacklisted = ['id', 'date_mod', 'entities_id', 'date_creation']; + $index_exceptions = ['name' => 1, 'id' => 2, 'comment' => 16, 'date_mod' => 19, + 'entities_id' => 80, 'is_recursive' => 86, 'notepad' => 90, + 'date_creation' => 121]; $index = 3; - $options = array(); + $options = []; $options['common'] = __('Characteristics'); $table = getTableForItemType(get_called_class()); @@ -789,7 +789,7 @@ function getObjectSearchOptions() { $currentindex++; } - if (in_array($field, array('is_deleted'))) { + if ($field == 'is_deleted') { continue; } @@ -942,7 +942,7 @@ function isPrimaryType() { function connectedTo() { - return array(); + return []; } @@ -952,10 +952,10 @@ function connectedTo() { * * @param values fields to add into glpi * @param options options used during creation - * @return an array of IDs of newly created objects : for example array(Computer=>1, Networkport=>10) + * @return an array of IDs of newly created objects : for example [Computer=>1, Networkport=>10] * **/ - function addOrUpdateObject($values=array(), $options=array()) { + function addOrUpdateObject($values = [], $options = []) { $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options); $lib->processAddOrUpdate(); @@ -976,7 +976,7 @@ function transfer($new_entity) { $tmp['entities_id'] = $new_entity; $this->update($tmp); - $toupdate = array('id' => $this->fields['id']); + $toupdate = ['id' => $this->fields['id']]; foreach (PluginGenericobjectSingletonObjectField::getInstance(get_called_class()) as $field => $data) { $table = getTableNameForForeignKeyField($field); @@ -996,7 +996,7 @@ function transfer($new_entity) { $dropdown->getEntityID()))) { continue; } else { - $tmp = array(); + $tmp = []; $where = ""; if ($dropdown instanceof CommonTreeDropdown) { $tmp['completename'] = $dropdown->fields['completename']; @@ -1044,7 +1044,7 @@ static function showMassiveActionsSubForm(MassiveAction $ma) { //if (in_array ($options['itemtype'], $GENINVENTORYNUMBER_TYPES)) { switch ($ma->action) { case "plugin_genericobject_transfer" : - Dropdown::show('Entity', array('name' => 'new_entity')); + Dropdown::show('Entity', ['name' => 'new_entity']); echo " "; break; @@ -1073,10 +1073,12 @@ function plugin_genericobject_MassiveActionsProcess($data) { static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids) { - $results = array('ok' => 0, - 'ko' => 0, - 'noright' => 0, - 'messages' => array()); + $results = [ + 'ok' => 0, + 'ko' => 0, + 'noright' => 0, + 'messages' => [] + ]; switch ($ma->action) { case "plugin_genericobject_transfer" : @@ -1107,7 +1109,7 @@ static function getMenuContent() { if (class_exists($itemtype) && Session::haveRight($itemtype_rightname, READ)) { - $links = array(); + $links = []; $links['search'] = $itemtype::getSearchUrl(false); if ($item->canUseTemplate()) { @@ -1121,8 +1123,8 @@ static function getMenuContent() { } } - // $menu[strtolower($itemtype)] = array('title' => $type['itemtype']::getMenuName(), - // 'page' => $itemtype::getSearchUrl(false)); + // $menu[strtolower($itemtype)] = ['title' => $type['itemtype']::getMenuName(), + // 'page' => $itemtype::getSearchUrl(false)]; if ($type['plugin_genericobject_typefamilies_id'] > 0 && (!isset($_GET['itemtype']) @@ -1132,19 +1134,18 @@ static function getMenuContent() { $str_name = strtolower($name); $menu[$str_name]['title'] = Dropdown::getDropdownName("glpi_plugin_genericobject_typefamilies", $family_id); $menu[$str_name]['page'] = '/plugins/genericobject/front/familylist.php?id='.$family_id; - $menu[$str_name]['options'][strtolower($itemtype)] = - array('title' => $type['itemtype']::getMenuName(), - 'page' => $itemtype::getSearchUrl(false), - 'links' => $links); + $menu[$str_name]['options'][strtolower($itemtype)] = [ + 'title' => $type['itemtype']::getMenuName(), + 'page' => $itemtype::getSearchUrl(false), + 'links' => $links + ]; } else { - $menu[strtolower($itemtype)]= array( + $menu[strtolower($itemtype)]= [ 'title' => $type['itemtype']::getMenuName(), 'page' => $itemtype::getSearchUrl(false), 'links' => $links - ); - + ]; } - } } diff --git a/inc/object_item.class.php b/inc/object_item.class.php index e889438a..5f1be5d2 100644 --- a/inc/object_item.class.php +++ b/inc/object_item.class.php @@ -88,8 +88,7 @@ static function showItemsForTarget(CommonDBTM $item) { * @since 2.2.0 */ static function registerType() { - Plugin::registerClass(get_called_class(), - array('addtabon' => self::getLinkedItemTypes())); + Plugin::registerClass(get_called_class(), ['addtabon' => self::getLinkedItemTypes()]); } static function getLinkedItemTypes() { @@ -107,7 +106,7 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { $itemtypes = self::getLinkedItemTypes(); if (in_array(get_class($item), $itemtypes) || get_class($item) == self::getItemType1()) { - return array(1 => __("Objects management", "genericobject")); + return [1 => __("Objects management", "genericobject")]; } } return ''; diff --git a/inc/profile.class.php b/inc/profile.class.php index 33fd8f19..466eacc4 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -29,7 +29,7 @@ class PluginGenericobjectProfile extends Profile { /* if profile deleted */ function cleanProfiles($id) { - $this->deleteByCriteria(array('id' => $id)); + $this->deleteByCriteria(['id' => $id]); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { @@ -114,7 +114,7 @@ static function getProfileNameForItemtype($itemtype) { /* profiles modification */ - function showForm($profiles_id, $options = array()) { + function showForm($profiles_id, $options = []) { if (!Session::haveRight("profile", READ)) { return false; } @@ -136,11 +136,11 @@ function showForm($profiles_id, $options = array()) { $profile->displayRightsChoiceMatrix( $general_rights, - array( + [ 'canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General', 'genericobject') - ) + ] ); $types_rights = self::getTypesRights(); @@ -152,17 +152,17 @@ function showForm($profiles_id, $options = array()) { $profile->displayRightsChoiceMatrix( $types_rights, - array( + [ 'canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => $title - ) + ] ); $profile->showLegend(); if ($canedit) { echo "
"; - echo Html::hidden('id', array('value' => $profiles_id)); - echo Html::submit(_sx('button', 'Save'), array('name' => 'update')); + echo Html::hidden('id', ['value' => $profiles_id]); + echo Html::submit(_sx('button', 'Save'), ['name' => 'update']); echo "
\n"; Html::closeForm(); } @@ -278,23 +278,20 @@ public static function createAccess($profiles_id, $itemtype, $first=false) { } else { $r = 0; } - $profile_right->updateProfileRights($right['id'], - array($itemtype_rightname => $r)); + $profile_right->updateProfileRights($right['id'], [$itemtype_rightname => $r]); } } public static function getGeneralRights() { - $rights = array(); - $rights[] = array( + return [[ 'itemtype' => 'PluginGenericobjectType', 'label' => __("Type of objects", "genericobject"), 'field' => self::getProfileNameForItemtype('PluginGenericobjectType'), - ); - return $rights; + ]]; } public static function getTypesRights() { - $rights = array(); + $rights = []; include_once(GLPI_ROOT."/plugins/genericobject/inc/type.class.php"); @@ -304,11 +301,11 @@ public static function getTypesRights() { $itemtype = $type['itemtype']; $field = self::getProfileNameForItemtype($itemtype); $objecttype = new PluginGenericobjectType($itemtype); - $rights[] = array( + $rights[] = [ 'itemtype' => $itemtype, 'label' => $itemtype::getTypeName(), 'field' => self::getProfileNameForItemtype($itemtype) - ); + ]; } } @@ -316,9 +313,9 @@ public static function getTypesRights() { } public static function installRights($first=false) { - $missing_rights = array(); + $missing_rights = []; $installed_rights = ProfileRight::getAllPossibleRights(); - $right_names = array(); + $right_names = []; // Add common plugin's rights $right_names[] = self::getProfileNameForItemtype('PluginGenericobjectType'); @@ -352,8 +349,7 @@ public static function installRights($first=false) { * @return nothing */ public static function deleteTypeFromProfile($itemtype) { - $rights = array(); - $rights[] = self::getProfileNameForItemtype($itemtype); + $rights = [self::getProfileNameForItemtype($itemtype)]; ProfileRight::deleteProfileRights($rights); } @@ -401,16 +397,16 @@ static function install(Migration $migration) { break; } - $profileRight->add(array('profiles_id' => $right['profiles_id'], - 'name' => $newrightname, - 'rights' => $rightvalue)); + $profileRight->add(['profiles_id' => $right['profiles_id'], + 'name' => $newrightname, + 'rights' => $rightvalue]); if (!countElementsInTable('glpi_profilerights', "`profiles_id`='".$right['profiles_id']."' AND `name`='plugin_genericobject_types'")) { - $profileRight->add(array('profiles_id' => $right['profiles_id'], - 'name' => 'plugin_genericobject_types', - 'rights' => 23)); + $profileRight->add(['profiles_id' => $right['profiles_id'], + 'name' => 'plugin_genericobject_types', + 'rights' => 23]); } } @@ -422,7 +418,7 @@ static function install(Migration $migration) { $helpdesk_item_types[] = $right['itemtype']; } } else { - $helpdesk_item_types = array($right['itemtype']); + $helpdesk_item_types = [$right['itemtype']]; } $tmp['id'] = $profile->getID(); @@ -441,7 +437,7 @@ static function install(Migration $migration) { static function uninstall() { global $DB; - $query = "DELETE FROM `glpi_profilerights` + $query = "DELETE FROM `glpi_profilerights` WHERE `name` LIKE '%plugin_genericobject%'"; $DB->query($query) or die($DB->error()); } diff --git a/inc/singletonobjectfield.class.php b/inc/singletonobjectfield.class.php index 0ca826b1..f6a90a28 100644 --- a/inc/singletonobjectfield.class.php +++ b/inc/singletonobjectfield.class.php @@ -37,7 +37,7 @@ class PluginGenericobjectSingletonObjectField { /// Items list - static $_dbfields = array(); + static $_dbfields = []; /** * Singleton to store DB fields definition diff --git a/inc/type.class.php b/inc/type.class.php index 307f8ddc..34c25783 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -67,7 +67,7 @@ static function getTypeName($nb=0) { } static function &getInstance($itemtype, $refresh = false) { - static $singleton = array(); + static $singleton = []; if (!isset($singleton[$itemtype]) ||$refresh) { $singleton[$itemtype] = new self($itemtype); } @@ -90,8 +90,8 @@ function getFromDBByType($itemtype) { //------------------------------------ Tabs management ----------------------------------- - function defineTabs($options=array()) { - $tabs = array(); + function defineTabs($options = []) { + $tabs = []; $this->addStandardTab(__CLASS__, $tabs, $options); return $tabs; } @@ -151,33 +151,33 @@ function prepareInputForAdd($input) { //Name must not be empty if (isset($input['name']) && $input['name'] == '') { Session::addMessageAfterRedirect(__("Type name is missing", "genericobject"), ERROR, true); - return array(); + return []; } // Name must be more than 1 char if (isset($input['name']) && strlen($input['name']) < 2) { Session::addMessageAfterRedirect(__("Type name must be longer", "genericobject"), ERROR, true); - return array(); + return []; } //Name must not match specific names - if (in_array($input['name'], array('field', 'object', 'type'))) { + if (in_array($input['name'], ['field', 'object', 'type'])) { Session::addMessageAfterRedirect(__("Types 'field', 'object' and 'type' are reserved. Please choose another one", "genericobject"), ERROR, true); - return array(); + return []; } //Name must start with a letter if (!preg_match("/^[a-zA-Z]+/i", $input['name'])) { Session::addMessageAfterRedirect(__("Type must start with a letter", "genericobject"), ERROR, true); - return array(); + return []; } $input['name'] = self::filterInput($input['name']); //Name must not be present in DB if (countElementsInTable(getTableForItemType(__CLASS__), "`name`='".$input['name']."'")) { Session::addMessageAfterRedirect(__("A type already exists with the same name", "genericobject"), ERROR, true); - return array(); + return []; } else { $input['itemtype'] = self::getClassByName($input['name']); return $input; @@ -188,7 +188,7 @@ function post_addItem() { self::addNewObject( $this->input["name"], $this->input["itemtype"], - array('add_table' => 1, 'create_default_profile' =>1, 'overwrite_locales' => true) + ['add_table' => 1, 'create_default_profile' => 1, 'overwrite_locales' => true] ); return true; } @@ -252,7 +252,7 @@ function pre_deleteItem() { if (preg_match("/PluginGenericobject(.*)/", $itemtype, $results)) { $newrightname = 'plugin_genericobject_'.strtolower($results[1]).'s'; - ProfileRight::deleteProfileRights(array($newrightname)); + ProfileRight::deleteProfileRights([$newrightname]); } $prof = new Profile(); @@ -371,7 +371,7 @@ static function getMenuName() { //------------------------------------- End Framework hooks ----------------------------- //------------------------------------- Forms ------------------------------------------- - function showForm($ID, $options = array()) { + function showForm($ID, $options = []) { if ($ID > 0) { $this->check($ID, READ); @@ -392,7 +392,7 @@ function showForm($ID, $options = array()) { return true; } - function showBehaviorForm($ID, $options=array()) { + function showBehaviorForm($ID, $options = []) { if ($ID > 0) { $this->check($ID, READ); } else { @@ -419,7 +419,7 @@ function showBehaviorForm($ID, $options=array()) { echo ""; echo ""; echo ""; echo ""; echo ""; @@ -472,33 +473,35 @@ function showBehaviorForm($ID, $options=array()) { echo __("Behaviour", "genericobject"); echo ""; - $use = array ("use_recursivity" => __("Child entities"), - "use_tickets" => __("Assistance"), - "use_deleted" => __("Item in the dustbin"), - "use_notepad" => _n('Note', 'Notes', 2), - "use_history" => __("Historical"), - "use_template" => __("Templates"), - "use_infocoms" => __("Financial and administratives information"), - "use_contracts" => _n("Contract", "Contracts", 2), - "use_documents" => _n("Document", "Documents", 2), - "use_loans" => _n("Reservation", "Reservations", 2), - // Disable unicity feature; see #16 - // Related code : search for #16 - "use_unicity" => __("Fields unicity"), - "use_global_search" => __("Global search"), - "use_projects" => _n("Project", "Projects", 2), - "use_network_ports" => __("Network connections", "genericobject"), - ); - - $plugins = array("use_plugin_datainjection" => __("injection file plugin", "genericobject"), - //"use_plugin_pdf" => __("PDF plugin", "genericobject"), - "use_plugin_geninventorynumber" => __("geninventorynumber plugin", "genericobject"), - "use_plugin_order" => __("order plugin", "genericobject"), - "use_plugin_uninstall" => __("item's uninstallation plugin", "genericobject"), - "use_plugin_simcard" => __("simcard plugin", "genericobject"), - ); + $use = [ + "use_recursivity" => __("Child entities"), + "use_tickets" => __("Assistance"), + "use_deleted" => __("Item in the dustbin"), + "use_notepad" => _n('Note', 'Notes', 2), + "use_history" => __("Historical"), + "use_template" => __("Templates"), + "use_infocoms" => __("Financial and administratives information"), + "use_contracts" => _n("Contract", "Contracts", 2), + "use_documents" => _n("Document", "Documents", 2), + "use_loans" => _n("Reservation", "Reservations", 2), + // Disable unicity feature; see #16 + // Related code : search for #16 + "use_unicity" => __("Fields unicity"), + "use_global_search" => __("Global search"), + "use_projects" => _n("Project", "Projects", 2), + "use_network_ports" => __("Network connections", "genericobject"), + ]; + + $plugins = [ + "use_plugin_datainjection" => __("injection file plugin", "genericobject"), + //"use_plugin_pdf" => __("PDF plugin", "genericobject"), + "use_plugin_geninventorynumber" => __("geninventorynumber plugin", "genericobject"), + "use_plugin_order" => __("order plugin", "genericobject"), + "use_plugin_uninstall" => __("item's uninstallation plugin", "genericobject"), + "use_plugin_simcard" => __("simcard plugin", "genericobject"), + ]; $plugin = new Plugin(); - $odd=0; + $odd = 0; foreach ($use as $right => $label) { if (!$odd) { echo ""; @@ -508,28 +511,29 @@ function showBehaviorForm($ID, $options=array()) { switch ($right) { case 'use_deleted': - Html::showCheckbox(array('name' => $right, - 'checked' => $this->canBeDeleted())); + Html::showCheckbox(['name' => $right, + 'checked' => $this->canBeDeleted()]); break; case 'use_recursivity': - Html::showCheckbox(array('name' => $right, 'value' => $this->canBeRecursive(), - 'checked' => $this->canBeRecursive())); + Html::showCheckbox(['name' => $right, + 'value' => $this->canBeRecursive(), + 'checked' => $this->canBeRecursive()]); break; case 'use_notes': - Html::showCheckbox(array('name' => $right, - 'checked' => $this->canUseNotepad())); + Html::showCheckbox(['name' => $right, + 'checked' => $this->canUseNotepad()]); break; case 'use_template': - Html::showCheckbox(array('name' => $right, - 'checked' => $this->canUseTemplate())); + Html::showCheckbox(['name' => $right, + 'checked' => $this->canUseTemplate()]); break; default : - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); break; } echo ""; @@ -557,8 +561,8 @@ function showBehaviorForm($ID, $options=array()) { switch ($right) { case 'use_plugin_datainjection' : if ($plugin->isActivated('datainjection')) { - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); } else { echo Dropdown::EMPTY_VALUE; echo "\n"; @@ -567,8 +571,8 @@ function showBehaviorForm($ID, $options=array()) { case 'use_plugin_pdf' : if ($plugin->isActivated('pdf')) { - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); } else { echo Dropdown::EMPTY_VALUE; echo "\n"; @@ -577,8 +581,8 @@ function showBehaviorForm($ID, $options=array()) { case 'use_plugin_order' : if ($plugin->isActivated('order')) { - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); } else { echo Dropdown::EMPTY_VALUE; echo "\n"; @@ -587,8 +591,8 @@ function showBehaviorForm($ID, $options=array()) { case 'use_plugin_uninstall' : if ($plugin->isActivated('uninstall')) { - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); } else { echo Dropdown::EMPTY_VALUE; echo "\n"; @@ -597,8 +601,8 @@ function showBehaviorForm($ID, $options=array()) { case 'use_plugin_simcard' : if ($plugin->isActivated('simcard')) { - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); } else { echo Dropdown::EMPTY_VALUE; echo "\n"; @@ -606,8 +610,8 @@ function showBehaviorForm($ID, $options=array()) { break; case 'use_plugin_geninventorynumber' : if ($plugin->isActivated('geninventorynumber')) { - Html::showCheckbox(array('name' => $right, - 'checked' => $this->fields[$right])); + Html::showCheckbox(['name' => $right, + 'checked' => $this->fields[$right]]); } else { echo Dropdown::EMPTY_VALUE; echo "\n"; @@ -664,7 +668,7 @@ function showLinkedTypesForm() { echo ""; echo ""; echo ""; - $this->showFormButtons(array('candel' => false, 'canadd' => false)); + $this->showFormButtons(['candel' => false, 'canadd' => false]); Html::closeForm(); } @@ -700,7 +704,7 @@ function showLinkedTypesForm() { * - add_language_file : create a default language for the itemtype * @return none */ - static function addNewObject($name, $itemtype, $options = array()) { + static function addNewObject($name, $itemtype, $options = []) { $params['add_table'] = false; $params['create_default_profile'] = false; $params['add_injection_file'] = false; @@ -747,7 +751,7 @@ static function addNewObject($name, $itemtype, $options = array()) { * @param string $itemtype * @param array $options */ - static function addNewDropdown($name, $itemtype, $options = array()) { + static function addNewDropdown($name, $itemtype, $options = []) { $params['entities_id'] = false; $params['is_recursive'] = false; $params['is_tree'] = false; @@ -1000,13 +1004,13 @@ public static function addLocales($name, $itemtype) { @ mkdir($locale_dir, 0755, true); } $locale_file = $name.".".$_SESSION['glpilanguage']; - self::addFileFromTemplate(array('NAME' => $name, - 'CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['NAME' => $name, + 'CLASSNAME' => self::getClassByName($name)], self::LOCALE_TEMPLATE, $locale_dir, $locale_file); if ($CFG_GLPI['language'] != $_SESSION['glpilanguage']) { $locale_file = $name.".".$CFG_GLPI['language']; - self::addFileFromTemplate(array('CLASSNAME' => $name), self::LOCALE_TEMPLATE, $locale_dir, + self::addFileFromTemplate(['CLASSNAME' => $name], self::LOCALE_TEMPLATE, $locale_dir, $locale_file); } } @@ -1044,27 +1048,27 @@ public static function addFileFromTemplate($mappings, $template, $directory, public static function addDatainjectionFile($name) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name), - 'INJECTIONCLASS' => self::getClassByName($name)."Injection"), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name), + 'INJECTIONCLASS' => self::getClassByName($name)."Injection"], self::OBJECTINJECTION_TEMPLATE, GENERICOBJECT_CLASS_PATH, $name."injection.class"); } public static function addDropdownFrontFile($name) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name)], self::FRONT_DROPDOWN_TEMPLATE, GENERICOBJECT_FRONT_PATH, $name); } public static function addAjaxFile($name, $field) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name)], self::AJAX_TEMPLATE, GENERICOBJECT_AJAX_PATH, $name.".tabs"); } public static function addDropdownFrontformFile($name) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name)], self::FRONTFORM_DROPDOWN_TEMPLATE, GENERICOBJECT_FRONT_PATH, $name.".form"); } @@ -1077,16 +1081,13 @@ public static function addDropdownClassFile($name, $field, $options) { foreach ($options as $key => $value) { $params[$key] = $value; } - self::addFileFromTemplate( - array( - 'CLASSNAME' => self::getClassByName($name), - 'EXTENDS' => - 'PluginGenericobject' . ($params['is_tree']?'CommonTree':'Common') . 'Dropdown', - 'FIELDNAME' => $params['realname'], - 'LINKED_ITEMTYPE' => $params['linked_itemtype'] - ), - self::CLASS_DROPDOWN_TEMPLATE, GENERICOBJECT_CLASS_PATH, - $name.".class"); + self::addFileFromTemplate([ + 'CLASSNAME' => self::getClassByName($name), + 'EXTENDS' => + 'PluginGenericobject' . ($params['is_tree']?'CommonTree':'Common') . 'Dropdown', + 'FIELDNAME' => $params['realname'], + 'LINKED_ITEMTYPE' => $params['linked_itemtype'] + ], self::CLASS_DROPDOWN_TEMPLATE, GENERICOBJECT_CLASS_PATH, $name.".class"); } @@ -1098,7 +1099,7 @@ public static function addDropdownClassFile($name, $field, $options) { * @return nothing */ public static function addClassFile($name, $classname) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name)], self::CLASS_TEMPLATE, GENERICOBJECT_CLASS_PATH, $name.".class"); } @@ -1111,9 +1112,9 @@ public static function addClassFile($name, $classname) { */ public static function addItemClassFile($name, $classname) { $class = self::getClassByName($name)."_Item"; - self::addFileFromTemplate(array('CLASSNAME' => $class, - 'FOREIGNKEY' => getForeignKeyFieldForItemType($classname), - 'SOURCEOBJECT' => $classname), + self::addFileFromTemplate(['CLASSNAME' => $class, + 'FOREIGNKEY' => getForeignKeyFieldForItemType($classname), + 'SOURCEOBJECT' => $classname], self::OBJECTITEM_TEMPLATE, GENERICOBJECT_CLASS_PATH, $name."_item.class"); } @@ -1125,7 +1126,7 @@ public static function addItemClassFile($name, $classname) { * @return nothing */ public static function addFormFile($name, $classname) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name)], self::FORM_TEMPLATE, GENERICOBJECT_FRONT_PATH, $name.".form"); } @@ -1138,7 +1139,7 @@ public static function addFormFile($name, $classname) { * @return nothing */ public static function addSearchFile($name, $classname) { - self::addFileFromTemplate(array('CLASSNAME' => self::getClassByName($name)), + self::addFileFromTemplate(['CLASSNAME' => self::getClassByName($name)], self::SEARCH_TEMPLATE, GENERICOBJECT_FRONT_PATH, $name); } @@ -1190,12 +1191,11 @@ static function checkClassAndFilesForOneItemType($itemtype, $name, $overwrite = //If class doesn't exist but table exists, create class if ($DB->tableExists($table) && ($overwrite || !class_exists($itemtype))) { - self::addNewObject($name, $itemtype, array('add_table' => false, - 'create_default_profile' => false, - 'add_injection_file' => false, - 'add_language_file' => false, - 'overwrite_locales' => $overwrite_locales - )); + self::addNewObject($name, $itemtype, ['add_table' => false, + 'create_default_profile' => false, + 'add_injection_file' => false, + 'add_language_file' => false, + 'overwrite_locales' => $overwrite_locales ]); } foreach ($DB->list_fields($table) as $field => $options) { @@ -1227,12 +1227,12 @@ static function checkClassAndFilesForOneItemType($itemtype, $name, $overwrite = static function deleteItemTypeFilesAndClasses($name, $table, $itemtype) { global $DB; - _log("Delete Type", array( + _log("Delete Type", [ "table"=>$table, "name"=>$name, "itemtype" => $itemtype, - )); + ]); //Delete files related to dropdowns foreach ($DB->list_fields($table) as $field => $options) { if (preg_match("/plugin_genericobject_(.*)_id/", $field, $results)) { @@ -1283,7 +1283,7 @@ static function deleteItemtypeReferencesInGLPI($itemtype) { $itemtypes = array ("Contract_Item", "DisplayPreference", "Document_Item", "SavedSearch", "Log"); foreach ($itemtypes as $type) { $item = new $type(); - $item->deleteByCriteria(array('itemtype' => $itemtype)); + $item->deleteByCriteria(['itemtype' => $itemtype]); } } @@ -1297,7 +1297,7 @@ static function deleteItemtypeReferencesInGLPI($itemtype) { * @param tree can the dropdown be a tree dropdown * @return nothing */ - public static function addDropdownTable($table, $options = array()) { + public static function addDropdownTable($table, $options = []) { global $DB; $params['entities_id'] = false; $params['is_recursive'] = false; @@ -1350,7 +1350,7 @@ public static function deleteTable($itemtype) { global $DB; _log($itemtype); $preferences = new DisplayPreference(); - $preferences->deleteByCriteria(array("itemtype" => $itemtype)); + $preferences->deleteByCriteria(["itemtype" => $itemtype]); $DB->query("DROP TABLE IF EXISTS `".getTableForItemType($itemtype)."`"); } @@ -1391,10 +1391,10 @@ static function getNameByID($itemtype) { public static function deleteTicketAssignation($itemtype) { global $DB; - $types = array('Item_Ticket', 'Item_Problem', 'Change_Item'); + $types = ['Item_Ticket', 'Item_Problem', 'Change_Item']; foreach ($types as $type) { $item = new $type(); - $item->deleteByCriteria(array('itemtype' => $itemtype)); + $item->deleteByCriteria(['itemtype' => $itemtype]); } } @@ -1408,12 +1408,12 @@ public static function deleteSimcardAssignation($itemtype) { $plugin = new Plugin(); if ($plugin->isActivated('simcard') && $plugin->isActivated('simcard')) { - $types = array('PluginSimcardSimcard_Item'); + $types = ['PluginSimcardSimcard_Item']; foreach ($types as $type) { $item = new $type(); - $item->deleteByCriteria(array( + $item->deleteByCriteria([ 'itemtype' => $itemtype - )); + ]); } } } @@ -1455,7 +1455,7 @@ public static function deleteLoans($itemtype) { */ public static function deleteUnicity($itemtype) { $unicity = new FieldUnicity(); - $unicity->deleteByCriteria(array('itemtype' => $itemtype)); + $unicity->deleteByCriteria(['itemtype' => $itemtype]); } @@ -1466,7 +1466,7 @@ public static function deleteUnicity($itemtype) { */ public static function deleteNotepad($itemtype) { $notepad = new Notepad(); - $notepad->deleteByCriteria(array('itemtype' => $itemtype)); + $notepad->deleteByCriteria(['itemtype' => $itemtype]); } @@ -1506,7 +1506,7 @@ static function deleteReservations($itemtype) { */ static function deleteReservationItems($itemtype) { $reservationItem = new ReservationItem(); - $reservationItem->deleteByCriteria(array('itemtype' => $itemtype), true); + $reservationItem->deleteByCriteria(['itemtype' => $itemtype], true); } /** @@ -1585,7 +1585,7 @@ static function getTypes($all = false) { global $DB; $table = getTableForItemType(__CLASS__); if ($DB->tableExists($table)) { - $mytypes = array(); + $mytypes = []; foreach (getAllDatasFromTable($table, (!$all?" is_active=" . self::ACTIVE:""), 'false', 'name') as $data) { //If class is not present on the filesystem, do not list itemtype $mytypes[$data['itemtype']] = $data; @@ -1604,7 +1604,7 @@ static function getTypesByFamily($all = false) { global $DB; $table = getTableForItemType(__CLASS__); if ($DB->tableExists($table)) { - $mytypes = array(); + $mytypes = []; foreach (getAllDatasFromTable($table, (!$all?" is_active=" . self::ACTIVE:"")) as $data) { //If class is not present on the filesystem, do not list itemtype if (file_exists(GENERICOBJECT_CLASS_PATH."/".$data['name'].".class.php")) { @@ -1679,7 +1679,7 @@ static function includeConstants($name, $force = false) { */ static function getDropdownForItemtype($itemtype) { global $DB; - $associated_tables = array(); + $associated_tables = []; if (class_exists($itemtype)) { $source_table = getTableForItemType($itemtype); foreach (PluginGenericobjectSingletonObjectField::getInstance($itemtype) as $field => $value) { @@ -1701,7 +1701,7 @@ static function deleteDropdownsForItemtype($itemtype) { global $DB; //Foreach dropdown : drop table & remove files ! foreach (self::getDropdownForItemtype($itemtype) as $table) { - $results = array(); + $results = []; if (preg_match("/glpi_plugin_genericobject_(.*)/i", getSingular($table), $results) && isset($results[1])) { $name = $results[1]; @@ -1864,7 +1864,7 @@ function getLinkedItemTypesAsArray() { if (!empty($this->fields['linked_itemtypes'])) { return json_decode($this->fields['linked_itemtypes'], true); } else { - return array(); + return []; } } @@ -1987,8 +1987,8 @@ static function install(Migration $migration) { } //Displayprefs - $prefs = array(10 => 6, 9 => 5, 8 => 4, 7 => 3, 6 => 2, 2 => 1, 4 => 1, 11 => 7, 12 => 8, - 14 => 10, 15 => 11); + $prefs = [10 => 6, 9 => 5, 8 => 4, 7 => 3, 6 => 2, 2 => 1, 4 => 1, 11 => 7, 12 => 8, + 14 => 10, 15 => 11]; foreach ($prefs as $num => $rank) { if (!countElementsInTable("glpi_displaypreferences", "`itemtype`='".__CLASS__."' AND `num`='$num' diff --git a/inc/typefamily.class.php b/inc/typefamily.class.php index 2cce7e83..2f31e5f3 100644 --- a/inc/typefamily.class.php +++ b/inc/typefamily.class.php @@ -75,7 +75,7 @@ static function getFamilies() { WHERE t.id IN (SELECT DISTINCT `id` FROM glpi_plugin_genericobject_types WHERE is_active=1)"; - $families = array(); + $families = []; foreach ($DB->request($query) as $fam) { $itemtype = $fam['itemtype']; if ($itemtype::canCreate()) { diff --git a/objects/objectinjection.class.tpl b/objects/objectinjection.class.tpl index edaf5682..ebe4e231 100644 --- a/objects/objectinjection.class.tpl +++ b/objects/objectinjection.class.tpl @@ -52,18 +52,18 @@ class %%INJECTIONCLASS%% extends %%CLASSNAME%% } function connectedTo() { - return array(); + return []; } - + /** * Standard method to add an object into glpi * * @param values fields to add into glpi * @param options options used during creation - * @return an array of IDs of newly created objects : for example array(Computer=>1, Networkport=>10) + * @return an array of IDs of newly created objects : for example [Computer=>1, Networkport=>10] * **/ - function addOrUpdateObject($values=array(), $options=array()) { + function addOrUpdateObject($values = [], $options = []) { $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options); $lib->processAddOrUpdate(); @@ -75,5 +75,5 @@ class %%INJECTIONCLASS%% extends %%CLASSNAME%% $parentclass = new $parent(); return $parentclass->getObjectSearchOptions(true); } - + } diff --git a/setup.php b/setup.php index f567b02f..3a00d508 100644 --- a/setup.php +++ b/setup.php @@ -96,10 +96,9 @@ include_once(GENERICOBJECT_DIR . "/log_filter.settings.php"); } -$options = array( +$go_autoloader = new PluginGenericobjectAutoloader([ GENERICOBJECT_CLASS_PATH -); -$go_autoloader = new PluginGenericobjectAutoloader($options); +]); $go_autoloader->register(); /** @@ -130,24 +129,24 @@ function plugin_init_genericobject() { && $plugin->isActivated("genericobject") && isset($_SESSION['glpiactiveprofile'])) { - $PLUGIN_HOOKS['change_profile']['genericobject'] = array( + $PLUGIN_HOOKS['change_profile']['genericobject'] = [ 'PluginGenericobjectProfile', 'changeProfile' - ); + ]; plugin_genericobject_includeCommonFields(); $PLUGIN_HOOKS['use_massive_action']['genericobject'] = 1; // add css styles - $PLUGIN_HOOKS['add_css']['genericobject'] = array( + $PLUGIN_HOOKS['add_css']['genericobject'] = [ "css/styles.css" - ); + ]; // Display a menu entry ? - $PLUGIN_HOOKS['menu_toadd']['genericobject'] = array( + $PLUGIN_HOOKS['menu_toadd']['genericobject'] = [ 'config' => 'PluginGenericobjectType', 'assets' => 'PluginGenericobjectObject' - ); + ]; // Config page if (Session::haveRight('config', READ)) { @@ -167,9 +166,7 @@ function plugin_post_init_genericobject() { global $GO_FIELDS; Plugin::registerClass( 'PluginGenericobjectProfile', - array('addtabon' => array( - 'Profile', 'PluginGenericobjectType' - )) + ['addtabon' => ['Profile', 'PluginGenericobjectType']] ); foreach (PluginGenericobjectType::getTypes() as $id => $objecttype) { From bf336231078ae0edb7018cad177175e72a9ad19c Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Tue, 12 Dec 2017 11:16:35 +0100 Subject: [PATCH 36/40] ong -> tabs --- inc/object.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/inc/object.class.php b/inc/object.class.php index c4f029f3..f4c3c48d 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -281,47 +281,47 @@ static function canPurge() { } function defineTabs($options = []) { - $ong = []; + $tabs = []; - $this->addDefaultFormTab($ong); + $this->addDefaultFormTab($tabs); if (!$this->isNewItem()) { if ($this->canUseNetworkPorts()) { - $this->addStandardTab('NetworkPort', $ong, $options); + $this->addStandardTab('NetworkPort', $tabs, $options); } if ($this->canUseInfocoms()) { - $this->addStandardTab('Infocom', $ong, $options); + $this->addStandardTab('Infocom', $tabs, $options); } if ($this->canUseContracts()) { - $this->addStandardTab('Contract_Item', $ong, $options); + $this->addStandardTab('Contract_Item', $tabs, $options); } if ($this->canUseDocuments()) { - $this->addStandardTab('Document_Item', $ong, $options); + $this->addStandardTab('Document_Item', $tabs, $options); } if ($this->canUseTickets()) { - $this->addStandardTab('Ticket', $ong, $options); - $this->addStandardTab('Item_Problem', $ong, $options); - $this->addStandardTab('Change_Item', $ong, $options); + $this->addStandardTab('Ticket', $tabs, $options); + $this->addStandardTab('Item_Problem', $tabs, $options); + $this->addStandardTab('Change_Item', $tabs, $options); } if ($this->canUseNotepad()) { - $this->addStandardTab('Notepad', $ong, $options); + $this->addStandardTab('Notepad', $tabs, $options); } if ($this->canBeReserved()) { - $this->addStandardTab('Reservation', $ong, $options); + $this->addStandardTab('Reservation', $tabs, $options); } if ($this->canUseHistory()) { - $this->addStandardTab('Log', $ong, $options); + $this->addStandardTab('Log', $tabs, $options); } } - return $ong; + return $tabs; } From 1d2dd2126b37e040a7e4388b0495c8ef670feec1 Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Tue, 12 Dec 2017 11:45:41 +0100 Subject: [PATCH 37/40] clean --- inc/field.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/inc/field.class.php b/inc/field.class.php index 210c58cf..aae50dac 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -310,11 +310,9 @@ public static function displayFieldDefinition($target, $itemtype, $field, $index $options = self::getFieldOptions($field, $itemtype); echo ""; - $sel =""; - echo "
" . __("Add new field", "genericobject") . ""; if (!$blacklist && !$readonly) { echo ""; + } else { + echo ""; } echo "" . __($options['name'], 'genericobject') . "
"; - $rights = array(); + $rights = []; foreach (getAllDatasFromTable(getTableForItemtype("Profile")) as $profile) { $prof = new Profile(); $prof->getFromDB($profile['id']); $right = self::getProfileforItemtype($profile['id'], $itemtype); $label = $profile['name']; - $rights = array( - array( - 'label' => $label, - 'itemtype' => $itemtype, - 'field' => self::getProfileNameForItemtype($itemtype), - 'html_field' => "profile_" . $profile['id'], - ) - ); - $prof->displayRightsChoiceMatrix( - $rights - ); + $rights[] = [ + 'label' => $label, + 'itemtype' => $itemtype, + 'field' => self::getProfileNameForItemtype($itemtype), + 'html_field' => "profile_" . $profile['id'], + ]; } + + $prof->displayRightsChoiceMatrix( + $rights + ); echo "
"; if ((!$blacklist || $readonly) && $index > 1) { Html::showSimpleForm($target, $CFG_GLPI["root_doc"] . "/pics/deplier_up.png", 'up', - array('field' => $field, 'action' => 'up', 'itemtype' => $itemtype), - $CFG_GLPI["root_doc"] . "/pics/deplier_up.png"); + ['field' => $field, 'action' => 'up', 'itemtype' => $itemtype], + $CFG_GLPI["root_doc"] . "/pics/deplier_up.png"); } echo ""; if ((!$blacklist || $readonly) && !$last) { Html::showSimpleForm($target, $CFG_GLPI["root_doc"] . "/pics/deplier_down.png", 'down', - array('field' => $field, 'action' => 'down', 'itemtype' => $itemtype), - $CFG_GLPI["root_doc"] . "/pics/deplier_down.png"); + ['field' => $field, 'action' => 'down', 'itemtype' => $itemtype], + $CFG_GLPI["root_doc"] . "/pics/deplier_down.png"); } echo "" . __("Internal identifier", "genericobject") . ""; if (!$ID) { - Html::autocompletionTextField($this, 'name', array('value' => $this->fields["name"])); + Html::autocompletionTextField($this, 'name', ['value' => $this->fields["name"]]); } else { echo ""; echo $this->fields["name"]; @@ -457,8 +457,9 @@ function showBehaviorForm($ID, $options=array()) { echo "
".__("Family of type of objects", 'genericobject').""; - PluginGenericobjectTypeFamily::dropdown( - array('value' => $this->fields["plugin_genericobject_typefamilies_id"])); + PluginGenericobjectTypeFamily::dropdown([ + 'value' => $this->fields["plugin_genericobject_typefamilies_id"] + ]); echo "
"._n("Type", "Types", 2).""; echo ""; echo "
"; if (!$blacklist && !$readonly) { - echo ""; + echo ""; } else { echo ""; } From e93bd771c159c7fd7fb9ee8e6fe27b6ca4ebdb66 Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Wed, 13 Dec 2017 09:10:38 +0100 Subject: [PATCH 38/40] clean --- inc/functions.php | 2 -- inc/object.class.php | 3 --- 2 files changed, 5 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 4e828885..3e5a1cd8 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -35,12 +35,10 @@ function dropdown_getTypeName($class,$nb=0) { function _log() { global $LOG_FILTER; $trace = debug_backtrace(); - //call_user_func_array("Toolbox::logInFile", ['generic-object', print_r($trace,true) . "\n", true]); if (count($trace)>0) { $glpi_root = str_replace( "\\", "/", GLPI_ROOT ); $trace_file = str_replace( "\\", "/", $trace[0]['file'] ); $filename = preg_replace("|^".$glpi_root."/plugins/genericobject/|", "", $trace_file); - //call_user_func_array("Toolbox::logInFile", ['generic-object', $filename . "\n", true]); } if (count($trace) > 1) { $caller = $trace[1]; diff --git a/inc/object.class.php b/inc/object.class.php index f4c3c48d..01712e54 100644 --- a/inc/object.class.php +++ b/inc/object.class.php @@ -1123,9 +1123,6 @@ static function getMenuContent() { } } - // $menu[strtolower($itemtype)] = ['title' => $type['itemtype']::getMenuName(), - // 'page' => $itemtype::getSearchUrl(false)]; - if ($type['plugin_genericobject_typefamilies_id'] > 0 && (!isset($_GET['itemtype']) || !preg_match("/itemtype=".$_GET['itemtype']."/", $_GET['itemtype']))) { From ab3f25d6b23713ce6532f4945e553c3696d62a3e Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Wed, 13 Dec 2017 14:34:52 +0100 Subject: [PATCH 39/40] update locales --- composer.json | 4 +- composer.lock | 673 +++++++++++++++++++++----------------- locales/es_ES.po | 142 ++++---- locales/fr_FR.po | 145 ++++---- locales/genericobject.pot | 138 ++++---- locales/it_IT.po | 142 ++++---- locales/pt_BR.po | 167 ++++++++++ locales/ro_RO.po | 142 ++++---- locales/tr_TR.po | 144 ++++---- 9 files changed, 996 insertions(+), 701 deletions(-) create mode 100644 locales/pt_BR.po diff --git a/composer.json b/composer.json index 68f6004b..3141aeea 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,9 @@ "minimum-stability": "dev", "prefer-stable": true, "require-dev": { - "glpi-project/tools": "^0.1.0" }, "require": { - "zendframework/zend-loader": "^2.5" + "zendframework/zend-loader": "^2.5", + "glpi-project/tools": "^0.1.2" } } diff --git a/composer.lock b/composer.lock index 294e0485..29fcc009 100644 --- a/composer.lock +++ b/composer.lock @@ -4,91 +4,93 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "71f59e2b593e3119c06d98aaacfd48ef", + "content-hash": "28b9f80cd8b600855d2b9c8b722baf19", "packages": [ { - "name": "zendframework/zend-loader", - "version": "2.5.1", + "name": "consolidation/annotated-command", + "version": "2.8.2", "source": { "type": "git", - "url": "https://github.com/zendframework/zend-loader.git", - "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + "url": "https://github.com/consolidation/annotated-command.git", + "reference": "e97c38717eae23a2bafcf3f09438290eee6ebeb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", - "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/e97c38717eae23a2bafcf3f09438290eee6ebeb4", + "reference": "e97c38717eae23a2bafcf3f09438290eee6ebeb4", "shasum": "" }, "require": { - "php": ">=5.3.23" + "consolidation/output-formatters": "^3.1.12", + "php": ">=5.4.0", + "psr/log": "^1", + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0.2 | dev-master", + "squizlabs/php_codesniffer": "^2.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "Zend\\Loader\\": "src/" + "Consolidation\\AnnotatedCommand\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "homepage": "https://github.com/zendframework/zend-loader", - "keywords": [ - "loader", - "zf2" + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } ], - "time": "2015-06-03T14:05:47+00:00" - } - ], - "packages-dev": [ + "description": "Initialize Symfony Console commands from annotated command class methods.", + "time": "2017-11-29T16:23:23+00:00" + }, { - "name": "consolidation/annotated-command", - "version": "2.4.0", + "name": "consolidation/config", + "version": "1.0.7", "source": { "type": "git", - "url": "https://github.com/consolidation/annotated-command.git", - "reference": "80afffd362bd1cf83bef60db690a8c50d8390803" + "url": "https://github.com/consolidation/config.git", + "reference": "b59a3b9ea750c21397f26a68fd2e04d9580af42e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/80afffd362bd1cf83bef60db690a8c50d8390803", - "reference": "80afffd362bd1cf83bef60db690a8c50d8390803", + "url": "https://api.github.com/repos/consolidation/config/zipball/b59a3b9ea750c21397f26a68fd2e04d9580af42e", + "reference": "b59a3b9ea750c21397f26a68fd2e04d9580af42e", "shasum": "" }, "require": { - "consolidation/output-formatters": "^3.1.5", - "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "psr/log": "~1", - "symfony/console": "^2.8|~3", - "symfony/event-dispatcher": "^2.5|~3", - "symfony/finder": "^2.5|~3" + "dflydev/dot-access-data": "^1.1.0", + "grasmash/yaml-expander": "^1.1", + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "^4", "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "^2.7" + "squizlabs/php_codesniffer": "2.*", + "symfony/console": "^2.5|^3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "Consolidation\\AnnotatedCommand\\": "src" + "Consolidation\\Config\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -101,30 +103,31 @@ "email": "greg.1.anderson@greenknowe.org" } ], - "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2017-02-04T06:13:54+00:00" + "description": "Provide configuration services for a commandline tool.", + "time": "2017-10-25T05:50:10+00:00" }, { "name": "consolidation/log", - "version": "1.0.3", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/consolidation/log.git", - "reference": "74ba81b4edc585616747cc5c5309ce56fec41254" + "reference": "dbc7c535f319a4a2d5a5077738f8eb7c10df8821" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/log/zipball/74ba81b4edc585616747cc5c5309ce56fec41254", - "reference": "74ba81b4edc585616747cc5c5309ce56fec41254", + "url": "https://api.github.com/repos/consolidation/log/zipball/dbc7c535f319a4a2d5a5077738f8eb7c10df8821", + "reference": "dbc7c535f319a4a2d5a5077738f8eb7c10df8821", "shasum": "" }, "require": { "php": ">=5.5.0", "psr/log": "~1.0", - "symfony/console": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4" }, "require-dev": { "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "dev-master", "squizlabs/php_codesniffer": "2.*" }, "type": "library", @@ -149,37 +152,37 @@ } ], "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "time": "2016-03-23T23:46:42+00:00" + "time": "2017-11-29T01:44:16+00:00" }, { "name": "consolidation/output-formatters", - "version": "3.1.7", + "version": "3.1.13", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "da39a0f14d5aaaee06732bb7cef2aea1de056b40" + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/da39a0f14d5aaaee06732bb7cef2aea1de056b40", - "reference": "da39a0f14d5aaaee06732bb7cef2aea1de056b40", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/3188461e965b32148c8fb85261833b2b72d34b8c", + "reference": "3188461e965b32148c8fb85261833b2b72d34b8c", "shasum": "" }, "require": { "php": ">=5.4.0", - "symfony/console": "~2.5|~3.0", - "symfony/finder": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4", + "symfony/finder": "^2.5|^3|^4" }, "require-dev": { - "phpunit/phpunit": "4.*", - "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "2.*", + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "^1.0.2 | dev-master", + "squizlabs/php_codesniffer": "^2.7", "victorjonsson/markdowndocs": "^1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { @@ -198,7 +201,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2017-01-21T06:26:40+00:00" + "time": "2017-11-29T15:25:38+00:00" }, { "name": "consolidation/robo", @@ -206,44 +209,46 @@ "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "cdc15c0059a1b2d5287910df678e8a73cbaa8ed6" + "reference": "ba32ac5f021387caa32166cc802cc01bd00a5504" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/cdc15c0059a1b2d5287910df678e8a73cbaa8ed6", - "reference": "cdc15c0059a1b2d5287910df678e8a73cbaa8ed6", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/ba32ac5f021387caa32166cc802cc01bd00a5504", + "reference": "ba32ac5f021387caa32166cc802cc01bd00a5504", "shasum": "" }, "require": { - "consolidation/annotated-command": "^2.2", + "consolidation/annotated-command": "^2.8.2", + "consolidation/config": "^1.0.1", "consolidation/log": "~1", - "consolidation/output-formatters": "^3.1.5", + "consolidation/output-formatters": "^3.1.13", + "grasmash/yaml-expander": "^1.3", "league/container": "^2.2", "php": ">=5.5.0", - "symfony/console": "~2.8|~3.0", - "symfony/event-dispatcher": "~2.5|~3.0", - "symfony/filesystem": "~2.5|~3.0", - "symfony/finder": "~2.5|~3.0", - "symfony/process": "~2.5|~3.0" + "symfony/console": "^2.8|^3|^4", + "symfony/event-dispatcher": "^2.5|^3|^4", + "symfony/filesystem": "^2.5|^3|^4", + "symfony/finder": "^2.5|^3|^4", + "symfony/process": "^2.5|^3|^4" }, "replace": { "codegyre/robo": "< 1.0" }, "require-dev": { - "codeception/aspect-mock": "~1", - "codeception/base": "^2.2.6", + "codeception/aspect-mock": "^1|^2.1.1", + "codeception/base": "^2.3.7", "codeception/verify": "^0.3.2", - "henrikbjorn/lurker": "~1", - "natxet/cssmin": "~3", + "greg-1-anderson/composer-test-scenarios": "^1", + "natxet/cssmin": "3.0.4", "patchwork/jsqueeze": "~2", "pear/archive_tar": "^1.4.2", "phpunit/php-code-coverage": "~2|~4", - "satooshi/php-coveralls": "~1", - "squizlabs/php_codesniffer": "~2" + "satooshi/php-coveralls": "^2", + "squizlabs/php_codesniffer": "^2.8" }, "suggest": { "henrikbjorn/lurker": "For monitoring filesystem changes in taskWatch", - "natxet/CssMin": "For minifying JS files in taskMinify", + "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." }, @@ -253,13 +258,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "1.x-dev", + "dev-state": "1.x-dev" } }, "autoload": { - "classmap": [ - "scripts/composer/ScriptHandler.php" - ], "psr-4": { "Robo\\": "src" } @@ -275,22 +278,25 @@ } ], "description": "Modern task runner", - "time": "2017-02-08 01:45:50" + "time": "2017-12-13 02:11:56" }, { "name": "container-interop/container-interop", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/container-interop/container-interop.git", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", "shasum": "" }, + "require": { + "psr/container": "^1.0" + }, "type": "library", "autoload": { "psr-4": { @@ -302,7 +308,67 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "time": "2014-12-30T15:22:37+00:00" + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+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" + } + }, + "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" + ], + "time": "2017-01-20T21:14:22+00:00" }, { "name": "glpi-project/coding-standard", @@ -391,26 +457,75 @@ ], "time": "2017-03-03T14:40:45+00:00" }, + { + "name": "grasmash/yaml-expander", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/grasmash/yaml-expander.git", + "reference": "3f45a3e1ff1d7ace6544c49f526127318abbb75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/grasmash/yaml-expander/zipball/3f45a3e1ff1d7ace6544c49f526127318abbb75c", + "reference": "3f45a3e1ff1d7ace6544c49f526127318abbb75c", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^1.1.0", + "php": ">=5.4", + "symfony/yaml": "^2.8.11|^3|^4" + }, + "require-dev": { + "greg-1-anderson/composer-test-scenarios": "^1", + "phpunit/phpunit": "^4.8|^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\\YamlExpander\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Grasmick" + } + ], + "description": "Expands internal property references in a yaml file.", + "time": "2017-12-08T17:42:26+00:00" + }, { "name": "league/container", - "version": "2.2.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/thephpleague/container.git", - "reference": "c0e7d947b690891f700dc4967ead7bdb3d6708c1" + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/container/zipball/c0e7d947b690891f700dc4967ead7bdb3d6708c1", - "reference": "c0e7d947b690891f700dc4967ead7bdb3d6708c1", + "url": "https://api.github.com/repos/thephpleague/container/zipball/43f35abd03a12977a60ffd7095efd6a7808488c0", + "reference": "43f35abd03a12977a60ffd7095efd6a7808488c0", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", - "php": ">=5.4.0" + "container-interop/container-interop": "^1.2", + "php": "^5.4.0 || ^7.0" }, "provide": { - "container-interop/container-interop-implementation": "^1.1" + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" }, "replace": { "orno/di": "~2.0" @@ -421,7 +536,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev", + "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, @@ -453,20 +568,20 @@ "provider", "service" ], - "time": "2016-03-17T11:07:59+00:00" + "time": "2017-05-10T09:20:27+00:00" }, { "name": "natxet/CssMin", - "version": "v3.0.4", + "version": "v3.0.5", "source": { "type": "git", "url": "https://github.com/natxet/CssMin.git", - "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39" + "reference": "9580f5448f05a82c96cfe6c7063a77807d8ec56d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/natxet/CssMin/zipball/92de3fe3ccb4f8298d31952490ef7d5395855c39", - "reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/9580f5448f05a82c96cfe6c7063a77807d8ec56d", + "reference": "9580f5448f05a82c96cfe6c7063a77807d8ec56d", "shasum": "" }, "require": { @@ -500,7 +615,7 @@ "css", "minify" ], - "time": "2015-09-25T11:13:11+00:00" + "time": "2017-10-04T16:54:00+00:00" }, { "name": "patchwork/jsqueeze", @@ -545,24 +660,21 @@ "time": "2015-03-25T10:11:08+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" + "php": ">=5.3.0" }, "type": "library", "extra": { @@ -572,9 +684,7 @@ }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -583,112 +693,20 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2015-12-27T11:43:31+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/log", @@ -739,16 +757,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.0", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "86dd55a522238211f9f3631e3361703578941d9a" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a", - "reference": "86dd55a522238211f9f3631e3361703578941d9a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -813,43 +831,49 @@ "phpcs", "standards" ], - "time": "2017-02-02T03:30:00+00:00" + "time": "2017-05-22T02:43:20+00:00" }, { "name": "symfony/console", - "version": "v3.2.3", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936" + "reference": "2cdef78de8f54f68ff16a857e710e7302b47d4c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a8405a9fc175f87fed8a3c40856b0d866d61936", - "reference": "7a8405a9fc175f87fed8a3c40856b0d866d61936", + "url": "https://api.github.com/repos/symfony/console/zipball/2cdef78de8f54f68ff16a857e710e7302b47d4c7", + "reference": "2cdef78de8f54f68ff16a857e710e7302b47d4c7", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/filesystem": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -876,37 +900,36 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-02-06T12:04:21+00:00" + "time": "2017-12-02T18:20:11+00:00" }, { "name": "symfony/debug", - "version": "v3.2.3", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477" + "reference": "fb2001e5d85f95d8b6ab94ae3be5d2672df128fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/b4d9818f127c60ce21ed62c395da7df868dc8477", - "reference": "b4d9818f127c60ce21ed62c395da7df868dc8477", + "url": "https://api.github.com/repos/symfony/debug/zipball/fb2001e5d85f95d8b6ab94ae3be5d2672df128fd", + "reference": "fb2001e5d85f95d8b6ab94ae3be5d2672df128fd", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -933,31 +956,34 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-28T02:37:08+00:00" + "time": "2017-11-21T09:01:46+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.3", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9137eb3a3328e413212826d63eeeb0217836e2b6" + "reference": "ca20b8f9ef149f40ff656d52965f240d85f7a8e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9137eb3a3328e413212826d63eeeb0217836e2b6", - "reference": "9137eb3a3328e413212826d63eeeb0217836e2b6", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ca20b8f9ef149f40ff656d52965f240d85f7a8e4", + "reference": "ca20b8f9ef149f40ff656d52965f240d85f7a8e4", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -966,7 +992,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -993,29 +1019,29 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:32:22+00:00" + "time": "2017-11-09T14:14:31+00:00" }, { "name": "symfony/filesystem", - "version": "v3.2.3", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4" + "reference": "de56eee71e0a128d8c54ccc1909cdefd574bad0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", - "reference": "a0c6ef2dc78d33b58d91d3a49f49797a184d06f4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/de56eee71e0a128d8c54ccc1909cdefd574bad0f", + "reference": "de56eee71e0a128d8c54ccc1909cdefd574bad0f", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1042,29 +1068,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-01-08T20:47:33+00:00" + "time": "2017-11-19T18:59:05+00:00" }, { "name": "symfony/finder", - "version": "v3.2.3", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8c71141cae8e2957946b403cc71a67213c0380d6" + "reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6", - "reference": "8c71141cae8e2957946b403cc71a67213c0380d6", + "url": "https://api.github.com/repos/symfony/finder/zipball/dac8d7db537bac7ad8143eb11360a8c2231f251a", + "reference": "dac8d7db537bac7ad8143eb11360a8c2231f251a", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1091,20 +1117,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:32:22+00:00" + "time": "2017-11-05T16:10:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -1116,7 +1142,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1150,29 +1176,29 @@ "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2017-10-11T12:05:26+00:00" }, { "name": "symfony/process", - "version": "v3.2.3", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "32646a7cf53f3956c76dcb5c82555224ae321858" + "reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/32646a7cf53f3956c76dcb5c82555224ae321858", - "reference": "32646a7cf53f3956c76dcb5c82555224ae321858", + "url": "https://api.github.com/repos/symfony/process/zipball/db25e810fd5e124085e3777257d0cf4ae533d0ea", + "reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1199,39 +1225,47 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-02-03T12:11:38+00:00" + "time": "2017-11-22T12:18:49+00:00" }, { - "name": "webmozart/assert", - "version": "1.2.0", + "name": "symfony/yaml", + "version": "v3.4.1", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "url": "https://github.com/symfony/yaml.git", + "reference": "f6a99b95b338799645fe9f7880d7d4ca1bf79cc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f6a99b95b338799645fe9f7880d7d4ca1bf79cc1", + "reference": "f6a99b95b338799645fe9f7880d7d4ca1bf79cc1", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" - } + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1239,19 +1273,64 @@ ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Assertions to validate method input/output with nice error messages.", + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-12-04T18:15:22+00:00" + }, + { + "name": "zendframework/zend-loader", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-loader.git", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Loader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-loader", "keywords": [ - "assert", - "check", - "validate" + "loader", + "zf2" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2015-06-03T14:05:47+00:00" } ], + "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], diff --git a/locales/es_ES.po b/locales/es_ES.po index 053f2ff4..00efbf67 100644 --- a/locales/es_ES.po +++ b/locales/es_ES.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 12:04+0100\n" -"PO-Revision-Date: 2017-03-20 11:05+0000\n" -"Last-Translator: Johan Cwiklinski \n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" +"PO-Revision-Date: 2017-12-13 13:22+0000\n" +"Last-Translator: Alexandre Delaunay \n" "Language-Team: Spanish (Spain) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/es_ES/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,23 +18,23 @@ msgstr "" "Language: es_ES\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 -#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 -#: inc/object_item.class.php:110 index.php:58 setup.php:190 +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 msgid "Objects management" msgstr "Gestión de objetos" -#: front/familylist.php:37 index.php:68 +#: index.php:68 front/familylist.php:37 msgid "Empty family" msgstr "Familia vacía" -#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 -#: front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 msgid "The requested dropdown does not exists" msgstr "La lista desplegable requerida no existe" -#: front/type.php:37 front/object.php:33 inc/type.class.php:68 -#: inc/profile.class.php:291 +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 msgid "Type of objects" msgstr "Tipo de objetos" @@ -46,113 +46,121 @@ msgstr "Campo(s) suprimido(s) correctamente" msgid "Field added successfully" msgstr "El campo fue añadido correctamente" -#: inc/type.class.php:180 +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campos asociados al objeto" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Término" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nombre en base de datos" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "Añadir un campo nuevo" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "Familia de tipos de objetos" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "General" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "Objetos" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Vista previa del objeto" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "Tiene que configurar los permisos para acceder a la vista previa" + +#: inc/type.class.php:153 msgid "Type name is missing" msgstr "Nombre de tipo es obligatorio" -#: inc/type.class.php:186 +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "" + +#: inc/type.class.php:165 msgid "" "Types 'field', 'object' and 'type' are reserved. Please choose another one" msgstr "Los nombres de tipo 'field', 'object' y 'type' son reservados. Tiene que elegir otro nombre" -#: inc/type.class.php:193 +#: inc/type.class.php:172 msgid "Type must start with a letter" msgstr "El nombre de tipo tiene que empezar con una letra" -#: inc/type.class.php:200 +#: inc/type.class.php:179 msgid "A type already exists with the same name" msgstr "Un tipo de objeto ya existe con el mismo nombre" -#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 -msgid "Family of type of objects" -msgstr "Familia de tipos de objetos" - -#: inc/type.class.php:440 +#: inc/type.class.php:419 msgid "Internal identifier" msgstr "Identificador interno" -#: inc/type.class.php:493 +#: inc/type.class.php:473 msgid "Behaviour" msgstr "Comportamiento" -#: inc/type.class.php:511 +#: inc/type.class.php:492 msgid "Network connections" msgstr "Conexiones de red" -#: inc/type.class.php:514 +#: inc/type.class.php:496 msgid "injection file plugin" msgstr "complemento Injection file" -#: inc/type.class.php:516 +#: inc/type.class.php:498 msgid "geninventorynumber plugin" msgstr "complemento Geninventorynumber" -#: inc/type.class.php:517 +#: inc/type.class.php:499 msgid "order plugin" msgstr "complemento Gestión de pedidos" -#: inc/type.class.php:518 +#: inc/type.class.php:500 msgid "item's uninstallation plugin" msgstr "complemento Item's uninstallation" -#: inc/type.class.php:519 +#: inc/type.class.php:501 msgid "simcard plugin" msgstr "" -#: inc/type.class.php:670 +#: inc/type.class.php:653 msgid "Regenerate files" msgstr "Generar de nuevo los ficheros" -#: inc/type.class.php:683 +#: inc/type.class.php:666 msgid "Link to other objects" msgstr "Enlace con otros objetos" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1932 +#: inc/type.class.php:1958 #, php-format msgid "Unable to load the class %1$s." msgstr "" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1934 +#: inc/type.class.php:1960 #, php-format msgid "" "You probably have garbage data in your database for this plugin and missing " "files in %1$s" msgstr "" - -#: inc/object.class.php:470 -msgid "Object preview" -msgstr "Vista previa del objeto" - -#: inc/object.class.php:732 -msgid "You must configure rights to enable the preview" -msgstr "Tiene que configurar los permisos para acceder a la vista previa" - -#: inc/profile.class.php:143 -msgid "General" -msgstr "General" - -#: inc/profile.class.php:149 -msgid "Objects" -msgstr "Objetos" - -#: inc/profile.class.php:151 -msgid "(No types defined yet)" -msgstr "" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Campos asociados al objeto" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Término" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nombre en base de datos" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Añadir un campo nuevo" diff --git a/locales/fr_FR.po b/locales/fr_FR.po index 15d7f8fb..1ef7c20f 100644 --- a/locales/fr_FR.po +++ b/locales/fr_FR.po @@ -3,6 +3,7 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: +# Alexandre Delaunay , 2017 # Manu1400 , 2016 # Johan Cwiklinski , 2016-2017 # Le Rohellec Benoit , 2015 @@ -11,9 +12,9 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 12:04+0100\n" -"PO-Revision-Date: 2017-03-20 11:07+0000\n" -"Last-Translator: Johan Cwiklinski \n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" +"PO-Revision-Date: 2017-12-13 13:24+0000\n" +"Last-Translator: Alexandre Delaunay \n" "Language-Team: French (France) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/fr_FR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,23 +22,23 @@ msgstr "" "Language: fr_FR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 -#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 -#: inc/object_item.class.php:110 index.php:58 setup.php:190 +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 msgid "Objects management" msgstr "Gestion d'objets" -#: front/familylist.php:37 index.php:68 +#: index.php:68 front/familylist.php:37 msgid "Empty family" msgstr "Famille vide" -#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 -#: front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 msgid "The requested dropdown does not exists" msgstr "L'intitulé demandé n'existe pas" -#: front/type.php:37 front/object.php:33 inc/type.class.php:68 -#: inc/profile.class.php:291 +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 msgid "Type of objects" msgstr "Types d'objets" @@ -49,113 +50,121 @@ msgstr "Champ(s) supprimé(s) avec succès" msgid "Field added successfully" msgstr "Champ ajouté avec succès" -#: inc/type.class.php:180 +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Champs associés à l'objet" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Libellé" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nom en base de données" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "Ajout d'un nouveau champ" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "Champ en lecture seule" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "Famille" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "Général" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "Objets" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "(Aucun type déjà défini)" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Prévisualisation d'un objet de ce type" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "Vous devez configurer les droits sur cet objet pour voir la prévisualisation" + +#: inc/type.class.php:153 msgid "Type name is missing" msgstr "Nom du type manquant" -#: inc/type.class.php:186 +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "Le nom du type doit être plus long" + +#: inc/type.class.php:165 msgid "" "Types 'field', 'object' and 'type' are reserved. Please choose another one" msgstr "Les types 'field', 'object' et 'type' sont réservés. Veuillez en choisir un autre" -#: inc/type.class.php:193 +#: inc/type.class.php:172 msgid "Type must start with a letter" msgstr "Le type doit commencer par une lettre" -#: inc/type.class.php:200 +#: inc/type.class.php:179 msgid "A type already exists with the same name" msgstr "Un type avec le même nom existe déjà" -#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 -msgid "Family of type of objects" -msgstr "Famille" - -#: inc/type.class.php:440 +#: inc/type.class.php:419 msgid "Internal identifier" msgstr "Indentifiant interne" -#: inc/type.class.php:493 +#: inc/type.class.php:473 msgid "Behaviour" msgstr "Comportement" -#: inc/type.class.php:511 +#: inc/type.class.php:492 msgid "Network connections" msgstr "Connexions réseaux" -#: inc/type.class.php:514 +#: inc/type.class.php:496 msgid "injection file plugin" msgstr "Plugin injection de fichiers" -#: inc/type.class.php:516 +#: inc/type.class.php:498 msgid "geninventorynumber plugin" msgstr "Plugin génération des numéros d'inventaire" -#: inc/type.class.php:517 +#: inc/type.class.php:499 msgid "order plugin" msgstr "Plugin gestion des commandes" -#: inc/type.class.php:518 +#: inc/type.class.php:500 msgid "item's uninstallation plugin" msgstr "Plugin de désinstallation des matériels" -#: inc/type.class.php:519 +#: inc/type.class.php:501 msgid "simcard plugin" msgstr "Plugin carte SIM" -#: inc/type.class.php:670 +#: inc/type.class.php:653 msgid "Regenerate files" msgstr "Regénérer les fichiers" -#: inc/type.class.php:683 +#: inc/type.class.php:666 msgid "Link to other objects" msgstr "Liaison avec d'autres objets" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1932 +#: inc/type.class.php:1958 #, php-format msgid "Unable to load the class %1$s." -msgstr "Impossible de charger la classe %1$s." +msgstr "Impossible de charger la classe %1$s" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1934 +#: inc/type.class.php:1960 #, php-format msgid "" "You probably have garbage data in your database for this plugin and missing " "files in %1$s" msgstr "Vous avez probablement d'anciennes données dans votre base pour ce plugin ou des fichiers manquants dans %1$s" - -#: inc/object.class.php:470 -msgid "Object preview" -msgstr "Prévisualisation d'un objet de ce type" - -#: inc/object.class.php:732 -msgid "You must configure rights to enable the preview" -msgstr "Vous devez configurer les droits sur cet objet pour voir la prévisualisation" - -#: inc/profile.class.php:143 -msgid "General" -msgstr "Général" - -#: inc/profile.class.php:149 -msgid "Objects" -msgstr "Objets" - -#: inc/profile.class.php:151 -msgid "(No types defined yet)" -msgstr "(Aucun type d'objet défini)" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Champs associés à l'objet" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Libellé" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nom en base de données" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Ajout d'un nouveau champ" diff --git a/locales/genericobject.pot b/locales/genericobject.pot index dd78722a..f15822fc 100644 --- a/locales/genericobject.pot +++ b/locales/genericobject.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 12:04+0100\n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,23 +17,23 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 -#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 -#: inc/object_item.class.php:110 index.php:58 setup.php:190 +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 msgid "Objects management" msgstr "" -#: front/familylist.php:37 index.php:68 +#: index.php:68 front/familylist.php:37 msgid "Empty family" msgstr "" -#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 -#: front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 msgid "The requested dropdown does not exists" msgstr "" -#: front/type.php:37 front/object.php:33 inc/type.class.php:68 -#: inc/profile.class.php:291 +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 msgid "Type of objects" msgstr "" @@ -45,113 +45,121 @@ msgstr "" msgid "Field added successfully" msgstr "" -#: inc/type.class.php:180 +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "" + +#: inc/type.class.php:153 msgid "Type name is missing" msgstr "" -#: inc/type.class.php:186 +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "" + +#: inc/type.class.php:165 msgid "" "Types 'field', 'object' and 'type' are reserved. Please choose another one" msgstr "" -#: inc/type.class.php:193 +#: inc/type.class.php:172 msgid "Type must start with a letter" msgstr "" -#: inc/type.class.php:200 +#: inc/type.class.php:179 msgid "A type already exists with the same name" msgstr "" -#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 -msgid "Family of type of objects" -msgstr "" - -#: inc/type.class.php:440 +#: inc/type.class.php:419 msgid "Internal identifier" msgstr "" -#: inc/type.class.php:493 +#: inc/type.class.php:473 msgid "Behaviour" msgstr "" -#: inc/type.class.php:511 +#: inc/type.class.php:492 msgid "Network connections" msgstr "" -#: inc/type.class.php:514 +#: inc/type.class.php:496 msgid "injection file plugin" msgstr "" -#: inc/type.class.php:516 +#: inc/type.class.php:498 msgid "geninventorynumber plugin" msgstr "" -#: inc/type.class.php:517 +#: inc/type.class.php:499 msgid "order plugin" msgstr "" -#: inc/type.class.php:518 +#: inc/type.class.php:500 msgid "item's uninstallation plugin" msgstr "" -#: inc/type.class.php:519 +#: inc/type.class.php:501 msgid "simcard plugin" msgstr "" -#: inc/type.class.php:670 +#: inc/type.class.php:653 msgid "Regenerate files" msgstr "" -#: inc/type.class.php:683 +#: inc/type.class.php:666 msgid "Link to other objects" msgstr "" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1932 +#: inc/type.class.php:1958 #, php-format msgid "Unable to load the class %1$s." msgstr "" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1934 +#: inc/type.class.php:1960 #, php-format msgid "" "You probably have garbage data in your database for this plugin and missing " "files in %1$s" msgstr "" - -#: inc/object.class.php:470 -msgid "Object preview" -msgstr "" - -#: inc/object.class.php:732 -msgid "You must configure rights to enable the preview" -msgstr "" - -#: inc/profile.class.php:143 -msgid "General" -msgstr "" - -#: inc/profile.class.php:149 -msgid "Objects" -msgstr "" - -#: inc/profile.class.php:151 -msgid "(No types defined yet)" -msgstr "" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "" diff --git a/locales/it_IT.po b/locales/it_IT.po index ffcfbbd1..96705599 100644 --- a/locales/it_IT.po +++ b/locales/it_IT.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 12:04+0100\n" -"PO-Revision-Date: 2017-03-20 11:05+0000\n" -"Last-Translator: Johan Cwiklinski \n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" +"PO-Revision-Date: 2017-12-13 13:22+0000\n" +"Last-Translator: Alexandre Delaunay \n" "Language-Team: Italian (Italy) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/it_IT/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,23 +18,23 @@ msgstr "" "Language: it_IT\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 -#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 -#: inc/object_item.class.php:110 index.php:58 setup.php:190 +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 msgid "Objects management" msgstr "Gestione degli Oggetti" -#: front/familylist.php:37 index.php:68 +#: index.php:68 front/familylist.php:37 msgid "Empty family" msgstr "Famiglia vuota" -#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 -#: front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 msgid "The requested dropdown does not exists" msgstr "Il menù a discesa richiesto non esiste" -#: front/type.php:37 front/object.php:33 inc/type.class.php:68 -#: inc/profile.class.php:291 +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 msgid "Type of objects" msgstr "Tipo di oggetti" @@ -46,113 +46,121 @@ msgstr "Campo(i) rimosso/i con successo" msgid "Field added successfully" msgstr "Campo aggiunto con successo" -#: inc/type.class.php:180 +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campi associati con l'oggetto" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Etichetta" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nome nel DataBase" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "Aggiungi nuovo campo" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "Famiglia" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "Generale" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "Oggetti" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Anteprima dell'oggetto" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "Bisogna configurare i diritti per abilitare l'anteprima" + +#: inc/type.class.php:153 msgid "Type name is missing" msgstr "Il nome del tipo non è presente" -#: inc/type.class.php:186 +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "" + +#: inc/type.class.php:165 msgid "" "Types 'field', 'object' and 'type' are reserved. Please choose another one" msgstr "I tipi 'field', 'object' e 'type' sono riservati. Sceglierne un altro" -#: inc/type.class.php:193 +#: inc/type.class.php:172 msgid "Type must start with a letter" msgstr "Il nome del tipo deve cominciare con una lettera" -#: inc/type.class.php:200 +#: inc/type.class.php:179 msgid "A type already exists with the same name" msgstr "Un tipo con lo stesso nome esiste già" -#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 -msgid "Family of type of objects" -msgstr "Famiglia" - -#: inc/type.class.php:440 +#: inc/type.class.php:419 msgid "Internal identifier" msgstr "Identificatore interno" -#: inc/type.class.php:493 +#: inc/type.class.php:473 msgid "Behaviour" msgstr "Comportamento" -#: inc/type.class.php:511 +#: inc/type.class.php:492 msgid "Network connections" msgstr "Connessioni di rete" -#: inc/type.class.php:514 +#: inc/type.class.php:496 msgid "injection file plugin" msgstr "injection file plugin" -#: inc/type.class.php:516 +#: inc/type.class.php:498 msgid "geninventorynumber plugin" msgstr "geninventorynumber plugin" -#: inc/type.class.php:517 +#: inc/type.class.php:499 msgid "order plugin" msgstr "order plugin" -#: inc/type.class.php:518 +#: inc/type.class.php:500 msgid "item's uninstallation plugin" msgstr "item's uninstallation plugin" -#: inc/type.class.php:519 +#: inc/type.class.php:501 msgid "simcard plugin" msgstr "simcard plugin" -#: inc/type.class.php:670 +#: inc/type.class.php:653 msgid "Regenerate files" msgstr "Rigenera file" -#: inc/type.class.php:683 +#: inc/type.class.php:666 msgid "Link to other objects" msgstr "Collega ad altri oggetti" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1932 +#: inc/type.class.php:1958 #, php-format msgid "Unable to load the class %1$s." msgstr "" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1934 +#: inc/type.class.php:1960 #, php-format msgid "" "You probably have garbage data in your database for this plugin and missing " "files in %1$s" msgstr "" - -#: inc/object.class.php:470 -msgid "Object preview" -msgstr "Anteprima dell'oggetto" - -#: inc/object.class.php:732 -msgid "You must configure rights to enable the preview" -msgstr "Bisogna configurare i diritti per abilitare l'anteprima" - -#: inc/profile.class.php:143 -msgid "General" -msgstr "Generale" - -#: inc/profile.class.php:149 -msgid "Objects" -msgstr "Oggetti" - -#: inc/profile.class.php:151 -msgid "(No types defined yet)" -msgstr "" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Campi associati con l'oggetto" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Etichetta" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nome nel DataBase" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Aggiungi nuovo campo" diff --git a/locales/pt_BR.po b/locales/pt_BR.po new file mode 100644 index 00000000..8deaa61c --- /dev/null +++ b/locales/pt_BR.po @@ -0,0 +1,167 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# polar147 , 2017 +# Arthur Ramos Schaefer , 2017 +msgid "" +msgstr "" +"Project-Id-Version: GLPI Plugin - Genericobject\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" +"PO-Revision-Date: 2017-12-13 13:22+0000\n" +"Last-Translator: Alexandre Delaunay \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/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" + +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 +msgid "Objects management" +msgstr "Gerenciamento de objetos" + +#: index.php:68 front/familylist.php:37 +msgid "Empty family" +msgstr "Família vazia" + +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 +msgid "The requested dropdown does not exists" +msgstr "O menu suspenso solicitado não existe" + +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 +msgid "Type of objects" +msgstr "Tipos de objetos" + +#: front/field.form.php:41 +msgid "Field(s) deleted successfully" +msgstr "Campo(s) excluído(s) com sucesso" + +#: front/field.form.php:51 +msgid "Field added successfully" +msgstr "Campo adicionado com sucesso" + +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campos associados com o objeto" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Etiqueta" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nome no banco de dados" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "Adicionar novo campo" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "Família de tipo de objetos" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "Geral" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "Objetos" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Pré-visualização do objet" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "Você deve configurar os direitos para habilitar pré-visualização" + +#: inc/type.class.php:153 +msgid "Type name is missing" +msgstr "O nome do tipo está faltando" + +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "" + +#: inc/type.class.php:165 +msgid "" +"Types 'field', 'object' and 'type' are reserved. Please choose another one" +msgstr "Tipos 'campo', 'objeto' e 'tipo' estão reservados. Por favor escolha outro" + +#: inc/type.class.php:172 +msgid "Type must start with a letter" +msgstr "O tipo deve começar com uma letra" + +#: inc/type.class.php:179 +msgid "A type already exists with the same name" +msgstr "Um tipo com o mesmo nome já existe " + +#: inc/type.class.php:419 +msgid "Internal identifier" +msgstr "Identificador interno" + +#: inc/type.class.php:473 +msgid "Behaviour" +msgstr "Comportamento" + +#: inc/type.class.php:492 +msgid "Network connections" +msgstr "Conexões de rede" + +#: inc/type.class.php:496 +msgid "injection file plugin" +msgstr "plugin datainjection" + +#: inc/type.class.php:498 +msgid "geninventorynumber plugin" +msgstr "plugin getinventorynumber" + +#: inc/type.class.php:499 +msgid "order plugin" +msgstr "plugin order" + +#: inc/type.class.php:500 +msgid "item's uninstallation plugin" +msgstr "plugin item's uninstallation" + +#: inc/type.class.php:501 +msgid "simcard plugin" +msgstr "plugin simcard" + +#: inc/type.class.php:653 +msgid "Regenerate files" +msgstr "Regenerar arquivos" + +#: inc/type.class.php:666 +msgid "Link to other objects" +msgstr "Conexão com outros objetos" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1958 +#, php-format +msgid "Unable to load the class %1$s." +msgstr "" + +#. TRANS: %1$s is itemtype name +#: inc/type.class.php:1960 +#, php-format +msgid "" +"You probably have garbage data in your database for this plugin and missing " +"files in %1$s" +msgstr "" diff --git a/locales/ro_RO.po b/locales/ro_RO.po index 7a5bf524..57591447 100644 --- a/locales/ro_RO.po +++ b/locales/ro_RO.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 12:04+0100\n" -"PO-Revision-Date: 2017-03-20 11:05+0000\n" -"Last-Translator: Johan Cwiklinski \n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" +"PO-Revision-Date: 2017-12-13 13:22+0000\n" +"Last-Translator: Alexandre Delaunay \n" "Language-Team: Romanian (Romania) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/ro_RO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,23 +18,23 @@ msgstr "" "Language: ro_RO\n" "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" -#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 -#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 -#: inc/object_item.class.php:110 index.php:58 setup.php:190 +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 msgid "Objects management" msgstr "Managementul obiectelor" -#: front/familylist.php:37 index.php:68 +#: index.php:68 front/familylist.php:37 msgid "Empty family" msgstr "Familie vida" -#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 -#: front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 msgid "The requested dropdown does not exists" msgstr "Dropdown-ul solicitat nu exista" -#: front/type.php:37 front/object.php:33 inc/type.class.php:68 -#: inc/profile.class.php:291 +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 msgid "Type of objects" msgstr "Tipul obiectelor" @@ -46,113 +46,121 @@ msgstr "Campul(urile) sterse cu succes" msgid "Field added successfully" msgstr "Camp adaugat cu succes" -#: inc/type.class.php:180 +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Campuri asociate la obiect" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Eticheta" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Nume in DB" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "Add camp nou" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "Familia tipului de obiecte" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "General" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "Obiecte" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Previzualizeaza un obiect de acest tip" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "Trebuie sa configurati drepturi pe acest obiect pentru a putea previzualiza" + +#: inc/type.class.php:153 msgid "Type name is missing" msgstr "Nume tip lipseste" -#: inc/type.class.php:186 +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "" + +#: inc/type.class.php:165 msgid "" "Types 'field', 'object' and 'type' are reserved. Please choose another one" msgstr "Tipurile 'camp', 'obiect', si 'tip' sunt rezervate.Va rugam alegeti altul" -#: inc/type.class.php:193 +#: inc/type.class.php:172 msgid "Type must start with a letter" msgstr "Tipul trebuie sa inceapa cu o litera" -#: inc/type.class.php:200 +#: inc/type.class.php:179 msgid "A type already exists with the same name" msgstr "UN tip cu acelasi nume exista deja" -#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 -msgid "Family of type of objects" -msgstr "Familia tipului de obiecte" - -#: inc/type.class.php:440 +#: inc/type.class.php:419 msgid "Internal identifier" msgstr "Identificator intern" -#: inc/type.class.php:493 +#: inc/type.class.php:473 msgid "Behaviour" msgstr "Comportament" -#: inc/type.class.php:511 +#: inc/type.class.php:492 msgid "Network connections" msgstr "Conexiuni retea" -#: inc/type.class.php:514 +#: inc/type.class.php:496 msgid "injection file plugin" msgstr "Plugin injectare fisiere" -#: inc/type.class.php:516 +#: inc/type.class.php:498 msgid "geninventorynumber plugin" msgstr "geninventorynumber plugin" -#: inc/type.class.php:517 +#: inc/type.class.php:499 msgid "order plugin" msgstr "Plugin gestiune comenzi" -#: inc/type.class.php:518 +#: inc/type.class.php:500 msgid "item's uninstallation plugin" msgstr "Plugin dezinstalare elemente" -#: inc/type.class.php:519 +#: inc/type.class.php:501 msgid "simcard plugin" msgstr "" -#: inc/type.class.php:670 +#: inc/type.class.php:653 msgid "Regenerate files" msgstr "Fisiere regenerate" -#: inc/type.class.php:683 +#: inc/type.class.php:666 msgid "Link to other objects" msgstr "Linck catre alte obiecte" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1932 +#: inc/type.class.php:1958 #, php-format msgid "Unable to load the class %1$s." msgstr "" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1934 +#: inc/type.class.php:1960 #, php-format msgid "" "You probably have garbage data in your database for this plugin and missing " "files in %1$s" msgstr "" - -#: inc/object.class.php:470 -msgid "Object preview" -msgstr "Previzualizeaza un obiect de acest tip" - -#: inc/object.class.php:732 -msgid "You must configure rights to enable the preview" -msgstr "Trebuie sa configurati drepturi pe acest obiect pentru a putea previzualiza" - -#: inc/profile.class.php:143 -msgid "General" -msgstr "General" - -#: inc/profile.class.php:149 -msgid "Objects" -msgstr "Obiecte" - -#: inc/profile.class.php:151 -msgid "(No types defined yet)" -msgstr "" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Campuri asociate la obiect" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Eticheta" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Nume in DB" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Add camp nou" diff --git a/locales/tr_TR.po b/locales/tr_TR.po index f9673ad2..caea5059 100644 --- a/locales/tr_TR.po +++ b/locales/tr_TR.po @@ -3,14 +3,14 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# Kaya Zeren , 2015-2016 +# Kaya Zeren , 2015-2017 msgid "" msgstr "" "Project-Id-Version: GLPI Plugin - Genericobject\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-20 12:04+0100\n" -"PO-Revision-Date: 2017-03-20 11:05+0000\n" -"Last-Translator: Johan Cwiklinski \n" +"POT-Creation-Date: 2017-12-13 14:17+0100\n" +"PO-Revision-Date: 2017-12-13 13:22+0000\n" +"Last-Translator: Alexandre Delaunay \n" "Language-Team: Turkish (Turkey) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/tr_TR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,23 +18,23 @@ msgstr "" "Language: tr_TR\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: front/familylist.php:33 front/familylist.php:41 front/type.form.php:73 -#: inc/type.class.php:306 inc/type.class.php:389 inc/profile.class.php:39 -#: inc/object_item.class.php:110 index.php:58 setup.php:190 +#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33 +#: front/familylist.php:41 inc/profile.class.php:39 +#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368 msgid "Objects management" msgstr "Nesne yönetimi" -#: front/familylist.php:37 index.php:68 +#: index.php:68 front/familylist.php:37 msgid "Empty family" msgstr "Aile boş" -#: front/commontreedropdown.form.php:36 front/commondropdown.form.php:36 -#: front/commondropdown.php:11 +#: front/commontreedropdown.form.php:36 front/commondropdown.php:11 +#: front/commondropdown.form.php:36 msgid "The requested dropdown does not exists" msgstr "İstenen açılan kutu bulunamadı" -#: front/type.php:37 front/object.php:33 inc/type.class.php:68 -#: inc/profile.class.php:291 +#: front/type.php:38 front/object.php:33 inc/profile.class.php:288 +#: inc/type.class.php:66 msgid "Type of objects" msgstr "Nesne tipi" @@ -46,113 +46,121 @@ msgstr "Alanlar silindi" msgid "Field added successfully" msgstr "Alan eklendi" -#: inc/type.class.php:180 +#: inc/field.class.php:64 +msgid "Fields associated with the object" +msgstr "Nesne ile ilişkilendirilmiş alanlar" + +#: inc/field.class.php:70 +msgid "Label" +msgstr "Etiket" + +#: inc/field.class.php:71 +msgid "Name in DB" +msgstr "Veritabanındaki Ad" + +#: inc/field.class.php:126 +msgid "Add new field" +msgstr "Alan ekle" + +#: inc/field.class.php:317 +msgid "Read-only field" +msgstr "" + +#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458 +msgid "Family of type of objects" +msgstr "Nesnelerin aile tipi" + +#: inc/profile.class.php:142 +msgid "General" +msgstr "Genel" + +#: inc/profile.class.php:148 +msgid "Objects" +msgstr "Nesneler" + +#: inc/profile.class.php:150 +msgid "(No types defined yet)" +msgstr "" + +#: inc/object.class.php:471 +msgid "Object preview" +msgstr "Nesne önizleme" + +#: inc/object.class.php:751 +msgid "You must configure rights to enable the preview" +msgstr "Önizleyebilmek için izinleri ayarlamalısınız" + +#: inc/type.class.php:153 msgid "Type name is missing" msgstr "Tip adı eksik" -#: inc/type.class.php:186 +#: inc/type.class.php:159 +msgid "Type name must be longer" +msgstr "" + +#: inc/type.class.php:165 msgid "" "Types 'field', 'object' and 'type' are reserved. Please choose another one" msgstr "field', 'object' ve 'type' tipleri ayrılmış olduğundan kullanılamaz. Lütfen başka bir tip seçin" -#: inc/type.class.php:193 +#: inc/type.class.php:172 msgid "Type must start with a letter" msgstr "Tip bir harf ile başlamalıdır" -#: inc/type.class.php:200 +#: inc/type.class.php:179 msgid "A type already exists with the same name" msgstr "Aynı adlı bir tip zaten var" -#: inc/type.class.php:360 inc/type.class.php:479 inc/typefamily.class.php:36 -msgid "Family of type of objects" -msgstr "Nesnelerin aile tipi" - -#: inc/type.class.php:440 +#: inc/type.class.php:419 msgid "Internal identifier" msgstr "İç belirteç" -#: inc/type.class.php:493 +#: inc/type.class.php:473 msgid "Behaviour" msgstr "Davranış" -#: inc/type.class.php:511 +#: inc/type.class.php:492 msgid "Network connections" msgstr "Ağ bağlantıları" -#: inc/type.class.php:514 +#: inc/type.class.php:496 msgid "injection file plugin" msgstr "dosya gönderme uygulama eki" -#: inc/type.class.php:516 +#: inc/type.class.php:498 msgid "geninventorynumber plugin" msgstr "stoknumarasiolustur uygulama eki" -#: inc/type.class.php:517 +#: inc/type.class.php:499 msgid "order plugin" msgstr "sıralama uygulama eki" -#: inc/type.class.php:518 +#: inc/type.class.php:500 msgid "item's uninstallation plugin" msgstr "ögeyi kaldırma uygulama eki" -#: inc/type.class.php:519 +#: inc/type.class.php:501 msgid "simcard plugin" msgstr "sim kart uygulama eki" -#: inc/type.class.php:670 +#: inc/type.class.php:653 msgid "Regenerate files" msgstr "Dosyaları yeniden oluştur" -#: inc/type.class.php:683 +#: inc/type.class.php:666 msgid "Link to other objects" msgstr "Diğer nesnelere bağlantı" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1932 +#: inc/type.class.php:1958 #, php-format msgid "Unable to load the class %1$s." msgstr "" #. TRANS: %1$s is itemtype name -#: inc/type.class.php:1934 +#: inc/type.class.php:1960 #, php-format msgid "" "You probably have garbage data in your database for this plugin and missing " "files in %1$s" msgstr "" - -#: inc/object.class.php:470 -msgid "Object preview" -msgstr "Nesne önizleme" - -#: inc/object.class.php:732 -msgid "You must configure rights to enable the preview" -msgstr "Önizleyebilmek için izinleri ayarlamalısınız" - -#: inc/profile.class.php:143 -msgid "General" -msgstr "Genel" - -#: inc/profile.class.php:149 -msgid "Objects" -msgstr "Nesneler" - -#: inc/profile.class.php:151 -msgid "(No types defined yet)" -msgstr "" - -#: inc/field.class.php:64 -msgid "Fields associated with the object" -msgstr "Nesne ile ilişkilendirilmiş alanlar" - -#: inc/field.class.php:70 -msgid "Label" -msgstr "Etiket" - -#: inc/field.class.php:71 -msgid "Name in DB" -msgstr "Veritabanındaki Ad" - -#: inc/field.class.php:110 -msgid "Add new field" -msgstr "Alan ekle" From 8a5251d61f7e5b77185c536cd3e1e97b39daa3fa Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 13 Dec 2017 14:40:39 +0100 Subject: [PATCH 40/40] Generate MOs --- locales/es_ES.mo | Bin 2619 -> 2633 bytes locales/fr_FR.mo | Bin 3033 -> 3177 bytes locales/it_IT.mo | Bin 2546 -> 2560 bytes locales/pt_BR.mo | Bin 0 -> 2600 bytes locales/ro_RO.mo | Bin 2550 -> 2564 bytes locales/tr_TR.mo | Bin 2509 -> 2523 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 locales/pt_BR.mo diff --git a/locales/es_ES.mo b/locales/es_ES.mo index d2026bdfb62338479af15aec8bad0a6e82661bf4..17a662fb32cf0e257a02db6fea7acc7d56cc7784 100644 GIT binary patch delta 347 zcmXxeze)o^5XbR3&2dQtMU8(@qAO{XkeIs&fx{xArCNwqVzHQ0guM$~641(4K`Set zz{WyI=@VE8c?T;|YX14nV!dW7?2 zgC)GOKH?mCfL!^YOyM_XF-Muj37o+)j^n1y2U$7!Ta0N;GU#CuuW=b4(8q!859LJ0 z$O;d!hE2S|1$@Qd4}IbidU=sWTTx^nf4MuEAHW4Sb^rhX delta 333 zcmXZWKTE?v7=ZCNm}pf{)cOZYG}^@?sh4V(;1Ey{L~(HwloP8BEh!{{ih_OuC#Noc z2BD*a(9I9vsGEbkOVPnc$#L9|=RFSYCI6IvG>zL=L!@Yltcgf}P-F&6Ln31sWFBCF zKE@(mWj^3M-9xs#aZKX}=I|Tm&?IKj#tE!uy_1vk|A!|GrntC38?SK%JLq9An}6Xr zJvl6Lgv%J<4KCm_{(a~jm#~kESm=Hloq!t}52Zo=#Ht uFxFAh)M+dBo!wSlN6uC|Y&63tX@t&Z8tbH9i-Suyjn2xaweF9#Z~g+M-84S{ diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo index 4d5af5594b634db2f238c73407f2127a8ab3160b..86e56c458b90b797ea123918a31875bd437ac862 100644 GIT binary patch delta 1015 zcmX}qO=uHA6u|LGn${*-wIBAwT06G&qn2&6X`vFOSS(hhQa=jSgUGf!*2rcPlZ`eY z1o2V?p%A=RJXt&lxp)x|Me!nd^`NLIQZHV_gCO{SvHD>1o86tvy!U3`wyn39-Zw?= zE25Wc7uQHgsUe&S^F!3vDAkHlJb)S-@FYfY7Pp{-9q3~_E@2lwz&-dJH{nNY#&xV! zs-%81*ujIEh*B}^K$*~oTk#OeA1AR1r*Rw3;dad7KD>jn;VQP^E0jduq0Ik@r?8G) zcjH+cVt8udNvNgnZ$}QIR5*!}&Sg5$0OI9eJ5>nx{wd_oY7v! zUog4KltXrmb`4Mk=4m_|}9In50g`?NMuE-f%K8G7u+X zQ%*jxW^#_7_naV;OX_jYEIPiMGkU^!PQiDI`iQ$R8g%}>Ji3r}Qr_TvCOyUye&t(T zQ>b?B(Y3XeO1OS8)Ozfylg?`6YtPIF1s2Pjf@jLb=*`|Kqy0=;y9FH-vqrm_RG`;Z V1LkDCLcUs6`FnJ!vKVthe*g#wj|2b! delta 849 zcmY+?zfTik9LMqJ%27%SsDQSh=xLNnv~VCw(lCg+NW`Tk{#eX4G`2#nNqbRbA)QQI zFD7pO0j7hwI662XF;2P|qX}^kCUrC>>iYw?@T7OI=efJy_s4VFxlh@(ul@E@!#K`y zgyW=T%mkiIaAIuXA>78(y3k=vFN|R~&R`GD;SgTO99D4zTc~$G$1Z$>1Gs^m#;lny zOb&A48>aDh{D5s6)5ki8`ePpZaRT?_B^<>PD$ptp;xpWbZJfu~cob7aQ(<|$jW=zAR za~n8FeDi?`KeNS20e)c?`*=#N8bt*xA~~2csslAtt5;Di4)GMeLUrOZs(_zZ!hiAo z5^Y{!{Rq$dOxBqc@Iq!cfkhl+-HO*QPyyc}jWE68W@6x~J`mNX5K3PuXd`%NC%iUG z^=c?>^+<2gP?-lf)OQoM6WKWxtZky{dxpL}c5u%)#!7{2P}5Ggov5?pt`!EhAN{e{ zt&DrFFy%UvQ$=?=e4iY-60awV?#vmNk-p|NgTjr5=Qo$Vpx!7t^YyCdJC`5UmX>RN zbE)Rc1`V%Stu!vK6as&7yj+Q9yRud?UoYRU1ktV3iWPqEeh{|OkFD`2mGP|q^ub>e diff --git a/locales/it_IT.mo b/locales/it_IT.mo index 49c5e9745cc7587bc09338822299e949152390a8..12bc64d2fd4868b2d77deac34f0de90eb23aa646 100644 GIT binary patch delta 372 zcmX}ny-EW?5Ww+CLNtjNB_xVLgWITuB;+o_!C|4ImD-5CY|J6bYo`6&)d4@M$i%Blcqk#on#vUQ>Ill8_HaFO#AjeT{(>NhGSW4 zbt1Q~d;RKBp#7ew`<=j1Tb_HV{Z`H%5> zEdn9vJ*q{}Dtduv7exPop|kmMJ~)SSUi>ON577(McV{QDny8DxfTl3BfC)wHVCY`uDQpQ`M|dDYfy zOPa_Wx+b)o!1Ybr4LgCY4mwTOSG#9ktL^!w<*AJ@a80ujYz BG-dz* diff --git a/locales/pt_BR.mo b/locales/pt_BR.mo new file mode 100644 index 0000000000000000000000000000000000000000..e6a587d1e1eb63a3530d23e5e80566b02a75d673 GIT binary patch literal 2600 zcmZvd&u<(x6vqveA6?3?0);-Y+$S-jKiE9sVLP+p^GrLKFTABTf$M*Ak-)F!4 zynDw-0__Dn&*Ry3j}TMfUm&+D_X;ryUIiZkzX5lG-+{ZpU%TR zfhWKR!8Z6Lcmcd0d>4Eg`~a+hACJaA2OmZM7Rc+q26uzsf{%m0f(OArK;CEH4k4Zb zUjrWlSHU;Hx4}Ai9c2H$2YJ8WL5_1LoM8VCg1p~h@HfOf55A246gFqOt02c6gFNpN zxDR{}WILaL9Oo^NHT)5T3GpY$`-z9jKd}eobuWT@z&Y>`46J>&in@+6Awo1i{HWw*avIxj+Ikd`=X+x*x#i|Me z>n>7kje)b;8ZXY4epBvLU#r2WJO1n`lSXz`hMmN^>Xt491#MF0MGLw)b*WIE{Y{+B z6FV@JSmnvsFw$7GSof^(fqalIRDnr?2neJaW#LIk65g0(#ce9KzImuN~N+ea+6-inJ(X^<#_N!HBqHgICvsic{ULchg))`ADNm&Zs<(V?pZa zXqS2(-kD#oPu0#WpIO}2vN1hVTd=r12I1hyG%2W!P|s7T%^XgObY6vH=UPkA(d~Kc zNk_S8(Zn{v$!yZmwhmhXHL2XIh7{pyMoZRZzDWk|q3e&$&T(?_dTi3racWG>)x^1s zg3c}OU`CcQgI}$oI-T z>QY&iM#U(WiFGJ9T%)X53>xJjNce8l#_+RI*hO%#GInp3qc@h?5+bwT32eaYa>-5H zdwg;#QDV&vuSYnsg-rEjIlRX95KU>PEL{5s}S~Oam^8 z6)hyB3}YN}^$si;J3$K740G`U18|@!XeHNr=8M}%PV9ayXxJewWMro@i%Zl8I|;KxD}fSrid(SY#BBwPkGsXUVT{ z67O*ypLO0vO8T@cexiv(v}v?3g{x?xhby>a%E{luD!~*%jN^EN3;2Y~_=Xwm;TV45 z9vUMeB|N|xe8k@mUonSWy}x(*iHE_o83PU2JxNkf)RxwW> z;WS?3BHo+6kBq$Vv%!^4Imq$wm7bdY=mg${0h z0u`YMf{Tlb;NUEN1iyp-VDy&X-Fw_|_wIZ;4;3r@vP8CvA~g|FlOj{tMjLnYdLI|4 zkFbI<&S8pmyhKLGBhKP8mhcUi@BV delta 358 zcmX}ny-EW?5Ww+?As?PWG3Q4S1B+lKCwozw!$LGR60q?FR&tml;STQ(vJAn^~A)=G*;rUmB(HS4m{ABGML-W=&)oH98m+^#LwW zA7KOgIEQDrhL^|)dB9nG#wxyH3qR1spTb|X{k6J`rB1TUV?Pwy292xOLxl<2!PjUP zyTem_L?4@Mt+0zL7@|Gs3YYL67x5Lj_dn)k;!NF^XY{7m(aP@xdh6z?((V?uAL#9M zO*lQ1<=$~>;%sE{Bn{MIGBB~)KaYl^D9(nF+R0Os4Z?Ky!pr0S#z{D7Ro}~hnglU#