diff --git a/ChangeLog b/ChangeLog
index 1fa1458c534..2c534cfff8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@ Following changes may create regressions for some external modules, but were nec
* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu.
* All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'.
* All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'.
+* All properties 'type_libelle' were renamed into 'type_label'.
***** ChangeLog for 10.0.3 compared to 10.0.2 *****
IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card.
diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index 986649d15e2..e2fc13edadf 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -431,10 +431,10 @@ class Subscription extends CommonObject
/**
* Renvoi le libelle d'un statut donne
*
- * @param int $statut Id statut
+ * @param int $status Id status
* @return string Label
*/
- public function LibStatut($statut)
+ public function LibStatut($status)
{
// phpcs:enable
global $langs;
diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php
index 2dd8c95923f..84fc6bc9824 100644
--- a/htdocs/adherents/htpasswd.php
+++ b/htdocs/adherents/htpasswd.php
@@ -42,7 +42,7 @@ if (empty($sortorder)) { $sortorder="ASC"; }
if (empty($sortfield)) { $sortfield="d.login"; }
if (! isset($statut))
{
- $statut = 1 ;
+ $statut = 1;
}
if (! isset($cotis))
@@ -54,7 +54,7 @@ if (! isset($cotis))
$sql = "SELECT d.login, d.pass, d.datefin";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
-$sql .= " WHERE d.statut = $statut ";
+$sql .= " WHERE d.statut = ".$statut;
if ($cotis==1)
{
$sql .= " AND datefin > '".$db->idate($now)."'";
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index 6d1a5c57cf6..52de58b80b8 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -236,7 +236,7 @@ foreach($listofnotifiedevents as $notifiedevent)
$s=''; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail=explode(',', $value);
$showwarning=0;
- foreach($arrayemail as $key=>$valuedet)
+ foreach($arrayemail as $keydet => $valuedet)
{
$valuedet=trim($valuedet);
if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++;
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index 4d234e266e8..52ef490ceae 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -458,7 +458,7 @@ if ($mode == 'searchkey')
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
$title = $langs->trans("TranslationKeySearch");
if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')';
- print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n";
+ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit);
print '';
print '';
@@ -466,7 +466,7 @@ if ($mode == 'searchkey')
print '
';
print '
';
print '
';
- print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).'';
+ print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 2b502d02738..6ff70106e0e 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -45,43 +45,67 @@ class ActionComm extends CommonObject
*/
public $table_element = 'actioncomm';
+ /**
+ * @var string Name of id column
+ */
public $table_rowid = 'id';
/**
- * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
+ * @var string Name of icon for actioncomm object. Filename of icon is object_action.png
*/
public $picto = 'action';
/**
- * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
- * @var int
+ * @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 1;
/**
- * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty
- * @var integer
+ * @var integer 0=Default
+ * 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
+ * 2=Same than 1 but accept record if fksoc is empty
*/
public $restrictiononfksoc = 2;
/**
- * Id of the event
- * @var int
+ * @var int Id of the event
*/
public $id;
/**
- * Id of the event. Use $id as possible
- * @var int
+ * @var int Id of the event. Use $id as possible
*/
public $ref;
- public $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
- public $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
+ /**
+ * @var int Id into parent table llx_c_actioncomm (used only if option to use type is set)
+ */
+ public $type_id;
+
+ /**
+ * @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
+ */
+ public $type_code;
+
+ /**
+ * @var string Type label
+ */
public $type_label;
- public $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
- public $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
- public $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
+
+ /**
+ * @var string Label into parent table llx_c_actioncomm (used only if option to use type is set)
+ */
+ public $type;
+
+ /**
+ * @var string Color into parent table llx_c_actioncomm (used only if option to use type is set)
+ */
+ public $type_color;
+
+ /**
+ * @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
+ */
+ public $code;
/**
* @var string Agenda event label
@@ -89,72 +113,56 @@ class ActionComm extends CommonObject
public $label;
/**
- * Date creation record (datec)
- *
- * @var integer
+ * @var integer Date creation record (datec)
*/
public $datec;
/**
- * Date end record (datef)
- *
- * @var integer
+ * @var integer Date end record (datef)
*/
public $datef;
/**
- * Duration (duree)
- *
- * @var integer
+ * @var integer Duration (duree)
*/
public $duree;
/**
- * Date modification record (tms)
- *
- * @var integer
+ * @var integer Date modification record (tms)
*/
public $datem;
/**
- * Object user that create action
- * @var User
+ * @var User Object user that create action
* @deprecated
* @see $authorid
*/
public $author;
/**
- * Object user that modified action
- * @var User
+ * @var User Object user that modified action
* @deprecated
* @see $usermodid
*/
public $usermod;
/**
- * Id user that create action
- * @var int
+ * @var int Id user that create action
*/
public $authorid;
/**
- * Id user that modified action
- * @var int
+ * @var int Id user that modified action
*/
public $usermodid;
/**
- * Date action start (datep)
- *
- * @var integer
+ * @var integer Date action start (datep)
*/
public $datep;
/**
- * Date action end (datep2)
- *
- * @var integer
+ * @var integer Date action end (datep2)
*/
public $datep2;
@@ -163,90 +171,178 @@ class ActionComm extends CommonObject
* @deprecated
*/
public $durationp = -1;
- public $fulldayevent = 0; // 1=Event on full day
/**
- * Milestone
- * @var int
+ * @var int 1=Event on full day
+ */
+ public $fulldayevent = 0;
+
+ /**
+ * @var int Milestone
* @deprecated Milestone is already event with end date = start date
*/
public $punctual = 1;
- public $percentage; // Percentage
- public $location; // Location
- public $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
- public $priority; // Small int (0 By default)
+ /**
+ * @var integer Percentage
+ */
+ public $percentage;
- public $userassigned = array(); // Array of user ids
- public $userownerid; // Id of user owner = fk_user_action into table
- public $userdoneid; // Id of user done (deprecated)
+ /**
+ * @var string Location
+ */
+ public $location;
- public $socpeopleassigned = array(); // Array of contact ids
+ /**
+ * @var int Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
+ */
+ public $transparency;
- public $otherassigned = array(); // Array of other contact emails (not user, not contact)
+ /**
+ * @var int (0 By default)
+ */
+ public $priority;
+
+ /**
+ * @var int[] Array of user ids
+ */
+ public $userassigned = array();
+
+ /**
+ * @var int Id of user owner = fk_user_action into table
+ */
+ public $userownerid;
+
+ /**
+ * @var int Id of user done (deprecated)
+ * @deprecated
+ */
+ public $userdoneid;
+
+ /**
+ * @var int[] Array of contact ids
+ */
+ public $socpeopleassigned = array();
+
+ /**
+ * @var int[] Array of other contact emails (not user, not contact)
+ */
+ public $otherassigned = array();
- /**
- * Object user of owner
- * @var User
+ /**
+ * @var User Object user of owner
* @deprecated
* @see userownerid
*/
public $usertodo;
/**
- * Object user that did action
- * @var User
+ * @var User Object user that did action
* @deprecated
* @see userdoneid
*/
public $userdone;
+ /**
+ * @var int thirdparty id linked to action
+ */
public $socid;
+
+ /**
+ * @var int socpeople id linked to action
+ */
public $contactid;
/**
- * Company linked to action (optional)
- * @var Societe|null
+ * @var Societe|null Company linked to action (optional)
* @deprecated
* @see socid
*/
public $societe;
/**
- * Contact linked to action (optional)
- * @var Contact|null
+ * @var Contact|null Contact linked to action (optional)
* @deprecated
* @see contactid
*/
public $contact;
// Properties for links to other objects
+ /**
+ * @var int Id of linked object
+ */
public $fk_element; // Id of record
- public $elementid; // Id of record alternative for API
- public $elementtype; // Type of record. This if property ->element of object linked to.
- // Ical
+ /**
+ * @var int Id of record alternative for API
+ */
+ public $elementid;
+
+ /**
+ * @var string Type of record. This if property ->element of object linked to.
+ */
+ public $elementtype;
+
+ /**
+ * @var string Ical name
+ */
public $icalname;
+
+ /**
+ * @var string Ical color
+ */
public $icalcolor;
+ /**
+ * @var array Actions
+ */
public $actions=array();
- // Fields for emails
+ /**
+ * @var string Email msgid
+ */
public $email_msgid;
+
+ /**
+ * @var string Email from
+ */
public $email_from;
+
+ /**
+ * @var string Email sender
+ */
public $email_sender;
+
+ /**
+ * @var string Email to
+ */
public $email_to;
+
+ /**
+ * @var string Email tocc
+ */
public $email_tocc;
+ /**
+ * @var string Email tobcc
+ */
public $email_tobcc;
+
+ /**
+ * @var string Email subject
+ */
public $email_subject;
+
+ /**
+ * @var string Email errors to
+ */
public $errors_to;
/**
* Constructor
*
- * @param DoliDB $db Database handler
+ * @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index c736dccf99c..65852d053b4 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -488,7 +488,7 @@ if ($resql)
if (! empty($arrayfields['a.tms']['checked'])) print '
';
if (! empty($arrayfields['a.percent']['checked'])) {
print '
';
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 73ab9d1e7b6..9bac85fe232 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -13,7 +13,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014-2015 Marcos García
* Copyright (C) 2018 Nicolas ZABOURI
- * Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2018-2019 Frédéric France
* Copyright (C) 2018 Ferran Marcet
*
* This program is free software; you can redistribute it and/or modify
@@ -95,8 +95,17 @@ class Propal extends CommonObject
*/
public $socid;
+ /**
+ * ID of the contact
+ * @var int
+ */
public $contactid;
public $author;
+
+ /**
+ * Ref from thirdparty
+ * @var string
+ */
public $ref_client;
/**
@@ -240,7 +249,7 @@ class Propal extends CommonObject
* @param int $socid Id third party
* @param int $propalid Id proposal
*/
- public function __construct($db, $socid = "", $propalid = 0)
+ public function __construct($db, $socid = 0, $propalid = 0)
{
global $conf,$langs;
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 0ec20862292..6e01ba2f5e2 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -53,19 +53,22 @@ class Commande extends CommonOrder
public $table_element='commande';
/**
- * @var int Name of subtable line
+ * @var string Name of subtable line
*/
public $table_element_line = 'commandedet';
+ /**
+ * @var string Name of class line
+ */
public $class_element_line = 'OrderLine';
/**
- * @var int Field with ID of parent key if this field has a parent
+ * @var string Field name with ID of parent key if this field has a parent
*/
public $fk_element = 'fk_commande';
/**
- * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
+ * @var string String with name of icon for commande class. Here is object_order.png
*/
public $picto = 'order';
@@ -87,13 +90,23 @@ class Commande extends CommonOrder
protected $table_ref_field = 'ref';
/**
- * Client ID
- * @var int
+ * @var int Thirparty ID
*/
public $socid;
+ /**
+ * @var string Thirparty ref of order
+ */
public $ref_client;
+
+ /**
+ * @var string Internal ref for order
+ */
public $ref_int;
+
+ /**
+ * @var int Contact ID
+ */
public $contactid;
/**
@@ -103,10 +116,9 @@ class Commande extends CommonOrder
public $statut;
/**
- * Billed
- * @var int
+ * @var int Status Billed or not
*/
- public $billed; // billed or not
+ public $billed;
/**
* @var int Draft Status of the order
@@ -115,25 +127,22 @@ class Commande extends CommonOrder
public $cond_reglement_code;
/**
- * @var int ID
+ * @var int bank account ID
*/
public $fk_account;
/**
- * It holds the label of the payment mode. Use it in case translation cannot be found.
- * @var string
+ * @var string It holds the label of the payment mode. Use it in case translation cannot be found.
*/
public $mode_reglement;
/**
- * Payment mode id
- * @var int
+ * @var int Payment mode id
*/
public $mode_reglement_id;
/**
- * Payment mode code
- * @var string
+ * @var string Payment mode code
*/
public $mode_reglement_code;
@@ -157,9 +166,13 @@ class Commande extends CommonOrder
public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...)
public $demand_reason_code;
- public $date; // Date commande
+ /**
+ * @var int Date of order
+ */
+ public $date;
/**
+ * @var int Date of order
* @deprecated
* @see $date
*/
@@ -182,7 +195,14 @@ class Commande extends CommonOrder
public $linked_objects=array();
+ /**
+ * @var int User author ID
+ */
public $user_author_id;
+
+ /**
+ * @var int User validator ID
+ */
public $user_valid;
/**
@@ -192,7 +212,7 @@ class Commande extends CommonOrder
// Multicurrency
/**
- * @var int ID
+ * @var int Currency ID
*/
public $fk_multicurrency;
@@ -202,6 +222,9 @@ class Commande extends CommonOrder
public $multicurrency_total_tva;
public $multicurrency_total_ttc;
+ /**
+ * @var Commande clone of order object
+ */
public $oldcopy;
//! key of module source when order generated from a dedicated module ('cashdesk', 'takepos', ...)
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index b4820e11ecb..5fe9853ec54 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -138,7 +138,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print "
\n";
- $sql = "SELECT c.id, c.libelle as lib,";
+ $sql = "SELECT c.id, c.libelle as label,";
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
$sql.= " pct.code as payment_code,";
@@ -185,12 +185,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
// Label
print '
';
// Type
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index c89e6d54d08..0b9c6768eda 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -2068,10 +2068,10 @@ class Contrat extends CommonObject
/**
* Return list of line rowid
*
- * @param int $statut Status of lines to get
+ * @param int $status Status of lines to get
* @return array|int Array of line's rowid or <0 if error
*/
- public function array_detail($statut = -1)
+ public function array_detail($status = -1)
{
// phpcs:enable
$tab=array();
@@ -2079,7 +2079,7 @@ class Contrat extends CommonObject
$sql = "SELECT cd.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
$sql.= " WHERE fk_contrat =".$this->id;
- if ($statut >= 0) $sql.= " AND statut = '$statut'";
+ if ($status >= 0) $sql.= " AND statut = ".$status;
dol_syslog(get_class($this)."::array_detail()", LOG_DEBUG);
$resql=$this->db->query($sql);
diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php
index 6369fd2b7a9..91ec36fd500 100644
--- a/htdocs/core/boxes/box_graph_invoices_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_permonth.php
@@ -135,7 +135,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
@@ -180,7 +181,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
index 7c793131dfc..9be3a986fa9 100644
--- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
@@ -132,7 +132,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png';
$px1 = new DolGraph();
@@ -143,7 +144,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px1->SetData($data1);
unset($data1);
- $i=$startyear;$legend=array();
+ $i=$startyear;
+ $legend=array();
while ($i <= $endyear)
{
if ($startmonth != 1)
@@ -177,7 +179,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png';
$px2 = new DolGraph();
diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php
index cf4b0b02aa6..5ea1bb9f764 100644
--- a/htdocs/core/boxes/box_graph_orders_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_permonth.php
@@ -135,7 +135,8 @@ class box_graph_orders_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
@@ -144,7 +145,8 @@ class box_graph_orders_permonth extends ModeleBoxes
{
$px1->SetData($data1);
unset($data1);
- $i=$startyear;$legend=array();
+ $i=$startyear;
+ $legend=array();
while ($i <= $endyear)
{
if ($startmonth != 1)
@@ -178,7 +180,8 @@ class box_graph_orders_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
index a687411cca5..fba42b42eba 100644
--- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
@@ -134,7 +134,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
@@ -143,7 +144,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{
$px1->SetData($data1);
unset($data1);
- $i=$startyear;$legend=array();
+ $i=$startyear;
+ $legend=array();
while ($i <= $endyear)
{
if ($startmonth != 1)
@@ -177,7 +179,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth);
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
- if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index a58b04c1f31..391bee1ec60 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1057,13 +1057,13 @@ abstract class CommonObject
/**
* Get array of all contacts for an object
*
- * @param int $statut Status of links to get (-1=all)
+ * @param int $status Status of links to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @return array|int Array of contacts, -1 if error
*/
- public function liste_contact($statut = -1, $source = 'external', $list = 0, $code = '')
+ public function liste_contact($status = -1, $source = 'external', $list = 0, $code = '')
{
// phpcs:enable
global $langs;
@@ -1086,7 +1086,7 @@ abstract class CommonObject
if ($source == 'internal') $sql.= " AND tc.source = 'internal'";
if ($source == 'external' || $source == 'thirdparty') $sql.= " AND tc.source = 'external'";
$sql.= " AND tc.active=1";
- if ($statut >= 0) $sql.= " AND ec.statut = '".$statut."'";
+ if ($status >= 0) $sql.= " AND ec.statut = ".$status;
$sql.=" ORDER BY t.lastname ASC";
dol_syslog(get_class($this)."::liste_contact", LOG_DEBUG);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a5fcf8bae99..0aca6a94213 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3765,7 +3765,7 @@ class Form
*
* @param string $selected Id account pre-selected
* @param string $htmlname Name of select zone
- * @param int $statut Status of searched accounts (0=open, 1=closed, 2=both)
+ * @param int $status Status of searched accounts (0=open, 1=closed, 2=both)
* @param string $filtre To filter list
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
@@ -3773,7 +3773,7 @@ class Form
* @param string $morecss More CSS
* @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...)
*/
- public function select_comptes($selected = '', $htmlname = 'accountid', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '')
+ public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '')
{
// phpcs:enable
global $langs, $conf;
@@ -3784,7 +3784,7 @@ class Form
$sql = "SELECT rowid, label, bank, clos as status, currency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity IN (".getEntity('bank_account').")";
- if ($statut != 2) $sql.= " AND clos = '".$statut."'";
+ if ($status != 2) $sql.= " AND clos = ".(int) $status;
if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY label";
@@ -3815,7 +3815,7 @@ class Form
}
print trim($obj->label);
if ($showcurrency) print ' ('.$obj->currency_code.')';
- if ($statut == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')';
+ if ($status == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')';
print '';
$i++;
}
@@ -3823,7 +3823,7 @@ class Form
}
else
{
- if ($statut == 0) print ''.$langs->trans("NoActiveBankAccountDefined").'';
+ if ($status == 0) print ''.$langs->trans("NoActiveBankAccountDefined").'';
else print ''.$langs->trans("NoBankAccountFound").'';
}
}
@@ -3839,13 +3839,13 @@ class Form
*
* @param string $selected Id establishment pre-selected
* @param string $htmlname Name of select zone
- * @param int $statut Status of searched establishment (0=open, 1=closed, 2=both)
+ * @param int $status Status of searched establishment (0=open, 1=closed, 2=both)
* @param string $filtre To filter list
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
* @return int <0 if error, Num of establishment found if OK (0, 1, 2, ...)
*/
- public function selectEstablishments($selected = '', $htmlname = 'entity', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '')
+ public function selectEstablishments($selected = '', $htmlname = 'entity', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '')
{
// phpcs:enable
global $langs, $conf;
@@ -3856,7 +3856,7 @@ class Form
$sql = "SELECT rowid, name, fk_country, status, entity";
$sql.= " FROM ".MAIN_DB_PREFIX."establishment";
$sql.= " WHERE 1=1";
- if ($statut != 2) $sql.= " AND status = '".$statut."'";
+ if ($status != 2) $sql.= " AND status = ".(int) $status;
if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY name";
@@ -3886,7 +3886,7 @@ class Form
print '';
$i++;
}
@@ -3894,7 +3894,7 @@ class Form
}
else
{
- if ($statut == 0) print ''.$langs->trans("NoActiveEstablishmentDefined").'';
+ if ($status == 0) print ''.$langs->trans("NoActiveEstablishmentDefined").'';
else print ''.$langs->trans("NoEstablishmentFound").'';
}
}
@@ -5344,13 +5344,14 @@ class Form
* @param int $disabled Disable input fields
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.
- * @param datetime $adddateof Add a link "Date of invoice" using the following date.
- * @param string $openinghours Specify hour strat and hour end for the select ex 8,20
+ * @param datetime $adddateof Add a link "Date of invoice" using the following date. See also $labeladddateof for the label used.
+ * @param string $openinghours Specify hour start and hour end for the select ex 8,20
* @param int $stepminutes Specify step for minutes between 1 and 30
+ * @param string $labeladddateof Label to use for the $adddateof parameter.
* @return string Html for selectDate
* @see form_date(), select_month(), select_year(), select_dayofweek()
*/
- public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1)
+ public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1, $labeladddateof = '')
{
global $conf,$langs;
@@ -5737,7 +5738,8 @@ class Form
if ($conf->use_javascript_ajax && $adddateof)
{
$tmparray=dol_getdate($adddateof);
- $retstring.=' -