From fd17280521dbf5456ffea82b2ab00f5811ae3504 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Sep 2013 09:40:00 +0200 Subject: [PATCH] Removed all checkstyle errors --- .travis.yml | 14 ++++++-------- htdocs/core/class/dolgraph.class.php | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6743bf93f6a..a160c3c06f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,15 +72,13 @@ before_script: -# Omitting "script:" will default to phpunit -# use the $DB env variable to determine the phpunit.xml to use -#script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php -#script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php -#script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php -#script: phpcs -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . script: - - phpcs -s --report-checkstyle --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php -# - phpcs -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . +# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php +# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php +# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php +# - phpcs -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . +# - phpcs -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php + - phpcs -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php after_script: diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index d283dd9ca1d..f1e66695831 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1022,7 +1022,7 @@ class DolGraph return $this->_stringtoshow; } - + /** * getDefaultGraphSizeForStats * @@ -1033,12 +1033,19 @@ class DolGraph static function getDefaultGraphSizeForStats($direction,$defaultsize='') { global $conf; - - if ($direction == 'width') return ($conf->dol_optimize_smallscreen?(empty($_SESSION['dol_screen_width'])?'280':$_SESSION['dol_screen_width']-40):($defaultsize?$defaultsize:'500')); - if ($direction == 'height') return ($conf->dol_optimize_smallscreen?'160':($defaultsize?$defaultsize:'200')); + + if ($direction == 'width') + { + if (empty($conf->dol_optimize_smallscreen)) return ($defaultsize ? $defaultsize : '500'); + else return (empty($_SESSION['dol_screen_width']) ? '280' : ($_SESSION['dol_screen_width']-40)); + } + if ($direction == 'height') + { + return (empty($conf->dol_optimize_smallscreen)?($defaultsize?$defaultsize:'200'):'160'); + } return 0; } - + } ?> \ No newline at end of file