diff --git a/build/README b/build/README index ab83fef26e4..07f0ebe3b55 100644 --- a/build/README +++ b/build/README @@ -36,7 +36,7 @@ Note: Prerequisites to build autoexe DoliWamp package: > perl makepack-dolibarrmodule.pl - To build developper documentation, launch the script -> perl dolybarr-doxygen-build.pl +> perl dolibarr-doxygen-build.pl Note: diff --git a/build/doxygen/dolibarr-doxygen-build.pl b/build/doxygen/dolibarr-doxygen-build.pl index 259e5aca766..75a5cceddbe 100755 --- a/build/doxygen/dolibarr-doxygen-build.pl +++ b/build/doxygen/dolibarr-doxygen-build.pl @@ -36,7 +36,7 @@ $SOURCE="../.."; $result = open( IN, "< " . $SOURCE . "/htdocs/filefunc.inc.php" ); if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; } while () { - if ( $_ =~ /define\('DOL_VERSION','([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; } + if ( $_ =~ /define\('DOL_VERSION', '([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; } } close IN; ($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3); diff --git a/build/doxygen/dolibarr-doxygen-filter.pl b/build/doxygen/dolibarr-doxygen-filter.pl index c3ab35cb8d2..9233bd9e77d 100755 --- a/build/doxygen/dolibarr-doxygen-filter.pl +++ b/build/doxygen/dolibarr-doxygen-filter.pl @@ -8,7 +8,7 @@ # Usage: dolibarr-doxygen-filter.pl pathtofilefromdolibarrroot $file=$ARGV[0]; -if (! $file) +if (! $file) { print "Usage: dolibarr-doxygen-filter.pl pathtofilefromdolibarrroot\n"; exit; @@ -75,7 +75,7 @@ while () { $insidedquote=0; } - } + } } } $ignore=""; diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 8a3096ef72a..59a39416b28 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -145,7 +145,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); // Need to ignore document custom etc. Note: this also ignore natively symbolic links. $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ -$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; +$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 338c795b4b2..61e5e34da99 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php + * \file htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php * \ingroup Accountancy (Double entries) * \brief Tab to setup lettering */ diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index a6343596632..cc840f754bc 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -114,7 +114,7 @@ if ($id > 0) print '
'; print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3d1885799c3..1c6505a260b 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -898,7 +898,7 @@ if ($rowid > 0) 'moreattr' => 'maxlength="128"', ); } - // @TODO Add other extrafields mandatory for thirdparty creation + // @todo Add other extrafields mandatory for thirdparty creation print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("CreateDolibarrThirdParty"), $langs->trans("ConfirmCreateThirdParty"), "confirm_create_thirdparty", $formquestion, 1); } diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index b2f903c1ade..f3d9fc5790c 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -53,7 +53,7 @@ $head = subscription_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Subscription"), -1, 'payment'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback, 1); diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index 5daafd17fb9..75fd269abc9 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -87,12 +87,9 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field - /* */ -/* ************************************************************************** */ - +/* + * Creation of an optional field + */ if ($action == 'create') { print '
'; @@ -101,11 +98,9 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * Edition of an optional field + */ if ($action == 'edit' && ! empty($attrname)) { print "
"; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 3f064e22dfb..895c7d6618d 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -587,8 +587,8 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { print ''; print ''; -/* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. /* +// Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. // Ask for payment bank during order if ($conf->banque->enabled) { diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index f06c4412207..900d66c73b5 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -25,7 +25,7 @@ */ /** - * \file htdocs/admin/commandefournisseurdispatch_extrafields.php + * \file htdocs/admin/commande_fournisseur_dispatch_extrafields.php * \ingroup reception * \brief Page to setup extra fields of reception */ diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 7f2ae92851b..9bae083ea0d 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2007-2012 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * Copyright (C) 2017 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -214,8 +214,8 @@ if (!$error && $xml) $includecustom = (empty($xml->dolibarr_htdocs_dir[0]['includecustom']) ? 0 : $xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude = '\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; - $regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs + $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); // Fill file_list with files in signature, new files, modified files diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index a7982d38ab9..dba4bf1bb91 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -432,7 +432,7 @@ print ''; print ''; */ -// @TODO Use module notification instead... +// @todo Use module notification instead... // Email de réception des notifications print ''; diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index 4e92873c384..ac267d29bc3 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -132,24 +132,21 @@ foreach ($modulesdir as $dir) $classname = ucfirst($classname); require_once $dir_part.$file_searched; - if (class_exists($classname)) - { - dol_syslog("Found API classname=".$classname); - $api->r->addAPIClass($classname,''); + // if (class_exists($classname)) + // { + // dol_syslog("Found API classname=".$classname); + // $api->r->addAPIClass($classname,''); + // require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Routes.php'; + // $tmpclass = new ReflectionClass($classname); + // try { + // $classMetadata = CommentParser::parse($tmpclass->getDocComment()); + // } catch (Exception $e) { + // throw new RestException(500, "Error while parsing comments of `$classname` class. " . $e->getMessage()); + // } - /* - require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/Routes.php'; - $tmpclass = new ReflectionClass($classname); - try { - $classMetadata = CommentParser::parse($tmpclass->getDocComment()); - } catch (Exception $e) { - throw new RestException(500, "Error while parsing comments of `$classname` class. " . $e->getMessage()); - }*/ - - //$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched); - /* } - + // //$listofapis[]=array('classname'=>$classname, 'fullpath'=>$file_searched); + // } }*/ } } @@ -160,7 +157,7 @@ foreach ($modulesdir as $dir) } //var_dump($listofapis); -$listofapis = Routes::toArray(); // TODO api for "status" is lost here +$listofapis = Routes::toArray(); // @todo api for "status" is lost here //var_dump($listofapis); diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 05bad1bbe7e..553c30e0ec8 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1286,9 +1286,9 @@ class Setup extends DolibarrApi $sql = "SELECT rowid, code, pos, label, use_default, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t"; - $sql .= " WHERE t.active = ".$active; - if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'"; - if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'"; + $sql .= " WHERE t.active = ".(int) $active; + // if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'"; + // if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'"; // Add sql filters if ($sqlfilters) { @@ -1473,8 +1473,8 @@ class Setup extends DolibarrApi $includecustom = (empty($xml->dolibarr_htdocs_dir[0]['includecustom']) ? 0 : $xml->dolibarr_htdocs_dir[0]['includecustom']); // Defined qualified files (must be same than into generate_filelist_xml.php) - $regextoinclude = '\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; - $regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs + $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; + $regextoexclude = '('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); // Fill file_list with files in signature, new files, modified files diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index 60147cf512b..d4ae2bd2930 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/asset/admin/asset_extrafields.php - * \ingroup asset - * \brief Page to setup extra fields of assets + * \file htdocs/asset/admin/assets_extrafields.php + * \ingroup asset + * \brief Page to setup extra fields of assets */ require '../../main.inc.php'; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 200b8898ed9..64f8c829072 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -222,7 +222,7 @@ if ($id > 0 && ! preg_match('/^add/i', $action)) dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b9d58fc76f1..acbffa109a2 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -98,7 +98,7 @@ class Categorie extends CommonObject /** * @var array Foreign keys mapping from type string * - * @TODO Move to const array when PHP 5.6 will be our minimum target + * @todo Move to const array when PHP 5.6 will be our minimum target */ protected $MAP_CAT_FK = array( 'product' => 'product', diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 765502075c2..19856095cd5 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -623,7 +623,7 @@ if (empty($reshook) && $action == 'update') */ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes') { - $object->fetch($id); + $object->fetch($id); $object->fetch_optionals(); $object->fetch_userassigned(); $object->oldcopy = clone $object; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 69f748412a1..38af9bfd4fd 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1112,7 +1112,7 @@ class ActionComm extends CommonObject /** * Load all objects with filters. - * @TODO WARNING: This make a fetch on all records instead of making one request with a join. + * @todo WARNING: This make a fetch on all records instead of making one request with a join. * * @param DoliDb $db Database handler * @param int $socid Filter by thirdparty diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 47feb0e75ae..562982dfc47 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -89,6 +89,7 @@ $pid=GETPOST("search_projectid", "int", 3)?GETPOST("search_projectid", "int", 3) $status=GETPOST("search_status", 'aZ09')?GETPOST("search_status", 'aZ09'):GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' $type=GETPOST("search_type", 'aZ09')?GETPOST("search_type", 'aZ09'):GETPOST("type", 'aZ09'); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -167,6 +168,10 @@ if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); + $event->fetch_optionals(); + $event->fetch_userassigned(); + $event->oldcopy = clone $event; + $result = $event->delete(); } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index a21d6472ec6..48256d75b8c 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -88,6 +88,7 @@ $pid=GETPOST("search_projectid", "int", 3)?GETPOST("search_projectid", "int", 3) $status=GETPOST("search_status", 'alpha')?GETPOST("search_status", 'alpha'):GETPOST("status", 'alpha'); $type=GETPOST("search_type", 'alpha')?GETPOST("search_type", 'alpha'):GETPOST("type", 'alpha'); $maxprint=((GETPOST("maxprint", 'int')!='')?GETPOST("maxprint", 'int'):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -154,6 +155,10 @@ if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); + $event->fetch_optionals(); + $event->fetch_userassigned(); + $event->oldcopy = clone $event; + $result = $event->delete(); } @@ -162,6 +167,26 @@ if ($action == 'delete_action') /* * View */ +$parameters = array( + 'socid' => $socid, + 'status' => $status, + 'year' => $year, + 'month' => $month, + 'day' => $day, + 'type' => $type, + 'maxprint' => $maxprint, + 'filter' => $filter, + 'filtert' => $filtert, + 'showbirthday' => $showbirthday, + 'canedit' => $canedit, + 'optioncss' => $optioncss, + 'actioncode' => $actioncode, + 'pid' => $pid, + 'resourceid' => $resourceid, + 'usergroup' => $usergroup, +); +$reshook = $hookmanager->executeHooks('beforeAgendaPerUser', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $form = new Form($db); $companystatic = new Societe($db); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 010a3c6785a..4e0cfa2f2dc 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -238,7 +238,7 @@ if ($object->id > 0) dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom'); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 9375767a172..e2985677514 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1189,7 +1189,7 @@ else dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright = ''; if ($object->statut == 2) $morehtmlright .= ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 9e820a6d608..460c691329e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -221,7 +221,7 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright = ''; $nbtry = $nbok = 0; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index c0b01050d8f..2291f04d0fb 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -54,7 +54,7 @@ if ($object->fetch($id) >= 0) dol_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; $nbtry = $nbok = 0; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ec29e4e5240..594cad56ea0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -132,7 +132,7 @@ class Account extends CommonObject /** * IBAN number (International Bank Account Number). Stored into iban_prefix field into database - * @var + * @var string */ public $iban; @@ -1427,6 +1427,7 @@ class Account extends CommonObject if (!empty($this->iban)) { // If IBAN defined, we can know country of account from it + $reg = array(); if (preg_match("/^([a-zA-Z][a-zA-Z])/i", $this->iban, $reg)) return $reg[1]; } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 72226f18cd6..027294663f1 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/compta/bank/various_expenses/card.php + * \file htdocs/compta/bank/various_payment/card.php * \ingroup bank * \brief Page of various expenses */ diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index d9724777a54..c240495c4a2 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -248,7 +248,7 @@ if ($action == "create" || $action == "start") $vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse; $bankid = $conf->global->$vartouse; // This value is ok for 'Terminal 0' for module 'CashDesk' and 'TakePos' (they manage only 1 terminal) // Hook to get the good bank id according to posmodule and posnumber. - // @TODO add hook here + // @todo add hook here if ($bankid > 0) { diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 127e38a0ddf..c9d4d906280 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -85,11 +85,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Creation of an optional field + * + */ if ($action == 'create') { @@ -99,11 +99,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition of an optional field + * + */ if ($action == 'edit' && ! empty($attrname)) { $langs->load("members"); diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index b8fb7ade572..08a2280ff1c 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -86,11 +86,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Creation of an optional field + * + */ if ($action == 'create') { @@ -100,11 +100,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition of an optional field + * + */ if ($action == 'edit' && ! empty($attrname)) { $langs->load("members"); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 07115733efb..fad5ec0e7a2 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -86,11 +86,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel -/* */ -/* ************************************************************************** */ +/* + * + * Creation d'un champ optionnel + * + */ if ($action == 'create') { @@ -100,11 +100,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition d'un champ optionnel + * + */ if ($action == 'edit' && ! empty($attrname)) { print "
"; diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index cd73063e1e6..133102fc282 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -86,11 +86,11 @@ if ($action != 'create' && $action != 'edit') } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel -/* */ -/* ************************************************************************** */ +/* + * + * Creation d'un champ optionnel + * + */ if ($action == 'create') { @@ -100,11 +100,11 @@ if ($action == 'create') require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +/* + * + * Edition d'un champ optionnel + * + */ if ($action == 'edit' && ! empty($attrname)) { print "
"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b4ad3a1e1ab..92e0f0a7543 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1976,7 +1976,14 @@ if (empty($reshook)) if ($tva_npr) $info_bits |= 0x01; - if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { + $price2num_pu_ht = price2num($pu_ht); + $price2num_remise_percent = price2num($remise_percent); + $price2num_price_min = price2num($price_min); + if (empty($price2num_pu_ht)) $price2num_pu_ht = 0; + if (empty($price2num_remise_percent)) $price2num_remise_percent = 0; + if (empty($price2num_price_min)) $price2num_price_min = 0; + + if ($usercanproductignorepricemin && (! empty($price_min) && ($price2num_pu_ht * (1 - $price2num_remise_percent / 100) < $price2num_price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 7b14146edf8..ffdb2bb90ea 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -204,7 +204,7 @@ if ($action == 'valide') print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide', '', 0, 2); } -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 4363f39216f..9a0e4b6c5fe 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/compat/paiement/class/cpaiement.class.php + * \file htdocs/compta/paiement/class/cpaiement.class.php * \ingroup facture * \brief This file is to manage CRUD function of type of payments */ diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index e19ef3d09e6..691707cf188 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -58,7 +58,7 @@ $head = payment_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 851a6450b8b..740a1e47784 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -280,7 +280,7 @@ class RejetPrelevement * * @param int $amounts If you want to get the amount of the order for each invoice * @return array Array List of invoices related to the withdrawal line - * @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? + * @todo A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? */ private function getListInvoices($amounts = 0) { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 33609f98997..88faf188d17 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -815,7 +815,9 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; - $sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity; + $sql.= " WHERE b.entity = ".$conf->entity; + $sql.= " AND aa.entity = ".$conf->entity; + $sql.= " AND b.numero_compte = aa.account_number"; $sql.= " AND ".$predefinedgroupwhere; $sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'"; if (! empty($date_start) && ! empty($date_end)) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 9af5a559f5e..6e91ef53e2b 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -420,7 +420,7 @@ elseif ($modecompta=="BOOKKEEPING") foreach ($cpts as $i => $cpt) // Loop on each account. { // We make 1 loop for each account because we may want detail per account. - // @TODO Optimize to ask a 'group by' account and a filter with account in (..., ...) in request + // @todo Optimize to ask a 'group by' account and a filter with account in (..., ...) in request // Each month $resultN = 0; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index ac3e800e6e4..fe0668aa9b2 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -194,7 +194,8 @@ elseif ($modecompta=="BOOKKEEPING") $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; $sql.= " WHERE b.entity = ".$conf->entity; - $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover + $sql.= " AND aj.entity = ".$conf->entity; + $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @todo currently count amount in sale journal, but we need to define a category group for turnover } $sql.= " GROUP BY dm"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a945e8cb5a5..0c8da446df7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -261,6 +261,7 @@ class Contact extends CommonObject $this->lastname = $this->lastname ?trim($this->lastname) : trim($this->name); $this->firstname = trim($this->firstname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); if (empty($this->socid)) $this->socid = 0; if (empty($this->priv)) $this->priv = 0; @@ -372,6 +373,10 @@ class Contact extends CommonObject $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); // Clean parameters + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname); + $this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname); $this->firstname = trim($this->firstname); $this->email = trim($this->email); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 35009811fe2..37f2dd62fa3 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1117,7 +1117,7 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { $objecttmp = new $objectclass($db); - if ($objecttmp->element == 'invoice' && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); @@ -1280,7 +1280,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } // Generate document foreach object according to model linked to object -// @TODO : propose model selection +// @todo : propose model selection if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $db->begin(); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f490397754d..3f13eec2b34 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -431,7 +431,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->socid = $sendtosocid; // To link to a company $object->sendtoid = $sendtoid; // To link to contact addresses. This is an array. $object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) - $object->actionmsg = $actionmsg; // Long text (@TODO Replace this with $message, we already have details of email in dedicated properties) + $object->actionmsg = $actionmsg; // Long text (@todo Replace this with $message, we already have details of email in dedicated properties) $object->actionmsg2 = $actionmsg2; // Short text ($langs->transnoentities('MailSentBy')...); $object->trackid = $trackid; @@ -444,7 +444,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->sendtouserid = $sendtouserid; } - $object->email_msgid = $mailfile->msgid; // @TODO Set msgid into $mailfile after sending + $object->email_msgid = $mailfile->msgid; // @todo Set msgid into $mailfile after sending $object->email_from = $from; $object->email_subject = $subject; $object->email_to = $sendto; diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 1addf1c4827..e48271c4d84 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frederic France * * 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 @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/boxes/box_adherent_birthdays.php + * \file htdocs/core/boxes/box_birthdays_members.php * \ingroup member * \brief Box for member birthdays */ diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 0ac4557431b..252141db9eb 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_ticket_latest.php + * \file htdocs/core/boxes/box_last_ticket.php * \ingroup ticket * \brief This box shows latest created tickets */ diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index edd6c89054d..68095eaec31 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/boxes/box_activite.php + * \file htdocs/core/boxes/box_project.php * \ingroup projet * \brief Module to show Projet activity of the current Year */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 544063bc4c8..6680c81fa20 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -73,7 +73,7 @@ abstract class CommonObject public $table_element; /** - * @var int Name of subtable line + * @var string Name of subtable line */ public $table_element_line = ''; @@ -577,7 +577,7 @@ abstract class CommonObject $this->country = $tmparray['label']; } - if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_cpde))) + if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_code))) { require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $tmparray = getState($this->state_id, 'all', 0, 1); @@ -1986,7 +1986,7 @@ abstract class CommonObject */ public function setMulticurrencyCode($code) { - dol_syslog(get_class($this).'::setMulticurrencyCode('.$id.')'); + dol_syslog(get_class($this).'::setMulticurrencyCode('.$code.')'); if ($this->statut >= 0 || $this->element == 'societe') { $fieldname = 'multicurrency_code'; @@ -2028,7 +2028,7 @@ abstract class CommonObject */ public function setMulticurrencyRate($rate, $mode = 1) { - dol_syslog(get_class($this).'::setMulticurrencyRate('.$id.')'); + dol_syslog(get_class($this).'::setMulticurrencyRate('.$rate.','.$mode.')'); if ($this->statut >= 0 || $this->element == 'societe') { $fieldname = 'multicurrency_tx'; @@ -2598,7 +2598,7 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { - $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position' + $fieldposition = 'rang'; // @todo Rename 'rang' into 'position' if (in_array($this->table_element_line, array('bom_bomline', 'ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang; @@ -4883,7 +4883,7 @@ abstract class CommonObject /** * Build thumb - * @TODO Move this into files.lib.php + * @todo Move this into files.lib.php * * @param string $file Path file in UTF8 to original file to create thumbs from. * @return void @@ -6607,7 +6607,7 @@ abstract class CommonObject // Show only the key field in params if (is_array($params) && array_key_exists('onlykey', $params) && $key != $params['onlykey']) continue; - // @TODO Add test also on 'enabled' (different than 'list' that is 'visibility') + // @todo Add test also on 'enabled' (different than 'list' that is 'visibility') $enabled = 1; $visibility = 1; diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index a4be0739aa5..beb887d8b76 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/ajax/fileupload.class.php + * \file htdocs/core/class/fileupload.class.php * \brief File to return Ajax response on file upload */ diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 0352700d91a..c78fe06693b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -971,7 +971,7 @@ class FormFile } // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files and get only generated files) - // @TODO Why not showing by default all files by just removing the '[^\-]+' at end of regex ? + // @todo Why not showing by default all files by just removing the '[^\-]+' at end of regex ? if (!empty($conf->global->MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP)) { $filterforfilesearch = preg_quote(basename($modulesubdir), '/'); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 8ef02b89616..d99a6c091cc 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -18,7 +18,7 @@ */ /** - * \file ticket/class/html.ticket.class.php + * \file htdocs/core/class/html.formticket.class.php * \ingroup ticket * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire */ diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 12be3854ed6..7a3508c7d2f 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -65,7 +65,7 @@ class Notify // Les codes actions sont definis dans la table llx_notify_def // codes actions supported are - // @TODO defined also into interface_50_modNotificiation_Notificiation.class.php + // @todo defined also into interface_50_modNotificiation_Notificiation.class.php public $arrayofnotifsupported = array( 'BILL_VALIDATE', 'BILL_PAYED', diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index aea79fdea29..cab3b4b4336 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -732,7 +732,7 @@ class Utils chdir($dirofmodule); require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; - $utils = new Utils($db); + $utils = new Utils($this->db); // Build HTML doc $command=$conf->global->MODULEBUILDER_ASCIIDOCTOR.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOC; diff --git a/htdocs/core/class/workboardresponse.class.php b/htdocs/core/class/workboardresponse.class.php index 12174916422..e2d9cc2c0d7 100644 --- a/htdocs/core/class/workboardresponse.class.php +++ b/htdocs/core/class/workboardresponse.class.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/class/WorkboardResponse.class.php + * \file htdocs/core/class/workboardresponse.class.php * \brief Class that represents response of load_board functions */ diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index af529e97fae..20a5f9728cb 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -21,7 +21,7 @@ */ /** - * \file htdocs/core/db/sqlite.class.php + * \file htdocs/core/db/sqlite3.class.php * \brief Class file to manage Dolibarr database access for a SQLite database */ diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index dc3581eaf20..587b8ab8434 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -960,7 +960,7 @@ function dol_unescapefile($filename) */ function dolCheckVirus($src_file) { - global $conf; + global $conf, $db; if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { @@ -995,7 +995,7 @@ function dolCheckVirus($src_file) * @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error']) * @param int $nohook Disable all hooks * @param string $varfiles _FILES var name - * @return int >0 if OK, <0 or string if KO + * @return int|string >0 if OK, <0 or string if KO * @see dol_move() */ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile') diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index a0ae9bb3692..5fbb799b7dc 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -17,7 +17,7 @@ * or see https://www.gnu.org/ */ /** - * \file htdocs/core/lib/functionsnumbertoword.lib.php + * \file htdocs/core/lib/functionsnumtoword.lib.php * \brief A set of functions for Dolibarr * This file contains all frequently used functions. */ diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index dfdc0df0fe4..8ee74065583 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/core/modules/cheque/mod_chequereceipts_mint.php + * \file htdocs/core/modules/cheque/mod_chequereceipt_mint.php * \ingroup cheque * \brief File containing class for numbering module Mint */ diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 1855e51f4bc..ddcb5d1965b 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/cheque/mod_chequereceipts_thyme.php + * \file htdocs/core/modules/cheque/mod_chequereceipt_thyme.php * \ingroup cheque * \brief File containing class for numbering module Thyme */ diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 7d745eac6d9..09a93f3d60f 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -261,7 +261,10 @@ class ExportExcel2007new extends ModeleExports $this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true); $this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); - $this->col=0; + $this->col=1; + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->col=0; + } foreach($array_selected_sorted as $code => $value) { $alias=$array_export_fields_label[$code]; @@ -301,7 +304,10 @@ class ExportExcel2007new extends ModeleExports global $conf; // Define first row - $this->col=0; + $this->col=1; + if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) { + $this->col=0; + } $reg=array(); diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 4d8ea35e4d9..3087864b38a 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -63,11 +63,11 @@ class mod_arctic extends ModeleNumRefFicheinter */ public function info() { - global $conf, $langs; + global $db, $conf, $langs; $langs->load("bills"); - $form = new Form($this->db); + $form = new Form($db); $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; $texte.= '
'; diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 092aeb3fa3a..0b02576f5d4 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -16,18 +16,18 @@ */ /** - * \defgroup dav Module dav - * \brief dav module descriptor. + * \defgroup emailcollector Module emailcollector + * \brief emailcollector module descriptor. * - * \file htdocs/dav/core/modules/modDav.class.php - * \ingroup dav - * \brief Description and activation file for module dav + * \file htdocs/emailcollector/core/modules/modEmailCollector.class.php + * \ingroup emailcollector + * \brief Description and activation file for module emailcollector */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Description and activation class for module dav + * Description and activation class for module emailcollector */ class modEmailCollector extends DolibarrModules { @@ -108,10 +108,10 @@ class modEmailCollector extends DolibarrModules ); - if (! isset($conf->dav) || ! isset($conf->dav->enabled)) + if (! isset($conf->emailcollector) || ! isset($conf->emailcollector->enabled)) { - $conf->dav=new stdClass(); - $conf->dav->enabled=0; + $conf->emailcollector=new stdClass(); + $conf->emailcollector->enabled=0; } diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 7dbf129b766..d97ac5df0ff 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2010 Laurent Destailleur * Copyright (C) 2019 Alexandre Spangaro + * Copyright (C) 2019 Frédéric France * * 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 @@ -42,8 +43,16 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + /** + * Prefix customer accountancy code + * @var string + */ public $prefixcustomeraccountancycode; + /** + * Prefix supplier accountancy code + * @var string + */ public $prefixsupplieraccountancycode; public $position = 30; @@ -117,7 +126,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode */ public function getExample($langs, $objsoc = 0, $type = -1) { - global $mysoc; + global $conf, $mysoc; $s = $langs->trans("ThirdPartyName").": ".$mysoc->name; $s .= "
\n"; @@ -142,6 +151,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode public function get_code($db, $societe, $type = '') { // phpcs:enable + global $conf; $i = 0; $this->code = ''; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index f467040a00d..490727f9521 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -44,7 +44,7 @@ class InterfaceNotification extends DolibarrTriggers */ public $picto = 'email'; - // @TODO Defined also into notify.class.php) + // @todo Defined also into notify.class.php) public $listofmanagedevents=array( 'BILL_VALIDATE', 'BILL_PAYED', diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 9b1c08704b6..b5c775207ba 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -21,9 +21,9 @@ */ /** - * \file htdocs/don/admin/dons.php - * \ingroup donations - * \brief Page to setup the donation module + * \file htdocs/don/admin/donation.php + * \ingroup donations + * \brief Page to setup the donation module */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 40445b522da..b5848cd562b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -693,7 +693,7 @@ if (empty($reshook)) if ($lines[$i]->entrepot_id > 0) { // single warehouse shipment line - if ($lines[i]->entrepot_id == $lotStock->warehouseid) + if ($lines[$i]->entrepot_id == $lotStock->warehouseid) { $lineIdToAddLot = $line_id; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ad21603efce..79ea7552237 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2712,8 +2712,8 @@ class ExpenseReportLine if (!empty($this->id)) $sql.= ' AND d.rowid <> '.$this->id; $sql .= ' AND d.fk_c_type_fees = '.$rule->fk_c_type_fees; if ($mode == 'day' || $mode == 'EX_DAY') $sql .= ' AND d.date = \''.dol_print_date($this->date, '%Y-%m-%d').'\''; - elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\''; // @TODO DATE_FORMAT is forbidden - elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\''; // @TODO DATE_FORMAT is forbidden + elseif ($mode == 'mon' || $mode == 'EX_MON') $sql .= ' AND DATE_FORMAT(d.date, \'%Y-%m\') = \''.dol_print_date($this->date, '%Y-%m').'\''; // @todo DATE_FORMAT is forbidden + elseif ($mode == 'year' || $mode == 'EX_YEA') $sql .= ' AND DATE_FORMAT(d.date, \'%Y\') = \''.dol_print_date($this->date, '%Y').'\''; // @todo DATE_FORMAT is forbidden dol_syslog('ExpenseReportLine::getExpAmount'); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 380204c2b0d..9ca729aedfc 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Charlie Benke * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * 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 @@ -197,6 +197,8 @@ class Fichinter extends CommonObject { global $conf, $langs; + $error = 0; + dol_syslog(get_class($this)."::create ref=".$this->ref); // Check parameters @@ -329,6 +331,8 @@ class Fichinter extends CommonObject */ public function update($user, $notrigger = 0) { + global $conf; + if (! is_numeric($this->duration)) { $this->duration = 0; } @@ -1474,6 +1478,8 @@ class FichinterLigne extends CommonObjectLine { global $langs,$conf; + $error = 0; + dol_syslog("FichinterLigne::insert rang=".$this->rang); $this->db->begin(); @@ -1570,7 +1576,9 @@ class FichinterLigne extends CommonObjectLine { global $langs,$conf; - $this->db->begin(); + $error = 0; + + $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET"; diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index d4f526d9847..92a42d1ffdf 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -23,9 +23,9 @@ */ /** - * \file fichinterrec/class/fichinter-rec.class.php - * \ingroup facture - * \brief Fichier de la classe des factures recurentes + * \file htdocs/fichinter/class/fichinterrec.class.php + * \ingroup facture + * \brief Fichier de la classe des factures recurentes */ require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index abda1519002..54aa70469e2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2892,9 +2892,9 @@ class CommandeFournisseur extends CommonOrder $resql = $db->query($sql); if ($resql) { - if ($db->num_rows($query)) + if ($db->num_rows($resql)) { - $obj = $db->fetch_object($query); + $obj = $db->fetch_object($resql); $string = $langs->trans($obj->code); if ($string == $obj->code) @@ -3590,7 +3590,7 @@ class CommandeFournisseurLigne extends CommonOrderLine if (!$error) { $this->db->commit(); - return $result; + return 1; } else { diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index d4fd5a20caf..2ef48bc9f0b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4474,7 +4474,10 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/facture/pdf_crabe.modules.php', '/core/modules/facture/pdf_oursin.modules.php', - '/compta/facture/class/api_invoice.class.php', + '/api/class/api_generic.class.php', + '/categories/class/api_category.class.php', + '/categories/class/api_deprecated_category.class.php', + '/compta/facture/class/api_invoice.class.php', '/commande/class/api_commande.class.php', '/user/class/api_user.class.php', '/product/class/api_product.class.php', diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index e72dcb08fae..01dcf7388a3 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -436,7 +436,7 @@ else /* if (($object->origin == 'shipment' || $object->origin == 'expedition') && $object->origin_id > 0) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print '
'; diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index e31353b3726..b65aa41c4d4 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -18,8 +18,9 @@ */ /** - * \file tvi/ajax/list.php - * \brief File to return datables output + * \file htdocs/loan/calcmens.php + * \ingroup loan + * \brief File to calculate loan monthly payments */ if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 85b797804c9..27e6f4da7a0 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -439,7 +439,7 @@ if ($id > 0) // Loan card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref loan diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index a4328bec863..00efe316732 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -124,7 +124,7 @@ if ($object->id) } $morehtmlref .= '
'; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index 1a26a8a12da..cc2d71a9d65 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -96,7 +96,7 @@ if (!empty($conf->projet->enabled)) { } $morehtmlref .= ''; -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index ebe0b9d876c..a9e15385e34 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -113,7 +113,7 @@ if ($id > 0) } $morehtmlref .= ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index bffa95172d9..8b4d7937d52 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -44,7 +44,7 @@ llxHeader("", $title, $help_url); $head = loan_prepare_head($object); dol_fiche_head($head, 'FinancialCommitment', $langs->trans("Loan"), -1, 'bill'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref loan diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 6b1fd839e07..95663a9a3d3 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/commande/doc/doc_generic_myobject_odt.modules.php + * \file htdocs/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php * \ingroup mymodule * \brief File of class to build ODT documents for myobjects */ diff --git a/htdocs/mrp/ajax/ajax_bom.php b/htdocs/mrp/ajax/ajax_bom.php index 15b70ae17c9..19fea01aa60 100644 --- a/htdocs/mrp/ajax/ajax_bom.php +++ b/htdocs/mrp/ajax/ajax_bom.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/mrp/ajax/ajax.php + * \file htdocs/mrp/ajax/ajax_bom.php * \brief Ajax search component for Mrp. It get BOM content. */ diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 88a0fc30488..e32f0c32f8f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -252,7 +252,7 @@ class Product extends CommonObject /** * Customs code * - * @var + * @var string */ public $customcode; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index c169c22f0a9..ea5b6d45bc1 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -371,7 +371,7 @@ else print $formconfirm; // Warehouse card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index 692fe17a83d..463e39a49d1 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -53,7 +53,7 @@ $head = stock_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("Warehouse"), -1, 'stock'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php index 01f10915ec2..0286b6bc480 100644 --- a/htdocs/product/stock/lib/replenishment.lib.php +++ b/htdocs/product/stock/lib/replenishment.lib.php @@ -110,7 +110,7 @@ function dispatchedOrders() * ordered * * @param int $product_id Product id - * @return void + * @return string|null */ function ordered($product_id) { @@ -155,7 +155,7 @@ function ordered($product_id) * getProducts * * @param int $order_id Order id - * @return void + * @return array|array[integer] */ function getProducts($order_id) { diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 9d10e08be9a..d577cf56b22 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -560,7 +560,7 @@ if ($resql) dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 09273ee947d..e6742cdc78b 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -542,7 +542,7 @@ if ($resql) dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index bd6c5eacc47..f129f2abc62 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/admin/project.php + * \file htdocs/projet/admin/project.php * \ingroup project * \brief Page to setup project module */ diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index e43782c2603..260a3744e2e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1106,7 +1106,7 @@ class Reception extends CommonObject */ public function getNomUrl($withpicto = 0, $option = 0, $max = 0, $short = 0, $notooltip = 0) { - global $langs; + global $conf, $langs; $result = ''; $label = ''.$langs->trans("ShowReception").''; $label .= '
'.$langs->trans('Ref').': '.$this->ref; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 45e3345e51c..d59f9b55996 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -162,7 +162,7 @@ if ($id > 0 || !empty($ref)) // Reception card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref customer reception diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 472b0255f5b..82b5724908e 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/reception/nosendingte.php + * \file htdocs/reception/note.php * \ingroup receptionsending * \brief Note card reception */ @@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref)) // Reception card - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; // Ref customer reception diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index e2c00528781..2b3b0613092 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -16,7 +16,7 @@ */ /** - * \file resource/class/resource.class.php + * \file htdocs/resource/class/dolresource.class.php * \ingroup resource * \brief Class file for resource object */ diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c2017c894c0..3160a701f64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -673,6 +673,7 @@ class Societe extends CommonObject if (empty($this->status)) $this->status = 0; $this->name = $this->name ?trim($this->name) : trim($this->nom); if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); $this->nom = $this->name; // For backward compatibility if (empty($this->client)) $this->client = 0; if (empty($this->fournisseur)) $this->fournisseur = 0; @@ -988,6 +989,8 @@ class Societe extends CommonObject $now = dol_now(); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name = ucwords($this->name); + if (! empty($conf->global->MAIN_ALL_TO_UPPER)) $this->name=strtoupper($this->name); // Clean parameters $this->id = $id; $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index e10603a2ba6..ddc667ef12e 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1618,7 +1618,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -1724,7 +1724,7 @@ if ($socid && $action == 'editcard' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -1772,7 +1772,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -1872,7 +1872,7 @@ if ($socid && $action == 'createcard' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 3d91fac7c29..5b383f30e28 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -185,7 +185,7 @@ $head = societe_prepare_head($object); dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), -1, 'company'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 4692687220a..7e4abfb5692 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -28,7 +28,7 @@ /** * \file htdocs/stripe/payment.php * \ingroup stripe - * \brief Payment page for customers invoices. @TODO Seems deprecated and bugged and not used (no link to this page) ! + * \brief Payment page for customers invoices. @todo Seems deprecated and bugged and not used (no link to this page) ! */ // Load Dolibarr environment diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 7c5676c5a1f..268fa6f6670 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/takepos/printsend.php + * \file htdocs/takepos/send.php * \ingroup takepos * \brief Page with the content of the popup to enter payments */ diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index ef987c84d86..0ea892eca8e 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -765,7 +765,7 @@ $menus[$r++]=array('title'=>'< print ''."\n"; print '
'; - print ' '; + print ' '; print ''.img_picto('', 'searchclear').''; print '
'; ?> diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 9b24a8b68c6..24423f85d46 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -692,7 +692,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd */ print '
'.$langs->trans("TicketEmailNotificationTo").'
'.$langs->trans("RefSending").'
'; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print '
'.$langs->trans('Ref').''; @@ -820,7 +820,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $morehtmlref .= ''; - $linkback = ''.$langs->trans("BackToList").' '; + $linkback = ''.$langs->trans("BackToList").' '; dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref); diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index a934d6cd74c..92be17dcd47 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -20,9 +20,9 @@ */ /** - * \file htdocs/adherents/admin/adherent_extrafields.php - * \ingroup member - * \brief Page to setup extra fields of members + * \file htdocs/user/admin/group_extrafields.php + * \ingroup user + * \brief Page to setup extra fields of users */ require '../../main.inc.php'; diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 712d7318391..1f87b5fbe90 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -19,9 +19,9 @@ */ /** - * \file htdocs/adherents/admin/adherent_extrafields.php - * \ingroup member - * \brief Page to setup extra fields of members + * \file htdocs/user/admin/user_extrafields.php + * \ingroup user + * \brief Page to setup extra fields of users */ require '../../main.inc.php'; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 3c0b8423096..188a6b59d31 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -477,7 +477,7 @@ if ($id && ($action == 'edit' || $action == 'create') && $user->rights->user->us $title = $langs->trans("User"); dol_fiche_head($head, 'bank', $title, 0, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ffb8c15e3c3..387d227d6b4 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -918,6 +918,7 @@ class User extends CommonObject else { $sql .= " AND gr.entity = ".$conf->entity; + $sql .= " AND gu.entity = ".$conf->entity; $sql .= " AND r.entity = ".$conf->entity; } $sql .= " AND gr.fk_usergroup = gu.fk_usergroup"; @@ -1175,6 +1176,11 @@ class User extends CommonObject global $mysoc; // Clean parameters + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); + $this->login = trim($this->login); if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value @@ -1513,6 +1519,11 @@ class User extends CommonObject dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); // Clean parameters + + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords($this->lastname); + if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname=strtoupper($this->lastname); + if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords($this->firstname); + $this->lastname = trim($this->lastname); $this->firstname = trim($this->firstname); $this->employee = $this->employee ? $this->employee : 0; @@ -1971,7 +1982,7 @@ class User extends CommonObject * * @param User $user Object user that send email * @param string $password New password - * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @TODO Add method 2 = Send link to reset password + * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @todo Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ public function send_password($user, $password = '', $changelater = 0) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 22a06e352c8..dba57f3954b 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -329,7 +329,7 @@ else { dol_fiche_head($head, 'guisetup', $title, -1, 'user'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index c3f2b198301..04c9e70c447 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -374,7 +374,7 @@ if (! empty($id) || ! empty($ref)) if ($action == 'add' || ($action == 'edit')) { if ($action == 'add') { $title = $langs->trans('NewProductCombination'); - //print dol_fiche_head(); + // dol_fiche_head(); $features = $_SESSION['addvariant_'.$object->id]; //First, sanitize $listofvariantselected = '
'; @@ -499,7 +499,7 @@ if (! empty($id) || ! empty($ref)) print ''."\n"; } - print dol_fiche_head(); + dol_fiche_head(); print ''; diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index c4fb81065d5..638b02c0c58 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -263,15 +263,15 @@ class ZapierApi extends DolibarrApi ); } - /** - * Update hook - * - * @param int $id Id of hook to update - * @param array $request_data Datas - * @return int - * - * @url PUT /hooks/{id} - */ + // /** + // * Update hook + // * + // * @param int $id Id of hook to update + // * @param array $request_data Datas + // * @return int + // * + // * @url PUT /hooks/{id} + // */ /*public function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->zapier->write) {