diff --git a/README-FR.md b/README-FR.md
index bccb7b0143b..77bb5a3e27a 100644
--- a/README-FR.md
+++ b/README-FR.md
@@ -6,7 +6,7 @@
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
-
+
## LICENCE
diff --git a/README.md b/README.md
index 919fc62ae5b..ac8f1d06382 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ You can use it as a standalone application or as a web application to access it
Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
-
+
## LICENSE
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 4306bc728d6..8c1eccfa846 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -278,13 +278,13 @@ print "
";
diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php
index 2a29fa81681..668417c0ee2 100644
--- a/htdocs/compta/bank/class/paymentvarious.class.php
+++ b/htdocs/compta/bank/class/paymentvarious.class.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2018-2020 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -70,8 +70,14 @@ class PaymentVarious extends CommonObject
*/
public $label;
+ /**
+ * @var string accountancy code
+ */
public $accountancy_code;
+ /**
+ * @var string subledger account
+ */
public $subledger_account;
/**
@@ -121,6 +127,9 @@ class PaymentVarious extends CommonObject
*/
// BEGIN MODULEBUILDER PROPERTIES
+ /**
+ * @var array fields definition
+ */
public $fields = array(
// TODO: fill this array
);
@@ -182,22 +191,19 @@ class PaymentVarious extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
- if (!$resql)
- {
+ if (!$resql) {
$this->error = "Error ".$this->db->lasterror();
return -1;
}
- if (!$notrigger)
- {
+ if (!$notrigger) {
// Call trigger
$result = $this->call_trigger('PAYMENT_VARIOUS_MODIFY', $user);
if ($result < 0) $error++;
// End call triggers
}
- if (!$error)
- {
+ if (!$error) {
$this->db->commit();
return 1;
} else {
@@ -303,8 +309,7 @@ class PaymentVarious extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
- if (!$resql)
- {
+ if (!$resql) {
$this->error = "Error ".$this->db->lasterror();
return -1;
}
@@ -348,8 +353,7 @@ class PaymentVarious extends CommonObject
$newamount = price2num($this->amount, 'MT');
// Validation of parameters
- if (!($newamount) > 0 || empty($this->datep))
- {
+ if (!($newamount) > 0 || empty($this->datep)) {
return false;
}
@@ -476,8 +480,7 @@ class PaymentVarious extends CommonObject
// Update fk_bank into llx_paiement.
// So we know the payment which has generate the banking ecriture
- if ($bank_line_id > 0)
- {
+ if ($bank_line_id > 0) {
$this->update_fk_bank($bank_line_id);
} else {
$this->error = $acc->error;
@@ -572,29 +575,23 @@ class PaymentVarious extends CommonObject
// phpcs:enable
global $langs;
- if ($mode == 0)
- {
+ if ($mode == 0) {
return $langs->trans($this->statuts[$status]);
- } elseif ($mode == 1)
- {
+ } elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$status]);
- } elseif ($mode == 2)
- {
+ } elseif ($mode == 2) {
if ($status == 0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status == 1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
elseif ($status == 2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
- } elseif ($mode == 3)
- {
+ } elseif ($mode == 3) {
if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status == 2 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
- } elseif ($mode == 4)
- {
+ } elseif ($mode == 4) {
if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
elseif ($status == 2 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
- } elseif ($mode == 5)
- {
+ } elseif ($mode == 5) {
if ($status == 0 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
elseif ($status == 1 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
elseif ($status == 2 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
@@ -609,9 +606,10 @@ class PaymentVarious extends CommonObject
* @param string $option link option
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $notooltip 1=Disable tooltip
+ * @param string $morecss morecss string
* @return string String with URL
*/
- public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0)
+ public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
{
global $db, $conf, $langs, $hookmanager;
global $langs;
diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php
index 07cffb3bf2c..842322f7f20 100644
--- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php
+++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php
@@ -19,7 +19,7 @@
*/
/**
- * \file cashcontrol/class/cashcontrol.class.php
+ * \file htdocs/compta/cashcontrol/class/cashcontrol.class.php
* \ingroup cashdesk|takepos
* \brief This file is CRUD class file (Create/Read/Update/Delete) for cash fence table
*/
@@ -76,6 +76,9 @@ class CashControl extends CommonObject
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')),
);
+ /**
+ * @var int Object Id
+ */
public $id;
public $opening;
public $status;
@@ -286,7 +289,7 @@ class CashControl extends CommonObject
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
- if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines();
+ //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines();
return $result;
}
@@ -420,8 +423,10 @@ class CashControl extends CommonObject
$hookmanager->initHooks(array('cashfencedao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- if ($reshook > 0) { $result = $hookmanager->resPrint;
- } else { $result .= $hookmanager->resPrint;
+ if ($reshook > 0) {
+ $result = $hookmanager->resPrint;
+ } else {
+ $result .= $hookmanager->resPrint;
}
return $result;
diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php
index 7f30e9d83f2..0447927ec4d 100644
--- a/htdocs/core/lib/barcode.lib.php
+++ b/htdocs/core/lib/barcode.lib.php
@@ -373,11 +373,8 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
}
$chars = explode(" ", $text);
- reset($chars);
- while (list($n, $v) = each($chars))
- {
- if (trim($v))
- {
+ foreach ($chars as $v) {
+ if (trim($v)) {
$inf = explode(":", $v);
$fontsize = $scale * ($inf[1] / 1.8);
$fontheight = $total_y - ($fontsize / 2.7) + 2;
@@ -387,16 +384,14 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
/* output the image */
$mode = strtolower($mode);
- if ($mode == 'jpg' || $mode == 'jpeg')
- {
+ if ($mode == 'jpg' || $mode == 'jpeg') {
header("Content-Type: image/jpeg; name=\"barcode.jpg\"");
imagejpeg($im);
- } elseif ($mode == 'gif')
- {
+ } elseif ($mode == 'gif') {
header("Content-Type: image/gif; name=\"barcode.gif\"");
imagegif($im);
- } elseif (!empty($filebarcode)) // To wxrite into afile onto disk
- {
+ } elseif (!empty($filebarcode)) {
+ // To wxrite into afile onto disk
imagepng($im, $filebarcode);
} else {
header("Content-Type: image/png; name=\"barcode.png\"");
diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang
index ba86c8f9d85..a50fa92ec9f 100644
--- a/htdocs/langs/en_US/recruitment.lang
+++ b/htdocs/langs/en_US/recruitment.lang
@@ -46,7 +46,7 @@ FutureManager=Future manager
ResponsibleOfRecruitement=Responsible of recruitment
IfJobIsLocatedAtAPartner=If job is located at a partner place
PositionToBeFilled=Job position
-PositionsToBeFilled=Job positionss
+PositionsToBeFilled=Job positions
ListOfPositionsToBeFilled=List of job positions
NewPositionToBeFilled=New job positions
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 3c9ea03d246..766db0e3479 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -704,7 +704,7 @@ class Reception extends CommonObject
* @param integer $eatby eat-by date
* @param integer $sellby sell-by date
* @param string $batch Lot number
- * @return int <0 if KO, >0 if OK
+ * @return int <0 if KO, index of line if OK
*/
public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '')
{
@@ -752,6 +752,8 @@ class Reception extends CommonObject
$line->fk_reception = $this->id;
$this->lines[$num] = $line;
+
+ return $num;
}