diff --git a/build/composer/README b/build/composer/README index d58359defec..e6846f2f09b 100644 --- a/build/composer/README +++ b/build/composer/README @@ -1,10 +1,19 @@ -To test upgrade of a lib with composer: +* To list packages -composer update --no-dev --no-autoloader --dry-run ccampbell/chromephp +composer show -i -To upgrade a lib with composer: +* To test upgrade of a lib with composer: + +Remove entry in composer.lock +Edit composer.json to change version to "x.y.z" +composer -v update --root-reqs --no-dev --no-autoloader --dry-run ccampbell/chromephp + +* To upgrade a lib with composer: + +Remove entry in composer.lock +Edit composer.json to change version to "x.y.z" +composer -v update --root-reqs --no-dev --no-autoloader ccampbell/chromephp -composer update --no-dev --no-autoloader ccampbell/chromephp diff --git a/build/debian/README.howto b/build/debian/README.howto index cd7cd93c24e..696ea9a2bef 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -295,12 +295,16 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER * Edit orig.tar.gz file to remove - debian - htdocs/includes/ckeditor -- htdocs/includes/jszip +- htdocs/includes/jquery/css +- htdocs/includes/jquery/js +- htdocs/includes/jquery/plugins/flot +- htdocs/includes/jquery/plugins/multiselect - htdocs/includes/jquery/plugins/datatables +- htdocs/includes/jszip - htdocs/includes/mike42 - htdocs/includes/phpexcel or htdocs/includes/phpoffice -- htdocs/includes/swiftmailer - htdocs/includes/restler/framework/Luracast/Restler/explorer +- htdocs/includes/swiftmailer - htdocs/includes/tcpdf or htdocs/includes/tecnickcom And rename file into dolibarr-x.y.z+dfsgw.tgz diff --git a/composer.json b/composer.json index 2aa9dd216d6..a8d6b9ee5ff 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "php": ">=5.3.0", "ext-curl": "*", "ccampbell/chromephp": "4.1.0", - "ckeditor/ckeditor": "dev-full/stable", + "ckeditor/ckeditor": "4.5.9", "mike42/escpos-php": "1.2.1", "mobiledetect/mobiledetectlib": "2.8.17", "phpoffice/phpexcel": "1.8.1", diff --git a/composer.lock b/composer.lock index 2e30ef6bd01..b6433991a15 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f666a32d1a59518b8ecc55899e829e79", - "content-hash": "8d110e7d8fca6eca1aa814ee35d0032b", + "hash": "c586663818e933f26657871d86d01dc6", + "content-hash": "09e891bb978d35a48902a5f57760aee9", "packages": [ { "name": "ccampbell/chromephp", @@ -52,16 +52,16 @@ }, { "name": "ckeditor/ckeditor", - "version": "dev-full/stable", + "version": "4.5.11", "source": { "type": "git", "url": "https://github.com/ckeditor/ckeditor-releases.git", - "reference": "4a7a6d717f9a408fa8f9ea53ef2dba4d64b83e91" + "reference": "48155a1e1c7e84736b5a166ad3f33acea2a51255" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/4a7a6d717f9a408fa8f9ea53ef2dba4d64b83e91", - "reference": "4a7a6d717f9a408fa8f9ea53ef2dba4d64b83e91", + "url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/48155a1e1c7e84736b5a166ad3f33acea2a51255", + "reference": "48155a1e1c7e84736b5a166ad3f33acea2a51255", "shasum": "" }, "type": "library", @@ -89,7 +89,7 @@ "text", "wysiwyg" ], - "time": "2016-05-12 15:36:04" + "time": "2016-09-07 13:32:39" }, { "name": "mike42/escpos-php", @@ -273,12 +273,12 @@ "source": { "type": "git", "url": "https://github.com/Luracast/Restler-Framework.git", - "reference": "bfe1139b233852b745c6a0ec14d7244ceb3b3fc6" + "reference": "3388d76e73a81f871ce5baa906271071b12cd17f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Luracast/Restler-Framework/zipball/bfe1139b233852b745c6a0ec14d7244ceb3b3fc6", - "reference": "bfe1139b233852b745c6a0ec14d7244ceb3b3fc6", + "url": "https://api.github.com/repos/Luracast/Restler-Framework/zipball/3388d76e73a81f871ce5baa906271071b12cd17f", + "reference": "3388d76e73a81f871ce5baa906271071b12cd17f", "shasum": "" }, "require": { @@ -325,7 +325,7 @@ "rest", "server" ], - "time": "2016-02-28 15:57:37" + "time": "2016-06-21 12:42:18" }, { "name": "tecnickcom/tcpdf", @@ -391,11 +391,1391 @@ "time": "2015-09-12 10:08:34" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "jakub-onderka/php-console-color", + "version": "0.1", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", + "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "jakub-onderka/php-code-style": "1.0", + "jakub-onderka/php-parallel-lint": "0.*", + "jakub-onderka/php-var-dump-check": "0.*", + "phpunit/phpunit": "3.7.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "JakubOnderka\\PhpConsoleColor": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com", + "homepage": "http://www.acci.cz" + } + ], + "time": "2014-04-08 15:00:19" + }, + { + "name": "jakub-onderka/php-console-highlighter", + "version": "v0.3.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", + "shasum": "" + }, + "require": { + "jakub-onderka/php-console-color": "~0.1", + "php": ">=5.3.0" + }, + "require-dev": { + "jakub-onderka/php-code-style": "~1.0", + "jakub-onderka/php-parallel-lint": "~0.5", + "jakub-onderka/php-var-dump-check": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JakubOnderka\\PhpConsoleHighlighter": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" + } + ], + "time": "2015-04-20 18:58:01" + }, + { + "name": "jakub-onderka/php-parallel-lint", + "version": "v0.9.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", + "reference": "2ead2e4043ab125bee9554f356e0a86742c2d4fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/2ead2e4043ab125bee9554f356e0a86742c2d4fa", + "reference": "2ead2e4043ab125bee9554f356e0a86742c2d4fa", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "~0.3", + "nette/tester": "~1.3" + }, + "suggest": { + "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", + "time": "2015-12-15 10:42:16" + }, + { + "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": "phpspec/prophecy", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2016-06-07 08:13:47" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06 15:47:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21 13:08:43" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2016-05-12 18:03:57" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-09-15 10:49:45" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2016-07-21 06:48:14" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02 06:51:40" + }, + { + "name": "phpunit/phpunit-selenium", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/giorgiosironi/phpunit-selenium.git", + "reference": "2bad798ec0daf20d2854400e3bc5329ee0a7b2d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/giorgiosironi/phpunit-selenium/zipball/2bad798ec0daf20d2854400e3bc5329ee0a7b2d1", + "reference": "2bad798ec0daf20d2854400e3bc5329ee0a7b2d1", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-dom": "*", + "php": ">=5.3.3", + "phpunit/phpunit": "~4.8", + "sebastian/comparator": "~1.0" + }, + "require-dev": { + "phing/phing": "2.*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Giorgio Sironi", + "email": "info@giorgiosironi.com", + "role": "developer" + }, + { + "name": "Ivan Kurnosov", + "email": "zerkms@zerkms.com", + "role": "developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "original developer" + } + ], + "description": "Selenium Server integration for PHPUnit", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "selenium", + "testing", + "xunit" + ], + "time": "2016-03-01 10:33:56" + }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08 07:14:41" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18 05:49:44" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17 09:04:28" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-11-11 19:50:13" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21 13:59:46" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/571e27b6348e5b3a637b2abc82ac0d01e6d7bbed", + "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed", + "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": "2016-09-01 23:53:02" + }, + { + "name": "symfony/yaml", + "version": "v3.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7ff51b06c6c3d5cc6686df69004a42c69df09e27", + "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "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 Yaml Component", + "homepage": "https://symfony.com", + "time": "2016-10-24 18:41:13" + }, + { + "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": { - "ckeditor/ckeditor": 20, "restler/framework": 5 }, "prefer-stable": false, diff --git a/dev/skeletons/skeleton_card.php b/dev/skeletons/skeleton_card.php index 9adcdba87de..f0a9dd23c26 100644 --- a/dev/skeletons/skeleton_card.php +++ b/dev/skeletons/skeleton_card.php @@ -53,6 +53,7 @@ $langs->load("other"); // Get parameters $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); +$cancel = GETPOST('cancel'); $backtopage = GETPOST('backtopage'); $myparam = GETPOST('myparam','alpha'); @@ -95,6 +96,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + if ($cancel) + { + if ($action != 'addlink') + { + $urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1); + header("Location: ".$urltogo); + exit; + } + if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref); + $action=''; + } + // Action to add record if ($action == 'add') { @@ -140,11 +153,8 @@ if (empty($reshook)) } } - // Cancel - if ($action == 'update' && GETPOST('cancel')) $action='view'; - // Action to update record - if ($action == 'update' && ! GETPOST('cancel')) + if ($action == 'update') { $error=0; diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index c47a87a8033..0eac0c761c7 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2014-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 5de8be91d20..1cb37e92baa 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -329,7 +329,7 @@ if ($result) print ''; print ''; - print ''; + print ''; if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; // On sell print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 79c12e68561..79aa64fb1ab 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1146,12 +1146,12 @@ class Adherent extends CommonObject $this->birth = $this->db->jdate($obj->birthday); $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; + $this->note_public = $obj->note_public; $this->morphy = $obj->morphy; $this->typeid = $obj->fk_adherent_type; - $this->type = $obj->type; - $this->need_subscription = ($obj->subscription=='yes'?1:0); + $this->type = $obj->type; + $this->need_subscription = $obj->subscription; $this->user_id = $obj->user_id; $this->user_login = $obj->user_login; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 7520bdbf6a5..f924881108c 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -45,7 +45,7 @@ class AdherentType extends CommonObject */ public $cotisation; /** - * @var bool Subsription required + * @var int Subsription required (0 or 1) * @since 5.0 */ public $subscription; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index bce8a063ecb..bbfc746a443 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -86,7 +86,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0); +$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,32,0); // Name of SQL tables of dictionaries $tabname=array(); diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 45f2be3e4da..e3081d10400 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -23,8 +23,7 @@ use Luracast\Restler\Defaults; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; /** - * Class for API - * + * Class for API REST v1 */ class DolibarrApi { @@ -55,6 +54,8 @@ class DolibarrApi $this->db = $db; $production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true ); $this->r = new Restler($production_mode); + + $this->r->setAPIVersion(1); } /** @@ -97,6 +98,7 @@ class DolibarrApi unset($object->statuts); unset($object->statuts_short); unset($object->statuts_logo); + unset($object->statuts_long); // Remove the $oldcopy property because it is not supported by the JSON // encoder. The following error is generated when trying to serialize diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 80cfb5485df..7fe3e6437ac 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -106,7 +106,10 @@ foreach ($modulesdir as $dir) elseif ($module == 'facture') { $moduledirforclass = 'compta/facture'; } - + elseif ($module == 'project') { + $moduledirforclass = 'projet'; + } + // Defined if module is enabled $enabled=true; if (empty($conf->$moduleforperm->enabled)) $enabled=false; @@ -135,7 +138,7 @@ foreach ($modulesdir as $dir) require_once $dir_part.$file_searched; if (class_exists($classname)) { - dol_syslog("Found deprecated API classname=".$classname." into ".$dir); + dol_syslog("Found deprecated API by index.php classname=".$classname." into ".$dir); $api->r->addAPIClass($classname, '/'); } } @@ -145,7 +148,7 @@ foreach ($modulesdir as $dir) require_once $dir_part.$file_searched; if (class_exists($classname)) { - dol_syslog("Found API classname=".$classname." into ".$dir); + dol_syslog("Found API by index.php classname=".$classname." into ".$dir); $listofapis[] = $classname; } } @@ -161,13 +164,14 @@ foreach ($modulesdir as $dir) // shows the classes in the order they are added and it's a mess if they are // not sorted. sort($listofapis); +//var_dump($listofapis); foreach ($listofapis as $classname) { $api->r->addAPIClass($classname); } // TODO If not found, redirect to explorer - +//var_dump($api); // Call API (we suppose we found it) $api->r->handle(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 4411061e0c0..ed836cbccbb 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -199,7 +199,7 @@ dol_fiche_head($head, 'card', $title, 0, 'category'); if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete'); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1); } print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 92dc2726030..d7fd92f365b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -333,7 +333,7 @@ if (empty($reshook)) dol_syslog("comm/mailing/card.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=-1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid; + $sql.=" SET statut=-1, error_text='".$db->escape($mail->error)."', date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) { @@ -668,7 +668,15 @@ if ($action == 'create') print ''; print ''; - print load_fiche_titre($langs->trans("NewMailing")); + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
'; + } + $htmltext.='
'; + + // Print mail form + print load_fiche_titre($langs->trans("NewMailing"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(); @@ -693,21 +701,16 @@ if ($action == 'create') print '
'; - print ''; - print '
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0); print '
'.$langs->trans("MailMessage").'
'; - print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; - } - print '
'; + + print '
'; + + print '
'; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%'); $doleditor->Create(); - print ''; - print ''; - + print '
'; + dol_fiche_end(); print '
'; @@ -788,17 +791,24 @@ else } } - print ''; - $linkback = ''.$langs->trans("BackToList").''; - print ''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '
'; + + print '
'.$langs->trans("Ref").'
'; + +/* print ''; print ''; - +*/ // Description - print ''; @@ -813,10 +823,12 @@ else print ''; // Status + /* print ''; - + */ + // Nb of distinct emails print ''; - print ''; - print ''; - - print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; + print '
'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').''; print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string'); print '
'.$langs->trans("Status").''.$object->getLibStatut(4); if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; print'
'; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -987,11 +999,19 @@ else print '
'; } + + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
'; + } + $htmltext.='
'; + // Print mail content - print load_fiche_titre($langs->trans("EMail"),'',''); - + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); + dol_fiche_head(''); - + print ''; // Subject @@ -1019,16 +1039,11 @@ else /*print '';*/ - + + print '
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'; + // Message - print '
'.$langs->trans("MailMessage").'
'; - print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; - } - print '
'; + print '
'; if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff') { $readonly=1; @@ -1038,12 +1053,10 @@ else $doleditor->Create(); } else print dol_htmlentitiesbr($object->body); - print '
'; + print ''; dol_fiche_end(); + } else { @@ -1051,19 +1064,28 @@ else * Mailing en mode edition */ - print ''; - $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '
'; + + print '
'; + + /* print ''; print ''; - + */ + // Topic - print ''; + print ''; // From - print ''; + print ''; // To print ''; @@ -1100,21 +1122,29 @@ else - print "\n"; + print "
\n"; + print ''."\n"; print ''; print ''; print ''; - + + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; + foreach($object->substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'
'; + } + $htmltext.='
'; + // Print mail content - print load_fiche_titre($langs->trans("EMail"),'',''); + print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic'); dol_fiche_head(); - + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto,0,0,0,0,1).'
'; // Subject - print ''; + print ''; $trackid=''; // TODO To avoid conflicts with 2 mass emailing, we should set a trackid here, even if we use another one into email header. dol_init_file_process($upload_dir, $trackid); @@ -1159,23 +1189,17 @@ else print ''; - + + print '
'.$langs->trans("MailTopic").'
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'; + // Message - print ''.$langs->trans("MailMessage").'
'; - print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; - } - print '
'; - print ''; + print '
'; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,120); $doleditor->Create(); - print ''; + print '
'; - print ''; dol_fiche_end(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index cc5b16f1935..3767ba17add 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -38,16 +38,17 @@ $langs->load("mails"); if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden(); +// Load variable for pagination $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="email"; +if (! $sortorder) $sortorder="ASC"; $id=GETPOST('id','int'); $rowid=GETPOST('rowid','int'); @@ -178,17 +179,24 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email'); - - print ''; - $linkback = ''.$langs->trans("BackToList").''; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + + print '
'; + + print '
'; +/* print ''; print ''; - - print ''; +*/ + print ''; print ''; @@ -197,10 +205,10 @@ if ($object->fetch($id) >= 0) print ''; // Status - print ''; - +*/ // Nb of distinct emails print ''; // EMail print ''; // Name print ''; // Firstname print ''; // Other print ''; - //Search Icon + // Action column print ''; print ''; @@ -480,9 +488,10 @@ if ($object->fetch($id) >= 0) if ($num) { - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); + $var=!$var; print ""; @@ -537,7 +546,7 @@ if ($object->fetch($id) >= 0) { print ''; print ''; } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 6a7ae2cefbe..dc39c2e9399 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -33,7 +33,8 @@ class Mailing extends CommonObject { public $element='mailing'; public $table_element='mailing'; - + public $picto='email'; + var $titre; var $sujet; var $body; @@ -577,12 +578,14 @@ class Mailing extends CommonObject /** * Renvoi le libelle d'un statut donne + * TODO Add class mailin_target.class.php * * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param strin $desc Desc error * @return string Label */ - static public function libStatutDest($statut,$mode=0) + static public function libStatutDest($statut,$mode=0,$desc='') { global $langs; $langs->load('mails'); @@ -597,28 +600,28 @@ class Mailing extends CommonObject } if ($mode == 2) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 3) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 4) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); } if ($mode == 5) { - if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index bf7c4624c1e..ba8c2481411 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -56,10 +56,10 @@ print ''; print '
'.$langs->trans("Ref").''; print $form->showrefnav($object,'id', $linkback); print '
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("Status").''.$object->getLibStatut(4); +/* print '
'.$langs->trans("Status").''.$object->getLibStatut(4); if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; print '
'; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -363,7 +371,7 @@ if ($object->fetch($id) >= 0) } // List of selected targets - $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type"; + $sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.source_url, mc.source_id, mc.source_type, mc.error_text"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.fk_mailing=".$object->id; if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'"; @@ -441,15 +449,15 @@ if ($object->fetch($id) >= 0) print '
'; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -468,10 +476,10 @@ if ($object->fetch($id) >= 0) print ''; print $formmailing->selectDestinariesStatus($search_dest_status,'search_dest_status',1); print ''; - print ''; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; print '
'.$obj->date_envoi.''; - print $object::libStatutDest($obj->statut,2); + print $object::libStatutDest($obj->statut,2,$obj->error_text); print '
'; print ''; print ''; +print $langs->trans("Ref").':'; print ''; print ''; +print $langs->trans("Other").':'; print "
'.$langs->trans("SearchAMailing").'
'; -print $langs->trans("Ref").':
'; -print $langs->trans("Other").':

\n"; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 77245f74766..5280fcfad59 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -43,24 +43,33 @@ llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:M $form = new Form($db); -$mil = new Mailing($db); +$object = new Mailing($db); -if ($mil->fetch($_REQUEST["id"]) >= 0) +if ($object->fetch($_REQUEST["id"]) >= 0) { - $head = emailing_prepare_head($mil); + $head = emailing_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email'); + $linkback = ''.$langs->trans("BackToList").''; - print '
'; - $mil->user_creation=$mil->user_creat; - $mil->date_creation=$mil->date_creat; - $mil->user_validation=$mil->user_valid; - $mil->date_validation=$mil->date_valid; - dol_print_object_info($mil); - print '
'; + $morehtmlright=''; + if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + + print '

'; + + //print '
'; + $object->user_creation=$object->user_creat; + $object->date_creation=$object->date_creat; + $object->user_validation=$object->user_valid; + $object->date_validation=$object->date_valid; + dol_print_object_info($object, 0); + //print '
'; + - print ''; + dol_fiche_end(); } llxFooter(); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 9495895beda..4842de41dbf 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -99,7 +99,6 @@ $permissiondellink = $user->rights->commande->creer; // Used by the include of $permissionedit = $user->rights->commande->creer; // Used by the include of actions_lineupdown.inc.php - /* * Actions */ @@ -110,8 +109,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($cancel) $action=''; - + if ($cancel) + { + if ($action != 'addlink') + { + $urltogo=$backtopage?$backtopage:dol_buildpath('/commande/list.php',1); + header("Location: ".$urltogo); + exit; + } + if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref); + $action=''; + } + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once @@ -1725,7 +1734,7 @@ if ($action == 'create' && $user->rights->commande->creer) print '
'; print ''; print '     '; - print ''; + print ''; print '
'; print ''; diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index f000e4ce201..c9931ac6f2a 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -371,7 +371,7 @@ class Orders extends DolibarrApi } $request_data = (object) $request_data; $updateRes = $this->commande->deleteline(DolibarrApiAccess::$user,$lineid); - if ($updateRes == 1) { + if ($updateRes > 0) { return $this->get($id); } return false; diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 9acf83db399..f82177e0b21 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $langs->load("banks"); $langs->load("categories"); +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); + $id=GETPOST('account')?GETPOST('account','alpha'):GETPOST('id'); $ref=GETPOST('ref'); @@ -53,6 +56,12 @@ else $year_end=$year_start+2; } + + +/* + * View + */ + $title = $langs->trans("FinancialAccount").' - '.$langs->trans("IOMonthlyReporting"); $helpurl = ""; llxHeader('',$title,$helpurl); @@ -276,10 +285,6 @@ if ($result < 0) } else { - // Definition de $width et $height - $width = 480; - $height = 300; - // Calcul de $min et $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -374,8 +379,8 @@ else $px1->SetMaxValue($px1->GetCeilMaxValue()<0?0:$px1->GetCeilMaxValue()); $px1->SetMinValue($px1->GetFloorMinValue()>0?0:$px1->GetFloorMinValue()); $px1->SetTitle($title); - $px1->SetWidth($width); - $px1->SetHeight($height); + $px1->SetWidth($WIDTH); + $px1->SetHeight($HEIGHT); $px1->SetType(array('line','line','line')); $px1->SetShading(3); $px1->setBgColor('onglet'); @@ -461,8 +466,8 @@ else $px2->SetMaxValue($px2->GetCeilMaxValue()<0?0:$px2->GetCeilMaxValue()); $px2->SetMinValue($px2->GetFloorMinValue()>0?0:$px2->GetFloorMinValue()); $px2->SetTitle($title); - $px2->SetWidth($width); - $px2->SetHeight($height); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); $px2->SetType(array('line','line','line')); $px2->SetShading(3); $px2->setBgColor('onglet'); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index a608a71bf7d..43efcc93d57 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry @@ -840,11 +840,11 @@ else // Label print ''.$langs->trans("Label").''; - print 'label).'">'; + print 'label).'">'; // Type print ''.$langs->trans("AccountType").''; - print ''; + print ''; $formbank->selectTypeOfBankAccount((isset($_POST["type"])?$_POST["type"]:$object->type),"type"); print ''; @@ -852,7 +852,7 @@ else print ''.$langs->trans("Currency"); print ''; print ''; - print ''; + print ''; $selectedcode=$object->currency_code; if (! $selectedcode) $selectedcode=$conf->currency; print $form->selectCurrency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code'); @@ -862,8 +862,8 @@ else // Status print ''.$langs->trans("Status").''; - print ''; - print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos)); + print ''; + print $form->selectarray("clos", $object->status, (isset($_POST["clos"])?$_POST["clos"]:$object->clos)); print ''; // Country @@ -874,13 +874,13 @@ else $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''.$langs->trans("Country").''; - print ''; + print ''; print $form->select_country($selectedcode,'account_country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; // State - print ''.$langs->trans('State').''; + print ''.$langs->trans('State').''; if ($selectedcode) { print $formcompany->select_state(isset($_POST["account_state_id"])?$_POST["account_state_id"]:$object->state_id,$selectedcode,'account_state_id'); @@ -909,7 +909,7 @@ else // Web print ''.$langs->trans("Web").''; - print 'url).'">'; + print 'url).'">'; print ''; // Tags-Categories @@ -931,7 +931,7 @@ else print ''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,70); + $doleditor=new DolEditor('account_comment',(GETPOST("account_comment")?GETPOST("account_comment"):$object->comment),'',90,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,4,'95%'); $doleditor->Create(); print ''; @@ -1020,22 +1020,22 @@ else // IBAN print ''.$langs->trans($ibankey).''; - print ''; + print ''; print ''.$langs->trans($bickey).''; - print ''; + print ''; print ''.$langs->trans("BankAccountDomiciliation").''; - print ""; print ''.$langs->trans("BankAccountOwner").''; - print ''; + print ''; print ''; print ''.$langs->trans("BankAccountOwnerAddress").''; - print ""; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 29f04d8f82d..c25bc073d1f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -236,7 +236,7 @@ class Account extends CommonObject $this->status = array( self::STATUS_OPEN => $langs->trans("StatusAccountOpened"), - self::STATUS_CLOSED => $langs->trans("StatusAccountOpened") + self::STATUS_CLOSED => $langs->trans("StatusAccountClosed") ); } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 3b74833f23a..6215f2343e8 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2011-2014 Juanjo Menent @@ -134,7 +134,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,"; $sql.= " pct.code as payment_code,"; - $sql.= " ba.rowid as bid, ba.label as blabel"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; @@ -205,6 +205,10 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { //$accountstatic->fetch($obj->fk_bank); $accountstatic->id=$obj->bid; + $accountstatic->ref=$obj->bref; + $accountstatic->number=$obj->bnumber; + $accountstatic->accountancy_number=$obj->account_number; + $accountstatic->accountancy_journal=$obj->accountancy_journal; $accountstatic->label=$obj->blabel; print $accountstatic->getNomUrl(1); } @@ -249,8 +253,13 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print load_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); - $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm"; + $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,"; + $sql.= " pct.code as payment_code,"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pv.fk_typepayment = pct.id"; $sql.= " WHERE pv.entity = ".$conf->entity; if ($year > 0) { @@ -273,6 +282,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=1; @@ -295,15 +306,45 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $tva_static->ref=$obj->rowid; print ''.$tva_static->getNomUrl(1)."\n"; + // Date print ''.dol_print_date($db->jdate($obj->dm),'day')."\n"; - print ''.price($obj->amount).""; + + // Type payment + print ''; + if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + print $obj->num_payment.''; + + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + if ($obj->fk_bank > 0) + { + //$accountstatic->fetch($obj->fk_bank); + $accountstatic->id=$obj->bid; + $accountstatic->ref=$obj->bref; + $accountstatic->number=$obj->bnumber; + $accountstatic->accountancy_number=$obj->account_number; + $accountstatic->accountancy_journal=$obj->accountancy_journal; + $accountstatic->label=$obj->blabel; + print $accountstatic->getNomUrl(1); + } + else print ' '; + print ''; + } + + // Paid + print ''.price($obj->amount).""; print "\n"; $i++; } print ''.$langs->trans("Total").''; print ''.price($total).''; - print ' '; + print ' '; + print ' '; + print ' '; + print ' '; print ''.price($total).""; print ""; @@ -426,8 +467,14 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); - $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary"; - $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u"; + $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,"; + $sql.= " pct.code as payment_code,"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; + $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON s.fk_typepayment = pct.id"; + $sql.= " , ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE s.entity IN (".getEntity('user',1).")"; $sql.= " AND u.rowid = s.fk_user"; if ($year > 0) @@ -449,6 +496,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=1; @@ -470,13 +519,40 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $sal_static->ref=$obj->rowid; print ''.$sal_static->getNomUrl(1)."\n"; + // Date print ''.dol_print_date($db->jdate($obj->datep),'day')."\n"; + + // Type payment + print ''; + if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + print $obj->num_payment.''; + + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + if ($obj->fk_bank > 0) + { + //$accountstatic->fetch($obj->fk_bank); + $accountstatic->id=$obj->bid; + $accountstatic->ref=$obj->bref; + $accountstatic->number=$obj->bnumber; + $accountstatic->accountancy_number=$obj->account_number; + $accountstatic->accountancy_journal=$obj->accountancy_journal; + $accountstatic->label=$obj->blabel; + print $accountstatic->getNomUrl(1); + } + else print ' '; + print ''; + } + + // Paid print ''.price($obj->amount).""; print "\n"; $i++; } - print ''.$langs->trans("Total").''; + print ''.$langs->trans("Total").''; print ''.price($total).""; print ""; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2e76d9ce4db..7abd140b9b9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4208,7 +4208,7 @@ class FactureLigne extends CommonInvoiceLine $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; $sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; $sql.= ' fd.fk_code_ventilation,'; - $sql.= ' fd.fk_unit,'; + $sql.= ' fd.fk_unit, fk_user_author, fk_user_modif,'; $sql.= ' fd.situation_percent, fd.fk_prev_id,'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; $sql.= ' , fd.multicurrency_subprice'; @@ -4261,7 +4261,9 @@ class FactureLigne extends CommonInvoiceLine $this->product_label = $objp->product_libelle; $this->product_desc = $objp->product_desc; $this->fk_unit = $objp->fk_unit; - + $this->fk_user_modif = $objp->fk_user_modif; + $this->fk_user_author = $objp->fk_user_author; + $this->situation_percent = $objp->situation_percent; $this->fk_prev_id = $objp->fk_prev_id; @@ -4361,8 +4363,8 @@ class FactureLigne extends CommonInvoiceLine $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2,'; $sql.= ' situation_percent, fk_prev_id,'; - $sql.= ' fk_unit'; - $sql.= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; + $sql.= ' fk_unit, fk_user_author, fk_user_modif,'; + $sql.= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; $sql.= ')'; $sql.= " VALUES (".$this->fk_facture.","; $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; @@ -4393,9 +4395,11 @@ class FactureLigne extends CommonInvoiceLine $sql.= " ".price2num($this->total_ttc).","; $sql.= " ".price2num($this->total_localtax1).","; $sql.= " ".price2num($this->total_localtax2); - $sql .= ", " . $this->situation_percent; - $sql .= ", " . $this->fk_prev_id; - $sql .= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit); + $sql.= ", " . $this->situation_percent; + $sql.= ", " . $this->fk_prev_id; + $sql.= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit); + $sql.= ", ".$user->id; + $sql.= ", ".$user->id; $sql.= ", ".(int) $this->fk_multicurrency; $sql.= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql.= ", ".price2num($this->multicurrency_subprice); @@ -4581,6 +4585,7 @@ class FactureLigne extends CommonInvoiceLine if (! empty($this->rang)) $sql.= ", rang=".$this->rang; $sql.= ", situation_percent=" . $this->situation_percent; $sql.= ", fk_unit=".(!$this->fk_unit ? 'NULL' : $this->fk_unit); + $sql.= ", fk_user_modif =".$user->id; // Multicurrency $sql.= ", multicurrency_subprice=".price2num($this->multicurrency_subprice).""; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index b5467f74a02..c1381be0ea5 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -40,6 +40,7 @@ if (! empty($conf->projet->enabled)) { $langs->load('bills'); $langs->load('compta'); +$langs->load('admin'); // Security check $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int')); diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 16aa54e229d..2fb2a7089ea 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -47,8 +47,17 @@ foreach($linkedObjectBlock as $key => $objectlink) date,'day'); ?> rights->facture->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); + $sign = 1; + if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1; + if ($objectlink->statut != 3) // If not abandonned + { + $total = $total + $sign * $objectlink->total_ht; + echo price($objectlink->total_ht); + } + else + { + echo ''.price($objectlink->total_ht).''; + } } ?> getLibStatut(3); ?> ">transnoentitiesnoconv("RemoveLink")); ?> diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index ce94e4a1212..781f5609915 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -24,16 +24,21 @@ load("bills"); +$total=0; $ilink=0; $var=true; -$total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> > trans("RepeatableInvoice"); ?> diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 40e3b80a510..0d0552b41ad 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -117,7 +117,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 63d4b9930ed..b39e5c47f7f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -534,7 +534,7 @@ if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ttc).''; print ''; -if ($mysoc->tva_assuj == 'franchise') // Non assujeti +if ($mysoc->tva_assuj == 'franchise') // Non assujetti { // Total print ''; @@ -572,7 +572,7 @@ if (! empty($conf->salaries->enabled)) $sql.= " WHERE p.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - + $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; $sql.= " ORDER BY u.firstname"; @@ -599,7 +599,7 @@ if (! empty($conf->salaries->enabled)) $var = !$var; print " "; - print "".$langs->trans("Salaries")." fk_user."\">".$obj->firstname." ".$obj->lastname."\n"; + print "".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."\n"; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).''; print ''.price(-$obj->amount).''; @@ -639,9 +639,8 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); $sql.= " AND p.fk_statut>=5"; - + $column='p.date_valid'; - } else { $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; @@ -650,12 +649,12 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); $sql.= " AND p.fk_statut>=5"; - + $column='pe.datep'; } print ''.$langs->trans("ExpenseReport").''; - + if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; @@ -709,12 +708,12 @@ if (! empty($conf->expensereport->enabled)) } /* - * Donation + * Donations */ if (! empty($conf->don->enabled)) { - print ''.$langs->trans("Donation").''; + print ''.$langs->trans("Donations").''; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; @@ -975,7 +974,7 @@ else } -if ($mysoc->tva_assuj != 'franchise') // Assujeti +if ($mysoc->tva_assuj != 'franchise') // Assujetti { print ''; if ($modecompta == 'CREANCES-DETTES') @@ -995,7 +994,7 @@ $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addBalanceLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; -if ($mysoc->tva_assuj != 'franchise') // Assujeti +if ($mysoc->tva_assuj != 'franchise') // Assujetti { // Total print ''; diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index 4de0e829538..6355fc03fab 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -93,7 +93,7 @@ $accountstatic = new Account($db); $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,"; $sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,"; -$sql.= " ba.rowid as bid, ba.label as blabel,"; +$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel,"; $sql.= " pst.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id"; @@ -230,8 +230,12 @@ if ($result) { //$accountstatic->fetch($obj->fk_bank); $accountstatic->id=$obj->bid; + $accountstatic->ref=$obj->bref; + $accountstatic->number=$obj->bnumber; + $accountstatic->accountancy_number=$obj->account_number; + $accountstatic->accountancy_journal=$obj->accountancy_journal; $accountstatic->label=$obj->blabel; - print $accountstatic->getNomUrl(1); + print $accountstatic->getNomUrl(1); } else print ' '; print ''; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 30d9655acc8..c9a65ac2f03 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,8 +20,8 @@ */ /** - * \file htdocs/compta/tva/index.php - * \ingroup tax + * \file htdocs/compta/tva/index.php + * \ingroup tax * \brief Index page of VAT reports */ require '../../main.inc.php'; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 6ebaee8ecd5..128eb6456f3 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -3,7 +3,8 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,11 +37,14 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; +require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; $langs->load("bills"); $langs->load("compta"); $langs->load("companies"); $langs->load("products"); +$langs->load("trips"); $langs->load("other"); // Date range @@ -111,9 +115,11 @@ $form=new Form($db); $company_static=new Societe($db); $invoice_customer=new Facture($db); $invoice_supplier=new FactureFournisseur($db); +$expensereport=new ExpenseReport($db); $product_static=new Product($db); $payment_static=new Paiement($db); $paymentfourn_static=new PaiementFourn($db); +$paymentexpensereport_static=new PaymentExpenseReport($db); //print load_fiche_titre($langs->trans("VAT"),""); @@ -149,16 +155,20 @@ if ($modetax==1) // Calculate on invoice for goods and services $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); + // Customers invoices $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("ProductOrService"); $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; + + // Suppliers invoices $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("ProductOrService"); $amountsup=$langs->trans("AmountHT"); $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; + } if ($modetax==0) // Invoice for goods, payment for services { @@ -185,26 +195,29 @@ if ($modetax==0) // Invoice for goods, payment for services $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); + // Customers invoices $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("ProductOrService"); $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')'; + + // Suppliers invoices $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("ProductOrService"); $amountsup=$langs->trans("AmountHT"); $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; + } report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); - +$vatexpensereport=$langs->trans("VATPaid"); // VAT Received and paid - -echo ''; +print '
'; $y = $year_current; $total = 0; @@ -242,21 +255,21 @@ else $invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id]; $invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id]; $x_both[$my_coll_rate]['coll']['detail'][] = array( - 'id' =>$x_coll[$my_coll_rate]['facid'][$id], - 'descr' =>$x_coll[$my_coll_rate]['descr'][$id], - 'pid' =>$x_coll[$my_coll_rate]['pid'][$id], - 'pref' =>$x_coll[$my_coll_rate]['pref'][$id], - 'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id], - 'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id], - 'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id], - 'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id], - 'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id], - 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id], - 'ddate_start'=>$x_coll[$my_coll_rate]['ddate_start'][$id], - 'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id], - 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id], - 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id], - 'link' =>$invoice_customer->getNomUrl(1,'',12)); + 'id' =>$x_coll[$my_coll_rate]['facid'][$id], + 'descr' =>$x_coll[$my_coll_rate]['descr'][$id], + 'pid' =>$x_coll[$my_coll_rate]['pid'][$id], + 'pref' =>$x_coll[$my_coll_rate]['pref'][$id], + 'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id], + 'payment_id' =>$x_coll[$my_coll_rate]['payment_id'][$id], + 'payment_amount' =>$x_coll[$my_coll_rate]['payment_amount'][$id], + 'ftotal_ttc' =>$x_coll[$my_coll_rate]['ftotal_ttc'][$id], + 'dtotal_ttc' =>$x_coll[$my_coll_rate]['dtotal_ttc'][$id], + 'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id], + 'ddate_start' =>$x_coll[$my_coll_rate]['ddate_start'][$id], + 'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id], + 'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id], + 'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id], + 'link' =>$invoice_customer->getNomUrl(1,'',12)); } } // tva paid @@ -272,25 +285,54 @@ else foreach($x_paye[$my_paye_rate]['facid'] as $id=>$dummy) { - $invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; - $invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; - $invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; - $x_both[$my_paye_rate]['paye']['detail'][] = array( - 'id' =>$x_paye[$my_paye_rate]['facid'][$id], - 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], - 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], - 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], - 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], - 'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id], - 'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id], - 'ftotal_ttc'=>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), - 'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), - 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], - 'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id], - 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], - 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), - 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], - 'link' =>$invoice_supplier->getNomUrl(1,'',12)); + // ExpenseReport + if ($x_paye[$my_paye_rate]['ptype'][$id] == 'ExpenseReportPayment') + { + $expensereport->id=$x_paye[$my_paye_rate]['facid'][$id]; + $expensereport->ref=$x_paye[$my_paye_rate]['facnum'][$id]; + $expensereport->type=$x_paye[$my_paye_rate]['type'][$id]; + + $x_both[$my_paye_rate]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_rate]['facid'][$id], + 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], + 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], + 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], + 'payment_id' =>$x_paye[$my_paye_rate]['payment_id'][$id], + 'payment_amount' =>$x_paye[$my_paye_rate]['payment_amount'][$id], + 'ftotal_ttc' =>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), + 'dtotal_ttc' =>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'ddate_start' =>$x_paye[$my_paye_rate]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], + 'link' =>$expensereport->getNomUrl(1) + ); + } + else + { + $invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; + $invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; + $invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; + $x_both[$my_paye_rate]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_rate]['facid'][$id], + 'descr' =>$x_paye[$my_paye_rate]['descr'][$id], + 'pid' =>$x_paye[$my_paye_rate]['pid'][$id], + 'pref' =>$x_paye[$my_paye_rate]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id], + 'payment_id' =>$x_paye[$my_paye_rate]['payment_id'][$id], + 'payment_amount' =>$x_paye[$my_paye_rate]['payment_amount'][$id], + 'ftotal_ttc' =>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]), + 'dtotal_ttc' =>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id], + 'ddate_start' =>$x_paye[$my_paye_rate]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], + 'link' =>$invoice_supplier->getNomUrl(1,'',12) + ); + } } } //now we have an array (x_both) indexed by rates for coll and paye @@ -320,18 +362,18 @@ else print ''; print ''; print ''; - + $action = "tvadetail"; $parameters["mode"] = $modetax; $parameters["start"] = $date_start; $parameters["end"] = $date_end; $parameters["type"] = 'vat'; - + $object = array(&$x_coll, &$x_paye, &$x_both); // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - + foreach(array_keys($x_coll) as $rate) { $subtot_coll_total_ht = 0; @@ -374,12 +416,12 @@ else { if ($type) $text = img_object($langs->trans('Service'),'service'); else $text = img_object($langs->trans('Product'),'product'); - if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) - { - if ($reg[1]=='DEPOSIT') $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); - elseif ($reg[1]=='CREDIT_NOTE') $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); - else $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); - } + if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) + { + if ($reg[1]=='DEPOSIT') $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); + elseif ($reg[1]=='CREDIT_NOTE') $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); + else $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); + } print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16); // Show range @@ -610,7 +652,7 @@ else print ''; } - if (count($x_paye) == 0) // Show a total ine if nothing shown + if (count($x_paye) == 0) // Show a total line if nothing shown { print ''; print ''; diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index d5bcbeeb06a..66d11ce753f 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -89,7 +89,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP * View */ -llxHeader(); +llxHeader('', $langs->trans("VATPayments")); $form = new Form($db); $formother=new FormOther($db); @@ -97,7 +97,7 @@ $tva_static = new Tva($db); $accountstatic = new Account($db); $sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,"; -$sql.= " ba.rowid as bid, ba.label as blabel"; +$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid"; @@ -228,6 +228,10 @@ if ($result) { //$accountstatic->fetch($obj->fk_bank); $accountstatic->id=$obj->bid; + $accountstatic->ref=$obj->bref; + $accountstatic->number=$obj->bnumber; + $accountstatic->accountancy_number=$obj->account_number; + $accountstatic->accountancy_journal=$obj->accountancy_journal; $accountstatic->label=$obj->blabel; print $accountstatic->getNomUrl(1); } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3c29f4e8fca..971f98b56e6 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -572,7 +572,7 @@ if (empty($reshook)) if ($result > 0) { // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && ! empty($conf->global->CONTRACT_ADDON_PDF)) // No generation if default type not defined { $outputlangs = $langs; $newlang = ''; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 6b0dc8d7fdb..550d5241431 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -935,7 +935,7 @@ class Contrat extends CommonObject // Load object modContract - $module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive'); + $module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_serpis'); if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module)-4); diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 8e37e392603..836e2fd82f6 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -50,6 +50,7 @@ $search_contract=GETPOST("search_contract"); $search_service=GETPOST("search_service"); $search_status=GETPOST("search_status","alpha"); $statut=GETPOST('statut')?GETPOST('statut'):1; +$search_product_category=GETPOST('search_product_category','int'); $socid=GETPOST('socid','int'); $opouvertureprevuemonth=GETPOST('opouvertureprevuemonth'); @@ -99,6 +100,9 @@ $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); $companystatic=new Societe($db); +$arrayfields=array(); + + /* * Actions */ @@ -153,8 +157,10 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; $sql.= " ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; +if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product'; $sql.= " WHERE c.entity = ".$conf->entity; $sql.= " AND c.rowid = cd.fk_contrat"; +if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; $sql.= " AND c.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($mode == "0") $sql.= " AND cd.statut = 0"; @@ -206,17 +212,67 @@ if ($resql) if ($filter_date2 != '') $param.='&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; if ($filter_datecloture != '') $param.='&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; + // List of mass actions available + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + //if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + //if ($massaction == 'presend') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $title=$langs->trans("ListOfServices"); if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0" if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices"); if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices"); if ($mode == "5") $title=$langs->trans("ListOfClosedServices"); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png'); - - print ''; - print ''; - print '
'.$langs->trans("AmountHTVATRealReceived").''.$vatcust.'
 
'; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } + + $morefilter = ''; + + // If the user can view categories of products + if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) + { + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); + $moreforfilter.='
'; + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; + + + if (! empty($moreforfilter)) + { + print '
'; + print $moreforfilter; + print '
'; + } + + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
'."\n"; + print ''; print_liste_field_titre($langs->trans("Contract"),$_SERVER["PHP_SELF"], "c.rowid",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Service"),$_SERVER["PHP_SELF"], "p.description",$param,"","",$sortfield,$sortorder); @@ -308,11 +364,16 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; - print ""; - print '"; + + // Ref + print ''; @@ -348,7 +409,7 @@ if ($resql) { print ''; @@ -357,7 +418,7 @@ if ($resql) { print ''; } - // Date fin + // End date if (($mode == "" || $mode == -1) || $mode < 5) { print ' > + diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 317b84e0b29..3abd7dd58b5 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -527,7 +527,7 @@ class CMailFile if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); if (! empty($bounce)) $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers, $bounce); - else $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers); + else $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers); if (! $res) { @@ -840,7 +840,7 @@ class CMailFile // Receiver if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2; - if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; + if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ? // Delivery receipt if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index b3b0cc4042b..30ea6639196 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -337,17 +337,17 @@ abstract class CommonInvoice extends CommonObject $prefix='Short'; if (! $paye) { - if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); - if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); - if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); - if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); - return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); + if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); + if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); + if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); + if ($alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); + return ''.$langs->trans('Bill'.$prefix.'StatusStarted').' '.img_picto($langs->trans('BillStatusStarted'),'statut3'); } else { - if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); - elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); - else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); + if ($type == 2) return ''.$langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted').' '.img_picto($langs->trans('BillStatusPaidBackOrConverted'),'statut6'); + elseif ($type == 3) return ''.$langs->trans('Bill'.$prefix.'StatusConverted').' '.img_picto($langs->trans('BillStatusConverted'),'statut6'); + else return ''.$langs->trans('Bill'.$prefix.'StatusPaid').' '.img_picto($langs->trans('BillStatusPaid'),'statut6'); } } } diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index ef750e70253..90e4970b9d6 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -108,7 +108,7 @@ class DolEditor // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? $modulepart='fckeditor'; - $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&file='; + $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file='; $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ; $this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false'); diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 1b3bd883d54..739e635f85c 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -165,6 +165,7 @@ class HookManager 'paymentsupplierinvoices', 'printAddress', 'printSearchForm', + 'printTabsHead', 'formatEvent', 'addCalendarChoice', 'printObjectLine', diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8a6c97e794c..3e704816d5c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -181,7 +181,14 @@ class Form else if (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) { $tmp=explode(':',$typeofdata); - $ret.=''; + $cols=$tmp[2]; + $morealt=''; + if (preg_match('/%/',$cols)) + { + $morealt=' style="width: '.$cols.'"'; + $cols=''; + } + $ret.=''; } else if ($typeofdata == 'day' || $typeofdata == 'datepicker') { @@ -211,9 +218,10 @@ class Form if (empty($notabletag)) $ret.=''; if (empty($notabletag)) $ret.=''; if (empty($notabletag)) $ret.='
'; + $contractstatic->id=$obj->cid; $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; + + $var=!$var; + + print "
'; print $contractstatic->getNomUrl(1,16); print ''; print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); - if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay))) + if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0) print ' '.img_picto($langs->trans("Late"),"warning"); else print '    '; print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index aa8d83bb803..9ea21f890fc 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -13,7 +13,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ ?> @@ -22,19 +21,23 @@ load("contracts"); +$total=0; $ilink=0; $var=true; foreach($linkedObjectBlock as $key => $objectlink) { - $objectlink->fetch_lines(); - $var=!$var; + $ilink++; + $var=!$var; + $trclass=($var?'pair':'impair'); + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> -
trans("Contract"); ?> getNomUrl(1); ?> '; - $ret.=''; - if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='
'."\n"; - $ret.=''; + else $ret.='
'; + $ret.=''; + if (preg_match('/ckeditor|textarea/',$typeofdata) && empty($notabletag)) $ret.='
'."\n"; + $ret.=''; if (empty($notabletag)) $ret.='
'."\n"; @@ -734,7 +742,7 @@ class Form } $out.= ''; - $out .= ''; + $out .= ''; if (!empty($page)) { @@ -3334,7 +3342,7 @@ class Form } // Now add questions - $more.=''."\n"; + $more.='
'."\n"; $more.=''."\n"; foreach ($formquestion as $key => $input) { @@ -4485,7 +4493,7 @@ class Form if ($usecalendar == "eldy") { // Zone de saisie manuelle de la date - $retstring.='trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript $retstring.='>'; @@ -4513,7 +4521,7 @@ class Form { //$retstring.='
'; // Day - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { @@ -4527,7 +4535,7 @@ class Form $retstring.=""; - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { $retstring.=''; @@ -4545,11 +4553,11 @@ class Form // Year if ($emptydate || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { - $retstring.=''; + $retstring.=''; for ($year = $syear - 5; $year < $syear + 10 ; $year++) { @@ -4566,7 +4574,7 @@ class Form if ($h) { // Show hour - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($hour = 0; $hour < 24; $hour++) { @@ -4580,7 +4588,7 @@ class Form if ($m) { // Show minutes - $retstring.=''; + $retstring.=''; if ($emptyhours) $retstring.=''; for ($min = 0; $min < 60 ; $min++) { @@ -5570,32 +5578,9 @@ class Form $next_ref = $object->ref_next?''.(($conf->dol_use_jmobile != 4)?'>':' ').'':''.(($conf->dol_use_jmobile != 4)?'>':' ').''; //print "xx".$previous_ref."x".$next_ref; - $ret.='
'; - - if ($morehtmlleft) - { - if ($conf->browser->layout == 'phone') $ret.='
'.$morehtmlleft.'
'; - else $ret.='
'.$morehtmlleft.'
'; - } - - $ret.='
'; - - // For thirdparty, contact, user, member, the ref is the id, so we show something else - if ($object->element == 'societe') - { - $ret.=dol_htmlentities($object->name); - } - else if (in_array($object->element, array('contact', 'user', 'member'))) - { - $ret.=dol_htmlentities($object->getFullName($langs)); - } - else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); - if ($morehtmlref) - { - $ret.=' '.$morehtmlref; - } - $ret.='
'; + $ret.='
'; + // Right part of banner if ($morehtmlright) $ret.='
'.$morehtmlright.'
'; if ($previous_ref || $next_ref || $morehtml) @@ -5616,7 +5601,34 @@ class Form $ret.='
'; } if ($morehtmlstatus) $ret.='
'.$morehtmlstatus.'
'; - $ret.='
'; + + // Left part of banner + if ($morehtmlleft) + { + if ($conf->browser->layout == 'phone') $ret.='
'.$morehtmlleft.'
'; // class="center" to have photo in middle + else $ret.='
'.$morehtmlleft.'
'; + } + + //if ($conf->browser->layout == 'phone') $ret.='
'; + $ret.='
'; + + // For thirdparty, contact, user, member, the ref is the id, so we show something else + if ($object->element == 'societe') + { + $ret.=dol_htmlentities($object->name); + } + else if (in_array($object->element, array('contact', 'user', 'member'))) + { + $ret.=dol_htmlentities($object->getFullName($langs)); + } + else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + if ($morehtmlref) + { + $ret.=' '.$morehtmlref; + } + $ret.='
'; + + $ret.='
'; return $ret; } @@ -5790,10 +5802,10 @@ class Form if ($caneditfield) { if ($object->photo) $ret.="
\n"; - $ret.='
'.(! empty($formquestion['text'])?$formquestion['text']:'').'
'; - if ($object->photo) $ret.=''; + $ret.='
'.$langs->trans("Delete").'

'; + if ($object->photo) $ret.=''; $ret.=''; - $ret.=''; + $ret.=''; $ret.='
'.$langs->trans("Delete").'

'.$langs->trans("PhotoFile").'
'; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a05d8b27c5e..d79eaae65f0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -62,7 +62,7 @@ class FormFile * @param int $addcancel 1=Add 'Cancel' button * @param int $sectionid If upload must be done inside a particular ECM section * @param int $perm Value of permission to allow upload - * @param int $size Length of input file area + * @param int $size Length of input file area. Deprecated. * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. @@ -106,7 +106,7 @@ class FormFile if (! empty($options)) $out .= ''.$options.''; - $out .= ''; + $out .= ''; $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb $maxphp=@ini_get('upload_max_filesize'); // En inconnu @@ -121,10 +121,10 @@ class FormFile { $out .= ''; } - $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; - $out .= ' '; + $out .= ' '; $out .= 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; @@ -183,11 +183,11 @@ class FormFile $out .= '
'; $out .= '
'; if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= ' '; - $out .= ''; + $out .= ''; $out .= '
'; $out .= '
'; if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= ' '; - $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= '
'; @@ -1451,6 +1451,7 @@ class FormFile else { print ''; + print img_picto('', 'object_globe').' '; print ''; print $link->label; print ''; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 742bc1a0231..1112d34d13f 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -59,9 +59,10 @@ class FormProjets * @param string $filterkey Key to filter * @param int $nooutput No print output. Return it only. * @param int $forceaddid Force to add project id in list, event if not qualified + * @param string $morecss More css * @return string Return html content */ - function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0) + function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='') { global $langs,$conf,$form; @@ -85,7 +86,7 @@ class FormProjets // ) )); - $out.=''; + $out.=''; } else { diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 39a45ad783b..c8ce225e0c2 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -489,14 +489,20 @@ class SMTPs // and send it out "single file" foreach ( $this->get_RCPT_list() as $_address ) { - /* + /* Note: + * BCC email addresses must be listed in the RCPT TO command list, + * but the BCC header should not be printed under the DATA command. + * http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server + */ + + /* * TODO - * After each 'RCPT TO:' is sent, we need to make sure it was kosher, - * if not, the whole message will fail - * If any email address fails, we will need to RESET the connection, - * mark the last address as "bad" and start the address loop over again. - * If any address fails, the entire message fails. - */ + * After each 'RCPT TO:' is sent, we need to make sure it was kosher, + * if not, the whole message will fail + * If any email address fails, we will need to RESET the connection, + * mark the last address as "bad" and start the address loop over again. + * If any address fails, the entire message fails. + */ $this->socket_send_str('RCPT TO: <' . $_address . '>', '250'); } @@ -1025,7 +1031,7 @@ class SMTPs /** * Returns an array of addresses for a specific type; TO, CC or BCC * - * @param string $_which Which collection of adresses to return + * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @return string|false Array of emaill address */ function get_email_list($_which = null) @@ -1174,9 +1180,17 @@ class SMTPs if ( $this->getCC() ) $_header .= 'Cc: ' . $this->getCC() . "\r\n"; + /* Note: + * BCC email addresses must be listed in the RCPT TO command list, + * but the BCC header should not be printed under the DATA command. + * So it is included into the function sendMsg() but not here. + * http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server + */ + /* if ( $this->getBCC() ) $_header .= 'Bcc: ' . $this->getBCC() . "\r\n"; - + */ + $host=$this->getHost(); $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix diff --git a/htdocs/core/filemanagerdol/connectors/php/config.php b/htdocs/core/filemanagerdol/connectors/php/config.php index 8733e6a7c17..de8b4d7e8bf 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.php @@ -45,10 +45,12 @@ $Config['Enabled'] = true ; // Path to user files relative to the document root. -$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&file=' ; +$extEntity=(empty($entity) ? 1 : $entity); // For multicompany with external access +$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&entity='.$extEntity.'&file=' ; $Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website)); + // Fill the following value it you prefer to specify the absolute path for the // user files directory. Useful if you are using a virtual directory, symbolic // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 3914b59b9f6..0193a33b305 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -35,7 +35,7 @@ * @param string $urloption More parameters on URL request * @param int $minLength Minimum number of chars to trigger that Ajax search * @param int $autoselect Automatic selection if just one value - * @param array $ajaxoptions Multiple options array + * @param array $ajaxoptions Multiple options array * Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done * Ex: array('disabled'=> * Ex: array('show'=> @@ -61,8 +61,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("input#search_'.$htmlname.'").keydown(function() { $("#'.$htmlname.'").val(""); }); - - /* I disable this. A call to trigger is already done later into the select action of the autocomplete code + + /* I disable this. A call to trigger is already done later into the select action of the autocomplete code $("input#search_'.$htmlname.'").change(function() { console.log("Call the change trigger on input '.$htmlname.' because of a change on search_'.$htmlname.' was triggered"); $("#'.$htmlname.'").trigger("change"); @@ -291,7 +291,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt needtotrigger="#" + fields[i]; } } - + if (needtotrigger != "") // To force select2 to refresh visible content { // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done @@ -356,9 +356,10 @@ function ajax_dialog($title,$message,$w=350,$h=150) * @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete * @param int $forcefocus Force focus on field + * @param string $widthTypeOfAutocomplete 'resolve' or 'off' * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. */ -function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0) +function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve') { global $conf; @@ -375,7 +376,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $ $(document).ready(function () { $(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({ dir: \'ltr\', - width: \'resolve\', /* off or resolve */ + width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */ minimumInputLength: '.$minLengthToAutocomplete.' })'; if ($forcefocus) $msg.= '.select2(\'focus\')'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a5866527b50..948ce7271da 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1126,6 +1126,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email))) { + $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -1159,14 +1161,16 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=''; } $out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder); - $out.=''.$langs->trans("Label").''; + $out.=''.$langs->trans("Label").''; $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep, a.id', '', $param, '', $sortfield, $sortorder); $out.=''.$langs->trans("Type").''; $out.=''; $out.=''; $out.=''.$langs->trans("Owner").''; $out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder); - $out.=''; + $out.=''; + //TODO Add selection of fields + $out.=''; $out.=''; @@ -1176,7 +1180,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=''; } $out.=''; - $out.=''; + $out.=''; $out.=''; $out.=''; $out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1); @@ -1242,6 +1246,12 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour'); else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour'); } + $late=0; + if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1; + if ($histo[$key]['percent'] == 0 && ! $histo[$key]['datestart'] && $histo[$key]['dateend'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1; + if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && $histo[$key]['dateend'] && $db->jdate($histo[$key]['dateend']) < ($now - $delay_warning)) $late=1; + if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1; + if ($late) $out.=img_warning($langs->trans("Late")).' '; $out.="\n"; // Type diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b1a9c0b2735..677b619bd02 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -772,7 +772,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto */ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0) { - global $conf,$langs, $hookmanager; + global $conf, $langs, $hookmanager; $out="\n".'
'."\n"; @@ -897,9 +897,13 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi if (! $notab) $out.="\n".'
'."\n"; - $parameters=array('tabname' => $active); - $reshook=$hookmanager->executeHooks('printTabsHead',$parameters); // Note that $action and $object may have been modified by some hooks - + $parameters=array('tabname' => $active, 'out' => $out); + $reshook=$hookmanager->executeHooks('printTabsHead',$parameters); // This hook usage is called just before output the head of tabs. Take also a look at "completeTabsHead" + if ($reshook > 0) + { + $out = $hookmanager->resPrint; + } + return $out; } @@ -939,11 +943,12 @@ function dol_get_fiche_end($notab=0) * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref + * @param string $morehtmlstatus More html code to show under navigation arrows * @param string $morehtmlright More html code to show before navigation arrows * @param int $onlybanner Put this to 1, if the card will contains only a banner * @return void */ -function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='', $onlybanner=0) +function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='') { global $conf, $form, $user, $langs; @@ -1013,38 +1018,38 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); } elseif ($object->element == 'product') { - //$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; + //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { - $morehtmlright.=$object->getLibStatut(5,0); + $morehtmlstatus.=$object->getLibStatut(5,0); } - $morehtmlright.='   '; - //$morehtmlright.=$langs->trans("Status").' ('.$langs->trans("Buy").') '; + $morehtmlstatus.='   '; + //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') '; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + $morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { - $morehtmlright.=$object->getLibStatut(5,1); + $morehtmlstatus.=$object->getLibStatut(5,1); } } elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier') { $tmptxt=$object->getLibStatut(6, $object->totalpaye); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5, $object->totalpaye); - $morehtmlright.=$tmptxt; + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); + $morehtmlstatus.=$tmptxt; } elseif ($object->element == 'facturerec') { - $morehtmlright.=''; + $morehtmlstatus.=''; } - else { + else { // Generic case $tmptxt=$object->getLibStatut(6); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5); - $morehtmlright.=$tmptxt; + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); + $morehtmlstatus.=$tmptxt; } if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; // For thirdparty if (! empty($object->label)) $morehtmlref.='
'.$object->label.'
'; // For product @@ -1062,7 +1067,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } print '
'; - print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright); + print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); print '
'; print '
'; } @@ -2241,14 +2246,14 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @param int $pictoisfullpath If 1, image path is a full path * @param int $srconly Return only content of the src attribute of img. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @return string Return img tag * @see #img_object, #img_picto_common */ -function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) +function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0) { global $conf; @@ -2300,7 +2305,7 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $ if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB $title=$tmparray[0]; $alt=empty($tmparray[1])?'':$tmparray[1]; - return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } @@ -2310,16 +2315,16 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $ * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...) * For external modules use imagename@mymodule to search into directory "img" of module. - * @param string $options Add more attribute on img tag (ie: class="datecallink") + * @param string $morealt Add more attribute on img tag (ie: class="datecallink") * @param int $pictoisfullpath If 1, image path is a full path * @param int $srconly Return only content of the src attribute of img. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @return string Return img tag * @see #img_picto, #img_picto_common */ -function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) +function img_object($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $srconly=0, $notitle=0) { - return img_picto($titlealt, 'object_'.$picto, $options, $pictoisfullpath, $srconly, $notitle); + return img_picto($titlealt, 'object_'.$picto, $morealt, $pictoisfullpath, $srconly, $notitle); } /** @@ -2327,12 +2332,12 @@ function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false, * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. - * @param string $options Add more attribute on img tag + * @param string $morealt Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see #img_object, #img_picto */ -function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) +function img_weather($titlealt, $picto, $morealt = '', $pictoisfullpath = 0) { global $conf; @@ -2340,7 +2345,7 @@ function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) $path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto; - return img_picto($titlealt, $path, $options, 1); + return img_picto($titlealt, $path, $morealt, 1); } /** @@ -2348,12 +2353,12 @@ function img_weather($titlealt, $picto, $options = '', $pictoisfullpath = 0) * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. - * @param string $options Add more attribute on img tag + * @param string $morealt Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see #img_object, #img_picto */ -function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0) +function img_picto_common($titlealt, $picto, $morealt = '', $pictoisfullpath = 0) { global $conf; @@ -2372,7 +2377,7 @@ function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0 } } - return img_picto($titlealt, $path, $options, 1); + return img_picto($titlealt, $path, $morealt, 1); } /** @@ -2478,9 +2483,9 @@ function img_view($titlealt = 'default', $float = 0, $other = '') if ($titlealt == 'default') $titlealt = $langs->trans('View'); - $options = ($float ? 'style="float: right" ' : '').$other; + $morealt = ($float ? 'style="float: right" ' : '').$other; - return img_picto($titlealt, 'view.png', $options); + return img_picto($titlealt, 'view.png', $morealt); } /** @@ -2552,16 +2557,16 @@ function img_info($titlealt = 'default') * Show warning logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param string $options Add more attribute on img tag (For example 'style="float: right"'). If 1 + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"'). If 1 * @return string Return img tag */ -function img_warning($titlealt = 'default', $options = '') +function img_warning($titlealt = 'default', $morealt = '') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); - return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($options ? ($options == '1' ? ' style="float: right"' : ' '.$options): '')); + return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): '')); } /** @@ -2583,32 +2588,32 @@ function img_error($titlealt = 'default') * Show next logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. -* @param string $options Add more attribute on img tag (For example 'style="float: right"') +* @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_next($titlealt = 'default', $options='') +function img_next($titlealt = 'default', $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Next'); - return img_picto($titlealt, 'next.png', $options); + return img_picto($titlealt, 'next.png', $morealt); } /** * Show previous logo * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_previous($titlealt = 'default', $options='') +function img_previous($titlealt = 'default', $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Previous'); - return img_picto($titlealt, 'previous.png', $options); + return img_picto($titlealt, 'previous.png', $morealt); } /** @@ -2650,16 +2655,16 @@ function img_up($titlealt = 'default', $selected = 0, $moreclass='') * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_left($titlealt = 'default', $selected = 0, $options='') +function img_left($titlealt = 'default', $selected = 0, $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Left'); - return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $morealt); } /** @@ -2667,16 +2672,16 @@ function img_left($titlealt = 'default', $selected = 0, $options='') * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected - * @param string $options Add more attribute on img tag (For example 'style="float: right"') + * @param string $morealt Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_right($titlealt = 'default', $selected = 0, $options='') +function img_right($titlealt = 'default', $selected = 0, $morealt='') { global $conf, $langs; if ($titlealt == 'default') $titlealt = $langs->trans('Right'); - return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $morealt); } /** @@ -5334,8 +5339,9 @@ function picto_from_langcode($codelang) } /** - * Complete or removed entries into a head array (used to build tabs) with value added by external modules. - * Such values are declared into $conf->modules_parts['tab']. + * Complete or removed entries into a head array (used to build tabs). + * For example, with value added by external modules. Such values are declared into $conf->modules_parts['tab']. + * Or by change using hook completeTabsHead * * @param Conf $conf Object conf * @param Translate $langs Object langs @@ -5362,6 +5368,8 @@ function picto_from_langcode($codelang) */ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add') { + global $hookmanager; + if (isset($conf->modules_parts['tabs'][$type]) && is_array($conf->modules_parts['tabs'][$type])) { foreach ($conf->modules_parts['tabs'][$type] as $value) @@ -5427,6 +5435,17 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= } } } + + // No need to make a return $head. Var is modified as a reference + if (! empty($hookmanager)) + { + $parameters=array('object' => $object, 'mode' => $mode, 'head'=>$head); + $reshook=$hookmanager->executeHooks('completeTabsHead',$parameters); + if ($reshook > 0) + { + $head = $hookmanager->resArray; + } + } } /** diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 8b017a5a9f3..840687ba69a 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -322,7 +322,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt { $result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; - $result[0]=price2num($result[2]-$result[0], 'MT'); + $result[0]=price2num($result[2]-$result[1], 'MT'); $result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; } diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 740bb223cba..0fc401f0280 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -515,6 +515,110 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, } } - return $list; + // Expense Report + if ($direction == 'buy') + { + // Define sql request + $sql=''; + + // Count on payments date + $sql = "SELECT e.rowid, d.product_type as dtype, e.rowid as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,"; + $sql .=" d.total_localtax1 as total_localtax1, d.total_localtax2 as total_localtax2, "; + $sql.= " e.date_debut as date_start, e.date_fin as date_end,"; + $sql.= " e.ref as facnum, e.total_ttc as ftotal_ttc, e.date_create, s.nom as company_name, s.rowid as company_id, d.fk_c_type_fees as type,"; + $sql.= " p.fk_bank as payment_id, p.amount as payment_amount, p.rowid as pid, e.ref as pref"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,"; + $sql.= " ".MAIN_DB_PREFIX."expensereport_det as d,"; + $sql.= " ".MAIN_DB_PREFIX."expensereport as e,"; + $sql.= " ".MAIN_DB_PREFIX."payment_expensereport as p"; + $sql.= " WHERE e.entity = " . $conf->entity; + $sql.= " AND e.fk_statut in (6)"; + $sql.= " AND e.rowid = p.fk_expensereport"; + $sql.= " AND s.rowid = e.entity"; + $sql.= " AND d.fk_expensereport = e.rowid"; + if ($y && $m) + { + $sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; + $sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; + } + else if ($y) + { + $sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'"; + $sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'"; + } + if ($q) $sql.= " AND (date_format(p.datep,'%m') > ".(($q-1)*3)." AND date_format(p.datep,'%m') <= ".($q*3).")"; + if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " AND (d.product_type = -1"; + $sql.= " OR e.date_debut is NOT null OR e.date_fin IS NOT NULL)"; // enhance detection of service + $sql.= " ORDER BY e.rowid"; + + if (! $sql) + { + dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR); + return -1; // -1 = Not accountancy module enabled + } + if ($sql == 'TODO') return -2; // -2 = Feature not yet available + if ($sql != 'TODO') + { + dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $rate = -1; + $oldrowid=''; + while($assoc = $db->fetch_array($resql)) + { + if (! isset($list[$assoc['rate']]['totalht'])) $list[$assoc['rate']]['totalht']=0; + if (! isset($list[$assoc['rate']]['vat'])) $list[$assoc['rate']]['vat']=0; + if (! isset($list[$assoc['rate']]['localtax1'])) $list[$assoc['rate']]['localtax1']=0; + if (! isset($list[$assoc['rate']]['localtax2'])) $list[$assoc['rate']]['localtax2']=0; + + if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid + { + $oldrowid=$assoc['rowid']; + $list[$assoc['rate']]['totalht'] += $assoc['total_ht']; + $list[$assoc['rate']]['localtax1'] += $assoc['total_localtax1']; + $list[$assoc['rate']]['localtax2'] += $assoc['total_localtax2']; + } + + $list[$assoc['rate']]['vat'] = $assoc['total_vat']; + $list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc']; + $list[$assoc['rate']]['dtype'][] = 'ExpenseReportPayment'; + $list[$assoc['rate']]['datef'][] = $assoc['datef']; + $list[$assoc['rate']]['company_name'][] = $assoc['company_name']; + $list[$assoc['rate']]['company_id'][] = $assoc['company_id']; + $list[$assoc['rate']]['ddate_start'][] = $db->jdate($assoc['date_start']); + $list[$assoc['rate']]['ddate_end'][] = $db->jdate($assoc['date_end']); + + $list[$assoc['rate']]['facid'][] = $assoc['facid']; + $list[$assoc['rate']]['facnum'][] = $assoc['facnum']; + $list[$assoc['rate']]['type'][] = $assoc['type']; + $list[$assoc['rate']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; + $list[$assoc['rate']]['descr'][] = $assoc['descr']; + + $list[$assoc['rate']]['totalht_list'][] = $assoc['total_ht']; + $list[$assoc['rate']]['vat_list'][] = $assoc['total_vat']; + $list[$assoc['rate']]['localtax1_list'][] = $assoc['total_localtax1']; + $list[$assoc['rate']]['localtax2_list'][] = $assoc['total_localtax2']; + + $list[$assoc['rate']]['pid'][] = $assoc['pid']; + $list[$assoc['rate']]['pref'][] = $assoc['pref']; + $list[$assoc['rate']]['ptype'][] = 'ExpenseReportPayment'; + + $list[$assoc['rate']]['payment_id'][] = $assoc['payment_id']; + $list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount']; + + $rate = $assoc['rate']; + } + } + else + { + dol_print_error($db); + return -3; + } + } + } + + return $list; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 2e9a9d582bd..1b5fdd69c26 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -465,7 +465,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if ($color) print ''; else print $langs->trans("Default"); } - print '   ('.$langs->trans("Default").': ffffff, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': ffffff) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; } @@ -511,7 +512,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if ($color) print ''; else print $langs->trans("Default"); } - print '   ('.$langs->trans("Default").': '.$default.', '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': '.$default.') '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; } @@ -554,7 +556,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE); } - print '   ('.$langs->trans("Default").': '.$default.', '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': '.$default.') '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; } @@ -581,7 +584,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); } - print '   ('.$langs->trans("Default").': e6e6e6, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': e6e6e6) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; print ''; @@ -607,7 +611,9 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); } - print '   ('.$langs->trans("Default").': 3c3c14, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': 3c3c14) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); + print ''; print ''; @@ -653,7 +659,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if ($color) print ''; else print $langs->trans("Default"); } - print '   ('.$langs->trans("Default").': 000078, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': 000078) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; } @@ -696,7 +703,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) } else print $langs->trans("None"); } - print '   ('.$langs->trans("Default").': edf4fb, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': edf4fb) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; print ''; } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index e5972cc1ad4..72b9a7e6def 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -372,9 +372,6 @@ class pdf_merou extends ModelePdfExpedition $this->error=$outputlangs->transnoentities("ErrorConstantNotDefined","EXP_OUTPUTDIR"); return 0; } - $this->error=$outputlangs->transnoentities("ErrorUnknown"); - return 0; // Erreur par defaut - } /** diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 2c873412da5..e826b18f0e0 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php'; /** - * \class mod_facture_mercure - * \brief Classe du modele de numerotation de reference de facture Mercure + * Class of numbering module Mercure for invoices */ class mod_facture_mercure extends ModeleNumRefFactures { diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 489b0fb77f1..4215bbdfa2a 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -115,12 +115,6 @@ class modExpenseReport extends DolibarrModules $this->rights[4][3] = 0; $this->rights[4][4] = 'supprimer'; - $this->rights[2][0] = 774; - $this->rights[2][1] = 'Read all expense reports'; - $this->rights[2][2] = 'r'; - $this->rights[2][3] = 1; - $this->rights[2][4] = 'readall'; - $this->rights[6][0] = 775; $this->rights[6][1] = 'Approve expense reports'; $this->rights[6][2] = 'w'; @@ -133,20 +127,17 @@ class modExpenseReport extends DolibarrModules $this->rights[7][3] = 0; $this->rights[7][4] = 'to_paid'; - if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) - { - $this->rights[8][0] = 777; - $this->rights[8][1] = 'Synchroniser les NDF avec un compte courant'; - $this->rights[8][2] = 'w'; - $this->rights[8][3] = 0; - $this->rights[8][4] = 'synchro'; + $this->rights[2][0] = 777; + $this->rights[2][1] = 'Read expense reports of everybody'; + $this->rights[2][2] = 'r'; + $this->rights[2][3] = 1; + $this->rights[2][4] = 'readall'; - $this->rights[9][0] = 778; - $this->rights[9][1] = 'Exporter les NDF au format CSV'; - $this->rights[9][2] = 'r'; - $this->rights[9][3] = 0; - $this->rights[9][4] = 'export_csv'; - } + $this->rights[2][0] = 778; + $this->rights[2][1] = 'Create expense reports for everybody'; + $this->rights[2][2] = 'w'; + $this->rights[2][3] = 0; + $this->rights[2][4] = 'writeall_advance'; $this->rights[5][0] = 779; $this->rights[5][1] = 'Export expense reports'; diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 1bd1aea6833..43e49ce55d3 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -62,7 +62,7 @@ class modMultiCurrency extends DolibarrModules $this->description = "Module to enter elements with a foreign currency"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version - $this->version = 'development'; + $this->version = 'experimental'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index ea0456bc3ff..6e875af78f2 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,14 +22,14 @@ /** * \file htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php * \ingroup supplier invoice - * \brief File containing the Cactus Class of numbering models of suppliers invoices references + * \brief File containing class for the numbering module Cactus */ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/modules_facturefournisseur.php'; /** - * Cactus Class of numbering models of suppliers invoices references + * Cactus Class of numbering models of suppliers invoices references */ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices { @@ -36,6 +37,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices var $error = ''; var $nom = 'Cactus'; var $prefixinvoice='SI'; + var $prefixcreditnote='SA'; + var $prefixdeposit='SD'; /** @@ -46,7 +49,8 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices function info() { global $langs; - return $langs->trans("SimpleNumRefModelDesc",$this->prefixinvoice); + $langs->load("bills"); + return $langs->trans("CactusNumRefModelDesc1",$this->prefixinvoice,$this->prefixcreditnote,$this->prefixdeposit); } @@ -61,45 +65,86 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices } - /** - * Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. - * - * @return boolean false if conflict, true if ok - */ - function canBeActivated() - { - global $conf,$langs,$db; + /** + * Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. + * + * @return boolean false if conflict, true if ok + */ + function canBeActivated() + { + global $conf,$langs,$db; - $siyymm=''; $max=''; + $langs->load("bills"); + + // Check invoice num + $siyymm=''; $max=''; $posindice=8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; $sql.= " WHERE ref LIKE '".$this->prefixinvoice."____-%'"; - $sql.= " AND entity = ".$conf->entity; - $resql=$db->query($sql); - if ($resql) - { - $row = $db->fetch_row($resql); - if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } - } - if (! $siyymm || preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$siyymm)) - { - return true; - } - else - { + $sql.= " AND entity = ".$conf->entity; + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($siyymm && ! preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { $langs->load("errors"); $this->error=$langs->trans('ErrorNumRefModel',$max); - return false; - } + return false; + } + + // Check credit note num + $siyymm=''; + + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$this->prefixcreditnote."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($siyymm && ! preg_match('/'.$this->prefixcreditnote.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { + $this->error=$langs->trans('ErrorNumRefModel',$max); + return false; + } + + // Check deposit num + $siyymm=''; + + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$this->prefixdeposit."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($siyymm && ! preg_match('/'.$this->prefixdeposit.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { + $this->error=$langs->trans('ErrorNumRefModel',$max); + return false; + } } /** * Return next value * * @param Societe $objsoc Object third party - * @param Object $object Object + * @param Object $object Object invoice * @param string $mode 'next' for next value or 'last' for last value * @return string Value if OK, 0 if KO */ @@ -108,6 +153,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices global $db,$conf; if ($object->type == 2) $prefix=$this->prefixcreditnote; + else if ($facture->type == 3) $prefix=$this->prefixdeposit; else $prefix=$this->prefixinvoice; // D'abord on recupere la valeur max diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index ba31d979864..b7a3801a9cd 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -3,7 +3,8 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Philippe Grand - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,6 +60,9 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices $texte.= ''; $texte.= ''; $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= ''; $texte.= ''; $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Invoice"),$langs->transnoentities("Invoice")); @@ -68,13 +72,28 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices $tooltip.=$langs->trans("GenericMaskCodes5"); // Parametrage du prefix - $texte.= ''; + $texte.= ''; $texte.= ''; $texte.= ''; $texte.= ''; + // Parametrage du prefix des replacement + $texte.= ''; + $texte.= ''; + $texte.= ''; + + // Parametrage du prefix des avoirs + $texte.= ''; + $texte.= ''; + $texte.= ''; + + // Parametrage du prefix des acomptes + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= '
'.$langs->trans("Mask").':
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'.$form->textwithpicto('',$tooltip,1,1).' 
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('',$tooltip,1,1).'
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'.$form->textwithpicto('',$tooltip,1,1).'
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'.$form->textwithpicto('',$tooltip,1,1).'
'; $texte.= ''; @@ -106,7 +125,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices * Return next value * * @param Societe $objsoc Object third party - * @param Object $object Object + * @param Object $object Object invoice * @param string $mode 'next' for next value or 'last' for last value * @return string Value if OK, 0 if KO */ @@ -116,16 +135,26 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; - // On defini critere recherche compteur - $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; - + // Get Mask value + $mask = ''; + if (is_object($object) && $object->type == 1) + { + $mask=$conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK; + if (! $mask) + { + $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; + } + } + else if (is_object($object) && $object->type == 2) $mask=$conf->global->SUPPLIER_CREDIT_TULIP_MASK; + else if (is_object($object) && $object->type == 3) $mask=$conf->global->SUPPLIER_DEPOSIT_TULIP_MASK; + else $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; if (! $mask) { $this->error='NotConfigured'; return 0; } - //Supplier invoices take invoice date instead of creation date for the mask + // Supplier invoices take invoice date instead of creation date for the mask $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc,$object->date); return $numFinal; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 28a02fcd38a..845bc30ce13 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -110,11 +110,10 @@ if ($permission) {
socid; ?> dol_use_jmobile)) + // add company icon before select list + if ($selectedCompany) { - $companystatic->fetch($selectedCompany); - echo $companystatic->getNomUrl(2, '', 0, 1); + echo img_object('', 'company', 'class="hideonsmartphone"'); } ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0); ?> diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index bc7cf44ce66..c971a49148f 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -63,8 +63,8 @@ elseif ($module == 'shipping') { $permission=$user->rights->expedition->cr elseif ($module == 'product') { $permission=$user->rights->produit->creer;} //else dol_print_error('','Bad value '.$module.' for param module'); -if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100'; // Rem: This var is for all notes, not only thirdparties note. -else $typeofdata='textarea:12:100'; +if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note. +else $typeofdata='textarea:12:95%'; ?> @@ -72,14 +72,14 @@ else $typeofdata='textarea:12:100';
-
>editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?>
-
editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
+
>editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); ?>
+
editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?>
societe_id)) { ?>
-
>editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?>
-
editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?>
+
>editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); ?>
+
editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); ?>
diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 9894de3a2b5..5e4b2966051 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -96,7 +96,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 729543eff56..dd37c86592a 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -140,9 +140,9 @@ print ''; print ''; print ""; print ''; -print "'; -print "'; -print "'; +print "'; +print "'; +print "'; print "'; print "
'.$langs->trans("ECMSearchByKeywords").'
".$langs->trans("Ref").':
".$langs->trans("Title").':
".$langs->trans("Keyword").':
".$langs->trans("Ref").':
".$langs->trans("Title").':
".$langs->trans("Keyword").':
"; //print $langs->trans("ECMSectionManualDesc"); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1994eded0da..06b7fb94cc0 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -46,6 +46,8 @@ $langs->load("mails"); $action=GETPOST('action'); $cancel=GETPOST('cancel'); +$confirm = GETPOST('confirm', 'alpha'); + $date_start = dol_mktime(0, 0, 0, GETPOST('date_debutmonth'), GETPOST('date_debutday'), GETPOST('date_debutyear')); $date_end = dol_mktime(0, 0, 0, GETPOST('date_finmonth'), GETPOST('date_finday'), GETPOST('date_finyear')); $date = dol_mktime(0, 0, 0, GETPOST('datemonth'), GETPOST('dateday'), GETPOST('dateyear')); @@ -192,6 +194,12 @@ if (empty($reshook)) $object->date_debut = $date_start; $object->date_fin = $date_end; + $object->fk_user_author = GETPOST('fk_user_author','int'); + if (! ($object->fk_user_author > 0)) $object->fk_user_author = $user->id; + + $fuser=new User($db); + $fuser->fetch($object->fk_user_author); + $object->fk_statut = 1; $object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->fk_user_validator = GETPOST('fk_user_validator','int'); @@ -204,7 +212,7 @@ if (empty($reshook)) if ($ret < 0) $error++; } - if ($object->periode_existe($user,$object->date_debut,$object->date_fin)) + if ($object->periode_existe($fuser,$object->date_debut,$object->date_fin)) { $error++; setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors'); @@ -1198,18 +1206,35 @@ if ($action == 'create') print ''; print ''; + + // Date start print ''; print ''; print ''; print ''; + + // Date end print ''; print ''; print ''; print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; + + // Payment mode if (! empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { print ''; @@ -1284,7 +1311,8 @@ else { if ($object->fk_user_author != $user->id) { - if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) + if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous) + && empty($user->rights->expensereport->writeall_advance)) { print load_fiche_titre($langs->trans('TripCard')); @@ -1322,6 +1350,14 @@ else $linkback = ''.$langs->trans("BackToList").''; + print ''; + print ''; + print ''; + // Ref print ''; } - print ''; - print ''; - print ''; if ($object->fk_statut==6) { print ''; @@ -1430,6 +1459,20 @@ else { dol_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => + // 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' + // => 1), + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneExpenseReport'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + if ($action == 'save') { $formconfirm=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1); @@ -1543,6 +1586,19 @@ else print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '';*/ + // Author + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; - // Author - print ''; - print ''; - print ''; - // Validation date print ''; print ''; @@ -1824,7 +1867,7 @@ else print ''; print ''; print ''; - if (! empty($conf->projet->enabled)) print ''; + if (! empty($conf->projet->enabled)) print ''; print ''; print ''; print ''; @@ -1972,10 +2015,11 @@ else if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer) { print ''; + print ''; print ''; - if (! empty($conf->projet->enabled)) print ''; + if (! empty($conf->projet->enabled)) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -1985,6 +2029,8 @@ else print ''; + print ''; + // Select date print ''; // Add comments - print ''; @@ -2198,6 +2244,10 @@ if ($action != 'create' && $action != 'edit') print ''; } + // Clone + if ($user->rights->expensereport->creer) { + print ''; + } /* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */ if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4) @@ -2219,7 +2269,7 @@ print ''; //$conf->global->DOL_URL_ROOT_DOCUMENT_PHP=dol_buildpath('/expensereport/documentwrapper.php',1); -print '
'; +print '
'; /* * Generate documents diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 8a49983eccf..feb61c130e7 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -126,6 +126,9 @@ class ExpenseReport extends CommonObject $now = dol_now(); + $fuserid = $this->fk_user_author; + if (empty($fuserid)) $fuserid = $user->id; + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; @@ -153,7 +156,7 @@ class ExpenseReport extends CommonObject $sql.= ", '".$this->db->idate($this->date_debut)."'"; $sql.= ", '".$this->db->idate($this->date_fin)."'"; $sql.= ", '".$this->db->idate($now)."'"; - $sql.= ", ".($user->id > 0 ? $user->id:"null"); + $sql.= ", ".$fuserid; $sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null"); $sql.= ", ".($this->fk_user_modif > 0 ? $this->fk_user_modif:"null"); $sql.= ", ".($this->fk_statut > 1 ? $this->fk_statut:0); @@ -222,6 +225,78 @@ class ExpenseReport extends CommonObject } + + /** + * Load an object from its id and create a new one in database + * + * @param int $socid Id of thirdparty + * @return int New id of clone + */ + function createFromClone($socid=0) + { + global $user,$hookmanager; + + $error=0; + + $this->context['createfromclone'] = 'createfromclone'; + + $this->db->begin(); + + // get extrafields so they will be clone + foreach($this->lines as $line) + //$line->fetch_optionals($line->rowid); + + // Load source object + $objFrom = clone $this; + + $this->id=0; + $this->ref = ''; + $this->statut=0; + + // Clear fields + $this->fk_user_author = $user->id; + $this->fk_user_valid = ''; + $this->date_create = ''; + $this->date_creation = ''; + $this->date_validation = ''; + + // Create clone + $result=$this->create($user); + if ($result < 0) $error++; + + if (! $error) + { + // Hook of thirdparty module + if (is_object($hookmanager)) + { + $parameters=array('objFrom'=>$objFrom); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; + } + + // Call trigger + $result=$this->call_trigger('EXPENSEREPORT_CLONE',$user); + if ($result < 0) $error++; + // End call triggers + } + + unset($this->context['createfromclone']); + + // End + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -1; + } + } + + /** * update * @@ -1164,25 +1239,56 @@ class ExpenseReport extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @return string String with URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $max Max length of shown ref + * @param int $short 1=Return just URL + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @return string String with URL */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto=0,$max=0,$short=0,$moretitle='',$notooltip=0) { - global $langs; + global $langs, $conf; $result=''; - $link = ''; - $linkend=''; + $url = DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id; + + if ($short) return $url; $picto='trip'; + $label = '' . $langs->trans("ShowExpenseReport") . ''; + if (! empty($this->ref)) + $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref; + if (! empty($this->total_ht)) + $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_tva)) + $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_ttc)) + $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + if ($moretitle) $label.=' - '.$moretitle; - $label=$langs->trans("Show").': '.$this->ref; + $ref=$this->ref; + if (empty($ref)) $ref=$this->id; - if ($withpicto) $result.=($link.img_object($label,$picto).$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$this->ref.$linkend; + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowExpenseReport"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip"'; + } + + $linkstart = ''; + $linkend=''; + + if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend.' '); + $result.=$linkstart.($max?dol_trunc($ref,$max):$ref).$linkend; return $result; } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index e6493fe36db..ab9f318ca89 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -100,7 +100,7 @@ if (empty($user->socid)) $fieldstosearchall["d.note_private"]="NotePrivate"; $arrayfields=array( 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'user'=>array('label'=>$langs->trans("Person"), 'checked'=>1), + 'user'=>array('label'=>$langs->trans("User"), 'checked'=>1), 'd.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1), 'd.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1), 'd.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), @@ -248,7 +248,8 @@ if ($search_status != '' && $search_status >= 0) else $sql.=" AND d.fk_statut = ".$search_status; } // RESTRICT RIGHTS -if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) +if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous) + && empty($user->rights->expensereport->writeall_advance)) { $childids = $user->getAllChildIds(); $childids[]=$user->id; @@ -354,7 +355,7 @@ if ($resql) print '
'.$langs->trans("DateStart").''; $form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1); print '
'.$langs->trans("DateEnd").''; $form->select_date($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1); print '
'.$langs->trans("User").''; + $defaultselectuser=$user->id; + if (GETPOST('fk_user_author') > 0) $defaultselectuser=GETPOST('fk_user_author'); + $include_users = array($user->id); + if (! empty($user->rights->expensereport->writeall)) $include_users=array(); + $s=$form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users); + print $s; + print '
'.$langs->trans("VALIDATOR").''; @@ -1222,6 +1247,8 @@ if ($action == 'create') print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate")); print '
'.$langs->trans("User").''; + $userfee=new User($db); + $userfee->fetch($object->fk_user_author); + print $userfee->getNomUrl(-1); + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); @@ -1372,13 +1408,6 @@ else print '
'.$langs->trans("AUTHOR").''; - $userfee=new User($db); - $userfee->fetch($object->fk_user_author); - print $userfee->getNomUrl(-1); - print '
'.$langs->trans("User").''; + if ($object->fk_user_author > 0) + { + $userauthor=new User($db); + $result=$userauthor->fetch($object->fk_user_author); + if ($result < 0) dol_print_error('',$userauthor->error); + print $userauthor->getNomUrl(-1); + } + print '
'.$langs->trans("Period").''; @@ -1595,19 +1651,6 @@ else print ''.price($object->total_ttc).'
'.$langs->trans("AUTHOR").''; - if ($object->fk_user_author > 0) - { - $userauthor=new User($db); - $result=$userauthor->fetch($object->fk_user_author); - if ($result < 0) dol_print_error('',$userauthor->error); - print $userauthor->getNomUrl(-1); - } - print '
'.$langs->trans("DATE_SAVE").'
'.$langs->trans('Piece').''.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Project').''.$langs->trans('Type').''.$langs->trans('Description').''.$langs->trans('VAT').'
'.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Project').''.$langs->trans('Type').''.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').'
'; $form->select_date($date?$date:-1,'date'); @@ -2004,7 +2050,7 @@ else print ''; + print ''; print ''; print '
'."\n"; print ""; if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.ref","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['user']['checked'])) print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['user']['checked'])) print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.lastname","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.date_debut']['checked'])) print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"d.date_debut","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['d.date_fin']['checked'])) print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"d.date_fin","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['d.total_ht']['checked'])) print_liste_field_titre($langs->trans("TotalHT"),$_SERVER["PHP_SELF"],"d.total_ht","",$param,'align="right"',$sortfield,$sortorder); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7a852704f9c..5ce08697913 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Xavier Dutoit - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-alpha'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.0-beta'); if (! defined('EURO')) define('EURO',chr(128)); diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index 5afde3a4427..ff16f267431 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -52,7 +52,8 @@ foreach($linkedObjectBlock as $key => $objectlink) - 1) { ?> diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 923d226a57c..ecad08da51a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2623,7 +2623,7 @@ else // Modify a validated invoice with no payments if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) { - print ''.$langs->trans('Modify').''; + print ''; } // Reopen a standard paid invoice @@ -2631,11 +2631,11 @@ else { if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice { - print ''.$langs->trans('ReOpen').''; + print ''; } else { - print ''.$langs->trans('ReOpen').''; + print '
'.$langs->trans('ReOpen').'
'; } } @@ -2644,26 +2644,52 @@ else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) { - print ''.$langs->trans('SendByMail').''; + print ''; } - else print ''.$langs->trans('SendByMail').''; + else print '
'.$langs->trans('SendByMail').'
'; } // Make payments - if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) + if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { - print ''.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice + print ''; // must use facid because id is for payment id not invoice } // Classify paid if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { - print ''.$langs->trans('ClassifyPaid').''; + print ''; //print ''.$langs->trans('ClassifyPaid').''; } + // Reverse back money or convert to reduction + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) { + // For credit note only + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0) + { + if ($resteapayer == 0) + { + print '
'.$langs->trans('DoPaymentBack').'
'; + } + else + { + print ''; + } + } + + // For credit note + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() == 0) { + print ''; + } + // For deposit invoice + if ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->paye == 1 && $resteapayer == 0 && $user->rights->fournisseur->facture->creer && empty($discount->id)) + { + print ''; + } + } + // Validate if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT) { @@ -2672,13 +2698,13 @@ else if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) { - print ''.$langs->trans('Validate').''; + print ''; } else { - print ''.$langs->trans('Validate').''; + print ''; } } } @@ -2692,7 +2718,7 @@ else // Clone if ($action != 'edit' && $user->rights->fournisseur->facture->creer) { - print 'socid.'">'.$langs->trans('ToClone').''; + print ''; } // Create a credit note @@ -2710,7 +2736,7 @@ else if ($object->getSommePaiement()) { print ''; } else { - print ''.$langs->trans('Delete').''; + print ''; } } print ''; diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 4df741b8ad4..2257b7b67c4 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -47,13 +47,23 @@ foreach($linkedObjectBlock as $key => $objectlink) 1) { ?> diff --git a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php index e8248a385fa..8a3023cab20 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php @@ -505,7 +505,7 @@ class CommentParser $data = explode('|', $data); $r['type'] = count($data) == 1 ? $data[0] : $data; } - if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { + if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) { $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); $r['type'] = 'array'; } diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index dc86614df4c..92f29ceab11 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -25,8 +25,8 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); -- after changing const name, please insure that old constant was rename -UPDATE llx_const SET name = 'THIRDPARTY_DEFAULT_CREATE_CONTACT' WHERE name='MAIN_THIRPARTY_CREATION_INDIVIDUAL' -- under 3.9.0 -UPDATE llx_const SET name = 'THIRDPARTY_DEFAULT_CREATE_CONTACT' WHERE name='MAIN_THIRDPARTY_CREATION_INDIVIDUAL' -- under 4.0.1 +UPDATE llx_const SET name = __ENCRYPT('THIRDPARTY_DEFAULT_CREATE_CONTACT')__ WHERE name = __ENCRYPT('MAIN_THIRPARTY_CREATION_INDIVIDUAL')__; -- under 3.9.0 +UPDATE llx_const SET name = __ENCRYPT('THIRDPARTY_DEFAULT_CREATE_CONTACT')__ WHERE name = __ENCRYPT('MAIN_THIRDPARTY_CREATION_INDIVIDUAL')__; -- under 4.0.1 -- VPGSQL8.2 ALTER TABLE llx_product_lot ALTER COLUMN entity SET DEFAULT 1; ALTER TABLE llx_product_lot MODIFY COLUMN entity integer DEFAULT 1; @@ -48,6 +48,9 @@ ALTER TABLE llx_don ADD COLUMN date_valid datetime; DELETE FROM llx_menu where module='expensereport'; +ALTER TABLE llx_facturedet ADD COLUMN fk_user_author integer after fk_unit; +ALTER TABLE llx_facturedet ADD COLUMN fk_user_modif integer after fk_unit; + ALTER TABLE llx_user DROP COLUMN phenix_login; ALTER TABLE llx_user DROP COLUMN phenix_pass; ALTER TABLE llx_user ADD COLUMN dateemployment datetime; @@ -108,8 +111,10 @@ ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafield ALTER TABLE llx_cotisation RENAME TO llx_subscription; ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh); ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real; -ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT 'yes'; - +ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1'; + +UPDATE llx_adherent_type SET subscription = '1' WHERE subscription = 'yes'; + CREATE TABLE llx_product_lot_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -171,7 +176,7 @@ create table llx_resource_extrafields ALTER TABLE llx_resource_extrafields ADD INDEX idx_resource_extrafields (fk_object); -INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Max length for small lists (tabs)',0); +INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('MAIN_SIZE_SHORTLIST_LIMIT')__,__ENCRYPT('3')__,'chaine','Max length for small lists (tabs)',0); ALTER TABLE llx_bank_account ADD COLUMN note_public text; @@ -180,6 +185,8 @@ ALTER TABLE llx_bank_account ADD COLUMN import_key varchar(14); ALTER TABLE llx_overwrite_trans ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; +ALTER TABLE llx_mailing_cibles ADD COLUMN error_text varchar(255); + create table llx_user_employment ( @@ -201,4 +208,15 @@ create table llx_user_employment dateemploymentend date -- last and current value stored into llx_user )ENGINE=innodb; + +-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. +drop table tmp_links_double; +--select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2; +create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2); +--select * from tmp_links_double; +delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete +drop table tmp_links_double; + +ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label); + ALTER TABLE llx_c_actioncomm MODIFY COLUMN type varchar(50) DEFAULT 'system' NOT NULL; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 99e4a7c556c..3ba06daabce 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -176,6 +176,7 @@ update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; update llx_opensurvey_sondage set tms = now(); + -- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL; @@ -183,12 +184,21 @@ update llx_product set barcode = null where barcode in ('', '-1', '0'); update llx_societe set barcode = null where barcode in ('', '-1', '0'); +-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. +drop table tmp_links_double; +--select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2; +create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2); +--select * from tmp_links_double; +delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete +drop table tmp_links_double; + + -- Sequence to removed duplicated values of barcode in llx_product. Use serveral times if you still have duplicate. drop table tmp_product_double; --select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2; create table tmp_product_double as (select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2); --select * from tmp_product_double; -update llx_product set barcode = null where (rowid, barcode) in (select max_rowid, barcode from tmp_product_double); +update llx_product set barcode = null where (rowid, barcode) in (select max_rowid, barcode from tmp_product_double); --update to avoid duplicate, delete to delete drop table tmp_product_double; diff --git a/htdocs/install/mysql/tables/llx_expensereport.sql b/htdocs/install/mysql/tables/llx_expensereport.sql index a6f93d9cb37..a6b45daddf4 100755 --- a/htdocs/install/mysql/tables/llx_expensereport.sql +++ b/htdocs/install/mysql/tables/llx_expensereport.sql @@ -24,8 +24,8 @@ CREATE TABLE llx_expensereport ( ref_ext integer, total_ht double(24,8) DEFAULT 0, total_tva double(24,8) DEFAULT 0, - localtax1 double(24,8) DEFAULT 0, -- amount total localtax1 - localtax2 double(24,8) DEFAULT 0, -- amount total localtax2 + localtax1 double(24,8) DEFAULT 0, -- amount total localtax1 + localtax2 double(24,8) DEFAULT 0, -- amount total localtax2 total_ttc double(24,8) DEFAULT 0, date_debut date NOT NULL, date_fin date NOT NULL, @@ -42,14 +42,14 @@ CREATE TABLE llx_expensereport ( fk_user_approve integer DEFAULT NULL, fk_user_refuse integer DEFAULT NULL, fk_user_cancel integer DEFAULT NULL, - fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused - fk_c_paiement integer DEFAULT NULL, -- deprecated - paid smallint default 0 NOT NULL, -- deprecated + fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused + fk_c_paiement integer DEFAULT NULL, -- deprecated + paid smallint default 0 NOT NULL, -- deprecated note_public text, note_private text, detail_refuse varchar(255) DEFAULT NULL, detail_cancel varchar(255) DEFAULT NULL, - integration_compta integer DEFAULT NULL, -- not used + integration_compta integer DEFAULT NULL, -- not used fk_bank_account integer DEFAULT NULL, model_pdf varchar(50) DEFAULT NULL, @@ -61,6 +61,6 @@ CREATE TABLE llx_expensereport ( multicurrency_total_ttc double(24,8) DEFAULT 0, import_key varchar(14), - extraparams varchar(255) -- for other parameters with json format + extraparams varchar(255) -- for other parameters with json format ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index 0bf124975ab..28c07e6d508 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -65,6 +65,8 @@ create table llx_facturedet situation_percent real, -- % progression of lines invoicing fk_prev_id integer, -- id of the line in the previous situation, fk_unit integer DEFAULT NULL, -- id of the unit code¡ + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change fk_multicurrency integer, multicurrency_code varchar(255), diff --git a/htdocs/install/mysql/tables/llx_links.key.sql b/htdocs/install/mysql/tables/llx_links.key.sql new file mode 100644 index 00000000000..7ba509e9d58 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_links.key.sql @@ -0,0 +1,22 @@ +-- ======================================================================== +-- Copyright (C) 2016 Laurent Destailleur +-- +-- This program 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 3 of the License, or +-- (at your option) any later version. +-- +-- This program 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 this program. If not, see . +-- +-- +-- Linked files +-- ======================================================================== + +ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label); + diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.sql index 72fdeca2925..f3031069220 100644 --- a/htdocs/install/mysql/tables/llx_mailing_cibles.sql +++ b/htdocs/install/mysql/tables/llx_mailing_cibles.sql @@ -1,6 +1,6 @@ -- ======================================================================== -- Copyright (C) 2005 Rodolphe Quiedeville --- Copyright (C) 2009-2012 Laurent Destailleur +-- Copyright (C) 2009-2016 Laurent Destailleur -- Copyright (C) 2011-2012 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify @@ -33,6 +33,6 @@ create table llx_mailing_cibles source_url varchar(160), source_id integer, source_type varchar(16), - date_envoi datetime - + date_envoi datetime, + error_text varchar(255) -- text with error if statut is -1 )ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 27d86696b82..ecc6e8897fc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1566,7 +1566,7 @@ HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight) TextTitleColor=Color of page title LinkColor=Color of links -PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective +PressF5AfterChangingThis=Press F5 on keyboard or clear your browser cache after changing this value to have it effective NotSupportedByAllThemes=Will works with core themes, may not be supported by external themes BackgroundColor=Background color TopMenuBackgroundColor=Background color for Top menu @@ -1626,13 +1626,13 @@ AddOtherPagesOrServices=Add other pages or services AddModels=Add document or numbering templates AddSubstitutions=Add keys substitutions DetectionNotPossible=Detection not possible -UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and will be checked on each future access) +UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and must be provided on each API call) ListOfAvailableAPIs=List of available APIs activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise CommandIsNotInsideAllowedCommands=The command you try to run is not inside list of allowed commands defined into parameter $dolibarr_main_restrict_os_commands into conf.php file. LandingPage=Landing page SamePriceAlsoForSharedCompanies=If you use a multicompany module, with the choice "Single price", price will be also the same for all companies if products are shared between environments -ModuleEnabledAdminMustCheckRights=Module has been activated. Permissions for activated module(s) were given to admin users only. You may need to grant permissions to other users manually if necessary. +ModuleEnabledAdminMustCheckRights=Module has been activated. Permissions for activated module(s) were given to admin users only. You may need to grant permissions to other users or groups manually if necessary. UserHasNoPermissions=This user has no permission defined TypeCdr=Use "None" if the date of payment term is date of invoice plus a delta in days (delta is field "Nb of days")
Use "At end of month", if, after delta, the date must be increased to reach the end of month (+ an optional "Offset" in days)
Use "Current/Next" to have payment term date being the first Nth of the month (N is stored into field "Nb of days") ##### Resource #### diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 3f4898630ba..73e4523f275 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -75,6 +75,7 @@ PaymentsAlreadyDone=Payments already done PaymentsBackAlreadyDone=Payments back already done PaymentRule=Payment rule PaymentMode=Payment type +PaymentTypeDC=Debit/Credit Card IdPaymentMode=Payment type (id) LabelPaymentMode=Payment type (label) PaymentModeShort=Payment type @@ -330,6 +331,7 @@ GeneratedFromRecurringInvoice=Generated from template recurring invoice %s DateIsNotEnough=Date not reached yet InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s # PaymentConditions +Statut=Status PaymentConditionShortRECEP=Immediate PaymentConditionRECEP=Immediate PaymentConditionShort30D=30 days @@ -446,6 +448,7 @@ PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice templat TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for deposit invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. +CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for deposit invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice TypeContact_facture_external_BILLING=Customer invoice contact @@ -484,4 +487,4 @@ ToCreateARecurringInvoiceGeneAuto=If you need to have such invoices generated au DeleteRepeatableInvoice=Delete template invoice ConfirmDeleteRepeatableInvoice=Are your sure you want to delete the template invoice? CreateOneBillByThird=Create one invoice per third (otherwise, one invoice per order) -BillCreated=%s bill(s) created \ No newline at end of file +BillCreated=%s bill(s) created diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index a6a0fc22b9e..16a6611db4a 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -28,7 +28,7 @@ ShowCustomer=Show customer ShowProspect=Show prospect ListOfProspects=List of prospects ListOfCustomers=List of customers -LastDoneTasks=Latest %s completed tasks +LastDoneTasks=Latest %s completed actions LastActionsToDo=Oldest %s not completed actions DoneAndToDoActions=Completed and To do events DoneActions=Completed events diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 45e8246261a..1c1a3bf3245 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -50,7 +50,6 @@ NbOfEMails=Nb of EMails TotalNbOfDistinctRecipients=Number of distinct recipients NoTargetYet=No recipients defined yet (Go on tab 'Recipients') RemoveRecipient=Remove recipient -CommonSubstitutions=Common substitutions YouCanAddYourOwnPredefindedListHere=To create your email selector module, see htdocs/core/modules/mailings/README. EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values MailingAddFile=Attach this file diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index c123fed51a5..245f6f3ccc0 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -13,7 +13,7 @@ ListOfValidatedPublicMembers=List of validated public members ErrorThisMemberIsNotPublic=This member is not public ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, login: %s) is already linked to a third party %s. Remove this link first because a third party can't be linked to only a member (and vice versa). ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours. -ThisIsContentOfYourCard=This is details of your card +ThisIsContentOfYourCard=Hi.

This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

CardContent=Content of your member card SetLinkToUser=Link to a Dolibarr user SetLinkToThirdParty=Link to a Dolibarr third party diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 9bea19a30a2..89aa8ff296e 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -89,7 +89,7 @@ NoteNotVisibleOnBill=Note (not visible on invoices, proposals...) ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Several segment of prices per product/service (each customer is in one segment) MultiPricesNumPrices=Number of prices -AssociatedProductsAbility=Activate the package feature +AssociatedProductsAbility=Activate the feature to manage virtual products AssociatedProducts=Virtual product AssociatedProductsNumber=Number of products composing this virtual product ParentProductsNumber=Number of parent packaging product diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 6a12588139d..900b424f3e7 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -1,6 +1,7 @@ # Dolibarr language file - Source file is en_US - trips ExpenseReport=Expense report ExpenseReports=Expense reports +ShowExpenseReport=Show expense report Trips=Expense reports TripsAndExpenses=Expenses reports TripsAndExpensesStatistics=Expense reports statistics diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 8a09c66989e..4a002fab02c 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -8,7 +8,7 @@ EditPassword=Edit password SendNewPassword=Regenerate and send password ReinitPassword=Regenerate password PasswordChangedTo=Password changed to: %s -SubjectNewPassword=Your new password for Dolibarr +SubjectNewPassword=Your new password for %s GroupRights=Group permissions UserRights=User permissions UserGUISetup=User display setup diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index a56e0f27e09..5671adf71aa 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -173,6 +173,12 @@ ProfId3FR=Id. prof. 3 (NAF-APE) ProfId4FR=Id. prof. 4 (RCS/RM) ProfId5FR=- ProfId6FR=- +ProfId1GA=Id. prof. 1 (NIF) +ProfId2GA=Id. prof. 2 (RCCM) +ProfId3GA=Id. prof. 3 (CAE) +ProfId4GA=Id. prof. 4 +ProfId5GA=- +ProfId6GA=- ProfId1GB=Numéro d'enregistrement ProfId2GB=- ProfId3GB=SIC diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b4a3f8ab420..f1f226b835f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1748,8 +1748,11 @@ $formquestionclone=array( array('type' => 'text', 'name' => 'clone_ref','label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), array('type' => 'checkbox', 'name' => 'clone_content','label' => $langs->trans("CloneContentProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true), - array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1) ); +if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) +{ + $formquestionclone[]=array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1); +} // Confirm delete product if (($action == 'delete' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4755e5e5405..7cf9079fc0c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1986,6 +1986,30 @@ class Product extends CommonObject $this->stats_commande['nb']=$obj->nb; $this->stats_commande['rows']=$obj->nb_rows; $this->stats_commande['qty']=$obj->qty?$obj->qty:0; + + // if it's a virtual product, maybe it is in order by extension + if (! empty($conf->global->ORDER_ADD_ORDERS_WITH_PARENT_PROD_IF_INCDEC)) + { + $TFather = $this->getFather(); + if (is_array($TFather) && !empty($TFather)) { + foreach($TFather as &$fatherData) { + $pFather = new Product($this->db); + $pFather->id = $fatherData['id']; + $qtyCoef = $fatherData['qty']; + + if ($fatherData['incdec']) { + $pFather->load_stats_commande($socid, $filtrestatut); + + $this->stats_commande['customers']+=$pFather->stats_commande['customers']; + $this->stats_commande['nb']+=$pFather->stats_commande['nb']; + $this->stats_commande['rows']+=$pFather->stats_commande['rows']; + $this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef; + + } + } + } + } + return 1; } else @@ -2822,17 +2846,17 @@ class Product extends CommonObject /** * Clone links between products * - * @param int $fromId Product id - * @param int $toId Product id - * @return number + * @param int $fromId Product id + * @param int $toId Product id + * @return int <0 if KO, >0 if OK */ function clone_associations($fromId, $toId) { $this->db->begin(); - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association (rowid, fk_product_pere, fk_product_fils, qty)'; - $sql.= " SELECT null, $toId, fk_product_fils, qty FROM ".MAIN_DB_PREFIX."product_association"; - $sql.= " WHERE fk_product_pere = '".$fromId."'"; + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association (fk_product_pere, fk_product_fils, qty)'; + $sql.= " SELECT ".$toId.", fk_product_fils, qty FROM ".MAIN_DB_PREFIX."product_association"; + $sql.= " WHERE fk_product_pere = ".$fromId; dol_syslog(get_class($this).'::clone_association', LOG_DEBUG); if (! $this->db->query($sql)) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 9277de5b498..0b48be2b0d5 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -110,7 +110,7 @@ print '
'; - print ''; + print ''; print ''; print '
getLibStatut(3); ?> ">transnoentitiesnoconv("RemoveLink")); ?>
date,'day'); ?> rights->fournisseur->facture->lire) { - $total = $total + $objectlink->total_ht; - echo price($objectlink->total_ht); + $sign = 1; + if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1; + if ($objectlink->statut != 3) // If not abandonned + { + $total = $total + $sign * $objectlink->total_ht; + echo price($objectlink->total_ht); + } + else + { + echo ''.price($objectlink->total_ht).''; + } } ?> getLibStatut(3); ?> ">transnoentitiesnoconv("RemoveLink")); ?>
'; print ''; print ''.$langs->trans("InventoryCode").''.$langs->trans("InventoryCode").'
'; diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index 98fe80f7c90..dfddd1e19f1 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -117,7 +117,7 @@ print ''; print ''; print ''; - print ''.$langs->trans("InventoryCode").''; + print ''.$langs->trans("InventoryCode").''; print ''; print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index f4c5d871fc6..5e639f6c920 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -698,7 +698,7 @@ else // Label print ''.$langs->trans("Label").''; - print ''; + print ''; // Thirdparty if ($conf->societe->enabled) @@ -752,7 +752,7 @@ else // Date start print ''.$langs->trans("DateStart").''; print $form->select_date($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1); - print '     '. $langs->trans("ProjectReportDate"); print ''; @@ -829,33 +829,12 @@ else print ''; - // Ref - /* - print ''; - */ - - // Label - //print ''; - - // Third party - /* - print ''; - */ - // Visibility print ''; - // Statut - //print ''; - if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status @@ -879,7 +858,11 @@ else print ''; // Budget diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php new file mode 100644 index 00000000000..74650407f87 --- /dev/null +++ b/htdocs/projet/class/api_projects.class.php @@ -0,0 +1,568 @@ + + * Copyright (C) 2016 Laurent Destailleur + * + * This program 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 3 of the License, or + * (at your option) any later version. + * + * This program 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 this program. If not, see . + */ + + use Luracast\Restler\RestException; + + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + +/** + * API class for projects + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ +class Projects extends DolibarrApi +{ + + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + static $FIELDS = array( + 'ref', + 'title' + ); + + /** + * @var Project $project {@type Project} + */ + public $project; + + /** + * Constructor + */ + function __construct() + { + global $db, $conf; + $this->db = $db; + $this->project = new Project($this->db); + } + + /** + * Get properties of a project object + * + * Return an array with project informations + * + * @param int $id ID of project + * @return array|mixed data without useless information + * + * @throws RestException + */ + function get($id) + { + if(! DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $this->project->fetchObjectLinked(); + return $this->_cleanObjectDatas($this->project); + } + + + + /** + * List projects + * + * Get a list of projects + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter projects of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @return array Array of project objects + */ + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') { + global $db, $conf; + + $obj_ret = array(); + // case of external user, $thirdpartyid param is ignored and replaced by user's socid + $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + + // If the internal user must only see his customers, force searching by him + if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id; + + $sql = "SELECT t.rowid"; + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) + $sql.= " FROM ".MAIN_DB_PREFIX."projet as t"; + + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale + + $sql.= ' WHERE t.entity IN ('.getEntity('project', 1).')'; + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; + if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; + if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale + // Insert sale filter + if ($search_sale > 0) + { + $sql .= " AND sc.fk_user = ".$search_sale; + } + // Add sql filters + if ($sqlfilters) + { + if (! DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) + { + $page = 0; + } + $offset = $limit * $page; + + $sql.= $db->plimit($limit + 1, $offset); + } + + dol_syslog("API Rest request"); + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + while ($i < min($num, ($limit <= 0 ? $num : $limit))) + { + $obj = $db->fetch_object($result); + $project_static = new Project($db); + if($project_static->fetch($obj->rowid)) { + $obj_ret[] = parent::_cleanObjectDatas($project_static); + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve project list'); + } + if( ! count($obj_ret)) { + throw new RestException(404, 'No project found'); + } + return $obj_ret; + } + + /** + * Create project object + * + * @param array $request_data Request data + * @return int ID of project + */ + function post($request_data = NULL) + { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401, "Insuffisant rights"); + } + // Check mandatory fields + $result = $this->_validate($request_data); + + foreach($request_data as $field => $value) { + $this->project->$field = $value; + } + /*if (isset($request_data["lines"])) { + $lines = array(); + foreach ($request_data["lines"] as $line) { + array_push($lines, (object) $line); + } + $this->project->lines = $lines; + }*/ + if ($this->project->create(DolibarrApiAccess::$user) <= 0) { + $errormsg = $this->project->error; + throw new RestException(500, $errormsg ? $errormsg : "Error while creating project"); + } + + return $this->project->id; + } + + /** + * Get tasks of a project + * + * @param int $id Id of project + * + * @url GET {id}/tasks + * + * @return int + */ + function getLines($id) { + if(! DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $this->project->getLinesArray(DolibarrApiAccess::$user); + $result = array(); + foreach ($this->project->lines as $line) { + array_push($result,$this->_cleanObjectDatas($line)); + } + return $result; + } + + + /** + * Get users and roles assigned to a project + * + * @param int $id Id of project + * + * @url GET {id}/roles + * + * @return int + */ + function getRoles($id) { + if(! DolibarrApiAccess::$user->rights->projet->lire) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic=new Task($this->db); + $this->project->roles = $taskstatic->getUserRolesForProjectsOrTasks(DolibarrApiAccess::$user, 0, $id, 0); + $result = array(); + foreach ($this->project->roles as $line) { + array_push($result,$this->_cleanObjectDatas($line)); + } + return $result; + } + + + /** + * Add a task to given project + * + * @param int $id Id of project to update + * @param array $request_data Projectline data + * + * @url POST {id}/tasks + * + * @return int + */ + /* + function postLine($id, $request_data = NULL) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $request_data = (object) $request_data; + $updateRes = $this->project->addline( + $request_data->desc, + $request_data->subprice, + $request_data->qty, + $request_data->tva_tx, + $request_data->localtax1_tx, + $request_data->localtax2_tx, + $request_data->fk_product, + $request_data->remise_percent, + $request_data->info_bits, + $request_data->fk_remise_except, + 'HT', + 0, + $request_data->date_start, + $request_data->date_end, + $request_data->product_type, + $request_data->rang, + $request_data->special_code, + $fk_parent_line, + $request_data->fk_fournprice, + $request_data->pa_ht, + $request_data->label, + $request_data->array_options, + $request_data->fk_unit, + $this->element, + $request_data->id + ); + + if ($updateRes > 0) { + return $this->get($id)->line->rowid; + + } + return false; + } + */ + + /** + * Update a task to given project + * + * @param int $id Id of project to update + * @param int $lineid Id of line to update + * @param array $request_data Projectline data + * + * @url PUT {id}/tasks/{lineid} + * + * @return object + */ + /* + function putLine($id, $lineid, $request_data = NULL) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $request_data = (object) $request_data; + $updateRes = $this->project->updateline( + $lineid, + $request_data->desc, + $request_data->subprice, + $request_data->qty, + $request_data->remise_percent, + $request_data->tva_tx, + $request_data->localtax1_tx, + $request_data->localtax2_tx, + 'HT', + $request_data->info_bits, + $request_data->date_start, + $request_data->date_end, + $request_data->product_type, + $request_data->fk_parent_line, + 0, + $request_data->fk_fournprice, + $request_data->pa_ht, + $request_data->label, + $request_data->special_code, + $request_data->array_options, + $request_data->fk_unit + ); + + if ($updateRes > 0) { + $result = $this->get($id); + unset($result->line); + return $this->_cleanObjectDatas($result); + } + return false; + }*/ + + + /** + * Delete a tasks of given project + * + * + * @param int $id Id of project to update + * @param int $taskid Id of task to delete + * + * @url DELETE {id}/tasks/{taskid} + * + * @return int + */ + function delLine($id, $taskid) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! ($result > 0) ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic=new Task($this->db); + $result = $taskstatic->fetch($taskid); + if( ! ($result > 0) ) { + throw new RestException(404, 'Task not found'); + } + + $deleteRes = $taskstatic->delete(DolibarrApiAccess::$user); + + if( ! ($deleteRes > 0)) { + throw new RestException(500, 'Error when delete tasks : '.$taskstatic->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Task deleted' + ) + ); + } + + + /** + * Update project general fields (won't touch lines of project) + * + * @param int $id Id of project to update + * @param array $request_data Datas + * + * @return int + */ + function put($id, $request_data = NULL) { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + foreach($request_data as $field => $value) { + $this->project->$field = $value; + } + + if($this->project->update(DolibarrApiAccess::$user, 0)) + return $this->get($id); + + return false; + } + + /** + * Delete project + * + * @param int $id Project ID + * + * @return array + */ + function delete($id) + { + if(! DolibarrApiAccess::$user->rights->projet->supprimer) { + throw new RestException(401); + } + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if( ! $this->project->delete(DolibarrApiAccess::$user)) { + throw new RestException(500, 'Error when delete project : '.$this->project->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Project deleted' + ) + ); + + } + + /** + * Validate a project + * + * @param int $id Project ID + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * + * @url POST {id}/validate + * + * @return array + * FIXME An error 403 is returned if the request has an empty body. + * Error message: "Forbidden: Content type `text/plain` is not supported." + * Workaround: send this in the body + * { + * "notrigger": 0 + * } + */ + function validate($id, $notrigger=0) + { + if(! DolibarrApiAccess::$user->rights->projet->creer) { + throw new RestException(401); + } + $result = $this->project->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Project not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('project',$this->project->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->project->setValid(DolibarrApiAccess::$user, $notrigger); + if ($result == 0) { + throw new RestException(500, 'Error nothing done. May be object is already validated'); + } + if ($result < 0) { + throw new RestException(500, 'Error when validating Project: '.$this->project->error); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Project validated' + ) + ); + } + + /** + * Validate fields before create or update object + * + * @param array $data Array with data to verify + * @return array + * @throws RestException + */ + function _validate($data) + { + $object = array(); + foreach (self::$FIELDS as $field) { + if (!isset($data[$field])) + throw new RestException(400, "$field field missing"); + $object[$field] = $data[$field]; + + } + return $object; + } + + + // TODO + // getSummaryOfTimeSpent +} diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 4ac568182de..cdddccbf432 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -241,7 +241,15 @@ class Project extends CommonObject $this->description = trim($this->description); if ($this->opp_amount < 0) $this->opp_amount=''; if ($this->opp_percent < 0) $this->opp_percent=''; - + if ($this->date_end && $this->date_end < $this->date_start) + { + $this->error = $langs->trans("ErrorDateEndLowerThanDateStart"); + $this->errors[] = $this->error; + $this->db->rollback(); + dol_syslog(get_class($this)."::update error -3 " . $this->error, LOG_ERR); + return -3; + } + if (dol_strlen(trim($this->ref)) > 0) { $this->db->begin(); @@ -695,10 +703,11 @@ class Project extends CommonObject /** * Validate a project * - * @param User $user User that validate - * @return int <0 if KO, >0 if OK + * @param User $user User that validate + * @param int $notrigger 1=Disable triggers + * @return int <0 if KO, >0 if OK */ - function setValid($user) + function setValid($user, $notrigger=0) { global $langs, $conf; @@ -725,10 +734,13 @@ class Project extends CommonObject if ($resql) { // Call trigger - $result=$this->call_trigger('PROJECT_VALIDATE',$user); - if ($result < 0) { $error++; } - // End call triggers - + if (empty($notrigger)) + { + $result=$this->call_trigger('PROJECT_VALIDATE',$user); + if ($result < 0) { $error++; } + // End call triggers + } + if (!$error) { $this->statut=1; @@ -1750,12 +1762,12 @@ class Project extends CommonObject global $conf; if (! ($this->statut == 1)) return false; - if (! $this->datee) return false; + if (! $this->datee && ! $this->date_end) return false; $now = dol_now(); - return $this->datee < ($now - $conf->projet->warning_delay); - } + return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay); + } /** @@ -1866,5 +1878,20 @@ class Project extends CommonObject return 1; } + + /** + * Create an array of tasks of current project + * + * @param User $user Object user we want project allowed to + * @return int >0 if OK, <0 if KO + */ + function getLinesArray($user) + { + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic = new Task($this->db); + + $this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0); + } + } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ad2f5faecbe..2baccfb3382 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -176,7 +176,7 @@ class Task extends CommonObject * * @param int $id Id object * @param int $ref ref object - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0 if not found, >0 if OK */ function fetch($id,$ref='') { @@ -214,7 +214,9 @@ class Task extends CommonObject $resql=$this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) + $num_rows = $this->db->num_rows($resql); + + if ($num_rows) { $obj = $this->db->fetch_object($resql); @@ -241,7 +243,8 @@ class Task extends CommonObject $this->db->free($resql); - return 1; + if ($num_rows) return 1; + else return 0; } else { @@ -754,7 +757,7 @@ class Task extends CommonObject * Return list of roles for a user for each projects or each tasks (or a particular project or a particular task). * * @param User $userp Return roles on project for this internal user. If set, usert and taskid must not be defined. - * @param User $usert Return roles on task for this internal user. If set userp must not be defined. + * @param User $usert Return roles on task for this internal user. If set userp must not be defined. -1 means no filter. * @param int $projectid Project id list separated with , to filter on project * @param int $taskid Task id to filter on a task * @param string $filteronprojstatus Filter on project status if userp is set. Not used if userp not defined. diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 673fbc973ad..b763240500f 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -83,8 +83,8 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) } //if ($totalinprocess != $total) //print ''; - print ''; - print ''; + print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 752e3615464..96f98111c2e 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -140,7 +140,7 @@ print '
'; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; - if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project'); - else print' '; - print '
'.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; print dol_print_date($object->date_start,'day'); $end=dol_print_date($object->date_end,'day'); - if ($end) print ' - '.$end; + if ($end) + { + print ' - '.$end; + if ($object->hasDelay()) print img_warning($langs->trans('Late')); + } print '
'.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')'.$totalinprocess.'
'.$langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')'.price($totalamount, 0, '', 1, -1, -1, $conf->currency).'
'; + print '
'.$langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')'.price($totalamount, 0, '', 1, -1, -1, $conf->currency).'
'; //print $langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')'; print $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1); print ''.price(price2num($ponderated_opp_amount,'MT'), 0, '', 1, -1, -1, $conf->currency).'
'; print ''; -print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder); +print_liste_field_titre($langs->trans("OpenedProjectsByThirdparties"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"',$sortfield,$sortorder); print "\n"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 787d902768d..8c2c8909a84 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -626,7 +626,7 @@ while ($i < min($num,$limit)) $projectstatic->user_author_id = $obj->fk_user_creat; $projectstatic->public = $obj->public; $projectstatic->ref = $obj->ref; - $projectstatic->datee = $obj->date_end; + $projectstatic->datee = $db->jdate($obj->date_end); $projectstatic->statut = $obj->fk_statut; $projectstatic->opp_status = $obj->fk_opp_status; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f1368099864..ab9c2f2b7d6 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -71,7 +71,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu; $dol_hide_leftmenu=$conf->dol_hide_leftmenu; $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; $dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; @@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; @@ -261,8 +259,6 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla background-color: #FFF; } - - input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; } @@ -306,7 +302,6 @@ span.timesheetalreadyrecorded input { border: none; /*background: transparent;*/ } - select.flat, form.flat select { font-weight: normal; @@ -341,9 +336,9 @@ input[type=checkbox] { background-color: transparent; border: none; box-shadow: input[type=radio] { background-color: transparent; border: none; box-shadow: none; } input[type=image] { background-color: transparent; border: none; box-shadow: none; } input:-webkit-autofill { - background-color: !important; + background-color: #FBFFEA !important; background-image:none !important; - -webkit-box-shadow: 0 0 0 50px inset; + -webkit-box-shadow: 0 0 0 50px #FBFFEA inset; } ::-webkit-input-placeholder { color:#ccc; } :-moz-placeholder { color:#bbb; } /* firefox 18- */ @@ -351,9 +346,6 @@ input:-webkit-autofill { :-ms-input-placeholder { color:#ccc; } /* ie */ input:-moz-placeholder { color:#ccc; } - -legend { margin-bottom: 8px; } - fieldset { border: 1px solid #AAAAAA !important; } @@ -542,7 +534,7 @@ div.myavailability { margin-top: 6px; margin-left: 4px; } -.selectlimit { +.selectlimit, .marginrightonly { margin-right: 10px !important; } .strikefordisabled { @@ -622,12 +614,14 @@ div.myavailability { .minwidth500imp { min-width: 500px !important; } } .maxwidth50 { max-width: 50px; } +.maxwidth75 { max-width: 75px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.maxwidth50imp { max-width: 50px !important; } .minheight20 { min-height: 20px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } @@ -662,25 +656,40 @@ div.myavailability { /* Force values for small screen 570 */ @media only screen and (max-width: 570px) { + .tdoverflowonsmartphone { + max-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + div.titre { line-height: 2em; } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { + height: 40px !important; + } - input[type=text], select, textarea { + .quatrevingtpercent, .inputsearch { + width: 95%; + } + + input, input[type=text], input[type=password], select, textarea { min-width: 20px; min-height: 1.4em; line-height: 1.4em; - margin: .5em 0; padding: .4em .1em; border: 1px solid #BBB; + /* max-width: inherit; why this ? */ } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } - .maxwidth50onsmartphone { max-width: 50px; } - .maxwidth100onsmartphone { max-width: 100px; } - .maxwidth150onsmartphone { max-width: 150px; } + .maxwidth50onsmartphone { max-width: 40px; } + .maxwidth75onsmartphone { max-width: 50px; } + .maxwidth100onsmartphone { max-width: 70px; } + .maxwidth150onsmartphone { max-width: 120px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -697,11 +706,13 @@ div.myavailability { position: absolute; width: px; } + + /* intput, input[type=text], */ select { width: 98%; - dol_use_jmobile)) { ?>max-width: 100px; min-width: 40px; } + div.divphotoref { padding-right: 5px; } @@ -833,7 +844,7 @@ div.fiche { margin-: px; margin-: dol_optimize_smallscreen)?'12':'6')); ?>px; dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?> - dol_use_jmobile)) print ' margin-bottom: 10px;'."\n"; ?> + dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?> } div.fichecenter { width: 100%; @@ -1929,10 +1940,7 @@ div.tabs { } div.tabsElem { margin-top: 1px; - dol_use_jmobile)) { ?>; - margin-bottom: -1px; - -} /* To avoid overlap of tabs when not browser */ +} /* To avoid overlap of tabs when not browser */ div.tabBar { color: #; @@ -2357,10 +2365,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord table.borderplus { border: 1px solid #BBB; } -.border tbody tr, .border tbody tr td { - height: 20px; -} -div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { +.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 20px; } div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col { @@ -2401,6 +2406,7 @@ td.border, div.tagtable div div.border { width:auto; } + /* Main boxes */ table.liste, table.noborder, table.formdoc, div.noborder { @@ -2413,27 +2419,15 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-top-color: rgb(); border-top-style: solid; -/* border-right-width: 1px; - border-right-color: #BBB; - border-right-style: solid; - - border-left-width: 1px; - border-left-color: #BBB; - border-left-style: solid; -*/ border-bottom-width: 1px; border-bottom-color: #BBB; border-bottom-style: solid; margin: 0px 0px 5px 0px; - -/* -moz-box-shadow: 2px 2px 4px #CCC; - -webkit-box-shadow: 2px 2px 4px #CCC; - box-shadow: 2px 2px 4px #CCC; - - -moz-border-radius: 0.2em; - -webkit-border-radius: 0.2em; - border-radius: 0.2em;*/ +} +table.paddingtopbottomonly tr td { + padding-top: 1px; + padding-bottom: 2px; } .liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd { @@ -2490,7 +2484,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile != 4)?'3':'7'; ?>px; + padding-top: 3px; } div.refid { font-weight: bold; @@ -2526,10 +2520,8 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile != 4) { ?> padding-top: 6px; padding-bottom: 5px; - } .pagination { display: inline-block; @@ -2538,22 +2530,12 @@ div.pagination li { } div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile != 4) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; color: #000; text-decoration: none; - /* - border-color: #ccc; - background-color: #f5f5f5; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);*/ - background-repeat: repeat-x; - + background-repeat: repeat-x; } div.pagination li.pagination span.inactive { cursor: default; @@ -2585,13 +2567,6 @@ div.pagination li.litext a:hover { background-color: transparent; background-image: none; } -dol_use_jmobile == 4) { ?> -div.pagination li.litext { - padding-top: 13px; - vertical-align: top; -} - -dol_use_jmobile != 4) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -2651,7 +2626,6 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - div.pagination li.pagination .active { text-decoration: underline; } @@ -4230,11 +4204,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - - font-size: 13px; - font-size: px; - /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9935c3b2231..6d8bc972ceb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -72,7 +72,6 @@ $dol_hide_topmenu=$conf->dol_hide_topmenu; $dol_hide_leftmenu=$conf->dol_hide_leftmenu; $dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; $dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; //$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; @@ -221,7 +220,6 @@ print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; print 'dol_screenwidth='.$_SESSION['dol_screenwidth']."\n"; print 'dol_screenheight='.$_SESSION['dol_screenheight']."\n"; print 'fontsize='.$fontsize."\n"; @@ -261,8 +259,6 @@ input, input.flat, textarea, textarea.flat, form.flat select, select, select.fla background-color: #FDFDFD; } - - input:focus, textarea:focus, button:focus, select:focus { box-shadow: 0 0 4px #8091BF; } @@ -308,8 +304,6 @@ span.timesheetalreadyrecorded input { /*background: transparent;*/ } - - select.flat, form.flat select { font-weight: normal; } @@ -347,9 +341,9 @@ input[type=radio] { background-color: transparent; border: none; box-shadow: input[type=image] { background-color: transparent; border: none; box-shadow: none; } input[type=text] { min-width: 20px; } input:-webkit-autofill { - background-color: !important; + background-color: #FBFFEA !important; background-image:none !important; - -webkit-box-shadow: 0 0 0 50px inset; + -webkit-box-shadow: 0 0 0 50px #FBFFEA inset; } ::-webkit-input-placeholder { color:#ccc; } :-moz-placeholder { color:#bbb; } /* firefox 18- */ @@ -357,9 +351,6 @@ input:-webkit-autofill { :-ms-input-placeholder { color:#ccc; } /* ie */ input:-moz-placeholder { color:#ccc; } - -legend { margin-bottom: 8px; } - fieldset { border: 1px solid #AAAAAA !important; } @@ -549,7 +540,7 @@ div.myavailability { margin-top: 6px; margin-left: 4px; } -.selectlimit { +.selectlimit, .marginrightonly { margin-right: 10px !important; } .strikefordisabled { @@ -627,12 +618,14 @@ div.myavailability { .minwidth500imp { min-width: 500px !important; } } .maxwidth50 { max-width: 50px; } +.maxwidth75 { max-width: 75px; } .maxwidth100 { max-width: 100px; } .maxwidth150 { max-width: 150px; } .maxwidth200 { max-width: 200px; } .maxwidth300 { max-width: 300px; } .maxwidth400 { max-width: 400px; } .maxwidth500 { max-width: 500px; } +.maxwidth50imp { max-width: 50px !important; } .minheight20 { min-height: 20px; } .minheight40 { min-height: 40px; } .titlefieldcreate { width: 20%; } @@ -667,25 +660,40 @@ div.myavailability { /* Force values for small screen 570 */ @media only screen and (max-width: 570px) { + .tdoverflowonsmartphone { + max-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + div.titre { line-height: 2em; } + .border tbody tr, .border tbody tr td, div.tabBar table.border tr { + height: 40px !important; + } - input[type=text], select, textarea { + .quatrevingtpercent, .inputsearch { + width: 95%; + } + + input, input[type=text], input[type=password], select, textarea { min-width: 20px; min-height: 1.4em; line-height: 1.4em; - margin: .5em 0; padding: .4em .1em; border: 1px solid #BBB; + /* max-width: inherit; why this */ } .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } - .maxwidth50onsmartphone { max-width: 50px; } - .maxwidth100onsmartphone { max-width: 100px; } - .maxwidth150onsmartphone { max-width: 150px; } + .maxwidth50onsmartphone { max-width: 40px; } + .maxwidth75onsmartphone { max-width: 50px; } + .maxwidth100onsmartphone { max-width: 70px; } + .maxwidth150onsmartphone { max-width: 120px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -697,6 +705,31 @@ div.myavailability { .minwidth500imp { min-width: 50px !important; } .titlefield { width: auto; } .titlefieldcreate { width: auto; } + + #tooltip { + position: absolute; + width: px; + } + + /* intput, input[type=text], */ + select { + width: 98%; + min-width: 40px; + } + + div.divphotoref { + padding-right: 5px; + } + img.photoref, div.photoref { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + padding: 4px; + height: 20px; + width: 20px; + object-fit: contain; + } } .linkobject { cursor: pointer; } @@ -2114,13 +2147,11 @@ span.butAction, span.butActionDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006dcc; - dol_use_jmobile != 4)) { ?> background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; @@ -2245,10 +2276,7 @@ table.borderplus { border: 1px solid #BBB; } -.border tbody tr, .border tbody tr td { - height: 20px; -} -div.tabBar table.border tr { +.border tbody tr, .border tbody tr td, div.tabBar table.border tr { height: 20px; } @@ -2273,6 +2301,7 @@ td.border, div.tagtable div div.border { width:auto; } + /* Main boxes */ table.liste, table.noborder, table.formdoc, div.noborder { @@ -2285,36 +2314,16 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-top-color: rgb(); border-top-style: solid; -/* border-right-width: 1px; - border-right-color: #BBB; - border-right-style: solid; - - border-left-width: 1px; - border-left-color: #BBB; - border-left-style: solid; -*/ border-bottom-width: 1px; border-bottom-color: #BBB; border-bottom-style: solid; margin: 0px 0px 8px 0px; - /* - -moz-box-shadow: 2px 2px 4px #CCC; - -webkit-box-shadow: 2px 2px 4px #CCC; - box-shadow: 2px 2px 4px #CCC; - */ - /* box-shadow: 0 0 3px rgba(0,0,0,0.16); */ -moz-border-radius: 0.1em; -webkit-border-radius: 0.1em; border-radius: 0.1em; } -/* -#tablelines tr.liste_titre:first-child td, form.formnoborder, tr.liste_titre.trnoborder td { - border-top-width: 1px; - border-top-color: rgb(); - border-top-style: solid; -}*/ table.noborder tr, div.noborder form { border-top-color: #FEFEFE; @@ -2327,6 +2336,10 @@ table.noborder tr, div.noborder form { border-left-style: solid; min-height: 26px; } +table.paddingtopbottomonly tr td { + padding-top: 1px; + padding-bottom: 2px; +} .liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd { @@ -2382,7 +2395,7 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - padding-top: dol_use_jmobile != 4)?'3':'14'; ?>px; + padding-top: 3px; } div.refid { font-weight: bold; @@ -2418,10 +2431,8 @@ div.pagination li { display: inline-block; padding-left: 0px; padding-right: 0px; -dol_use_jmobile != 4)) { ?> padding-top: 6px; padding-bottom: 5px; - } .pagination { display: inline-block; @@ -2431,7 +2442,6 @@ div.pagination li { div.pagination li.pagination a, div.pagination li.pagination span { -dol_use_jmobile != 4) { ?> padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; @@ -2445,7 +2455,6 @@ div.pagination li.pagination span { background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); background-repeat: repeat-x; - } div.pagination li.pagination span.inactive { cursor: default; @@ -2458,13 +2467,6 @@ border: none; padding-left: 4px; font-weight: bold; } -dol_use_jmobile == 4) { ?> -div.pagination li.litext { - padding-top: 13px; - vertical-align: top; -} - -dol_use_jmobile != 4) { ?> div.pagination li.noborder a:hover { border: none; background-color: transparent; @@ -2516,7 +2518,6 @@ div.pagination .disabled a:focus { background-color: #fff; border-color: #ddd; } - div.pagination li.pagination .active { text-decoration: underline; } @@ -4114,11 +4115,7 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i min-width: .4em; padding-left: 6px; padding-right: 6px; - - font-size: 13px; - font-size: px; - /* white-space: normal; */ /* Warning, enable this break the truncate feature */ } .ui-btn-icon-right .ui-btn-inner { @@ -4543,7 +4540,6 @@ img.demothumb { } select { width: 98%; - dol_use_jmobile)) { ?>max-width: 100px; min-width: 0 !important; } div.divphotoref { diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 823f5ad307e..ef7ffd9f70b 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -169,7 +169,7 @@ print "
"; print ""; print ""; print ""; -print "'; +print "'; print "'; print ''; print ""; @@ -187,13 +187,13 @@ while ($i <= $MAXAGENDA) $var=!$var; print ""; // Nb - print '"; + print '"; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; @@ -747,7 +747,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - print ''; + print ''; } print ''; @@ -1802,7 +1802,7 @@ else print ''; print ''; - print ''; print ''; @@ -1902,7 +1902,7 @@ else if(! empty($conf->api->enabled) && $user->admin) { print ''; print ''; @@ -1992,7 +1992,7 @@ else } // Type - print ''; + print ''; print ''; } @@ -2104,7 +2104,7 @@ else print ''; - print ''; + print ''; print ''; // Picto and label of permission - print ''; + print ''; // Permission and tick if (! empty($object->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin @@ -403,7 +403,7 @@ if ($result) } $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); - print ''; + print ''; print ''."\n"; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index b6d33de99ae..6fa65660df1 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -36,7 +36,13 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks // Some value of modulepart can be used to get resources that are public so no login are required. if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) +{ + define("NOLOGIN",'1'); + // For multicompany + $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); + if (is_numeric($entity)) define("DOLENTITY", $entity); +} /** * Header empty diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index d0aa6424787..17979db0989 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -632,7 +632,7 @@ if (count($object->records) > 0) if ($website && $action == 'preview') { $disabled=''; - if (empty($user->rights->websites->create)) $disabled=' disabled="disabled"'; + if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; print '   '; @@ -735,7 +735,7 @@ if (count($object->records) > 0) if ($action == 'preview') { $disabled=''; - if (empty($user->rights->websites->create)) $disabled=' disabled="disabled"'; + if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; if ($pageid > 0) {
".$langs->trans("Parameter")."".$langs->trans("Name")."".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)".$langs->trans("ExtSiteUrlAgenda").'
'." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)
".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).''.$langs->trans("Color").'
'.$langs->trans("AgendaExtNb",$key)."'.$langs->trans("AgendaExtNb",$key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d2c96ab7950..0cd5b077996 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -733,7 +733,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - print ''; + print ''; } print '
'; if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -1817,7 +1817,7 @@ else print ''; if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { @@ -1829,8 +1829,8 @@ else // Photo print '
'.$langs->trans("Photo").''; - print $form->showphoto('userphoto',$object,100,0,$caneditfield,'photowithmargin','small'); + print ''; + print $form->showphoto('userphoto',$object,60,0,$caneditfield,'photowithmargin','small'); print '
'.$langs->trans("ApiKey").''; - print ''; + print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"'); print '
'.$langs->trans("Type").'
'.$langs->trans("Type").''; if ($user->id == $object->id || ! $user->admin) { @@ -2035,7 +2035,7 @@ else // State if (empty($conf->global->USER_DISABLE_STATE)) { - print '
'.fieldLabel('State','state_id').''; + print '
'.fieldLabel('State','state_id').''; print $formcompany->select_state($object->state_id,$object->country_code, 'state_id'); print '
'; if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { @@ -2135,7 +2135,7 @@ else print ''; if ($caneditfield) { - print ''; + print ''; } else { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 997933e234b..75af1dae8e3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1659,38 +1659,48 @@ class User extends CommonObject $outputlangs->load("users"); $outputlangs->load("other"); - $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword"); + $appli=constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + + $subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - $urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current if (! $changelater) { + $url = $urlwithroot.'/'; + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; - $url = $urlwithroot.'/'; - $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $conf->global->MAIN_APPLICATION_TITLE).': '.$url."\n\n"; + + $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg.= "--\n"; $mesg.= $user->getFullName($outputlangs); // Username that make then sending + + dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } else { + $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); + $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; $mesg.= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n"; - $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); $mesg.= $url."\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n"; - dol_syslog(get_class($this)."::send_password url=".$url); + + dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } + $mailfile = new CMailFile( $subject, $this->email, diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 36338f03e10..d1922371909 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -96,6 +96,7 @@ if ($id > 0 || ! empty($ref)) // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('usercard','globalcard')); + /* * Actions */ @@ -108,6 +109,7 @@ if (empty($reshook)) { include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } + /* * View */ @@ -144,20 +146,21 @@ if ($object->id) } - print ''; + print '
'; // Login - print ''; + print ''; - // Nbre fichiers - print ''; + // Nbre files + print ''; //Total taille - print ''; + print ''; print '
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - print ''; + dol_fiche_end(); + $modulepart = 'user'; $permission = $user->rights->user->user->creer; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 3240ae2d5ec..95c3eb6c87f 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -329,8 +329,8 @@ if ($result) { // On affiche ligne pour modifier droits print '
'.img_object('',$picto).' '.$objMod->getName(); - print ' '.img_object('',$picto).' '.$objMod->getName(); + print ''; print ''.$langs->trans("All").""; print '/'; @@ -344,7 +344,7 @@ if ($result) print '
'.img_object('',$picto).' '.$objMod->getName().''.img_object('',$picto).' '.$objMod->getName().''.$permlabel. ''.$permlabel.'