diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 831aa15c68a..60fea392133 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,4 +1,7 @@ # .scrutinizer.yml +build: + - php-scrutinizer-run + imports: - javascript - php diff --git a/.travis.yml b/.travis.yml index 63e48a051f0..b710e17c773 100644 --- a/.travis.yml +++ b/.travis.yml @@ -164,12 +164,6 @@ before_script: echo echo "Set timezone" echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then - # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly! - echo - echo "Enabling Memcached for PHP <= 5.4" - echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - fi phpenv rehash echo @@ -350,6 +344,9 @@ script: php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log + php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log + php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log + php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log # Enable modules not enabled into original dump php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log echo $? diff --git a/ChangeLog b/ChangeLog index e0f4159c49e..9b91afd128f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -114,6 +114,7 @@ NEW: Option in workflow module to set a reception billed on validate supplier bi NEW: Autocompletion on lists should be available on mobile applications. NEW: Add mass action to close several members. NEW: Add hidden option ADD_UNSPLASH_LOGIN_BACKGROUND for random background +NEW: Add hidden option to be ready for BREXIT For Developers: NEW: Module "DebugBar" is available as a stable module. diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index a28fc430caa..343cebc6abe 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -1,7 +1,7 @@ #---------------------------------------------------------------------------- # \file dolibarr.pl # \brief Dolibarr script install for Virtualmin Pro -# \author (c)2009-2018 Regis Houssin +# \author (c)2009-2019 Regis Houssin #---------------------------------------------------------------------------- @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" ); +return ( "10.0.0", "9.0.3", "8.0.5", "7.0.5", "6.0.8" ); } sub script_dolibarr_release @@ -390,6 +390,7 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", + $ver >= 10.0 ? "dolibarr\\-(10\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" : diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f44ff0071d2..102d268e218 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2016 Juanjo Menent @@ -462,8 +462,6 @@ $linkback=''; print load_fiche_titre($titre, $linkback, 'title_accountancy'); -print "
\n"; - // Confirmation de la suppression de la ligne if ($action == 'delete') diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 3a55e092d94..e7cdc800aee 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -412,7 +412,7 @@ $titlepicto='title_setup'; print load_fiche_titre($titre, $linkback, $titlepicto); -print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

'; +print ''.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

'; // Confirmation de la suppression de la ligne if ($action == 'delete') diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php index a638d598ac9..479dd410f33 100644 --- a/htdocs/accountancy/admin/closure.php +++ b/htdocs/accountancy/admin/closure.php @@ -21,9 +21,8 @@ * \ingroup Accountancy (Double entries) * \brief Setup page to configure accounting expert module */ -require '../../main.inc.php'; -// Class +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; @@ -89,7 +88,7 @@ llxHeader(); $linkback = ''; print load_fiche_titre($langs->trans('MenuClosureAccounts'), $linkback, 'title_accountancy'); -print $langs->trans("DefaultClosureDesc").'
'; +print ''.$langs->trans("DefaultClosureDesc").'
'; print '
'; print '
'; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index cba9ac92f3b..079e3585341 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -78,7 +78,6 @@ $list_account = array ( $accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE; - if (GETPOST('change_chart', 'alpha')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); @@ -132,7 +131,7 @@ llxHeader(); $linkback = ''; print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy'); -print $langs->trans("DefaultBindingDesc").'
'; +print ''.$langs->trans("DefaultBindingDesc").'
'; print '
'; print ''; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 74090e54120..81dc83b2ae5 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -76,6 +76,7 @@ $model_option = array ( ), ); + /* * Actions */ @@ -138,6 +139,7 @@ $form = new Form($db); // $linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup'); + print "\n".''; +} + /** * Abort invoice creationg with a given error message * @@ -497,13 +522,88 @@ print $langs->trans('TotalTTC'); print ' : '.price($invoice->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; print '
'.$sectionwithinvoicelink; print ''; -print '' . $langs->trans('ReductionShort') . ''; -print '' . $langs->trans('Qty') . ''; -print '' . $langs->trans('TotalHTShort') . ''; +if ($_SESSION["basiclayout"]!=1) +{ + print '' . $langs->trans('ReductionShort') . ''; + print '' . $langs->trans('Qty') . ''; + print '' . $langs->trans('TotalHTShort') . ''; +} print "\n"; +if ($_SESSION["basiclayout"]==1) +{ + if ($mobilepage=="cats") + { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $categorie = new Categorie($db); + $categories = $categorie->get_full_arbo('product'); + $htmlforlines = ''; + foreach ($categories as $row){ + $htmlforlines.= ''; + $htmlforlines.= ''; + $htmlforlines.= $row['label']; + $htmlforlines.= ''; + $htmlforlines.= ''."\n"; + } + $htmlforlines.= ''; + $htmlforlines.= '
'; + $htmlforlines.= ''.$langs->trans("Floors").''; + $htmlforlines.= '
'; + print $htmlforlines; + } + + if ($mobilepage=="products") + { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $object = new Categorie($db); + $catid = GETPOST('catid', 'int'); + $result=$object->fetch($catid); + $prods = $object->getObjectsInCateg("product"); + $htmlforlines = ''; + foreach ($prods as $row) { + $htmlforlines.= ''; + $htmlforlines.= ''; + $htmlforlines.= $row->label; + $htmlforlines.= ''; + $htmlforlines.= ''."\n"; + } + $htmlforlines.= ''; + $htmlforlines.= '
'; + $htmlforlines.= ''.$langs->trans("Categories").''; + $htmlforlines.= ''.$langs->trans("Floors").''; + $htmlforlines.= '
'; + print $htmlforlines; + } + + if ($mobilepage=="places") + { + $sql="SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables"; + $resql = $db->query($sql); + $rows = array(); + $htmlforlines = ''; + while($row = $db->fetch_array($resql)){ + $rows[] = $row; + $htmlforlines.= ''; + $htmlforlines.= ''; + $htmlforlines.= $row['label']; + $htmlforlines.= ''; + $htmlforlines.= ''."\n"; + } + $htmlforlines.= ''; + $htmlforlines.= '
'; + $htmlforlines.= ''.$langs->trans("Categories").''; + $htmlforlines.= ''.$langs->trans("Floors").''; + $htmlforlines.= '
'; + print $htmlforlines; + } +} + if ($placeid > 0) { + if ($_SESSION["basiclayout"]==1 && $mobilepage!="invoice") return; if (is_array($invoice->lines) && count($invoice->lines)) { $tmplines = array_reverse($invoice->lines); @@ -538,11 +638,14 @@ if ($placeid > 0) } } if (!empty($line->array_options['options_order_notes'])) $htmlforlines.= "
(".$line->array_options['options_order_notes'].")"; - $htmlforlines.= ''; - $htmlforlines.= '' . vatrate($line->remise_percent, true) . ''; - $htmlforlines.= '' . $line->qty . ''; - $htmlforlines.= '' . price($line->total_ttc) . ''; - $htmlforlines.= ''."\n"; + if ($_SESSION["basiclayout"]!=1) + { + $htmlforlines.= ''; + $htmlforlines.= '' . vatrate($line->remise_percent, true) . ''; + $htmlforlines.= '' . $line->qty . ''; + $htmlforlines.= '' . price($line->total_ttc) . ''; + } + $htmlforlines.= ''."\n"; print $htmlforlines; } @@ -558,6 +661,14 @@ else { // No invoice generated yet print ''; +if ($_SESSION["basiclayout"]==1 && $mobilepage=="invoice") +{ + print ''; +} + if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}) { $soc = new Societe($db); diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index c0a37881cf9..7e55bbc5936 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -57,6 +57,13 @@ if ($conf->browser->layout == 'phone') { $maxcategbydefaultforthisdevice=8; $maxproductbydefaultforthisdevice=16; + //REDIRECT TO BASIC LAYOUT IF TERMINAL SELECTED AND BASIC MOBILE LAYOUT ENABLED + if ($_SESSION["takeposterminal"]!="" && $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT==1) + { + $_SESSION["basiclayout"]=1; + header("Location: invoice.php?mobilepage=invoice"); + exit; + } } $MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG)?$maxcategbydefaultforthisdevice:$conf->global->TAKEPOS_NB_MAXCATEG); $MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT)?$maxproductbydefaultforthisdevice:$conf->global->TAKEPOS_NB_MAXPRODUCT); diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 1d00718401b..2e42d42acaa 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -68,7 +68,7 @@ a.butActionNew>span.fa-list-alt, a.butActionNew>span.fa-list-alt:hover, span.butActionNew>span.fa-list-alt, span.butActionNew>span.fa-list-alt:hover, a.butActionNewRefused>span.fa-list-alt, a.butActionNewRefused>span.fa-list-alt:hover, span.butActionNewRefused>span.fa-list-alt, span.butActionNewRefused>span.fa-list-alt:hover { - padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; + padding-: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; } .butAction:hover { diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index b20db935154..7b6dcaad245 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -51,7 +51,7 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .tmenu .dropdown-menu, .login_block .dropdown-menu { position: absolute; right: 0; - left: auto; + : auto; line-height:1.3em; } .tmenu .dropdown-menu, .login_block .dropdown-menu .user-body { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9061595dd1d..7a585345130 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -95,6 +95,10 @@ input.button.massactionconfirmed { margin: 4px; } +input:invalid, select:invalid { + border-color: #ea1212; +} + /* Focus definitions must be after standard definition */ textarea:focus { /* v6 box-shadow: 0 0 4px #8091BF; */ @@ -552,13 +556,13 @@ select.flat.selectlimit { margin-right: 10px !important; } .marginleftonly { - margin-left: 10px !important; + margin-: 10px !important; } .marginleftonlyshort { - margin-left: 4px !important; + margin-: 4px !important; } .nomarginleft { - margin-left: 0px !important; + margin-: 0px !important; } .margintoponly { margin-top: 10px !important; @@ -911,7 +915,7 @@ select.selectarrowonleft option { } div.divphotoref { - padding-right: 5px; + padding-: 5px; padding-bottom: 5px; } img.photoref, div.photoref { @@ -1008,7 +1012,7 @@ td.showDragHandle { .side-nav { display: table-cell; - border-right: 1px solid #d0d0d0; + border-: 1px solid #d0d0d0; box-shadow: 3px 0 6px -2px #eee; background: rgb(); transition: left 0.5s ease; @@ -1286,7 +1290,7 @@ div.heightref { min-height: 80px; } div.divphotoref { - padding-right: 20px; + padding-: 20px; } div.paginationref { padding-bottom: 10px; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index e7f7c6bff2f..a5361ec6f59 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -1,5 +1,6 @@ +/* Copyright (C) - 2013-2016 Jean-François FERRY + * Copyright (C) - 2019 Nicolas ZABOURI * * 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 @@ -26,6 +27,11 @@ require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticketstats.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +$hookmanager = new HookManager($db); + +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('ticketsindex')); + // Load translation files required by the page $langs->loadLangs(array('companies', 'other', 'ticket')); @@ -225,7 +231,6 @@ if (! empty($dataseries) && count($dataseries) > 1) { if (!$mesg) { $px1->SetData($data); unset($data1); - $px1->SetPrecisionY(0); $i = $startyear; $legend = array(); while ($i <= $endyear) { @@ -240,7 +245,6 @@ if (! empty($dataseries) && count($dataseries) > 1) { $px1->SetYLabel($langs->trans("TicketStatByStatus")); $px1->SetShading(3); $px1->SetHorizTickIncrement(1); - $px1->SetPrecisionY(0); $px1->SetCssPrefix("cssboxes"); $px1->mode = 'depth'; //$px1->SetTitle($langs->trans("TicketStatByStatus")); @@ -372,6 +376,9 @@ if ($result) { print ''; print '
'; +$parameters = array('user' => $user); +$reshook = $hookmanager->executeHooks('dashboardTickets', $parameters, $object); // Note that $action and $object may have been modified by hook + // End of page llxFooter(''); $db->close(); diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 3990540ab9d..775e5d522a5 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -96,7 +96,6 @@ $mesg = $px1->isGraphKo(); if (! $mesg) { $px1->SetData($data); - $px1->SetPrecisionY(0); $i=$startyear;$legend=array(); while ($i <= $endyear) { @@ -111,7 +110,6 @@ if (! $mesg) $px1->SetYLabel($langs->trans("NbOfTicket")); $px1->SetShading(3); $px1->SetHorizTickIncrement(1); - $px1->SetPrecisionY(0); $px1->mode='depth'; $px1->SetTitle($langs->trans("NumberOfTicketsByMonth")); @@ -153,7 +151,6 @@ if (! $mesg) $px2->SetYLabel($langs->trans("AmountOfTickets")); $px2->SetShading(3); $px2->SetHorizTickIncrement(1); - $px2->SetPrecisionY(0); $px2->mode='depth'; $px2->SetTitle($langs->trans("AmountOfTicketsByMonthHT")); @@ -193,7 +190,6 @@ if (! $mesg) $px3->SetHeight($HEIGHT); $px3->SetShading(3); $px3->SetHorizTickIncrement(1); - $px3->SetPrecisionY(0); $px3->mode='depth'; $px3->SetTitle($langs->trans("AmountAverage")); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a151fdb5574..4d78aa1b892 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -520,8 +520,8 @@ class User extends CommonObject * Add a right to the user * * @param int $rid Id of permission to add or 0 to add several permissions - * @param string $allmodule Add all permissions of module $allmodule - * @param string $allperms Add all permissions of module $allmodule, subperms $allperms only + * @param string $allmodule Add all permissions of module $allmodule or 'allmodules' to include all modules. + * @param string $allperms Add all permissions of module $allmodule, subperms $allperms only or '' to include all permissions. * @param int $entity Entity to use * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int > 0 if OK, < 0 if KO @@ -2389,7 +2389,7 @@ class User extends CommonObject if ($withpictoimg) { $paddafterimage=''; - if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"'; + if (abs($withpictoimg) == 1) $paddafterimage='style="margin-'.($langs->trans("DIRECTION")=='rtl'?'left':'right').': 3px;"'; // Only picto if ($withpictoimg > 0) $picto='
'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'
'; // Picto must be a photo diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 9a7d0ab94fd..bc766f4dc4b 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -286,6 +287,10 @@ if ($canreadperms) //print ''; print ''; +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$parameters = array('user' => $user); +$reshook = $hookmanager->executeHooks('dashboardUsersGroups', $parameters, $object); // Note that $action and $object may have been modified by hook + // End of page llxFooter(); $db->close(); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 4d13b182fd4..b77beb001b3 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -66,6 +66,7 @@ if (is_numeric($entity)) define("DOLENTITY", $entity); /** * Header empty * + * @ignore * @return void */ function llxHeader() @@ -74,6 +75,7 @@ function llxHeader() /** * Footer empty * + * @ignore * @return void */ function llxFooter() diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index 9672123f103..a2c0e78ee96 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -211,6 +211,7 @@ class EntrepotTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; + //$this->assertLessThan(1, 0); return $localobject->id; } @@ -237,7 +238,7 @@ class EntrepotTest extends PHPUnit_Framework_TestCase $result=$localobject->delete($user); print __METHOD__." id=".$id." result=".$result."\n"; - $this->assertLessThan($result, 0); + $this->assertLessThan($result, 0, $localobject->errorsToString()); return $result; } @@ -257,6 +258,8 @@ class EntrepotTest extends PHPUnit_Framework_TestCase $localobject=new Entrepot($db); + //$this->assertLessThan(1, 0); + return; } }