diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 39bb06c2ada..ffc0b24619b 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -254,18 +254,18 @@ class Bookmark extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'bookmark' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b5719d388f3..4c2842b2dcf 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1962,18 +1962,18 @@ class Categorie extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'categorie_societe' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables, 1); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables, 1); } /** diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 64d01817c85..efe9374a748 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2261,18 +2261,18 @@ class ActionComm extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'actioncomm' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 963cbc92465..a5fd221de87 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3860,18 +3860,18 @@ class Propal extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'propal' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 19390d06f2f..6083209a32e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4043,18 +4043,18 @@ class Commande extends CommonOrder /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'commande' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 3a586dfc3e5..cf9151c9bee 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1771,35 +1771,35 @@ class FactureRec extends CommonInvoice /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'facture_rec' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** * Function used to replace a product id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old product id - * @param int $dest_id New product id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old product id + * @param int $dest_id New product id + * @return bool */ - public static function replaceProduct(DoliDB $db, $origin_id, $dest_id) + public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'facturedet_rec' ); - return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceProduct($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ea5ad10eb2f..87914eac38e 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5190,18 +5190,18 @@ class Facture extends CommonInvoice /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old third-party id - * @param int $dest_id New third-party id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'facture' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 0093db77c32..6ed518f7f2f 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -167,17 +167,17 @@ class LignePrelevement /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'prelevement_lignes' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4d9db893bd0..4659fe08c17 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1712,18 +1712,18 @@ class Contact extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'socpeople', 'societe_contacts' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f473d3ce0de..1846d911cef 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2474,18 +2474,18 @@ class Contrat extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'contrat' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d1b0ca0164c..d9b86ae01da 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8431,19 +8431,19 @@ abstract class CommonObject * This function is meant to be called from replaceThirdparty with the appropriate tables * Column name fk_soc MUST be used to identify thirdparties * - * @param DoliDB $db Database handler + * @param DoliDB $dbs Database handler * @param int $origin_id Old thirdparty id (the thirdparty to delete) * @param int $dest_id New thirdparty id (the thirdparty that will received element of the other) * @param string[] $tables Tables that need to be changed * @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one) * @return bool True if success, False if error */ - public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) + public static function commonReplaceThirdparty(DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) { foreach ($tables as $table) { - $sql = 'UPDATE '.$db->prefix().$table.' SET fk_soc = '.((int) $dest_id).' WHERE fk_soc = '.((int) $origin_id); + $sql = 'UPDATE '.$dbs->prefix().$table.' SET fk_soc = '.((int) $dest_id).' WHERE fk_soc = '.((int) $origin_id); - if (!$db->query($sql)) { + if (!$dbs->query($sql)) { if ($ignoreerrors) { return true; // TODO Not enough. If there is A-B on kept thirdparty and B-C on old one, we must get A-B-C after merge. Not A-B. } @@ -8460,19 +8460,19 @@ abstract class CommonObject * This function is meant to be called from replaceProduct with the appropriate tables * Column name fk_product MUST be used to identify products * - * @param DoliDB $db Database handler + * @param DoliDB $dbs Database handler * @param int $origin_id Old product id (the product to delete) * @param int $dest_id New product id (the product that will received element of the other) * @param string[] $tables Tables that need to be changed * @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old product may already exists on new one) * @return bool True if success, False if error */ - public static function commonReplaceProduct(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) + public static function commonReplaceProduct(DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) { foreach ($tables as $table) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$table.' SET fk_product = '.((int) $dest_id).' WHERE fk_product = '.((int) $origin_id); - if (!$db->query($sql)) { + if (!$dbs->query($sql)) { if ($ignoreerrors) { return true; // TODO Not enough. If there is A-B on kept product and B-C on old one, we must get A-B-C after merge. Not A-B. } diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 6ef5b69ba3e..d6e9d901ed8 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -41,7 +41,7 @@ class DolGraph { public $type = array(); // Array with type of each series. Example: array('bars', 'horizontalbars', 'lines', 'pies', 'piesemicircle', 'polar'...) public $mode = 'side'; // Mode bars graph: side, depth - private $_library = 'chart'; // Graphic library to use (jflot, chart, artichow) + private $_library; // Graphic library to use (jflot, chart, artichow) //! Array of data public $data; // Data of graph: array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a9c17a2edba..274e58807aa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1483,7 +1483,7 @@ class Form } if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) { - $label .= ' - '.$obj->tva_intra.''; + $label .= ' - '.$obj->tva_intra; } $labelhtml = $label; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index e885790e111..eb0c7668d8c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -347,7 +347,7 @@ class FormTicket print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title; } else { if (isset($this->withreadid) && $this->withreadid > 0) { - $subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.''; + $subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title; } else { $subject = GETPOST('subject', 'alpha'); } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 7406779054b..83e9e3ff277 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -99,8 +99,6 @@ class mailing_contacts1 extends MailingTargets */ public function getNbOfRecipients($sql = '') { - global $conf; - $sql = "SELECT count(distinct(c.email)) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 9947bb49b0b..7cf7c96aef2 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -130,7 +130,7 @@ class pdf_beluga extends ModelePDFProjects * Page orientation * @var string 'P' or 'Portait' (default), 'L' or 'Landscape' */ - private $orientation = ''; + private $orientation; /** * Issuer diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 73fc15e6911..3b560ce1026 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -1085,18 +1085,18 @@ class Delivery extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'delivery' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index b52e0974b9a..333f9673175 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -1101,18 +1101,18 @@ class Don extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old third-party id - * @param int $dest_id New third-party id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'don' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 595eaf67eeb..abb0046606c 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1102,18 +1102,18 @@ class ConferenceOrBoothAttendee extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'eventorganization_conferenceorboothattendee' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 0b8668a6c1a..bb2954daa60 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2450,18 +2450,18 @@ class Expedition extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'expedition' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } } diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 45779950ea6..f2bd0bac8a3 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -761,7 +761,7 @@ if ($action == 'create') { if ($user->rights->ficheinter->creer) { print '
'; - print ''; print $langs->trans("AddIntervention").'
'; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index e36598d04bc..25fc0996ca0 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1383,18 +1383,18 @@ class Fichinter extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'fichinter' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 6f9beb5d051..fa3b700b1fd 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -683,16 +683,16 @@ class FichinterRec extends Fichinter /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array('fichinter_rec'); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index baed7051ef8..30dc5c17425 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -209,17 +209,17 @@ class Fournisseur extends Societe /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old third-party id - * @param int $dest_id New third-party id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'facture_fourn' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0c0cb00129e..00ed65e7616 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3265,18 +3265,18 @@ class CommandeFournisseur extends CommonOrder /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'commande_fournisseur' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 738e27a84e9..1570f161582 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1737,18 +1737,18 @@ class FactureFournisseurRec extends CommonInvoice /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'facture_rec' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 74be4d3d6ac..de012c86a58 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -3154,18 +3154,18 @@ class FactureFournisseur extends CommonInvoice /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'facture_fourn' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index fa1706a523a..a01c8ec00d3 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1003,35 +1003,35 @@ class ProductFournisseur extends Product /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'product_fournisseur_price' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** * Function used to replace a product id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old product id - * @param int $dest_id New product id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceProduct(DoliDB $db, $origin_id, $dest_id) + public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'product_fournisseur_price' ); - return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceProduct($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/index.php b/htdocs/index.php index f0fe4a8e4cc..06a829ea4b5 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -683,12 +683,12 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if ($board->nbtodolate > 0) { $boxwork .= '
'; $boxwork .= ''; - //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').''; + //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"'); $boxwork .= img_picto( $textlate, "warning_white", 'class="inline-block hideonsmartphone valigntextbottom"' - ).''; + ); $boxwork .= ''; $boxwork .= $board->nbtodolate; $boxwork .= ''; diff --git a/htdocs/install/install.forced.sample.php b/htdocs/install/install.forced.sample.php index 98f102ddea0..1e986e4a446 100644 --- a/htdocs/install/install.forced.sample.php +++ b/htdocs/install/install.forced.sample.php @@ -15,59 +15,59 @@ * along with this program. If not, see . */ -/** @var bool Hide PHP informations */ +/** @var boolean $force_install_nophpinfo Hide PHP informations */ $force_install_nophpinfo = true; -/** @var int 1 = Lock and hide environment variables, 2 = Lock all set variables */ +/** @var int $force_install_noedit 1 = Lock and hide environment variables, 2 = Lock all set variables */ $force_install_noedit = 2; -/** @var string Information message */ +/** @var string $force_install_message Information message */ $force_install_message = 'Welcome to your Dolibarr install'; -/** @var string Data root absolute path (documents folder) */ +/** @var string $force_install_main_data_root Data root absolute path (documents folder) */ $force_install_main_data_root = null; -/** @var bool Force HTTPS */ +/** @var boolean $force_install_mainforcehttps Force HTTPS */ $force_install_mainforcehttps = true; -/** @var string Database name */ +/** @var string $force_install_database Database name */ $force_install_database = 'dolibarr'; -/** @var string Database driver (mysql|mysqli|pgsql|mssql|sqlite|sqlite3) */ +/** @var string $force_install_type Database driver (mysql|mysqli|pgsql|mssql|sqlite|sqlite3) */ $force_install_type = 'mysqli'; -/** @var string Database server host */ +/** @var string $force_install_dbserver Database server host */ $force_install_dbserver = 'localhost'; -/** @var int Database server port */ +/** @var int $force_install_port Database server port */ $force_install_port = 3306; -/** @var string Database tables prefix */ +/** @var string $force_install_prefix Database tables prefix */ $force_install_prefix = 'llx_'; -/** @var bool Force database creation */ +/** @var bool $force_install_createdatabase Force database creation */ $force_install_createdatabase = true; -/** @var string Database username */ +/** @var string $force_install_databaselogin Database username */ $force_install_databaselogin = 'root'; -/** @var string Database password */ +/** @var string $force_install_databasepass Database password */ $force_install_databasepass = ''; -/** @var bool Force database user creation */ +/** @var bool $force_install_createuser Force database user creation */ $force_install_createuser = false; -/** @var string Database root username */ +/** @var string $force_install_databaserootlogin Database root username */ $force_install_databaserootlogin = 'root'; -/** @var string Database root password */ +/** @var string $force_install_databaserootpass Database root password */ $force_install_databaserootpass = ''; -/** @var string Dolibarr super-administrator username */ +/** @var string $force_install_dolibarrlogin Dolibarr super-administrator username */ $force_install_dolibarrlogin = 'admin'; -/** @var bool Force install locking */ +/** @var bool $force_install_lockinstall Force install locking */ $force_install_lockinstall = true; -/** @var string Enable module(s) (Comma separated class names list) */ +/** @var string $force_install_module Enable module(s) (Comma separated class names list) */ $force_install_module = 'modSociete,modFournisseur,modFacture'; diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 7b2c4e2ab5a..4cac166942e 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -183,13 +183,14 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param string $filter Filter - * @param string $option Options - * @return int Nb of recipients or -1 if KO + * @param string $sql Not use here + * @return int Nb of recipients or -1 if KO */ - public function getNbOfRecipients($filter = 1, $option = '') + public function getNbOfRecipients($sql = '') { - $a = parent::getNbOfRecipients("select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''"); + $sql = "select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''"; + + $a = parent::getNbOfRecipients($sql); if ($a < 0) { return -1; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0956d55097f..5574984b5fd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -444,7 +444,7 @@ if (empty($reshook)) { } $error++; - setEventMessages($errors, null, 'errors'); + setEventMessages('', $errors, 'errors'); } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 18834f9bac6..9e8e6391752 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -6103,19 +6103,19 @@ class Product extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id + * @param DoliDB $dbs Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'product_customer_price', 'product_customer_price_log' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index ccefdb4c600..c1c24d4f8da 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2167,18 +2167,18 @@ class Project extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id + * @param DoliDB $dbs Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'projet' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 8ae9744a8dd..96b275bfb26 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -2006,32 +2006,32 @@ class Reception extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array('reception'); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** * Function used to replace a product id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old product id - * @param int $dest_id New product id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceProduct(DoliDB $db, $origin_id, $dest_id) + public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'commande_fournisseur_dispatch' ); - return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceProduct($dbs, $origin_id, $dest_id, $tables); } } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index ae39569a36e..f2f5c85236a 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1129,7 +1129,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '....'.$companypaymentmodetemp->last_four; } if ($companypaymentmodetemp->exp_date_month || $companypaymentmodetemp->exp_date_year) { - print ' - '.sprintf("%02d", $companypaymentmodetemp->exp_date_month).'/'.$companypaymentmodetemp->exp_date_year.''; + print ' - '.sprintf("%02d", $companypaymentmodetemp->exp_date_month).'/'.$companypaymentmodetemp->exp_date_year; } print ''; if ($companypaymentmodetemp->country_code) { @@ -1236,7 +1236,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Information print ''; if ($src->object == 'card') { - print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.''; + print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year; print ''; if ($src->country) { $img = picto_from_langcode($src->country); @@ -1246,7 +1246,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } elseif ($src->object == 'source' && $src->type == 'card') { - print ''.$src->owner->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; + print ''.$src->owner->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year; print ''; if ($src->card->country) { @@ -1267,7 +1267,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } } elseif ($src->object == 'payment_method' && $src->type == 'card') { - print ''.$src->billing_details->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; + print ''.$src->billing_details->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year; print ''; if ($src->card->country) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 44ee85ed68e..f283295aeb5 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2693,18 +2693,18 @@ class SupplierProposal extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'supplier_proposal' ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } /** diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 75c9f1b2bae..52a9f941cfe 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3642,18 +3642,18 @@ class User extends CommonObject /** * Function used to replace a thirdparty id with another one. * - * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id - * @return bool + * @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool */ - public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id) { $tables = array( 'user', ); - return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables); } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 21060f5fde9..8fa614bf1e5 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -218,7 +218,7 @@ if ($object->id > 0) { // Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner) if (!empty($conf->mutlicompany->enabled)) { print ''.$langs->trans("Name").''; - print ''.$object->name.''; + print ''.$object->name; if (!$object->entity) { print img_picto($langs->trans("GlobalGroup"), 'redstar'); } diff --git a/qodana.yaml b/qodana.yaml index 5ee4830e26d..3082079a09d 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -42,6 +42,15 @@ exclude: - name: PhpArrayIsAlwaysEmptyInspection - name: PhpParameterByRefIsNotUsedAsReferenceInspection - name: PhpWrongStringConcatenationInspection + - name: PhpUnusedAliasInspection + - name: PhpUnusedPrivateMethodInspection + - name: PhpUnusedPrivateFieldInspection - name: PhpExpressionAlwaysNullInspection - - name: PhpIfWithCommonPartsInspection - + - name: PhpIfWithCommonPartsInspection + - name: PhpTernaryExpressionCanBeReducedToShortVersionInspection + - name: PhpExpressionWithSameOperandsInspection + - name: PhpInArrayCanBeReplacedWithComparisonInspection + - name: PhpUnusedAliasInspection + - name: PhpPossiblePolymorphicInvocationInspection + + \ No newline at end of file