=0 if OK
+ * @return integer Return integer <0 if KO, >=0 if OK
*/
public function fetch($rowid)
{
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index 70b39fde0fb..564de96b4f4 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -201,6 +201,7 @@ if (empty($reshook)) {
$object->label = GETPOST('label', 'alpha');
$object->date_ech = $dateech;
$object->periode = $dateperiod;
+ $object->period = $dateperiod;
$object->amount = $amount;
$object->fk_user = $fk_user;
$object->mode_reglement_id = (int) GETPOST('mode_reglement_id', 'int');
@@ -236,6 +237,7 @@ if (empty($reshook)) {
$object->date_ech = $dateech;
$object->periode = $dateperiod;
+ $object->period = $dateperiod;
$object->amount = $amount;
$object->fk_user = $fk_user;
@@ -271,6 +273,7 @@ if (empty($reshook)) {
if (GETPOST('clone_for_next_month', 'int')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set
$object->periode = dol_time_plus_duree($object->periode, 1, 'm');
+ $object->period = dol_time_plus_duree($object->periode, 1, 'm');
$object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm');
} else {
// Note date_ech is often a little bit higher than dateperiod
@@ -278,6 +281,7 @@ if (empty($reshook)) {
$newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int'));
if ($newdateperiod) {
$object->periode = $newdateperiod;
+ $object->period = $newdateperiod;
if (empty($newdateech)) {
$object->date_ech = $object->periode;
}
@@ -288,6 +292,7 @@ if (empty($reshook)) {
// TODO We can here get dol_get_last_day of previous month:
// $object->periode = dol_get_last_day(year of $object->date_ech - 1m, month or $object->date_ech -1m)
$object->periode = $object->date_ech;
+ $object->period = $object->date_ech;
}
}
}
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index 909072fb459..83eb82d55de 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -66,7 +66,11 @@ class ChargeSociales extends CommonObject
public $type_label;
public $amount;
public $paye;
+ /**
+ * @deprecated
+ */
public $periode;
+ public $period;
/**
* @var integer|string date_creation
@@ -144,12 +148,12 @@ class ChargeSociales extends CommonObject
*
* @param int $id Id
* @param string $ref Ref
- * @return int <0 KO >0 OK
+ * @return int Return integer <0 KO >0 OK
*/
public function fetch($id, $ref = '')
{
$sql = "SELECT cs.rowid, cs.date_ech";
- $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key";
+ $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key";
$sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private";
$sql .= ", c.libelle as type_label";
$sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
@@ -186,7 +190,8 @@ class ChargeSociales extends CommonObject
$this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->paye = $obj->paye;
- $this->periode = $this->db->jdate($obj->periode);
+ $this->periode = $this->db->jdate($obj->period);
+ $this->period = $this->db->jdate($obj->period);
$this->import_key = $this->import_key;
$this->db->free($resql);
@@ -211,7 +216,7 @@ class ChargeSociales extends CommonObject
$newamount = price2num($this->amount, 'MT');
// Validation of parameters
- if ($newamount == 0 || empty($this->date_ech) || empty($this->periode)) {
+ if ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) {
return false;
}
@@ -222,7 +227,7 @@ class ChargeSociales extends CommonObject
* Create a social contribution into database
*
* @param User $user User making creation
- * @return int <0 if KO, id if OK
+ * @return int Return integer <0 if KO, id if OK
*/
public function create($user)
{
@@ -744,6 +749,7 @@ class ChargeSociales extends CommonObject
$this->date_creation = dol_now();
$this->date_ech = $this->date_creation + 3600 * 24 * 30;
$this->periode = $this->date_creation + 3600 * 24 * 30;
+ $this->period = $this->date_creation + 3600 * 24 * 30;
$this->amount = 100;
$this->label = 'Social contribution label';
$this->type = 1;
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index 75800e434ca..5b0782a6598 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -153,7 +153,7 @@ class PaymentSocialContribution extends CommonObject
*
* @param User $user User making payment
* @param int $closepaidcontrib 1=Also close paid contributions to paid, 0=Do nothing more
- * @return int <0 if KO, id of payment if OK
+ * @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user, $closepaidcontrib = 0)
{
@@ -802,7 +802,7 @@ class PaymentSocialContribution extends CommonObject
/**
* Return if object was dispatched into bookkeeping
*
- * @return int <0 if KO, 0=no, 1=yes
+ * @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{
diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php
index 8fa529f410b..3d0d51bebf8 100644
--- a/htdocs/compta/tva/class/paymentvat.class.php
+++ b/htdocs/compta/tva/class/paymentvat.class.php
@@ -154,7 +154,7 @@ class PaymentVAT extends CommonObject
*
* @param User $user User making payment
* @param int $closepaidvat 1=Also close paid contributions to paid, 0=Do nothing more
- * @return int <0 if KO, id of payment if OK
+ * @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user, $closepaidvat = 0)
{
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index 281c44d4574..e160abfc3b8 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -559,7 +559,7 @@ class Tva extends CommonObject
* Create in database
*
* @param User $user Object user that insert
- * @return int <0 if KO, rowid in tva table if OK
+ * @return int Return integer <0 if KO, rowid in tva table if OK
*/
public function addPayment($user)
{
diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example
index 2faa7e7af46..4c612256c23 100644
--- a/htdocs/conf/conf.php.example
+++ b/htdocs/conf/conf.php.example
@@ -349,6 +349,14 @@ $dolibarr_cron_allow_cli='0';
//
// $dolibarr_mailing_limit_sendbycli='0';
+// dolibarr_main_stream_to_disable
+// ================================
+// Can set a list of PHP stream to disable.
+// Default value: array('compress.zlib', 'compress.bzip2', 'ftp', 'ftps', 'glob', 'data', 'expect', 'ogg', 'rar', 'zip', 'zlib')
+// Examples: array('ftp', 'ftps')
+//
+// $dolibarr_main_stream_to_disable = array('compress.zlib', 'compress.bzip2', 'ftp', 'ftps', 'glob', 'data', 'expect', 'ogg', 'rar', 'zip', 'zlib');
+
// MAIN_ANTIVIRUS_COMMAND (as a constant)
// ======================
// Force a value for the antivirus command line tool so setup for admin user interface has no effect.
@@ -378,8 +386,8 @@ $dolibarr_cron_allow_cli='0';
// =========================
// If this value is set to a value, it forces the creation of a file install.lock once an upgrade process into a new version end.
// The value is the octal value of permission to set on created file.
-// The file install.lock prevents the use of the migration process another time. You will have to delete it manually for
-// next upgrade.
+// The file install.lock prevents the use of the install and upgrade process another time. You will have to delete it manually for
+// next install process or create a upgrade.unlock for next upgrade.
// Default value: '0'
// Example: '444';
// $force_install_lockinstall='440';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 03dc1d964d6..25ca192e6fa 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -883,7 +883,7 @@ class Contact extends CommonObject
* @param int $id Id of contact
* @param User $user User asking to change alert or birthday
* @param int $notrigger 0=no, 1=yes
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function update_perso($id, $user = null, $notrigger = 0)
{
@@ -1178,7 +1178,7 @@ class Contact extends CommonObject
* ref_commande (for order and/or shipments)
* ref_propale
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function load_ref_elements()
{
@@ -1678,7 +1678,7 @@ class Contact extends CommonObject
* Change status of a user
*
* @param int $status Status to set
- * @return int <0 if KO, 0 if nothing is done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing is done, >0 if OK
*/
public function setstatus($status)
{
@@ -1758,7 +1758,7 @@ class Contact extends CommonObject
* Fetch roles (default contact of some companies) for the current contact.
* This load the array ->roles.
*
- * @return int <0 if KO, Nb of roles found if OK
+ * @return int Return integer <0 if KO, Nb of roles found if OK
* @see updateRoles()
*/
public function fetchRoles()
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 71370dbc04c..7c991630275 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -462,7 +462,7 @@ if (empty($reshook)) {
$tva_tx = GETPOST('tva_tx', 'alpha');
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
- $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef), 2) : 0);
+ $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef), '', 2) : 0);
if (empty($remise_percent)) {
$remise_percent = 0;
}
@@ -766,10 +766,9 @@ if (empty($reshook)) {
// TODO Use object->updateline instead objedtline->update
$price_ht = price2num(GETPOST('elprice'), 'MU');
- $remise_percent = price2num(GETPOST('elremise_percent'), 2);
+ $remise_percent = price2num(GETPOST('elremise_percent'), '', 2);
if ($remise_percent > 0) {
$remise = round(($price_ht * $remise_percent / 100), 2);
- $price_ht = ($price_ht - $remise);
}
$objectline->fk_product = GETPOST('idprod', 'int');
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index c0237c56693..08bb4caa932 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -680,7 +680,7 @@ class Contrat extends CommonObject
* @param string $ref_supplier Supplier ref
* @param int $noextrafields 0=Default to load extrafields, 1=No extrafields
* @param int $nolines 0=Default to load lines, 1=No lines
- * @return int <0 if KO, 0 if not found or if two records found for same ref, Id of contract if OK
+ * @return int Return integer <0 if KO, 0 if not found or if two records found for same ref, Id of contract if OK
*/
public function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '', $noextrafields = 0, $nolines = 0)
{
@@ -976,7 +976,7 @@ class Contrat extends CommonObject
* Create a contract into database
*
* @param User $user User that create
- * @return int <0 if KO, id of contract if OK
+ * @return int Return integer <0 if KO, id of contract if OK
*/
public function create($user)
{
@@ -1168,7 +1168,7 @@ class Contrat extends CommonObject
* Delete object
*
* @param User $user User that deletes
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
*/
public function delete($user)
{
@@ -2282,7 +2282,7 @@ class Contrat extends CommonObject
*
* @param User $user Objet user
* @param string $mode "inactive" pour services a activer, "expired" pour services expires
- * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
+ * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode)
{
@@ -2378,7 +2378,7 @@ class Contrat extends CommonObject
/**
* Charge indicateurs this->nb de tableau de bord
*
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function load_state_board()
{
@@ -2543,7 +2543,7 @@ class Contrat extends CommonObject
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
- * @return int < 0 if KO, 0 = no doc generated, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 = no doc generated, > 0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php
index e442a4fb1db..2e4c87c8e2b 100644
--- a/htdocs/core/boxes/box_external_rss.php
+++ b/htdocs/core/boxes/box_external_rss.php
@@ -160,9 +160,9 @@ class box_external_rss extends ModeleBoxes
$isutf8 = utf8_check($title);
if (!$isutf8 && $conf->file->character_set_client == 'UTF-8') {
- $title = utf8_encode($title);
+ $title = mb_convert_encoding($title, 'UTF-8', 'ISO-8859-1');
} elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') {
- $title = utf8_decode($title);
+ $title = mb_convert_encoding($title, 'ISO-8859-1');
}
$title = preg_replace("/([[:alnum:]])\?([[:alnum:]])/", "\\1'\\2", $title); // Gere probleme des apostrophes mal codee/decodee par utf8
@@ -173,9 +173,9 @@ class box_external_rss extends ModeleBoxes
$description = !empty($item['description']) ? $item['description'] : '';
$isutf8 = utf8_check($description);
if (!$isutf8 && $conf->file->character_set_client == 'UTF-8') {
- $description = utf8_encode($description);
+ $description = mb_convert_encoding($description, 'UTF-8', 'ISO-8859-1');
} elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') {
- $description = utf8_decode($description);
+ $description = mb_convert_encoding($description, 'ISO-8859-1');
}
$description = preg_replace("/([[:alnum:]])\?([[:alnum:]])/", "\\1'\\2", $description);
$description = preg_replace("/^\s+/", "", $description);
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 78c987a0905..ceb65e8cfa9 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -1242,7 +1242,7 @@ class CMailFile
* Read a file on disk and return encoded content for emails (mode = 'mail')
*
* @param string $sourcefile Path to file to encode
- * @return int|string <0 if KO, encoded string if OK
+ * @return int|string Return integer <0 if KO, encoded string if OK
*/
private function _encode_file($sourcefile)
{
@@ -1750,7 +1750,7 @@ class CMailFile
$_retVal = $socket;
}
} else {
- $this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : utf8_encode('Error '.$errno.' - '.$errstr);
+ $this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : mb_convert_encoding('Error '.$errno.' - '.$errstr, 'UTF-8', 'ISO-8859-1');
}
}
return $_retVal;
diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php
index f8391c7a512..5e81ef2cfec 100644
--- a/htdocs/core/class/antivir.class.php
+++ b/htdocs/core/class/antivir.class.php
@@ -66,7 +66,7 @@ class AntiVir
* Return also true (virus found) if file end with '.virus' (so we can make test safely).
*
* @param string $file File to scan
- * @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
+ * @return int Return integer <0 if KO (-98 if error, -99 if virus), 0 if OK
*/
public function dol_avscan_file($file)
{
diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php
index 4443e04dd38..3bae32d81e3 100644
--- a/htdocs/core/class/comment.class.php
+++ b/htdocs/core/class/comment.class.php
@@ -237,7 +237,7 @@ class Comment extends CommonObject
*
* @param User $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = 0)
{
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index da836b0f883..e211cd631d0 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -1232,7 +1232,7 @@ abstract class CommonDocGenerator
* @param float $curY curent Y position
* @param string $colKey the column key
* @param string $columnText column text
- * @return int <0 if KO, >= if OK
+ * @return int Return integer <0 if KO, >= if OK
*/
public function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{
@@ -1429,7 +1429,7 @@ abstract class CommonDocGenerator
$params = $params + $defaultParams;
/**
- * @var $extrafields ExtraFields
+ * @var ExtraFields $extrafields
*/
$html = '';
@@ -1658,7 +1658,7 @@ abstract class CommonDocGenerator
* @param object $object common object det
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function defineColumnExtrafield($object, $outputlangs, $hidedetails = 0)
{
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 33e46d0a15e..0f3b8628122 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -280,7 +280,7 @@ abstract class CommonInvoice extends CommonObject
* of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended).
*
* @param int $multicurrency Return multicurrency_amount instead of amount
- * @return float <0 and set ->error if KO, Sum of deposits amount otherwise
+ * @return float Return integer <0 and set ->error if KO, Sum of deposits amount otherwise
* @see getSommePaiement(), getSumCreditNotesUsed()
*/
public function getSumDepositsUsed($multicurrency = 0)
@@ -313,7 +313,7 @@ abstract class CommonInvoice extends CommonObject
* Return amount (with tax) of all credit notes invoices + excess received used by invoice
*
* @param int $multicurrency Return multicurrency_amount instead of amount
- * @return float <0 and set ->error if KO, Sum of credit notes and deposits amount otherwise
+ * @return float Return integer <0 and set ->error if KO, Sum of credit notes and deposits amount otherwise
* @see getSommePaiement(), getSumDepositsUsed()
*/
public function getSumCreditNotesUsed($multicurrency = 0)
@@ -340,7 +340,7 @@ abstract class CommonInvoice extends CommonObject
* Return amount (with tax) of all converted amount for this credit note
*
* @param int $multicurrency Return multicurrency_amount instead of amount
- * @return float <0 if KO, Sum of credit notes and deposits amount otherwise
+ * @return float Return integer <0 if KO, Sum of credit notes and deposits amount otherwise
*/
public function getSumFromThisCreditNotesNotUsed($multicurrency = 0)
{
@@ -388,7 +388,7 @@ abstract class CommonInvoice extends CommonObject
* Returns the id of the invoice that replaces it
*
* @param string $option status filter ('', 'validated', ...)
- * @return int <0 si KO, 0 if no invoice replaces it, id of invoice otherwise
+ * @return int Return integer <0 si KO, 0 if no invoice replaces it, id of invoice otherwise
*/
public function getIdReplacingInvoice($option = '')
{
@@ -534,7 +534,7 @@ abstract class CommonInvoice extends CommonObject
* If there is payment -> no (-4)
* Otherwise -> yes (2)
*
- * @return int <=0 if no, >0 if yes
+ * @return int Return integer <=0 if no, >0 if yes
*/
public function is_erasable()
{
@@ -595,7 +595,7 @@ abstract class CommonInvoice extends CommonObject
/**
* Return if an invoice was dispatched into bookkeeping
*
- * @return int <0 if KO, 0=no, 1=yes
+ * @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{
@@ -954,7 +954,7 @@ abstract class CommonInvoice extends CommonObject
* @param string $type 'direct-debit' or 'bank-transfer'
* @param string $sourcetype Source ('facture' or 'supplier_invoice')
* @param int $checkduplicateamongall 0=Default (check among open requests only to find if request already exists). 1=Check also among requests completely processed and cancel if at least 1 request exists whatever is its status.
- * @return int <0 if KO, 0 if a request already exists, >0 if OK
+ * @return int Return integer <0 if KO, 0 if a request already exists, >0 if OK
*/
public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture', $checkduplicateamongall = 0)
{
@@ -1613,7 +1613,7 @@ abstract class CommonInvoice extends CommonObject
*
* @param User $fuser User making delete
* @param int $did ID of request to delete
- * @return int <0 if OK, >0 if KO
+ * @return int Return integer <0 if OK, >0 if KO
*/
public function demande_prelevement_delete($fuser, $did)
{
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f517cb73cb6..fdc1fc4bf6a 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -769,7 +769,7 @@ abstract class CommonObject
* @param int $id Id of object
* @param string $ref Ref of object to check
* @param string $ref_ext Ref ext of object to check
- * @return int <0 if KO, 0 if OK but not found, >0 if OK and exists
+ * @return int Return integer <0 if KO, 0 if OK but not found, >0 if OK and exists
*/
public static function isExistingObject($element, $id, $ref = '', $ref_ext = '')
{
@@ -1091,7 +1091,7 @@ abstract class CommonObject
* @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL
* @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
* @param int $notrigger Disable all triggers
- * @return int <0 if KO, 0 if already added or code not valid, >0 if OK
+ * @return int Return integer <0 if KO, 0 if already added or code not valid, >0 if OK
*/
public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0)
{
@@ -1221,7 +1221,7 @@ abstract class CommonObject
* @param int $statut New status of link
* @param int $type_contact_id Id of contact type (not modified if 0)
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
- * @return int <0 if KO, >= 0 if OK
+ * @return int Return integer <0 if KO, >= 0 if OK
*/
public function update_contact($rowid, $statut, $type_contact_id = 0, $fk_socpeople = 0)
{
@@ -1301,7 +1301,7 @@ abstract class CommonObject
*
* @param string $source '' or 'internal' or 'external'
* @param string $code Type of contact (code or id)
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function delete_linked_contact($source = '', $code = '')
{
@@ -1446,7 +1446,7 @@ abstract class CommonObject
* Update status of a contact linked to object
*
* @param int $rowid Id of link between object and contact
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function swapContactStatus($rowid)
{
@@ -1804,7 +1804,7 @@ abstract class CommonObject
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
* if it is not defined, ->element must be defined to know default barcode type.
*
- * @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
+ * @return int Return integer <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
*/
public function fetch_barcode()
{
@@ -1851,7 +1851,7 @@ abstract class CommonObject
/**
* Load the project with id $this->fk_project into this->project
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_project()
{
@@ -1863,7 +1863,7 @@ abstract class CommonObject
/**
* Load the project with id $this->fk_project into this->project
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_projet()
{
@@ -1889,7 +1889,7 @@ abstract class CommonObject
/**
* Load the product with id $this->fk_product into this->product
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_product()
{
@@ -2893,7 +2893,7 @@ abstract class CommonObject
* @deprecated
*
* @param int $id Address id
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function setDeliveryAddress($id)
{
@@ -3912,7 +3912,7 @@ abstract class CommonObject
* @param int $origin_id Linked element id
* @param User $f_user User that create
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
* @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked()
*/
public function add_object_linked($origin = null, $origin_id = null, $f_user = null, $notrigger = 0)
@@ -4474,7 +4474,7 @@ abstract class CommonObject
* @param int $fk_object_where id of object we need to remove linked items
* @param string $field_where name of field of object we need to delete linked items
* @param string $table_element name of association table
- * @return int <0 if KO, 0 if nothing done, >0 if OK and something done
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK and something done
*/
public static function deleteAllItemsLinkedByObjectID($fk_object_where, $field_where, $table_element)
{
@@ -4629,7 +4629,7 @@ abstract class CommonObject
*
* @param int $id Record id
* @param string $ref Record ref
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function getCanvas($id = 0, $ref = '')
{
@@ -4696,7 +4696,7 @@ abstract class CommonObject
*
* @param int $id Force id of object
* @param int $entity Force entity to check
- * @return int <0 if KO, 0 if not used, >0 if already used
+ * @return int Return integer <0 if KO, 0 if not used, >0 if already used
*/
public function isObjectUsed($id = 0, $entity = 0)
{
@@ -4781,7 +4781,7 @@ abstract class CommonObject
* Function to say how many lines object contains
*
* @param int $predefined -1=All, 0=Count free product/service only, 1=Count predefined product/service only, 2=Count predefined product, 3=Count predefined service
- * @return int <0 if KO, 0 if no predefined products, nb of lines with predefined products if found
+ * @return int Return integer <0 if KO, 0 if no predefined products, nb of lines with predefined products if found
*/
public function hasProductsOrServices($predefined = -1)
{
@@ -5461,7 +5461,7 @@ abstract class CommonObject
* @param string $resource_type 'resource'
* @param int $busy Busy or not
* @param int $mandatory Mandatory or not
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
public function add_element_resource($resource_id, $resource_type, $busy = 0, $mandatory = 0)
{
@@ -6017,7 +6017,7 @@ abstract class CommonObject
* Function to get alternative languages of a data into $this->array_languages
* This method is NOT called by method fetch of objects but must be called separately.
*
- * @return int <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded
+ * @return int Return integer <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded
* @see fetch_optionnals()
*/
public function fetchValuesForExtraLanguages()
@@ -6195,7 +6195,7 @@ abstract class CommonObject
*
* @param int $rowid Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters.
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
- * @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
+ * @return int Return integer <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
* @see fetchValuesForExtraLanguages()
*/
public function fetch_optionals($rowid = null, $optionsArray = null)
@@ -8926,7 +8926,7 @@ abstract class CommonObject
* @param float $unitPrice Product unit price
* @param float $discountPercent Line discount percent
* @param int $fk_product Product id
- * @return float <0 if KO, buyprice if OK
+ * @return float Return integer <0 if KO, buyprice if OK
*/
public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0)
{
@@ -9975,7 +9975,7 @@ abstract class CommonObject
* @param User $user User that deletes
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @param int $forcechilddeletion 0=no, 1=Force deletion of children
- * @return int <0 if KO, 0=Nothing done because object has child, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done because object has child, >0 if OK
*/
public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0)
{
@@ -10500,7 +10500,7 @@ abstract class CommonObject
* @param int $fromId Id object source
* @param int $toId Id object cible
* @param string $type Type of category ('product', ...)
- * @return int < 0 if error, > 0 if ok
+ * @return int Return integer < 0 if error, > 0 if ok
*/
public function cloneCategories($fromId, $toId, $type = '')
{
diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php
index 91c3800432a..9f53c4ada61 100644
--- a/htdocs/core/class/commonobjectline.class.php
+++ b/htdocs/core/class/commonobjectline.class.php
@@ -154,7 +154,7 @@ abstract class CommonObjectLine extends CommonObject
* A langs->trans() must be called on result to get translated value.
*
* @param string $type Label type ('long', 'short' or 'code'). This can be a translation key.
- * @return string|int <0 if KO, label if OK (Example: 'long', 'short' or 'unitCODE')
+ * @return string|int Return integer <0 if KO, label if OK (Example: 'long', 'short' or 'unitCODE')
*/
public function getLabelOfUnit($type = 'long')
{
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index e266288b528..92afb54af52 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -235,7 +235,7 @@ class Conf extends stdClass
*
* @param DoliDB $db Database handler
* @param int $entity Entity to get
- * @return int < 0 if KO, >= 0 if OK
+ * @return int Return integer < 0 if KO, >= 0 if OK
*/
public function setEntityValues($db, $entity)
{
@@ -253,7 +253,7 @@ class Conf extends stdClass
* Note that this->db->xxx, this->file->xxx have been already set when setValues is called.
*
* @param DoliDB $db Database handler
- * @return int < 0 if KO, >= 0 if OK
+ * @return int Return integer < 0 if KO, >= 0 if OK
*/
public function setValues($db)
{
diff --git a/htdocs/core/class/cproductnature.class.php b/htdocs/core/class/cproductnature.class.php
index 28645210a19..7022de50ba1 100644
--- a/htdocs/core/class/cproductnature.class.php
+++ b/htdocs/core/class/cproductnature.class.php
@@ -294,7 +294,7 @@ class CProductNature extends CommonDict
* Get unit from code
* @param int $code code of unit
* @param string $mode 0= id , short_label=Use short label as value, code=use code
- * @return int <0 if KO, Id of code if OK
+ * @return int Return integer <0 if KO, Id of code if OK
*/
public function getProductNatureFromCode($code, $mode = 'code')
{
diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php
index 8bd7baac30b..4c7f1246587 100644
--- a/htdocs/core/class/cunits.class.php
+++ b/htdocs/core/class/cunits.class.php
@@ -402,7 +402,7 @@ class CUnits extends CommonDict
* @param string $code code of unit
* @param string $mode 0= id , short_label=Use short label as value, code=use code
* @param string $unit_type weight,size,surface,volume,qty,time...
- * @return int <0 if KO, Id of code if OK
+ * @return int Return integer <0 if KO, Id of code if OK
*/
public function getUnitFromCode($code, $mode = 'code', $unit_type = '')
{
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index 1a960c5c3eb..f92ce30e087 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -148,7 +148,7 @@ class DiscountAbsolute
* @param int $rowid id discount to load
* @param int $fk_facture_source fk_facture_source
* @param int $fk_invoice_supplier_source fk_invoice_supplier_source
- * @return int <0 if KO, =0 if not found, >0 if OK
+ * @return int Return integer <0 if KO, =0 if not found, >0 if OK
*/
public function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0)
{
@@ -530,7 +530,7 @@ class DiscountAbsolute
* @param int $maxvalue Filter on max value for discount
* @param int $discount_type 0 => customer discount, 1 => supplier discount
* @param int $multicurrency Return multicurrency_amount instead of amount
- * @return int <0 if KO, amount otherwise
+ * @return int Return integer <0 if KO, amount otherwise
*/
public function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0, $multicurrency = 0)
{
@@ -584,7 +584,7 @@ class DiscountAbsolute
*
* @param CommonInvoice $invoice Object invoice (customer of supplier)
* @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount
- * @return int <0 if KO, Sum of credit notes and deposits amount otherwise
+ * @return int Return integer <0 if KO, Sum of credit notes and deposits amount otherwise
*/
public function getSumDepositsUsed($invoice, $multicurrency = 0)
{
@@ -625,7 +625,7 @@ class DiscountAbsolute
*
* @param CommonInvoice $invoice Object invoice
* @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount
- * @return int <0 if KO, Sum of credit notes and excess received amount otherwise
+ * @return int Return integer <0 if KO, Sum of credit notes and excess received amount otherwise
*/
public function getSumCreditNotesUsed($invoice, $multicurrency = 0)
{
@@ -665,7 +665,7 @@ class DiscountAbsolute
*
* @param CommonInvoice $invoice Object invoice
* @param int $multicurrency Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount
- * @return int <0 if KO, Sum of credit notes and deposits amount otherwise
+ * @return int Return integer <0 if KO, Sum of credit notes and deposits amount otherwise
*/
public function getSumFromThisCreditNotesNotUsed($invoice, $multicurrency = 0)
{
diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php
index 110d84ede85..9e347343982 100644
--- a/htdocs/core/class/emailsenderprofile.class.php
+++ b/htdocs/core/class/emailsenderprofile.class.php
@@ -97,7 +97,7 @@ class EmailSenderProfile extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
- 'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
+ 'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
'signature' => array('type'=>'html', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 883d8e296ce..ec4f72027be 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -135,7 +135,7 @@ class ExtraFields
* @param int $totalizable Is a measure. Must show a total on lists
* @param int $printable Is extrafield displayed on PDF
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...)
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
{
@@ -197,7 +197,7 @@ class ExtraFields
* @param string $computed Computed value
* @param string $help Help on tooltip
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '', $help = '', $moreparams = array())
{
@@ -300,7 +300,7 @@ class ExtraFields
* @param int $totalizable Is a measure. Must show a total on lists
* @param int $printable Is extrafield displayed on PDF
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
* @throws Exception
*/
private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
@@ -433,7 +433,7 @@ class ExtraFields
*
* @param string $attrname Code of attribute to delete
* @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...)
- * @return int < 0 if KO, 0 if nothing is done, 1 if OK
+ * @return int Return integer < 0 if KO, 0 if nothing is done, 1 if OK
*/
public function delete($attrname, $elementtype = 'member')
{
@@ -491,7 +491,7 @@ class ExtraFields
*
* @param string $attrname Code of attribute to delete
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
- * @return int < 0 if KO, 0 if nothing is done, 1 if OK
+ * @return int Return integer < 0 if KO, 0 if nothing is done, 1 if OK
*/
private function delete_label($attrname, $elementtype = 'member')
{
@@ -673,7 +673,7 @@ class ExtraFields
* @param int $totalizable Is extrafield totalizable on list
* @param int $printable Is extrafield displayed on PDF
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
* @throws Exception
*/
private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 2860d2c2bfe..1686336db60 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1730,7 +1730,7 @@ class Form
* @param bool $options_only Return options only (for ajax treatment)
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
* @param string $htmlid Html id to use instead of htmlname
- * @return int <0 if KO, Nb of contact in list if OK
+ * @return int Return integer <0 if KO, Nb of contact in list if OK
* @deprecated You can use selectcontacts directly (warning order of param was changed)
*/
public function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '')
@@ -1762,7 +1762,7 @@ class Form
* @param string $htmlid Html id to use instead of htmlname
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @param integer $disableifempty Set tag 'disabled' on select if there is no choice
- * @return int|string <0 if KO, HTML with select string if OK.
+ * @return int|string Return integer <0 if KO, HTML with select string if OK.
*/
public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0)
{
@@ -4880,7 +4880,7 @@ class Form
* @param int $showcurrency Show currency in label
* @param string $morecss More CSS
* @param int $nooutput 1=Return string, do not send to output
- * @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...)
+ * @return int Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...)
*/
public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0)
{
@@ -4963,7 +4963,7 @@ class Form
* @param string $filtre To filter list. This parameter must not come from input of users
* @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, ...)
+ * @return int Return integer <0 if error, Num of establishment found if OK (0, 1, 2, ...)
*/
public function selectEstablishments($selected = '', $htmlname = 'entity', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '')
{
@@ -8995,7 +8995,7 @@ class Form
* @param string $morehtmlright More html to show on right of title
* @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action
* @param string $title Title
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false, $title = 'RelatedObjects')
{
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index b4d37581ab2..52e4e3fba31 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -167,7 +167,7 @@ class FormActions
* @param string $moreparambacktopage More param for the backtopage
* @param string $morehtmlcenter More html text on center of title line
* @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions)
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0)
{
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 47d1045b50a..725a0f82c94 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -1155,7 +1155,7 @@ class FormCompany extends Form
* @param string $mode select if we want activate de html part or js
* @return void
*/
- public function selectProspectStatus($htmlname, Societe $prospectstatic, $statusprospect, $idprospect, $mode = "html")
+ public function selectProspectStatus($htmlname, $prospectstatic, $statusprospect, $idprospect, $mode = "html")
{
global $langs;
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 12489481a43..3f5172c3e91 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -296,7 +296,7 @@ class FormFile
* @param string $title Title to show on top of form
* @param string $buttonlabel Label on submit button
* @param string $codelang Default language code to use on lang combo box if multilang is enabled
- * @return int <0 if KO, number of shown files if OK
+ * @return int Return integer <0 if KO, number of shown files if OK
* @deprecated Use print xxx->showdocuments() instead.
*/
public function show_documents($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '')
@@ -1185,7 +1185,7 @@ class FormFile
* @param int $addfilterfields Add the line with filters
* @param int $disablecrop Disable crop feature on images (-1 = auto, prefer to set it explicitely to 0 or 1)
* @param string $moreattrondiv More attributes on the div for responsive. Example 'style="height:280px; overflow: auto;"'
- * @return int <0 if KO, nb of files shown if OK
+ * @return int Return integer <0 if KO, nb of files shown if OK
* @see list_of_autoecmfiles()
*/
public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1, $moreattrondiv = '')
@@ -1643,7 +1643,7 @@ class FormFile
* @param int $maxlength Maximum length of file name shown
* @param string $url Full url to use for click links ('' = autodetect)
* @param int $addfilterfields Add line with filters
- * @return int <0 if KO, nb of files shown if OK
+ * @return int Return integer <0 if KO, nb of files shown if OK
* @see list_of_documents()
*/
public function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permissiontodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0)
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index de2086b3b2d..59effb1deac 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -1521,7 +1521,7 @@ class FormMail extends Form
* @param string $type_template Get message for key module
* @param User $user Use template public or limited to this user
* @param Translate $outputlangs Output lang object
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
*/
public function isEMailTemplate($type_template, $user, $outputlangs)
{
@@ -1555,7 +1555,7 @@ class FormMail extends Form
* @param User $user Use template public or limited to this user
* @param Translate $outputlangs Output lang object
* @param int $active 1=Only active template, 0=Only disabled, -1=All
- * @return int <0 if KO, nb of records found if OK
+ * @return int Return integer <0 if KO, nb of records found if OK
*/
public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active = 1)
{
diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php
index 606a6640995..ce35998f647 100644
--- a/htdocs/core/class/infobox.class.php
+++ b/htdocs/core/class/infobox.class.php
@@ -219,7 +219,7 @@ class InfoBox
* @param int $zone Name of area (0 for Homepage, ...)
* @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...'
* @param int $userid Id of user
- * @return int <0 if KO, 0=Nothing done, > 0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, > 0 if OK
*/
public static function saveboxorder($dbs, $zone, $boxorder, $userid = 0)
{
diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php
index 1bcb9f9d935..50f10df1729 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -260,7 +260,7 @@ class Ldap
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
* After return, this->connection and $this->bind are defined
*
- * @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
+ * @return int Return integer <0 if KO, 1 if bind anonymous, 2 if bind auth
*/
public function connect_bind()
{
@@ -1007,7 +1007,7 @@ class Ldap
*
* @param string $dn DN entry key
* @param string $filter Filter
- * @return int|array <0 or false if KO, array if OK
+ * @return int|array Return integer <0 or false if KO, array if OK
*/
public function getAttribute($dn, $filter)
{
@@ -1511,10 +1511,10 @@ class Ldap
{
global $conf;
if ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') {
- $str = utf8_encode($str);
+ $str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
if ($pagecodefrom == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') {
- $str = utf8_decode($str);
+ $str = mb_convert_encoding($str, 'ISO-8859-1');
}
return $str;
}
@@ -1530,10 +1530,10 @@ class Ldap
{
global $conf;
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') {
- $str = utf8_decode($str);
+ $str = mb_convert_encoding($str, 'ISO-8859-1');
}
if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') {
- $str = utf8_encode($str);
+ $str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
return $str;
}
diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php
index 526e94c55d2..a3e6398a00a 100644
--- a/htdocs/core/class/lessc.class.php
+++ b/htdocs/core/class/lessc.class.php
@@ -1,6 +1,7 @@
compileValue($this->reduce($q[2])).")";
+ $this->compileValue($this->reduce($q[2])).")";
} else {
$parts[] = "($q[1])";
}
@@ -432,7 +434,7 @@ class Lessc
{
if (is_null($env) ||
!empty($env->block->type) && $env->block->type != "media"
- ) {
+ ) {
return $childQueries;
}
@@ -714,7 +716,7 @@ class Lessc
$value = $a[2];
} else {
$value = null; // :(
- $this->throwError("Failed to assign arg ".$a[1]); // This end function by throwing an exception
+ $this->throwError("Failed to assign arg ".$a[1]); // This ends function by throwing an exception
}
$value = $this->reduce($value);
@@ -728,7 +730,7 @@ class Lessc
// check for a rest
$last = end($args);
- if ($last[0] == "rest") {
+ if ($last && $last[0] == "rest") {
$rest = array_slice($orderedValues, count($args) - 1);
$this->set($last[1], $this->reduce(array("list", " ", $rest)));
}
@@ -765,6 +767,7 @@ class Lessc
$orderedArgs = array();
$keywordArgs = array();
foreach ((array) $args as $arg) {
+ $argval = null;
switch ($arg[0]) {
case "arg":
if (!isset($arg[2])) {
@@ -817,11 +820,11 @@ class Lessc
$subProp[0] == "assign" &&
is_string($subProp[1]) &&
$subProp[1][0] != $this->vPrefix
- ) {
+ ) {
$subProp[2] = array(
- 'list', ' ',
- array($subProp[2], array('keyword', $suffix))
- );
+ 'list', ' ',
+ array($subProp[2], array('keyword', $suffix))
+ );
}
$this->compileProp($subProp, $mixin, $out);
@@ -859,7 +862,7 @@ class Lessc
$result = $this->tryImport($importPath, $block, $out);
$this->env->imports[$importId] = $result === false ?
- array(false, "@import ".$this->compileValue($importPath).";") : $result;
+ array(false, "@import ".$this->compileValue($importPath).";") : $result;
break;
case "import_mixin":
@@ -876,7 +879,7 @@ class Lessc
break;
default:
- $this->throwError("unknown op: $prop[0]\n");
+ $this->throwError("unknown op: {$prop[0]}\n");
}
}
@@ -1128,7 +1131,7 @@ class Lessc
if (isset($items[0])) {
return $this->lib_e($items[0]);
}
- $this->throwError("unrecognised input"); // This end function by throwing an exception
+ $this->throwError("unrecognised input"); // This ends function by throwing an exception
// no break
case "string":
$arg[1] = "";
@@ -1154,7 +1157,7 @@ class Lessc
if (preg_match_all('/%[dsa]/', $template, $m)) {
foreach ($m[0] as $match) {
$val = isset($values[$i]) ?
- $this->reduce($values[$i]) : array('keyword', '');
+ $this->reduce($values[$i]) : array('keyword', '');
// lessjs compat, renders fully expanded color, not raw color
if ($color = $this->coerceColor($val)) {
@@ -1387,7 +1390,7 @@ class Lessc
* mix(@color1, @color2, [@weight: 50%]);
* http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method
*
- * @param array $args Args
+ * @param array $args Args
* @return array
*/
protected function lib_mix($args)
@@ -1431,7 +1434,7 @@ class Lessc
/**
* lib_contrast
*
- * @param array $args Args
+ * @param array $args Args
* @return array
*/
protected function lib_contrast($args)
@@ -1520,7 +1523,7 @@ class Lessc
$name = $name.": ";
}
- $this->throwError("${name}expecting $expectedArgs arguments, got $numValues");
+ $this->throwError("{$name}expecting $expectedArgs arguments, got $numValues");
}
return $values;
@@ -1610,7 +1613,7 @@ class Lessc
$r = $g = $b = $L;
} else {
$temp2 = $L < 0.5 ?
- $L * (1.0 + $S) : $L + $S - $L * $S;
+ $L * (1.0 + $S) : $L + $S - $L * $S;
$temp1 = 2.0 * $L - $temp2;
@@ -1669,6 +1672,7 @@ class Lessc
$hsl[] = 0;
}
return $this->toRGB($hsl);
+
} elseif ($fname == 'rgb' || $fname == 'rgba') {
$components = array();
$i = 1;
@@ -1769,7 +1773,7 @@ class Lessc
}
$f = isset($this->libFunctions[$name]) ?
- $this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name));
+ $this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name));
if (is_callable($f)) {
if ($args[0] == 'list') {
@@ -1842,10 +1846,10 @@ class Lessc
$width = strlen($colorStr) == 3 ? 16 : 256;
for ($i = 3; $i > 0; $i--) { // 3 2 1
- $t = $num % $width;
+ $t = intval($num) % $width;
$num /= $width;
- $c[$i] = $t * (256 / $width) + $t * floor(16 / $width);
+ $c[$i] = $t * (256 / $width) + $t * floor(16/$width);
}
return $c;
@@ -1923,7 +1927,7 @@ class Lessc
}
// type based operators
- $fname = "op_".$ltype."_".$rtype;
+ $fname = "op_{$ltype}_{$rtype}";
if (is_callable(array($this, $fname))) {
$out = $this->$fname($op, $left, $right);
if (!is_null($out)) {
@@ -1957,7 +1961,6 @@ class Lessc
array_unshift($strRight[2], $left);
return $strRight;
}
-
return '';
}
@@ -1982,7 +1985,6 @@ class Lessc
if ($op == '+' || $op == '*') {
return $this->op_color_number($op, $rgt, $lft);
}
-
return array();
}
@@ -2160,7 +2162,7 @@ class Lessc
}
$current = isset($current->storeParent) ?
- $current->storeParent : $current->parent;
+ $current->storeParent : $current->parent;
}
$this->throwError("variable $name is undefined");
@@ -2638,7 +2640,7 @@ class lessc_parser
// these properties will supress division unless it's inside parenthases
protected static $supressDivisionProps =
- array('/border-radius$/i', '/^font$/i');
+ array('/border-radius$/i', '/^font$/i');
protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document", "viewport", "-moz-viewport", "-o-viewport", "-ms-viewport");
protected $lineDirectives = array("charset");
@@ -2682,10 +2684,10 @@ class lessc_parser
if (!self::$operatorString) {
self::$operatorString =
- '('.implode('|', array_map(
- array('lessc', 'preg_quote'),
- array_keys(self::$precedence)
- )).')';
+ '('.implode('|', array_map(
+ array('lessc', 'preg_quote'),
+ array_keys(self::$precedence)
+ )).')';
$commentSingle = Lessc::preg_quote(self::$commentSingle);
$commentMultiLeft = Lessc::preg_quote(self::$commentMultiLeft);
@@ -2699,7 +2701,7 @@ class lessc_parser
/**
* Parse a string
*
- * @param string $buffer String to parse
+ * @param string $buffer String to parse
* @throws exception
* @return NULL|stdclass
*/
@@ -2726,6 +2728,7 @@ class lessc_parser
if ($this->count != strlen($this->buffer)) {
$this->throwError('parse error count '.$this->count.' != len buffer '.strlen($this->buffer));
+
}
// TODO report where the block was opened
@@ -2748,7 +2751,7 @@ class lessc_parser
* functions represent discrete grammatical rules for the language, and
* they are able to capture the text that represents those rules.
*
- * Consider the function lessc::keyword(). (all parse functions are
+ * Consider the function Lessc::keyword(). (all parse functions are
* structured the same)
*
* The function takes a single reference argument. When calling the
@@ -2757,7 +2760,7 @@ class lessc_parser
* argument, advance the position in the buffer, and return true. If it
* fails then it won't advance the buffer and it will return false.
*
- * All of these parse functions are powered by lessc::match(), which behaves
+ * All of these parse functions are powered by Lessc::match(), which behaves
* the same way, but takes a literal regular expression. Sometimes it is
* more convenient to use match instead of creating a new function.
*
@@ -2766,7 +2769,7 @@ class lessc_parser
*
* But, if some of the rules in the chain succeed before one fails, then
* the buffer position will be left at an invalid state. In order to
- * avoid this, lessc::seek() is used to remember and set buffer positions.
+ * avoid this, Lessc::seek() is used to remember and set buffer positions.
*
* Before parsing a chain, use $s = $this->seek() to remember the current
* position into $s. Then if a chain fails, use $this->seek($s) to
@@ -2801,7 +2804,7 @@ class lessc_parser
// setting a property
if ($this->keyword($key) && $this->assign() &&
$this->propertyValue($value, $key) && $this->end()
- ) {
+ ) {
$this->append(array('assign', $key, $value), $s);
return true;
} else {
@@ -2817,7 +2820,7 @@ class lessc_parser
if ($this->literal('@media')) {
if ($this->mediaQueryList($mediaQueries)
&& $this->literal('{')
- ) {
+ ) {
$media = $this->pushSpecialBlock("media");
$media->queries = is_null($mediaQueries) ? array() : $mediaQueries;
return true;
@@ -2831,7 +2834,7 @@ class lessc_parser
if ($this->isDirective($dirName, $this->blockDirectives)) {
if ($this->openString("{", $dirValue, null, array(";")) &&
$this->literal("{")
- ) {
+ ) {
$dir = $this->pushSpecialBlock("directive");
$dir->name = $dirName;
if (isset($dirValue)) {
@@ -2852,8 +2855,8 @@ class lessc_parser
// setting a variable
if ($this->variable($var) && $this->assign() &&
- $this->propertyValue($value) && $this->end()
- ) {
+ $this->propertyValue($value) && $this->end()
+ ) {
$this->append(array('assign', $var, $value), $s);
return true;
} else {
@@ -2867,9 +2870,9 @@ class lessc_parser
// opening parametric mixin
if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) &&
- $this->guards($guards) &&
- $this->literal('{')
- ) {
+ $this->guards($guards) &&
+ $this->literal('{')
+ ) {
$block = $this->pushBlock($this->fixTags(array($tag)));
$block->args = $args;
$block->isVararg = $isVararg;
@@ -2930,9 +2933,9 @@ class lessc_parser
// mixin
if ($this->mixinTags($tags) &&
- $this->argumentDef($argv, $isVararg) &&
- $this->keyword($suffix) && $this->end()
- ) {
+ $this->argumentDef($argv, $isVararg) &&
+ $this->keyword($suffix) && $this->end()
+ ) {
$tags = $this->fixTags($tags);
$this->append(array('mixin', $tags, $argv, $suffix), $s);
return true;
@@ -3032,7 +3035,7 @@ class lessc_parser
while (true) {
$whiteBefore = isset($this->buffer[$this->count - 1]) &&
- ctype_space($this->buffer[$this->count - 1]);
+ ctype_space($this->buffer[$this->count - 1]);
// If there is whitespace before the operator, then we require
// whitespace after the operator for it to be an expression
@@ -3051,7 +3054,7 @@ class lessc_parser
$whiteAfter = isset($this->buffer[$this->count - 1]) &&
- ctype_space($this->buffer[$this->count - 1]);
+ ctype_space($this->buffer[$this->count - 1]);
if (!$this->value($rhs)) {
break;
@@ -3126,7 +3129,7 @@ class lessc_parser
if ($this->literal("(") &&
($this->inParens = true) && $this->expression($exp) &&
$this->literal(")")
- ) {
+ ) {
$out = $exp;
$this->inParens = $inParens;
return true;
@@ -3153,9 +3156,9 @@ class lessc_parser
// negation
if ($this->literal("-", false) &&
(($this->variable($inner) && $inner = array("variable", $inner)) ||
- $this->unit($inner) ||
- $this->parenValue($inner))
- ) {
+ $this->unit($inner) ||
+ $this->parenValue($inner))
+ ) {
$value = array("unary", "-", $inner);
return true;
} else {
@@ -3293,7 +3296,7 @@ class lessc_parser
$this->keyword($feature) &&
($this->literal(":") && $this->expression($value)) &&
$this->literal(")")
- ) {
+ ) {
$out = array("mediaExp", $feature);
if ($value) {
$out[] = $value;
@@ -3449,7 +3452,7 @@ class lessc_parser
if ($this->literal("@{") &&
$this->openString("}", $interp, null, array("'", '"', ";")) &&
$this->literal("}", false)
- ) {
+ ) {
$out = array("interpolate", $interp);
$this->eatWhiteDefault = $oldWhite;
if ($this->eatWhiteDefault) {
@@ -3586,6 +3589,7 @@ class lessc_parser
$newArg = array("lit", $newList);
break;
}
+
} elseif ($values) { // 1 item
$newArg = $values[0];
}
@@ -3745,7 +3749,7 @@ class lessc_parser
$this->eatWhiteDefault = false;
while (true) {
- $m =array();
+ $m = array();
if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) {
$parts[] = $m[1];
if ($simple) {
@@ -3855,7 +3859,7 @@ class lessc_parser
$s = $this->seek();
if ($this->literal($this->lessc->vPrefix, false) &&
($this->variable($sub) || $this->keyword($name))
- ) {
+ ) {
if (!empty($sub)) {
$name = array('variable', $sub);
} else {
@@ -3991,7 +3995,7 @@ class lessc_parser
$this->count++;
return true;
}
- // goes below...
+ // goes below...
} else {
return false;
}
@@ -4064,7 +4068,7 @@ class lessc_parser
}
$r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais';
- if (preg_match($r, $this->buffer, $out, null, $this->count)) {
+ if (preg_match($r, $this->buffer, $out, 0, $this->count)) {
$this->count += strlen($out[0]);
if ($eatWhitespace && $this->writeComments) {
$this->whitespace();
@@ -4080,7 +4084,7 @@ class lessc_parser
if ($this->writeComments) {
$gotWhite = false;
$m = array();
- while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) {
+ while (preg_match(self::$whitePattern, $this->buffer, $m, 0, $this->count)) {
if (isset($m[1]) && empty($this->seenComments[$this->count])) {
$this->append(array("comment", $m[1]));
$this->seenComments[$this->count] = true;
@@ -4102,7 +4106,7 @@ class lessc_parser
$from = $this->count;
}
$r = '/'.$regex.'/Ais';
- $result = preg_match($r, $this->buffer, $out, null, $from);
+ $result = preg_match($r, $this->buffer, $out, 0, $from);
return $result;
}
@@ -4125,7 +4129,7 @@ class lessc_parser
$count = is_null($count) ? $this->count : $count;
$line = $this->line +
- substr_count(substr($this->buffer, 0, $count), "\n");
+ substr_count(substr($this->buffer, 0, $count), "\n");
if (!empty($this->sourceName)) {
$loc = "$this->sourceName on line $line";
@@ -4220,6 +4224,7 @@ class lessc_parser
break;
case '"':
case "'":
+ $m = array();
if (preg_match('/'.$min[0].'.*?(?indentStr();
$isSingle = !$this->disableSingle &&
- is_null($block->type) && count($block->lines) == 1;
+ is_null($block->type) && count($block->lines) == 1;
if (!empty($block->selectors)) {
$this->indentLevel++;
@@ -4324,7 +4329,7 @@ class lessc_formatter_classic
}
echo $pre.
- implode($selectorSeparator, $block->selectors);
+ implode($selectorSeparator, $block->selectors);
if ($isSingle) {
echo $this->openSingle;
$inner = "";
@@ -4363,7 +4368,7 @@ class lessc_formatter_classic
}
/**
- * Class for compressed result
+ * Class for compressed result
*/
class lessc_formatter_compressed extends lessc_formatter_classic
{
@@ -4381,7 +4386,7 @@ class lessc_formatter_compressed extends lessc_formatter_classic
}
/**
- * Class for lessjs
+ * Class for lessjs
*/
class lessc_formatter_lessjs extends lessc_formatter_classic
{
diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php
index 239c527ec53..bcf8d437fae 100644
--- a/htdocs/core/class/link.class.php
+++ b/htdocs/core/class/link.class.php
@@ -147,7 +147,7 @@ class Link extends CommonObject
*
* @param User $user User executing update
* @param int $call_trigger 0=no, 1=yes
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function update($user = '', $call_trigger = 1)
{
@@ -346,7 +346,7 @@ class Link extends CommonObject
* Delete a link from database
*
* @param User $user Object suer
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function delete($user)
{
diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php
index fd010ed944e..08d110637cd 100644
--- a/htdocs/core/class/menubase.class.php
+++ b/htdocs/core/class/menubase.class.php
@@ -179,7 +179,7 @@ class Menubase
* Create menu entry into database
*
* @param User $user User that create
- * @return int <0 if KO, Id of record if OK
+ * @return int Return integer <0 if KO, Id of record if OK
*/
public function create($user = null)
{
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 1223c4c60c2..e60bd5919ff 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -188,7 +188,7 @@ class Notify
* @param Object $object Object the notification is about (need it to check threshold value of some notifications)
* @param int $userid Id of user or 0 for all users or -1 for no users
* @param array $scope Scope where to search
- * @return array|int <0 if KO, array of notifications to send if OK
+ * @return array|int Return integer <0 if KO, array of notifications to send if OK
*/
public function getNotificationsArray($notifcode, $socid = 0, $object = null, $userid = 0, $scope = array('thirdparty', 'user', 'global'))
{
@@ -352,7 +352,7 @@ class Notify
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
- * @return int <0 if KO, or number of changes if OK
+ * @return int Return integer <0 if KO, or number of changes if OK
*/
public function send($notifcode, $object, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array())
{
diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php
index 325ef75f14c..a820be9e668 100644
--- a/htdocs/core/class/timespent.class.php
+++ b/htdocs/core/class/timespent.class.php
@@ -448,7 +448,7 @@ class TimeSpent extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -605,7 +605,7 @@ class TimeSpent extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -629,7 +629,7 @@ class TimeSpent extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index 3104dddcfbf..5e68dd05bd8 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -166,7 +166,7 @@ class Translate
* Load translation files.
*
* @param array $domains Array of lang files to load
- * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
+ * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
public function loadLangs($domains)
{
@@ -200,7 +200,7 @@ class Translate
* @param int $forcelangdir To force a different lang directory
* @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf.
* @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found
- * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
+ * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @see loadLangs()
*/
public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0, $forceloadifalreadynotfound = 0)
@@ -432,7 +432,7 @@ class Translate
* Value for hash are: 1:Loaded from disk, 2:Not found, 3:Loaded from cache
*
* @param DoliDB $db Database handler
- * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
+ * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
public function loadFromDatabase($db)
{
@@ -803,10 +803,10 @@ class Translate
public function convToOutputCharset($str, $pagecodefrom = 'UTF-8')
{
if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') {
- $str = utf8_encode($str);
+ $str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') {
- $str = utf8_decode(str_replace('€', chr(128), $str));
+ $str = mb_convert_encoding(str_replace('€', chr(128), $str), 'ISO-8859-1');
// TODO Replace with iconv("UTF-8", "ISO-8859-1", str_replace('€', chr(128), $str)); ?
}
return $str;
diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php
index 8e320c0e6eb..646e9ed4457 100644
--- a/htdocs/core/db/Database.interface.php
+++ b/htdocs/core/db/Database.interface.php
@@ -332,7 +332,7 @@ interface Database
* @param array $unique_keys Associative array Name of fields that will be unique key => value
* @param array $fulltext_keys Field name table that will be indexed in fulltext
* @param array $keys Table of key fields names => value
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
// phpcs:enable
@@ -342,7 +342,7 @@ interface Database
* Drop a table into database
*
* @param string $table Name of table
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table);
// phpcs:enable
@@ -430,7 +430,7 @@ interface Database
* @param string $dolibarr_main_db_user Username to create
* @param string $dolibarr_main_db_pass User password to create
* @param string $dolibarr_main_db_name Database name where user must be granted
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser(
$dolibarr_main_db_host,
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index d7e3e352b03..6d1a43c7908 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -802,7 +802,7 @@ class DoliDBMysqli extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@@ -883,7 +883,7 @@ class DoliDBMysqli extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@@ -1040,7 +1040,7 @@ class DoliDBMysqli extends DoliDB
* @param string $dolibarr_main_db_user Nom user a creer
* @param string $dolibarr_main_db_pass Mot de passe user a creer
* @param string $dolibarr_main_db_name Database name where user must be granted
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 828e06d391a..cce8d21610a 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -1062,7 +1062,7 @@ class DoliDBPgsql extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@@ -1136,7 +1136,7 @@ class DoliDBPgsql extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@@ -1160,7 +1160,7 @@ class DoliDBPgsql extends DoliDB
* @param string $dolibarr_main_db_user Name of user to create
* @param string $dolibarr_main_db_pass Password of user to create
* @param string $dolibarr_main_db_name Database name where user must be granted
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{
diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php
index 8d7d8e2f37a..41c1c021525 100644
--- a/htdocs/core/db/sqlite3.class.php
+++ b/htdocs/core/db/sqlite3.class.php
@@ -964,7 +964,7 @@ class DoliDBSqlite3 extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@@ -1037,7 +1037,7 @@ class DoliDBSqlite3 extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@@ -1173,7 +1173,7 @@ class DoliDBSqlite3 extends DoliDB
* @param string $dolibarr_main_db_user Nom user a creer
* @param string $dolibarr_main_db_pass Mot de passe user a creer
* @param string $dolibarr_main_db_name Database name where user must be granted
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{
diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php
index fe715ebe270..4259e1e1a63 100644
--- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php
+++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php
@@ -926,7 +926,7 @@ function ConvertToXmlAttribute($value)
}
if (strtoupper(substr($os, 0, 3)) === 'WIN' || FindBadUtf8($value)) {
- return (utf8_encode(htmlspecialchars($value)));
+ return (mb_convert_encoding(htmlspecialchars($value), 'UTF-8', 'ISO-8859-1'));
} else {
return (htmlspecialchars($value));
}
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 861f5208f5e..d8d1b8428f6 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -164,7 +164,7 @@ function versiondolibarrarray()
* @param int $colspan 2=Add a colspan=2 on td
* @param int $onlysqltoimportwebsite Only sql resquests used to import a website template are allowed
* @param string $database Database (replace __DATABASE__ with this value)
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0, $database = '')
{
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index aff76b1ac9e..a08b6b19030 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -113,7 +113,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl
$fileperm = '';
while (false !== ($file = readdir($dir))) { // $file is always a basename (into directory $newpath)
if (!utf8_check($file)) {
- $file = utf8_encode($file); // To be sure data is stored in utf8 in memory
+ $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in utf8 in memory
}
$fullpathfile = ($newpath ? $newpath.'/' : '').$file;
@@ -550,7 +550,7 @@ function dol_dir_is_emtpy($folder)
* Count number of lines in a file
*
* @param string $file Filename
- * @return int <0 if KO, Number of lines in files if OK
+ * @return int Return integer <0 if KO, Number of lines in files if OK
* @see dol_nboflines()
*/
function dol_count_nb_of_line($file)
@@ -623,7 +623,7 @@ function dol_fileperm($pathoffile)
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
* @param int $indexdatabase 1=index new file into database.
* @param int $arrayreplacementisregex 1=Array of replacement is regex
- * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
+ * @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @see dol_copy()
*/
function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0, $arrayreplacementisregex = 0)
@@ -711,7 +711,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param int $testvirus Do an antivirus test. Move is canceled if a virus is found.
* @param int $indexdatabase Index new file into database.
- * @return int <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
+ * @return int Return integer <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
* @see dol_delete_file() dolCopyDir()
*/
function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $testvirus = 0, $indexdatabase = 0)
@@ -839,7 +839,7 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
* @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories).
* @param array $excludefileext Exclude some file extensions
- * @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
+ * @return int Return integer <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @see dol_copy()
*/
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null, $excludesubdir = 0, $excludefileext = null)
@@ -1515,7 +1515,7 @@ function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub =
if ($handle = opendir("$dir_osencoded")) {
while (false !== ($item = readdir($handle))) {
if (!utf8_check($item)) {
- $item = utf8_encode($item); // should be useless
+ $item = mb_convert_encoding($item, 'UTF-8', 'ISO-8859-1'); // should be useless
}
if ($item != "." && $item != "..") {
@@ -1755,7 +1755,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
* @param int $generatethumbs 1=Generate also thumbs for uploaded image files
* @param Object $object Object used to set 'src_object_*' fields
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
* @see dol_remove_file_process()
*/
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null)
@@ -1991,7 +1991,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
* @param Object $object Object used to set 'src_object_*' fields
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
{
@@ -2056,7 +2056,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
* @param string $dir Directory name (full real path without ending /)
* @param string $file File name
* @param string $mode How file was created ('uploaded', 'generated', ...)
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
{
@@ -2114,7 +2114,7 @@ function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
* @param string $fileoutput Output filename
* @param string $page Page number if we convert a PDF into png
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
* @see dol_imageResizeOrCrop()
*/
function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '')
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a5f519375b3..d389eddd76a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -630,7 +630,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
return 'BadFirstParameterForGETPOST';
}
if (empty($check)) {
- dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
+ dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and a 2nd param that is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
// Enable this line to know who call the GETPOST with '' $check parameter.
//var_dump(debug_backtrace()[0]);
}
@@ -659,7 +659,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
//var_dump($user->default_values);
// Code for search criteria persistence.
- // Retrieve values if restore_lastsearch_values
+ // Retrieve saved values if restore_lastsearch_values is set
if (!empty($_GET['restore_lastsearch_values'])) { // Use $_GET here and not GETPOST
if (!empty($_SESSION['lastsearch_values_'.$relativepathstring])) { // If there is saved values
$tmp = json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true);
@@ -815,7 +815,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
}
- // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable parameters)
+ // Substitution variables for GETPOST (used to get final url with variable parameters or final default value, when using variable parameters __XXX__ in the GET URL)
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOMPANY_COUNTRY_ID__, __USER_ID__, ...
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
@@ -873,7 +873,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
}
- // Check rule
+ // Check type of variable and make sanitization according to this
if (preg_match('/^array/', $check)) { // If 'array' or 'array:restricthtml' or 'array:aZ09' or 'array:intcomma'
if (!is_array($out) || empty($out)) {
$out = array();
@@ -1075,6 +1075,9 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
$out = filter_var($out, $filter, $options);
}
break;
+ default:
+ dol_syslog("Error, you call sanitizeVal() with a bad value for the check type. Data can't be sanitized.", LOG_ERR);
+ break;
}
return $out;
@@ -6753,7 +6756,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
* @param int $idprod Id of product
* @param int $local 1 for localtax1, 2 for localtax 2
* @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...)
- * @return int <0 if KO, Vat rate if OK
+ * @return int Return integer <0 if KO, Vat rate if OK
* @see get_product_vat_for_country()
*/
function get_product_localtax_for_country($idprod, $local, $thirdpartytouse)
@@ -7138,7 +7141,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning, on first dir, saying PHP has no permission when open_basedir is used)
* @param string $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
- * @return int < 0 if KO, 0 = already exists, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 = already exists, > 0 if OK
*/
function dol_mkdir($dir, $dataroot = '', $newmask = '')
{
@@ -9441,7 +9444,7 @@ function dol_osencode($str)
* @param string $fieldid Field to get
* @param int $entityfilter Filter by entity
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
- * @return int <0 if KO, Id of code if OK
+ * @return int Return integer <0 if KO, Id of code if OK
* @see $langs->getLabelFromKey
*/
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index f102ecdd14b..a64165b6952 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -53,7 +53,7 @@ function jsUnEscape($source)
$unicodeHexVal = substr($source, $pos, 4);
$unicode = hexdec($unicodeHexVal);
$entity = "".$unicode.';';
- $decodedStr .= utf8_encode($entity);
+ $decodedStr .= mb_convert_encoding($entity, 'UTF-8', 'ISO-8859-1');
$pos += 4;
} else {
// we have an escaped ascii character
@@ -154,9 +154,9 @@ function dol_print_file($langs, $filename, $searchalt = 0)
$content = file_get_contents($formfile);
$isutf8 = utf8_check($content);
if (!$isutf8 && $conf->file->character_set_client == 'UTF-8') {
- print utf8_encode($content);
+ print mb_convert_encoding($content, 'UTF-8', 'ISO-8859-1');
} elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') {
- print utf8_decode($content);
+ print mb_convert_encoding($content, 'ISO-8859-1');
} else {
print $content;
}
@@ -1503,7 +1503,7 @@ function get_string_between($string, $start, $end)
*
* @param string $mask Mask to use
* @param string $value Value
- * @return int|string <0 or error string if KO, 0 if OK
+ * @return int|string Return integer <0 or error string if KO, 0 if OK
*/
function check_value($mask, $value)
{
diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php
index 0c1d89c99a3..b1959900794 100644
--- a/htdocs/core/lib/images.lib.php
+++ b/htdocs/core/lib/images.lib.php
@@ -30,6 +30,11 @@ $maxwidthmini = 128;
$maxheightmini = 72; // 16/9eme
$quality = 80;
+if (!defined('IMAGETYPE_WEBP')) {
+ define('IMAGETYPE_WEBP', 18);
+}
+
+
/**
* Return default values for image sizes
*
@@ -445,7 +450,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95)
break;
}
if ($deg) {
- if ($infoImg[2] === 'IMAGETYPE_PNG') { // In fact there is no exif on PNG but just in case
+ if ($infoImg[2] === IMAGETYPE_PNG) { // In fact there is no exif on PNG but just in case
imagealphablending($img, false);
imagesavealpha($img, true);
$img = imagerotate($img, $deg, imageColorAllocateAlpha($img, 0, 0, 0, 127));
@@ -583,6 +588,9 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
case IMAGETYPE_WBMP: // 15
$imgfonction = 'imagecreatefromwbmp';
break;
+ case IMAGETYPE_WEBP: // 18
+ $imgfonction = 'imagecreatefromwebp';
+ break;
}
if ($imgfonction) {
if (!function_exists($imgfonction)) {
@@ -600,11 +608,11 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
switch ($infoImg[2]) {
case IMAGETYPE_GIF: // 1
$img = imagecreatefromgif($filetoread);
- $extImg = '.gif'; // Extension de l'image
+ $extImg = '.gif';
break;
case IMAGETYPE_JPEG: // 2
$img = imagecreatefromjpeg($filetoread);
- $extImg = (preg_match('/\.jpeg$/', $file) ? '.jpeg' : '.jpg'); // Extension de l'image
+ $extImg = (preg_match('/\.jpeg$/', $file) ? '.jpeg' : '.jpg');
break;
case IMAGETYPE_PNG: // 3
$img = imagecreatefrompng($filetoread);
@@ -618,6 +626,10 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
$img = imagecreatefromwbmp($filetoread);
$extImg = '.bmp';
break;
+ case IMAGETYPE_WEBP: // 18
+ $img = imagecreatefromwebp($filetoread);
+ $extImg = '.webp';
+ break;
}
// Before PHP8, img was a resource, With PHP8, it is a GdImage
@@ -746,6 +758,11 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
$extImgTarget = '.bmp';
$newquality = 'NU';
break;
+ case IMAGETYPE_WEBP: // 18
+ $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0);
+ $extImgTarget = '.webp';
+ $newquality = $quality;
+ break;
}
if (function_exists("imagefill")) {
imagefill($imgThumb, 0, 0, $trans_colour);
@@ -782,6 +799,9 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
case IMAGETYPE_WBMP: // 15
imagewbmp($imgThumb, $imgThumbName);
break;
+ case IMAGETYPE_WEBP: // 18
+ imagewebp($imgThumb, $imgThumbName, $newquality);
+ break;
}
// Set permissions on file
diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php
index 379fb844077..4ea746feb26 100644
--- a/htdocs/core/lib/memory.lib.php
+++ b/htdocs/core/lib/memory.lib.php
@@ -62,7 +62,7 @@ $shmoffset = 1000; // Max number of entries found into a language file. If too l
* @param string $memoryid Memory id of shared area
* @param mixed $data Data to save. It must not be a null value.
* @param int $expire ttl in seconds, 0 never expire
- * @return int <0 if KO, 0 if nothing is done, Nb of bytes written if OK
+ * @return int Return integer <0 if KO, 0 if nothing is done, Nb of bytes written if OK
* @see dol_getcache()
*/
function dol_setcache($memoryid, $data, $expire = 0)
@@ -134,7 +134,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area
- * @return int|mixed <0 if KO, data if OK, null if not found into cache or no caching feature enabled
+ * @return int|mixed Return integer <0 if KO, data if OK, null if not found into cache or no caching feature enabled
* @see dol_setcache()
*/
function dol_getcache($memoryid)
@@ -214,7 +214,7 @@ function dol_getcache($memoryid)
* Return shared memory address used to store dataset with key memoryid
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
- * @return int <0 if KO, Memoy address of shared memory for key
+ * @return int Return integer <0 if KO, Memoy address of shared memory for key
*/
function dol_getshmopaddress($memoryid)
{
@@ -250,7 +250,7 @@ function dol_listshmop()
* @param int $memoryid Memory id of shared area ('main', 'agenda', ...)
* @param string $data Data to save. Must be a not null value.
* @param int $expire ttl in seconds, 0 never expire
- * @return int <0 if KO, 0=Caching not available, Nb of bytes written if OK
+ * @return int Return integer <0 if KO, 0=Caching not available, Nb of bytes written if OK
*/
function dol_setshmop($memoryid, $data, $expire)
{
@@ -287,7 +287,7 @@ function dol_setshmop($memoryid, $data, $expire)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
- * @return int <0 if KO, data if OK, Null if no cache enabled or not found
+ * @return int Return integer <0 if KO, data if OK, Null if no cache enabled or not found
*/
function dol_getshmop($memoryid)
{
diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php
index bd07f0d745a..47ff2aa6f74 100644
--- a/htdocs/core/lib/modulebuilder.lib.php
+++ b/htdocs/core/lib/modulebuilder.lib.php
@@ -32,7 +32,7 @@
* @param string $readdir Directory source (use $destdir when not defined)
* @param string $addfieldentry Array of 1 field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure')
* @param string $delfieldentry Id of field to remove
- * @return int|object <=0 if KO, Object if OK
+ * @return int|object Return integer <=0 if KO, Object if OK
* @see rebuildObjectSql()
*/
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '')
@@ -250,7 +250,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
* @param string $readdir Directory source (use $destdir when not defined)
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
* @param string $moduletype 'external' or 'internal'
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
* @see rebuildObjectClass()
*/
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null, $moduletype = 'external')
@@ -429,7 +429,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
* Get list of existing objects from directory
*
* @param string $destdir Directory
- * @return array|int <=0 if KO, array if OK
+ * @return array|int Return integer <=0 if KO, array if OK
*/
function dolGetListOfObjectClasses($destdir)
{
diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php
index 65a7f4948a0..a3f0de2c0f3 100644
--- a/htdocs/core/lib/prelevement.lib.php
+++ b/htdocs/core/lib/prelevement.lib.php
@@ -109,10 +109,10 @@ function prelevement_check_config($type = 'direct-debit')
/**
* Return array head with list of tabs to view object informations
*
- * @param object $object Member
- * @param int $nbOfInvoices No of invoices
- * @param int $nbOfSalaryInvoice No of salary invoices
- * @return array head
+ * @param BonPrelevement $object Member
+ * @param int $nbOfInvoices No of invoices
+ * @param int $nbOfSalaryInvoice No of salary invoices
+ * @return array head
*/
function bon_prelevement_prepare_head(BonPrelevement $object, $nbOfInvoices, $nbOfSalaryInvoice)
{
diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php
index bddcce12d72..4ea8fffb327 100644
--- a/htdocs/core/lib/xcal.lib.php
+++ b/htdocs/core/lib/xcal.lib.php
@@ -30,7 +30,7 @@
* @param string $desc Description of export
* @param array $events_array Array of events ("uid","startdate","duration","enddate","title","summary","category","email","url","desc","author")
* @param string $outputfile Output file
- * @return int < 0 if KO, Nb of events in file if OK
+ * @return int Return integer < 0 if KO, Nb of events in file if OK
*/
function build_calfile($format, $title, $desc, $events_array, $outputfile)
{
@@ -320,7 +320,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
* @param string $filter (optional) Filter
* @param string $url Url (If empty, forge URL for agenda RSS export)
* @param string $langcode Language code to show in header
- * @return int < 0 if KO, Nb of events in file if OK
+ * @return int Return integer < 0 if KO, Nb of events in file if OK
*/
function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filter = '', $url = '', $langcode = '')
{
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 344418ce20e..d9e6ad3f370 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -18,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->hasRight("bom","read") || $user->hasRight("mrp","read")', '', 0, 31, __ENTITY__, '');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__, '');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__, '');
-insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight('facture','lire') || $user->hasRight('don','lire') || $user->hasRight('tax','charges','lire') || $user->hasRight('salaries','read') || $user->hasRight('loan','read') || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, '');
+insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, '');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__, '');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__, '');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__, '');
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 2104cd7d5d4..13ff885a2d0 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -1121,7 +1121,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*
* @param string $reldir Relative directory where to scan files. Example: '/install/mysql/' or '/module/sql/'
* @param string $onlywithsuffix Only with the defined suffix
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
protected function _load_tables($reldir, $onlywithsuffix = '')
{
@@ -1801,7 +1801,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
/**
* Removes constants tagged 'deleteonunactive'
*
- * @return int <0 if KO, 0 if OK
+ * @return int Return integer <0 if KO, 0 if OK
*/
public function delete_const()
{
@@ -2506,7 +2506,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* TODO : store results for $this->url_last_version and $this->needUpdate
* Add a cron task to monitor for updates
*
- * @return int <0 if Error, 0 == no update needed, >0 if need update
+ * @return int Return integer <0 if Error, 0 == no update needed, >0 if need update
*/
public function checkForUpdate()
{
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index dfbbea1039b..51426d677f3 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -934,7 +934,7 @@ class pdf_espadon extends ModelePdfExpedition
* @param Expedition $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
- * @return int <0 if KO, > if OK
+ * @return int Return integer <0 if KO, > if OK
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
index eab2e6cc05e..a4d790f2285 100644
--- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
@@ -475,7 +475,7 @@ class pdf_merou extends ModelePdfExpedition
* @param Expedition $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
- * @return int <0 if KO, > if OK
+ * @return int Return integer <0 if KO, > if OK
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index 6fad9c974d8..9258a1fb58c 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -844,7 +844,7 @@ class pdf_rouget extends ModelePdfExpedition
* @param Expedition $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
- * @return int <0 if KO, > if OK
+ * @return int Return integer <0 if KO, > if OK
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php
index 8540334123e..cdb6e9c208d 100644
--- a/htdocs/core/modules/export/export_excel2007.modules.php
+++ b/htdocs/core/modules/export/export_excel2007.modules.php
@@ -56,6 +56,7 @@ class ExportExcel2007 extends ModeleExports
public $version_lib;
+ /** @var Spreadsheet */
public $workbook; // Handle file
public $worksheet; // Handle sheet
@@ -175,17 +176,13 @@ class ExportExcel2007 extends ModeleExports
*
* @param string $file File name to generate
* @param Translate $outputlangs Output language object
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function open_file($file, $outputlangs)
{
// phpcs:enable
global $user, $conf, $langs;
- if (getDolGlobalString('MAIN_USE_PHP_WRITEEXCEL')) {
- $outputlangs->charset_output = 'ISO-8859-1'; // Because Excel 5 format is ISO
- }
-
dol_syslog(get_class($this)."::open_file file=".$file);
$this->file = $file;
@@ -256,9 +253,7 @@ class ExportExcel2007 extends ModeleExports
$selectlabel = array();
$this->col = 1;
- if (getDolGlobalString('MAIN_USE_PHP_WRITEEXCEL')) {
- $this->col = 0;
- }
+
foreach ($array_selected_sorted as $code => $value) {
$alias = $array_export_fields_label[$code];
//print "dd".$alias;
@@ -270,24 +265,16 @@ class ExportExcel2007 extends ModeleExports
if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) {
$selectlabel[$code."_label"] = $alias."_label";
}
- if (getDolGlobalString('MAIN_USE_PHP_WRITEEXCEL')) {
- $this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($alias), $formatheader);
- } else {
- $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $outputlangs->transnoentities($alias));
- if (!empty($array_types[$code]) && in_array($array_types[$code], array('Date', 'Numeric', 'TextAuto'))) { // Set autowidth for some types
- $this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($this->col + 1))->setAutoSize(true);
- }
+ $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $outputlangs->transnoentities($alias));
+ if (!empty($array_types[$code]) && in_array($array_types[$code], array('Date', 'Numeric', 'TextAuto'))) { // Set autowidth for some types
+ $this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($this->col + 1))->setAutoSize(true);
}
$this->col++;
}
foreach ($selectlabel as $key => $value) {
- if (getDolGlobalString('MAIN_USE_PHP_WRITEEXCEL')) {
- $this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($value), $formatheader);
- } else {
- $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $outputlangs->transnoentities($value));
- if (!empty($array_types[$code]) && in_array($array_types[$code], array('Date', 'Numeric', 'TextAuto'))) { // Set autowidth for some types
- $this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($this->col + 1))->setAutoSize(true);
- }
+ $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $outputlangs->transnoentities($value));
+ if (!empty($array_types[$code]) && in_array($array_types[$code], array('Date', 'Numeric', 'TextAuto'))) { // Set autowidth for some types
+ $this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($this->col + 1))->setAutoSize(true);
}
$this->col++;
}
@@ -312,9 +299,6 @@ class ExportExcel2007 extends ModeleExports
// Define first row
$this->col = 1;
- if (getDolGlobalString('MAIN_USE_PHP_WRITEEXCEL')) {
- $this->col = 0;
- }
$reg = array();
$selectlabelvalues = array();
diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php
index e0338d44d32..fa90f362c06 100644
--- a/htdocs/core/modules/export/export_tsv.modules.php
+++ b/htdocs/core/modules/export/export_tsv.modules.php
@@ -156,7 +156,7 @@ class ExportTsv extends ModeleExports
*
* @param string $file Path of filename to generate
* @param Translate $outputlangs Output language object
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function open_file($file, $outputlangs)
{
diff --git a/htdocs/core/modules/export/exportcsv.class.php b/htdocs/core/modules/export/exportcsv.class.php
index 794c9ac0391..75add987729 100644
--- a/htdocs/core/modules/export/exportcsv.class.php
+++ b/htdocs/core/modules/export/exportcsv.class.php
@@ -134,7 +134,7 @@ class ExportCsv extends ModeleExports
*
* @param string $file Path of filename to generate
* @param Translate $outputlangs Output language object
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function open_file($file, $outputlangs)
{
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 19433eee66e..124fe9f7bbc 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -176,7 +176,7 @@ class ImportCsv extends ModeleImports
* Open input file
*
* @param string $file Path of filename
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function import_open_file($file)
{
@@ -206,7 +206,7 @@ class ImportCsv extends ModeleImports
* Return nb of records. File must be closed.
*
* @param string $file Path of filename
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function import_get_nb_of_lines($file)
{
@@ -219,7 +219,7 @@ class ImportCsv extends ModeleImports
/**
* Input header line from file
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function import_read_header()
{
@@ -256,7 +256,7 @@ class ImportCsv extends ModeleImports
$newarrayres[$key]['val'] = $val;
$newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null
} else {
- $newarrayres[$key]['val'] = utf8_encode($val);
+ $newarrayres[$key]['val'] = mb_convert_encoding($val, 'UTF-8', 'ISO-8859-1');
$newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null
}
} else { // Autodetect format (UTF8 or ISO)
@@ -264,7 +264,7 @@ class ImportCsv extends ModeleImports
$newarrayres[$key]['val'] = $val;
$newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null
} else {
- $newarrayres[$key]['val'] = utf8_encode($val);
+ $newarrayres[$key]['val'] = mb_convert_encoding($val, 'UTF-8', 'ISO-8859-1');
$newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null
}
}
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index e67c37992ab..14e4b561eae 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -228,7 +228,7 @@ class ImportXlsx extends ModeleImports
* Open input file
*
* @param string $file Path of filename
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function import_open_file($file)
{
@@ -252,7 +252,7 @@ class ImportXlsx extends ModeleImports
* Return nb of records. File must be closed.
*
* @param string $file Path of filename
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function import_get_nb_of_lines($file)
{
@@ -273,7 +273,7 @@ class ImportXlsx extends ModeleImports
/**
* Input header line from file
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function import_read_header()
{
diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php
index 7a40e1cdbda..9017e81aa14 100644
--- a/htdocs/core/modules/mailings/advthirdparties.modules.php
+++ b/htdocs/core/modules/mailings/advthirdparties.modules.php
@@ -59,7 +59,7 @@ class mailing_advthirdparties extends MailingTargets
* @param array $socid Array of id soc to add
* @param int $type_of_target Defined in advtargetemailing.class.php
* @param array $contactid Array of contact id to add
- * @return int <0 if error, number of emails added if ok
+ * @return int Return integer <0 if error, number of emails added if ok
*/
public function add_to_target_spec($mailing_id, $socid, $type_of_target, $contactid)
{
diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php
index 958a6e10eda..83059884b80 100644
--- a/htdocs/core/modules/mailings/contacts1.modules.php
+++ b/htdocs/core/modules/mailings/contacts1.modules.php
@@ -333,7 +333,7 @@ class mailing_contacts1 extends MailingTargets
* Add some recipients into target table
*
* @param int $mailing_id Id of emailing
- * @return int <0 si erreur, nb ajout si ok
+ * @return int Return integer <0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/eventorganization.modules.php b/htdocs/core/modules/mailings/eventorganization.modules.php
index cf63d029d8d..c2a2c0d3c8d 100644
--- a/htdocs/core/modules/mailings/eventorganization.modules.php
+++ b/htdocs/core/modules/mailings/eventorganization.modules.php
@@ -61,7 +61,7 @@ class mailing_eventorganization extends MailingTargets
* This is the main function that returns the array of emails
*
* @param int $mailing_id Id of mailing. No need to use it.
- * @return int <0 if error, number of emails added if ok
+ * @return int Return integer <0 if error, number of emails added if ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php
index aa8f0f5859a..1ffd718a44f 100644
--- a/htdocs/core/modules/mailings/fraise.modules.php
+++ b/htdocs/core/modules/mailings/fraise.modules.php
@@ -228,7 +228,7 @@ class mailing_fraise extends MailingTargets
* Ajoute destinataires dans table des cibles
*
* @param int $mailing_id Id of emailing
- * @return int < 0 si erreur, nb ajout si ok
+ * @return int Return integer < 0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php
index 632e228ad69..c4e96bbf7ba 100644
--- a/htdocs/core/modules/mailings/modules_mailings.php
+++ b/htdocs/core/modules/mailings/modules_mailings.php
@@ -159,7 +159,7 @@ class MailingTargets // This can't be abstract as it is used for some method
* Met a jour nombre de destinataires
*
* @param int $mailing_id Id of emailing
- * @return int < 0 si erreur, nb destinataires si ok
+ * @return int Return integer < 0 si erreur, nb destinataires si ok
*/
public function update_nb($mailing_id)
{
@@ -190,7 +190,7 @@ class MailingTargets // This can't be abstract as it is used for some method
*
* @param int $mailing_id Id of emailing
* @param array $cibles Array with targets
- * @return int < 0 if error, nb added if OK
+ * @return int Return integer < 0 if error, nb added if OK
*/
public function addTargetsToDatabase($mailing_id, $cibles)
{
diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php
index 48fabd3b0fe..03d6a59dba8 100644
--- a/htdocs/core/modules/mailings/partnership.modules.php
+++ b/htdocs/core/modules/mailings/partnership.modules.php
@@ -61,7 +61,7 @@ class mailing_partnership extends MailingTargets
* This is the main function that returns the array of emails
*
* @param int $mailing_id Id of mailing. No need to use it.
- * @return int <0 if error, number of emails added if ok
+ * @return int Return integer <0 if error, number of emails added if ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php
index cd93813cf68..25d4d8a4192 100644
--- a/htdocs/core/modules/mailings/pomme.modules.php
+++ b/htdocs/core/modules/mailings/pomme.modules.php
@@ -153,7 +153,7 @@ class mailing_pomme extends MailingTargets
* Ajoute destinataires dans table des cibles
*
* @param int $mailing_id Id of emailing
- * @return int < 0 si erreur, nb ajout si ok
+ * @return int Return integer < 0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php
index 54775dee58d..dcda0f2b0aa 100644
--- a/htdocs/core/modules/mailings/thirdparties.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties.modules.php
@@ -58,7 +58,7 @@ class mailing_thirdparties extends MailingTargets
* This is the main function that returns the array of emails
*
* @param int $mailing_id Id of mailing. No need to use it.
- * @return int <0 if error, number of emails added if ok
+ * @return int Return integer <0 if error, number of emails added if ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
index 2484537d063..4d0ac4ea0bb 100644
--- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
@@ -81,7 +81,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
* This is the main function that returns the array of emails
*
* @param int $mailing_id Id of mailing. No need to use it.
- * @return int <0 if error, number of emails added if ok
+ * @return int Return integer <0 if error, number of emails added if ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php
index 765a2d300f7..3fcbace468b 100644
--- a/htdocs/core/modules/mailings/xinputfile.modules.php
+++ b/htdocs/core/modules/mailings/xinputfile.modules.php
@@ -124,7 +124,7 @@ class mailing_xinputfile extends MailingTargets
* Ajoute destinataires dans table des cibles
*
* @param int $mailing_id Id of emailing
- * @return int < 0 si erreur, nb ajout si ok
+ * @return int Return integer < 0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php
index 74ed18ba91f..a141cb7881e 100644
--- a/htdocs/core/modules/mailings/xinputuser.modules.php
+++ b/htdocs/core/modules/mailings/xinputuser.modules.php
@@ -117,7 +117,7 @@ class mailing_xinputuser extends MailingTargets
* Ajoute destinataires dans table des cibles
*
* @param int $mailing_id Id of emailing
- * @return int < 0 si erreur, nb ajout si ok
+ * @return int Return integer < 0 si erreur, nb ajout si ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/core/modules/oauth/generic_oauthcallback.php b/htdocs/core/modules/oauth/generic_oauthcallback.php
index da8949ecbfb..96176bb2467 100644
--- a/htdocs/core/modules/oauth/generic_oauthcallback.php
+++ b/htdocs/core/modules/oauth/generic_oauthcallback.php
@@ -57,7 +57,7 @@ $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/
* Load the credential for the service
*/
-/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
+/** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php
index d1c057d5c33..b1ccd2adabd 100644
--- a/htdocs/core/modules/oauth/github_oauthcallback.php
+++ b/htdocs/core/modules/oauth/github_oauthcallback.php
@@ -56,7 +56,7 @@ $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/
* Load the credential for the service
*/
-/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
+/** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php
index 1478d3a778d..b48f9ec54da 100644
--- a/htdocs/core/modules/oauth/google_oauthcallback.php
+++ b/htdocs/core/modules/oauth/google_oauthcallback.php
@@ -74,7 +74,7 @@ $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/
* Load the credential for the service
*/
-/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
+/** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
diff --git a/htdocs/core/modules/oauth/microsoft_oauthcallback.php b/htdocs/core/modules/oauth/microsoft_oauthcallback.php
index 15ceccea0f3..fde5371380a 100644
--- a/htdocs/core/modules/oauth/microsoft_oauthcallback.php
+++ b/htdocs/core/modules/oauth/microsoft_oauthcallback.php
@@ -57,7 +57,7 @@ $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/
* Load the credential for the service
*/
-/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
+/** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php
index 17e99333509..ba0247d5915 100644
--- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php
+++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php
@@ -56,7 +56,7 @@ $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/
* Load the credential for the service
*/
-/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
+/** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php
index f73eca899e6..2e54fcbc907 100644
--- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php
+++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php
@@ -56,7 +56,7 @@ $currentUri = $uriFactory->createFromAbsolute($urlwithroot.'/core/modules/oauth/
* Load the credential for the service
*/
-/** @var $serviceFactory \OAuth\ServiceFactory An OAuth service factory. */
+/** @var \OAuth\ServiceFactory $serviceFactory An OAuth service factory. */
$serviceFactory = new \OAuth\ServiceFactory();
$httpClient = new \OAuth\Common\Http\Client\CurlClient();
// TODO Set options for proxy and timeout
diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
index 8c1cb380e87..f4e01bc9f77 100644
--- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
@@ -361,10 +361,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetTextColor(0, 0, 0);
// Define size of image if we need it
- $imglinesize = array();
- if (!empty($realpatharray[$i])) {
- $imglinesize = pdf_getSizeForImage($realpatharray[$i]);
- }
+ //$imglinesize = array();
+ //if (!empty($realpatharray[$i])) {
+ // $imglinesize = pdf_getSizeForImage($realpatharray[$i]);
+ //}
$pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it.
diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php
index ab583ebd4ec..f5156da7caf 100644
--- a/htdocs/core/tpl/list_print_total.tpl.php
+++ b/htdocs/core/tpl/list_print_total.tpl.php
@@ -14,7 +14,7 @@ if (isset($totalarray['pos'])) {
while ($i < $totalarray['nbfield']) {
$i++;
if (!empty($totalarray['pos'][$i])) {
- switch ($totalarray['pos'][$i]) {
+ switch ($totalarray['type'][$i]) {
case 'duration':
print '';
print(!empty($totalarray['val'][$totalarray['pos'][$i]]) ? convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]], 'allhourmin') : 0);
diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php
index f20e275f306..4bc62369a31 100644
--- a/htdocs/core/triggers/dolibarrtriggers.class.php
+++ b/htdocs/core/triggers/dolibarrtriggers.class.php
@@ -167,7 +167,7 @@ abstract class DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf);
}
diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
index 76288ed1124..96eb6b0ee3d 100644
--- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
+++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
@@ -60,7 +60,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
@@ -188,7 +188,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
- // Set shipment to "Closed" if WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE is set (deprecated, WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE instead))
+ // Set shipment to "Closed" if WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE is set (deprecated, has been replaced with WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE instead))
if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE')) {
$object->fetchObjectLinked('', 'shipping', $object->id, $object->element);
if (!empty($object->linkedObjects)) {
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index 8916e99ec3d..7c11e252f4b 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -73,7 +73,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
index 8e9c3f7e2bb..70923143d18 100644
--- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
+++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
@@ -55,7 +55,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php
index 93ca0acbc3c..1c869b2d75e 100644
--- a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php
+++ b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php
@@ -67,7 +67,7 @@ class InterfaceEventOrganization extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php
index d948c77865b..da7b37c3acf 100644
--- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php
+++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php
@@ -57,7 +57,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php
index f8abd2e3539..fb161a16dbd 100644
--- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php
+++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php
@@ -55,7 +55,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
index ee78895f99b..99c2ee84bf1 100644
--- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
+++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
@@ -62,7 +62,7 @@ class InterfaceNotification extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
index 364c94101c1..e5efd4f6b47 100644
--- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
+++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
@@ -56,7 +56,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
index 9a1f68a9ca9..8b992b79022 100644
--- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
+++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
@@ -61,7 +61,7 @@ class InterfaceStripe extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param Conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
index 9505196dd49..7017d5cd721 100644
--- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
+++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
@@ -63,7 +63,7 @@ class InterfaceContactRoles extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php
index 3eb8a2ce076..c8b97488b5d 100644
--- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php
+++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php
@@ -86,7 +86,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param Conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php
index 2b6208c025d..ea846616096 100644
--- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php
+++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php
@@ -56,7 +56,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param Conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php
index 22e23b1c05e..481c3b08d09 100644
--- a/htdocs/datapolicy/class/actions_datapolicy.class.php
+++ b/htdocs/datapolicy/class/actions_datapolicy.class.php
@@ -69,7 +69,7 @@ class ActionsDatapolicy extends CommonHookActions
* @param array $parameters Array of parameters
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action 'add', 'update', 'view'
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
@@ -87,7 +87,7 @@ class ActionsDatapolicy extends CommonHookActions
* @param Societe|CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
- * @return int < 0 on error, 0 on success, 1 to replace standard code
+ * @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function doActions($parameters, &$object, &$action, $hookmanager)
{
diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php
index 8c4872fce24..9b40abdb668 100644
--- a/htdocs/debugbar/class/TraceableDB.php
+++ b/htdocs/debugbar/class/TraceableDB.php
@@ -500,7 +500,7 @@ class TraceableDB extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@@ -511,7 +511,7 @@ class TraceableDB extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@@ -616,7 +616,7 @@ class TraceableDB extends DoliDB
* @param string $dolibarr_main_db_user Nom user a creer
* @param string $dolibarr_main_db_pass Mot de passe user a creer
* @param string $dolibarr_main_db_name Database name where user must be granted
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index 8ae8af24eef..ab081fbfe30 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -144,7 +144,7 @@ class Delivery extends CommonObject
* Create delivery receipt in database
*
* @param User $user Objet du user qui cree
- * @return int <0 si erreur, id delivery cree si ok
+ * @return int Return integer <0 si erreur, id delivery cree si ok
*/
public function create($user)
{
@@ -548,7 +548,7 @@ class Delivery extends CommonObject
*
* @param User $user User who creates
* @param int $sending_id Id of the expedition that serves as a model
- * @return integer <=0 if KO, >0 if OK
+ * @return integer Return integer <=0 if KO, >0 if OK
*/
public function create_from_sending($user, $sending_id)
{
@@ -655,7 +655,7 @@ class Delivery extends CommonObject
* Delete line
*
* @param int $lineid Line id
- * @return integer <0 if KO, 0 if nothing done, >0 if OK
+ * @return integer Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function deleteline($lineid)
{
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 7751feb2ed4..483a53465ee 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -364,7 +364,7 @@ class Don extends CommonObject
*
* @param User $user User who created the donation
* @param int $notrigger Disable triggers
- * @return int <0 if KO, id of created donation if OK
+ * @return int Return integer <0 if KO, id of created donation if OK
* TODO add numbering module for Ref
*/
public function create($user, $notrigger = 0)
@@ -572,7 +572,7 @@ class Don extends CommonObject
*
* @param User $user User
* @param int $notrigger Disable triggers
- * @return int <0 if KO, 0 if not possible, >0 if OK
+ * @return int Return integer <0 if KO, 0 if not possible, >0 if OK
*/
public function delete($user, $notrigger = 0)
{
@@ -830,7 +830,7 @@ class Don extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
@@ -1125,7 +1125,7 @@ class Don extends CommonObject
/**
* Function to get reamain to pay for a donation
*
- * @return int <0 if KO, > reamain to pay if OK
+ * @return int Return integer <0 if KO, > reamain to pay if OK
*/
public function getRemainToPay()
{
diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php
index f697ec63b65..f72c5783721 100644
--- a/htdocs/don/class/paymentdonation.class.php
+++ b/htdocs/don/class/paymentdonation.class.php
@@ -123,7 +123,7 @@ class PaymentDonation extends CommonObject
*
* @param User $user User making payment
* @param bool $notrigger false=launch triggers after, true=disable triggers
- * @return int <0 if KO, id of payment if OK
+ * @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user, $notrigger = false)
{
diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php
index 6f5da67de41..020c534a065 100644
--- a/htdocs/don/stats/index.php
+++ b/htdocs/don/stats/index.php
@@ -49,6 +49,9 @@ $endyear = $year;
// Load translation files required by the page
$langs->loadLangs(array("companies", "other", "sendings"));
+// Security check
+$result = restrictedArea($user, 'don');
+
/*
* View
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index 84c17a2e637..738c39a10d0 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -382,7 +382,7 @@ class ConferenceOrBooth extends ActionComm
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -468,7 +468,7 @@ class ConferenceOrBooth extends ActionComm
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -492,7 +492,7 @@ class ConferenceOrBooth extends ActionComm
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 33fb6b00657..e7230f91755 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -529,7 +529,7 @@ class ConferenceOrBoothAttendee extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -660,7 +660,7 @@ class ConferenceOrBoothAttendee extends CommonObject
/**
* Load the project with id $this->fk_project into this->project
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_projet()
{
@@ -711,7 +711,7 @@ class ConferenceOrBoothAttendee extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -735,7 +735,7 @@ class ConferenceOrBoothAttendee extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index 041956abf72..7fcd29de5cc 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -1087,7 +1087,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 53b84352f94..8d8095c5797 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -1085,7 +1085,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index ba8c7b9290e..08aec707687 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -334,7 +334,7 @@ class Expedition extends CommonObject
*
* @param User $user Objet du user qui cree
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <0 si erreur, id expedition creee si ok
+ * @return int Return integer <0 si erreur, id expedition creee si ok
*/
public function create($user, $notrigger = 0)
{
@@ -495,7 +495,7 @@ class Expedition extends CommonObject
* @param int $qty Quantity
* @param int $rang Rang
* @param array $array_options extrafields array
- * @return int <0 if KO, line_id if OK
+ * @return int Return integer <0 if KO, line_id if OK
*/
public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $array_options = null)
{
@@ -709,7 +709,7 @@ class Expedition extends CommonObject
*
* @param User $user Object user that validate
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <0 if OK, >0 if KO
+ * @return int Return integer <0 if OK, >0 if KO
*/
public function valid($user, $notrigger = 0)
{
@@ -859,7 +859,7 @@ class Expedition extends CommonObject
* Create a delivery receipt from a shipment
*
* @param User $user User
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function create_delivery($user)
{
@@ -2019,7 +2019,7 @@ class Expedition extends CommonObject
*
* @param User $user Object user that modify
* @param int $delivery_date Delivery date
- * @return int <0 if ko, >0 if ok
+ * @return int Return integer <0 if ko, >0 if ok
* @deprecated Use setDeliveryDate
*/
public function set_date_livraison($user, $delivery_date)
@@ -2324,7 +2324,7 @@ class Expedition extends CommonObject
/**
* Classify the shipping as invoiced (used for exemple by trigger when WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE is on)
*
- * @return int <0 if ko, >0 if ok
+ * @return int Return integer <0 if ko, >0 if ok
*/
public function setBilled()
{
@@ -2380,7 +2380,7 @@ class Expedition extends CommonObject
/**
* Classify the shipping as validated/opened
*
- * @return int <0 if KO, 0 if already open, >0 if OK
+ * @return int Return integer <0 if KO, 0 if already open, >0 if OK
*/
public function reOpen()
{
@@ -2781,7 +2781,7 @@ class ExpeditionLigne extends CommonObjectLine
*
* @param User $user User that modify
* @param int $notrigger 1 = disable triggers
- * @return int <0 if KO, line id >0 if OK
+ * @return int Return integer <0 if KO, line id >0 if OK
*/
public function insert($user, $notrigger = 0)
{
@@ -2928,7 +2928,7 @@ class ExpeditionLigne extends CommonObjectLine
*
* @param User $user User that modify
* @param int $notrigger 1 = disable triggers
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
*/
public function update($user = null, $notrigger = 0)
{
diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php
index 658de632577..4c8ee08e5a1 100644
--- a/htdocs/expedition/class/expeditionlinebatch.class.php
+++ b/htdocs/expedition/class/expeditionlinebatch.class.php
@@ -105,7 +105,7 @@ class ExpeditionLineBatch extends CommonObject
* @param int $id_line_expdet rowid of expedtiondet record
* @param User $f_user User that create
* @param int $notrigger 1 = disable triggers
- * @return int <0 if KO, Id of record (>0) if OK
+ * @return int Return integer <0 if KO, Id of record (>0) if OK
*/
public function create($id_line_expdet, $f_user = null, $notrigger = 0)
{
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 90fa537313d..1740360148e 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -1039,7 +1039,7 @@ class ExpenseReport extends CommonObject
/**
* fetch_lines
*
- * @return int <0 if OK, >0 if KO
+ * @return int Return integer <0 if OK, >0 if KO
*/
public function fetch_lines()
{
@@ -1257,7 +1257,7 @@ class ExpenseReport extends CommonObject
*
* @param User $fuser User
* @param int $notrigger Disable triggers
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function setValidate($fuser, $notrigger = 0)
{
@@ -1421,7 +1421,7 @@ class ExpenseReport extends CommonObject
*
* @param User $fuser User
* @param int $notrigger Disable triggers
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function setApproved($fuser, $notrigger = 0)
{
@@ -2521,7 +2521,7 @@ class ExpenseReport extends CommonObject
*
* @param User $user Objet user
* @param string $option 'topay' or 'toapprove'
- * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
+ * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $option = 'topay')
{
@@ -2617,7 +2617,7 @@ class ExpenseReport extends CommonObject
/**
* Return if object was dispatched into bookkeeping
*
- * @return int <0 if KO, 0=no, 1=yes
+ * @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{
@@ -2675,7 +2675,7 @@ class ExpenseReport extends CommonObject
* @param int $fk_cat Category of the vehicule used
* @param float $qty Number of kilometers
* @param float $tva VAT rate
- * @return int <0 if KO, total ttc if OK
+ * @return int Return integer <0 if KO, total ttc if OK
*/
public function computeTotalKm($fk_cat, $qty, $tva)
{
diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php
index 403ead3d28a..9f197da98c3 100644
--- a/htdocs/expensereport/class/paymentexpensereport.class.php
+++ b/htdocs/expensereport/class/paymentexpensereport.class.php
@@ -117,7 +117,7 @@ class PaymentExpenseReport extends CommonObject
* Use this->amounts to have list of lines for the payment
*
* @param User $user User making payment
- * @return int <0 if KO, id of payment if OK
+ * @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user)
{
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index ca400b0057a..262289dd226 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -139,7 +139,7 @@ $step = GETPOST("step", "int") ? GETPOST("step", "int") : 1;
$export_name = GETPOST("export_name", "alphanohtml");
$hexa = GETPOST("hexa", "alpha");
$exportmodelid = GETPOST("exportmodelid", "int");
-$field = GETPOST("field", "alpa");
+$field = GETPOST("field", "alpha");
$objexport = new Export($db);
$objexport->load_arrays($user, $datatoexport);
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 0c9b1add075..b590bbfdc20 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -1509,7 +1509,7 @@ class Fichinter extends CommonObject
* @param User $user Object user that modify
* @param string $ref_client Customer reference
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <0 if ko, >0 if ok
+ * @return int Return integer <0 if ko, >0 if ok
*/
public function setRefClient($user, $ref_client, $notrigger = 0)
{
@@ -1707,7 +1707,7 @@ class FichinterLigne extends CommonObjectLine
*
* @param User $user Objet user that make creation
* @param int $notrigger Disable all triggers
- * @return int <0 if ko, >0 if ok
+ * @return int Return integer <0 if ko, >0 if ok
*/
public function insert($user, $notrigger = 0)
{
@@ -1796,7 +1796,7 @@ class FichinterLigne extends CommonObjectLine
*
* @param User $user Objet user that make creation
* @param int $notrigger Disable all triggers
- * @return int <0 if ko, >0 if ok
+ * @return int Return integer <0 if ko, >0 if ok
*/
public function update($user, $notrigger = 0)
{
@@ -1857,7 +1857,7 @@ class FichinterLigne extends CommonObjectLine
/**
* Update total duration into llx_fichinter
*
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function update_total()
{
diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php
index 34b814ade33..c983380b2fd 100644
--- a/htdocs/fichinter/class/fichinterrec.class.php
+++ b/htdocs/fichinter/class/fichinterrec.class.php
@@ -145,7 +145,7 @@ class FichinterRec extends Fichinter
*
* @param User $user User object
* @param int $notrigger no trigger
- * @return int <0 if KO, id of fichinter if OK
+ * @return int Return integer <0 if KO, id of fichinter if OK
*/
public function create($user, $notrigger = 0)
{
@@ -477,7 +477,7 @@ class FichinterRec extends Fichinter
* @param int $special_code Special code
* @param string $label Label of the line
* @param string $fk_unit Unit
- * @return int <0 if KO, Id of line if OK
+ * @return int Return integer <0 if KO, Id of line if OK
*/
public function addline($desc, $duration, $date, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null)
{
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index ee1dbec70d7..1aeaa3f89f4 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -991,7 +991,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index 3707ed1a7b1..91d3f73152d 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -80,13 +80,16 @@ $result = @include_once $conffile; // Keep @ because with some error reporting t
// Disable some not used PHP stream
$listofwrappers = stream_get_wrappers();
-// We need '.phar' for geoip2. TODO Replace phar in geoip with exploded files so we can disable phar.
-$arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib');
+// We need '.phar' for geoip2. TODO Replace phar in geoip with exploded files so we can disable phar by default.
+$arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftp', 'ftps', 'glob', 'data', 'expect', 'ogg', 'rar', 'zip', 'zlib');
+if (!empty($dolibarr_main_stream_to_disable) && is_array($dolibarr_main_stream_to_disable)) {
+ $arrayofstreamtodisable = $dolibarr_main_stream_to_disable;
+}
foreach ($arrayofstreamtodisable as $streamtodisable) {
if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) {
- if (!empty($dolibarr_main_stream_enabled) && is_array($dolibarr_main_stream_enabled) && in_array($streamtodisable, $dolibarr_main_stream_enabled)) {
+ /*if (!empty($dolibarr_main_stream_do_not_disable) && is_array($dolibarr_main_stream_do_not_disable) && in_array($streamtodisable, $dolibarr_main_stream_do_not_disable)) {
continue; // We do not disable this stream
- }
+ }*/
stream_wrapper_unregister($streamtodisable);
}
}
diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php
index f2c6953aebc..2fb646d69f8 100644
--- a/htdocs/fourn/class/fournisseur.class.php
+++ b/htdocs/fourn/class/fournisseur.class.php
@@ -53,10 +53,12 @@ class Fournisseur extends Societe
/**
* Return nb of orders
*
- * @return int Nb of orders
+ * @return int Nb of orders for current supplier
*/
public function getNbOfOrders()
{
+ $num = 0;
+
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf";
$sql .= " WHERE cf.fk_soc = ".((int) $this->id);
@@ -64,18 +66,13 @@ class Fournisseur extends Societe
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
-
- if ($num == 1) {
- $row = $this->db->fetch_row($resql);
-
- $this->single_open_commande = $row[0];
- }
}
+
return $num;
}
/**
- * Returns number of ref prices (not number of products).
+ * Returns number of ref prices (not number of products) for current supplier
*
* @return int Nb of ref prices, or <0 if error
*/
@@ -147,7 +144,7 @@ class Fournisseur extends Societe
*
* @param User $user User asking creation
* @param string $name Category name
- * @return int <0 if KO, 0 if OK
+ * @return int Return integer <0 if KO, 0 if OK
*/
public function CreateCategory($user, $name)
{
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index e38c2062f70..6df974c0b6a 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1054,7 +1054,7 @@ class CommandeFournisseur extends CommonOrder
* Class invoiced the supplier order
*
* @param User $user Object user making the change
- * @return int <0 if KO, 0 if already billed, >0 if OK
+ * @return int Return integer <0 if KO, 0 if already billed, >0 if OK
*/
public function classifyBilled(User $user)
{
@@ -1406,7 +1406,7 @@ class CommandeFournisseur extends CommonOrder
*
* @param User $user User making creation
* @param int $notrigger Disable all triggers
- * @return int <0 if KO, Id of supplier order if OK
+ * @return int Return integer <0 if KO, Id of supplier order if OK
*/
public function create($user, $notrigger = 0)
{
@@ -1827,7 +1827,7 @@ class CommandeFournisseur extends CommonOrder
* @param int $origin_id Id of origin object
* @param int $rang Rank
* @param int $special_code Special code
- * @return int <=0 if KO, >0 if OK
+ * @return int Return integer <=0 if KO, >0 if OK
*/
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1, $special_code = 0)
{
@@ -2547,7 +2547,7 @@ class CommandeFournisseur extends CommonOrder
* @param User $user Object user that modify
* @param int $delivery_date Delivery date
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <0 if ko, >0 if ok
+ * @return int Return integer <0 if ko, >0 if ok
* @deprecated Use setDeliveryDate
*/
public function set_date_livraison($user, $delivery_date, $notrigger = 0)
@@ -2619,7 +2619,7 @@ class CommandeFournisseur extends CommonOrder
* @param User $user Objet utilisateur qui modifie
* @param int $id_projet Delivery date
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function set_id_projet($user, $id_projet, $notrigger = 0)
{
@@ -2788,7 +2788,7 @@ class CommandeFournisseur extends CommonOrder
* @param string $fk_unit Code of the unit to use. Null to use the default one
* @param double $pu_ht_devise Unit price in currency
* @param string $ref_supplier Supplier ref
- * @return int < 0 if error, > 0 if ok
+ * @return int Return integer < 0 if error, > 0 if ok
*/
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
{
@@ -3097,7 +3097,7 @@ class CommandeFournisseur extends CommonOrder
/**
* Charge indicateurs this->nb de tableau de bord
*
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function load_state_board()
{
@@ -3137,7 +3137,7 @@ class CommandeFournisseur extends CommonOrder
*
* @param User $user Objet user
* @param int $mode "opened", "awaiting" for orders awaiting reception
- * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
+ * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode = 'opened')
{
@@ -3239,7 +3239,7 @@ class CommandeFournisseur extends CommonOrder
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
- * @return int < 0 if KO, 0 = no doc generated, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 = no doc generated, > 0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
@@ -3412,7 +3412,7 @@ class CommandeFournisseur extends CommonOrder
* @param User $user User action
* @param int $closeopenorder Close if received
* @param string $comment Comment
- * @return int <0 if KO, 0 if not applicable, >0 if OK
+ * @return int Return integer <0 if KO, 0 if not applicable, >0 if OK
*/
public function calcAndSetStatusDispatch(User $user, $closeopenorder = 1, $comment = '')
{
@@ -3542,7 +3542,7 @@ class CommandeFournisseur extends CommonOrder
* Note: For a dedicated shipment, the fetch_lines can be used to load the qty_asked and qty_shipped. This function is use to return qty_shipped cumulated for the order
*
* @param int $filtre_statut Filter on shipment status
- * @return int <0 if KO, Nb of lines found if OK
+ * @return int Return integer <0 if KO, Nb of lines found if OK
*/
public function loadReceptions($filtre_statut = -1)
{
@@ -3975,7 +3975,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
* Update the line object into db
*
* @param int $notrigger 1 = disable triggers
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function update($notrigger = 0)
{
diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php
index ac232bd2eb1..275fbb48d0a 100644
--- a/htdocs/fourn/class/fournisseur.facture-rec.class.php
+++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php
@@ -83,6 +83,11 @@ class FactureFournisseurRec extends CommonInvoice
public $ref_supplier;
public $socid;
+ /**
+ * @deprecated
+ */
+ public $fk_soc;
+
public $suspended; // status
/**
@@ -255,7 +260,7 @@ class FactureFournisseurRec extends CommonInvoice
* @param User $user User object
* @param int $facFournId Id invoice
* @param int $notrigger No trigger
- * @return int <0 if KO, id of invoice created if OK
+ * @return int Return integer <0 if KO, id of invoice created if OK
*/
public function create($user, $facFournId, $notrigger = 0)
{
@@ -481,7 +486,7 @@ class FactureFournisseurRec extends CommonInvoice
*
* @param User $user User
* @param int $notrigger No trigger
- * @return int <0 if KO, Id of line if OK
+ * @return int Return integer <0 if KO, Id of line if OK
*/
public function update(User $user, $notrigger = 0)
{
@@ -491,8 +496,10 @@ class FactureFournisseurRec extends CommonInvoice
$sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "")."'," ;
$sql .= " ref_supplier = '". (!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "")."',";
$sql .= " entity = ". (!empty($this->entity) ? ((int) $this->entity) : 1) . ',';
- if ($this->fk_soc > 0) {
- $sql .= " fk_soc = ". (int) $this->fk_soc. ',';
+ if (!empty($this->socid) && $this->socid > 0) {
+ $sql .= " fk_soc = ". ((int) $this->socid). ',';
+ } elseif (!empty($this->fk_soc) && $this->fk_soc > 0) { // For backward compatibility
+ $sql .= " fk_soc = ". ((int) $this->fk_soc). ',';
}
$sql .= " suspended = ". (!empty($this->suspended) ? ((int) $this->suspended) : 0) . ',';
$sql .= " libelle = ". (!empty($this->libelle) ? "'".$this->db->escape($this->libelle)."'" : 'NULL') . ",";
@@ -872,7 +879,7 @@ class FactureFournisseurRec extends CommonInvoice
* @param int $rang Position of line
* @param string $fk_unit Unit
* @param int $pu_ht_devise Unit price in currency
- * @return int <0 if KO, Id of line if OK
+ * @return int Return integer <0 if KO, Id of line if OK
* @throws Exception
*/
public function addline($fk_product, $ref, $label, $desc, $pu_ht, $pu_ttc, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $type = 0, $date_start = 0, $date_end = 0, $info_bits = 0, $special_code = 0, $rang = -1, $fk_unit = null, $pu_ht_devise = 0)
@@ -1065,7 +1072,7 @@ class FactureFournisseurRec extends CommonInvoice
* @param string $fk_unit Unit
* @param double $pu_ht_devise Unit price in currency
* @param double $pu_ttc Unit price TTC (> 0 even for credit note)
- * @return int <0 if KO, Id of line if OK
+ * @return int Return integer <0 if KO, Id of line if OK
* @throws Exception
*/
public function updateline($rowid, $fk_product, $ref, $label, $desc, $pu_ht, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $type = 0, $date_start = 0, $date_end = 0, $info_bits = 0, $special_code = 0, $rang = -1, $fk_unit = null, $pu_ht_devise = 0, $pu_ttc = 0)
@@ -2148,7 +2155,7 @@ class FactureFournisseurLigneRec extends CommonObjectLine
*
* @param User $user User
* @param int $notrigger No trigger
- * @return int <0 if KO, Id of line if OK
+ * @return int Return integer <0 if KO, Id of line if OK
*/
public function update(User $user, $notrigger = 0)
{
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 49aafcf9378..26a73d35472 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1554,7 +1554,7 @@ class FactureFournisseur extends CommonInvoice
* @param User $user Object user
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
* @param string $close_note Comment informs if the class has been paid while payment is incomplete. Not implementd yet.
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function set_paid($user, $close_code = '', $close_note = '')
{
@@ -1569,7 +1569,7 @@ class FactureFournisseur extends CommonInvoice
* @param User $user Object user
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
* @param string $close_note Comment informs if the class has been paid while payment is incomplete. Not implementd yet.
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function setPaid($user, $close_code = '', $close_note = '')
{
@@ -1632,7 +1632,7 @@ class FactureFournisseur extends CommonInvoice
* @deprecated
* @see setUnpaid()
* @param User $user Object user that change status
- * @return int <0 si ok, >0 si ok
+ * @return int Return integer <0 si ok, >0 si ok
*/
public function set_unpaid($user)
{
@@ -1647,7 +1647,7 @@ class FactureFournisseur extends CommonInvoice
* or when the invoice was canceled and reopened.
*
* @param User $user Object user that change status
- * @return int <0 si ok, >0 si ok
+ * @return int Return integer <0 si ok, >0 si ok
*/
public function setUnpaid($user)
{
@@ -1750,7 +1750,7 @@ class FactureFournisseur extends CommonInvoice
* @param string $force_number Reference to force on invoice
* @param int $idwarehouse Id of warehouse for stock change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <0 if KO, =0 if nothing to do, >0 if OK
+ * @return int Return integer <0 if KO, =0 if nothing to do, >0 if OK
*/
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0)
{
@@ -2679,7 +2679,7 @@ class FactureFournisseur extends CommonInvoice
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Object user
- * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
+ * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user)
{
@@ -3213,7 +3213,7 @@ class FactureFournisseur extends CommonInvoice
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
@@ -3640,7 +3640,7 @@ class SupplierInvoiceLine extends CommonObjectLine
* Retrieves a supplier invoice line
*
* @param int $rowid Line id
- * @return int <0 KO; 0 NOT FOUND; 1 OK
+ * @return int Return integer <0 KO; 0 NOT FOUND; 1 OK
*/
public function fetch($rowid)
{
@@ -4125,7 +4125,7 @@ class SupplierInvoiceLine extends CommonObjectLine
/**
* Mise a jour de l'objet ligne de commande en base
*
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function update_total()
{
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 7c5fc258fa7..26751c291d7 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -164,7 +164,7 @@ class ProductFournisseur extends Product
* Remove all prices for this couple supplier-product
*
* @param int $id_fourn Supplier Id
- * @return int < 0 if error, > 0 if ok
+ * @return int Return integer < 0 if error, > 0 if ok
*/
public function remove_fournisseur($id_fourn)
{
@@ -266,7 +266,7 @@ class ProductFournisseur extends Product
* @param string $barcode Barcode
* @param int $fk_barcode_type Barcode type
* @param array $options Extrafields of product fourn price
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '', $options = array())
{
@@ -583,7 +583,7 @@ class ProductFournisseur extends Product
*
* @param int $rowid Line id
* @param int $ignore_expression Ignores the math expression for calculating price and uses the db value instead
- * @return int < 0 if KO, 0 if OK but not found, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 if OK but not found, > 0 if OK
*/
public function fetch_product_fournisseur_price($rowid, $ignore_expression = 0)
{
@@ -794,7 +794,7 @@ class ProductFournisseur extends Product
* @param int $prodid Product id
* @param int $qty Minimum quantity
* @param int $socid get min price for specific supplier
- * @return int <0 if KO, 0=Not found of no product id provided, >0 if OK
+ * @return int Return integer <0 if KO, 0=Not found of no product id provided, >0 if OK
* @see list_product_fournisseur_price()
*/
public function find_min_price_product_fournisseur($prodid, $qty = 0, $socid = 0)
@@ -1367,7 +1367,7 @@ class ProductFournisseur extends Product
* @param int $fk_multicurrency key multi currency
* @param string $multicurrency_code Currency code
*
- * @return int < 0 NOK > 0 OK
+ * @return int Return integer < 0 NOK > 0 OK
*/
private function logPrice($user, $datec, $buyprice, $qty, $multicurrency_buyprice = null, $multicurrency_unitBuyPrice = null, $multicurrency_tx = null, $fk_multicurrency = null, $multicurrency_code = null)
{
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 83cba47fddb..37e937bbca0 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -96,7 +96,7 @@ class PaiementFourn extends Paiement
* @param int $id Id if payment to get
* @param string $ref Ref of payment to get
* @param int $fk_bank Id of bank line associated to payment
- * @return int <0 if KO, -2 if not found, >0 if OK
+ * @return int Return integer <0 if KO, -2 if not found, >0 if OK
*/
public function fetch($id, $ref = '', $fk_bank = '')
{
@@ -429,7 +429,7 @@ class PaiementFourn extends Paiement
* @TODO Add User $user as first param
*
* @param int $notrigger No trigger
- * @return int <0 si ko, >0 si ok
+ * @return int Return integer <0 si ko, >0 si ok
*/
public function delete($notrigger = 0)
{
@@ -833,7 +833,7 @@ class PaiementFourn extends Paiement
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
- * @return int <0 if KO, 0 if nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index dda72e38976..a65fca4d55c 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -2026,7 +2026,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 1f0b87462d0..c1fac0b66e5 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -101,7 +101,7 @@ $mesg = '';
if ($action == 'uploadfile') {
// set up a connection or die
if (!$conn_id) {
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
$resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive);
$conn_id = $resultarray['conn_id'];
$ok = $resultarray['ok'];
@@ -131,7 +131,7 @@ if ($action == 'uploadfile') {
if ($action == 'addfolder') {
// set up a connection or die
if (!$conn_id) {
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
$resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive);
$conn_id = $resultarray['conn_id'];
$ok = $resultarray['ok'];
@@ -173,7 +173,7 @@ if ($action == 'add' && $user->hasRight('ftp', 'setup')) {
if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes') {
// set up a connection or die
if (!$conn_id) {
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
$resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive);
$conn_id = $resultarray['conn_id'];
$ok = $resultarray['ok'];
@@ -201,7 +201,7 @@ if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes') {
if (GETPOST("const", 'array') && GETPOST("delete") && GETPOST("delete") == $langs->trans("Delete")) {
// set up a connection or die
if (!$conn_id) {
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
$resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive);
$conn_id = $resultarray['conn_id'];
$ok = $resultarray['ok'];
@@ -240,7 +240,7 @@ if (GETPOST("const", 'array') && GETPOST("delete") && GETPOST("delete") == $lang
if ($action == 'confirm_deletesection' && $confirm == 'yes') {
// set up a connection or die
if (!$conn_id) {
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
$resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive);
$conn_id = $resultarray['conn_id'];
$ok = $resultarray['ok'];
@@ -270,7 +270,7 @@ if ($action == 'confirm_deletesection' && $confirm == 'yes') {
if ($action == 'download') {
// set up a connection or die
if (!$conn_id) {
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
$resultarray = dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso, $ftp_passive);
$conn_id = $resultarray['conn_id'];
$ok = $resultarray['ok'];
@@ -454,7 +454,7 @@ if (!function_exists('ftp_connect')) {
//$type = ftp_systype($conn_id);
$newsection = $section;
- $newsectioniso = utf8_decode($section);
+ $newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
//$newsection='/home';
// List content of directory ($newsection = '/', '/home', ...)
@@ -497,12 +497,12 @@ if (!function_exists('ftp_connect')) {
$i = 0;
$nbofentries = 0;
while ($i < $nboflines && $i < 1000) {
- $vals = preg_split('@ +@', utf8_encode($buff[$i]), 9);
+ $vals = preg_split('@ +@', mb_convert_encoding($buff[$i], 'UTF-8', 'ISO-8859-1'), 9);
//$vals=preg_split('@ +@','drwxr-xr-x 2 root root 4096 Aug 30 2008 backup_apollon1',9);
$file = $vals[8];
if (empty($file)) {
$rawlisthasfailed = true;
- $file = utf8_encode($contents[$i]);
+ $file = mb_convert_encoding($contents[$i], 'UTF-8', 'ISO-8859-1');
}
if ($file == '.' || ($file == '..' && $section == '/')) {
@@ -530,7 +530,7 @@ if (!function_exists('ftp_connect')) {
//print preg_match('@[\\\/]$@',"aaa\\").'Y';
$remotefile = $section.(preg_match('@[\\\/]$@', $section) ? '' : '/').preg_replace('@^[\\\/]@', '', $file);
//print 'A'.$remotefile.'A';
- $newremotefileiso = utf8_decode($remotefile);
+ $newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
//print 'Z'.$newremotefileiso.'Z';
$is_directory = ftp_isdir($conn_id, $newremotefileiso);
}
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 9c460550e85..5e845cf951e 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -2404,7 +2404,7 @@ class Holiday extends CommonObject
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
- * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
+ * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user)
{
diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php
index 2594d26f26b..c9d03da8924 100644
--- a/htdocs/hrm/class/establishment.class.php
+++ b/htdocs/hrm/class/establishment.class.php
@@ -285,7 +285,7 @@ class Establishment extends CommonObject
* Load an object from database
*
* @param int $id Id of record to load
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch($id)
{
diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php
index f2bdfc2021c..0214c2f51f1 100644
--- a/htdocs/hrm/class/evaluation.class.php
+++ b/htdocs/hrm/class/evaluation.class.php
@@ -512,7 +512,7 @@ class Evaluation extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -686,7 +686,7 @@ class Evaluation extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -703,7 +703,7 @@ class Evaluation extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php
index d20877abb4f..2778ac9e76c 100644
--- a/htdocs/hrm/class/evaluationdet.class.php
+++ b/htdocs/hrm/class/evaluationdet.class.php
@@ -483,7 +483,7 @@ class EvaluationLine extends CommonObjectLine
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -640,7 +640,7 @@ class EvaluationLine extends CommonObjectLine
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -664,7 +664,7 @@ class EvaluationLine extends CommonObjectLine
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php
index 67b513f745e..2a306d5b8be 100644
--- a/htdocs/hrm/class/job.class.php
+++ b/htdocs/hrm/class/job.class.php
@@ -481,7 +481,7 @@ class Job extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -675,7 +675,7 @@ class Job extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -699,7 +699,7 @@ class Job extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php
index cdb8a18e1d8..a1bd5183cae 100644
--- a/htdocs/hrm/class/position.class.php
+++ b/htdocs/hrm/class/position.class.php
@@ -491,7 +491,7 @@ class Position extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -648,7 +648,7 @@ class Position extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -672,7 +672,7 @@ class Position extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php
index e38a6c5915b..486e47f8b38 100644
--- a/htdocs/hrm/class/skill.class.php
+++ b/htdocs/hrm/class/skill.class.php
@@ -401,7 +401,7 @@ class Skill extends CommonObject
/**
* Load object lines in memory from the database
*
- * @return array|int <0 if KO, array of skill level found
+ * @return array|int Return integer <0 if KO, array of skill level found
*/
public function fetchLines()
{
@@ -549,7 +549,7 @@ class Skill extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -706,7 +706,7 @@ class Skill extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -730,7 +730,7 @@ class Skill extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php
index 8aa70255356..e658e75b265 100644
--- a/htdocs/hrm/class/skilldet.class.php
+++ b/htdocs/hrm/class/skilldet.class.php
@@ -472,7 +472,7 @@ class Skilldet extends CommonObjectLine
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -629,7 +629,7 @@ class Skilldet extends CommonObjectLine
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -653,7 +653,7 @@ class Skilldet extends CommonObjectLine
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php
index 74a97d7c732..dffb5600e46 100644
--- a/htdocs/hrm/class/skillrank.class.php
+++ b/htdocs/hrm/class/skillrank.class.php
@@ -521,7 +521,7 @@ class SkillRank extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -678,7 +678,7 @@ class SkillRank extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -702,7 +702,7 @@ class SkillRank extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php
index 7c22551dfae..c49e60c030b 100644
--- a/htdocs/hrm/evaluation_list.php
+++ b/htdocs/hrm/evaluation_list.php
@@ -782,7 +782,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php
index 074293417b2..1d2ed7ab515 100644
--- a/htdocs/hrm/job_list.php
+++ b/htdocs/hrm/job_list.php
@@ -748,7 +748,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php
index bf5043af97b..0076c3521a4 100644
--- a/htdocs/hrm/position.php
+++ b/htdocs/hrm/position.php
@@ -745,7 +745,7 @@ if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'
print '' . "\n";
- if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+ if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php
index 2a9e1f1031e..461e0259a82 100644
--- a/htdocs/hrm/position_list.php
+++ b/htdocs/hrm/position_list.php
@@ -774,7 +774,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php
index 199f113fbd9..df0a9c26add 100644
--- a/htdocs/hrm/skill_card.php
+++ b/htdocs/hrm/skill_card.php
@@ -829,7 +829,7 @@ if ($action != "create" && $action != "edit") {
print '' . "\n";
- // if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+ // if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
// $hidegeneratedfilelistifempty = 1;
// if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
// $hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php
index 4078e13f63e..7d562077b59 100644
--- a/htdocs/hrm/skill_list.php
+++ b/htdocs/hrm/skill_list.php
@@ -767,7 +767,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index a8d4000bef2..b3159796514 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -713,7 +713,7 @@ if ($step == 3 && $datatoimport) {
// readdir return value in ISO and we want UTF8 in memory
if (!utf8_check($file)) {
- $file = utf8_encode($file);
+ $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1');
}
if (preg_match('/^\./', $file)) {
@@ -2468,7 +2468,7 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
}
if ($example) {
if (!utf8_check($example)) {
- $example = utf8_encode($example);
+ $example = mb_convert_encoding($example, 'UTF-8', 'ISO-8859-1');
}
if (!empty($conf->dol_optimize_smallscreen)) {
//print ' ';
diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php
index 7e0ebd94da4..4f6208aa604 100644
--- a/htdocs/includes/nusoap/lib/nusoap.php
+++ b/htdocs/includes/nusoap/lib/nusoap.php
@@ -6936,7 +6936,7 @@ class nusoap_parser extends nusoap_base {
// raw UTF-8 that, e.g., might not map to iso-8859-1
// TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");
if($this->decode_utf8){
- $data = utf8_decode($data);
+ $data = mb_convert_encoding($data, 'ISO-8859-1');
}
}
$this->message[$pos]['cdata'] .= $data;
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index e30dd15cd1d..98cdcf0a2fd 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -330,7 +330,7 @@ class Odf
private function encode_chars($text, $encode = false, $charset = '')
{
$newtext = $encode ? htmlspecialchars($text, ENT_QUOTES | ENT_XML1) : $text;
- $newtext = ($charset == 'ISO-8859') ? utf8_encode($newtext) : $newtext;
+ $newtext = ($charset == 'ISO-8859') ? mb_convert_encoding($newtext, 'UTF-8', 'ISO-8859-1') : $newtext;
return $newtext;
}
diff --git a/htdocs/includes/sabre/sabre/http/lib/functions.php b/htdocs/includes/sabre/sabre/http/lib/functions.php
index 197a9e6612a..728bbc13240 100644
--- a/htdocs/includes/sabre/sabre/http/lib/functions.php
+++ b/htdocs/includes/sabre/sabre/http/lib/functions.php
@@ -421,7 +421,7 @@ function decodePathSegment(string $path): string
switch ($encoding) {
case 'ISO-8859-1':
- $path = utf8_encode($path);
+ $path = mb_convert_encoding($path, 'UTF-8', 'ISO-8859-1');
}
return $path;
diff --git a/htdocs/includes/webklex/php-imap/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/htdocs/includes/webklex/php-imap/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
index b05b3652c40..b90b6abb9bf 100644
--- a/htdocs/includes/webklex/php-imap/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
+++ b/htdocs/includes/webklex/php-imap/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
@@ -1857,7 +1857,7 @@ trait Date
? (
\function_exists('mb_convert_encoding')
? mb_convert_encoding($formatted, 'UTF-8', mb_list_encodings())
- : utf8_encode($formatted)
+ : mb_convert_encoding($formatted, 'UTF-8', 'ISO-8859-1')
)
: $formatted;
}
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 982d46fa4aa..f96d7b8719e 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -2534,7 +2534,7 @@ function migrate_commande_deliveryaddress($db, $langs, $conf)
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
- * @return integer <0 if KO, 0=Bad version, >0 if OK
+ * @return integer Return integer <0 if KO, 0=Bad version, >0 if OK
*/
function migrate_restore_missing_links($db, $langs, $conf)
{
diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php
index 554be07eb97..9409ae0d40f 100644
--- a/htdocs/intracommreport/card.php
+++ b/htdocs/intracommreport/card.php
@@ -267,7 +267,7 @@ if ($id > 0 && $action != 'edit') {
// Type
print ' | | '.$langs->trans("Type").' | '.$object->declaration." |
\n";
- // Analysis Period
+ // Analysis period
print '| '.$langs->trans("AnalysisPeriod").' | '.$object->period.' | ';
print '
';
@@ -283,101 +283,6 @@ if ($id > 0 && $action != 'edit') {
print dol_get_fiche_end();
}
- /*
- switch($action) {
- case 'generateXML':
- $obj = new TDebProdouane($PDOdb);
- $obj->load($PDOdb, GETPOST('id_declaration'));
- $obj->generateXMLFile();
- break;
- case 'list':
- _liste($exporttype);
- break;
- case 'export':
- if ($exporttype == 'deb') _export_xml_deb($type_declaration, $year, str_pad($month, 2, 0, STR_PAD_LEFT));
- else _export_xml_des($type_declaration, $year, str_pad($month, 2, 0, STR_PAD_LEFT));
- default:
- if ($exporttype == 'deb') _print_form_deb();
- else _print_form_des();
- break;
- }
-
- function _print_form_des()
- {
- global $langs, $formother, $year, $month, $type_declaration;
-
- print load_fiche_titre($langs->trans("IntracommReportDESTitle"));
-
- print dol_get_fiche_head();
-
- print '';
- }
-
- function _export_xml_deb($type_declaration, $period_year, $period_month) {
-
- global $db, $conf;
-
- $obj = new TDebProdouane($db);
- $obj->entity = $conf->entity;
- $obj->mode = 'O';
- $obj->periode = $period_year.'-'.$period_month;
- $obj->type_declaration = $type_declaration;
- $obj->numero_declaration = $obj->getNextNumeroDeclaration();
- $obj->content_xml = $obj->getXML('O', $type_declaration, $period_year.'-'.$period_month);
- if(empty($obj->errors)) {
- $obj->save($PDOdb);
- $obj->generateXMLFile();
- }
- else setEventMessage($obj->errors, 'warnings');
- }
-
- function _export_xml_des($type_declaration, $period_year, $period_month) {
-
- global $PDOdb, $conf;
-
- $obj = new TDebProdouane($PDOdb);
- $obj->entity = $conf->entity;
- $obj->periode = $period_year.'-'.$period_month;
- $obj->type_declaration = $type_declaration;
- $obj->exporttype = 'des';
- $obj->numero_declaration = $obj->getNextNumeroDeclaration();
- $obj->content_xml = $obj->getXMLDes($period_year, $period_month, $type_declaration);
- if(empty($obj->errors)) {
- $obj->save($PDOdb);
- $obj->generateXMLFile();
- }
- else setEventMessage($obj->errors, 'warnings');
- }
- */
-
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php
index 28efdbf08fd..7512813ebae 100644
--- a/htdocs/intracommreport/class/intracommreport.class.php
+++ b/htdocs/intracommreport/class/intracommreport.class.php
@@ -482,8 +482,11 @@ class IntracommReport extends CommonObject
*/
public function generateXMLFile()
{
- $name = $this->periode.'.xml';
+ $name = $this->period.'.xml';
+
+ // TODO Must be stored into a dolibarr temp directory
$fname = sys_get_temp_dir().'/'.$name;
+
$f = fopen($fname, 'w+');
fwrite($f, $this->content_xml);
fclose($f);
@@ -495,6 +498,7 @@ class IntracommReport extends CommonObject
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: '.filesize($fname));
+
readfile($fname);
exit;
}
diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
index b140916d559..3fcc370b0dd 100644
--- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php
+++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
@@ -522,7 +522,7 @@ class KnowledgeRecord extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -679,7 +679,7 @@ class KnowledgeRecord extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -703,7 +703,7 @@ class KnowledgeRecord extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php
index 33c134a6ddd..1014f3f367b 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_list.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_list.php
@@ -839,7 +839,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b84828f9048..ec0d628d8cf 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2433,3 +2433,4 @@ ConfirmDeleteExtrafield=Do you confirm deletion of the field %s ? All data saved
ExtraFieldsSupplierInvoicesRec=Complementary attributes (templates invoices)
ExtraFieldsSupplierInvoicesLinesRec=Complementary attributes (invoice lines)
ParametersForTestEnvironment=Parameters for test environment
+TryToKeepOnly=Try to keep only %s
\ No newline at end of file
diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang
index 870ebeabf40..e6502c32c70 100644
--- a/htdocs/langs/en_US/workflow.lang
+++ b/htdocs/langs/en_US/workflow.lang
@@ -9,16 +9,16 @@ descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a sales order is closed (the new invoice will have same amount as the order)
descWORKFLOW_TICKET_CREATE_INTERVENTION=On ticket creation, automatically create an intervention.
# Autoclassify customer proposal or order
-descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposals as billed when a sales order is set to billed (and if the amount of the order is the same as the total amount of the signed linked proposal)
-descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposals as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the signed linked proposal)
-descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order)
-descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source sales orders as billed when a customer invoice is set to paid (and if the amount of the invoice is the same as the total amount of the linked order)
+descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposals as billed when a sales order is set to billed (and if the amount of the order is the same as the total amount of the signed linked proposals)
+descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposals as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the signed linked proposals)
+descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked sales orders). If you have 1 invoice validated for n orders, this may set all orders to billed too.
+descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source sales orders as billed when a customer invoice is set to paid (and if the amount of the invoice is the same as the total amount of the linked sales orders). If you have 1 invoice set billed for n orders, this may set all orders to billed too.
descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source sales orders as shipped when a shipment is validated (and if the quantity shipped by all shipments is the same as in the order to update)
descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED=Classify linked source sales order as shipped when a shipment is closed (and if the quantity shipped by all shipments is the same as in the order to update)
# Autoclassify purchase proposal
-descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked proposal)
+descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked proposals)
# Autoclassify purchase order
-descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order)
+descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked orders)
descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION=Classify linked source purchase order as received when a reception is validated (and if the quantity received by all receptions is the same as in the purchase order to update)
descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED=Classify linked source purchase order as received when a reception is closed (and if the quantity received by all rceptions is the same as in the purchase order to update)
# Autoclassify shipment
diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php
index a799f20185d..4830cca6d2e 100644
--- a/htdocs/loan/class/loan.class.php
+++ b/htdocs/loan/class/loan.class.php
@@ -131,7 +131,7 @@ class Loan extends CommonObject
* Load object in memory from database
*
* @param int $id id object
- * @return int <0 error , >=0 no error
+ * @return int Return integer <0 error , >=0 no error
*/
public function fetch($id)
{
@@ -182,7 +182,7 @@ class Loan extends CommonObject
* Create a loan into database
*
* @param User $user User making creation
- * @return int <0 if KO, id if OK
+ * @return int Return integer <0 if KO, id if OK
*/
public function create($user)
{
@@ -348,7 +348,7 @@ class Loan extends CommonObject
* Update loan
*
* @param User $user User who modified
- * @return int <0 if error, >0 if ok
+ * @return int Return integer <0 if error, >0 if ok
*/
public function update($user)
{
diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php
index 069a798bdd6..4ec3e2908b8 100644
--- a/htdocs/loan/class/loanschedule.class.php
+++ b/htdocs/loan/class/loanschedule.class.php
@@ -124,7 +124,7 @@ class LoanSchedule extends CommonObject
* Use this->amounts to have list of lines for the payment
*
* @param User $user User making payment
- * @return int <0 if KO, id of payment if OK
+ * @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user)
{
@@ -538,7 +538,7 @@ class LoanSchedule extends CommonObject
* lastpayment
*
* @param int $loanid Loan id
- * @return int < 0 if KO, Date > 0 if OK
+ * @return int Return integer < 0 if KO, Date > 0 if OK
*/
private function lastPayment($loanid)
{
diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php
index 6125e67afa2..08346ad502b 100644
--- a/htdocs/loan/class/paymentloan.class.php
+++ b/htdocs/loan/class/paymentloan.class.php
@@ -120,7 +120,7 @@ class PaymentLoan extends CommonObject
* Use this->amounts to have list of lines for the payment
*
* @param User $user User making payment
- * @return int <0 if KO, id of payment if OK
+ * @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user)
{
diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php
index bf040d51673..9c70a6a9200 100644
--- a/htdocs/mailmanspip/class/mailmanspip.class.php
+++ b/htdocs/mailmanspip/class/mailmanspip.class.php
@@ -288,7 +288,7 @@ class MailmanSpip
*
* @param Adherent $object Object with data (->email, ->pass, ->element, ->type)
* @param string $listes To force mailing-list (string separated with ,)
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function add_to_mailman($object, $listes = '')
{
@@ -358,7 +358,7 @@ class MailmanSpip
*
* @param Adherent $object Object with data (->email, ->pass, ->element, ->type)
* @param string $listes To force mailing-list (string separated with ,)
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function del_to_mailman($object, $listes = '')
{
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b15559f080c..9a98c9fc776 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -746,7 +746,7 @@ if (!defined('NOLOGIN')) {
// Check code
if (!$ok) {
- dol_syslog('Bad value for code, connexion refused');
+ dol_syslog('Bad value for code, connexion refused', LOG_NOTICE);
// Load translation files required by page
$langs->loadLangs(array('main', 'errors'));
@@ -854,7 +854,7 @@ if (!defined('NOLOGIN')) {
}
if (!$login) {
- dol_syslog('Bad password, connexion refused', LOG_DEBUG);
+ dol_syslog('Bad password, connexion refused (see a previous notice message for more info)', LOG_NOTICE);
// Load translation files required by page
$langs->loadLangs(array('main', 'errors'));
@@ -1657,7 +1657,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
* @param int $disablenoindex Disable noindex tag for meta robots
* @return void
*/
-function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disableforlogin = 0, $disablenofollow = 0, $disablenoindex = 0)
+function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $disableforlogin = 0, $disablenofollow = 0, $disablenoindex = 0)
{
global $db, $conf, $langs, $user, $mysoc, $hookmanager;
diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
index de16b676c00..62b2e8ce3f6 100644
--- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php
+++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
@@ -79,7 +79,7 @@ class ActionsMyModule extends CommonHookActions
* @param array $parameters Array of parameters
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action 'add', 'update', 'view'
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
@@ -97,7 +97,7 @@ class ActionsMyModule extends CommonHookActions
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
- * @return int < 0 on error, 0 on success, 1 to replace standard code
+ * @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function doActions($parameters, &$object, &$action, $hookmanager)
{
@@ -129,7 +129,7 @@ class ActionsMyModule extends CommonHookActions
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
- * @return int < 0 on error, 0 on success, 1 to replace standard code
+ * @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function doMassActions($parameters, &$object, &$action, $hookmanager)
{
@@ -162,7 +162,7 @@ class ActionsMyModule extends CommonHookActions
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
- * @return int < 0 on error, 0 on success, 1 to replace standard code
+ * @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function addMoreMassActions($parameters, &$object, &$action, $hookmanager)
{
@@ -192,7 +192,7 @@ class ActionsMyModule extends CommonHookActions
* @param array $parameters Array of parameters
* @param Object $object Object output on PDF
* @param string $action 'add', 'update', 'view'
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
@@ -220,7 +220,7 @@ class ActionsMyModule extends CommonHookActions
* @param array $parameters Array of parameters
* @param Object $pdfhandler PDF builder handler
* @param string $action 'add', 'update', 'view'
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
@@ -251,7 +251,7 @@ class ActionsMyModule extends CommonHookActions
* @param array $parameters Hook metadatas (context, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
- * @return int < 0 on error, 0 on success, 1 to replace standard code
+ * @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
*/
public function loadDataForCustomReports($parameters, &$action, $hookmanager)
{
@@ -291,7 +291,7 @@ class ActionsMyModule extends CommonHookActions
* @param array $parameters Hook metadatas (context, etc...)
* @param string $action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
@@ -319,7 +319,7 @@ class ActionsMyModule extends CommonHookActions
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string $action 'add', 'update', 'view'
* @param Hookmanager $hookmanager hookmanager
- * @return int <0 if KO,
+ * @return int Return integer <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 30490b92e6d..2c5307279ce 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -587,7 +587,7 @@ class MyObject extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -744,7 +744,7 @@ class MyObject extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -768,7 +768,7 @@ class MyObject extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
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 b554c6aa578..4999067b62c 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
@@ -96,7 +96,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
* This is the main function that returns the array of emails
*
* @param int $mailing_id Id of emailing
- * @return int <0 if error, number of emails added if ok
+ * @return int Return integer <0 if error, number of emails added if ok
*/
public function add_to_target($mailing_id)
{
diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
index 9420c83b8c0..392addd84d0 100644
--- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
+++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
@@ -86,7 +86,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
* @param User $user Object user
* @param Translate $langs Object langs
* @param Conf $conf Object conf
- * @return int <0 if KO, 0 if no triggered ran, >0 if OK
+ * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index c7904ea3d93..812235c48d1 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -866,7 +866,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 86273c415d0..4d9f5a2529d 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -294,7 +294,7 @@ class Mo extends CommonObject
*
* @param User $user User that creates
* @param bool $notrigger false=launch triggers after, true=disable triggers
- * @return int <=0 if KO, Id of created object if OK
+ * @return int Return integer <=0 if KO, Id of created object if OK
*/
public function create(User $user, $notrigger = false)
{
@@ -1012,7 +1012,7 @@ class Mo extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -1164,7 +1164,7 @@ class Mo extends CommonObject
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @param bool $also_cancel_consumed_and_produced_lines true if the consumed and produced lines will be deleted (and stocks incremented/decremented back) (false by default)
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0, $also_cancel_consumed_and_produced_lines = false)
{
@@ -1211,7 +1211,7 @@ class Mo extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
@@ -1237,7 +1237,7 @@ class Mo extends CommonObject
* @param bool $mode Type line supported (0 by default) (0: consumed and produced lines; 1: consumed lines; 2: produced lines)
* @param bool $also_delete_lines true if the consumed/produced lines is deleted (false by default)
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancelConsumedAndProducedLines($user, $mode = 0, $also_delete_lines = false, $notrigger = 0)
{
diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php
index 7e04c554c3d..f1476ac6605 100644
--- a/htdocs/mrp/mo_list.php
+++ b/htdocs/mrp/mo_list.php
@@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// load mrp libraries
require_once __DIR__.'/class/mo.class.php';
@@ -766,7 +767,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php
index c03a8ab9952..a7ef2153c9f 100644
--- a/htdocs/multicurrency/class/multicurrency.class.php
+++ b/htdocs/multicurrency/class/multicurrency.class.php
@@ -237,7 +237,7 @@ class MultiCurrency extends CommonObject
/**
* Load all rates in object from the database
*
- * @return int <0 if KO, >=0 if OK
+ * @return int Return integer <0 if KO, >=0 if OK
*/
public function fetchAllCurrencyRate()
{
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 2d4fa98a4ef..dddbb7fc49b 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -553,7 +553,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php
index 05be2893076..4c54741c94d 100644
--- a/htdocs/partnership/class/partnership.class.php
+++ b/htdocs/partnership/class/partnership.class.php
@@ -555,7 +555,7 @@ class Partnership extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -687,7 +687,7 @@ class Partnership extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function approve($user, $notrigger = 0)
{
@@ -845,7 +845,7 @@ class Partnership extends CommonObject
* @param User $user Object user that modify
* @param string $reasondeclinenote Reason decline
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function refused($user, $reasondeclinenote = '', $notrigger = 0)
{
@@ -872,7 +872,7 @@ class Partnership extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -896,7 +896,7 @@ class Partnership extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php
index 13f6ddc438e..a2e612a88c5 100644
--- a/htdocs/partnership/partnership_list.php
+++ b/htdocs/partnership/partnership_list.php
@@ -1060,7 +1060,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 1297f2a6752..bbec24b64de 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1458,7 +1458,7 @@ class Product extends CommonObject
*
* @param User $user User (object) deleting product
* @param int $notrigger Do not execute trigger
- * @return int < 0 if KO, 0 = Not possible, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 = Not possible, > 0 if OK
*/
public function delete(User $user, $notrigger = 0)
{
@@ -1760,7 +1760,7 @@ class Product extends CommonObject
*
* @param string $type It can be 'buy', 'buy_intra', 'buy_export', 'sell', 'sell_intra' or 'sell_export'
* @param string $value Accountancy code
- * @return int <0 KO >0 OK
+ * @return int Return integer <0 KO >0 OK
*/
public function setAccountancyCode($type, $value)
{
@@ -2082,7 +2082,7 @@ class Product extends CommonObject
* @param int $product_id Filter on a particular product id
* @param string $fourn_ref Filter on a supplier price ref. 'none' to exclude ref in search.
* @param int $fk_soc If of supplier
- * @return int <-1 if KO, -1 if qty not enough, 0 if OK but nothing found, id_product if OK and found. May also initialize some properties like (->ref_supplier, buyprice, fourn_pu, vatrate_supplier...)
+ * @return int Return integer <-1 if KO, -1 if qty not enough, 0 if OK but nothing found, id_product if OK and found. May also initialize some properties like (->ref_supplier, buyprice, fourn_pu, vatrate_supplier...)
* @see getSellPrice(), find_min_price_product_fournisseur()
*/
public function get_buyprice($prodfournprice, $qty, $product_id = 0, $fourn_ref = '', $fk_soc = 0)
@@ -3836,7 +3836,7 @@ class Product extends CommonObject
* @param string $sql Request to execute
* @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities
* @param int $year Year (0=current year, -1=all years)
- * @return array|int <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array|int Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
private function _get_stats($sql, $mode, $year = 0)
{
@@ -3914,7 +3914,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_vente($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -3968,7 +3968,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_achat($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4021,7 +4021,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_propal($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4073,7 +4073,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_propalsupplier($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4126,7 +4126,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_order($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4178,7 +4178,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_ordersupplier($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4230,7 +4230,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_contract($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4285,7 +4285,7 @@ class Product extends CommonObject
* @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only
* @param int $year Year (0=last 12 month, -1=all years)
* @param string $morefilter More sql filters
- * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
+ * @return array Return integer <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11
*/
public function get_nb_mos($socid, $mode, $filteronproducttype = -1, $year = 0, $morefilter = '')
{
@@ -4338,7 +4338,7 @@ class Product extends CommonObject
* @param int $qty Quantity
* @param int $incdec 1=Increase/decrease stock of child when parent stock increase/decrease
* @param int $notrigger Disable triggers
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
*/
public function add_sousproduit($id_pere, $id_fils, $qty, $incdec = 1, $notrigger = 0)
{
@@ -4411,7 +4411,7 @@ class Product extends CommonObject
* @param int $qty Quantity
* @param int $incdec 1=Increase/decrease stock of child when parent stock increase/decrease
* @param int $notrigger Disable triggers
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
*/
public function update_sousproduit($id_pere, $id_fils, $qty, $incdec = 1, $notrigger = 0)
{
@@ -4463,7 +4463,7 @@ class Product extends CommonObject
* @param int $fk_parent Id of parent product (child will no more be linked to it)
* @param int $fk_child Id of child product
* @param int $notrigger Disable triggers
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
*/
public function del_sousproduit($fk_parent, $fk_child, $notrigger = 0)
{
@@ -4566,7 +4566,7 @@ class Product extends CommonObject
* @param int $id_fourn Supplier id
* @param string $ref_fourn Supplier ref
* @param float $quantity Quantity minimum for price
- * @return int < 0 if KO, 0 if link already exists for this product, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 if link already exists for this product, > 0 if OK
*/
public function add_fournisseur($user, $id_fourn, $ref_fourn, $quantity)
{
@@ -4695,7 +4695,7 @@ class Product extends CommonObject
*
* @param int $fromId Id product source
* @param int $toId Id product target
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
*/
public function clone_price($fromId, $toId)
{
@@ -4808,7 +4808,7 @@ class Product extends CommonObject
*
* @param int $fromId Id produit source
* @param int $toId Id produit cible
- * @return int < 0 si erreur, > 0 si ok
+ * @return int Return integer < 0 si erreur, > 0 si ok
*/
public function clone_fournisseurs($fromId, $toId)
{
@@ -5672,7 +5672,7 @@ class Product extends CommonObject
* You can also filter on 'warehouseclosed', 'warehouseopen', 'warehouseinternal'
* @param int $includedraftpoforvirtual Include draft status of PO for virtual stock calculation
* @param int $dateofvirtualstock Date of virtual stock
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
* @see load_virtual_stock(), loadBatchInfo()
*/
public function load_stock($option = '', $includedraftpoforvirtual = null, $dateofvirtualstock = null)
@@ -5751,7 +5751,7 @@ class Product extends CommonObject
*
* @param int $includedraftpoforvirtual Include draft status and not yet approved Purchase Orders for virtual stock calculation
* @param int $dateofvirtualstock Date of virtual stock
- * @return int < 0 if KO, > 0 if OK
+ * @return int Return integer < 0 if KO, > 0 if OK
* @see load_stock(), loadBatchInfo()
*/
public function load_virtual_stock($includedraftpoforvirtual = null, $dateofvirtualstock = null)
@@ -5975,7 +5975,7 @@ class Product extends CommonObject
if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) {
if (!utf8_check($file)) {
- $file = utf8_encode($file); // To be sure data is stored in UTF8 in memory
+ $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory
}
if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) {
return true;
@@ -6008,7 +6008,7 @@ class Product extends CommonObject
if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) {
if (!utf8_check($file)) {
- $file = utf8_encode($file); // readdir returns ISO
+ $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // readdir returns ISO
}
if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) {
$nbphoto++;
@@ -6253,7 +6253,7 @@ class Product extends CommonObject
* Returns the text label from units dictionary
*
* @param string $type Label type (long or short)
- * @return string|int <0 if ko, label if ok
+ * @return string|int Return integer <0 if ko, label if ok
*/
public function getLabelOfUnit($type = 'long')
{
diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php
index 7374673fa02..20e3932ce33 100644
--- a/htdocs/product/class/productbatch.class.php
+++ b/htdocs/product/class/productbatch.class.php
@@ -446,7 +446,7 @@ class Productbatch extends CommonObject
* @param int $fk_product_stock id product_stock for objet
* @param int $with_qty 1 = doesn't return line with 0 quantity
* @param int $fk_product If set to a product id, get eatby and sellby from table llx_product_lot
- * @return array|int <0 if KO, array of batch
+ * @return array|int Return integer <0 if KO, array of batch
*/
public static function findAll($dbs, $fk_product_stock, $with_qty = 0, $fk_product = 0)
{
@@ -548,7 +548,7 @@ class Productbatch extends CommonObject
* @param int $qty_min [=NULL] Minimum quantity
* @param string $sortfield [=NULL] List of sort fields, separated by comma. Example: 't1.fielda,t2.fieldb'
* @param string $sortorder [=NULL] Sort order, separated by comma. Example: 'ASC,DESC';
- * @return int|array <0 if KO, array of batch
+ * @return int|array Return integer <0 if KO, array of batch
*
* @throws Exception
*/
diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php
index 392ba0b3aa6..255582e62c3 100644
--- a/htdocs/product/class/productcustomerprice.class.php
+++ b/htdocs/product/class/productcustomerprice.class.php
@@ -811,7 +811,7 @@ class ProductCustomerPrice extends CommonObject
*
* @param User $user User that modifies
* @param int $forceupdateaffiliate update price on each soc child
- * @return int <0 if KO, 0 = action disabled, >0 if OK
+ * @return int Return integer <0 if KO, 0 = action disabled, >0 if OK
*/
public function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate)
{
diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php
index 29a242b0238..a8b2f56c553 100644
--- a/htdocs/product/class/productfournisseurprice.class.php
+++ b/htdocs/product/class/productfournisseurprice.class.php
@@ -424,7 +424,7 @@ class ProductFournisseurPrice extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int <=0 if OK, 0=Nothing done, >0 if KO
+ * @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@@ -566,7 +566,7 @@ class ProductFournisseurPrice extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@@ -583,7 +583,7 @@ class ProductFournisseurPrice extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
- * @return int <0 if KO, 0=Nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{
diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php
index 8c237b0d1bd..ed4f30b099f 100644
--- a/htdocs/product/dynamic_price/class/price_expression.class.php
+++ b/htdocs/product/dynamic_price/class/price_expression.class.php
@@ -127,7 +127,7 @@ class PriceExpression
* Load object in memory from the database
*
* @param int $id Id object
- * @return int < 0 if KO, 0 if OK but not found, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 if OK but not found, > 0 if OK
*/
public function fetch($id)
{
@@ -199,7 +199,7 @@ class PriceExpression
* Returns any existing rowid with specified title
*
* @param String $title Title of expression
- * @return int < 0 if KO, 0 if OK but not found, > 0 rowid
+ * @return int Return integer < 0 if KO, 0 if OK but not found, > 0 rowid
*/
public function find_title($title)
{
diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php
index d6575223866..d9d7a340551 100644
--- a/htdocs/product/dynamic_price/class/price_global_variable.class.php
+++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php
@@ -138,7 +138,7 @@ class PriceGlobalVariable
* Load object in memory from the database
*
* @param int $id Id object
- * @return int < 0 if KO, 0 if OK but not found, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 if OK but not found, > 0 if OK
*/
public function fetch($id)
{
diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
index d3fc23e7357..5b7aee5d5f6 100644
--- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
+++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
@@ -154,7 +154,7 @@ class PriceGlobalVariableUpdater
* Load object in memory from the database
*
* @param int $id Id object
- * @return int < 0 if KO, 0 if OK but not found, > 0 if OK
+ * @return int Return integer < 0 if KO, 0 if OK but not found, > 0 if OK
*/
public function fetch($id)
{
@@ -445,7 +445,7 @@ class PriceGlobalVariableUpdater
/**
* Handles the processing of this updater
*
- * @return int <0 if KO, 0 if OK but no global variable found, >0 if OK
+ * @return int Return integer <0 if KO, 0 if OK but no global variable found, >0 if OK
*/
public function process()
{
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 6ee9885c76e..b97e589a001 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -784,7 +784,7 @@ print ''."\n";
print ''."\n";
// no inventory docs yet
/*
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index fc1baf52648..7c018077e5d 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -182,7 +182,7 @@ class MouvementStock extends CommonObject
* @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct)
* @param int $donotcleanemptylines Do not clean lines in stock table with qty=0 (because we want to have this done by the caller)
* @param boolean $force_update_batch Allows to add batch stock movement even if $product doesn't use batch anymore
- * @return int <0 if KO, 0 if fk_product is null or product id does not exists, >0 if OK
+ * @return int Return integer <0 if KO, 0 if fk_product is null or product id does not exists, >0 if OK
*/
public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0, $donotcleanemptylines = 0, $force_update_batch = false)
{
@@ -752,7 +752,7 @@ class MouvementStock extends CommonObject
* @param string $label Label of movement
* @param string $inventorycode Inventory code
* @param integer|string $datem Force date of movement
- * @return int <0 if KO, 0 if OK
+ * @return int Return integer <0 if KO, 0 if OK
*/
private function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '')
{
@@ -893,7 +893,7 @@ class MouvementStock extends CommonObject
* - int if row id of product_batch table (for update)
* - or complete array('fk_product_stock'=>, 'batchnumber'=>)
* @param int $qty Quantity of product with batch number. May be a negative amount.
- * @return int <0 if KO, -2 if we try to update a product_batchid that does not exist, else return productbatch id
+ * @return int Return integer <0 if KO, -2 if we try to update a product_batchid that does not exist, else return productbatch id
*/
private function createBatch($dluo, $qty)
{
@@ -1258,7 +1258,7 @@ class MouvementStock extends CommonObject
*
* @param int $fk_product Product id
* @param string $batch batch number
- * @return int <0 if KO, number of equipments found if OK
+ * @return int Return integer <0 if KO, number of equipments found if OK
*/
private function getBatchCount($fk_product, $batch)
{
diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php
index 284cf791dbd..34204e86d5d 100644
--- a/htdocs/product/stock/class/productlot.class.php
+++ b/htdocs/product/stock/class/productlot.class.php
@@ -179,7 +179,7 @@ class Productlot extends CommonObject
* Check sell or eat by date is mandatory
*
* @param string $onlyFieldName [=''] check all fields by default or only one field name ("sellby", "eatby")
- * @return int <0 if KO, 0 nothing done, >0 if OK
+ * @return int Return integer <0 if KO, 0 nothing done, >0 if OK
*/
public function checkSellOrEatByMandatory($onlyFieldName = '')
{
diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php
index d0435b5c60a..3aae11eced6 100644
--- a/htdocs/product/stock/class/productstockentrepot.class.php
+++ b/htdocs/product/stock/class/productstockentrepot.class.php
@@ -242,7 +242,7 @@ class ProductStockEntrepot extends CommonObject
* @param array $filter filter array
* @param string $filtermode filter mode (AND or OR)
*
- * @return int|array <0 if KO, array if OK
+ * @return int|array Return integer <0 if KO, array if OK
*/
public function fetchAll($fk_product = '', $fk_entrepot = '', $sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index bfbfafa2725..f9f1bac7ac9 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -910,7 +910,7 @@ print ''."\n";
print ''."\n";
-if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index d542a589513..5a49139386b 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -822,7 +822,7 @@ function startsWith($haystack, $needle)
*
* @param Object $static_object static object to fetch
* @param string $tmp_ref ref of the object to fetch
- * @return int <0 if Ko or Id of object
+ * @return int Return integer <0 if Ko or Id of object
*/
function fetchref($static_object, $tmp_ref)
{
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 6255a0ac5a0..e979926c8c8 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -1662,7 +1662,7 @@ if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) {
//print '