From 277045167db9a0ef2d8f3c692456a39c9668a833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Nov 2020 08:10:22 +0100 Subject: [PATCH 01/11] typo --- htdocs/langs/en_US/recruitment.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang index bc709f678d0..e7f1ec871f0 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 From 29e69a875600046508bb8c36d6e6f8fd6273bc22 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 3 Nov 2020 12:35:32 +0100 Subject: [PATCH 02/11] Update README-FR.md --- README-FR.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, ...). -![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) +![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) ## LICENCE From 990cd553f279418eab6553274acf41dd97415ddd Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 3 Nov 2020 12:35:57 +0100 Subject: [PATCH 03/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) +![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) ## LICENSE From d80f614e20cfff63209fdd9b437ad43d6d143ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Nov 2020 20:43:42 +0100 Subject: [PATCH 04/11] doxygen --- .../bank/class/paymentvarious.class.php | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) 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; From 73d01612d469c52c0fedc0334ba3635bf339504c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Nov 2020 20:50:51 +0100 Subject: [PATCH 05/11] doxygen --- .../compta/cashcontrol/class/cashcontrol.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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; From ce2e8407d5e09321503075c82ea567c73c705deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Nov 2020 21:28:57 +0100 Subject: [PATCH 06/11] remove deprecated --- htdocs/compta/facture/class/facture-rec.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 5771ead70f1..47e9d8161fd 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -347,7 +347,7 @@ class FactureRec extends CommonInvoice { // Extrafields if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { - $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid); + $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->id); $objectline->array_options = $facsrc->lines[$i]->array_options; } @@ -360,8 +360,8 @@ class FactureRec extends CommonInvoice } } - if (!empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects - { + if (!empty($this->linkedObjectsIds) && empty($this->linked_objects)) { + // To use new linkedObjectsIds instead of old linked_objects $this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds } @@ -381,8 +381,8 @@ class FactureRec extends CommonInvoice $error++; } } - } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) - { + } else { + // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) $origin_id = $tmp_origin_id; $ret = $this->add_object_linked($origin, $origin_id); if (!$ret) From 7caac9ebe726017c424a8826db53e0e308eb8dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 3 Nov 2020 21:35:23 +0100 Subject: [PATCH 07/11] The function each() has been deprecated: 7.2 --- htdocs/core/lib/barcode.lib.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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\""); From 1653e171810ee136036ef01303311b2d35ffac4c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 4 Nov 2020 10:26:45 +0100 Subject: [PATCH 08/11] FIX syntax error, missing token in url --- htdocs/categories/viewcat.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 4306bc728d6..441f8454262 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -278,13 +278,13 @@ print "
\n"; if ($user->rights->categorie->creer) { - $socid = ($object->socid ? "&socid=".$object->socid : ""); - print "".$langs->trans("Modify").""; + $socid = ($object->socid ? "&socid=".$object->socid : ""); + print "".$langs->trans("Modify").""; } if ($user->rights->categorie->supprimer) { - print "".$langs->trans("Delete").""; + print "".$langs->trans("Delete").""; } print "
"; From ebb38e1e4dd01a0fb00af1813902459133ad1e10 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 4 Nov 2020 17:44:02 +0100 Subject: [PATCH 09/11] Add OK return value to reception->addline --- htdocs/reception/class/reception.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } From f4829e7a166730ec3e5ed164b02fcab7a5d1eca6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Nov 2020 18:38:45 +0100 Subject: [PATCH 10/11] Update viewcat.php --- htdocs/categories/viewcat.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 441f8454262..8c1eccfa846 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -279,12 +279,12 @@ print "
\n"; if ($user->rights->categorie->creer) { $socid = ($object->socid ? "&socid=".$object->socid : ""); - print "".$langs->trans("Modify").""; + print ''.$langs->trans("Modify").''; } if ($user->rights->categorie->supprimer) { - print "".$langs->trans("Delete").""; + print 'id.'&type='.$type.'">'.$langs->trans("Delete").''; } print "
"; From d6b25bd89179c6598236d03b320af90fe1aaa683 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Nov 2020 18:45:50 +0100 Subject: [PATCH 11/11] Revert "remove deprecated" --- htdocs/compta/facture/class/facture-rec.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 47e9d8161fd..5771ead70f1 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -347,7 +347,7 @@ class FactureRec extends CommonInvoice { // Extrafields if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { - $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->id); + $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid); $objectline->array_options = $facsrc->lines[$i]->array_options; } @@ -360,8 +360,8 @@ class FactureRec extends CommonInvoice } } - if (!empty($this->linkedObjectsIds) && empty($this->linked_objects)) { - // To use new linkedObjectsIds instead of old linked_objects + if (!empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects + { $this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds } @@ -381,8 +381,8 @@ class FactureRec extends CommonInvoice $error++; } } - } else { - // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) + } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) + { $origin_id = $tmp_origin_id; $ret = $this->add_object_linked($origin, $origin_id); if (!$ret)