From 7cc9639417d9a33ff9b2e0c34737c1cdd9e6908e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 22 Feb 2020 12:28:15 +0100 Subject: [PATCH 001/490] comment translation --- .../template/core/modules/mymodule/mod_myobject_standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php index 71926700aa4..9c1f6ece4d0 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php @@ -116,7 +116,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject { global $db, $conf; - // D'abord on recupere la valeur max + // First we get the max value $posindice = 9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; From 061f4623b3cc8ce593c97a8ae6c4fe2333514e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Apr 2020 23:53:00 +0200 Subject: [PATCH 002/490] remove deprecated libelle --- htdocs/product/stock/class/entrepot.class.php | 21 +++++++++++-------- htdocs/product/stock/movement_card.php | 1 - htdocs/product/stock/movement_list.php | 1 - htdocs/product/stock/product.php | 1 - 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 3dd22c9e5c3..c09c8932401 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2008 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2016 Francis Appels - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-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 @@ -48,7 +48,11 @@ class Entrepot extends CommonObject * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'stock'; - public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + public $ismultientitymanaged = 1; /** * @var string Label @@ -184,11 +188,10 @@ class Entrepot extends CommonObject $error = 0; - $this->libelle = trim($this->libelle); + $this->label = !empty($this->label) ? trim($this->label) : trim($this->libelle); - // Si libelle non defini, erreur - if ($this->libelle == '') - { + // Error if label not defined + if ($this->label == '') { $this->error = "ErrorFieldRequired"; return 0; } @@ -198,7 +201,7 @@ class Entrepot extends CommonObject $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)"; - $sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; + $sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); @@ -285,7 +288,7 @@ class Entrepot extends CommonObject } } - $this->libelle = trim($this->libelle); + $this->label = !empty($this->label) ? trim($this->label) : trim($this->libelle); $this->description = trim($this->description); $this->lieu = trim($this->lieu); @@ -296,7 +299,7 @@ class Entrepot extends CommonObject $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; - $sql .= " SET ref = '".$this->db->escape($this->libelle)."'"; + $sql .= " SET ref = '".$this->db->escape($this->label)."'"; $sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", statut = ".$this->statut; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 2714740eb45..7e7aa53cd08 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -975,7 +975,6 @@ if ($resql) $productlot->sellby = $objp->sellby; $warehousestatic->id = $objp->entrepot_id; - $warehousestatic->libelle = $objp->warehouse_ref; // deprecated $warehousestatic->label = $objp->warehouse_ref; $warehousestatic->lieu = $objp->lieu; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 944462ccdfc..de12c018f20 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1012,7 +1012,6 @@ if ($resql) $warehousestatic->id = $objp->entrepot_id; $warehousestatic->ref = $objp->warehouse_ref; - $warehousestatic->libelle = $objp->warehouse_ref; // deprecated $warehousestatic->label = $objp->warehouse_ref; $warehousestatic->lieu = $objp->lieu; $warehousestatic->fk_parent = $objp->fk_parent; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 0164f6338e6..e188ab368f7 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -866,7 +866,6 @@ if (!$variants) { $entrepotstatic->id = $obj->rowid; $entrepotstatic->ref = $obj->ref; - $entrepotstatic->libelle = $obj->ref; $entrepotstatic->label = $obj->ref; $entrepotstatic->lieu = $obj->lieu; $entrepotstatic->fk_parent = $obj->fk_parent; From 2349c2be2247188bd37fa260e1ff813b304919f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Apr 2020 23:55:50 +0200 Subject: [PATCH 003/490] remove deprecated libelle --- htdocs/product/stock/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 0665cc48e06..d0e9228fbf5 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -97,7 +97,7 @@ if (empty($reshook)) { $object->ref = GETPOST("ref"); $object->fk_parent = GETPOST("fk_parent"); - $object->libelle = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->description = GETPOST("desc"); $object->statut = GETPOST("statut"); $object->lieu = GETPOST("lieu"); @@ -108,8 +108,7 @@ if (empty($reshook)) $object->phone = GETPOST("phone"); $object->fax = GETPOST("fax"); - if (!empty($object->libelle)) - { + if (!empty($object->label)) { // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) { @@ -167,7 +166,7 @@ if (empty($reshook)) { if ($object->fetch($id)) { - $object->libelle = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->fk_parent = GETPOST("fk_parent"); $object->description = GETPOST("desc"); $object->statut = GETPOST("statut"); From bc4726c7c347e406b0bed30ddb0f437c3209bb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Apr 2020 00:06:57 +0200 Subject: [PATCH 004/490] remove deprecated libelle --- test/phpunit/MouvementStockTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index d095736042b..85137234a3b 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -148,13 +148,13 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase // We create a product for tests $warehouse1=new Entrepot($db); $warehouse1->initAsSpecimen(); - $warehouse1->libelle.=' 1'; + $warehouse1->label.=' 1'; $warehouse1->description.=' 1'; $warehouse1id=$warehouse1->create($user); $warehouse2=new Entrepot($db); $warehouse2->initAsSpecimen(); - $warehouse2->libelle.=' 2'; + $warehouse2->label.=' 2'; $warehouse2->description.=' 2'; $warehouse2id=$warehouse2->create($user); From 35410209124f135e12781f757012b1c932f7d335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Apr 2020 00:13:51 +0200 Subject: [PATCH 005/490] remove deprecated libelle --- htdocs/product/stock/class/mouvementstock.class.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5bbc3f9d92c..d6ca1f3655e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -41,7 +41,14 @@ class MouvementStock extends CommonObject public $table_element = 'stock_mouvement'; + /** + * @var int ID product + */ public $product_id; + + /** + * @var int ID warehouse + */ public $warehouse_id; public $qty; @@ -58,7 +65,7 @@ class MouvementStock extends CommonObject public $price; /** - * @var int ID + * @var int ID user author */ public $fk_user_author; @@ -894,13 +901,13 @@ class MouvementStock extends CommonObject } else { - dol_syslog(get_class($this)."::createBatch array param dluo must contain at least key fk_product_stock".$error, LOG_ERR); + dol_syslog(get_class($this)."::createBatch array param dluo must contain at least key fk_product_stock", LOG_ERR); $result = -1; } } else { - dol_syslog(get_class($this)."::createBatch error invalid param dluo".$error, LOG_ERR); + dol_syslog(get_class($this)."::createBatch error invalid param dluo", LOG_ERR); $result = -1; } From ac872b6d3dc618b23b456fd7dccb9e9c1535e103 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Fri, 24 Apr 2020 23:36:37 +0200 Subject: [PATCH 006/490] Update global.inc.php --- htdocs/theme/eldy/global.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e495a3bb4bc..7b8e1373df9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3360,6 +3360,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; + color: unset; } tr.liste_titre_topborder td { border-top-width: px; From 740b2c92285aaf60c69fe3849306a6798fc01b74 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Tue, 28 Apr 2020 08:59:27 +0200 Subject: [PATCH 007/490] NEW possibilty to group payments by mode and show their subtotal This add two params (PAYMENTS_REPORT_GROUP_BY_MOD and PAYMENTS_FOURN_REPORT_GROUP_BY_MOD) for payments and supplier payments to group them by mode and get subtotals for each mode. Add the corresponding configuration options on admin page fore each payments and supplier payments. --- htdocs/admin/payment.php | 14 +++- htdocs/admin/supplier_payment.php | 56 ++++++++++++++ htdocs/compta/paiement/rapport.php | 5 +- .../modules/rapport/pdf_paiement.class.php | 74 +++++++++++++++++-- htdocs/fourn/facture/rapport.php | 5 +- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 7 files changed, 145 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index e740150e1d5..a5b494b62e2 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Maxime DEMAREST * * 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,11 +71,12 @@ if ($action == 'setmod') if ($action == 'setparams') { $freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + $res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + if (!$res > 0) $error++; + if ($error) { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -253,6 +255,14 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $co print ''; print "\n"; +// Allow to group payments by mod in rapports +print ''; +print $langs->trans("GroupPaymentsByModOnReports"); +print ''; +print $form->selectyesno("PAYMENTS_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_REPORT_GROUP_BY_MOD, 1); +print ''; +print "\n"; + print ''; print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index d533ba0d8eb..e2fc6dce4a7 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -144,6 +145,23 @@ elseif ($action == 'specimen') } } + + +elseif ($action == 'setparams') +{ + $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + if (!$res > 0) $error++; + + if ($error) + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + if (!$error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } +} + /* * View */ @@ -428,8 +446,46 @@ foreach ($dirmodels as $reldir) print ''; +/* + * Other Options + */ + +print "
"; + +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + +print '
'; +print ''; +print ''; + +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +// Allow to group payments by mod in rapports +print '\n"; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("GroupPaymentsByModOnReports"); +print ''; +print $form->selectyesno("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD, 1); +print ''; +print "
'; + dol_fiche_end(); +print '
'; +print '
'; +print ''; +print '
'; +print '
'; + +print ''; + // End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 80013d3d865..76a1ce72d76 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -26,6 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Security check @@ -84,6 +86,7 @@ if ($action == 'builddoc') */ $formother = new FormOther($db); +$formfile = new FormFile($db); llxHeader(); @@ -155,7 +158,7 @@ if ($year) $tfile = $dir.'/'.$year.'/'.$file; $relativepath = $year.'/'.$file; print ''; - print ''.img_pdf().' '.$file.''; + print ''.img_pdf().' '.$file.''.$formfile->showPreview($file, 'facture_paiement', $relativepath, 0).''; print ''.dol_print_size(dol_filesize($tfile)).''; print ''.dol_print_date(dol_filemtime($tfile), "dayhour").''; print ''; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 2377e537606..58b5de4d7d8 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2006-2014 Laurent Destailleur * Copyright (C) 2015-2018 Charlene BENKE + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -207,7 +208,11 @@ class pdf_paiement $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (!empty($socid)) $sql .= " AND s.rowid = ".$socid; - $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; + // If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code + if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) + $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiement ASC"; + else + $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; break; case "fourn": $sql = "SELECT p.datep as dp, f.ref as ref"; @@ -237,7 +242,11 @@ class pdf_paiement $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (!empty($socid)) $sql .= " AND s.rowid = ".$socid; - $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; + // If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payement fourn are ordered by paiement_code + if (!empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD)) + $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiementfourn ASC"; + else + $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; break; } @@ -425,7 +434,7 @@ class pdf_paiement public function Body(&$pdf, $page, $lines, $outputlangs) { // phpcs:enable - global $langs; + global $langs, $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('', '', $default_font_size - 1); @@ -435,6 +444,11 @@ class pdf_paiement $pdf->SetFillColor(220, 220, 220); $yp = 0; $numlines = count($lines); + if (($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) + { + $mod = $lines[0][2]; + $total_mod = 0; + } for ($j = 0; $j < $numlines; $j++) { $i = $j; @@ -450,8 +464,17 @@ class pdf_paiement { if ($yp > $this->tab_height - 15) { - $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0); + $pdf->SetFillColor(255, 255, 255); + $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); + $pdf->SetFont('', 'B', $default_font_size - 1); + $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_page), 0, 'R', 1); + $pdf->SetFont('', '', $default_font_size - 1); + $pdf->SetFillColor(220, 220, 220); $page++; $pdf->AddPage(); $this->_pagehead($pdf, $page, 0, $outputlangs); @@ -474,6 +497,7 @@ class pdf_paiement $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1); $yp = $yp + 5; $total_page += $lines[$j][9]; + if (($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) $total_mod += $lines[$j][9]; } // Invoice number @@ -497,9 +521,45 @@ class pdf_paiement { $oldprowid = $lines[$j][7]; } + + // Add line to add total by payment mode if mode reglement for nex line change + if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j+1][2])) + { + $pdf->SetFillColor(245, 245, 245); + $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); + $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetFont('', 'I', $default_font_size - 1); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_mod), 0, 'R', 1); + $pdf->SetFont('', '', $default_font_size - 1); + $mod = $lines[$j+1][2]; + $total_mod = 0; + $yp = $yp + 5; + if ($yp > $this->tab_height - 5) + { + $page++; + $pdf->AddPage(); + $this->_pagehead($pdf, $page, 0, $outputlangs); + $pdf->SetFont('', '', $default_font_size - 1); + $yp = 0; + } + $pdf->SetFillColor(220, 220, 220); + } + } $total += $total_page; - $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('Total')." : ".price($total), 0, 'R', 0); + $pdf->SetFillColor(255, 255, 255); + $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); + $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetFont('', 'B'); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total), 0, 'R', 1); + $pdf->SetFillColor(220, 220, 220); } } diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index f0bf2d85dd1..9f38c4c4f9e 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -24,6 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement_fourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->loadLangs(array('bills')); @@ -86,6 +88,7 @@ if ($action == 'builddoc') */ $formother = new FormOther($db); +$formfile = new FormFile($db); $titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports")); @@ -157,7 +160,7 @@ if ($year) { $tfile = $dir.'/'.$year.'/'.$file; $relativepath = $year.'/'.$file; - print ''.img_pdf().' '.$file.''; + print ''.img_pdf().' '.$file.''.$formfile->showPreview($file, 'facture_fournisseur', 'payments/'.$relativepath, 0).''; print ''.dol_print_size(dol_filesize($tfile)).''; print ''.dol_print_date(dol_filemtime($tfile), "dayhour").''; } diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 55de1591689..9f11d8ecf87 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -385,6 +385,7 @@ GeneratedFromTemplate=Generated from template invoice %s WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date ViewAvailableGlobalDiscounts=View available discounts +GroupPaymentsByModOnReports=Group payments by mode on reports # PaymentConditions Statut=Status PaymentConditionShortRECEP=Due Upon Receipt diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 6ad3faba02d..92a0da802d1 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -393,6 +393,7 @@ GeneratedFromTemplate=Généré à partir du modèle de facture %s WarningInvoiceDateInFuture=Attention, la date de facturation est antérieur à la date actuelle WarningInvoiceDateTooFarInFuture=Attention, la date de facturation est trop éloignée de la date actuelle ViewAvailableGlobalDiscounts=Voir les remises disponibles +GroupPaymentsByModOnReports=Grouper les paiements par mode sur les rapports # PaymentConditions Statut=État PaymentConditionShortRECEP=A réception From 2cf5f12a62a949f602ac601ac6965977c991af80 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 28 Apr 2020 07:18:45 +0000 Subject: [PATCH 008/490] Fixing style errors. --- htdocs/admin/supplier_payment.php | 12 ++++++------ htdocs/core/modules/rapport/pdf_paiement.class.php | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index e2fc6dce4a7..5d7a0d0b8d5 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -152,14 +152,14 @@ elseif ($action == 'setparams') $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); if (!$res > 0) $error++; - if ($error) + if ($error) { - setEventMessages($langs->trans("Error"), null, 'errors'); - } - if (!$error) + setEventMessages($langs->trans("Error"), null, 'errors'); + } + if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } } /* diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 58b5de4d7d8..024310abb09 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -548,7 +548,6 @@ class pdf_paiement } $pdf->SetFillColor(220, 220, 220); } - } $total += $total_page; $pdf->SetFillColor(255, 255, 255); From 92898c9562da57f2fa7ccbe2c6a1bd7118674bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 May 2020 11:27:11 +0200 Subject: [PATCH 009/490] enable free emails with select2 --- htdocs/core/actions_sendmails.inc.php | 9 ++++-- htdocs/core/class/html.form.class.php | 39 +++++++++++++++++++---- htdocs/core/class/html.formmail.class.php | 22 ++++++------- htdocs/langs/en_US/mails.lang | 1 + 4 files changed, 52 insertions(+), 19 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index e23d2ce01a9..f647bd5418e 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -190,10 +190,12 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; } - elseif ($val) // $val is the Id of a contact + elseif ((int) $val > 0) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; + } else { + $tmparray[] = $val; } } } @@ -240,10 +242,12 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; } - elseif ($val) // $val is the Id of a contact + elseif ((int) $val > 0) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? + } else { + $tmparray[] = $val; } } } @@ -261,6 +265,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST } } $sendtocc = implode(',', $tmparray); + //var_dump($sendto, $sendtocc);exit; if (dol_strlen($sendto)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b2c677ed29d..bc605d286c1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6617,10 +6617,11 @@ class Form * @param string $elemtype Type of element we show ('category', ...). Will execute a formating function on it. To use in readonly mode if js component support HTML formatting. * @param string $placeholder String to use as placeholder * @param int $addjscombo Add js combo + * @param int $enablefreetag 0 no free tag, 1 enable free tag for elemtype * @return string HTML multiselect string * @see selectarray(), selectArrayAjax(), selectArrayFilter() */ - public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1) + public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1, $enablefreetag = 0) { global $conf, $langs; @@ -6634,11 +6635,11 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { - $out .= "\n".' - + '; + return $html; +} /** * Build the tooltip on top menu bookmark diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 49f910f50da..479bb3f889b 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -9,7 +9,7 @@ button.dropdown-item.global-search-item { outline: none; } -.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-menu, .dropdown dd ul.open { +.open>.dropdown-search, .open>.dropdown-bookmark, .open>.dropdown-quickadd, .open>.dropdown-menu, .dropdown dd ul.open { display: block; } @@ -59,6 +59,29 @@ button.dropdown-item.global-search-item { -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); box-shadow: 0 6px 12px rgba(0,0,0,.175); } +.dropdown-quickadd { + border-color: #eee; + + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 240px; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0,0,0,.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); + box-shadow: 0 6px 12px rgba(0,0,0,.175); +} .dropdown-menu { border-color: #eee; @@ -163,7 +186,7 @@ button.dropdown-item.global-search-item { max-width: 100%; } -div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown { +div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown, div#topmenu-quickadd-dropdown { global->THEME_TOPMENU_DISABLE_IMAGE)) { ?> line-height: 46px; @@ -383,6 +406,58 @@ a.top-menu-dropdown-link { display: none !important; } +/* + * QUICK ADD + */ +#topmenu-quickadd-dropdown .dropdown-menu { + width: 300px !important; + color: #444; +} + +.quickadd-header { + color: #444 !important; +} + +div.quickadd { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-content: center; + -ms-flex-line-pack: center; + align-content: center; + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; +} + +div.quickadd a { + color: #444; +} + +div.quickadd a:hover, div.quickadd a:active { + color: #000000; +} + +div.quickaddblock { + width: 80px; + display: block ruby; +} + +div.quickaddblock:hover, +div.quickaddblock:active, +div.quickaddblock:focus { + background: ; +} + /* smartphone */ @media only screen and (max-width: 767px) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 28fa0ecfa65..4a3c2523ecc 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1304,7 +1304,7 @@ td.showDragHandle { #id-left { padding-top: 20px; padding-bottom: 5px; - global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { ?> + global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN) && ! empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { ?> padding-top: 8px; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 39fcd003335..0409ca5830e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -202,7 +202,7 @@ $disableimages = 0; $maxwidthloginblock = 180; if (!empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = $maxwidthloginblock + 50; $minwidthtmenu = 0; } - +if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; } if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) { $maxwidthloginblock = $maxwidthloginblock + 55; } if (!empty($conf->bookmark->enabled)) { $maxwidthloginblock = $maxwidthloginblock + 55; } From eacb1b3b2e399d365bab45e58e3cf184b3d42af7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 May 2020 21:45:10 +0200 Subject: [PATCH 051/490] Debug modulebuilder --- htdocs/core/lib/files.lib.php | 11 ++++++++++- htdocs/modulebuilder/index.php | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 941cb03d6c4..dbea182fb9b 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -761,8 +761,17 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep if (is_dir($ossrcfile."/".$file)) { if (empty($excludesubdir) || ($excludesubdir == 2 && strlen($file) == 2)) { + $newfile = $file; + // Replace destination filename with a new one + if (is_array($arrayreplacement)) + { + foreach ($arrayreplacement as $key => $val) + { + $newfile = str_replace($key, $val, $newfile); + } + } //var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists"); - $tmpresult = dolCopyDir($srcfile."/".$file, $destfile."/".$file, $newmask, $overwriteifexists, $arrayreplacement, $excludesubdir); + $tmpresult = dolCopyDir($srcfile."/".$file, $destfile."/".$newfile, $newmask, $overwriteifexists, $arrayreplacement, $excludesubdir); } } else diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1be2ac09971..d813c3b291b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -180,8 +180,10 @@ if ($dirins && $action == 'initmodule' && $modulename) dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql'); + dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.key.sql'); dol_delete_file($destdir.'/img/object_myobject.png'); dol_delete_file($destdir.'/class/myobject.class.php'); + dol_delete_dir($destdir.'/class'); dol_delete_dir($destdir.'/sql'); } From fa305fdaca1b7b32e51c8f80233693a2625eec4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 May 2020 21:49:46 +0200 Subject: [PATCH 052/490] Prepare version 11.0.4 --- ChangeLog | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3b81e0555d5..a7d0282fba5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,84 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 11.0.4 compared to 11.0.3 ***** +FIX: #13749 +FIX: #7594 +FIX: #7594 Expense report multi pagebreak +FIX: Access to undeclared static property: Contact::$table_element +FIX: actions on supplier proposal not saved (bad trigger name) +FIX: Add function "completeTabsHead" to "addreplace" type hook. +FIX: All forms must use newToken() +FIX: Another "Access to undeclared static property: Contact::$table_element" && "Societe::$table_element" +FIX: author search supplier proposal list +FIX: A variable was erased by a temporary variable +FIX: Avoid infinite loop when a fetch is inside a compute field. +FIX: Backto link +FIX: Bad position of total in column +FIX: bad value in currency into discount created from down payment +FIX: buyprice extrafield langfile and tooltip +FIX: Buyprice was updated only if min price for this qty had same qty +FIX: Can switch from double to price type for extrafields +FIX: Can use decimal value in virtual products +FIX: child categories only with good entity rights +FIX: cloning of emailing when no content selected +FIX: closing tags +FIX: Combo list of available users to filter on the list of leaves. +FIX: Compatibility with multicompany, bad numerotation of task. +FIX: consistency of price w/wo vat wrong when price entered with tax +FIX: default value of selectMasssAction broken +FIX: draftordered replenish virtual stock +FIX: Error update SQL into stock reception +FIX: expensereport status in generated pdf +FIX: extra date field incorrect check +FIX: Extrafields of type price must be '' and not '0' if not defined +FIX: Foreign currency lost when splitting a discount +FIX: get remain to pay with rounding decimals +FIX: gzip and bzip2 must use option -f +FIX: IHM, unexpected quote +FIX: keep viewstatut for doli 3.5 +FIX: Link missing into email of some notification +FIX: Look and feel v11 +FIX: md stylesheet to be included by external modules like eldy +FIX: missing array option +FIX: missing default accountancy product buy code +FIX: missing fk_bank during export of suppliers invoices +FIX: missing member entity +FIX: missing selectedlines on supplier order but checkbox are displayed +FIX: Missing token and take into account max date when it can. +FIX: model export list must be sorted by label +FIX: multicurrency manage on hidden conf SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL +FIX: Must escape shell +FIX: Must exclude logs and some dirs for compressed backup +FIX: ordered stock already in $stock +FIX: picture migration script from doli 9.0 +FIX: print pictures on shipment docs +FIX: product get purchase prices +FIX: product purchase prices +FIX: Protection when database has a corrupted product id +FIX: remove unused var, $usercancreate can be change by Multicompany +FIX: replenish stock to buy +FIX: Sanitizing menu parameter +FIX: Send email from bulk action of list of thirdparties +FIX: setup of suggested payment mode on proposals and orders +FIX: Several pb in export of documents +FIX: Situation invoice take into account the credit notes. +FIX: some others modules (like subtotal) use other product_type than 0 or 1 AND must not be considered in this report +FIX: sort by default role makes no sense +FIX: sort on company on member list +FIX: TakePOS buying price +FIX: text version of html emailing (removed the body style) +FIX: The "test smtp connectivity" failed on page to setup mass emailing +FIX: Error logs an Orderline::delete error, but this is an Orderline::insert error +FIX: Translation of tooltips of extrafields +FIX: Use getNomURL instead of hard coded link. Fix limit. +FIX: Use of image into free text for PDF if DOL_DATA_DIR is outside of +FIX: viewstatut to search status +FIX: we must export company mail address on contact vcard only if contact email address is empty +FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create +FIX: Wrong Sql on getListOfTowns api method +FIX: wrong user right's name to top menu "commercial" +FIX: XSS Vulnerability ***** ChangeLog for 11.0.3 compared to 11.0.2 ***** FIX: unit price for selected supplier products not set. NaN was used. From 9f176c5e2d8733114ed712f7d2f8ba8b3b69801a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 01:41:10 +0200 Subject: [PATCH 053/490] Fix trans --- htdocs/langs/en_US/companies.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index f8b3d0354e2..0fad58c9389 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -325,7 +325,8 @@ CompanyDeleted=Company "%s" deleted from database. ListOfContacts=List of contacts/addresses ListOfContactsAddresses=List of contacts/addresses ListOfThirdParties=List of Third Parties -ShowContact=Show contact +ShowCompany=Third Party +ShowContact=Contact-Address ContactsAllShort=All (No filter) ContactType=Contact type ContactForOrders=Order's contact From d9cef1c8d79ac971641fc4304355f5cb44d5b5f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 01:49:19 +0200 Subject: [PATCH 054/490] Fix packager to publish on new web site --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c6b8cd330c8..933c5b8f994 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Term::ANSIColor; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From 247acdd27446434927a8727506cacdd58985fc8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 03:47:28 +0200 Subject: [PATCH 055/490] Fix position of custom groups of modules --- htdocs/admin/company.php | 2 +- htdocs/admin/modules.php | 10 ++++++---- htdocs/core/lib/functions.lib.php | 1 + htdocs/core/modules/DolibarrModules.class.php | 2 +- htdocs/theme/eldy/info-box.inc.php | 5 +++++ htdocs/theme/eldy/progress.inc.php | 2 +- htdocs/theme/md/info-box.inc.php | 4 ++++ 7 files changed, 19 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d4664a13de1..f33a3ea6f93 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -693,7 +693,7 @@ print '
'; // Sales taxes (VAT, IRPF, ...) -print load_fiche_titre($langs->trans("TypeOfSaleTaxes")); +print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment'); print ''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 926a4c34f70..6a0ff450346 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -412,11 +412,13 @@ foreach ($modulesdir as $dir) } $familyposition = $familyinfo[$familykey]['position']; - if ($external) + $listOfOfficialModuleGroups = array('hr', 'technic', 'interface', 'technic', 'portal', 'financial', 'crm', 'base', 'products', 'srm', 'ecm', 'projects', 'other'); + if ($external && ! in_array($familykey, $listOfOfficialModuleGroups)) { - // TODO Find a solution so modules with their own family are always at end - //var_dump($familyposition); - //$familyposition += 100; + // If module is extern and into a custom group (not into an official predefined one), it must appear at end (custom groups should not be before official groups). + if (is_numeric($familyposition)) { + $familyposition = sprintf("%03d", (int) $familyposition + 100); + } } $orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 14531947574..f456ec311ac 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3268,6 +3268,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal', 'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal', 'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action', + //'title_setup'=>'bg-infobox-action', 'tools'=>'bg-infobox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' ); if (!empty($arrayconvpictotomorcess[$pictowithouttext])) { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index cd3fe7922ee..c592cb69959 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2279,7 +2279,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this))); print ' -
+
'; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 028039f6c8b..7f62fe39689 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -6,6 +6,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> * Component: Info Box * ------------------- */ + +.info-box-module-external span.info-box-icon-version { + background: #999; +} + .info-box { display: block; position: relative; diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php index b0bd96df1d2..71f25ff35ba 100644 --- a/htdocs/theme/eldy/progress.inc.php +++ b/htdocs/theme/eldy/progress.inc.php @@ -123,7 +123,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> width: 3px; } .progress-group .progress-text { - font-weight: 600; + /* font-weight: 600; */ } .progress-group .progress-number { float: right; diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index d9b467f130b..d866cab96a6 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -7,6 +7,10 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> * ------------------- */ +.info-box-module-external span.info-box-icon-version { + background: #999; +} + span.info-box-icon-text { /* hide box text number due to problems */ display: none; } From 30fede216c7cb7b95e5db3d26cf338b88ad62b61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 04:03:07 +0200 Subject: [PATCH 056/490] Fix Add '_pw' var as var sensibles. --- htdocs/api/class/api_setup.class.php | 2 +- htdocs/core/class/commondocgenerator.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index ec7a6b89596..fd6432b553f 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1429,7 +1429,7 @@ class Setup extends DolibarrApi if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) { throw new RestException(500, 'Error Bad or unknown value for constantname'); } - if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) { + if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $constantname)) { throw new RestException(403, 'Forbidden'); } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 1f5ef0a5a9e..df80aab7a1f 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -325,7 +325,7 @@ abstract class CommonDocGenerator foreach ($conf->global as $key => $val) { - if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****'; + if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****'; else $newval = $val; $array_other['__['.$key.']__'] = $newval; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f456ec311ac..28a44562b28 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6523,7 +6523,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null) if (dol_textishtml($text, 1)) $msgishtml = 1; $keyfound = $reg[1]; - if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****'; + if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****'; else $newval = empty($conf->global->$keyfound) ? '' : $conf->global->$keyfound; $text = preg_replace('/__\['.preg_quote($keyfound, '/').'\]__/', $msgishtml ?dol_htmlentitiesbr($newval) : $newval, $text); } From b09f179a16759ee8213c51ebf0726f57decf3a3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 04:32:48 +0200 Subject: [PATCH 057/490] NEW Website logs are now into a separated log file. --- htdocs/core/lib/functions.lib.php | 7 +++++++ htdocs/core/lib/website2.lib.php | 5 ++++- htdocs/core/website.inc.php | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 28a44562b28..1a4ab00b7d6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1078,6 +1078,13 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = // If syslog module enabled if (empty($conf->syslog->enabled)) return; + // Check if we are into execution of code of a website + if (defined('USEEXTERNALSERVER') && ! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { + global $website, $websitekey; + if (is_object($website) && ! empty($website->ref)) $suffixinfilename.='_website_'.$website->ref; + elseif (! empty($websitekey)) $suffixinfilename.='_website_'.$websitekey; + } + if ($ident < 0) { foreach ($conf->loghandlers as $loghandlerinstance) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 6ef17220283..fc56a489d75 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -39,7 +39,10 @@ function dolSaveMasterFile($filemaster) $mastercontent = ''."\n"; $result = file_put_contents($filemaster, $mastercontent); if (!empty($conf->global->MAIN_UMASK)) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index b90da632fac..3e54f6ec2ad 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/website.inc.php * \brief Common file loaded by all website pages (after master.inc.php). It set the new object $weblangs, using parameter 'l'. - * This file is included in top of all container pages. + * This file is included in top of all container pages and is run only when a web page is called. * The global variable $websitekey must be defined. */ From a8222c2651591a657767b8bf95cc04fa37752866 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 05:10:42 +0200 Subject: [PATCH 058/490] Look and feel v12 --- htdocs/admin/menus/index.php | 4 ++-- htdocs/admin/tools/purge.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 56251e48f7b..97f0246ac88 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -277,8 +277,8 @@ print '
'; print ''; print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 43cf81b41ba..9898e290ddc 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -78,7 +78,7 @@ $form = new Form($db); print load_fiche_titre($langs->trans("Purge"), '', 'title_setup'); -print $langs->trans("PurgeAreaDesc", $dolibarr_main_data_root).'
'; +print ''.$langs->trans("PurgeAreaDesc", $dolibarr_main_data_root).'
'; print '
'; From b6aa766c72078988a0e74d8b5305b96eb9d6d509 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 6 May 2020 09:37:17 +0200 Subject: [PATCH 059/490] FIX stickler --- htdocs/compta/facture/stats/index.php | 14 +++++++------- htdocs/core/class/dolgraph.class.php | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 4c0d23c90e2..8606e619740 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -262,13 +262,13 @@ if ($mode == 'customer') $filter = 's.client in (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); print ''; -if(!empty($conf->category->enabled) && $mode == 'customer') { - // Customer Category - print ''; - } +if(! empty($conf->category->enabled) && $mode == 'customer') { + // Customer Category + print ''; +} // ThirdParty Type print ''; } +// Option to include various payment in results +print ''."\n"; +print ''."\n"; +print ''; + +// Option to include loan in results +print ''."\n"; +print ''."\n"; +print ''; + print "
'.$langs->trans("TreeMenuPersonalized").'
'.$langs->trans("CustomersProspectsCategoriesShort").''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); - print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); - print '
'.$langs->trans("CustomersProspectsCategoriesShort").''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); + print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 3f1bfa245fb..551fe2b82c0 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -895,11 +895,11 @@ class DolGraph $color = sprintf("%02x%02x%02x", $this->datacolor[$i][0], $this->datacolor[$i][1], $this->datacolor[$i][2]); $this->stringtoshow .= '{ '; if (! isset($this->type[$i]) || $this->type[$i] == 'bars') { - if($nblot == 3) { - if($i == $firstlot) $align = 'right'; - else if($i == $firstlot+1) $align = 'center'; - else $align = 'left'; - $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.$align.'", barWidth: 0.45 }, '; + if($nblot == 3) { + if($i == $firstlot) $align = 'right'; + elseif($i == $firstlot + 1) $align = 'center'; + else $align = 'left'; + $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.$align.'", barWidth: 0.45 }, '; } else $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; } From 128ec6fd78fa91569f80636a83f90dd8171ad1a1 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 6 May 2020 08:38:36 +0200 Subject: [PATCH 060/490] Add include various payments and loans in accounting report For simplified accouning, behaviour not enable by default and must be enabed in simplified accounting module admin page (or by global settings ACCOUNTING_REPORTS_INCLUDE_VARPAY and ACCOUNTING_REPORTS_INCLUDE_LOAN). --- htdocs/admin/compta.php | 35 ++++++++ htdocs/compta/resultat/clientfourn.php | 116 ++++++++++++++++++++++++- htdocs/compta/resultat/index.php | 112 ++++++++++++++++++++++++ htdocs/langs/en_US/compta.lang | 2 + htdocs/langs/fr_FR/compta.lang | 2 + 5 files changed, 266 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index cdfa15d9069..b3c66af76ca 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -5,6 +5,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2013-2017 Philippe Grand * Copyright (C) 2014 Marcos García + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -83,6 +84,20 @@ if ($action == 'update') } } + $report_include_varpay = GETPOST('ACCOUNTING_REPORTS_INCLUDE_VARPAY', 'alpha'); + if (!empty($report_include_varpay)) + if ($report_include_varpay == 'yes') + if (!dolibarr_set_const($db, 'ACCOUNTING_REPORTS_INCLUDE_VARPAY', 1, 'chaine', 0, '', $conf->entity)) $error++; + if ($report_include_varpay == 'no') + if (!dolibarr_del_const($db, 'ACCOUNTING_REPORTS_INCLUDE_VARPAY', $conf->entity)) $error++; + + $report_include_loan = GETPOST('ACCOUNTING_REPORTS_INCLUDE_LOAN', 'alpha'); + if (!empty($report_include_loan)) + if ($report_include_loan == 'yes') + if (!dolibarr_set_const($db, 'ACCOUNTING_REPORTS_INCLUDE_LOAN', 1, 'chaine', 0, '', $conf->entity)) $error++; + if ($report_include_loan == 'no') + if (!dolibarr_del_const($db, 'ACCOUNTING_REPORTS_INCLUDE_LOAN', $conf->entity)) $error++; + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -158,6 +173,26 @@ foreach ($list as $key) print '
'."\n"; +print ''."\n"; +print '
'."\n"; +print ''."\n"; +print '
\n"; print '

'; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 44be66a2218..59b7999e4ef 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -38,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; // Load translation files required by the page -$langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy')); +$langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy', 'loan')); $date_startmonth = GETPOST('date_startmonth', 'int'); $date_startday = GETPOST('date_startday', 'int'); @@ -953,6 +954,119 @@ else print ''; } + /* + * Various Payments + */ + + if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) + { + $subtotal_ht = 0; + $subtotal_ttc = 0; + + print ''.$langs->trans("VariousPayment").''; + + // Debit + $sql = "SELECT SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; + $sql .= ' WHERE 1 = 1'; + if (!empty($date_start) && !empty($date_end)) + $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql .= ' GROUP BY p.sens'; + $sql .= ' ORDER BY p.sens'; + + dol_syslog('get various payments', LOG_DEBUG); + $result = $db->query($sql); + if ($result) + { + + // Debit + $obj = $db->fetch_object($result); + if (isset($obj->amount)) + { + $subtotal_ht += -$obj->amount; + $subtotal_ttc += -$obj->amount; + } + print ' '; + print "".$langs->trans("Debit")."\n"; + if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).''; + print ''.price(-$obj->amount)."\n"; + print "\n"; + + // Credit + $obj = $db->fetch_object($result); + if (isset($obj->amount)) + { + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + } + print ' '; + print "".$langs->trans("Credit")."\n"; + if ($modecompta == 'CREANCES-DETTES') print ''.price($obj->amount).''; + print ''.price($obj->amount)."\n"; + print "\n"; + + // Total + $total_ht += $subtotal_ht; + $total_ttc += $subtotal_ttc; + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''.price($subtotal_ht).''; + print ''.price($subtotal_ttc).''; + print ''; + + } + else dol_print_error($db); + } + + /* + * Payement Loan + */ + + if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) + { + $subtotal_ht = 0; + $subtotal_ttc = 0; + + print ''.$langs->trans("PaymentLoan").''; + + $sql = 'SELECT l.rowid as id, l.label AS label, SUM(p.amount_capital + p.amount_insurance + p.amount_interest) as amount FROM '.MAIN_DB_PREFIX.'payment_loan as p'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'loan AS l ON l.rowid = p.fk_loan'; + $sql .= ' WHERE 1 = 1'; + if (!empty($date_start) && !empty($date_end)) + $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql .= ' GROUP BY p.fk_loan'; + $sql .= ' ORDER BY p.fk_loan'; + + dol_syslog('get loan payments', LOG_DEBUG); + $result = $db->query($sql); + if ($result) + { + require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; + $loan_static = new Loan($db); + while ($obj = $db->fetch_object($result)) + { + $loan_static->id = $obj->id; + $loan_static->ref = $obj->id; + $loan_static->label = $obj->label; + print ' '; + print "".$loan_static->getNomUrl(1).' - '.$obj->label."\n"; + if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).''; + print ''.price(-$obj->amount)."\n"; + print "\n"; + $subtotal_ht -= $obj->amount; + $subtotal_ttc -= $obj->amount; + } + + $total_ht += $subtotal_ht; + $total_ttc += $subtotal_ttc; + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''.price($subtotal_ht).''; + print ''.price($subtotal_ttc).''; + print ''; + } + else dol_print_error($db); + } + /* * VAT diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index d462007d273..ed3befce56c 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -6,6 +6,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -794,6 +795,117 @@ elseif ($modecompta == 'BOOKKEEPING') { // Nothing from this table } +/* + * Various Payments + */ + +if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) +{ + + // decaiss + + $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; + $sql .= ' WHERE p.sens = 0'; + if (!empty($date_start) && !empty($date_end)) + $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql .= ' GROUP BY dm'; + + dol_syslog("get various payments"); + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + if (!isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm] = 0; + if (isset($obj->amount)) $decaiss_ttc[$obj->dm] += $obj->amount; + $i++; + } + } + } + else + { + dol_print_error($db); + } + + // encaiss + + $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various AS p"; + $sql .= ' WHERE p.sens = 1'; + if (!empty($date_start) && !empty($date_end)) + $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql .= ' GROUP BY dm'; + + dol_syslog("get various payments"); + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + if (!isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm] = 0; + if (isset($obj->amount)) $encaiss_ttc[$obj->dm] += $obj->amount; + $i++; + } + } + } + else + { + dol_print_error($db); + } + +} +elseif ($modecompta == 'BOOKKEEPING') { + // Useless with BOOKKEEPING +} + +/* + * Payement Loan + */ + +if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) +{ + + $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount_capital + p.amount_insurance + p.amount_interest) AS amount FROM ".MAIN_DB_PREFIX."payment_loan AS p"; + $sql .= ' WHERE 1 = 1'; + if (!empty($date_start) && !empty($date_end)) + $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql .= ' GROUP BY dm'; + + dol_syslog("get loan payments"); + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + if (!isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm] = 0; + if (isset($obj->amount)) $decaiss_ttc[$obj->dm] += $obj->amount; + $i++; + } + } + } + else + { + dol_print_error($db); + } + +} +elseif ($modecompta == 'BOOKKEEPING') { + // Not use with BOOKKEEPING +} /* diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 6cd046c5607..8a8c837ac87 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -262,3 +262,5 @@ RulesPurchaseTurnoverIn=- It includes all the effective payments of invoices don RulesPurchaseTurnoverTotalPurchaseJournal=It includes all debit lines from the purchase journal. ReportPurchaseTurnover=Purchase turnover invoiced ReportPurchaseTurnoverCollected=Purchase turnover collected +IncludeVarpaysInResults = Include various payments in reports +IncludeLoansInResults = Include loans in reports diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index c60c79513c5..d4c59754898 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -262,3 +262,5 @@ RulesPurchaseTurnoverIn=- It includes all the effective payments of invoices don RulesPurchaseTurnoverTotalPurchaseJournal=It includes all debit lines from the purchase journal. ReportPurchaseTurnover=Purchase turnover invoiced ReportPurchaseTurnoverCollected=Purchase turnover collected +IncludeVarpaysInResults = Inclure les payments divers dans les rapports +IncludeLoansInResults = Inclure les emprunts dans les rapports From bf8cd51a5aaf32db3dd66bf73c1021ce08f38f4b Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 6 May 2020 13:37:24 +0200 Subject: [PATCH 061/490] Fix somes code formating errors --- htdocs/compta/resultat/clientfourn.php | 8 ++------ htdocs/compta/resultat/index.php | 14 ++++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 59b7999e4ef..27bc4526a3e 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -977,7 +977,6 @@ else $result = $db->query($sql); if ($result) { - // Debit $obj = $db->fetch_object($result); if (isset($obj->amount)) @@ -987,7 +986,7 @@ else } print ' '; print "".$langs->trans("Debit")."\n"; - if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).''; + if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).''; print ''.price(-$obj->amount)."\n"; print "\n"; @@ -1000,7 +999,7 @@ else } print ' '; print "".$langs->trans("Credit")."\n"; - if ($modecompta == 'CREANCES-DETTES') print ''.price($obj->amount).''; + if ($modecompta == 'CREANCES-DETTES') print ''.price($obj->amount).''; print ''.price($obj->amount)."\n"; print "\n"; @@ -1012,7 +1011,6 @@ else print ''.price($subtotal_ht).''; print ''.price($subtotal_ttc).''; print ''; - } else dol_print_error($db); } @@ -1055,7 +1053,6 @@ else $subtotal_ht -= $obj->amount; $subtotal_ttc -= $obj->amount; } - $total_ht += $subtotal_ht; $total_ttc += $subtotal_ttc; print ''; @@ -1067,7 +1064,6 @@ else else dol_print_error($db); } - /* * VAT */ diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index ed3befce56c..10d0f31fe72 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -801,7 +801,6 @@ elseif ($modecompta == 'BOOKKEEPING') { if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { - // decaiss $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; @@ -863,9 +862,9 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba } } -elseif ($modecompta == 'BOOKKEEPING') { - // Useless with BOOKKEEPING -} +// Useless with BOOKKEEPING +//elseif ($modecompta == 'BOOKKEEPING') { +//} /* * Payement Loan @@ -873,7 +872,6 @@ elseif ($modecompta == 'BOOKKEEPING') { if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { - $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount_capital + p.amount_insurance + p.amount_interest) AS amount FROM ".MAIN_DB_PREFIX."payment_loan AS p"; $sql .= ' WHERE 1 = 1'; if (!empty($date_start) && !empty($date_end)) @@ -903,9 +901,9 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan } } -elseif ($modecompta == 'BOOKKEEPING') { - // Not use with BOOKKEEPING -} +// Useless with BOOKKEEPING +//elseif ($modecompta == 'BOOKKEEPING') { +//} /* From 7bf037ab2ff568e45096d86b5de1d64df7b0239c Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 6 May 2020 13:46:24 +0200 Subject: [PATCH 062/490] Fix blank line at end of control structure --- htdocs/compta/resultat/index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 10d0f31fe72..ad81a3943c1 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -860,7 +860,6 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba { dol_print_error($db); } - } // Useless with BOOKKEEPING //elseif ($modecompta == 'BOOKKEEPING') { @@ -899,7 +898,6 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan { dol_print_error($db); } - } // Useless with BOOKKEEPING //elseif ($modecompta == 'BOOKKEEPING') { From 889e5db4fbbf8e081f9ab4f6fe34e581bd6477a2 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 6 May 2020 13:55:38 +0200 Subject: [PATCH 063/490] Fix use Form::selectyesno() for added options in admin/compta.php --- htdocs/admin/compta.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index b3c66af76ca..3ccc2a213ac 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -177,20 +177,14 @@ foreach ($list as $key) print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print $form->selectyesno('ACCOUNTING_REPORTS_INCLUDE_VARPAY', (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY))); print ''; // Option to include loan in results print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print $form->selectyesno('ACCOUNTING_REPORTS_INCLUDE_LOAN', (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN))); print ''; print "\n"; From 3dbe9a4af1d18cdf3a9c8404b25d1209d94d07d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 13:59:15 +0200 Subject: [PATCH 064/490] Fix label --- htdocs/product/admin/stock_extrafields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/admin/stock_extrafields.php b/htdocs/product/admin/stock_extrafields.php index 0e8f7289b77..22ad53cd0e8 100644 --- a/htdocs/product/admin/stock_extrafields.php +++ b/htdocs/product/admin/stock_extrafields.php @@ -68,7 +68,7 @@ print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup'); $head = stock_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Warehouses"), -1, 'stock'); +dol_fiche_head($head, 'attributes', $langs->trans("StockSetup"), -1, 'stock'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; From bfd4ebd49d40942d8cf8bfa2a2cbd2ff6f5f125e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 14:28:24 +0200 Subject: [PATCH 065/490] FIX Changing password message not visible if a background is set --- htdocs/user/passwordforgotten.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 461ab8e7b4a..0afa158ec58 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -133,7 +133,7 @@ if ($action == 'buildnewpassword' && $username) // Success if ($edituser->send_password($edituser, $newpassword, 1) > 0) { - $message = '
'.$langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)).'
'; + $message = ''; $username = ''; } else From e7ae9c752ea54a59d0ae9406d1043d4d0afb6cf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 14:48:02 +0200 Subject: [PATCH 066/490] Fix missing trackid --- htdocs/user/class/user.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 23d42ba3e65..09f78a7d044 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1972,12 +1972,12 @@ class User extends CommonObject /** * Send new password by email * - * @param User $user Object user that send email + * @param User $fuser Object user that send email * @param string $password New password * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @todo Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ - public function send_password($user, $password = '', $changelater = 0) + public function send_password($fuser, $password = '', $changelater = 0) { // phpcs:enable global $conf, $langs; @@ -1997,8 +1997,8 @@ class User extends CommonObject { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } - if ($user->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + if ($fuser->conf->MAIN_LANG_DEFAULT) { + $outputlangs->setDefaultLang($fuser->conf->MAIN_LANG_DEFAULT); } else { // If user has not defined its own language, we used current language @@ -2028,7 +2028,7 @@ class User extends CommonObject $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg .= "--\n"; - $mesg .= $user->getFullName($outputlangs); // Username that make then sending + $mesg .= $fuser->getFullName($outputlangs); // Username that make then sending dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } @@ -2048,6 +2048,8 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } + $trackid = 'use'.$fuser->id; + $mailfile = new CMailFile( $subject, $this->email, @@ -2059,7 +2061,10 @@ class User extends CommonObject '', '', 0, - $msgishtml + $msgishtml, + '', + '', + $trackid ); if ($mailfile->sendfile()) From abdb0cc8c025359c8eb05cc705cd36820bbd46e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 15:03:57 +0200 Subject: [PATCH 067/490] Fix use correct trackid --- htdocs/user/class/user.class.php | 13 +++++++------ htdocs/user/passwordforgotten.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 09f78a7d044..e20c1ca527b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1972,12 +1972,12 @@ class User extends CommonObject /** * Send new password by email * - * @param User $fuser Object user that send email + * @param User $user Object user that send the email (not the user we send too) * @param string $password New password * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @todo Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ - public function send_password($fuser, $password = '', $changelater = 0) + public function send_password($user, $password = '', $changelater = 0) { // phpcs:enable global $conf, $langs; @@ -1997,8 +1997,9 @@ class User extends CommonObject { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } - if ($fuser->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($fuser->conf->MAIN_LANG_DEFAULT); + + if ($this->conf->MAIN_LANG_DEFAULT) { + $outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT); } else { // If user has not defined its own language, we used current language @@ -2028,7 +2029,7 @@ class User extends CommonObject $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg .= "--\n"; - $mesg .= $fuser->getFullName($outputlangs); // Username that make then sending + $mesg .= $user->getFullName($outputlangs); // Username that send email dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } @@ -2048,7 +2049,7 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } - $trackid = 'use'.$fuser->id; + $trackid = 'use'.$this->id; $mailfile = new CMailFile( $subject, diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 0afa158ec58..81e6779b80b 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -131,7 +131,7 @@ if ($action == 'buildnewpassword' && $username) else { // Success - if ($edituser->send_password($edituser, $newpassword, 1) > 0) + if ($edituser->send_password($user, $newpassword, 1) > 0) { $message = ''; $username = ''; From 1ec8b31e46e7ef1d1036f08b4814170ed501618c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 15:15:12 +0200 Subject: [PATCH 068/490] Fix remove action param in url to allow a second try without the error message --- htdocs/core/tpl/passwordforgotten.tpl.php | 1 + htdocs/user/class/user.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index ab12b48aa08..63ff6a8a0a7 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -40,6 +40,7 @@ if (!empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax = 1; $php_self = $_SERVER['PHP_SELF']; $php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''; +$php_self = str_replace('action=validatenewpassword', '', $php_self); $titleofpage = $langs->trans('SendNewPassword'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e20c1ca527b..11d0cec3654 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1838,7 +1838,7 @@ class User extends CommonObject /** * Change password of a user * - * @param User $user Object user of user making change + * @param User $user Object user of user requesting the change (not the user for who we change the password). May be unknown. * @param string $password New password in clear text (to generate if not provided) * @param int $changelater 1=Change password only after clicking on confirm email * @param int $notrigger 1=Does not launch triggers @@ -2029,7 +2029,7 @@ class User extends CommonObject $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg .= "--\n"; - $mesg .= $user->getFullName($outputlangs); // Username that send email + $mesg .= $user->getFullName($outputlangs); // Username that send the email (not the user for who we want to reset password) dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } From 485896614b4e1cb831b8fcbd84e6e1ce56737bb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 15:30:00 +0200 Subject: [PATCH 069/490] Add message during password reset --- htdocs/langs/en_US/users.lang | 1 + htdocs/user/passwordforgotten.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index aea4e7676e4..9b75a2ff37e 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -78,6 +78,7 @@ UserWillBeExternalUser=Created user will be an external user (because linked to IdPhoneCaller=Id phone caller NewUserCreated=User %s created NewUserPassword=Password change for %s +NewPasswordValidated=Your new password have been validated and must be used now to login. EventUserModified=User %s modified UserDisabled=User %s disabled UserEnabled=User %s activated diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 81e6779b80b..f8c035779d2 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -77,7 +77,8 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) { if (dol_verifyHash($edituser->pass_temp, $passwordhash)) { - $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); + setEventMessages('NewPasswordValidated', null, 'mesgs'); + $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database"); header("Location: ".DOL_URL_ROOT.'/'); exit; From 5e6b7fb6b4cb598e5ff1980d2a20b43cf7f01c3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 15:36:14 +0200 Subject: [PATCH 070/490] Show message after pass reset --- htdocs/user/passwordforgotten.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index f8c035779d2..7f8ad45a06d 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -77,7 +77,10 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) { if (dol_verifyHash($edituser->pass_temp, $passwordhash)) { - setEventMessages('NewPasswordValidated', null, 'mesgs'); + // Clear session + $_SESSION['dol_login'] = ''; + $_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page + $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database"); header("Location: ".DOL_URL_ROOT.'/'); From 4c04ace9d8305da6e4bdca000ae8d333f2ba5217 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 15:39:07 +0200 Subject: [PATCH 071/490] fix reset of session --- htdocs/user/passwordforgotten.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 7f8ad45a06d..b0f3a5aab6c 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -78,7 +78,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) if (dol_verifyHash($edituser->pass_temp, $passwordhash)) { // Clear session - $_SESSION['dol_login'] = ''; + unset($_SESSION['dol_login']); $_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); From b3a064d309e2533c911bbf45f246f98309a1e2b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 16:02:34 +0200 Subject: [PATCH 072/490] Fix dup --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a7d0282fba5..bcbfb1a959c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,6 @@ English Dolibarr ChangeLog ***** ChangeLog for 11.0.4 compared to 11.0.3 ***** FIX: #13749 -FIX: #7594 FIX: #7594 Expense report multi pagebreak FIX: Access to undeclared static property: Contact::$table_element FIX: actions on supplier proposal not saved (bad trigger name) From 326dc7d36743779fde215dc23a63ea03796dcf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 May 2020 17:59:40 +0200 Subject: [PATCH 073/490] fix html file:///home/fred/Images/S%C3%A9lection_078.png --- htdocs/bookmarks/bookmarks.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 46e9ca315a5..93283cab815 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -60,7 +60,7 @@ function printDropdownBookmarksList() } $searchForm = ''."\n"; - $searchForm .= '
global->MAIN_OPTIMIZEFORTEXTBROWSER) ? 'onsubmit="return false"' : '').'>'; + $searchForm .= 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' onsubmit="return false"' : '').'>'; $searchForm .= ''; From 91dcf103757d4c8d5898af031bed620b7c186c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 May 2020 23:56:02 +0200 Subject: [PATCH 074/490] session_cache_limiter before starting session --- htdocs/modulebuilder/template/css/mymodule.css.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index a7ce9fce677..af1566c0869 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -32,6 +32,11 @@ if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +session_cache_limiter('public'); +// false or '' = keep cache instruction added by server +// 'public' = remove cache instruction added by server +// and if no cache-control added later, a default cache delay (10800) will be added by PHP. + // Load Dolibarr environment $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) @@ -48,10 +53,6 @@ if (!$res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -session_cache_limiter('public'); -// false or '' = keep cache instruction added by server -// 'public' = remove cache instruction added by server and if no cache-control added later, a default cache delay (10800) will be added by PHP. - // Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS /*if (empty($user->id) && ! empty($_SESSION['dol_login'])) { From d4400cf80fce889f4836338ca40a8bff0080ee2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 11:39:32 +0200 Subject: [PATCH 075/490] FIX links into emails of notifications --- htdocs/core/class/notify.class.php | 56 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 6c0ec1ec62b..8a03196beef 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -416,34 +416,34 @@ class Notify switch ($notifcode) { case 'BILL_VALIDATE': - $link='/compta/facture/card.php?facid='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $link); break; case 'BILL_PAYED': - $link='/compta/facture/card.php?facid='.$object->id; + $link ='' . $newref . ''; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link); break; case 'ORDER_VALIDATE': - $link='/commande/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->commande->dir_output; $object_type = 'order'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $link); break; case 'PROPAL_VALIDATE': - $link='/comm/propal/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $link); break; case 'PROPAL_CLOSE_SIGNED': - $link='/comm/propal/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $link); break; case 'FICHINTER_ADD_CONTACT': $link='/fichinter/card.php?id='.$object->id; @@ -452,17 +452,17 @@ class Notify $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionAddedContact", $newref); break; case 'FICHINTER_VALIDATE': - $link='/fichinter/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated", $link); break; case 'ORDER_SUPPLIER_VALIDATE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $newref, $user->getFullName($outputlangs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $link, $user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_APPROVE': @@ -470,46 +470,46 @@ class Notify $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $newref, $user->getFullName($outputlangs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': - $link='/fourn/commande/card.php?id='.$object->id; + $link = '' . $newref . ''; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $newref, $user->getFullName($outputlangs)); + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $link, $user->getFullName($outputlangs)); $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'expedition'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; case 'EXPENSE_REPORT_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link); break; case 'EXPENSE_REPORT_APPROVE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link); break; case 'HOLIDAY_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $link); break; case 'HOLIDAY_APPROVE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); break; } $ref = dol_sanitizeFileName($newref); @@ -528,7 +528,6 @@ class Notify $message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; - if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to '' $parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list); if (!isset($action)) $action = ''; @@ -655,7 +654,7 @@ class Notify break; case 'FICHINTER_ADD_CONTACT': $link = '' . $newref . ''; - $dir_output = $conf->facture->dir_output; + $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact", $link); break; @@ -701,31 +700,31 @@ class Notify $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; case 'EXPENSE_REPORT_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link); break; case 'EXPENSE_REPORT_APPROVE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link); break; case 'HOLIDAY_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $link); break; case 'HOLIDAY_APPROVE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref); + $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); break; } $ref = dol_sanitizeFileName($newref); @@ -744,7 +743,6 @@ class Notify $message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; - if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to '' $message = nl2br($message); From 03fddd48af55363089ad6082be122d407922ced5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 12:14:45 +0200 Subject: [PATCH 076/490] Clean some constructors --- htdocs/compta/prelevement/bons.php | 2 +- htdocs/compta/prelevement/card.php | 4 ++-- .../compta/prelevement/class/bonprelevement.class.php | 10 ++++------ .../prelevement/class/ligneprelevement.class.php | 4 +--- .../prelevement/class/rejetprelevement.class.php | 3 ++- htdocs/compta/prelevement/factures.php | 2 +- htdocs/compta/prelevement/fiche-rejet.php | 2 +- htdocs/compta/prelevement/fiche-stat.php | 4 ++-- htdocs/compta/prelevement/line.php | 4 ++-- htdocs/compta/prelevement/list.php | 4 ++-- htdocs/compta/prelevement/rejets.php | 2 +- htdocs/compta/prelevement/stats.php | 2 +- 12 files changed, 20 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 7f0bd46c450..c7c717e702b 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -54,7 +54,7 @@ $statut = GETPOST('statut', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); -$bon = new BonPrelevement($db, ""); +$bon = new BonPrelevement($db); $hookmanager->initHooks(array('withdrawalsreceiptslist')); diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 68f40999aa7..4dcd9f33388 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -58,7 +58,7 @@ $pagenext = $page + 1; if (!$sortfield) $sortfield = 'pl.fk_soc'; if (!$sortorder) $sortorder = 'DESC'; -$object = new BonPrelevement($db, ""); +$object = new BonPrelevement($db); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals @@ -321,7 +321,7 @@ if ($id > 0 || $ref) } - $ligne = new LignePrelevement($db, $user); + $ligne = new LignePrelevement($db); /* * Lines into withdraw request diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0a033e2df53..0c21a3e6d2b 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -83,18 +83,16 @@ class BonPrelevement extends CommonObject * Constructor * * @param DoliDB $db Database handler - * @param string $filename Filename of withdraw receipt */ - public function __construct($db, $filename = '') + public function __construct($db) { global $conf, $langs; - $error = 0; $this->db = $db; - $this->filename = $filename; + $this->filename = ''; - $this->date_echeance = time(); + $this->date_echeance = dol_now(); $this->raison_sociale = ""; $this->reference_remise = ""; @@ -892,7 +890,7 @@ class BonPrelevement extends CommonObject if ($bac->verif() >= 1) { $factures_prev[$i] = $fac; - /* second tableau necessaire pour BonPrelevement */ + /* second array necessary for BonPrelevement */ $factures_prev_id[$i] = $fac[0]; $i++; //dol_syslog(__METHOD__."::RIB is ok", LOG_DEBUG); diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index dd24ad9522c..88b612554df 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -48,14 +48,12 @@ class LignePrelevement * Constructor * * @param DoliDb $db Database handler - * @param User $user Objet user */ - public function __construct($db, $user) + public function __construct($db) { global $conf, $langs; $this->db = $db; - $this->user = $user; // List of language codes for status diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 74626baed13..8c033353637 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -247,6 +247,7 @@ class RejetPrelevement $sendto = $emuser->getFullName($langs)." <".$emuser->email.">"; $from = $this->user->getFullName($langs)." <".$this->user->email.">"; $msgishtml = 1; + $trackid = 'use'.$emuser->id; $arr_file = array(); $arr_mime = array(); @@ -258,7 +259,7 @@ class RejetPrelevement $message = $langs->trans("InfoRejectMessage", $facref, $socname, $amount, $userinfo); - $mailfile = new CMailFile($subject, $sendto, $from, $message, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $this->user->email); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $this->user->email, '', $trackid); $result = $mailfile->sendfile(); if ($result) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index ec004717946..fb0a5548426 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -53,7 +53,7 @@ $pagenext = $page + 1; if (!$sortfield) $sortfield = 'p.ref'; if (!$sortorder) $sortorder = 'DESC'; -$object = new BonPrelevement($db, ""); +$object = new BonPrelevement($db); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 44be3d1cd01..1cc454a3d4d 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -51,7 +51,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$object = new BonPrelevement($db, ""); +$object = new BonPrelevement($db); diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 6e8e8390ae8..18028e2059a 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -50,7 +50,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; -$object = new BonPrelevement($db, ""); +$object = new BonPrelevement($db); /* @@ -142,7 +142,7 @@ if ($prev_id > 0 || $ref) /* * Stats */ - $ligne = new LignePrelevement($db, $user); + $ligne = new LignePrelevement($db); $sql = "SELECT sum(pl.amount), pl.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 6eef29d1e3e..29bb5c435e3 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -90,7 +90,7 @@ if ($action == 'confirm_rejet') if (!$error) { - $lipre = new LignePrelevement($db, $user); + $lipre = new LignePrelevement($db); if ($lipre->fetch($id) == 0) @@ -132,7 +132,7 @@ $h++; if ($id) { - $lipre = new LignePrelevement($db, $user); + $lipre = new LignePrelevement($db); if ($lipre->fetch($id) == 0) { diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index bebb838652d..48f9bcc7c54 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -64,8 +64,8 @@ $search_code = GETPOST('search_code', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $statut = GETPOST('statut', 'int'); -$bon = new BonPrelevement($db, ""); -$line = new LignePrelevement($db, $user); +$bon = new BonPrelevement($db); +$line = new LignePrelevement($db); $company = new Societe($db); $hookmanager->initHooks(array('withdrawalsreceiptslineslist')); diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 928aaba51b1..6d1994b7a4b 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -57,7 +57,7 @@ if ($sortorder == "") $sortorder = "DESC"; if ($sortfield == "") $sortfield = "p.datec"; $rej = new RejetPrelevement($db, $user); -$line = new LignePrelevement($db, $user); +$line = new LignePrelevement($db); $hookmanager->initHooks(array('withdrawalsreceiptsrejectedlist')); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index c19603df967..c6d1962ff46 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -73,7 +73,7 @@ if ($resql) print '
'; print load_fiche_titre($langs->trans("WithdrawStatistics"), '', ''); -$ligne = new LignePrelevement($db, $user); +$ligne = new LignePrelevement($db); $sql = "SELECT sum(pl.amount), count(pl.amount), pl.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; From ad489ab1b409b11f2e39552d63e2fb6cff603115 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 7 May 2020 12:22:13 +0200 Subject: [PATCH 077/490] NEW show messages on ticket card --- htdocs/ticket/card.php | 919 +++++++++++++++++++++-------------------- 1 file changed, 479 insertions(+), 440 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index b9459a0e161..3d37c46eb90 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -55,6 +55,17 @@ $action = GETPOST('action', 'aZ09'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); + +if (GETPOST('actioncode', 'array')) { + $actioncode = GETPOST('actioncode', 'array', 3); + if (!count($actioncode)) $actioncode = '0'; +} else { + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label = GETPOST('search_agenda_label'); + // Initialize technical object to manage hooks of ticket. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ticketcard', 'globalcard')); @@ -116,493 +127,486 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if ($cancel) -{ - if (!empty($backtopage)) +if (empty($reshook)) { + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers{ { - header("Location: ".$backtopage); - exit; - } - $action = 'view'; -} - -if (GETPOST('add', 'alpha') && $user->rights->ticket->write) { - $error = 0; - - if (!GETPOST("subject", 'alpha')) { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")), null, 'errors'); - $action = 'create'; - } elseif (!GETPOST("message", 'alpha')) { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors'); - $action = 'create'; + $actioncode = ''; + $search_agenda_label = ''; } - if (!$error) { - $db->begin(); + if ($cancel) { + if (!empty($backtopage)) { + header("Location: " . $backtopage); + exit; + } + $action = 'view'; + } - $object->ref = GETPOST("ref", 'alpha'); - $object->fk_soc = GETPOST("socid", 'int') > 0 ? GETPOST("socid", 'int') : 0; - $object->subject = GETPOST("subject", 'alpha'); - $object->message = GETPOST("message", 'none'); + if (GETPOST('add', 'alpha') && $user->rights->ticket->write) { + $error = 0; - $object->type_code = GETPOST("type_code", 'alpha'); - $object->category_code = GETPOST("category_code", 'alpha'); - $object->severity_code = GETPOST("severity_code", 'alpha'); - $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); - $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; - - $object->fk_project = GETPOST('projectid', 'int'); - - $ret = $extrafields->setOptionalsFromPost(null, $object); - - $id = $object->create($user); - if ($id <= 0) { + if (!GETPOST("subject", 'alpha')) { $error++; - setEventMessage($object->error, $object->errors, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")), null, 'errors'); + $action = 'create'; + } elseif (!GETPOST("message", 'alpha')) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors'); $action = 'create'; } - if (!$error) - { - // Add contact - $contactid = GETPOST('contactid', 'int'); - $type_contact = GETPOST("type", 'alpha'); + if (!$error) { + $db->begin(); - if ($contactid > 0 && $type_contact) { - $result = $object->add_contact($contactid, GETPOST("type"), 'external'); + $object->ref = GETPOST("ref", 'alpha'); + $object->fk_soc = GETPOST("socid", 'int') > 0 ? GETPOST("socid", 'int') : 0; + $object->subject = GETPOST("subject", 'alpha'); + $object->message = GETPOST("message", 'none'); + + $object->type_code = GETPOST("type_code", 'alpha'); + $object->category_code = GETPOST("category_code", 'alpha'); + $object->severity_code = GETPOST("severity_code", 'alpha'); + $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); + $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; + + $object->fk_project = GETPOST('projectid', 'int'); + + $ret = $extrafields->setOptionalsFromPost(null, $object); + + $id = $object->create($user); + if ($id <= 0) { + $error++; + setEventMessage($object->error, $object->errors, 'errors'); + $action = 'create'; } - // altairis: link ticket to project - if (GETPOST('projectid') > 0) { - $object->setProject(GETPOST('projectid')); - } + if (!$error) { + // Add contact + $contactid = GETPOST('contactid', 'int'); + $type_contact = GETPOST("type", 'alpha'); - // Auto assign user - if ($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE) { - $result = $object->assignUser($user, $user->id, 1); - $object->add_contact($user->id, "SUPPORTTEC", 'internal'); - } + if ($contactid > 0 && $type_contact) { + $result = $object->add_contact($contactid, GETPOST("type"), 'external'); + } - // Auto assign contrat - $contractid = 0; - if ($conf->global->TICKET_AUTO_ASSIGN_CONTRACT_CREATE) { - $contrat = new Contrat($db); - $contrat->socid = $object->fk_soc; - $list = $contrat->getListOfContracts(); + // altairis: link ticket to project + if (GETPOST('projectid') > 0) { + $object->setProject(GETPOST('projectid')); + } - if (is_array($list) && !empty($list)) { - if (count($list) == 1) { - $contractid = $list[0]->id; - $object->setContract($contractid); - } else { + // Auto assign user + if ($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE) { + $result = $object->assignUser($user, $user->id, 1); + $object->add_contact($user->id, "SUPPORTTEC", 'internal'); + } + + // Auto assign contrat + $contractid = 0; + if ($conf->global->TICKET_AUTO_ASSIGN_CONTRACT_CREATE) { + $contrat = new Contrat($db); + $contrat->socid = $object->fk_soc; + $list = $contrat->getListOfContracts(); + + if (is_array($list) && !empty($list)) { + if (count($list) == 1) { + $contractid = $list[0]->id; + $object->setContract($contractid); + } else { + } + } + } + + // Auto create fiche intervention + if ($conf->global->TICKET_AUTO_CREATE_FICHINTER_CREATE) { + $fichinter = new Fichinter($db); + $fichinter->socid = $object->fk_soc; + $fichinter->fk_project = GETPOST('projectid', 'int'); + $fichinter->fk_contrat = $contractid; + $fichinter->author = $user->id; + $fichinter->modelpdf = 'soleil'; + $fichinter->origin = $object->element; + $fichinter->origin_id = $object->id; + + // Extrafields + $extrafields->fetch_name_optionals_label($fichinter->table_element); + $array_options = $extrafields->getOptionalsFromPost($fichinter->table_element); + $fichinter->array_options = $array_options; + + $id = $fichinter->create($user); + if ($id <= 0) { + setEventMessages($fichinter->error, null, 'errors'); } } } - // Auto create fiche intervention - if ($conf->global->TICKET_AUTO_CREATE_FICHINTER_CREATE) - { - $fichinter = new Fichinter($db); - $fichinter->socid = $object->fk_soc; - $fichinter->fk_project = GETPOST('projectid', 'int'); - $fichinter->fk_contrat = $contractid; - $fichinter->author = $user->id; - $fichinter->modelpdf = 'soleil'; - $fichinter->origin = $object->element; - $fichinter->origin_id = $object->id; + if (!$error) { + // File transfer + $object->copyFilesForTicket(); + } - // Extrafields - $extrafields->fetch_name_optionals_label($fichinter->table_element); - $array_options = $extrafields->getOptionalsFromPost($fichinter->table_element); - $fichinter->array_options = $array_options; + if (!$error) { + $db->commit(); - $id = $fichinter->create($user); - if ($id <= 0) { - setEventMessages($fichinter->error, null, 'errors'); + if (!empty($backtopage)) { + $url = $backtopage; + } else { + $url = 'card.php?track_id=' . $object->track_id; } - } - } - if (!$error) - { - // File transfer - $object->copyFilesForTicket(); - } - - if (!$error) - { - $db->commit(); - - if (!empty($backtopage)) { - $url = $backtopage; + header("Location: " . $url); + exit; } else { - $url = 'card.php?track_id='.$object->track_id; + $db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); } - - header("Location: ".$url); - exit; } else { - $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } -} - -if ($action == 'edit' && $user->rights->ticket->write) { - $error = 0; - - if ($object->fetch(GETPOST('id', 'int')) < 0) { - $error++; - array_push($object->errors, $langs->trans("ErrorTicketIsNotValid")); - $_GET["action"] = $_POST["action"] = ''; - } -} - -if (GETPOST('update', 'alpha') && GETPOST('id', 'int') && $user->rights->ticket->write) { - $error = 0; - - $ret = $object->fetch(GETPOST('id', 'int')); - if ($ret < 0) { - $error++; - array_push($object->errors, $langs->trans("ErrorTicketIsNotValid")); - $action = ''; - } elseif (!GETPOST("label")) { - $error++; - array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"))); - $action = 'edit'; - } elseif (!GETPOST("subject")) { - $error++; - array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject"))); - $action = 'edit'; } - if (!$error) { - $db->begin(); + if ($action == 'edit' && $user->rights->ticket->write) { + $error = 0; - $object->label = GETPOST("label", 'alphanohtml'); - $object->description = GETPOST("description", 'none'); - - //... - $ret = $object->update($user); - if ($ret <= 0) { + if ($object->fetch(GETPOST('id', 'int')) < 0) { $error++; - setEventMessage($object->error, $object->errors, 'errors'); + array_push($object->errors, $langs->trans("ErrorTicketIsNotValid")); + $_GET["action"] = $_POST["action"] = ''; + } + } + + if (GETPOST('update', 'alpha') && GETPOST('id', 'int') && $user->rights->ticket->write) { + $error = 0; + + $ret = $object->fetch(GETPOST('id', 'int')); + if ($ret < 0) { + $error++; + array_push($object->errors, $langs->trans("ErrorTicketIsNotValid")); + $action = ''; + } elseif (!GETPOST("label")) { + $error++; + array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"))); + $action = 'edit'; + } elseif (!GETPOST("subject")) { + $error++; + array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject"))); $action = 'edit'; } - if (!$error && $ret > 0) { - $db->commit(); - } else { - $db->rollback(); - } - } -} + if (!$error) { + $db->begin(); -// Mark as Read -if ($action == "mark_ticket_read" && $user->rights->ticket->write) { - $object->fetch('', '', GETPOST("track_id", 'alpha')); + $object->label = GETPOST("label", 'alphanohtml'); + $object->description = GETPOST("description", 'none'); - if ($object->markAsRead($user) > 0) - { - setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs'); + //... + $ret = $object->update($user); + if ($ret <= 0) { + $error++; + setEventMessage($object->error, $object->errors, 'errors'); + $action = 'edit'; + } - header("Location: card.php?track_id=".$object->track_id."&action=view"); - exit; - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - $action = 'view'; -} - -// Assign to someone -if ($action == "assign_user" && GETPOST('btn_assign_user', 'alpha') && $user->rights->ticket->write) { - $object->fetch('', '', GETPOST("track_id", 'alpha')); - $useroriginassign = $object->fk_user_assign; - $usertoassign = GETPOST('fk_user_assign', 'int'); - - /*if (! ($usertoassign > 0)) { - $error++; - array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("AssignedTo"))); - $action = 'view'; - }*/ - - if (!$error) - { - $ret = $object->assignUser($user, $usertoassign); - if ($ret < 0) $error++; - } - - if (!$error) // Update list of contacts - { - // Si déjà un user assigné on le supprime des contacts - if ($useroriginassign > 0) { - $internal_contacts = $object->listeContact(-1, 'internal'); - - foreach ($internal_contacts as $key => $contact) { - if ($contact['code'] == "SUPPORTTEC" && $contact['id'] == $useroriginassign) { - } - { - //print "user à effacer : ".$useroriginassign; - $object->delete_contact($contact['rowid']); - } + if (!$error && $ret > 0) { + $db->commit(); + } else { + $db->rollback(); } } - - if ($usertoassign > 0) $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0); } - if (!$error) - { - // Log action in ticket logs table - $object->fetch_user($usertoassign); - $log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs)); + // Mark as Read + if ($action == "mark_ticket_read" && $user->rights->ticket->write) { + $object->fetch('', '', GETPOST("track_id", 'alpha')); - setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs'); + if ($object->markAsRead($user) > 0) { + setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs'); - header("Location: card.php?track_id=".$object->track_id."&action=view"); - exit; - } else { - array_push($object->errors, $object->error); - } - $action = 'view'; -} - -if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $user->rights->ticket->read) { - $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0)); - - if ($ret > 0) { - if (!empty($backtopage)) { - $url = $backtopage; - } else { - $url = 'card.php?action=view&track_id='.$object->track_id; - } - - header("Location: ".$url); - exit; - } else { - setEventMessages($object->error, null, 'errors'); - $action = 'presend'; - } -} - -if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) -{ - $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); - - if ($object->close($user)) { - setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); - - $url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha'); - header("Location: ".$url); - } else { - $action = ''; - setEventMessages($object->error, $object->errors, 'errors'); - } -} - -if ($action == "confirm_public_close" && GETPOST('confirm', 'alpha') == 'yes') { - $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); - if ($_SESSION['email_customer'] == $object->origin_email || $_SESSION['email_customer'] == $object->thirdparty->email) { - $object->close($user); - - // Log action in ticket logs table - $log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']); - - setEventMessages('
'.$langs->trans('TicketMarkedAsClosed').'
', null, 'mesgs'); - - $url = 'card.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha'); - header("Location: ".$url); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; - } -} - -if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticket->delete) { - if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - if ($object->delete($user) > 0) { - setEventMessages('
'.$langs->trans('TicketDeletedSuccess').'
', null, 'mesgs'); - Header("Location: ".DOL_URL_ROOT."/ticket/list.php"); + header("Location: card.php?track_id=" . $object->track_id . "&action=view"); exit; } else { - $langs->load("errors"); - $mesg = '
'.$langs->trans($object->error).'
'; + setEventMessages($object->error, $object->errors, 'errors'); + } + $action = 'view'; + } + + // Assign to someone + if ($action == "assign_user" && GETPOST('btn_assign_user', 'alpha') && $user->rights->ticket->write) { + $object->fetch('', '', GETPOST("track_id", 'alpha')); + $useroriginassign = $object->fk_user_assign; + $usertoassign = GETPOST('fk_user_assign', 'int'); + + /*if (! ($usertoassign > 0)) { + $error++; + array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("AssignedTo"))); + $action = 'view'; + }*/ + + if (!$error) { + $ret = $object->assignUser($user, $usertoassign); + if ($ret < 0) $error++; + } + + if (!$error) // Update list of contacts + { + // Si déjà un user assigné on le supprime des contacts + if ($useroriginassign > 0) { + $internal_contacts = $object->listeContact(-1, 'internal'); + + foreach ($internal_contacts as $key => $contact) { + if ($contact['code'] == "SUPPORTTEC" && $contact['id'] == $useroriginassign) { + } + { + //print "user à effacer : ".$useroriginassign; + $object->delete_contact($contact['rowid']); + } + } + } + + if ($usertoassign > 0) $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0); + } + + if (!$error) { + // Log action in ticket logs table + $object->fetch_user($usertoassign); + $log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs)); + + setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs'); + + header("Location: card.php?track_id=" . $object->track_id . "&action=view"); + exit; + } else { + array_push($object->errors, $object->error); + } + $action = 'view'; + } + + if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $user->rights->ticket->read) { + $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0)); + + if ($ret > 0) { + if (!empty($backtopage)) { + $url = $backtopage; + } else { + $url = 'card.php?action=view&track_id=' . $object->track_id; + } + + header("Location: " . $url); + exit; + } else { + setEventMessages($object->error, null, 'errors'); + $action = 'presend'; + } + } + + if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) { + $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); + + if ($object->close($user)) { + setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); + + $url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); + header("Location: " . $url); + } else { + $action = ''; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + if ($action == "confirm_public_close" && GETPOST('confirm', 'alpha') == 'yes') { + $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); + if ($_SESSION['email_customer'] == $object->origin_email || $_SESSION['email_customer'] == $object->thirdparty->email) { + $object->close($user); + + // Log action in ticket logs table + $log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']); + + setEventMessages('
' . $langs->trans('TicketMarkedAsClosed') . '
', null, 'mesgs'); + + $url = 'card.php?action=view_ticket&track_id=' . GETPOST('track_id', 'alpha'); + header("Location: " . $url); + } else { + setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } -} -// Set parent company -if ($action == 'set_thirdparty' && $user->rights->societe->creer) { - if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $result = $object->setCustomer(GETPOST('editcustomer', 'int')); - $url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha'); - header("Location: ".$url); - exit(); - } -} - -if ($action == 'set_progression' && $user->rights->ticket->write) { - if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $result = $object->setProgression(GETPOST('progress', 'alpha')); - - $url = 'card.php?action=view&track_id='.$object->track_id; - header("Location: ".$url); - exit(); - } -} - -if ($action == 'setsubject') { - if ($object->fetch(GETPOST('id', 'int'))) { - if ($action == 'setsubject') { - $object->subject = trim(GETPOST('subject', 'alpha')); - } - - if ($action == 'setsubject' && empty($object->subject)) { - $mesg .= ($mesg ? '
' : '').$langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")); - } - - if (!$mesg) { - if ($object->update($user) >= 0) { - header("Location: ".$_SERVER['PHP_SELF']."?track_id=".$object->track_id); + if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticket->delete) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + if ($object->delete($user) > 0) { + setEventMessages('
' . $langs->trans('TicketDeletedSuccess') . '
', null, 'mesgs'); + Header("Location: " . DOL_URL_ROOT . "/ticket/list.php"); exit; + } else { + $langs->load("errors"); + $mesg = '
' . $langs->trans($object->error) . '
'; + $action = ''; } - $mesg = $object->error; } } -} -if ($action == 'confirm_reopen' && $user->rights->ticket->manage && !GETPOST('cancel')) { - if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - // prevent browser refresh from reopening ticket several times - if ($object->fk_statut == Ticket::STATUS_CLOSED) { - $res = $object->setStatut(Ticket::STATUS_ASSIGNED); + // Set parent company + if ($action == 'set_thirdparty' && $user->rights->societe->creer) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + $result = $object->setCustomer(GETPOST('editcustomer', 'int')); + $url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); + header("Location: " . $url); + exit(); + } + } + + if ($action == 'set_progression' && $user->rights->ticket->write) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + $result = $object->setProgression(GETPOST('progress', 'alpha')); + + $url = 'card.php?action=view&track_id=' . $object->track_id; + header("Location: " . $url); + exit(); + } + } + + if ($action == 'setsubject') { + if ($object->fetch(GETPOST('id', 'int'))) { + if ($action == 'setsubject') { + $object->subject = trim(GETPOST('subject', 'alpha')); + } + + if ($action == 'setsubject' && empty($object->subject)) { + $mesg .= ($mesg ? '
' : '') . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")); + } + + if (!$mesg) { + if ($object->update($user) >= 0) { + header("Location: " . $_SERVER['PHP_SELF'] . "?track_id=" . $object->track_id); + exit; + } + $mesg = $object->error; + } + } + } + + if ($action == 'confirm_reopen' && $user->rights->ticket->manage && !GETPOST('cancel')) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + // prevent browser refresh from reopening ticket several times + if ($object->fk_statut == Ticket::STATUS_CLOSED) { + $res = $object->setStatut(Ticket::STATUS_ASSIGNED); + if ($res) { + // Log action in ticket logs table + $log_action = $langs->trans('TicketLogReopen'); + + $url = 'card.php?action=view&track_id=' . $object->track_id; + header("Location: " . $url); + exit(); + } + } + } + } // Categorisation dans projet + elseif ($action == 'classin' && $user->rights->ticket->write) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + $object->setProject(GETPOST('projectid', 'int')); + $url = 'card.php?action=view&track_id=' . $object->track_id; + header("Location: " . $url); + exit(); + } + } // Categorisation dans contrat + elseif ($action == 'setcontract' && $user->rights->ticket->write) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + $object->setContract(GETPOST('contractid', 'int')); + $url = 'card.php?action=view&track_id=' . $object->track_id; + header("Location: " . $url); + exit(); + } + } elseif ($action == "set_message" && $user->rights->ticket->manage) { + // altairis: manage cancel button + if (!GETPOST('cancel')) { + $object->fetch('', '', GETPOST('track_id', 'alpha')); + $oldvalue_message = $object->message; + $fieldtomodify = GETPOST('message_initial'); + + $object->message = $fieldtomodify; + $ret = $object->update($user); + if ($ret > 0) { + $log_action = $langs->trans('TicketInitialMessageModified') . " \n"; + // include the Diff class + dol_include_once('/ticket/class/utils_diff.class.php'); + // output the result of comparing two files as plain text + $log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message))); + + setEventMessages($langs->trans('TicketMessageSuccesfullyUpdated'), null, 'mesgs'); + } + } + + $action = 'view'; + } // Reopen ticket + elseif ($action == 'confirm_set_status' && $user->rights->ticket->write && !GETPOST('cancel')) { + if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + $new_status = GETPOST('new_status', 'int'); + $old_status = $object->fk_statut; + $res = $object->setStatut($new_status); if ($res) { // Log action in ticket logs table - $log_action = $langs->trans('TicketLogReopen'); + $log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status])); - $url = 'card.php?action=view&track_id='.$object->track_id; - header("Location: ".$url); + $url = 'card.php?action=view&track_id=' . $object->track_id; + header("Location: " . $url); exit(); } } } -} // Categorisation dans projet -elseif ($action == 'classin' && $user->rights->ticket->write) { - if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $object->setProject(GETPOST('projectid', 'int')); - $url = 'card.php?action=view&track_id='.$object->track_id; - header("Location: ".$url); - exit(); - } -} // Categorisation dans contrat -elseif ($action == 'setcontract' && $user->rights->ticket->write) { - if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { - $object->setContract(GETPOST('contractid', 'int')); - $url = 'card.php?action=view&track_id='.$object->track_id; - header("Location: ".$url); - exit(); - } -} elseif ($action == "set_message" && $user->rights->ticket->manage) { - // altairis: manage cancel button - if (!GETPOST('cancel')) { - $object->fetch('', '', GETPOST('track_id', 'alpha')); - $oldvalue_message = $object->message; - $fieldtomodify = GETPOST('message_initial'); - $object->message = $fieldtomodify; + // Action to update one extrafield + if ($action == "update_extras" && !empty($permissiontoadd)) { + $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); + $attributekey = GETPOST('attribute', 'alpha'); + $attributekeylong = 'options_' . $attributekey; + $object->array_options['options_' . $attributekey] = GETPOST($attributekeylong, ' alpha'); + + $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); + if ($result > 0) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $action = 'view'; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'edit_extras'; + } + } + + if ($action == "change_property" && GETPOST('btn_update_ticket_prop', 'alpha') && $user->rights->ticket->write) { + $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); + + $object->type_code = GETPOST('update_value_type', 'aZ09'); + $object->severity_code = GETPOST('update_value_severity', 'aZ09'); + $object->category_code = GETPOST('update_value_category', 'aZ09'); + $ret = $object->update($user); if ($ret > 0) { - $log_action = $langs->trans('TicketInitialMessageModified')." \n"; - // include the Diff class - dol_include_once('/ticket/class/utils_diff.class.php'); - // output the result of comparing two files as plain text - $log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message))); + $log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label); - setEventMessages($langs->trans('TicketMessageSuccesfullyUpdated'), null, 'mesgs'); + setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); } - } - - $action = 'view'; -} // Reopen ticket -elseif ($action == 'confirm_set_status' && $user->rights->ticket->write && !GETPOST('cancel')) { - if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { - $new_status = GETPOST('new_status', 'int'); - $old_status = $object->fk_statut; - $res = $object->setStatut($new_status); - if ($res) { - // Log action in ticket logs table - $log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status])); - - $url = 'card.php?action=view&track_id='.$object->track_id; - header("Location: ".$url); - exit(); - } - } -} - -// Action to update one extrafield -if ($action == "update_extras" && !empty($permissiontoadd)) -{ - $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); - $attributekey = GETPOST('attribute', 'alpha'); - $attributekeylong = 'options_'.$attributekey; - $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, ' alpha'); - - $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); - if ($result > 0) - { - setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = 'view'; } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - $action = 'edit_extras'; - } + + + $permissiondellink = $user->rights->ticket->write; + include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once + + // Actions to build doc + $upload_dir = $conf->ticket->dir_output; + $permissiontoadd = $user->rights->ticket->write; + include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; + + // Actions to send emails + $triggersendname = 'TICKET_SENTBYMAIL'; + $paramname = 'id'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add + $trackid = 'tic' . $object->id; + include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; + + // Set $action to correct value for the case we used presend action to add a message + if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage'; } -if ($action == "change_property" && GETPOST('btn_update_ticket_prop', 'alpha') && $user->rights->ticket->write) -{ - $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); - - $object->type_code = GETPOST('update_value_type', 'aZ09'); - $object->severity_code = GETPOST('update_value_severity', 'aZ09'); - $object->category_code = GETPOST('update_value_category', 'aZ09'); - - $ret = $object->update($user); - if ($ret > 0) { - $log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label); - - setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs'); - } - $action = 'view'; -} - - -$permissiondellink = $user->rights->ticket->write; -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once - -// Actions to build doc -$upload_dir = $conf->ticket->dir_output; -$permissiontoadd = $user->rights->ticket->write; -include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - -// Actions to send emails -$triggersendname = 'TICKET_SENTBYMAIL'; -$paramname = 'id'; -$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add -$trackid = 'tic'.$object->id; -include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - -// Set $action to correct value for the case we used presend action to add a message -if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage'; - - /* * View */ @@ -1213,30 +1217,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Set $action to correct value for the case we used presend action to add a message if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage'; - if ($action != 'presend' && $action != 'presend_addmessage') - { - print '
'; - print ''; // ancre - - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('ticket')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - - // Show direct link to public interface - print '
'."\n"; - print showDirectPublicLink($object).'
'; - - print '
'; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'ticket', $socid, 1); - - print '
'; - } - else - { + // add a message + if ($action == 'presend' || $action == 'presend_addmessage') { $action = 'add_message'; // action to use to post the message $modelmail = 'ticket_send'; @@ -1310,6 +1292,63 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd $formticket->showMessageForm('100%'); print '
'; } + + // Show messages on card + if (empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) { + $param = '&id='.$object->id; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; + if ($actioncode) $param .= '&actioncode='.urlencode($actioncode); + if ($search_agenda_label) $param .= '&search_agenda_label='.urlencode($search_agenda_label); + + $morehtmlright = ''; + + $messagingUrl = DOL_URL_ROOT . '/ticket/agenda.php?track_id=' . $object->track_id; + $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fal fa-list-alt imgforviewmode', $messagingUrl, '', 1); + + // Show link to add a message (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; + $url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init'; + $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fal fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); + + // Show link to add event (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message";; + $url = dol_buildpath('/comm/action/card.php', 1) . '?action=create&datep=' . date('YmdHi') . '&origin=ticket&originid=' . $object->id . '&projectid=' . $object->fk_project . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?track_id=' . $object->track_id); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fal fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); + + print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + show_ticket_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + } + + if ($action != 'presend' && $action != 'presend_addmessage') { + print '
'; + print ''; // ancre + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('ticket')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + // Show direct link to public interface + print '
'."\n"; + print showDirectPublicLink($object).'
'; + print '
'; + + if (!empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) { + print '
'; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'ticket', $socid, 1); + + print '
'; + } + print '
'; + } } } From 7e8cd565f482fcc7e58fa64f67fe4107c63b21cc Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Thu, 7 May 2020 14:35:04 +0200 Subject: [PATCH 078/490] NEW not show linked table on add message action --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 3d37c46eb90..7d5ab5fe228 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1324,7 +1324,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd show_ticket_messaging($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); } - if ($action != 'presend' && $action != 'presend_addmessage') { + if ($action != 'presend' && $action != 'presend_addmessage' && $action != 'add_message') { print '
'; print ''; // ancre From dd1d29f983c4625b4866fb1c61a80f1907cf5f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 May 2020 15:37:32 +0200 Subject: [PATCH 079/490] add some substitutions for date datetime --- htdocs/core/lib/functions.lib.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1a4ab00b7d6..c3da7d0ade4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6358,6 +6358,17 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { $substitutionarray['__EXTRAFIELD_'.strtoupper($key).'__'] = $object->array_options['options_'.$key]; + if ($extrafields->attribute_type[$key] == 'date') { + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = dol_print_date($object->array_options['options_' . $key], 'day'); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_LOCALE__'] = dol_print_date($object->array_options['options_' . $key], 'day', 'tzserver', $outputlangs); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_RFC__'] = dol_print_date($object->array_options['options_' . $key],'dayrfc'); + } elseif ($extrafields->attribute_type[$key] == 'datetime') { + $datetime = $object->array_options['options_'.$key]; + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = ($datetime!="0000-00-00 00:00:00" ? dol_print_date($datetime,'dayhour') : ''); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_LOCALE__'] = ($datetime!="0000-00-00 00:00:00" ? dol_print_date($datetime, 'dayhour', 'tzserver', $outputlangs) : ''); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_DAY_LOCALE__'] = ($datetime != "0000-00-00 00:00:00" ? dol_print_date($datetime, 'day', 'tzserver', $outputlangs) : ''); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_RFC__'] = ($datetime != "0000-00-00 00:00:00" ? dol_print_date($datetime, 'dayhourrfc') : ''); + } } } } From c28e6630bb9bf6fe4a3020e01f8fbb640ce2347f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 May 2020 15:41:21 +0200 Subject: [PATCH 080/490] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c3da7d0ade4..43cee63c1ed 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6361,11 +6361,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($extrafields->attribute_type[$key] == 'date') { $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = dol_print_date($object->array_options['options_' . $key], 'day'); $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_LOCALE__'] = dol_print_date($object->array_options['options_' . $key], 'day', 'tzserver', $outputlangs); - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_RFC__'] = dol_print_date($object->array_options['options_' . $key],'dayrfc'); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_RFC__'] = dol_print_date($object->array_options['options_' . $key], 'dayrfc'); } elseif ($extrafields->attribute_type[$key] == 'datetime') { $datetime = $object->array_options['options_'.$key]; - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = ($datetime!="0000-00-00 00:00:00" ? dol_print_date($datetime,'dayhour') : ''); - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_LOCALE__'] = ($datetime!="0000-00-00 00:00:00" ? dol_print_date($datetime, 'dayhour', 'tzserver', $outputlangs) : ''); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = ($datetime != "0000-00-00 00:00:00" ? dol_print_date($datetime, 'dayhour') : ''); + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_LOCALE__'] = ($datetime != "0000-00-00 00:00:00" ? dol_print_date($datetime, 'dayhour', 'tzserver', $outputlangs) : ''); $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_DAY_LOCALE__'] = ($datetime != "0000-00-00 00:00:00" ? dol_print_date($datetime, 'day', 'tzserver', $outputlangs) : ''); $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '_RFC__'] = ($datetime != "0000-00-00 00:00:00" ? dol_print_date($datetime, 'dayhourrfc') : ''); } From 0cd05887ce95de5496924a941a92f31155a0ed2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 17:21:27 +0200 Subject: [PATCH 081/490] FIX count of open day when date and start are not open should be 0 --- htdocs/core/lib/date.lib.php | 10 +++++++++- htdocs/holiday/card.php | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 123e3297f11..56dfee3988c 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -896,15 +896,23 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, if ($timestampStart < $timestampEnd) { $numdays = num_between_day($timestampStart, $timestampEnd, $lastday); + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday); $nbOpenDay = $numdays - $numholidays; - $nbOpenDay.= " " . $langs->trans("Days"); + $nbOpenDay.= ' '.$langs->trans("Days"); if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); } elseif ($timestampStart == $timestampEnd) { + $numholidays = 0; + if ($lastday) { + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday); + if ($numholidays == 1) return 0; + } + $nbOpenDay=$lastday; + if ($inhour == 1) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); } diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 9cc287cd28a..6dd218255e5 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1291,7 +1291,9 @@ else if ($includesunday) $htmlhelp.='
'.$langs->trans("DayIsANonWorkingDay", $langs->trans("Sunday")); print $form->textwithpicto($langs->trans('NbUseDaysCP'), $htmlhelp); print ''; - print ''.num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday).''; + print ''; + print num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); + print ''; print ''; if ($object->statut == Holiday::STATUS_REFUSED) From db8596743c7c081674420aa3a53edc68c75dd851 Mon Sep 17 00:00:00 2001 From: Vaadasch Date: Thu, 7 May 2020 22:09:55 +0200 Subject: [PATCH 082/490] Update facture.class.php Auto-update dates (if not empty) of services when cloning facture. Actual code is only for month by month. If empty (start or end) => do nothing If set, update for next month if there is only 1d between what had been set and the start (or end) of the month. If there is more than one day from start or end of the month => do nothing, because we're not sure the service is by month Worst case scenario : the facture is cloned, the service is updated with new unwanted dates User need to manually updates date : he would have done that either way --- htdocs/compta/facture/class/facture.class.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 90ed560b3cf..395de47d443 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1177,6 +1177,30 @@ class Facture extends CommonInvoice { unset($object->lines[$i]); unset($object->products[$i]); // Tant que products encore utilise + } + // Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month) + // If it's a service with start and end dates + if ($line->product_type == 1 && !empty($line->date_start) && !empty($line->date_end) ) { + // Get the dates + $start = dol_getdate($line->date_start); + $end = dol_getdate($line->date_end); + + // Get the first and last day of the month + $first = dol_get_first_day($start['year'], $start['mon']); + $last = dol_get_first_day($end['year'], $end['mon']); + + // Get diff betweend start/end of month and previously filled + $diffFirst = num_between_day($first, dol_mktime($start['hours'], $start['minutes'], $start['seconds'], $start['mon'], $start['mday'], $start['year'], 'user')); + $diffLast = num_between_day(dol_mktime($end['hours'], $end['minutes'], $end['seconds'], $end['mon'], $end['mday'], $end['year'], 'user'), $last); + + // If there is <= 1d (or 2?) of start/or/end of month + if ($diffFirst <= 2 && $diffLast <= 2) { + $nextMonth = dol_get_next_month($end['mon'], $end['year']); + $newFirst = dol_get_first_day($nextMonth['year'],$nextMonth['month']); + $newLast = dol_get_last_day($nextMonth['year'],$nextMonth['month']); + $object->lines[$i]->date_start = $newFirst; + $object->lines[$i]->date_end = $newLast; + } } } From 7514a625fdb17a9226185ddc9a7fda64b84f625e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 7 May 2020 20:11:59 +0000 Subject: [PATCH 083/490] Fixing style errors. --- htdocs/compta/facture/class/facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 395de47d443..ffa96fe5237 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1184,7 +1184,7 @@ class Facture extends CommonInvoice // Get the dates $start = dol_getdate($line->date_start); $end = dol_getdate($line->date_end); - + // Get the first and last day of the month $first = dol_get_first_day($start['year'], $start['mon']); $last = dol_get_first_day($end['year'], $end['mon']); @@ -1196,8 +1196,8 @@ class Facture extends CommonInvoice // If there is <= 1d (or 2?) of start/or/end of month if ($diffFirst <= 2 && $diffLast <= 2) { $nextMonth = dol_get_next_month($end['mon'], $end['year']); - $newFirst = dol_get_first_day($nextMonth['year'],$nextMonth['month']); - $newLast = dol_get_last_day($nextMonth['year'],$nextMonth['month']); + $newFirst = dol_get_first_day($nextMonth['year'], $nextMonth['month']); + $newLast = dol_get_last_day($nextMonth['year'], $nextMonth['month']); $object->lines[$i]->date_start = $newFirst; $object->lines[$i]->date_end = $newLast; } From 206b16410ebd615c87ed7fbf120804f53c5d980e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 22:52:32 +0200 Subject: [PATCH 084/490] Revert the option to avoid to introduce a feature that is duplicate with already existing view "Events/Agenda". It also keeps a common behaviour between other tools. Maxi debug on messages of tickets --- htdocs/comm/action/class/actioncomm.class.php | 3 +- htdocs/comm/action/list.php | 39 +++++++----- htdocs/contrat/card.php | 5 +- htdocs/core/class/html.formactions.class.php | 63 +++++++++++-------- htdocs/core/lib/functions.lib.php | 6 +- htdocs/core/lib/ticket.lib.php | 2 +- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 +- htdocs/langs/en_US/main.lang | 1 + htdocs/public/ticket/view.php | 2 +- htdocs/societe/card.php | 2 +- htdocs/theme/eldy/timeline.inc.php | 2 +- htdocs/ticket/card.php | 20 ++++-- htdocs/ticket/class/actions_ticket.class.php | 3 +- htdocs/ticket/class/ticket.class.php | 2 +- 14 files changed, 88 insertions(+), 64 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fac4dc45715..7141d875567 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -405,7 +405,6 @@ class ActionComm extends CommonObject $this->userassigned[$tmpid] = array('id'=>$tmpid, 'transparency'=>$this->transparency); } - $userownerid = $this->userownerid; $userdoneid = $this->userdoneid; @@ -484,7 +483,7 @@ class ActionComm extends CommonObject $sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", "; $sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated $sql .= (isset($this->type_id) ? $this->type_id : "null").","; - $sql .= ($code ? ("'".$code."'") : "null").", "; + $sql .= ($code ? ("'".$this->db->escape($code)."'") : "null").", "; $sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", "; $sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", "; $sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", "; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index a4b1a9618fb..ef6e21c39cd 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -242,7 +242,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; $sql = "SELECT"; if ($usergroup > 0) $sql .= " DISTINCT"; $sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,"; -$sql .= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,"; +$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,"; $sql .= ' a.fk_user_author,a.fk_user_action,'; $sql .= " a.fk_contact, a.note, a.percent as percent,"; $sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,"; @@ -385,14 +385,8 @@ if ($resql) print ''; $nav = ''; - //if ($actioncode) $nav.=''; - //if ($resourceid) $nav.=''; if ($filter) $nav .= ''; - //if ($filtert) $nav.=''; - //if ($socid) $nav.=''; if ($showbirthday) $nav .= ''; - //if ($pid) $nav.=''; - //if ($usergroup) $nav.=''; print $nav; dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); @@ -548,6 +542,7 @@ if ($resql) $actionstatic->id = $obj->id; $actionstatic->ref = $obj->id; + $actionstatic->code = $obj->code; $actionstatic->type_code = $obj->type_code; $actionstatic->type_label = $obj->type_label; $actionstatic->type_picto = $obj->type_picto; @@ -583,21 +578,31 @@ if ($resql) if (!empty($arrayfields['c.libelle']['checked'])) { print ''; + $actioncomm = $actionstatic; + // TODO Code common with code into showactions + $imgpicto = ''; if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto); - else { - if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group', '', false, 0, 0, '', '').' '; - elseif ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning', '', false, 0, 0, '', '').' '; - elseif ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', '').' '; - elseif ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email', '', false, 0, 0, '', '').' '; - elseif ($actionstatic->type_code == 'AC_INT') print img_picto('', 'object_intervention', '', false, 0, 0, '', '').' '; - elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) print img_picto('', 'object_other', '', false, 0, 0, '', '').' '; - } + if ($actioncomm->type_picto) { + $imgpicto = img_picto('', $actioncomm->type_picto); + } + else { + if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' '; + elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_other', '', false, 0, 0, '', 'paddingright').' '; + } } + print $imgpicto; + $labeltype = $obj->type_code; if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH'; - if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype]; + if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') { + $labeltype = $langs->trans("Message"); + } elseif (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype]; print dol_trunc($labeltype, 28); print ''; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 52144d44d34..25857767e80 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2227,13 +2227,12 @@ else $MAXEVENT = 10; - $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlright); - + $somethingshown = $formactions->showactions($object, 'contract', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter); print '
'; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index b06877c8c3b..352fcebb06b 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -165,13 +165,12 @@ class FormActions * @param string $morecss More css on table * @param int $max Max number of record * @param string $moreparambacktopage More param for the backtopage - * @param string $morehtmlright More html text on right of title line + * @param string $morehtmlcenter More html text on center of title line * @return int <0 if KO, >=0 if OK */ - public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlright = '') + public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '') { global $langs, $conf, $user; - global $bc; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -208,8 +207,9 @@ class FormActions $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage)); } + print ''."\n"; - print load_fiche_titre($title, $newcardbutton, '', 0, 0, '', $morehtmlright); + print load_fiche_titre($title, $newcardbutton, '', 0, 0, '', $morehtmlcenter); $page = 0; $param = ''; @@ -230,29 +230,29 @@ class FormActions $cacheusers = array(); $cursorevent = 0; - foreach ($listofactions as $action) + foreach ($listofactions as $actioncomm) { if ($max && $cursorevent >= $max) break; - $ref = $action->getNomUrl(1, -1); - $label = $action->getNomUrl(0, 38); + $ref = $actioncomm->getNomUrl(1, -1); + $label = $actioncomm->getNomUrl(0, 38); print ''; // Ref print ''.$ref.''; // Onwer print ''; - if (!empty($action->userownerid)) + if (!empty($actioncomm->userownerid)) { - if (is_object($cacheusers[$action->userownerid])) + if (is_object($cacheusers[$actioncomm->userownerid])) { - $tmpuser = $cacheusers[$action->userownerid]; + $tmpuser = $cacheusers[$actioncomm->userownerid]; } else { $tmpuser = new User($this->db); - $tmpuser->fetch($action->userownerid); - $cacheusers[$action->userownerid] = $tmpuser; + $tmpuser->fetch($actioncomm->userownerid); + $cacheusers[$actioncomm->userownerid] = $tmpuser; } if ($tmpuser->id > 0) { @@ -260,41 +260,50 @@ class FormActions } } print ''; + // Type print ''; + // TODO Code common with code into comm/action/list.php $imgpicto = ''; if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - if ($action->type_picto) $imgpicto = img_picto('', $action->type_picto); + if ($actioncomm->type_picto) { + $imgpicto = img_picto('', $actioncomm->type_picto); + } else { - if ($action->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' '; - elseif ($action->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' '; - elseif ($action->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' '; - elseif ($action->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' '; - elseif ($action->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' '; - elseif (!preg_match('/_AUTO/', $action->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' '; + if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' '; + elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' '; } } print $imgpicto; - print $action->type_short ? $action->type_short : $action->type; + if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') { + print $langs->trans("Message"); + } else { + print $actioncomm->type_short ? $actioncomm->type_short : $actioncomm->type; + } print ''; // Label print ''.$label.''; // Date - print ''.dol_print_date($action->datep, 'dayhour', 'tzuserrel'); - if ($action->datef) + print ''.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel'); + if ($actioncomm->datef) { - $tmpa = dol_getdate($action->datep); - $tmpb = dol_getdate($action->datef); + $tmpa = dol_getdate($actioncomm->datep); + $tmpb = dol_getdate($actioncomm->datef); if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { - if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef, 'hour', 'tzuserrel'); + if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel'); } - else print '-'.dol_print_date($action->datef, 'dayhour', 'tzuserrel'); + else print '-'.dol_print_date($actioncomm->datef, 'dayhour', 'tzuserrel'); } print ''; print ''; - print $action->getLibStatut(3); + print $actioncomm->getLibStatut(3); print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 43cee63c1ed..bcf47a58eef 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3155,7 +3155,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'intervention', 'label', 'language', 'list', 'listlight', 'lot', 'map-marker-alt', 'money-bill-alt', 'mrp', 'note', 'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', - 'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', + 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', @@ -3190,7 +3190,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billd'=>'file-medical', 'bom'=>'cubes', - 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', + 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', 'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', @@ -3263,7 +3263,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotomorcess = array( 'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'accountancy'=>'bg-infobox-bank_account', 'bank_account'=>'bg-infobox-bank_account', 'bill'=>'bg-infobox-commande', 'billa'=>'bg-infobox-commande', 'billd'=>'bg-infobox-commande', - 'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', + 'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'conversation'=>'bg-infobox-contrat', 'donation'=>'bg-infobox-commande', 'dollyrevert'=>'flip', 'ecm'=>'bg-infobox-action', 'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat', 'multicurrency'=>'bg-infobox-bank_account', diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index e12531b3846..0a50eb7407f 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -709,7 +709,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $out .= $histo[$key]['id']; $out .= ' '; } else { - $out .= $actionstatic->getNomUrl(1, -1).' '; + $out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' '; } //if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 0730511ad99..38d0acb97fa 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -275,4 +275,4 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); - +ALTER TABLE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fb0808e0953..8c992bf91ca 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -426,6 +426,7 @@ Modules=Modules/Applications Option=Option List=List FullList=Full list +FullConversation=Full conversation Statistics=Statistics OtherStatistics=Other statistics Status=Status diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 1938c68de3e..af656e69ab0 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -370,7 +370,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a } // Message list - print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'messages@ticket'); + print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation'); $object->viewTicketMessages(false, true, $object->dao); } else diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b5400db04b3..195d4df88bb 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2826,7 +2826,7 @@ else $MAXEVENT = 10; - $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); + $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/theme/eldy/timeline.inc.php b/htdocs/theme/eldy/timeline.inc.php index 21e683e42f0..eb13821c221 100644 --- a/htdocs/theme/eldy/timeline.inc.php +++ b/htdocs/theme/eldy/timeline.inc.php @@ -154,7 +154,7 @@ a.timeline-btn:hover border-radius: 50%; text-align: center; left: 18px; - top: 0; + top: 5px; } .timeline > .time-label > span { font-weight: 600; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 7d5ab5fe228..6e400b3eeaa 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -143,6 +143,7 @@ if (empty($reshook)) { $action = 'view'; } + // Action to add an action (not a message) if (GETPOST('add', 'alpha') && $user->rights->ticket->write) { $error = 0; @@ -381,6 +382,7 @@ if (empty($reshook)) { $action = 'view'; } + // Action to add an action (not a message) if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $user->rights->ticket->read) { $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0)); @@ -1218,7 +1220,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage'; // add a message - if ($action == 'presend' || $action == 'presend_addmessage') { + if ($action == 'presend' || $action == 'presend_addmessage') + { $action = 'add_message'; // action to use to post the message $modelmail = 'ticket_send'; @@ -1293,8 +1296,8 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd print ''; } - // Show messages on card - if (empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) { + // Show messages on card (Note: this is a duplicate of the view Events/Agenda but on the main tab) + if (! empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) { $param = '&id='.$object->id; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; @@ -1337,16 +1340,23 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd print showDirectPublicLink($object).'
'; print ''; - if (!empty($conf->global->TICKET_HIDE_MESSAGES_ON_CARD)) { + if (empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) { print '
'; + $MAXEVENT = 10; + + $morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/ticket/messaging.php?id='.$object->id); + $morehtmlcenter .= ' '; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id); + // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'ticket', $socid, 1); + $somethingshown = $formactions->showactions($object, 'ticket', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter); print '
'; } + print ''; } } diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 9a67c3dd574..9931b12ffa2 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -272,6 +272,7 @@ class ActionsTicket print $langs->trans('User'); print ''; } + print ''; foreach ($this->dao->cache_msgs_ticket as $id => $arraymsgs) { if (!$arraymsgs['private'] @@ -280,7 +281,7 @@ class ActionsTicket //print ''; print ''; print ''; - print dol_print_date($arraymsgs['datec'], 'dayhour'); + print img_picto('', 'actioncomm', 'class="paddingright"').dol_print_date($arraymsgs['datec'], 'dayhour'); print ''; if ($show_user) { print ''; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index f94599153f0..4db98cfe7ad 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1559,7 +1559,7 @@ class Ticket extends CommonObject // Insert entry into agenda with code 'TICKET_MSG' include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $actioncomm = new ActionComm($this->db); - $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->type_code = 'AC_OTH'; $actioncomm->code = 'TICKET_MSG'; if ($this->private) { $actioncomm->code = 'TICKET_MSG_PRIVATE'; From 7e7a10f8d2140ff2ca0eae2a3818bb2da35435b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 May 2020 22:55:21 +0200 Subject: [PATCH 085/490] clean --- htdocs/core/class/html.formmail.class.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 45c40a8bc72..6007dd1dbaa 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -669,15 +669,8 @@ class FormMail extends Form } else { - // The free input of email - // if (!empty($this->withtofree)) - // { - // $out .= 'withto) : "")).'" />'; - // } - // The select combo if (!empty($this->withto) && is_array($this->withto)) { - //if (!empty($this->withtofree)) $out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withto; foreach ($tmparray as $key => $val) @@ -744,10 +737,8 @@ class FormMail extends Form } else { - //$out .= 'withtocc) && !is_numeric($this->withtocc)) ? $this->withtocc : '')).'" />'; if (!empty($this->withtocc) && is_array($this->withtocc)) { - //$out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtocc; foreach ($tmparray as $key => $val) From b88a84323b34d47c81b1929b3f1d6fb8354434b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 May 2020 22:59:34 +0200 Subject: [PATCH 086/490] clean --- htdocs/core/actions_sendmails.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f647bd5418e..d6c4c0a6313 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -265,7 +265,6 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST } } $sendtocc = implode(',', $tmparray); - //var_dump($sendto, $sendtocc);exit; if (dol_strlen($sendto)) { From dca3f3b31f2075c4a65056a0d5ca0dfe5941615b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 22:59:40 +0200 Subject: [PATCH 087/490] Look adn feel v12 --- htdocs/ticket/class/actions_ticket.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 9931b12ffa2..147f6228005 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -380,8 +380,7 @@ class ActionsTicket global $langs; print '
'; - print '
'; - print '
'; + print '
'; // Exclude status which requires specific method $exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED); // Exclude actual status @@ -392,7 +391,7 @@ class ActionsTicket foreach ($object->statuts_short as $status => $status_label) { if (!in_array($status, $exclude_status)) { - print '
'; + print '
'; if ($status == 1) { @@ -403,13 +402,13 @@ class ActionsTicket $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status; } - print ''; + print ''; print img_picto($langs->trans($object->statuts_short[$status]), 'statut'.$status.'.png@ticket').' '.$langs->trans($object->statuts_short[$status]); print ''; print '
'; } } - print '

'; + print '

'; } /** From f23451e1c986143235b7aea6750293b878f0e1f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 23:04:52 +0200 Subject: [PATCH 088/490] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ffa96fe5237..fd6a6d32642 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1180,7 +1180,7 @@ class Facture extends CommonInvoice } // Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month) // If it's a service with start and end dates - if ($line->product_type == 1 && !empty($line->date_start) && !empty($line->date_end) ) { + if (!empty($line->date_start) && !empty($line->date_end) ) { // Get the dates $start = dol_getdate($line->date_start); $end = dol_getdate($line->date_end); From 8f9ee3250dba03aea88cfd5188253383c866e2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 May 2020 23:28:32 +0200 Subject: [PATCH 089/490] clean --- htdocs/core/class/html.formmail.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 6007dd1dbaa..8881b93349f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -669,6 +669,7 @@ class FormMail extends Form } else { + // The select combo if (!empty($this->withto) && is_array($this->withto)) { // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time From 830a117aa7ae799cd93021b68408aa177b733cc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 23:39:03 +0200 Subject: [PATCH 090/490] Suggest fix for #13824 --- htdocs/bom/class/bom.class.php | 5 ++++- htdocs/takepos/admin/bar.php | 2 +- htdocs/takepos/admin/setup.php | 2 +- htdocs/takepos/genimg/qr.php | 2 +- htdocs/takepos/phone.php | 8 ++++---- htdocs/takepos/public/auto_order.php | 6 +++++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index c2c18dae6e5..3e522b3c11f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1004,6 +1004,7 @@ class BOM extends CommonObject /** * BOM costs calculation based on cost_price or pmp of each BOM line + * * @return void */ public function calculateCosts() @@ -1022,7 +1023,9 @@ class BOM extends CommonObject } $this->total_cost = price2num($this->total_cost, 'MT'); - $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU'); + if ($this->qty) { + $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU'); + } } } diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 7b6e1d9a98c..5c255dc89c7 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -157,7 +157,7 @@ if ($conf->global->TAKEPOS_AUTO_ORDER) print ''; print "".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid']).""; print ''; - print ""; + print ""; print ''; } diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 59fe85e66ef..85406c46faa 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -274,7 +274,7 @@ if (!empty($conf->service->enabled)) print ''; print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc")); print ''; -print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); +print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID'); print "\n"; diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index f0c3bea82b9..c73e874a465 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -29,5 +29,5 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; $key = GETPOST('key'); -$module = new modtcpdfbarcode($db); +$module = new modTcpdfbarcode($db); $result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 80d67513bf2..eac1f40bfd1 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -31,14 +31,14 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -require '../main.inc.php'; // Load $user and permissions +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; -if ($_SESSION["publicterminal"]){ - // Decode place if is a order from customer phone +if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + // Decode place if it is an order from customer phone $key = GETPOST('key'); $place=dol_decode($key); } @@ -53,7 +53,7 @@ if ($setterminal > 0) $langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter")); -if ($_SESSION["publicterminal"]) { +if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers } elseif (empty($user->rights->takepos->run)) { diff --git a/htdocs/takepos/public/auto_order.php b/htdocs/takepos/public/auto_order.php index c97edfdc0e7..5b463959b69 100644 --- a/htdocs/takepos/public/auto_order.php +++ b/htdocs/takepos/public/auto_order.php @@ -24,6 +24,10 @@ if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +require '../../main.inc.php'; + $_SESSION["basiclayout"] = 1; $_SESSION["publicterminal"] = true; // Is a public customer -require '../phone.php'; + +define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); +include '../phone.php'; From 790bef98e5e271cc3750d2f9ff5749b590262ebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 May 2020 23:45:33 +0200 Subject: [PATCH 091/490] Look and feel v12 --- htdocs/ticket/class/actions_ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 147f6228005..0fb5835cb4c 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -281,7 +281,7 @@ class ActionsTicket //print ''; print ''; print ''; - print img_picto('', 'actioncomm', 'class="paddingright"').dol_print_date($arraymsgs['datec'], 'dayhour'); + print img_picto('', 'object_action', 'class="paddingright"').dol_print_date($arraymsgs['datec'], 'dayhour'); print ''; if ($show_user) { print ''; From d9a0edcf2b83aa9e9f6e35fefa8e740f1c36ab14 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 8 May 2020 00:01:56 +0200 Subject: [PATCH 092/490] FIX missing file manifest.json.php --- htdocs/theme/md/manifest.json.php | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 htdocs/theme/md/manifest.json.php diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php new file mode 100644 index 00000000000..f8d059752a6 --- /dev/null +++ b/htdocs/theme/md/manifest.json.php @@ -0,0 +1,57 @@ + + * Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2007-2017 Regis Houssin + * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FI8TNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/theme/md/manifest.json.php + * \brief File for The Web App + */ + +if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); +if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (! defined('NOLOGIN')) define('NOLOGIN', '1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +require_once __DIR__.'/../../main.inc.php'; + +$appli=constant('DOL_APPLICATION_TITLE'); +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + +?> +{ + "name": "", + "icons": [ + { + "src": "", + "sizes": "256x256", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file From 1a9afe6b203b1224ae0e4a641dcefe3c2073eb0a Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 8 May 2020 01:40:25 +0200 Subject: [PATCH 093/490] Fix missing hook params for printFieldListValue --- htdocs/accountancy/bookkeeping/list.php | 2 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/bank/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/contrat/services_list.php | 2 +- htdocs/expedition/list.php | 2 +- htdocs/expensereport/list.php | 2 +- htdocs/fichinter/list.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/projet/list.php | 2 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/reception/list.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/user/list.php | 2 +- htdocs/zapier/hook_list.php | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d8fe9975da5..129fedf3867 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -966,7 +966,7 @@ while ($i < min($num, $limit)) } // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c9b7ee42fcf..838e7cd9a5c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -872,7 +872,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index a582584ae7f..fa47d01cd41 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -524,7 +524,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 53d9fd8d1f1..9c76c176414 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -479,7 +479,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index fb8c4066a10..ae307bf1a42 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -459,7 +459,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 95a3e6dbe09..410d31fb07e 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -718,7 +718,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index dcc9c7a54c7..eaeea9e3d43 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1065,7 +1065,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e2b6aa06136..8a023cf7e80 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1075,7 +1075,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index e0d7f7d5c29..ac2caaf94eb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -529,7 +529,7 @@ foreach ($accounts as $key=>$type) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 6c59276d600..c13528224c4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -496,7 +496,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f5ab943d831..c3bfe93bf30 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1313,7 +1313,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9903e37cd5e..d51399d21a9 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -936,7 +936,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index c32e45c1b42..857f9609d36 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -744,7 +744,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 29501ddee88..85579d65980 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -687,7 +687,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index d5cda3e2ebb..c3db317c9de 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -591,7 +591,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 5604ee77dc3..7f5e86d9c98 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -761,7 +761,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 03000bdb44d..fd45d2daecb 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -562,7 +562,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index b895bf63513..ddb2ce853b1 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1058,7 +1058,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 2277563aaa0..18df214f4c6 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -744,7 +744,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index ce3f8f1cd81..cc12bc73349 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1148,7 +1148,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index e4ad265c793..057735c49cc 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -571,7 +571,7 @@ if ($num) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 527afee2607..154ede71956 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -476,7 +476,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 650c14c5ee2..f3a8900a148 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -895,7 +895,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 3fd85f4082e..7d995965294 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -836,7 +836,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f9069f7efa7..3a5e3c89ae3 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1332,7 +1332,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) */ // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index fea2662b93f..7566edfc610 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -885,7 +885,7 @@ if ($resql) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index e480d68eca4..4e033e5f35e 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1279,7 +1279,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 5d248ec16fd..d5e89459771 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -481,7 +481,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index a133d781337..91ef70c7b94 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -779,7 +779,7 @@ if ($resql) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 8d76ef5c5eb..08419e5c46d 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -669,7 +669,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/user/list.php b/htdocs/user/list.php index eb14f61e982..1ceec68a622 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -655,7 +655,7 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php index 56a68ad7300..dbd9239e752 100644 --- a/htdocs/zapier/hook_list.php +++ b/htdocs/zapier/hook_list.php @@ -519,7 +519,7 @@ while ($i < min($num, $limit)) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column From 42ee755ea5189842673d8d1f374efef088404bfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 02:52:55 +0200 Subject: [PATCH 094/490] Look and feel v12 --- htdocs/admin/translation.php | 10 +++++----- htdocs/comm/action/list.php | 4 ++-- htdocs/core/lib/agenda.lib.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 520cee44913..c17c2bdcee6 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -365,9 +365,9 @@ if ($mode == 'overwrite') } else { - print ''.img_edit().''; + print ''.img_edit().''; print '   '; - print ''.img_delete().''; + print ''.img_delete().''; } print ''; @@ -531,8 +531,8 @@ if ($mode == 'searchkey') { $obj = $db->fetch_object($result); } - print ''.img_edit().''; - print '  '; + print ''.img_edit().''; + print ' '; print ''.img_delete().''; print '  '; $htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]); @@ -541,7 +541,7 @@ if ($mode == 'searchkey') elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) { //print $key.'-'.$val; - print ''.img_edit_add($langs->trans("Overwrite")).''; + print ''.img_edit_add($langs->trans("Overwrite")).''; } if (!empty($conf->global->MAIN_FEATURES_LEVEL)) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index ef6e21c39cd..e804213cdce 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -625,7 +625,7 @@ if ($resql) $formatToUse = $obj->fulldayevent ? 'day' : 'dayhour'; // Start date if (!empty($arrayfields['a.datep']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->dp), $formatToUse); $late = 0; if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1; @@ -638,7 +638,7 @@ if ($resql) // End date if (!empty($arrayfields['a.datep2']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->dp2), $formatToUse); print ''; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 8dc2e418cc8..474a4f03696 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -27,7 +27,7 @@ /** * Show filter form in agenda view * - * @param Object $form Form object + * @param Form $form Form object * @param int $canedit Can edit filter fields * @param int $status Status * @param int $year Year @@ -123,7 +123,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $langs->trans("ThirdParty").'   '; print ''; print img_picto('', 'company'); - print $form->select_company($socid, 'search_socid', '', 'SelectThirdParty', 0, 0, null, 0); + print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0); print ''; } From a649dcecf767cd63a5b30234916b1c7b6613fac9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 03:01:51 +0200 Subject: [PATCH 095/490] Look and field --- htdocs/takepos/admin/bar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 5c255dc89c7..2508ab56040 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -85,7 +85,7 @@ print ''; print '
'; print ''; print ''; -print ''; +print ''; print "\n"; if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") { From e55d9ed3b89c8f9e477e523e856419f8e8a62765 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 03:02:53 +0200 Subject: [PATCH 096/490] Trans --- htdocs/langs/en_US/cashdesk.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index b22a7b83166..52c2004c1c7 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -95,7 +95,7 @@ PrintMethod=Print method ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. Cannot print from the cloud. ByTerminal=By terminal TakeposNumpadUsePaymentIcon=Use payment icon on numpad -CashDeskRefNumberingModules=Numbering module for cash desk +CashDeskRefNumberingModules=Numbering module for POS sales CashDeskGenericMaskCodes6 =
{TN} tag is used to add the terminal number TakeposGroupSameProduct=Group same products lines StartAParallelSale=Start a new parallel sale From a49635a825360a8cb92acecb92dae14d389693b0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 May 2020 07:45:01 +0200 Subject: [PATCH 097/490] NEW Bookkeeping by account - Add selectfields & hook --- .../accountancy/bookkeeping/listbyaccount.php | 453 ++++++++++++------ 1 file changed, 318 insertions(+), 135 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 78f29e97595..582e54442a5 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -70,6 +70,13 @@ $pagenext = $page + 1; if ($sortorder == "") $sortorder = "ASC"; if ($sortfield == "") $sortfield = "t.doc_date,t.rowid"; +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$object = new BookKeeping($db); +$hookmanager->initHooks(array('bookkeepingbyaccountlist')); + +$formaccounting = new FormAccounting($db); +$form = new Form($db); + if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search_date_startday') && GETPOSTISSET('search_date_startmonth') && GETPOSTISSET('search_date_starthour')) { $sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; @@ -96,87 +103,112 @@ if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search } } +$arrayfields = array( + // 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), + 't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1), + 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), + 't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1), + 't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1), + 't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1), + 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), + 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), + 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), + // 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), + // 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), + // 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), +); + +if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']); + + $object = new BookKeeping($db); /* * Action */ -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers -{ - $search_doc_date = ''; - $search_accountancy_code = ''; - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; - $search_label_account = ''; - $search_doc_ref = ''; - $search_label_operation = ''; - $search_direction = ''; - $search_ledger_code = ''; - $search_date_start = ''; - $search_date_end = ''; - $search_date_startyear = ''; - $search_date_startmonth = ''; - $search_date_startday = ''; - $search_date_endyear = ''; - $search_date_endmonth = ''; - $search_date_endday = ''; - $search_debit = ''; - $search_credit = ''; -} +$parameters = array('socid'=>$socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -// Must be after the remove filter action, before the export. -$param = ''; -$filter = array(); +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; -if (!empty($search_date_start)) { - $filter['t.doc_date>='] = $search_date_start; - $param .= '&search_date_startmonth='.GETPOST('search_date_startmonth', 'int').'&search_date_startday='.GETPOST('search_date_startday', 'int').'&search_date_startyear='.GETPOST('search_date_startyear', 'int'); -} -if (!empty($search_date_end)) { - $filter['t.doc_date<='] = $search_date_end; - $param .= '&search_date_endmonth='.GETPOST('search_date_endmonth', 'int').'&search_date_endday='.GETPOST('search_date_endday', 'int').'&search_date_endyear='.GETPOST('search_date_endyear', 'int'); -} -if (!empty($search_doc_date)) { - $filter['t.doc_date'] = $search_doc_date; - $param .= '&doc_datemonth='.GETPOST('doc_datemonth', 'int').'&doc_dateday='.GETPOST('doc_dateday', 'int').'&doc_dateyear='.GETPOST('doc_dateyear', 'int'); -} -if (!empty($search_accountancy_code_start)) { - $filter['t.numero_compte>='] = $search_accountancy_code_start; - $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); -} -if (!empty($search_accountancy_code_end)) { - $filter['t.numero_compte<='] = $search_accountancy_code_end; - $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); -} -if (!empty($search_label_account)) { - $filter['t.label_compte'] = $search_label_account; - $param .= '&search_label_compte='.urlencode($search_label_account); -} -if (!empty($search_doc_ref)) { - $filter['t.doc_ref'] = $search_doc_ref; - $param .= '&search_doc_ref='.urlencode($search_doc_ref); -} -if (!empty($search_label_operation)) { - $filter['t.label_operation'] = $search_label_operation; - $param .= '&search_label_operation='.urlencode($search_label_operation); -} -if (!empty($search_direction)) { - $filter['t.sens'] = $search_direction; - $param .= '&search_direction='.urlencode($search_direction); -} -if (!empty($search_ledger_code)) { - $filter['t.code_journal'] = $search_ledger_code; - $param .= '&search_ledger_code='.urlencode($search_ledger_code); -} -if (!empty($search_debit)) { - $filter['t.debit'] = $search_debit; - $param .= '&search_debit='.urlencode($search_debit); -} -if (!empty($search_credit)) { - $filter['t.credit'] = $search_credit; - $param .= '&search_credit='.urlencode($search_credit); -} + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers + { + $search_doc_date = ''; + $search_accountancy_code = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_label_account = ''; + $search_doc_ref = ''; + $search_label_operation = ''; + $search_direction = ''; + $search_ledger_code = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_date_startyear = ''; + $search_date_startmonth = ''; + $search_date_startday = ''; + $search_date_endyear = ''; + $search_date_endmonth = ''; + $search_date_endday = ''; + $search_debit = ''; + $search_credit = ''; + } + // Must be after the remove filter action, before the export. + $param = ''; + $filter = array(); + + if (!empty($search_date_start)) { + $filter['t.doc_date>='] = $search_date_start; + $param .= '&search_date_startmonth=' . GETPOST('search_date_startmonth', 'int') . '&search_date_startday=' . GETPOST('search_date_startday', 'int') . '&search_date_startyear=' . GETPOST('search_date_startyear', 'int'); + } + if (!empty($search_date_end)) { + $filter['t.doc_date<='] = $search_date_end; + $param .= '&search_date_endmonth=' . GETPOST('search_date_endmonth', 'int') . '&search_date_endday=' . GETPOST('search_date_endday', 'int') . '&search_date_endyear=' . GETPOST('search_date_endyear', 'int'); + } + if (!empty($search_doc_date)) { + $filter['t.doc_date'] = $search_doc_date; + $param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int'); + } + if (!empty($search_accountancy_code_start)) { + $filter['t.numero_compte>='] = $search_accountancy_code_start; + $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); + } + if (!empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); + } + if (!empty($search_label_account)) { + $filter['t.label_compte'] = $search_label_account; + $param .= '&search_label_compte=' . urlencode($search_label_account); + } + if (!empty($search_doc_ref)) { + $filter['t.doc_ref'] = $search_doc_ref; + $param .= '&search_doc_ref=' . urlencode($search_doc_ref); + } + if (!empty($search_label_operation)) { + $filter['t.label_operation'] = $search_label_operation; + $param .= '&search_label_operation=' . urlencode($search_label_operation); + } + if (!empty($search_direction)) { + $filter['t.sens'] = $search_direction; + $param .= '&search_direction=' . urlencode($search_direction); + } + if (!empty($search_ledger_code)) { + $filter['t.code_journal'] = $search_ledger_code; + $param .= '&search_ledger_code=' . urlencode($search_ledger_code); + } + if (!empty($search_debit)) { + $filter['t.debit'] = $search_debit; + $param .= '&search_debit=' . urlencode($search_debit); + } + if (!empty($search_credit)) { + $filter['t.credit'] = $search_credit; + $param .= '&search_credit=' . urlencode($search_credit); + } +} if ($action == 'delmouvconfirm') { $mvt_num = GETPOST('mvt_num', 'int'); @@ -267,14 +299,25 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($l print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $viewflat.$newcardbutton, '', $limit); +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; +else $moreforfilter = $hookmanager->resPrint; + // Reverse sort order if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc"; else $sortorder = "desc"; print '
'; -print '
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Parameters").''.$langs->trans("Value").'
'; +print '
'; -print ''; +// Filters lines +print ''; +// Accountancy account print ''; -print ''; +// Date document +if (!empty($arrayfields['t.doc_date']['checked'])) { + print ''; + print ''; +} +// Ref document +if (!empty($arrayfields['t.doc_ref']['checked'])) { + print ''; +} +// Label operation +if (!empty($arrayfields['t.label_operation']['checked'])) { + print ''; +} +// Debit +if (!empty($arrayfields['t.debit']['checked'])) { + print ''; +} +// Credit +if (!empty($arrayfields['t.credit']['checked'])) { + print ''; +} +// Code journal +if (!empty($arrayfields['t.code_journal']['checked'])) { + print ''; +} + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +// Action column print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print "\n"; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); -print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); -print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); -print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); -print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60"', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); +if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); +if (!empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -323,7 +395,10 @@ $sous_total_debit = 0; $sous_total_credit = 0; $displayed_account_number = null; // Start with undefined to be able to distinguish with empty +// Loop on record +// -------------------------------------------------------------------- $i = 0; +$totalarray = array(); while ($i < min($num, $limit)) { $line = $object->lines[$i]; @@ -362,38 +437,149 @@ while ($i < min($num, $limit)) print ''; print ''; print ''; - print ''; - // TODO Add a link according to doc_type and fk_doc - print ''; + if (!$i) $totalarray['nbfield']++; + } + + // Document ref + if (!empty($arrayfields['t.doc_ref']['checked'])) + { + if ($line->doc_type == 'customer_invoice') + { + $langs->loadLangs(array('bills')); + + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $objectstatic = new Facture($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'facture'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id; + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + } + elseif ($line->doc_type == 'supplier_invoice') + { + $langs->loadLangs(array('bills')); + + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $objectstatic = new FactureFournisseur($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'invoice_supplier'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir); + } + elseif ($line->doc_type == 'expense_report') + { + $langs->loadLangs(array('trips')); + + require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; + $objectstatic = new ExpenseReport($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'expensereport'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id; + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + } + else + { + // Other type + } + + print '\n"; + if (!$i) $totalarray['nbfield']++; + } + + // Label operation + if (!empty($arrayfields['t.label_operation']['checked'])) { + // Affiche un lien vers la facture client/fournisseur + $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref); + print strlen(length_accounta($line->subledger_account)) == 0 ? '' : ''; + if (!$i) $totalarray['nbfield']++; + } + + // Amount debit + if (!empty($arrayfields['t.debit']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit'; + $totalarray['val']['totaldebit'] += $line->debit; + } + + // Amount credit + if (!empty($arrayfields['t.credit']['checked'])) { + print ''; + if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit'; + $totalarray['val']['totalcredit'] += $line->credit; + } + + // Lettering code + if (!empty($arrayfields['t.lettering_code']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } + + // Journal code + if (!empty($arrayfields['t.code_journal']['checked'])) + { + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); + print ''; + } + + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Action column + print ''; - // Affiche un lien vers la facture client/fournisseur - $doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref); - print strlen(length_accounta($line->subledger_account)) == 0 ? '' : ''; - - - print ''; - print ''; - - $accountingjournal = new AccountingJournal($db); - $result = $accountingjournal->fetch('', $line->code_journal); - $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); - print ''; - - print ''; - print "\n"; - // Comptabilise le sous-total $sous_total_debit += $line->debit; $sous_total_credit += $line->credit; + if (!$i) $totalarray['nbfield']++; + + print "\n"; + $i++; } @@ -406,23 +592,20 @@ print ''; print ''; print ''; +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; -// Show total -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; print "
'; print '
'; print $langs->trans('From').' '; @@ -285,35 +328,64 @@ print $langs->trans('to').' '; print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); print '
'; print '
'; + print $langs->trans('From') . ': '; + print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1); + print '
'; + print $langs->trans('to') . ': '; + print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); + print '
'; -print $langs->trans('From').': '; -print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1); -print '
'; -print $langs->trans('to').': '; -print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); -print '
'; -$searchpicto = $form->showFilterAndCheckAddButtons(0); +$searchpicto = $form->showFilterButtons(); print $searchpicto; print '
 '.$line->piece_num.''.dol_print_date($line->doc_date, 'day').''; - //if ($line->doc_type == 'supplier_invoice') - //if ($line->doc_type == 'customer_invoice') - print $line->doc_ref; + // Document date + if (!empty($arrayfields['t.doc_date']['checked'])) + { + print ''.dol_print_date($line->doc_date, 'day').''; + + print ''; + // Picto + Ref + print '
'; + + if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') + { + print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); + print $documentlink; + } else { + print $line->doc_ref; + } + print '
'; + + print "
' . $line->label_operation . '' . $line->label_operation . '
(' . length_accounta($line->subledger_account) . ')
'.($line->debit ? price($line->debit) : '').'' . ($line->credit ? price($line->credit) : '') . ''.$line->lettering_code.''.$journaltoshow.''; + if (empty($line->date_export)) { + if ($user->rights->accounting->mouvements->creer) { + print ''.img_edit().''; + } + if ($user->rights->accounting->mouvements->supprimer) { + print ' '.img_delete().''; + } + } print ''.$line->label_operation.''.$line->label_operation.'
('.length_accounta($line->subledger_account).')
'.($line->debit ? price($line->debit) : '').''.($line->credit ? price($line->credit) : '').''.$journaltoshow.''; - print ''.img_edit().' '; - print ''.img_delete().''; - print '
'.$langs->trans("Total").':'; -print price($total_debit); -print ''; -print price($total_credit); -print '
"; print '
'; +// TODO Replace this with mass delete action +if ($user->rights->accounting->mouvements->supprimer_tous) { + print '
'."\n"; + print ''.$langs->trans("DeleteMvt").''; + print '
'; +} + print ''; // End of page From 40ffbbe61653f7a5bfea122b1d028b5cc297fcba Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 May 2020 13:28:56 +0200 Subject: [PATCH 098/490] Debug --- .../accountancy/bookkeeping/listbyaccount.php | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 582e54442a5..ff742c356c4 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -120,17 +120,18 @@ $arrayfields = array( if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']); - -$object = new BookKeeping($db); - /* * Action */ +if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } + $parameters = array('socid'=>$socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if (empty($reshook)) { +if (empty($reshook)) +{ include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers @@ -328,15 +329,22 @@ print $langs->trans('to').' '; print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); print ''; print ''; +// Movement number +if (!empty($arrayfields['t.piece_num']['checked'])) +{ + print ''; +} // Date document if (!empty($arrayfields['t.doc_date']['checked'])) { - print ''; print ''; + print '
'; print $langs->trans('From') . ': '; print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1); - print '
'; + print '
'; + print '
'; print $langs->trans('to') . ': '; print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); + print '
'; print ''; } // Ref document @@ -374,7 +382,7 @@ print "\n"; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder, 'right '); +if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); @@ -436,7 +444,18 @@ while ($i < min($num, $limit)) print ''; print ' '; - print ''.$line->piece_num.''; + if (!$i) $totalarray['nbfield']++; + + // Piece number + if (!empty($arrayfields['t.piece_num']['checked'])) + { + print ''; + $object->id = $line->id; + $object->piece_num = $line->piece_num; + print $object->getNomUrl(1, '', 0, '', 1); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Document date if (!empty($arrayfields['t.doc_date']['checked'])) @@ -553,6 +572,7 @@ while ($i < min($num, $limit)) $result = $accountingjournal->fetch('', $line->code_journal); $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); print ''.$journaltoshow.''; + if (!$i) $totalarray['nbfield']++; } // Fields from hook @@ -585,7 +605,7 @@ while ($i < min($num, $limit)) // Show sub-total of last shown account print ''; -print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; +print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print ''; print price($sous_total_debit - $sous_total_credit); print ''; From 640158ea4caa3ffc94a0af63494fd509c768dbf0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 May 2020 13:50:26 +0200 Subject: [PATCH 099/490] NEW Accountancy - Add Fiducial Winfic eWinfic WinSis Compta --- ...ncy-format_Winfic-eWinfic-WinSisCompta.pdf | Bin 0 -> 173394 bytes .../class/accountancyexport.class.php | 96 +++++++++++++++++- htdocs/langs/en_US/accountancy.lang | 3 +- 3 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 dev/resources/iso-normes/Accountancy-format_Winfic-eWinfic-WinSisCompta.pdf diff --git a/dev/resources/iso-normes/Accountancy-format_Winfic-eWinfic-WinSisCompta.pdf b/dev/resources/iso-normes/Accountancy-format_Winfic-eWinfic-WinSisCompta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2fbaad04699b50eed31cf1373164693fda111714 GIT binary patch literal 173394 zcmbSyWmsHGvu+ZCyE{yRJHsFY!JXi4!5N&vEx5ZUkl^ki1cwmZCAb84_uxV9kiEZq z_Q^i?{J863&8$^zRbBN~_cOdrqa-fL0%YYxr&(Pa9!E#v2CxI{jIGf5`Pt+wp%5cS z%eN3y0FX@%0OSFIcsbb=0bn)>0FaB5mz$GK0l>kg_E-Ys;$o8q=mLP8KyCmC2+|W2 zM2A34AA17)aiOEQJ3`DJN8;i}M`8c_f;Id71c3fW2IS%3{g({P1O8LS0c2gNyUedO!{y(4YMQVHW+XEeHhuQx_nJi|1ecfq1w%{v4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Wbq{PMf_@#kBaXwxy daS;QUo@lTL8S3(zng9SyO?rB16&Xyl{||4v)L#Gq literal 0 HcmV?d00001 diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 1e641564de4..37b00ff43a6 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -5,11 +5,12 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2016-2019 Alexandre Spangaro + * Copyright (C) 2016-2020 Alexandre Spangaro * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz * Copyright (C) 2017-2019 Frédéric France * Copyright (C) 2017 André Schild + * Copyright (C) 2020 Guillaume Alexandre * * 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 @@ -52,6 +53,7 @@ class AccountancyExport public static $EXPORT_TYPE_SAGE50_SWISS = 45; public static $EXPORT_TYPE_CHARLEMAGNE = 50; public static $EXPORT_TYPE_QUADRATUS = 60; + public static $EXPORT_TYPE_WINFIC = 70; public static $EXPORT_TYPE_OPENCONCERTO = 100; public static $EXPORT_TYPE_LDCOMPTA = 110; public static $EXPORT_TYPE_LDCOMPTA10 = 120; @@ -105,6 +107,7 @@ class AccountancyExport self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'), self::$EXPORT_TYPE_CIEL => $langs->trans('Modelcsv_ciel'), self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'), + self::$EXPORT_TYPE_WINFIC => $langs->trans('Modelcsv_winfic'), self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'), self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'), self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'), @@ -136,6 +139,7 @@ class AccountancyExport self::$EXPORT_TYPE_BOB50 => 'bob50', self::$EXPORT_TYPE_CIEL => 'ciel', self::$EXPORT_TYPE_QUADRATUS => 'quadratus', + self::$EXPORT_TYPE_WINFIC => 'winfic', self::$EXPORT_TYPE_EBP => 'ebp', self::$EXPORT_TYPE_COGILOG => 'cogilog', self::$EXPORT_TYPE_AGIRIS => 'agiris', @@ -184,6 +188,10 @@ class AccountancyExport 'label' => $langs->trans('Modelcsv_quadratus'), 'ACCOUNTING_EXPORT_FORMAT' => 'txt', ), + self::$EXPORT_TYPE_WINFIC => array( + 'label' => $langs->trans('Modelcsv_winfic'), + 'ACCOUNTING_EXPORT_FORMAT' => 'txt', + ), self::$EXPORT_TYPE_EBP => array( 'label' => $langs->trans('Modelcsv_ebp'), ), @@ -246,7 +254,7 @@ class AccountancyExport $filename = 'general_ledger-'.$this->getFormatCode($formatexportset); $type_export = 'general_ledger'; - global $db; // The tpl file use $db + global $db; // The tpl file use $db include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; @@ -269,6 +277,9 @@ class AccountancyExport case self::$EXPORT_TYPE_QUADRATUS : $this->exportQuadratus($TData); break; + case self::$EXPORT_TYPE_WINFIC : + $this->exportWinfic($TData); + break; case self::$EXPORT_TYPE_EBP : $this->exportEbp($TData); break; @@ -548,6 +559,85 @@ class AccountancyExport } } + /** + * Export format : WinFic - eWinfic - WinSis Compta + * + * + * @param array $TData data + * @return void + */ + public function exportWinfic(&$TData) + { + global $conf; + + $end_line = "\r\n"; + + //We should use dol_now function not time however this is wrong date to transfert in accounting + //$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy + //$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy + foreach ($TData as $data) { + $code_compta = $data->numero_compte; + if (!empty($data->subledger_account)) + $code_compta = $data->subledger_account; + + $Tab = array(); + //$Tab['type_ligne'] = 'M'; + $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); + + //We use invoice date $data->doc_date not $date_ecriture which is the transfert date + //maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ? + //$Tab['date_ecriture'] = $date_ecriture; + $Tab['date_operation'] = dol_print_date($data->doc_date, '%d%m%Y'); + + $Tab['folio'] = ' 1'; + + $Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT); + + $Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); + + $Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0'); + + if($data->sens == 'D'){ + $Tab['montant_debit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT); + + $Tab['montant_crebit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT); + } + else{ + $Tab['montant_debit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT); + + $Tab['montant_crebit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT); + } + + $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30); + + $Tab['lettrage'] = str_repeat(' ', 2); + + $Tab['code_piece'] = str_repeat(' ', 5); + + $Tab['code_stat'] = str_repeat(' ', 4); + + if (!empty($data->date_echeance)) + //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); + $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y'); + else + $Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y'); + + $Tab['monnaie'] = '1'; + + $Tab['filler'] = ' '; + + $Tab['ind_compteur'] = ' '; + + $Tab['quantite'] = '0,000000000'; + + $Tab['code_pointage'] = str_repeat(' ', 2); + + $Tab['end_line'] = $end_line; + + print implode('|', $Tab); + } + } + /** * Export format : EBP @@ -930,7 +1020,7 @@ class AccountancyExport } /** - * Export format : LD Compta version 9 & higher + * Export format : LD Compta version 9 * http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf * * @param array $objectLines data diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index ba34d38f36e..eb3229efaee 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -314,12 +314,13 @@ Modelcsv_quadratus=Export for Quadratus QuadraCompta Modelcsv_ebp=Export for EBP Modelcsv_cogilog=Export for Cogilog Modelcsv_agiris=Export for Agiris -Modelcsv_LDCompta=Export for LD Compta (v9 & higher) (Test) +Modelcsv_LDCompta=Export for LD Compta (v9) (Test) Modelcsv_LDCompta10=Export for LD Compta (v10 & higher) Modelcsv_openconcerto=Export for OpenConcerto (Test) Modelcsv_configurable=Export CSV Configurable Modelcsv_FEC=Export FEC Modelcsv_Sage50_Swiss=Export for Sage 50 Switzerland +Modelcsv_winfic=Export Winfic - eWinfic - WinSis Compta ChartofaccountsId=Chart of accounts Id ## Tools - Init accounting account on product / service From 7ad80c9bf623a88d215baa7dce03e4446c8b7db2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 8 May 2020 11:53:11 +0000 Subject: [PATCH 100/490] Fixing style errors. --- htdocs/accountancy/class/accountancyexport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 37b00ff43a6..3bf41e6326f 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -561,7 +561,7 @@ class AccountancyExport /** * Export format : WinFic - eWinfic - WinSis Compta - * + * * * @param array $TData data * @return void From 94d47c2acd4a53ba4ad69f914ac87212983b9ac4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 14:04:17 +0200 Subject: [PATCH 101/490] Fix sql --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 38d0acb97fa..238c98b2f6e 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -275,4 +275,4 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); -ALTER TABLE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; +UPDATE TABLE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; From c98663be4a491e133c914972891af7cde7e4ac84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 14:05:04 +0200 Subject: [PATCH 102/490] Fix sql --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 238c98b2f6e..470d48bbf26 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -275,4 +275,4 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); -UPDATE TABLE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; +UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; From 0138ab3f7c85eb7fb1319f1ec568da8299d9eed8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 14:25:49 +0200 Subject: [PATCH 103/490] Fix $weblangs must be initialized with language of page --- htdocs/core/website.inc.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 3e54f6ec2ad..5ea21e19fda 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -33,11 +33,6 @@ if (!is_object($website)) $website = new Website($db); $website->fetch(0, $websitekey); } -// Define $weblangs -if (!is_object($weblangs)) -{ - $weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice -} // Define $websitepage if we have $websitepagefile defined if (!$pageid && !empty($websitepagefile)) { @@ -48,10 +43,17 @@ if (!is_object($websitepage)) { $websitepage = new WebsitePage($db); } +// Define $weblangs +if (!is_object($weblangs)) +{ + $weblangs = new Translate($db); +} if ($pageid > 0) { $websitepage->fetch($pageid); + $weblangs->setDefaultLang($websitepage->lang ? $websitepage->lang : 'auto'); + if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) { $weblangs->load("website"); From 6a2bb08107a15da3a4d3ccc640be071a7c3d7d80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 14:34:02 +0200 Subject: [PATCH 104/490] Fix constructor --- htdocs/core/website.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 5ea21e19fda..18744fec7a8 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -46,7 +46,7 @@ if (!is_object($websitepage)) // Define $weblangs if (!is_object($weblangs)) { - $weblangs = new Translate($db); + $weblangs = new Translate($db, $conf); } if ($pageid > 0) { From c28a3e85a35cb4df9a6cc4828bcfc82eb035955b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 14:35:03 +0200 Subject: [PATCH 105/490] Fix constructor --- htdocs/core/website.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 18744fec7a8..b5053fcc814 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -46,7 +46,7 @@ if (!is_object($websitepage)) // Define $weblangs if (!is_object($weblangs)) { - $weblangs = new Translate($db, $conf); + $weblangs = new Translate('', $conf); } if ($pageid > 0) { From b93a3ceb297b7722229ecfbfe6d0eedb16c2f5cc Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Fri, 8 May 2020 17:25:48 +0200 Subject: [PATCH 106/490] TakePOS Auto Order improvements --- htdocs/takepos/css/phone.css | 28 +++++ htdocs/takepos/genimg/qr.php | 7 +- htdocs/takepos/invoice.php | 20 ++-- htdocs/takepos/phone.php | 162 ++++++++++++++++++++++----- htdocs/takepos/public/auto_order.php | 7 +- 5 files changed, 185 insertions(+), 39 deletions(-) diff --git a/htdocs/takepos/css/phone.css b/htdocs/takepos/css/phone.css index 49d833ade17..0f3606071f0 100644 --- a/htdocs/takepos/css/phone.css +++ b/htdocs/takepos/css/phone.css @@ -79,3 +79,31 @@ button.phonebutton { height:90%; font-weight: bold; } + +button.publicphonebutton { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ + width:33%; + height:90%; + font-weight: bold; +} + +button.publicphonebutton2 { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ + width:33%; + font-weight: bold; + padding: 8px 16px; +} diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index c73e874a465..553f5165a0d 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -29,5 +29,8 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; $key = GETPOST('key'); -$module = new modTcpdfbarcode($db); -$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); +$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); +$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + +$module = new modtcpdfbarcode($db); +$result = $module->buildBarCode($urlwithroot."/takepos/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index b1641072829..236b302406d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -32,7 +32,7 @@ if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } if (!defined('NOREQUIREAJAX')) { define('NOREQUIREAJAX', '1'); } -require '../main.inc.php'; +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; @@ -47,16 +47,11 @@ $idproduct = GETPOST('idproduct', 'int'); $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant $placeid = 0; // $placeid is ID of invoice -if ($_SESSION["publicterminal"]) { - $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers -} -elseif (empty($user->rights->takepos->run)) { +if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { accessforbidden(); } - - -if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') || $_SESSION["publicterminal"]) +if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED if ($_SESSION["takeposterminal"] == "") @@ -629,6 +624,12 @@ $(document).ready(function() { if (selectedline==this.id) return; // If is already selected else selectedline=this.id; selectedtext=$('#'+selectedline).find("td:first").html(); + }); /* Autoselect the line */ @@ -913,7 +914,7 @@ if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">'; $htmlforlines .= ''; $htmlforlines .= $row->label; - $htmlforlines .= ''; + $htmlforlines .= '

'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; $htmlforlines .= ''."\n"; } $htmlforlines .= ''; @@ -990,6 +991,7 @@ if ($placeid > 0) } $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= ''; + if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x "; //if ($line->product_label) $htmlforlines.= ''.$line->product_label.''; if (isset($line->product_type)) { diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index eac1f40bfd1..6e912d988dc 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -31,7 +31,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE') && isset($_GET['key'])) require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -45,6 +45,7 @@ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); +$idproduct = GETPOST('idproduct', 'int'); if ($setterminal > 0) { @@ -53,14 +54,10 @@ if ($setterminal > 0) $langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter")); -if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { - $_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers -} -elseif (empty($user->rights->takepos->run)) { +if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { accessforbidden(); } - /* * View */ @@ -75,7 +72,42 @@ $head = ' top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> - + +fetch($idproduct); + print "".$prod->label."
"; + print ''; + print "
".$prod->description; + print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; + print '
'; + print ''; +} +elseif ($action=="editline"){ + $placeid = GETPOST('placeid', 'int'); + $selectedline = GETPOST('selectedline', 'int'); + $invoice = new Facture($db); + $invoice->fetch($placeid); + foreach ($invoice->lines as $line) + { + if ($line->id == $selectedline) + { + $prod = new Product($db); + $prod->fetch($line->fk_product); + print "".$prod->label."
"; + print ''; + print "
".$prod->description; + print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; + print '
'; + print ''; + print ''; + print ''; + } + } +} +else { +?> -global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; -?> + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; + ?>
global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"]
- Date: Fri, 8 May 2020 18:04:38 +0200 Subject: [PATCH 108/490] Fix URLs --- htdocs/takepos/phone.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 7e454a734a3..8714173e45f 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -31,7 +31,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE') && isset($_GET['key'])) require '../main.inc.php'; +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -71,14 +71,13 @@ $head = ' '; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); -?> - -'; + if ($action=="productinfo"){ $prod = new Product($db); $prod->fetch($idproduct); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; From b89b6d7679546811e13826e74262fa67cd10be75 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Fri, 8 May 2020 18:51:49 +0200 Subject: [PATCH 109/490] Name fix --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index 553f5165a0d..99f7fced1d0 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -32,5 +32,5 @@ $key = GETPOST('key'); $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -$module = new modtcpdfbarcode($db); +$module = new modTcpdfbarcode($db); $result = $module->buildBarCode($urlwithroot."/takepos/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); From bba8ab657eea7ae7f28e5369ea59b06b1f3f5937 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 May 2020 18:57:15 +0200 Subject: [PATCH 110/490] Fix add missing migration --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 11 +++++++++++ htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index bc4b562711b..2a7a8963e9f 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -582,3 +582,14 @@ create table llx_commande_fournisseur_dispatch_extrafields ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object); + +create table llx_facturedet_rec_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- object id + import_key varchar(14) -- import key +)ENGINE=innodb; + +ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object); + diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 470d48bbf26..8a68e763160 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -54,6 +54,15 @@ create table llx_c_shipment_package_type entity integer DEFAULT 1 NOT NULL -- Multi company id )ENGINE=innodb; +create table llx_facturedet_rec_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- object id + import_key varchar(14) -- import key +)ENGINE=innodb; + +ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object); -- For v12 From a87d9cd740f2399f5d24e13e0f7791eadde19976 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 8 May 2020 22:41:49 +0200 Subject: [PATCH 111/490] Update list.php --- htdocs/product/list.php | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 90464742839..0b1c0d19aff 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -211,6 +211,17 @@ $arrayfields = array( 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000), 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Buy").')', 'checked'=>1, 'position'=>1000) ); + +// MultiPrices +if ($conf->global->PRODUIT_MULTIPRICES){ + for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) + { + $arrayfields['p.sellprice'.$i] = array('label'=>$langs->trans("SellingPrice")." ".$i, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>40); + $arraypricelevel[$i] = array($i); + } +} + +//var_dump($arraypricelevel); // Extra fields if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { @@ -733,6 +744,19 @@ if ($resql) print ''; print ''; } + + // Multiprice + if ($conf->global->PRODUIT_MULTIPRICES){ + foreach ($arraypricelevel as $key => $value) + { + if (!empty($arrayfields['p.sellprice'.$key]['checked'])) + { + print ''; + print ''; + } + } + } + // Minimum buying Price if (!empty($arrayfields['p.minbuyprice']['checked'])) { @@ -865,6 +889,18 @@ if ($resql) if (!empty($arrayfields['p.sellprice']['checked'])) { print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); } + + // Multiprices + if ($conf->global->PRODUIT_MULTIPRICES){ + foreach ($arraypricelevel as $key => $value) + { + if (!empty($arrayfields['p.sellprice'.$key]['checked'])) + { + print_liste_field_titre($arrayfields['p.sellprice'.$key]['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); + } + } + } + if (!empty($arrayfields['p.minbuyprice']['checked'])) { print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); } @@ -1200,6 +1236,38 @@ if ($resql) if (!$i) $totalarray['nbfield']++; } + + // Multiprices + if ($conf->global->PRODUIT_MULTIPRICES){ + foreach ($arraypricelevel as $key => $value) + { + if (!empty($arrayfields['p.sellprice'.$key]['checked'])) + { + $resultp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price"; + $resultp .= " FROM ".MAIN_DB_PREFIX."product_price as p"; + $resultp .= " WHERE fk_product = ".$obj->rowid; + if (!empty($conf->global->PRODUIT_MULTIPRICES)) $resultp .= " AND p.price_level = ".$key; + $resultp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC"; + $resultp = $db->query($resultp); + if ($resultp) + { + $objp = $db->fetch_object($resultp); + print ''; + if ($obj->tosell) + { + if ($obj->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); + else print price($objp->price).' '.$langs->trans("HT"); + } + print ''; + $db->free($resultp); + } else { + dol_print_error($db); + } + if (!$i) $totalarray['nbfield']++; + } + } + } + // Better buy price if (!empty($arrayfields['p.minbuyprice']['checked'])) { From c2dff7dfed6077cba99165aa9dcc1ee86eab0785 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 8 May 2020 20:46:06 +0000 Subject: [PATCH 112/490] Fixing style errors. --- htdocs/product/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 0b1c0d19aff..d666caad80c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1253,11 +1253,11 @@ if ($resql) { $objp = $db->fetch_object($resultp); print ''; - if ($obj->tosell) + if ($obj->tosell) { - if ($obj->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); - else print price($objp->price).' '.$langs->trans("HT"); - } + if ($obj->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); + else print price($objp->price).' '.$langs->trans("HT"); + } print ''; $db->free($resultp); } else { From 52b47fd5988832725fd75c50d38e208a0095bcff Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 9 May 2020 00:28:23 +0200 Subject: [PATCH 113/490] Update list.php --- htdocs/product/list.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d666caad80c..f818d2f475a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -216,7 +216,16 @@ $arrayfields = array( if ($conf->global->PRODUIT_MULTIPRICES){ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { - $arrayfields['p.sellprice'.$i] = array('label'=>$langs->trans("SellingPrice")." ".$i, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>40); + $keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i; + if (!empty($conf->global->$keyforlabel)) + { + $labelp = $i.' - '.$langs->trans($conf->global->$keyforlabel); + } + else + { + $labelp = $langs->trans("SellingPrice")." ".$i; + } + $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>1, 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>40); $arraypricelevel[$i] = array($i); } } From 3644a718d8b7fd21deec36617724c9a30e119c15 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 9 May 2020 01:02:51 +0200 Subject: [PATCH 114/490] 1 --- htdocs/admin/user.php | 24 ++++++++++++++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 3 files changed, 26 insertions(+) diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index fb15a57a87e..60cbadcdd3a 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -177,6 +177,30 @@ else } print ''; +// user hide inactive + +print ''; +print ''.$langs->trans("UserHideInactive").''; +print ' '; + +print ''; +if ($conf->use_javascript_ajax) +{ + print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX'); +} +else +{ + if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) + { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } +} +print ''; + print ''; print '
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3cf6e6044db..e97ed8dbc54 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1272,6 +1272,7 @@ RuleForGeneratedPasswords=Rules to generate and validate passwords DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page UsersSetup=Users module setup UserMailRequired=Email required to create a new user +UserHideInactive=Hide inactive users UsersDocModules=Document templates for documents generated from user record GroupsDocModules=Document templates for documents generated from a group record ##### HRM setup ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 6545b71ede3..172153852e3 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1272,6 +1272,7 @@ RuleForGeneratedPasswords=Règle pour la génération des mots de passe proposé DisableForgetPasswordLinkOnLogonPage=Cacher le lien "Mot de passe oublié" sur la page de connexion UsersSetup=Configuration du module utilisateurs UserMailRequired=Email requis pour créer un nouvel utilisateur +UserHideInactive=Cacher les utilisateurs inactifs UsersDocModules=Modèles de documents pour les documents générés à partir de la fiche utilisateur GroupsDocModules=Modèles de documents pour les documents générés à partir de la fiche d'un groupe ##### HRM setup ##### From 53eb891a88d9727591ada4601c1f03fed7c22370 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 9 May 2020 18:48:01 +0200 Subject: [PATCH 115/490] Update list.php --- htdocs/product/stock/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 15b92c83acc..c13243fc9cb 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -549,6 +549,11 @@ if ($num) { print ''; if ($key == 'statut') print $warehouse->getLibStatut(5); + if ($key == 'phone') + { + print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL'); + } + elseif ($key == 'fax') print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); else print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); print ''; if (!$i) $totalarray['nbfield']++; From fe241ea321982b4b7ee30cf6ea03e7e5c7a7b3e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 May 2020 21:49:12 +0200 Subject: [PATCH 116/490] Fix removed not reliabled info in PHP info --- htdocs/admin/system/phpinfo.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index ce21c1f3ad8..04439d11710 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -143,7 +143,7 @@ $loadedExtensions = array_map('strtolower', get_loaded_extensions(false)); print ''; print ''; print ''; -print ''; +//print ''; print ''; print ''; print ''; @@ -154,7 +154,7 @@ $name = "GD"; print ""; print ""; -print getTableColumn($name, $activatedExtensions); +//print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -165,7 +165,7 @@ $name = "Curl"; print ""; print ""; -print getTableColumn($name, $activatedExtensions); +//print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -178,7 +178,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc print ""; print ""; - print getTableColumn($name, $activatedExtensions); + //print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -191,7 +191,7 @@ $name = "xDebug"; print ""; print ""; -print getTableColumn($name, $activatedExtensions); +//print getTableColumn($name, $activatedExtensions); print getTableColumn($name, $loadedExtensions); print getTableColumnFunction($functions); print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); @@ -208,7 +208,6 @@ foreach ($phparray as $key => $value) print '
'; print '
'.$langs->trans("Extension").''.$langs->trans("EnabledInSetup").''.$langs->trans("EnabledInSetup").''.$langs->trans("Loaded").''.$langs->trans("FunctionTest").''.$langs->trans("Result").'
".$name."
".$name."
".$name."
".$name."
'; print ''; - //print ''; print ''; print ''; print "\n"; @@ -408,7 +407,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function global $langs; $result = true; - $result = $result && in_array(strtolower($name), $activated); + //$result = $result && in_array(strtolower($name), $activated); $result = $result && in_array(strtolower($name), $loaded); foreach ($functions as $function) From 310c5f9eb665ac0331f3b727c81bf65b668da569 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 May 2020 21:56:51 +0200 Subject: [PATCH 117/490] Fix size of field --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 61f4dc544ba..b7fe131c3f9 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -200,7 +200,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, fk_emailcollector INTEGER NOT NULL, type varchar(128) NOT NULL, - rulevalue varchar(255) NULL, + rulevalue varchar(128) NULL, date_creation datetime NOT NULL, tms timestamp NOT NULL, fk_user_creat integer NOT NULL, From f40e978475751664c2b4cb1245f5c185b890613c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 10 May 2020 06:28:50 +0200 Subject: [PATCH 118/490] Fix delbookkeepingyear - add hook printFieldPreListTitle - Look & Feel v12 --- .../accountancy/bookkeeping/listbyaccount.php | 282 +++++++++++++----- htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 213 insertions(+), 70 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index ff742c356c4..49dbb81e77d 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -57,6 +57,12 @@ $search_direction = GETPOST('search_direction', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'alpha'); $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); +$search_lettering_code = GETPOST('search_lettering_code', 'alpha'); +$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha'); + +if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { + $action = 'delbookkeepingyear'; +} // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -105,6 +111,7 @@ if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search $arrayfields = array( // 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), + 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), 't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1), 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), 't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1), @@ -112,10 +119,6 @@ $arrayfields = array( 't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1), 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), - 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), - // 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), - // 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), - // 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']); @@ -155,6 +158,8 @@ if (empty($reshook)) $search_date_endday = ''; $search_debit = ''; $search_credit = ''; + $search_lettering_code = ''; + $search_not_reconciled = ''; } // Must be after the remove filter action, before the export. @@ -209,9 +214,62 @@ if (empty($reshook)) $filter['t.credit'] = $search_credit; $param .= '&search_credit=' . urlencode($search_credit); } + if (!empty($search_lettering_code)) { + $filter['t.lettering_code'] = $search_lettering_code; + $param .= '&search_lettering_code='.urlencode($search_lettering_code); + } + if (!empty($search_not_reconciled)) { + $filter['t.reconciled_option'] = $search_not_reconciled; + $param .= '&search_not_reconciled='.urlencode($search_not_reconciled); + } } -if ($action == 'delmouvconfirm') { +if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { + $import_key = GETPOST('importkey', 'alpha'); + + if (!empty($import_key)) { + $result = $object->deleteByImportkey($import_key); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + + // Make a redirect to avoid to launch the delete later after a back button + header("Location: listbyaccount.php".($param ? '?'.$param : '')); + exit; + } +} +if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) { + $delmonth = GETPOST('delmonth', 'int'); + $delyear = GETPOST('delyear', 'int'); + if ($delyear == -1) { + $delyear = 0; + } + $deljournal = GETPOST('deljournal', 'alpha'); + if ($deljournal == -1) { + $deljournal = 0; + } + + if (!empty($delmonth) || !empty($delyear) || !empty($deljournal)) + { + $result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0)); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + else + { + setEventMessages("RecordDeleted", null, 'mesgs'); + } + + // Make a redirect to avoid to launch the delete later after a back button + header("Location: listbyaccount.php".($param ? '?'.$param : '')); + exit; + } + else + { + setEventMessages("NoRecordDeleted", null, 'warnings'); + } +} +if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) { $mvt_num = GETPOST('mvt_num', 'int'); if (!empty($mvt_num)) { @@ -219,8 +277,13 @@ if ($action == 'delmouvconfirm') { if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - Header("Location: listbyaccount.php"); - exit(); + else + { + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + } + + header("Location: listbyaccount.php?noreset=1".($param ? '&'.$param : '')); + exit; } } @@ -262,22 +325,42 @@ if ($action == 'delmouv') { } if ($action == 'delbookkeepingyear') { $form_question = array(); - $delyear = GETPOST('delyear'); + $delyear = GETPOST('delyear', 'int'); + $deljournal = GETPOST('deljournal', 'alpha'); if (empty($delyear)) { $delyear = dol_print_date(dol_now(), '%Y'); } + $month_array = array(); + for ($i = 1; $i <= 12; $i++) { + $month_array[$i] = $langs->trans("Month".sprintf("%02d", $i)); + } $year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array'); + $journal_array = $formaccounting->select_journal($deljournal, 'deljournal', '', 1, 1, 1, '', 0, 1); + $form_question['delmonth'] = array( + 'name' => 'delmonth', + 'type' => 'select', + 'label' => $langs->trans('DelMonth'), + 'values' => $month_array, + 'default' => '' + ); $form_question['delyear'] = array( - 'name' => 'delyear', - 'type' => 'select', - 'label' => $langs->trans('DelYear'), - 'values' => $year_array, - 'default' => $delyear + 'name' => 'delyear', + 'type' => 'select', + 'label' => $langs->trans('DelYear'), + 'values' => $year_array, + 'default' => $delyear + ); + $form_question['deljournal'] = array( + 'name' => 'deljournal', + 'type' => 'other', // We don't use select here, the journal_array is already a select html component + 'label' => $langs->trans('DelJournal'), + 'value' => $journal_array, + 'default' => $deljournal ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300); print $formconfirm; } @@ -304,35 +387,41 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); +// Reverse sort order +if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc"; +else $sortorder = "desc"; + +$moreforfilter = ''; + +// Accountancy account +$moreforfilter .= '
'; +$moreforfilter .= $langs->trans('AccountAccounting').': '; +$moreforfilter .= '
'; +$moreforfilter .= $langs->trans('From').' '; +$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200'); +$moreforfilter .= $langs->trans('to').' '; +$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); +$moreforfilter .= '
'; +$moreforfilter .= '
'; + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; -// Reverse sort order -if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc"; -else $sortorder = "desc"; +print '
'; +print $moreforfilter; +print '
'; print '
'; print '
'.$langs->trans("Parameter").''.$key.''.$langs->trans("Value").'
'; // Filters lines print ''; -// Accountancy account -print ''; -// Movement number -if (!empty($arrayfields['t.piece_num']['checked'])) -{ - print ''; + +// Code journal +if (!empty($arrayfields['t.code_journal']['checked'])) { + print ''; } // Date document if (!empty($arrayfields['t.doc_date']['checked'])) { @@ -347,6 +436,11 @@ if (!empty($arrayfields['t.doc_date']['checked'])) { print ''; print ''; } +// Movement number +if (!empty($arrayfields['t.piece_num']['checked'])) +{ + print ''; +} // Ref document if (!empty($arrayfields['t.doc_ref']['checked'])) { print ''; @@ -363,9 +457,13 @@ if (!empty($arrayfields['t.debit']['checked'])) { if (!empty($arrayfields['t.credit']['checked'])) { print ''; } -// Code journal -if (!empty($arrayfields['t.code_journal']['checked'])) { - print ''; +// Lettering code +if (!empty($arrayfields['t.lettering_code']['checked'])) +{ + print ''; } // Fields from hook @@ -381,14 +479,14 @@ print ''; print "\n"; print ''; -print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder); +if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); if (!empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); -if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook @@ -419,18 +517,42 @@ while ($i < min($num, $limit)) // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { - // Affiche un Sous-Total par compte comptable + + $colspan = $totalarray['nbfield'] - 3; + $colspanend = $totalarray['nbfield'] - 7; + // Show a subtotal by accounting account if (isset($displayed_account_number)) { - print ''; - print "\n"; - print "\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + // Show balance of last shown account + $balance = $sous_total_debit - $sous_total_credit; + print ''; + print ''; + if ($balance > 0 ) + { + print ''; + print ''; + } + else + { + print ''; + print ''; + } + print ''; print ''; } // Show the break account - $colspan = 9; print ""; - print ''; @@ -440,11 +562,28 @@ while ($i < min($num, $limit)) //if (empty($displayed_account_number)) $displayed_account_number='-'; $sous_total_debit = 0; $sous_total_credit = 0; + + $colspan = 0; } print ''; - print ''; - if (!$i) $totalarray['nbfield']++; + + // Journal code + if (!empty($arrayfields['t.code_journal']['checked'])) + { + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); + print ''; + if (!$i) $totalarray['nbfield']++; + } + + // Document date + if (!empty($arrayfields['t.doc_date']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Piece number if (!empty($arrayfields['t.piece_num']['checked'])) @@ -457,13 +596,6 @@ while ($i < min($num, $limit)) if (!$i) $totalarray['nbfield']++; } - // Document date - if (!empty($arrayfields['t.doc_date']['checked'])) - { - print ''; - if (!$i) $totalarray['nbfield']++; - } - // Document ref if (!empty($arrayfields['t.doc_ref']['checked'])) { @@ -565,16 +697,6 @@ while ($i < min($num, $limit)) if (!$i) $totalarray['nbfield']++; } - // Journal code - if (!empty($arrayfields['t.code_journal']['checked'])) - { - $accountingjournal = new AccountingJournal($db); - $result = $accountingjournal->fetch('', $line->code_journal); - $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); - print ''; - if (!$i) $totalarray['nbfield']++; - } - // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook @@ -591,25 +713,45 @@ while ($i < min($num, $limit)) } } print ''; + if (!$i) $totalarray['nbfield']++; // Comptabilise le sous-total $sous_total_debit += $line->debit; $sous_total_credit += $line->credit; - if (!$i) $totalarray['nbfield']++; - print "\n"; $i++; } // Show sub-total of last shown account +$colspan = $totalarray['nbfield'] - 3; +$colspanend = $totalarray['nbfield'] - 8; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +// Show balance of last shown account +$balance = $sous_total_debit - $sous_total_credit; +print ''; +print ''; +if ($balance > 0 ) +{ + print ''; + print ''; +} +else +{ + print ''; + print ''; +} +print ''; print ''; // Show total line diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index eb3229efaee..adf2309ad07 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -121,6 +121,7 @@ InvoiceLinesDone=Bound lines of invoices ExpenseReportLines=Lines of expense reports to bind ExpenseReportLinesDone=Bound lines of expense reports IntoAccount=Bind line with the accounting account +TotalForAccount=Total for accounting account Ventilate=Bind From ff578198d63c4e8f4b852c96c4380f264e38b74c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 10 May 2020 04:35:52 +0000 Subject: [PATCH 119/490] Fixing style errors. --- htdocs/accountancy/bookkeeping/listbyaccount.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 49dbb81e77d..25f664d955e 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -517,7 +517,6 @@ while ($i < min($num, $limit)) // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { - $colspan = $totalarray['nbfield'] - 3; $colspanend = $totalarray['nbfield'] - 7; // Show a subtotal by accounting account From 04480847df1ca79066567d41c58e613ed03a4189 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 10 May 2020 08:28:03 +0200 Subject: [PATCH 120/490] NEW Accountancy balance - Add a button ShowSubtotalByGroup --- htdocs/accountancy/bookkeeping/balance.php | 61 ++++++++++++++-------- htdocs/langs/en_US/accountancy.lang | 1 + 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b2a25b00ce2..7b99057f73a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -55,7 +55,7 @@ $pagenext = $page + 1; //if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortorder) $sortorder="DESC"; - +$show_subgroup = GETPOST('show_subgroup', 'alpha'); $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); @@ -130,10 +130,11 @@ if (!empty($search_accountancy_code_end)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; + $show_subgroup = ''; $search_date_start = ''; $search_date_end = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; $filter = array(); } @@ -223,6 +224,12 @@ if ($action != 'export_csv') $moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0); $moreforfilter .= $langs->trans('DateEnd').': '; $moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0); + + $moreforfilter .= ' - '; + $moreforfilter .= $langs->trans('ShowSubtotalByGroup').': '; + $moreforfilter .= ''; + + $moreforfilter .= ''; if (!empty($moreforfilter)) { @@ -289,26 +296,31 @@ if ($action != 'export_csv') } print ''; - // Permet d'afficher le compte comptable - if (empty($displayed_account) || $root_account_description != $displayed_account) + if(!empty($show_subgroup)) { - // Affiche un Sous-Total par compte comptable - if ($displayed_account != "") { - print ''; - print "\n"; + // Permet d'afficher le compte comptable + if (empty($displayed_account) || $root_account_description != $displayed_account) { + // Affiche un Sous-Total par compte comptable + if ($displayed_account != "") { + print ''; + print ''; + print ''; + print ''; + print "\n"; + print "\n"; + print ''; + } + + // Show first line of a break + print ''; + print ''; print ''; + + $displayed_account = $root_account_description; + $sous_total_debit = 0; + $sous_total_credit = 0; } - - // Show first line of a break - print ''; - print ''; - print ''; - - $displayed_account = $root_account_description; - $sous_total_debit = 0; - $sous_total_credit = 0; } - // $object->get_compte_racine($line->numero_compte); print ''; @@ -326,12 +338,15 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print ''; - print "\n"; - print ''; + if(!empty($show_subgroup)) + { + print ''; + print "\n"; + print ''; + } print ''; - print "\n"; + print "\n"; print ''; print "
'; -print '
'; -print $langs->trans('From').' '; -print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200'); -print '
'; -print '
'; -print $langs->trans('to').' '; -print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); -print '
'; -print '
'; + print ''; + print '
'.$langs->trans("NotReconciled").''; + print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).'  
'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':'.price($sous_total_debit).''.price($sous_total_credit).'
'.$langs->trans("Balance").':'; + print price($sous_total_debit - $sous_total_credit); + print ''; + print price($sous_total_credit - $sous_total_debit); + print '
'; + print ''; if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte); else print ''.$langs->trans("Unknown").''; print '
 '.$journaltoshow.''.dol_print_date($line->doc_date, 'day').''.dol_print_date($line->doc_date, 'day').''.$journaltoshow.'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; -print price($sous_total_debit - $sous_total_credit); -print ''.$langs->trans("TotalForAccount").' '.$accountg.':'.price($sous_total_debit).''.price($sous_total_credit).'
'.$langs->trans("Balance").':'; + print price($sous_total_debit - $sous_total_credit); + print ''; + print price($sous_total_credit - $sous_total_debit); + print '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).' 
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '
'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'
'.length_accountg($line->numero_compte).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).' 
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_debit - $sous_total_credit)) . '
'.$langs->trans("AccountBalance").':'.price($total_debit).''.price($total_credit).''.price(price2num($total_debit - $total_credit)).' 
"; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index eb3229efaee..a3d4437b043 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -235,6 +235,7 @@ UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-par PaymentsNotLinkedToProduct=Payment not linked to any product / service ShowOpeningBalance=Show opening balance HideOpeningBalance=Hide opening balance +ShowSubtotalByGroup=Show subtotal by group Pcgtype=Group of account PcgtypeDesc=Group of account are used as predefined 'filter' and 'grouping' criteria for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as groups for accounting accounts of products to build the expense/income report. From 796f97c6715e16b162c9d23952c63a34d728ee8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 15:08:01 +0200 Subject: [PATCH 121/490] Support tag $capture in input of files --- htdocs/core/class/html.formfile.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 98d781a51c1..26abcf2e721 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -78,9 +78,10 @@ class FormFile * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') * @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be) * @param int $usewithoutform 0=Default, 1=Disable
and style to use in existing area + * @param int $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept. * @return int <0 if KO, >0 if OK */ - public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0) + public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0) { // phpcs:enable global $conf, $langs, $hookmanager; @@ -170,6 +171,7 @@ class FormFile $out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple'); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : ''); $out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""'); + $out .= (!empty($capture) ? ' capture="capture"' : ''); $out .= '>'; $out .= ' '; if ($sectionid) { // Show overwrite if exists for ECM module only From 501f1ba2c403f12c90c8a76810bec39540581e64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 15:45:07 +0200 Subject: [PATCH 122/490] Fix look and feel v12 --- htdocs/contrat/document.php | 1 - htdocs/core/ajax/selectsearchbox.php | 2 +- htdocs/core/lib/functions.lib.php | 9 +++++---- htdocs/main.inc.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 6 +++++- htdocs/theme/md/style.css.php | 2 ++ 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 7d47b5102ac..fd3b3f66e4a 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -179,7 +179,6 @@ if ($object->id) print '
'; print '
'; - print ''; print ''; print ''; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 2f8ad4ab5f7..31a95d1e02c 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -99,7 +99,7 @@ if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUS } if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { - $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); } if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bcf47a58eef..89e76156448 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3162,7 +3162,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', - 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', + 'object_shipment', 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'off', 'on', 'order', @@ -3209,7 +3209,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'resource'=>'laptop-house', - 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', + 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uparrow'=>'mail-forward', @@ -3273,7 +3273,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'holiday'=>'bg-infobox-holiday', 'invoice'=>'bg-infobox-commande', 'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal', - 'resource'=>'bg-infobox-action', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal', + 'resource'=>'bg-infobox-action', + 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal', 'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action', //'title_setup'=>'bg-infobox-action', 'tools'=>'bg-infobox-action', 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' @@ -3291,7 +3292,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', - 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' + 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { $facolor = $arrayconvpictotocolor[$pictowithouttext]; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6533b4bfe54..8ebd68631cb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2180,7 +2180,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ } else { if (is_array($arrayresult)) { foreach ($arrayresult as $key => $val) { - $searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft'.$key, img_picto('', $val['img'], '', false, 1, 1)); + $searchform .= printSearchForm($val['url'], $val['url'], $val['label'], 'maxwidth125', 'sall', $val['shortcut'], 'searchleft'.$key, $val['img']); } } } @@ -2453,14 +2453,14 @@ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinpu $ret .= ''; if ($showtitlebefore) $ret .= '
'.$title.'
'; $ret .= '
'; + $ret .= img_picto('', $img, '', false, 0, 0, '', 'paddingright width20'); $ret .= ''; - //$ret.=''; - $ret .= ''; $ret .= '
'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9e099c6953d..4ec62c217a5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1027,6 +1027,7 @@ table[summary="list_of_modules"] .fa-cog { /* rule for not too small screen only */ @media only screen and (min-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) { + .width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } @@ -1048,6 +1049,7 @@ table[summary="list_of_modules"] .fa-cog { .minwidth500imp { min-width: 500px !important; } } .widthauto { width: auto; } +.width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } @@ -6309,7 +6311,9 @@ div.tabsElem a.tab { div.login_block_user, div.login_block_other { clear: both; } .atoplogin, .atoplogin:hover { - color: #000 !important; + color:unset !important; + padding-left: 4px; + padding-right: 4px; } .login_block_elem { padding: 0 !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c995426edd9..71fbb6f50da 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1122,6 +1122,7 @@ table[summary="list_of_modules"] .fa-cog { /* rule for not too small screen only */ @media only screen and (min-width: px) { + .width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } @@ -1143,6 +1144,7 @@ table[summary="list_of_modules"] .fa-cog { .minwidth500imp { min-width: 500px !important; } } .widthauto { width: auto; } +.width20 { width: 20px; } .width25 { width: 25px; } .width50 { width: 50px; } .width75 { width: 75px; } From fbbb898d528e526b9ff9b8a7e47d4a027718d96b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 18:31:55 +0200 Subject: [PATCH 123/490] Better log --- scripts/cron/cron_run_jobs.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 24e92c79d0b..79d52c49445 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -227,11 +227,13 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { echo "You can also enable module Log if not yet enabled, run again and take a look into dolibarr.log file\n"; dol_syslog("cron_run_jobs.php::run_jobs Error ".$cronjob->error, LOG_ERR); $nbofjobslaunchedko++; + $resultstring = 'KO'; } else { $nbofjobslaunchedok++; + $resultstring = 'OK'; } - echo " - result of run_jobs = ".$result; + echo " - run_jobs ".$resultstring." result = ".$result; // We re-program the next execution and stores the last execution time for this job $result = $cronjob->reprogram_jobs($userlogin, $now); From c511af69fe31ec911679f93de77aeffbc541a952 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2020 21:07:49 +0200 Subject: [PATCH 124/490] Debug look and feel v12 --- htdocs/core/class/html.form.class.php | 5 ++- htdocs/core/class/html.formactions.class.php | 5 ++- htdocs/core/lib/agenda.lib.php | 44 ++++++++++--------- htdocs/core/modules/DolibarrModules.class.php | 2 +- .../class/html.formresource.class.php | 5 ++- htdocs/theme/eldy/global.inc.php | 31 +++++++++---- 6 files changed, 55 insertions(+), 37 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ee24af9f307..5fe411c6260 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7676,10 +7676,11 @@ class Form * @param int $enableonly Array list of groups id to be enabled. All other must be disabled * @param string $force_entity '0' or Ids of environment to force * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) + * @param string $morecss More css to add to html component * @return string * @see select_dolusers() */ - public function select_dolgroups($selected = '', $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $multiple = false) + public function select_dolgroups($selected = '', $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $multiple = false, $morecss = '') { // phpcs:enable global $conf, $user, $langs; @@ -7722,7 +7723,7 @@ class Form include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $out .= ajax_combobox($htmlname); - $out .= ''; $num = $this->db->num_rows($resql); $i = 0; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 352fcebb06b..8aa51a66ab7 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -339,9 +339,10 @@ class FormActions * @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value * @param int $multiselect 1=Allow multiselect of action type * @param int $nooutput 1=No output + * @param string $morecss More css to add to SELECT component. * @return string */ - public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0) + public function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = '') { // phpcs:enable global $langs, $user, $form, $conf; @@ -371,7 +372,7 @@ class FormActions } else { - $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1); + $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'.($morecss ? ' '.$morecss : ''), 1); } if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 474a4f03696..532ef091698 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -77,27 +77,29 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Type print ''; - print ''; // Assigned to print ''; - print ''; if ($conf->resource->enabled) @@ -109,9 +111,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; } } @@ -119,11 +121,11 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print ''; - print ''; } @@ -133,10 +135,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh $formproject = new FormProjets($db); print ''; - print ''; } @@ -145,9 +147,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Status print ''; - print ''; } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index c592cb69959..9543cf74442 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2314,7 +2314,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it print '
'.$this->getName().' - '.nl2br($this->getDesc()).''; + '.nl2br($this->getDesc()).''; /*print 'getVersion(1).'">'; print $this->getVersion(1); diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 3c0bb36116e..36d3fc854cc 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -74,9 +74,10 @@ class FormResource * @param string $filterkey Filter on key value * @param int $outputmode 0=HTML select string, 1=Array, 2=without form tag * @param int $limit Limit number of answers + * @param string $morecss More css * @return string HTML string with */ - public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20) + public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '') { // phpcs:enable global $conf, $user, $langs; @@ -103,7 +104,7 @@ class FormResource } // Construct $out and $outarray - $out .= ''."\n"; if ($showempty) $out .= ''."\n"; $num = 0; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4ec62c217a5..dc0c77ed67d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -670,7 +670,9 @@ body[class*="colorblind-"] .text-success{ .editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover, .editfieldlang:hover { color: var(--colortexttitle) !important; } - +.fawidth30 { + width: 20px; +} .floatnone { float: none !important; } @@ -1137,6 +1139,19 @@ table[summary="list_of_modules"] .fa-cog { .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } + + span.pictotitle { + margin-: 0 !important; + } + div.fiche>table.table-fiche-title { + margin-top: 7px !important; + margin-bottom: 15px !important; + } + + select.minwidth100imp, select.minwidth100, select.minwidth200, .widthcentpercentminusx { + width: calc(100% - 30px) !important; + display: inline-block; + } } /* Force values for small screen 570 */ @@ -1145,6 +1160,10 @@ table[summary="list_of_modules"] .fa-cog { body { font-size: ; } + + .box-flex-item { + margin: 3px 2px 3px 2px !important; + } div.refidno { font-size: !important; } @@ -1472,10 +1491,10 @@ body.onlinepaymentbody div.fiche { /* For online payment page */ margin: 20px !important; } div.fiche>table:first-child { - margin-bottom: 15px !important; + margin-bottom: 15px; } div.fiche>table.table-fiche-title { - margin-bottom: 7px !important; + margin-bottom: 7px; } div.fichecenter { width: 100%; @@ -1607,12 +1626,6 @@ td.nobordernopadding.widthpictotitle.col-picto { margin-: 8px; /* margin-bottom: 4px; */ } -@media only screen and (max-width: 767px) -{ - span.pictotitle { - margin-: 0 !important; - } -} .pictoobjectwidth { width: 14px; } From a83af075aa7867a404f5fb125515c120a042756f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 00:35:05 +0200 Subject: [PATCH 125/490] Fix responsive --- htdocs/admin/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 1a55fbc04ee..1a27d61e55d 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -67,12 +67,12 @@ if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) } } -print ''; -print $langs->trans("SetupDescription1"); +print ''; +print $langs->trans("SetupDescription1").' '; print $langs->trans("AreaForAdminOnly").' '; print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules")); -print ''; print "

"; +print '
'; print '
'; From 7300b45bcd9af35dc206830d71708853615eed60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 01:19:33 +0200 Subject: [PATCH 126/490] Responsive --- htdocs/adherents/index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 44fcb397ddc..6d069386592 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,9 +1,9 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2019 Nicolas ZABOURI * * 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 @@ -22,7 +22,7 @@ /** * \file htdocs/adherents/index.php * \ingroup member - * \brief Page accueil module adherents + * \brief Home page of membership module */ require '../main.inc.php'; @@ -339,7 +339,7 @@ if ($resql) $staticmember->ref = $staticmember->getFullName($langs); $statictype->id = $obj->typeid; $statictype->label = $obj->label; - print '
'; + print ''; print ''; print ''; print ''; @@ -399,12 +399,12 @@ if ($resql) $staticmember->name = $obj->company; } $staticmember->ref = $staticmember->getFullName($langs); - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; //print ''; - print ''; + print ''; print ''; $i++; } From 02ec28281296c16044ecd714230ad935625eb3f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 03:34:30 +0200 Subject: [PATCH 127/490] Typo --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3cf6e6044db..9ad7d2cf55a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1015,7 +1015,7 @@ LocalTax2IsUsedDescES=The IRPF rate by default when creating prospects, invoices LocalTax2IsNotUsedDescES=By default the proposed IRPF is 0. End of rule. LocalTax2IsUsedExampleES=In Spain, freelancers and independent professionals who provide services and companies who have chosen the tax system of modules. LocalTax2IsNotUsedExampleES=In Spain they are businesses not subject to tax system of modules. -RevenueStampDesc=The "tax stamp" or "revenue stamp" is a fixed tax you per invoice (It does not depend on amount of invoice). It can also be a percent tax but using the second or third type of tax is better for percent taxes as tax stamps des not provide any reporting. Only few countries uses this type of tax. +RevenueStampDesc=The "tax stamp" or "revenue stamp" is a fixed tax you per invoice (It does not depend on amount of invoice). It can also be a percent tax but using the second or third type of tax is better for percent taxes as tax stamps does not provide any reporting. Only few countries uses this type of tax. UseRevenueStamp=Use a tax stamp UseRevenueStampExample=The value of tax stamp is defined by default into the setup of dictionaries (%s - %s - %s) CalcLocaltax=Reports on local taxes From a8dcd2d09b2a933f1e5525340e4db31786aece88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 11:53:13 +0200 Subject: [PATCH 128/490] Clean code --- htdocs/core/class/conf.class.php | 2 -- htdocs/core/lib/functions.lib.php | 26 +++++++------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 0a52301e608..dee4edc3298 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -690,8 +690,6 @@ class Conf $this->global->AGENDA_DEFAULT_FILTER_TYPE = '0'; // 'AC_NON_AUTO' does not exists when AGENDA_DEFAULT_FILTER_TYPE is not on. } - if (!isset($this->global->MAIN_USE_OLD_TITLE_BUTTON)) $this->global->MAIN_USE_OLD_TITLE_BUTTON = 0; - if (!isset($this->global->MAIN_JS_GRAPH)) $this->global->MAIN_JS_GRAPH = 'chart'; // Use chart.js library if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) $this->global->MAIN_MODULE_DOLISTORE_API_SRV = 'https://www.dolistore.com'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 89e76156448..5f31b07214c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4523,15 +4523,17 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be } if ($page > 0) { - print ''; + print ''; } if ($betweenarrows) { + print ''; print $betweenarrows; + print ''; } if ($nextpage > 0) { - print ''; + print ''; } if ($afterarrows) { @@ -8623,11 +8625,8 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u } $class = 'btnTitle'; + if ($iconClass == 'fa fa-plus-circle') $class .= ' btnTitlePlus'; - // hidden conf keep during button transition TODO: remove this block - if (!empty($conf->global->MAIN_USE_OLD_TITLE_BUTTON)) { - $class = 'butActionNew'; - } if (!empty($params['morecss'])) $class .= ' '.$params['morecss']; $attr = array( @@ -8642,11 +8641,6 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u if ($status <= 0) { $attr['class'] .= ' refused'; - // hidden conf keep during button transition TODO: remove this block - if (!empty($conf->global->MAIN_USE_OLD_TITLE_BUTTON)) { - $attr['class'] = 'butActionNewRefused'; - } - $attr['href'] = ''; if ($status == -1) { // disable @@ -8698,18 +8692,12 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $tag = (empty($attr['href']) ? 'span' : 'a'); - $button = '<'.$tag.' '.$compiledAttributes.' >'; + $button = ''; + $button .= '<'.$tag.' '.$compiledAttributes.' >'; $button .= ''; $button .= ''.$label.''; $button .= ''; - // hidden conf keep during button transition TODO: remove this block - if (!empty($conf->global->MAIN_USE_OLD_TITLE_BUTTON)) { - $button = '<'.$tag.' '.$compiledAttributes.' >'.$label.''; - $button .= ''; - $button .= ''; - } - return $button; } From a2bc46f1c012346c5c0ee5f006c5bd59ccd988ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 12:50:24 +0200 Subject: [PATCH 129/490] CSS --- htdocs/core/ajax/ajaxdirtree.php | 4 ++-- htdocs/core/lib/agenda.lib.php | 6 +++--- htdocs/resource/class/html.formresource.class.php | 5 +++-- htdocs/theme/eldy/global.inc.php | 12 +++++++++--- htdocs/theme/eldy/info-box.inc.php | 11 +++++------ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 04687b77829..3e54532668a 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -428,11 +428,11 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : ' '; print ''; print ''; // Edit link - print ''; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 532ef091698..5d450aa4b04 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -109,9 +109,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Resource print ''; - print ''; @@ -158,7 +158,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { // Filter on hours print ''; - print ''; + print ''; print "'; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8f2e0973ab3..44fb0865682 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5387,11 +5387,11 @@ class Product extends CommonObject $label_type = 'short_label'; } - $sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; + $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit; $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); - $label = $res[$label_type]; + $label = $label_type == 'short' ? $res[$label_type] : $langs->trans('unit' . $res['code']); $this->db->free($resql); return $label; } From 64d2f906bc7cdf2c4bbcb733ca4668ce7eae868e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 11 May 2020 16:35:58 +0200 Subject: [PATCH 131/490] fix visibility of extrafields in public interface --- htdocs/public/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 1a18954994f..a7f9b49fd58 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -235,7 +235,7 @@ if ($action == "view_ticketlist") if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { - $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => $extrafields->attributes[$object->table_element]['list'][$key], 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $extrafields->attributes[$object->table_element]['perms'][$key]); + $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' =>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3) && $extrafields->attributes[$object->table_element]['perms'][$key]); } } } From 097de7b3cd934e67a00cb0a9c82bc02e6c47d838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 11 May 2020 18:34:54 +0200 Subject: [PATCH 132/490] Only add empty select if no multiselect --- htdocs/core/class/html.formactions.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 8aa51a66ab7..398e2b8a235 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -353,10 +353,13 @@ class FormActions require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $caction = new CActionComm($this->db); - // Suggest a list with manual events or all auto events - $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); - array_unshift($arraylist, ' '); // Add empty line at start - //asort($arraylist); + // Suggest a list with manual events or all auto events + $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot); + if (empty($multiselect)) { + // Add empty line at start only if no multiselect + array_unshift($arraylist, ' '); + } + //asort($arraylist); if ($selected == 'manual') $selected = 'AC_OTH'; if ($selected == 'auto') $selected = 'AC_OTH_AUTO'; From 3a46d5a3dddaf7b581f11867cbbd4ee1cd74d9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 11 May 2020 18:46:54 +0200 Subject: [PATCH 133/490] Update agenda_other.php --- htdocs/admin/agenda_other.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 10bfa13d1ce..c5b196146d5 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -81,8 +81,10 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) } if ($action == 'set') { + $getDefaultFilter = GETPOST('AGENDA_DEFAULT_FILTER_TYPE'); + $defaultfilter = (is_array($getDefaultFilter)) ? implode(',', $getDefaultFilter) : $getDefaultFilter; dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); } @@ -377,7 +379,12 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS From 44d36815bd88eff1960f560de635a37f1cfcbfc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 19:00:27 +0200 Subject: [PATCH 134/490] Look and feel v12 --- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/list.php | 2 +- htdocs/core/lib/functions.lib.php | 10 ++++++---- htdocs/core/modules/modCollab.class.php | 2 +- htdocs/core/modules/modWebsite.class.php | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 68a6b8db331..e3cb5a9ad97 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -742,7 +742,7 @@ if ($action == 'create') // Print mail form - print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'generic'); + print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email'); dol_fiche_head(); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 8feaa5a4d93..8119224bbfa 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -188,7 +188,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_email', 0, $newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f31b07214c..20094da216c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3158,13 +3158,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice', - 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', + 'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', 'object_shipment', 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', - 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', + 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'off', 'on', 'order', 'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', @@ -3213,7 +3213,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uparrow'=>'mail-forward', - 'jabber'=>'comment-o' + 'jabber'=>'comment-o', + 'website'=>'globe-americas' ); if ($pictowithouttext == 'off') { $fakey = 'fa-square'; @@ -3292,7 +3293,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', - 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' + 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa', + 'website'=>'#304' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { $facolor = $arrayconvpictotocolor[$pictowithouttext]; diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php index 5190c8c4d72..345a292cb92 100644 --- a/htdocs/core/modules/modCollab.class.php +++ b/htdocs/core/modules/modCollab.class.php @@ -55,7 +55,7 @@ class modCollab extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. - $this->picto = 'globe'; + $this->picto = 'website'; // Data directories to create when module is enabled $this->dirs = array("/collab/temp"); diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index 3e3b4bae374..60cc93b5d39 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -55,7 +55,7 @@ class modWebsite extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. - $this->picto = 'globe'; + $this->picto = 'website'; // Data directories to create when module is enabled $this->dirs = array("/website/temp"); From c4a7923b51a449a86f1fedc50cef32c9feb745ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 May 2020 19:02:52 +0200 Subject: [PATCH 135/490] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8a21844ca7c..b6884b164a1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -880,7 +880,7 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } -.divintdwithtwolinesmax { +.divintowithtwolinesmax { width: 75px; display: -webkit-box; -webkit-box-orient: vertical; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 71fbb6f50da..40e8c5e27b4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -983,7 +983,7 @@ select.flat.selectlimit { max-width: 0; overflow: auto; } -.divintdwithtwolinesmax { +.divintodwithtwolinesmax { width: 75px; display: -webkit-box; -webkit-box-orient: vertical; From 4d50ba5e370a57c7168e6f4cd2dd4f336fe3d361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 11 May 2020 20:42:47 +0200 Subject: [PATCH 136/490] Fix dolistore search with csrf active --- htdocs/admin/dolistore/ajax/image.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index c1bb4e997dc..6349c7461b5 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -1,6 +1,7 @@ . * Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2020 Frédéric France * * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); * it under the terms of the GNU General Public License as published bypliance with the License. @@ -17,6 +18,9 @@ */ if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); +} /** From 75cd7d7e723103fa0edadcb8860a77e908f7e6bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:04:48 +0200 Subject: [PATCH 137/490] Code comment --- htdocs/core/class/commonobjectline.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 5a09dbfed29..f04e2da11ee 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -54,8 +54,8 @@ abstract class CommonObjectLine extends CommonObject * Returns the translation key from units dictionary. * A langs->trans() must be called on result to get translated value. * - * @param string $type Label type (long or short) - * @return string|int <0 if ko, label if ok + * @param string $type Label type (long or short). This can be a translation key. + * @return string|int <0 if ko, label if ok */ public function getLabelOfUnit($type = 'long') { From d459f9902c7bbc601cf4eda76a4803d65bc3f194 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:06:30 +0200 Subject: [PATCH 138/490] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d58e5f8f742..87e86e8e0bc 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2099,7 +2099,7 @@ else print ''; } From a0998583852dd9ff3a946703210be6aaed326399 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:07:23 +0200 Subject: [PATCH 139/490] Update product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 44fb0865682..2a56131bdd5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5391,7 +5391,7 @@ class Product extends CommonObject $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); - $label = $label_type == 'short' ? $res[$label_type] : $langs->trans('unit' . $res['code']); + $label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']); $this->db->free($resql); return $label; } From 92d137cde90c6e2ad9c0ac42f46157badf624708 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:09:04 +0200 Subject: [PATCH 140/490] Update list.php --- htdocs/product/stock/list.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index c13243fc9cb..74c2c21cadf 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -549,12 +549,15 @@ if ($num) { print ''; if ($key == 'statut') print $warehouse->getLibStatut(5); - if ($key == 'phone') - { + if ($key == 'phone') { print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL'); } - elseif ($key == 'fax') print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); - else print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); + elseif ($key == 'fax') { + print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); + } + else { + print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); + } print ''; if (!$i) $totalarray['nbfield']++; if (!empty($val['isameasure'])) From 6706d28eb7f166754cedbb64c106a1fd3c62cff3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:15:19 +0200 Subject: [PATCH 141/490] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e97ed8dbc54..7669378aff4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1272,7 +1272,7 @@ RuleForGeneratedPasswords=Rules to generate and validate passwords DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page UsersSetup=Users module setup UserMailRequired=Email required to create a new user -UserHideInactive=Hide inactive users +UserHideInactive=Hide inactive users from all combo lists of users (this may means you won't be able to filter on old users) UsersDocModules=Document templates for documents generated from user record GroupsDocModules=Document templates for documents generated from a group record ##### HRM setup ##### From 3c8452aa3131eb6391ea21edf1a4315370f02d85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:17:55 +0200 Subject: [PATCH 142/490] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7669378aff4..c9be1ca2f41 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1272,7 +1272,7 @@ RuleForGeneratedPasswords=Rules to generate and validate passwords DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page UsersSetup=Users module setup UserMailRequired=Email required to create a new user -UserHideInactive=Hide inactive users from all combo lists of users (this may means you won't be able to filter on old users) +UserHideInactive=Hide inactive users from all combo lists of users (Not recommended: this may means you won't be able to filter or search on old users on some pages) UsersDocModules=Document templates for documents generated from user record GroupsDocModules=Document templates for documents generated from a group record ##### HRM setup ##### From e4611f29502f5e311e45e6f2eefc23aeab796b45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 03:36:33 +0200 Subject: [PATCH 143/490] Fix filter on categories --- htdocs/compta/facture/stats/index.php | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 8606e619740..284186b73ce 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -262,33 +262,33 @@ if ($mode == 'customer') $filter = 's.client in (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); print ''; -if(! empty($conf->category->enabled) && $mode == 'customer') { - // Customer Category - print ''; -} + // ThirdParty Type print ''; + // Category -if ($mode == 'customer') -{ - $cat_type = Categorie::TYPE_CUSTOMER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +if (! empty($conf->category->enabled)) { + if ($mode == 'customer') + { + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); + } + if ($mode == 'supplier') + { + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); + } + print ''; } -if ($mode == 'supplier') -{ - $cat_type = Categorie::TYPE_SUPPLIER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); -} -print ''; + // User print ''; + print ''; print ''; print ''; print ''; print "\n"; - print "\n"; print ''; } From d9e26b8569404f2a47329c9a8ff26d5c0cd4af27 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 12 May 2020 08:38:03 +0200 Subject: [PATCH 145/490] fix template email on prpal list --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index eaeea9e3d43..522e8f5eaa3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -468,7 +468,7 @@ if ($resql) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit); $topicmail = "SendPropalRef"; - $modelmail = "proposal_send"; + $modelmail = "propal_send"; $objecttmp = new Propal($db); $trackid = 'pro'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; From 66beb7c14f9b88bb2aa1388f3f3a1356f80e460a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 12 May 2020 10:17:47 +0200 Subject: [PATCH 146/490] FIX: Do not show stats panel if the user does not have permissions --- htdocs/comm/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fcd3823b0c2..82e331eb623 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2020 Juanjo Menent * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015-2019 Frédéric France * Copyright (C) 2015 Marcos García @@ -581,7 +581,7 @@ if ($object->id > 0) $boxstat .= '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
'; + print ''; print $langs->trans("Type"); - print ''; + print ''; $multiselect = 0; if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" { $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); } - print ''; - print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect); + print ''; + print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500'); print '
'; + print ''; print $langs->trans("ActionsToDoBy").'   '; - print ''; - print img_picto('', 'user'); - print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print ''; + print img_picto('', 'user', 'class="fawidth30 inline-block"'); + print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500'); if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or").' '.$langs->trans("ToUserOfGroup").'   '; - print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit); + else print '
'; + print img_picto('', 'object_group', 'class="fawidth30 inline-block"'); + print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); print '
'; print $langs->trans("Resource"); - print ''; - print img_picto('', 'object_resource'); - print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2); + print ''; + print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); + print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); print '
'; + print ''; print $langs->trans("ThirdParty").'   '; - print ''; - print img_picto('', 'company'); - print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0); + print ''; + print img_picto('', 'company', 'class="fawidth30 inline-block"'); + print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500'); print '
'; + print ''; print $langs->trans("Project").'   '; - print ''; - print img_picto('', 'project'); + print ''; + print img_picto('', 'project', 'class="fawidth30 inline-block"'); print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); print '
'; + print ''; print $langs->trans("Status"); - print '  '; + print '  '; $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); print '
'.$staticmember->getNomUrl(1, 32).''.$staticmember->getNomUrl(1, 32).''.$statictype->getNomUrl(1, 32).''.dol_print_date($db->jdate($obj->datem), 'dayhour').''.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).''.$subscriptionstatic->getNomUrl(1).''.$staticmember->getNomUrl(1, 32, 'subscription').''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''.$subscriptionstatic->getNomUrl(1).''.$staticmember->getNomUrl(1, 32, 'subscription').''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''.price($obj->subscription).''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').''.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').'
'; - if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) print '+'.$nboffilesinsubdir.' '; + if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) print '+'.$nboffilesinsubdir.' '; print ''.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').'
'; + print ''; print $langs->trans("Resource"); - print ''; + print ''; print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); print '
'.$langs->trans("VisibleTimeRange").''.$langs->trans("VisibleTimeRange").'"; print '
'; print ''; diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 36d3fc854cc..4836ed1a0f1 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -101,10 +101,12 @@ class FormResource { //$minLength = (is_numeric($conf->global->RESOURCE_USE_SEARCH_TO_SELECT)?$conf->global->RESOURCE_USE_SEARCH_TO_SELECT:2); $out .= ajax_combobox($htmlname, $event, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT); + } else { + $out .= ajax_combobox($htmlname); } // Construct $out and $outarray - $out .= ''."\n"; if ($showempty) $out .= ''."\n"; $num = 0; @@ -137,7 +139,6 @@ class FormResource } } $out .= ''."\n"; - $out .= ajax_combobox($htmlname); if ($outputmode != 2) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index dc0c77ed67d..8a21844ca7c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1899,8 +1899,8 @@ div.tmenuleft } div.tmenucenter { - padding-left: 0px; - padding-right: 3px; + padding-left: 2px; + padding-right: 2px; padding-top: 8px; height: 26px; @@ -3600,6 +3600,12 @@ ul.noborder li:nth-child(even):not(.liste_titre) { @media only screen and (max-width: 767px) { + a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { + padding: 0px 0px 0px 0px; + } + a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { + padding: 0px 0px 0px 0px; + } .boxstats, .boxstats130 { margin: 3px; } @@ -4882,7 +4888,7 @@ ul.ecmjqft li { ul.ecmjqft a { line-height: 24px; vertical-align: middle; - color: #333; + color: unset; padding: 0px 0px; font-weight:normal; display: inline-block !important; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 7f62fe39689..3138cd8bfd9 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -15,10 +15,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> display: block; position: relative; min-height: 90px; - background: #fff; + /* background: #fff; */ width: 100%; - box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1); - border-radius: 2px; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + border-radius: 2px; + border: 1px solid #eee; margin-bottom: 15px; } .info-box.info-box-sm{ @@ -67,7 +68,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> text-align: center; font-size: 45px; line-height: 90px; - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.08) !important } .info-box-sm .info-box-icon { height: 80px; @@ -203,8 +204,6 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES .info-box-icon { color: #fff !important; - - background-color: #eee !important; opacity: 0.95; } From 65011c28771601aab882785dd0b1621a6c1f994d Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Mon, 11 May 2020 15:11:23 +0200 Subject: [PATCH 130/490] Fixed the product unit translation --- htdocs/product/card.php | 2 +- htdocs/product/class/product.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 87e86e8e0bc..d58e5f8f742 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2099,7 +2099,7 @@ else print '
'.$langs->trans('DefaultUnitToShow').''; if ($unit !== '') { - print $langs->trans($unit); + print $unit; } print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").' '."\n"; -$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1); +$multiselect = 0; +if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { + // We use an option here because it adds bugs when used on agenda page "peruser" and "list" + $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); +} +$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1, $multiselect); print '
'.$langs->trans('DefaultUnitToShow').''; if ($unit !== '') { - print $unit; + print $langs->trans($unit); } print '
'.$langs->trans("CustomersProspectsCategoriesShort").''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); - print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); - print '
'.$langs->trans("ThirdPartyType").''; $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$cat_label.''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); + //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); + print '
'.$cat_label.''; -print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); -print '
'.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); From 0dccc9cbeb734ebdba69ed29354ec42fc7d3677f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 12 May 2020 07:27:20 +0200 Subject: [PATCH 144/490] Debug colspan --- htdocs/accountancy/bookkeeping/balance.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 7b99057f73a..85562ebc268 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -302,12 +302,11 @@ if ($action != 'export_csv') if (empty($displayed_account) || $root_account_description != $displayed_account) { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print '
' . $langs->trans("SubTotal") . ':
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
'; $boxstat .= ''; - // Delivery date planed - print ""; + // Date delivery planned + print ''; + print '\n"; + print ''; // terms of the settlement print ''; - // Date delivery planned - print ''; - print '\n"; - print ''; + // Date delivery planned + print ''; + print '\n"; + print ''; // terms of the settlement print ''; - // Date delivery planned - print ''; - print '\n"; - print ''; + // Date delivery planned + print ''; + print '\n"; + print ''; // terms of the settlement print ''; - // Date delivery planned - print ''; - print '\n"; - print ''; + // Date delivery planned + print ''; + print '\n"; + print ''; // terms of the settlement print ''; print ''; print ''; if (!$i) $totalarray['nbfield']++; } From 8bd1179b8207671f4d33d8f6d156c453b7bf8239 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Tue, 12 May 2020 17:03:24 +0200 Subject: [PATCH 161/490] Update qr.php --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index 99f7fced1d0..3f27464f5ca 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -33,4 +33,4 @@ $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', t $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $module = new modTcpdfbarcode($db); -$result = $module->buildBarCode($urlwithroot."/takepos/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); +$result = $module->buildBarCode($urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($key), 'QRCODE', 'Y'); From fc2f2c6da71b6c4f7f0b16216f0fba320b52ba1d Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 12 May 2020 17:41:21 +0200 Subject: [PATCH 162/490] FIX : wrong url param --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9fa696c69b3..cb3aa9cd099 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4837,7 +4837,7 @@ elseif ($id > 0 || ! empty($ref)) { if (! $objectidnext) { - print ''; + print ''; } } From 366ae2f116cfaaed73e07a4b06d0a596ded92582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 May 2020 18:44:26 +0200 Subject: [PATCH 163/490] Update dolistore.class.php --- .../admin/dolistore/class/dolistore.class.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 230c588f7e4..a229f3c985d 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -248,11 +248,8 @@ class Dolistore // phpcs:enable global $langs, $conf; $html = ""; - $parity = "pair"; $last_month = time() - (30 * 24 * 60 * 60); foreach ($this->products as $product) { - $parity = ($parity == "impair") ? 'pair' : 'impair'; - // check new product ? $newapp = ''; if ($last_month < strtotime($product->date_add)) { @@ -267,7 +264,7 @@ class Dolistore // add image or default ? if ($product->id_default_image != '') { $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image; - $images = ''; + $images = ''; $images .= ''; } else { $images = ''; @@ -306,16 +303,16 @@ class Dolistore //.'
'.$langs->trans("SeeInMarkerPlace").' //output template - $html .= '
+ $html .= ' - - - - '; + '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

'.$product->description_short->language[$this->lang - 1].''; + // do not load if display none + //$html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; } return $html; } From 410694100d911de889d06f59f43756e6df849b4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 23:42:01 +0200 Subject: [PATCH 164/490] CSS --- htdocs/theme/eldy/global.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 68e16afecd0..ef39d38a568 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1707,6 +1707,7 @@ div.statusref { margin-top: 8px; margin-bottom: 10px; clear: both; + text-align: right; } div.statusref img { padding-left: 8px; From 63d6b3c47d5629082628cfd08d1a15ad13309149 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 23:44:50 +0200 Subject: [PATCH 165/490] Look and feel v12 --- htdocs/contrat/card.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 25857767e80..9f825cdf009 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1452,7 +1452,7 @@ else print '
'; - if (!empty($conf->propal->enabled)) + if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { // Box proposals $tmp = $object->getOutstandingProposals(); @@ -599,7 +599,7 @@ if ($object->id > 0) if ($link) $boxstat .= ''; } - if (!empty($conf->commande->enabled)) + if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { // Box commandes $tmp = $object->getOutstandingOrders(); @@ -617,7 +617,7 @@ if ($object->id > 0) if ($link) $boxstat .= ''; } - if (!empty($conf->facture->enabled)) + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { // Box factures $tmp = $object->getOutstandingBills(); From e1db0ef855173bffda16735f7c4a836c8de68a50 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 10:57:51 +0200 Subject: [PATCH 147/490] Update index.php --- htdocs/comm/mailing/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 61187f2e647..6b765d9451f 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -157,6 +157,7 @@ print '
'; $limit = 10; $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; +$sql .= " WHERE m.entity = ".$conf->entity; $sql .= " ORDER BY m.date_creat DESC"; $sql .= " LIMIT ".$limit; $result = $db->query($sql); From c6e7b2e6a3281f14bd4b325b5cf4835e4108c487 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 13:39:02 +0200 Subject: [PATCH 148/490] Fix date shipment from order better for pickup collection with date and hour from order --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 8a68e763160..95c6658c306 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -285,3 +285,5 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; + +ALTER TABLE llx_commande MODIFY COLUMN date_livraison DATETIME; From 014c013f834b5a90d5b8dddfc6f0af6fed6103f9 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 13:40:31 +0200 Subject: [PATCH 149/490] Update card.php --- htdocs/commande/card.php | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4764b53a5c9..a24e62cde97 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -557,14 +557,17 @@ if (empty($reshook)) } } - elseif ($action == 'setdate_livraison' && $usercancreate) { - // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; - $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + elseif ($action == 'setdate_livraison' && $usercancreate) + { + //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; + $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); - $result = $object->set_date_livraison($user, $datelivraison); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->fetch($id); + $result = $object->set_date_livraison($user, $datedelivery); + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } } elseif ($action == 'setmode' && $usercancreate) { @@ -1681,15 +1684,14 @@ if ($action == 'create' && $usercancreate) print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print '
".$langs->trans("DateDeliveryPlanned").''; - if (empty($datedelivery)) - { - if (!empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - else $datedelivery = empty($conf->global->MAIN_AUTOFILL_DATE_DELIVERY) ?-1 : ''; - } - print $form->selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1); - print "
'.$langs->trans("DateDeliveryPlanned").''; + //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. + $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); + print "
'.$langs->trans('PaymentConditionsShort').''; @@ -2209,11 +2211,11 @@ if ($action == 'create' && $usercancreate) print ''; print ''; print ''; - print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison"); + print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print ''; } else { - print $object->date_livraison ? dol_print_date($object->date_livraison, 'daytext') : ' '; + print $object->date_livraison ? dol_print_date($object->date_livraison, 'dayhour') : ' '; if ($object->hasDelay() && !empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } From 9e49e02efb3f06e515640a84c62ec7b5f022c265 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 12 May 2020 11:42:18 +0000 Subject: [PATCH 150/490] Fixing style errors. --- htdocs/commande/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a24e62cde97..f382ac85f8e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1684,14 +1684,14 @@ if ($action == 'create' && $usercancreate) print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print '
'.$langs->trans("DateDeliveryPlanned").''; - //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. - $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST - print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); - print "
'.$langs->trans("DateDeliveryPlanned").''; + //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. + $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); + print "
'.$langs->trans('PaymentConditionsShort').''; From e1ff1bf865ac2dc2d440569050f4acacfea1dbad Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 13:42:43 +0200 Subject: [PATCH 151/490] Update card.php --- htdocs/commande/card.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f382ac85f8e..800193bc61e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1684,14 +1684,14 @@ if ($action == 'create' && $usercancreate) print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print '
'.$langs->trans("DateDeliveryPlanned").''; - //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. - $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST - print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); - print "
'.$langs->trans("DateDeliveryPlanned").''; + //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. + $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); + print "
'.$langs->trans('PaymentConditionsShort').''; @@ -2211,7 +2211,7 @@ if ($action == 'create' && $usercancreate) print '
'; print ''; print ''; - print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); + print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print '
'; } else { From 83ec39f55a1ed189b15b12eb4032dc3d17edb9fc Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 12 May 2020 11:44:12 +0000 Subject: [PATCH 152/490] Fixing style errors. --- htdocs/commande/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 800193bc61e..54661297939 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1684,14 +1684,14 @@ if ($action == 'create' && $usercancreate) print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print '
'.$langs->trans("DateDeliveryPlanned").''; - //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. - $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST - print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); - print "
'.$langs->trans("DateDeliveryPlanned").''; + //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. + $date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST + print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); + print "
'.$langs->trans('PaymentConditionsShort').''; From 447c61cc15bcdc517db0554609424a2984493d12 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 13:49:55 +0200 Subject: [PATCH 153/490] Update shipment.php --- htdocs/expedition/shipment.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 75ee2ef4da3..a40d29d1d78 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -103,16 +103,17 @@ if (empty($reshook)) } if ($action == 'setdatedelivery' && $user->rights->commande->creer) - { - //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; - $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + { + //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; + $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); - $object = new Commande($db); - $object->fetch($id); - $result = $object->set_date_livraison($user, $datelivraison); - if ($result < 0) - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->fetch($id); + $result = $object->set_date_livraison($user, $datedelivery); + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } /* if ($action == 'setdeliveryaddress' && $user->rights->commande->creer) { @@ -373,13 +374,13 @@ if ($id > 0 || !empty($ref)) print '
'; print ''; print ''; - print $form->selectDate($object->date_livraison > 0 ? $object->date_livraison : -1, 'liv_', '', '', '', "setdatedelivery"); + print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print '
'; } else { - print dol_print_date($object->date_livraison, 'daytext'); + print dol_print_date($object->date_livraison, 'dayhour'); if ($object->hasDelay() && !empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } From c89e8efec354070f055504c64c11e49fe1827320 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 14:08:28 +0200 Subject: [PATCH 154/490] responsive --- htdocs/takepos/css/pos.css.php | 3 +++ htdocs/takepos/index.php | 9 +++++++-- htdocs/takepos/invoice.php | 2 +- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 5f0006d24fe..6871fcbd68b 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -591,6 +591,9 @@ div#moreinfo, div#infowarehouse { height: calc(45% - 100px); } + div#moreinfo, div#infowarehouse { + padding: 0 5px 0 5px; + } div.div1 { padding-bottom: 0; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 0688d4a8584..8da96df54d0 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -756,8 +756,13 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
-
- trans("Terminal")." "; +
+ + + + trans("Terminal"); ?> + + - '.dol_print_date(dol_now(), "day").''; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index b1641072829..9f0e6649cf6 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -747,7 +747,7 @@ $( document ).ready(function() { $("#customerandsales").html(''); - $("#customerandsales").append(''); + $("#customerandsales").append(''); global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 40e8c5e27b4..c7ce5709efd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1119,6 +1119,7 @@ table[summary="list_of_modules"] .fa-cog { .clearboth { clear:both; } .hideobject { display: none; } .minwidth50 { min-width: 50px; } +.minwidth75 { min-width: 75px; } /* rule for not too small screen only */ @media only screen and (min-width: px) { From 39f228b98a92140d58d82c3be1220742728e4958 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 14:10:43 +0200 Subject: [PATCH 155/490] Update list.php --- htdocs/expedition/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 999bde3fb32..ada701750a0 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -699,7 +699,7 @@ if ($resql) if (!empty($arrayfields['e.date_delivery']['checked'])) { print '
'; - print dol_print_date($db->jdate($obj->date_livraison), "day"); + print dol_print_date($db->jdate($obj->date_livraison), "dayhour"); /*$now = time(); if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 ) { From e9c405182d07497ed177b60377f44c5f225ff30a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 14:18:31 +0200 Subject: [PATCH 156/490] css --- htdocs/theme/eldy/main_menu_fa_icons.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index 5b9395fbc04..c344838458d 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -8,7 +8,7 @@ font-style: normal; font-variant: normal; text-rendering: auto; - line-height: 26px; + line-height: 23px; font-size: ; -webkit-font-smoothing: antialiased; text-align:center; From a6708009d790003f14320cfbcdadc972661d494e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 May 2020 14:53:03 +0200 Subject: [PATCH 157/490] Add option PROJECT_OPEN_ALWAYS_ON_TAB --- htdocs/projet/class/project.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1ee17511304..554bc84766a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1044,6 +1044,9 @@ class Project extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; + if (! empty($conf->global->PROJECT_OPEN_ALWAYS_ON_TAB)) { + $option = $conf->global->PROJECT_OPEN_ALWAYS_ON_TAB; + } $label = ''; if ($option != 'nolink') $label = ''.$langs->trans("Project").''; @@ -1073,6 +1076,10 @@ class Project extends CommonObject { $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id; } + elseif ($option == 'preview') + { + $url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id; + } else { $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; From ce9b841d9f1e026f0aaa0d94890bd40c5283d4b1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 15:33:25 +0200 Subject: [PATCH 158/490] Update shipment.php --- htdocs/expedition/shipment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index a40d29d1d78..3adb1820d27 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -353,7 +353,7 @@ if ($id > 0 || !empty($ref)) // Date print '
'.$langs->trans('Date').''; - print dol_print_date($object->date, 'daytext'); + print dol_print_date($object->date, 'dayhour'); if ($object->hasDelay() && empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } From f837bf043a4c642a8df8b894519b1e0960f94043 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 15:34:48 +0200 Subject: [PATCH 159/490] Update shipment.php --- htdocs/expedition/shipment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 3adb1820d27..99cf77ce1f3 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -353,7 +353,7 @@ if ($id > 0 || !empty($ref)) // Date print '
'.$langs->trans('Date').''; - print dol_print_date($object->date, 'dayhour'); + print dol_print_date($object->date, 'day'); if ($object->hasDelay() && empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } From 70ea77ce8f547eb775fa63e7d68e17e2262aff39 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 15:37:37 +0200 Subject: [PATCH 160/490] Update list.php --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 3b83e04fe3c..8b7000d8f23 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1147,7 +1147,7 @@ if ($resql) if (!empty($arrayfields['c.date_delivery']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->date_delivery), 'day'); + print dol_print_date($db->jdate($obj->date_delivery), 'dayhour'); print '
'.$newapp.$images.'

'.$product->name->language[$this->lang - 1] .'
'.$version.'

- '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

'.$product->description_short->language[$this->lang - 1].'
'.$price.' - '.$download_link.'
'.$price.''.$download_link.'
'; - // Ligne info remises tiers + // Line info of thirdparty discounts print ''; } print ''; print ''; From b5f3be4599f9f56c30c63297643c88da8d75e956 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:29:46 +0200 Subject: [PATCH 166/490] Clean phpcs rule file --- dev/setup/codesniffer/ruleset.xml | 77 +++++++++---------- htdocs/compta/bank/class/account.class.php | 3 +- htdocs/product/stats/commande_fournisseur.php | 4 +- htdocs/webservices/server_actioncomm.php | 6 +- 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index ad26c7f0bdc..41526340daf 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -272,12 +272,7 @@ - - - - - - + 0 @@ -310,20 +305,21 @@ - - + 0 - + 0 + - 0 + 0 - + + 0 @@ -332,27 +328,25 @@ - + 0 - + + 0 - - 0 - + + + - 0 + 0 - - 0 - - - 0 - + + + @@ -361,26 +355,26 @@ 0 + - 0 + 0 - + 0 + - - 0 - + 0 0 - + 0 @@ -391,16 +385,16 @@ + + 0 + - - - - + 0 @@ -411,7 +405,6 @@ 0 - 0 @@ -421,15 +414,21 @@ - - - - - + + + + + + + + + + + diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 58115537b1f..3fcbffba3b2 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1672,8 +1672,7 @@ class Account extends CommonObject //Replace the old AccountNumber key with the new BankAccountNumber key $fieldlists = explode( ' ', - preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', - $conf->global->BANK_SHOW_ORDER_OPTION) + preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', $conf->global->BANK_SHOW_ORDER_OPTION) ); } } diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 61024cdd7ff..c111e075972 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -44,9 +44,7 @@ if (!empty($user->socid)) $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array( - 'productstatssupplyorder' -)); +$hookmanager->initHooks(array('productstatssupplyorder')); $mesg = ''; diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index bc3d4a78c6a..39ed3b3cdf5 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -153,8 +153,8 @@ $server->wsdl->addComplexType( 'sequence', '', array( - 'code' => array('name'=>'code', 'type'=>'xsd:string'), - 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') + 'code' => array('name'=>'code', 'type'=>'xsd:string'), + 'libelle' => array('name'=>'libelle', 'type'=>'xsd:string') ) ); @@ -164,7 +164,7 @@ $server->wsdl->addComplexType( 'array', 'sequence', '', - array( + array( 'actioncommtype' => array( 'name' => 'actioncommtype', 'type' => 'tns:actioncommtype', From 22301d63d8fedaa2607167232b4ac4df76cd9593 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:35:10 +0200 Subject: [PATCH 167/490] Replace a ZEND phpcs rule with a PSR2 rule --- dev/setup/codesniffer/ruleset.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 41526340daf..e726df6db7c 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -424,11 +424,7 @@ - - - - - + From f0d14662b996b082c701db2318157f9f86d7c957 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:38:12 +0200 Subject: [PATCH 168/490] Fix scrutinizer --- htdocs/takepos/genimg/qr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/qr.php b/htdocs/takepos/genimg/qr.php index c73e874a465..c4d60a52c1b 100644 --- a/htdocs/takepos/genimg/qr.php +++ b/htdocs/takepos/genimg/qr.php @@ -29,5 +29,5 @@ require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php'; $key = GETPOST('key'); -$module = new modTcpdfbarcode($db); +$module = new modTcpdfbarcode(); $result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y'); From ebbd4413f5985def5e726d974c761e193473d442 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 00:47:27 +0200 Subject: [PATCH 169/490] Fix scrutinizer error --- htdocs/accountancy/admin/account.php | 2 +- .../class/accountingaccount.class.php | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 86981e5b5de..cf00519e9d7 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -161,7 +161,7 @@ if (empty($reshook)) if ($action == 'disable') { if ($accounting->fetch($id)) { $mode = GETPOST('mode', 'int'); - $result = $accounting->account_desactivate($id, $mode); + $result = $accounting->accountDeactivate($id, $mode); } $action = 'update'; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index a32918cc5bf..bcd17793db1 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -553,24 +553,19 @@ class AccountingAccount extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Account deactivated + * Deactivate an account (for status active or status reconcilable) * * @param int $id Id - * @param int $mode 0=field active, 1=field active_customer_list, 2=field_active_supplier_list + * @param int $mode 0=field active, 1=field reconcilable * @return int <0 if KO, >0 if OK */ - public function account_desactivate($id, $mode = 0) + public function accountDeactivate($id, $mode = 0) { - // phpcs:enable $result = $this->checkUsage(); - if ($mode == 0) - { - $fieldtouse = 'active'; - } - elseif ($mode == 1) + $fieldtouse = 'active'; + if ($mode == 1) { $fieldtouse = 'reconcilable'; } @@ -582,7 +577,7 @@ class AccountingAccount extends CommonObject $sql .= "SET ".$fieldtouse." = '0'"; $sql .= " WHERE rowid = ".$this->db->escape($id); - dol_syslog(get_class($this)."::account_desactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { From 0850570e951e98b1b50de544844f9a19e669a97a Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Tue, 12 May 2020 13:15:49 +0200 Subject: [PATCH 170/490] Fix and imporve some points for compta/accounting-flles.php * Fix zip generation for accouning-files if line has no document. The zip file generated if $filesarray contain a line with empty 'files' was unsustainable because it try to add empty files. * Add clickable link to jump on card for other line than Invoice and Supplier Invoice * Add various payment * Use label as ref for paiements of salaries line to display more explicit line --- htdocs/compta/accounting-files.php | 64 +++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 471637461f6..9c26cc0999c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -37,8 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; -$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips")); +$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); @@ -176,7 +178,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Paiements of salaries if (GETPOST('selectpaymentsofsalaries')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -191,6 +193,14 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } + // Various payments + if (GETPOST('selectvariouspayment')) { + if (!empty($sql)) $sql .= " UNION ALL"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datec as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; + $sql .= " WHERE datec between ".$wheretail; + $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; + } if ($sql) { $sql .= $db->order($sortfield, $sortorder); @@ -254,6 +264,12 @@ if (($action == 'searchfiles' || $action == 'dl')) { $upload_dir = $conf->tax->dir_output.'/'.$subdir; $link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F'; break; + case "VariousPayment": + $subdir = ''; + $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); + $upload_dir = $conf->bank->dir_output.'/'.$subdir; + $link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F'; + break; default: $subdir = ''; $upload_dir = ''; @@ -394,11 +410,13 @@ if ($result && $action == "dl" && !$error) { foreach ($filesarray as $key => $file) { - foreach ($file['files'] as $filecursor) { - if (file_exists($filecursor["fullname"])) { - $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); - } - } + if (!empty($file['files'])) { + foreach ($file['files'] as $filecursor) { + if (file_exists($filecursor["fullname"])) { + $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); + } + } + } $log .= '"'.$langs->trans($file['item']).'"'; if (!empty($conf->multicompany->enabled) && is_object($mc)) @@ -448,6 +466,11 @@ $form = new Form($db); $userstatic = new User($db); $invoice = new Facture($db); $supplier_invoice = new FactureFournisseur($db); +$expensereport = new ExpenseReport($db); +$don = new Don($db); +$salary_payment = new PaymentSalary($db); +$charge_sociales = new ChargeSociales($db); +$various_payment = new PaymentVarious($db); $title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); $help_url = ''; @@ -492,7 +515,8 @@ $listofchoices = array( 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips'), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'), - 'selectsocialcontributions'=>array('label'=>'SocialContributions') + 'selectsocialcontributions'=>array('label'=>'SocialContributions'), + 'selectvariouspayment'=>array('label'=>'VariousPayment') ); foreach ($listofchoices as $choice => $val) { $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); @@ -592,14 +616,34 @@ if (!empty($date_start) && !empty($date_stop)) // Ref print ''; // File link From 48183b396ad674fb22e1c9415978d8414b0fd9e8 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 13 May 2020 08:54:42 +0200 Subject: [PATCH 172/490] Fix top menu search method must be GET --- htdocs/main.inc.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8e05aa34ab8..2beb4f74787 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2002,7 +2002,7 @@ function top_menu_search() $defaultAction = ''; $buttonList = ''; + print ''; + $extrafields_collapse_num_old = $extrafields_collapse_num; print ''; print ''; print ''; - if($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED )print ''; + if (!empty($conf->multicompany->enabled) && $conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED ) print ''; print ''; print ''; print ''; @@ -379,7 +379,7 @@ if ($resql) print ''; // Expected to pay - if($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED ){ + if(!empty($conf->multicompany->enabled) && $conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED ){ print ''; print ''; print ''; print ''; -$sessiontimeout = ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = ""; print ''; print ''; - /*print '';*/ print '
'.$langs->trans('Discount').''; if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $object->thirdparty->remise_percent); else print $langs->trans("CompanyHasNoRelativeDiscount"); @@ -1502,8 +1502,6 @@ else } - $colorb = '666666'; - $arrayothercontracts = $object->getListOfContracts('others'); /* @@ -1775,8 +1773,8 @@ else print ''; - print ''; - print '
'; + print ''; + print '
'; print '
'; - if ($data['item'] == 'Invoice') { - $invoice->id = $data['id']; + if ($data['item'] == 'Invoice') { + $invoice->id = $data['id']; $invoice->ref = $data['ref']; print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } elseif ($data['item'] == 'SupplierInvoice') { $supplier_invoice->id = $data['id']; $supplier_invoice->ref = $data['ref']; print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'ExpenseReport') { + $expensereport->id = $data['id']; + $expensereport->ref = $data['ref']; + print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'SalaryPayment') { + $salary_payment->id = $data['id']; + $salary_payment->ref = $data['ref']; + print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'Donation') { + $don->id = $data['id']; + $don->ref = $data['ref']; + print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'SocialContributions') { + $charge_sociales->id = $data['id']; + $charge_sociales->ref = $data['ref']; + print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'VariousPayment') { + $various_payment->id = $data['id']; + $various_payment->ref = $data['ref']; + print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } else { print $data['ref']; } From b7ae5ffa1d085661bed4906ad4540562e6134219 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 13 May 2020 06:12:45 +0000 Subject: [PATCH 171/490] Fixing style errors. --- htdocs/compta/accounting-files.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 9c26cc0999c..66d36df25b2 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -616,37 +616,37 @@ if (!empty($date_start) && !empty($date_stop)) // Ref print ''; - if ($data['item'] == 'Invoice') { - $invoice->id = $data['id']; + if ($data['item'] == 'Invoice') { + $invoice->id = $data['id']; $invoice->ref = $data['ref']; print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'SupplierInvoice') { + } elseif ($data['item'] == 'SupplierInvoice') { $supplier_invoice->id = $data['id']; $supplier_invoice->ref = $data['ref']; print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'ExpenseReport') { + } elseif ($data['item'] == 'ExpenseReport') { $expensereport->id = $data['id']; $expensereport->ref = $data['ref']; print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'SalaryPayment') { + } elseif ($data['item'] == 'SalaryPayment') { $salary_payment->id = $data['id']; $salary_payment->ref = $data['ref']; print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'Donation') { + } elseif ($data['item'] == 'Donation') { $don->id = $data['id']; $don->ref = $data['ref']; print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'SocialContributions') { + } elseif ($data['item'] == 'SocialContributions') { $charge_sociales->id = $data['id']; $charge_sociales->ref = $data['ref']; print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } elseif ($data['item'] == 'VariousPayment') { + } elseif ($data['item'] == 'VariousPayment') { $various_payment->id = $data['id']; $various_payment->ref = $data['ref']; print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); - } else { + } else { print $data['ref']; - } + } print '
'; print ''; print ''; - print '\n"; From 872518a91fa2f30318f298c5bb630af616ee32e4 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 16:54:53 +0200 Subject: [PATCH 179/490] Add total by credit/debit for accounting-file.php --- htdocs/compta/accounting-files.php | 104 ++++++++++++++++------------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 98d8c9b9983..64332671b5d 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -42,6 +42,10 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +// Constant to define payment sens +const PAY_DEBIT = 0; +const PAY_CREDIT = 1; + $langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); $date_start = GETPOST('date_start', 'alpha'); @@ -144,7 +148,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Customer invoices if (GETPOST('selectinvoices')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum"; + $sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays"; $sql .= " WHERE datef between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -153,7 +157,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Vendor invoices if (GETPOST('selectsupplierinvoices')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays"; $sql .= " WHERE datef between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -162,7 +166,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Expense reports if (GETPOST('selectexpensereports')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " WHERE date_fin between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -171,7 +175,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Donations if (GETPOST('selectdonations')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country"; $sql .= " WHERE datedon between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -180,7 +184,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Paiements of salaries if (GETPOST('selectpaymentsofsalaries')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -189,7 +193,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Social contributions if (GETPOST('selectsocialcontributions')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t"; $sql .= " WHERE date_creation between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -198,7 +202,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Various payments if (GETPOST('selectvariouspayment')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; + $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; @@ -311,6 +315,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $nofile['thirdparty_code'] = $objd->thirdparty_code; $nofile['country_code'] = $objd->country_code; $nofile['vatnum'] = $objd->vatnum; + $nofile['sens'] = $objd->sens; $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; } @@ -329,11 +334,11 @@ if (($action == 'searchfiles' || $action == 'dl')) { $file['ref'] = ($objd->ref ? $objd->ref : $objd->id); $file['fk'] = $objd->fk_soc; $file['item'] = $objd->item; - $file['thirdparty_name'] = $objd->thirdparty_name; $file['thirdparty_code'] = $objd->thirdparty_code; $file['country_code'] = $objd->country_code; $file['vatnum'] = $objd->vatnum; + $file['sens'] = $objd->sens; // Save record into array (only the first time it is found) if (empty($filesarray[$file['item'].'_'.$file['id']])) { @@ -417,7 +422,8 @@ if ($result && $action == "dl" && !$error) $log .= ','.$langs->transnoentitiesnoconv("ThirdParty"); $log .= ','.$langs->transnoentitiesnoconv("Code"); $log .= ','.$langs->transnoentitiesnoconv("Country"); - $log .= ','.$langs->transnoentitiesnoconv("VATIntra")."\n"; + $log .= ','.$langs->transnoentitiesnoconv("VATIntra"); + $log .= ','.$langs->transnoentitiesnoconv("Sens")."\n"; $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip'; dol_delete_file($zipname); @@ -454,6 +460,7 @@ if ($result && $action == "dl" && !$error) $log .= ',"'.$file['thirdparty_code'].'"'; $log .= ',"'.$file['country_code'].'"'; $log .= ',"'.$file['vatnum'].'"'; + $log .= ',"'.$file['sens'].'"'; $log .= "\n"; } $zip->addFromString('transactions.csv', $log); @@ -605,11 +612,12 @@ if (!empty($date_start) && !empty($date_stop)) { // Sort array by date ASC to calculate balance - $totalET = 0; - $totalIT = 0; - $totalVAT = 0; - $totalDebit = 0; - $totalCredit = 0; + $totalET_debit = 0; + $totalIT_debit = 0; + $totalVAT_debit = 0; + $totalET_credit = 0; + $totalIT_credit = 0; + $totalVAT_credit = 0; // Display array foreach ($TData as $data) @@ -682,11 +690,11 @@ if (!empty($date_start) && !empty($date_stop)) print ''; // Total ET - print '\n"; + print '\n"; // Total IT - print '\n"; + print '\n"; // Total VAT - print '\n"; + print '\n"; print '\n"; @@ -696,42 +704,42 @@ if (!empty($date_start) && !empty($date_stop)) print '\n"; - // Debit - //print '\n"; - // Credit - //print '\n"; - - $totalET += $data['amount_ht']; - $totalIT += $data['amount_ttc']; - $totalVAT += $data['amount_vat']; - - $totalDebit += ($data['amount_ttc'] > 0) ? abs($data['amount_ttc']) : 0; - $totalCredit += ($data['amount_ttc'] > 0) ? 0 : abs($data['amount_ttc']); - - // Balance - //print '\n"; + if ($data['sens']) { + $totalET_credit += $data['amount_ht']; + $totalIT_credit += $data['amount_ttc']; + $totalVAT_credit += $data['amount_vat']; + } else { + $totalET_debit -= $data['amount_ht']; + $totalIT_debit -= $data['amount_ttc']; + $totalVAT_debit -= $data['amount_vat']; + } print "\n"; } + // Total credits print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - /*print ''; - print ''; - print ''; - */ + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + // Total debits + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + // Balance + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; } } From ee6e717f4632716ce1e4d6a12301882b17850524 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 17:47:30 +0200 Subject: [PATCH 180/490] Add payment loan in accounting-files.php --- htdocs/compta/accounting-files.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 64332671b5d..a97a0a815b7 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -41,12 +41,13 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; // Constant to define payment sens const PAY_DEBIT = 0; const PAY_CREDIT = 1; -$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); +$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks", "loan")); $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); @@ -207,6 +208,14 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " WHERE datep between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; } + // Loan payments + if (GETPOST('selectloanspayment')) { + if (!empty($sql)) $sql .= " UNION ALL"; + $sql .= " SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX."loan as l ON l.rowid = t.fk_loan"; + $sql .= " WHERE datep between ".$wheretail; + $sql .= " AND l.entity IN (".($entity == 1 ? '0,1' : $entity).')'; + } if ($sql) { $sql .= $db->order($sortfield, $sortorder); @@ -283,6 +292,13 @@ if (($action == 'searchfiles' || $action == 'dl')) { $link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F'; $modulepart = "banque"; break; + case "LoanPayment": + // Loan payment has no linked file + $subdir = ''; + $upload_dir = $conf->loan->dir_output.'/'.$subdir; + $link = ""; + $modulepart = ""; + break; default: $subdir = ''; $upload_dir = ''; @@ -497,6 +513,7 @@ $don = new Don($db); $salary_payment = new PaymentSalary($db); $charge_sociales = new ChargeSociales($db); $various_payment = new PaymentVarious($db); +$payment_loan = new PaymentLoan($db); $title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); $help_url = ''; @@ -542,7 +559,8 @@ $listofchoices = array( 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'), 'selectsocialcontributions'=>array('label'=>'SocialContributions'), - 'selectvariouspayment'=>array('label'=>'VariousPayment') + 'selectvariouspayment'=>array('label'=>'VariousPayment'), + 'selectloanspayment'=>array('label'=>'PaymentLoan'), ); foreach ($listofchoices as $choice => $val) { $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); @@ -671,6 +689,10 @@ if (!empty($date_start) && !empty($date_stop)) $various_payment->id = $data['id']; $various_payment->ref = $data['ref']; print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + } elseif ($data['item'] == 'LoanPayment') { + $payment_loan->id = $data['id']; + $payment_loan->ref = $data['ref']; + print $payment_loan->getNomUrl(1, '', 0, 0, '', 0, 0, 0); } else { print $data['ref']; } From ac0b735131af206c67d34420ed38a3fff43a8482 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 18:01:00 +0200 Subject: [PATCH 181/490] Fix use date_ech for social contributions in accounting-file.php --- htdocs/compta/accounting-files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index a97a0a815b7..f9bc453d999 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -194,9 +194,9 @@ if (($action == 'searchfiles' || $action == 'dl')) { // Social contributions if (GETPOST('selectsocialcontributions')) { if (!empty($sql)) $sql .= " UNION ALL"; - $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; + $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t"; - $sql .= " WHERE date_creation between ".$wheretail; + $sql .= " WHERE t.date_ech between ".$wheretail; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } From 9f6a5d4cc95097e92eeb94d6524add35ae3a5c3d Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 14 May 2020 10:50:20 +0200 Subject: [PATCH 182/490] Fix multicompany supplier product price filter --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93061d200d8..078cfb2b5f2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2759,7 +2759,7 @@ class Form } if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; if ($socid) $sql .= " AND pfp.fk_soc = ".$socid; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; // Units From 36b63ed921b555b297da38c2467b1e32037c9c1f Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Thu, 14 May 2020 11:37:26 +0200 Subject: [PATCH 183/490] Update list.php --- htdocs/product/list.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index f818d2f475a..d6b3def0967 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1252,26 +1252,26 @@ if ($resql) { if (!empty($arrayfields['p.sellprice'.$key]['checked'])) { - $resultp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price"; - $resultp .= " FROM ".MAIN_DB_PREFIX."product_price as p"; - $resultp .= " WHERE fk_product = ".$obj->rowid; - if (!empty($conf->global->PRODUIT_MULTIPRICES)) $resultp .= " AND p.price_level = ".$key; - $resultp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC"; - $resultp = $db->query($resultp); - if ($resultp) + print ''; - $db->free($resultp); - } else { - dol_print_error($db); } + print ''; if (!$i) $totalarray['nbfield']++; } } From e3afa658808b856b4afe576787f5835b020c0998 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 14 May 2020 09:38:27 +0000 Subject: [PATCH 184/490] Fixing style errors. --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d6b3def0967..97d08477946 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1265,7 +1265,7 @@ if ($resql) { $objp = $db->fetch_object($resultp); if ($obj->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); - else print price($objp->price).' '.$langs->trans("HT"); + else print price($objp->price).' '.$langs->trans("HT"); $db->free($resultp); } else { dol_print_error($db); From 1bd00b0e8c635db1a8348c97d3933699b92d88db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 12:28:17 +0200 Subject: [PATCH 185/490] Fix to solve feedbacks of https://www.dolibarr.fr/forum/t/email-collector-avec-office-365-bug-et-contournement/32726 --- .../class/emailcollector.class.php | 20 +++++++++++++++---- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ .../llx_emailcollector_emailcollector.sql | 3 ++- htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 11cf2477720..969b83cac5a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -100,8 +100,9 @@ class EmailCollector extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1), - 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>100, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), + 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), + 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)'), + 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>103, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX'), //'filter' => array('type'=>'text', 'label'=>'Filter', 'visible'=>1, 'enabled'=>1, 'position'=>105), @@ -173,6 +174,7 @@ class EmailCollector extends CommonObject public $host; + public $hostcharset; public $login; public $password; public $source_directory; @@ -985,9 +987,10 @@ class EmailCollector extends CommonObject $nbemailprocessed = 0; $nbemailok = 0; $nbactiondone = 0; + $charset = ($this->hostcharset ? $this->hostcharset : "UTF-8"); // Scan IMAP inbox - $arrayofemail = imap_search($connection, $search, null, "UTF-8"); + $arrayofemail = imap_search($connection, $search, null, $charset); if ($arrayofemail === false) { // Nothing found or search string not understood @@ -1086,6 +1089,7 @@ class EmailCollector extends CommonObject } $header = imap_fetchheader($connection, $imapemail, 0); + $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches); $headers = array_combine($matches[1], $matches[2]); @@ -1132,7 +1136,10 @@ class EmailCollector extends CommonObject // Can use also imap_mime_header_decode($str) // Can use also mb_decode_mimeheader($str) // Can use also iconv_mime_decode($str, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8') - if (function_exists('imap_mime_header_decode')) { + if (function_exists('iconv_mime_decode')) { + $overview[0]->subject = iconv_mime_decode($overview[0]->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'); + } + elseif (function_exists('imap_mime_header_decode')) { $elements = imap_mime_header_decode($overview[0]->subject); $newstring = ''; if (!empty($elements)) { @@ -1146,6 +1153,8 @@ class EmailCollector extends CommonObject elseif (function_exists('mb_decode_mimeheader')) { $overview[0]->subject = mb_decode_mimeheader($overview[0]->subject); } + // Removed emojis + $overview[0]->subject = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $overview[0]->subject); // Parse IMAP email structure global $htmlmsg, $plainmsg, $charset, $attachments; @@ -1153,6 +1162,9 @@ class EmailCollector extends CommonObject //$htmlmsg,$plainmsg,$charset,$attachments $messagetext = $plainmsg ? $plainmsg : dol_string_nohtmltag($htmlmsg, 0); + // Removed emojis + $messagetext = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $messagetext); + /*var_dump($plainmsg); var_dump($htmlmsg); var_dump($messagetext);*/ diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 8a68e763160..7daf41a05d3 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -285,3 +285,5 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; + +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8'; diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index 10f3e4f8b9b..87581f418e8 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -21,7 +21,8 @@ CREATE TABLE llx_emailcollector_emailcollector( ref varchar(128) NOT NULL, label varchar(255), description text, - host varchar(255), + host varchar(255), + hostcharset varchar(16) DEFAULT 'UTF-8', login varchar(128), password varchar(128), source_directory varchar(255) NOT NULL, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1bd7f3d0297..5ce79a12231 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -40,6 +40,7 @@ WebUserGroup=Web server user/group NoSessionFound=Your PHP configuration seems to not allow listing of active sessions. The directory used to save sessions (%s) may be protected (for example by OS permissions or by PHP directive open_basedir). DBStoringCharset=Database charset to store data DBSortingCharset=Database charset to sort data +HostCharset=Host charset ClientCharset=Client charset ClientSortingCharset=Client collation WarningModuleNotActive=Module %s must be enabled From bcaa83eeeca16486d5d3d511ea7290b25146aba5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:10:04 +0200 Subject: [PATCH 186/490] FIX dol_concatdesc to escape < Better help --- htdocs/admin/emailcollector_card.php | 4 ++-- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 9 +++++---- htdocs/emailcollector/class/emailcollector.class.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 74592ff777a..80161eaadc6 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); //var_dump($htmltext); - print $form->textwithpicto('', $htmltext); + print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt'); print ''; print ''; print ''; @@ -643,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Delete print ''; print ''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4f3930a4588..3fc3151030a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -308,7 +308,7 @@ class Translate continue; } else { - // Convert some strings: Parse and render carriage returns. Also, change '\\s' int '\s' because transifex sync pull the string '\s' into string '\\s' + // Convert some strings: Parse and render carriage returns. Also, change '\\s' into '\s' because transifex sync pull the string '\s' into string '\\s' $this->tab_translate[$key] = str_replace(array('\\n', '\\\\s'), array("\n", '\s'), $value); if ($usecachekey) { $tabtranslatedomain[$key] = $value; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20094da216c..31716dc3f3c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5794,7 +5794,8 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8') /** - * Replace CRLF in string with a HTML BR tag + * Replace CRLF in string with a HTML BR tag. + * WARNING: The content after operation contains some HTML tags (the
) so be sure to also have encode the special chars of stringtoencode into HTML before. * * @param string $stringtoencode String to encode * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br @@ -6048,7 +6049,7 @@ function dol_textishtml($msg, $option = 0) * * @param string $text1 Text 1 * @param string $text2 Text 2 - * @param bool $forxml false=Use
instead of \n if html content detected, true=Use
instead of \n if html content detected + * @param bool $forxml true=Use
instead of
if we have to add a br tag * @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter) * @return string Text 1 + new line + Text2 * @see dol_textishtml() @@ -6063,9 +6064,9 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) } $ret = ''; - $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ?dol_nl2br($text1, 0, $forxml) : $text1; + $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text1, 0, 1, '', 1), 0, $forxml) : $text1; $ret .= (!empty($text1) && !empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2)) ? ($forxml ? "
\n" : "
\n") : "\n") : ""; - $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ?dol_nl2br($text2, 0, $forxml) : $text2; + $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text2, 0, 1, '', 1), 0, $forxml) : $text2; return $ret; } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 969b83cac5a..2bc6d6db962 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -937,8 +937,8 @@ class EmailCollector extends CommonObject } imap_errors(); // Clear stack of errors. - // $conf->global->MAIL_PREFIX_FOR_EMAIL_ID must be defined $host = dol_getprefix('email'); + //$host = '123456'; // Define the IMAP search string // See https://tools.ietf.org/html/rfc3501#section-6.4.4 for IMAPv4 (PHP not yet compatible) @@ -1081,6 +1081,7 @@ class EmailCollector extends CommonObject dol_syslog("Start of loop on email", LOG_INFO, 1); + $i = 0; foreach ($arrayofemail as $imapemail) { if ($nbemailprocessed > 1000) @@ -1088,6 +1089,8 @@ class EmailCollector extends CommonObject break; // Do not process more than 1000 email per launch (this is a different protection than maxnbcollectedpercollect } + $i++; + $header = imap_fetchheader($connection, $imapemail, 0); $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); @@ -1095,6 +1098,8 @@ class EmailCollector extends CommonObject $headers = array_combine($matches[1], $matches[2]); //var_dump($headers); + dol_syslog("** Process email ".$i." References: ".$headers['References']); + // If there is a filter on trackid if ($searchfilterdoltrackid > 0) { @@ -1130,7 +1135,7 @@ class EmailCollector extends CommonObject // GET Email meta datas $overview = imap_fetch_overview($connection, $imapemail, 0); - dol_syslog("** Process email - msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); + dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); // Decode $overview[0]->subject according to RFC2047 // Can use also imap_mime_header_decode($str) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5ce79a12231..6c139a0f10c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1939,7 +1939,7 @@ WithoutDolTrackingID=Dolibarr Reference not found in Message ID FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) ECMAutoTree=Show automatic ECM tree -OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. +OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
objproperty1=SET:the value to set
objproperty2=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
objproperty4=EXTRACT:HEADER:X-Myheaderkey:\s*([^\s]*)
options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. OpeningHours=Opening hours OpeningHoursDesc=Enter here the regular opening hours of your company. ResourceSetup=Configuration of Resource module From 4a65b629ee3c93266226208d24806aee8243e168 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:29:14 +0200 Subject: [PATCH 187/490] Position of fields --- htdocs/index.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 36aae1f25b8..7f6e462839b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -142,11 +142,11 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'orders', 'invoices', 'donations', - 'contracts', - 'interventions', 'supplier_proposals', 'supplier_orders', 'supplier_invoices', + 'contracts', + 'interventions', 'ticket' ); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2f5e10c1459..afb154408c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3643,7 +3643,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20); } span.boxstatstext { - opacity: 0.7; + opacity: 0.5; line-height: 18px; color: var(--colortext); } From 72c6aa81bb146813ab52f6a95f321ba9918c687c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 12:30:59 +0200 Subject: [PATCH 188/490] Trans --- htdocs/langs/en_US/modulebuilder.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index b815cf997cc..135ac1ae9ec 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -83,7 +83,7 @@ ListOfDictionariesEntries=List of dictionaries entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update). Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
4 = display in description column after the description only if not empty DisplayOnPdf=Display on PDF IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) From 4a04cecbaae3c6deea391462718f08323965805d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 12:49:53 +0200 Subject: [PATCH 189/490] CSS --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ef39d38a568..60c7ee43bb0 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1611,7 +1611,7 @@ div.nopadding { } td.nobordernopadding.widthpictotitle.col-picto { - color: var(--colortexttitlenotab); + color: #bbb; opacity: 0.85; } .table-list-of-attached-files .col-picto, .table-list-of-links .col-picto { From 0b3e917155c8e4f9f4a6fe676268fd357f6e8df0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 May 2020 13:29:50 +0200 Subject: [PATCH 190/490] CSS --- htdocs/core/tpl/extrafields_view.tpl.php | 21 ++++++++++++++++++--- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index e6cbad245d9..198a3910747 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -52,8 +52,12 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $lastseparatorkeyfound = ''; $extrafields_collapse_num = ''; + $extrafields_collapse_num_old = ''; + $i = 0; foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { + $i++; + // Discard if extrafield is a hidden field on form $enabled = 1; @@ -65,6 +69,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); } + $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) { @@ -87,6 +92,8 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $value = $object->array_options["options_".$key]; //var_dump($key.' - '.$value); } + + // Print line tr of extra field if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') { $extrafields_collapse_num = ''; @@ -109,13 +116,20 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] } else { - print '
'; + print ''; + $extrafields_collapse_num_old = $extrafields_collapse_num; print ''; - if(!empty($show_subgroup)) + if (!empty($show_subgroup)) { // Permet d'afficher le compte comptable if (empty($displayed_account) || $root_account_description != $displayed_account) { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; print ''; } // Show first line of a break print ''; - print ''; + print ''; print ''; $displayed_account = $root_account_description; @@ -337,9 +337,9 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - if(!empty($show_subgroup)) + if (!empty($show_subgroup)) { - print ''; + print ''; print "\n"; print ''; } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f9bc453d999..6b9be4d285c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -712,11 +712,11 @@ if (!empty($date_start) && !empty($date_stop)) print ''; // Total ET - print '\n"; + print '\n"; // Total IT - print '\n"; + print '\n"; // Total VAT - print '\n"; + print '\n"; print '\n"; @@ -758,9 +758,9 @@ if (!empty($date_start) && !empty($date_stop)) // Balance print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print "\n"; } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 9302ed09afb..7c010ea742c 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -379,7 +379,7 @@ class Interfaces print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers
'; } } - catch(Exception $e) { + catch (Exception $e) { print $e->getMessage(); } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index a751f584564..b44d7260e97 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -910,7 +910,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, if ($numholidays == 1) return 0; } - $nbOpenDay=$lastday; + $nbOpenDay = $lastday; if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 384c4fc3a7e..24811ad854d 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2302,7 +2302,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning'; if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning'; if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { - print 'getVersion(1).'">'; + print 'getVersion(1).'">'; print $this->getVersion(1); print ''; } diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 024310abb09..103d0fdffba 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -465,14 +465,14 @@ class pdf_paiement if ($yp > $this->tab_height - 15) { $pdf->SetFillColor(255, 255, 255); - $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetFont('', 'B', $default_font_size - 1); - $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1); - $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_page), 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_page), 0, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFillColor(220, 220, 220); $page++; @@ -523,19 +523,19 @@ class pdf_paiement } // Add line to add total by payment mode if mode reglement for nex line change - if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j+1][2])) + if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j + 1][2])) { $pdf->SetFillColor(245, 245, 245); - $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); - $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'I', $default_font_size - 1); $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1); - $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_mod), 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_mod), 0, 'R', 1); $pdf->SetFont('', '', $default_font_size - 1); - $mod = $lines[$j+1][2]; + $mod = $lines[$j + 1][2]; $total_mod = 0; $yp = $yp + 5; if ($yp > $this->tab_height - 5) @@ -551,14 +551,14 @@ class pdf_paiement } $total += $total_page; $pdf->SetFillColor(255, 255, 255); - $pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array()); + $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); - $pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp); + $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'B'); $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1); - $pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total), 0, 'R', 1); + $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total), 0, 'R', 1); $pdf->SetFillColor(220, 220, 220); } } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 2bc6d6db962..bf1a4e26de7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1092,7 +1092,7 @@ class EmailCollector extends CommonObject $i++; $header = imap_fetchheader($connection, $imapemail, 0); - $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines + $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches); $headers = array_combine($matches[1], $matches[2]); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3d6cec96319..16012022dc9 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -625,7 +625,7 @@ $(document).ready(function() { else selectedline=this.id; selectedtext=$('#'+selectedline).find("td:first").html(); '; -if ($action=="productinfo"){ +if ($action == "productinfo") { $prod = new Product($db); $prod->fetch($idproduct); print "".$prod->label."
"; @@ -83,7 +83,7 @@ if ($action=="productinfo"){ print '
'; print ''; } -elseif ($action=="editline"){ +elseif ($action == "editline") { $placeid = GETPOST('placeid', 'int'); $selectedline = GETPOST('selectedline', 'int'); $invoice = new Facture($db); @@ -99,8 +99,8 @@ elseif ($action=="editline"){ print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; - print ''; - print ''; + print ''; + print ''; print ''; } } @@ -168,11 +168,11 @@ $( document ).ready(function() { function LoadPlace(placeid){ place=placeid; @@ -197,11 +197,11 @@ function AddProduct(placeid, productid){ function AddProductConfirm(placeid, productid){ place=placeid;
'.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; print ''; print ''; print ''; } - else{ + else { print ''; print ''; print ''; From 672ea60ffd471b2156bf45c28c60c3dc57223906 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 13:58:34 +0200 Subject: [PATCH 222/490] FIX #13896 --- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index fad19564fdc..2070bedf568 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -440,7 +440,7 @@ class MyObject extends CommonObject if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - while ($i < min($limit, $num)) + while ($i < ($limit ? min($limit, $num) : $num)) { $obj = $this->db->fetch_object($resql); From dc6ae70aa6ddc311b8967dd9bf8d445e70c815a1 Mon Sep 17 00:00:00 2001 From: Langlais115 Date: Fri, 15 May 2020 10:25:56 +0200 Subject: [PATCH 223/490] Fix #13805 Add proper type check to "seuil_stock_alerte" parameter. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb2a1652d8f..7b6892552d1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1015,7 +1015,7 @@ class Product extends CommonObject $sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null'); $sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null'); $sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null'); - $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->db->escape($this->seuil_stock_alerte)."'" : "null"); + $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (int) $this->seuil_stock_alerte : 'null'); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null'); $sql .= ", customcode = '".$this->db->escape($this->customcode)."'"; From 3295b0d669541c24849f51f772d4487b708ddf3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 14:14:05 +0200 Subject: [PATCH 224/490] Update viewimage.php --- htdocs/viewimage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 39795b62fd8..c72a4e0424e 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -203,7 +203,7 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } -elseif ($conf->global->TAKEPOS_AUTO_ORDER && isset($_GET["publictakepos"])) +elseif (! empty($conf->global->TAKEPOS_AUTO_ORDER) && isset($_GET["publictakepos"])) { $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable } From f35a618699830aadfaedbf5fbcf9bc8dc7b307db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 14:29:04 +0200 Subject: [PATCH 225/490] Update index.php --- htdocs/takepos/genimg/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index c2bb62b9322..e668b01aacb 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -77,7 +77,7 @@ elseif ($query == "pro") preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file.'&cache=1&publictakepos=1'); + else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); } else { From b8d7a4373c2deeba697b592eb6eb23fa19812e85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 14:34:24 +0200 Subject: [PATCH 226/490] Update viewimage.php --- htdocs/viewimage.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index c72a4e0424e..b2534ee92dd 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -52,7 +52,7 @@ if (isset($_GET["hashp"]) && !defined("NOLOGIN")) if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } // Some value of modulepart can be used to get resources that are public so no login are required. -if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) +if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') { if (!defined("NOLOGIN")) define("NOLOGIN", 1); if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -60,7 +60,7 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) } // Used by TakePOS Auto Order -if (isset($_GET["publictakepos"])) +if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'product' && isset($_GET["publictakepos"])) { if (!defined("NOLOGIN")) define("NOLOGIN", 1); if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. @@ -203,9 +203,11 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } -elseif (! empty($conf->global->TAKEPOS_AUTO_ORDER) && isset($_GET["publictakepos"])) +elseif (isset($_GET["publictakepos"])) { - $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable + if (! empty($conf->global->TAKEPOS_AUTO_ORDER)) { + $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable + } } else { From 895833effc017ad4c2817e16d0a9e947b49b497a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:00:58 +0200 Subject: [PATCH 227/490] FIX #13864 --- htdocs/projet/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e41c3da3e88..ae91ac0cfac 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -639,20 +639,20 @@ if ($action == 'create' && $user->rights->projet->creer) // Opportunity probability print '
'; - print ''; print ''; // Opportunity amount print ''; - print ''; + print ''; print ''; } // Budget print ''; - print ''; + print ''; print ''; // Description @@ -897,14 +897,14 @@ elseif ($object->id > 0) // Opportunity probability print ''; - print ''; print ''; // Opportunity amount print ''; - print ''; + print ''; print ''; } @@ -923,7 +923,7 @@ elseif ($object->id > 0) // Budget print ''; - print ''; + print ''; print ''; // Description From 99db3a2991b4b74a38f1c99379f6c06a0c097ca8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:15:07 +0200 Subject: [PATCH 228/490] Fix field for opportunities must be visible only if we use opportinities --- htdocs/projet/card.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index ae91ac0cfac..6918e6fd57c 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -833,9 +833,22 @@ elseif ($object->id > 0) print ''; + print ''; print ''; // Opportunity probability - print ''; + print ''; print ''; print ''; // Opportunity amount - print ''; + print ''; print ''; print ''; } From 38059ab86190b32c9a5834062b10864ce91fc010 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:17:37 +0200 Subject: [PATCH 229/490] Fix trans --- htdocs/langs/en_US/projects.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index cdc0e6b3c95..bb42bff3c87 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -255,7 +255,7 @@ ServiceToUseOnLines=Service to use on lines InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). Note: To generate invoice, go on tab 'Time spent' of the project and select lines to include. ProjectFollowOpportunity=Follow opportunity -ProjectFollowTasks=Follow tasks +ProjectFollowTasks=Follow tasks or time spent Usage=Usage UsageOpportunity=Usage: Opportunity UsageTasks=Usage: Tasks From 86ff60f16152235e51709c4d91effdff8026822f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 15:50:50 +0200 Subject: [PATCH 230/490] Fix break line and set of opportunity fields --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/core/class/html.formprojet.class.php | 6 ++++-- htdocs/langs/en_US/accountancy.lang | 1 + htdocs/projet/card.php | 19 ++++++++++++++++--- htdocs/theme/eldy/global.inc.php | 3 ++- htdocs/theme/eldy/theme_vars.inc.php | 2 +- htdocs/theme/md/style.css.php | 20 +++++++++++--------- htdocs/theme/md/theme_vars.inc.php | 2 +- 8 files changed, 37 insertions(+), 18 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b2a25b00ce2..456da29d954 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -294,7 +294,7 @@ if ($action != 'export_csv') { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print ''; + print ''; print "\n"; print ''; } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index b6c7017e408..bf3db0cc65c 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -620,11 +620,12 @@ class FormProjets * @param int $showallnone Add choice "All" and "None" * @param int $showpercent Show default probability for status * @param string $morecss Add more css + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '') + public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0) { - global $conf, $langs; + global $conf, $langs, $user; $sql = "SELECT rowid, code, label, percent"; $sql .= " FROM ".MAIN_DB_PREFIX.'c_lead_status'; @@ -670,6 +671,7 @@ class FormProjets $i++; } $sellist .= ''; + if ($user->admin && !$noadmininfo) $sellist .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } /*else { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index adf2309ad07..92cc0f0c79e 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -234,6 +234,7 @@ ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unkno ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Third-party account not defined or third party unknown. Blocking error. UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error PaymentsNotLinkedToProduct=Payment not linked to any product / service +OpeningBalance=Opening balance ShowOpeningBalance=Show opening balance HideOpeningBalance=Hide opening balance diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 6918e6fd57c..15d1d6d9563 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -558,6 +558,19 @@ if ($action == 'create' && $user->rights->projet->creer) print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) @@ -632,20 +645,20 @@ if ($action == 'create' && $user->rights->projet->creer) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status - print ''; + print ''; print ''; // Opportunity probability - print ''; + print ''; print ''; print ''; // Opportunity amount - print ''; + print ''; print ''; print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index afb154408c5..3e213c3d8e2 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -17,6 +17,7 @@ --colorbacklinepair2: rgb(); --colorbacklinepairhover: rgb(); --colorbacklinepairchecked: rgb(); + --colorbacklinebreak: rgb(); --colorbackbody: rgb(); --colortexttitlenotab: rgb(); --colortexttitle: rgb(); @@ -3289,7 +3290,7 @@ td.evenodd, tr.nohoverpair td, #trlinefordates td { .trforbreak td { font-weight: 500; border-bottom: 1pt solid black !important; - /* background-color: # !important; */ + background-color: var(--colorbacklinebreak) !important; !important; } .trforbreak.nobold td a, .trforbreak.nobold span.secondary { font-weight: normal !important; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 823b8168b4c..d2a11725ecf 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -65,7 +65,7 @@ $colorbacklinepair1 = '251,251,251'; // line pair $colorbacklinepair2 = '251,251,251'; // line pair $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked -$colorbacklinebreak = '233,228,230'; // line break +$colorbacklinebreak = '253,251,250'; // line break $colorbackbody = '255,255,255'; $colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 $colortexttitle = '0,0,0'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index da2df5eb788..36fb265c42a 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -242,6 +242,7 @@ print '*/'."\n"; --colorbacklinepair2: rgb(); --colorbacklinepairhover: rgb(); --colorbacklinepairchecked: rgb(); + --colorbacklinebreak: rgb(); --colorbackbody: rgb(); --colortexttitlenotab: rgb(); --colortexttitle: rgb(); @@ -3284,10 +3285,10 @@ ul.noborder li:nth-child(odd):not(.liste_titre) { } .impair, .nohover .impair:hover, tr.impair td.nohover { - background: #; + background: var(--colorbacklineimpair1); } #GanttChartDIV { - background-color: #; + background-color: var(--colorbacklineimpair1); } .oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover, .tagtr.oddeven { @@ -3296,25 +3297,26 @@ ul.noborder li:nth-child(odd):not(.liste_titre) { color: #202020; } .pair, .nohover .pair:hover, tr.pair td.nohover { - background-color: #; + background-color: var(--colorbacklinepair1); } + table.dataTable tr.oddeven { - background-color: # !important; + background-color: var(--colorbacklinepair1) !important; } /* For no hover style */ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.impair td, table.nohover tr.pair td, tr.nohover td, form.nohover, form.nohover:hover { - background-color: # !important; - background: # !important; + background-color: var(--colorbacklineimpair1) !important; !important; + background: var(--colorbacklineimpair1) !important; !important; } td.evenodd, tr.nohoverpair td, #trlinefordates td { - background-color: # !important; - background: # !important; + background-color: var(--colorbacklinepair1) !important; !important; + background: var(--colorbacklinepair1) !important; !important; } .trforbreak td { font-weight: bold; border-bottom: 1pt solid black !important; - /* background-color: # !important; */ + background-color: var(--colorbacklinebreak) !important; } table.dataTable td { diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 6cdd37fe913..ffad2cc66b5 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -61,7 +61,7 @@ $colorbacklinepair1 = '248,248,248'; // line pair $colorbacklinepair2 = '246,246,246'; // line pair $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked -$colorbacklinebreak = '214,218,220'; +$colorbacklinebreak = '250,246,251'; $colorbackbody = '248,248,248'; $colortexttitlenotab = '80,71,5'; $colortexttitle = '20,20,20'; From 1453b8469ea6dad679dc652bc0fa4a175f081cae Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 15:56:16 +0200 Subject: [PATCH 231/490] Update 11.0.0-12.0.0.sql --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 95c6658c306..8a68e763160 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -285,5 +285,3 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; - -ALTER TABLE llx_commande MODIFY COLUMN date_livraison DATETIME; From 703fee0635d4deccccccc7a1ac1f88ebe287f397 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 15:58:01 +0200 Subject: [PATCH 232/490] Update llx_commande.sql --- htdocs/install/mysql/tables/llx_commande.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 676e768c73b..aa237383452 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -64,8 +64,8 @@ create table llx_commande fk_currency varchar(3), -- currency code fk_cond_reglement integer, -- condition de reglement fk_mode_reglement integer, -- mode de reglement - - date_livraison date default NULL, + + date_livraison datetime default NULL, fk_shipping_method integer, -- shipping method id fk_warehouse integer default NULL, fk_availability integer NULL, From 6a0bc86ea6a77c000eb1092a8fafdd97fa6ddc50 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 16:03:03 +0200 Subject: [PATCH 233/490] Create 12.0.0.-13.0.0.sql --- .../mysql/migration/12.0.0.-13.0.0.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 htdocs/install/mysql/migration/12.0.0.-13.0.0.sql diff --git a/htdocs/install/mysql/migration/12.0.0.-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0.-13.0.0.sql new file mode 100644 index 00000000000..e0bf956bb43 --- /dev/null +++ b/htdocs/install/mysql/migration/12.0.0.-13.0.0.sql @@ -0,0 +1,35 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 13.0.0 or higher. +-- +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field); +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): +-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; +-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid); +-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq'); +-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table; +-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; +-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. + + +-- Missing in v12 + + +-- For v13 + ALTER TABLE llx_commande MODIFY COLUMN date_livraison DATETIME; From e00152a8459f51eb9fb9619f06d6d75888f56063 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 16:03:38 +0200 Subject: [PATCH 234/490] Rename 12.0.0.-13.0.0.sql to 12.0.0-13.0.0.sql --- .../mysql/migration/{12.0.0.-13.0.0.sql => 12.0.0-13.0.0.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename htdocs/install/mysql/migration/{12.0.0.-13.0.0.sql => 12.0.0-13.0.0.sql} (100%) diff --git a/htdocs/install/mysql/migration/12.0.0.-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql similarity index 100% rename from htdocs/install/mysql/migration/12.0.0.-13.0.0.sql rename to htdocs/install/mysql/migration/12.0.0-13.0.0.sql From 8d242cacae0ab85f988adc3110141c12a28cb918 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 16:04:36 +0200 Subject: [PATCH 235/490] Update 12.0.0-13.0.0.sql update sql --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index e0bf956bb43..d2ee477afa3 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -32,4 +32,5 @@ -- For v13 + ALTER TABLE llx_commande MODIFY COLUMN date_livraison DATETIME; From 5fe9c45fb25a952c9b38d2f815354ec19c7df1e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 16:07:39 +0200 Subject: [PATCH 236/490] Fix look and feel v12 --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/projet/card.php | 4 +-- htdocs/societe/card.php | 51 +++++-------------------------- 3 files changed, 11 insertions(+), 46 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 31716dc3f3c..878b85993b5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3149,7 +3149,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building', - 'cash-register', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes', + 'cash-register', 'category', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help', 'intervention', 'label', 'language', 'list', 'listlight', 'lot', diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 15d1d6d9563..e79d5bafa59 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -604,7 +604,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '"; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 195d4df88bb..6abb7aa9647 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1331,7 +1331,7 @@ else // Country print ''; @@ -1354,16 +1354,16 @@ else // Phone / Fax print ''; - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning').' '; + print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning').' '; if ($conf->browser->layout == 'phone') print ''; print ''; - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning_fax').' '; + print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning_fax').' '; // Email / Web print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1380,42 +1380,6 @@ else } } - // if (! empty($conf->socialnetworks->enabled)) - // { - // // Skype - // if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) - // { - // print ''; - // print ''; - // } - // // Twitter - // if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) - // { - // print ''; - // print ''; - // } - // // Facebook - // if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - // { - // print ''; - // print ''; - // } - // // LinkedIn - // if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) - // { - // print ''; - // print ''; - // } - // } - // Prof ids $i = 1; $j = 0; $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); while ($i <= 6) @@ -1481,9 +1445,10 @@ else //TODO: Place into a function to control showing by country or study better option if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { - print ''; + print ''; } From c43813ccbb7f5671b0d79291066ded0e35abef30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 16:23:24 +0200 Subject: [PATCH 237/490] Fix responsive of edition of thirdparties --- htdocs/societe/card.php | 62 +++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6abb7aa9647..96a9dd7deed 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1396,7 +1396,7 @@ else print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print ''; - if (($j % 2) == 1) print ''; + if (($j % $NBCOLS) == ($NBCOLS - 1)) print ''; $j++; } $i++; @@ -1448,6 +1448,7 @@ else print ''; + if ($conf->browser->layout == 'phone') print ''; print ''; @@ -1848,6 +1849,7 @@ else print ''; + if ($conf->browser->layout == 'phone') print ''; print 'id.')">'; - $htmlforlines .= ''."\n"; + $htmlforlines .= '
'; + $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency); + $htmlforlines .= ''."\n"; } $htmlforlines .= '
attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; print '">'; if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); @@ -161,6 +175,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; } + //TODO Improve element and rights detection if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 60c7ee43bb0..2f5e10c1459 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1751,7 +1751,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); /* border-bottom: 2px solid var(--colorbackhmenu1); */ } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { /* border-bottom: 2px solid var(--colorbackhmenu1) !important; */ border-bottom: 2px solid rgb() !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c7ce5709efd..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1799,7 +1799,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { border-bottom: 1px solid rgb() !important; } .tdhrthin { From 5f400d27b4a7909efcad5f2914cdefddb4d64983 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 13 May 2020 15:01:32 +0200 Subject: [PATCH 178/490] Add preview file in compta/accounting-files.php --- htdocs/compta/accounting-files.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index c567c5e99ee..98d8c9b9983 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks")); @@ -232,6 +233,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $upload_dir = $conf->facture->dir_output.'/'.$subdir; $link = "document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "facture"; break; case "SupplierInvoice": $tmpinvoicesupplier->fetch($objd->id); @@ -239,18 +241,21 @@ if (($action == 'searchfiles' || $action == 'dl')) { $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir; $link = "document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "facture_fournisseur"; break; case "ExpenseReport": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $upload_dir = $conf->expensereport->dir_output.'/'.$subdir; $link = "document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "expensereport"; break; case "SalaryPayment": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->salaries->dir_output.'/'.$subdir; $link = "document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "salaries"; break; case "Donation": $tmpdonation->fetch($objp->id); @@ -258,18 +263,21 @@ if (($action == 'searchfiles' || $action == 'dl')) { $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->don->dir_output.'/'.$subdir; $link = "document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "don"; break; case "SocialContributions": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->tax->dir_output.'/'.$subdir; $link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "tax"; break; case "VariousPayment": $subdir = ''; $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $upload_dir = $conf->bank->dir_output.'/'.$subdir; $link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F'; + $modulepart = "banque"; break; default: $subdir = ''; @@ -336,7 +344,16 @@ if (($action == 'searchfiles' || $action == 'dl')) { if (empty($filesarray[$file['item'].'_'.$file['id']]['files'])) { $filesarray[$file['item'].'_'.$file['id']]['files'] = array(); } - $filesarray[$file['item'].'_'.$file['id']]['files'][] = array('link' => $link.$file['name'], 'name'=>$file['name'], 'ref'=>$file['ref'], 'fullname' => $file['fullname'], 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name']); + $filesarray[$file['item'].'_'.$file['id']]['files'][] = array( + 'link' => $link.urlencode($file['name']), + 'name'=>$file['name'], + 'ref'=>$file['ref'], + 'fullname' => $file['fullname'], + 'relpath' => '/'.$file['name'], + 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name'], + 'modulepart' => $modulepart, + 'subdir' => $subdir, + ); //var_dump($file['item'].'_'.$file['id']); //var_dump($filesarray[$file['item'].'_'.$file['id']]['files']); } @@ -463,7 +480,8 @@ if ($result && $action == "dl" && !$error) * View */ -$form = new Form($db); +$form = new form($db); +$formfile = new FormFile($db); $userstatic = new User($db); $invoice = new Facture($db); $supplier_invoice = new FactureFournisseur($db); @@ -654,8 +672,8 @@ if (!empty($date_start) && !empty($date_stop)) print ''; if (!empty($data['files'])) { - foreach ($data['files'] as $filecursor) { - print ''.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'
'; + foreach ($data['files'] as $id=>$filecursor) { + print ''.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).' '.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'
'; } } print "
'.$data['paid'].''.price($data['amount_ht'])."'.price($data['sens']?$data['amount_ht']:-$data['amount_ht'])."'.price($data['amount_ttc'])."'.price($data['sens']?$data['amount_ttc']:-$data['amount_ttc'])."'.price($data['amount_vat'])."'.price($data['sens']?$data['amount_vat']:-$data['amount_vat'])."'.$data['thirdparty_name']."'.$data['vatnum']."'.(($data['amount_ttc'] > 0) ? price(abs($data['amount_ttc'])) : '')."'.(($data['amount_ttc'] > 0) ? '' : price(abs($data['amount_ttc'])))."'.price($data['balance'])."
'.price(price2num($totalET, 'MT')).''.price(price2num($totalIT, 'MT')).''.price(price2num($totalVAT, 'MT')).''.price($totalDebit).''.price($totalCredit).''.price(price2num($totalDebit - $totalCredit, 'MT')).''.$langs->trans('Total').' '.$langs->trans('Income').''.price(price2num($totalET_credit, 'MT')).''.price(price2num($totalIT_credit, 'MT')).''.price(price2num($totalVAT_credit, 'MT')).'
'.$langs->trans('Total').' '.$langs->trans('Outcome').''.price(price2num($totalET_debit, 'MT')).''.price(price2num($totalIT_debit, 'MT')).''.price(price2num($totalVAT_debit, 'MT')).'
'.$langs->trans('Total').''.price(price2num($totalET_credit+$totalET_debit, 'MT')).''.price(price2num($totalIT_credit+$totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit+$totalVAT_debit, 'MT')).'
'; + if ($obj->tosell) { - $objp = $db->fetch_object($resultp); - print ''; - if ($obj->tosell) - { - if ($obj->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); - else print price($objp->price).' '.$langs->trans("HT"); + $resultp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price"; + $resultp .= " FROM ".MAIN_DB_PREFIX."product_price as p"; + $resultp .= " WHERE fk_product = ".$obj->rowid; + $resultp .= " AND p.price_level = ".$key; + $resultp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC"; + $resultp = $db->query($resultp); + if ($resultp) + { + $objp = $db->fetch_object($resultp); + if ($obj->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); + else print price($objp->price).' '.$langs->trans("HT"); + $db->free($resultp); + } else { + dol_print_error($db); } - print ''; - print ''.img_edit().''; + print ''.img_edit().''; print ' '.img_delete().''; print '
'; print ''; print ''; - print ''; print ''; print ''; @@ -643,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Delete print ''; print ''; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4f3930a4588..3fc3151030a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -308,7 +308,7 @@ class Translate continue; } else { - // Convert some strings: Parse and render carriage returns. Also, change '\\s' int '\s' because transifex sync pull the string '\s' into string '\\s' + // Convert some strings: Parse and render carriage returns. Also, change '\\s' into '\s' because transifex sync pull the string '\s' into string '\\s' $this->tab_translate[$key] = str_replace(array('\\n', '\\\\s'), array("\n", '\s'), $value); if ($usecachekey) { $tabtranslatedomain[$key] = $value; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20094da216c..31716dc3f3c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5794,7 +5794,8 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8') /** - * Replace CRLF in string with a HTML BR tag + * Replace CRLF in string with a HTML BR tag. + * WARNING: The content after operation contains some HTML tags (the
) so be sure to also have encode the special chars of stringtoencode into HTML before. * * @param string $stringtoencode String to encode * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br @@ -6048,7 +6049,7 @@ function dol_textishtml($msg, $option = 0) * * @param string $text1 Text 1 * @param string $text2 Text 2 - * @param bool $forxml false=Use
instead of \n if html content detected, true=Use
instead of \n if html content detected + * @param bool $forxml true=Use
instead of
if we have to add a br tag * @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter) * @return string Text 1 + new line + Text2 * @see dol_textishtml() @@ -6063,9 +6064,9 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) } $ret = ''; - $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ?dol_nl2br($text1, 0, $forxml) : $text1; + $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text1, 0, 1, '', 1), 0, $forxml) : $text1; $ret .= (!empty($text1) && !empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2)) ? ($forxml ? "
\n" : "
\n") : "\n") : ""; - $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ?dol_nl2br($text2, 0, $forxml) : $text2; + $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text2, 0, 1, '', 1), 0, $forxml) : $text2; return $ret; } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 969b83cac5a..2bc6d6db962 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -937,8 +937,8 @@ class EmailCollector extends CommonObject } imap_errors(); // Clear stack of errors. - // $conf->global->MAIL_PREFIX_FOR_EMAIL_ID must be defined $host = dol_getprefix('email'); + //$host = '123456'; // Define the IMAP search string // See https://tools.ietf.org/html/rfc3501#section-6.4.4 for IMAPv4 (PHP not yet compatible) @@ -1081,6 +1081,7 @@ class EmailCollector extends CommonObject dol_syslog("Start of loop on email", LOG_INFO, 1); + $i = 0; foreach ($arrayofemail as $imapemail) { if ($nbemailprocessed > 1000) @@ -1088,6 +1089,8 @@ class EmailCollector extends CommonObject break; // Do not process more than 1000 email per launch (this is a different protection than maxnbcollectedpercollect } + $i++; + $header = imap_fetchheader($connection, $imapemail, 0); $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); @@ -1095,6 +1098,8 @@ class EmailCollector extends CommonObject $headers = array_combine($matches[1], $matches[2]); //var_dump($headers); + dol_syslog("** Process email ".$i." References: ".$headers['References']); + // If there is a filter on trackid if ($searchfilterdoltrackid > 0) { @@ -1130,7 +1135,7 @@ class EmailCollector extends CommonObject // GET Email meta datas $overview = imap_fetch_overview($connection, $imapemail, 0); - dol_syslog("** Process email - msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); + dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." subject=".$overview[0]->subject); // Decode $overview[0]->subject according to RFC2047 // Can use also imap_mime_header_decode($str) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5ce79a12231..6c139a0f10c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1939,7 +1939,7 @@ WithoutDolTrackingID=Dolibarr Reference not found in Message ID FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) ECMAutoTree=Show automatic ECM tree -OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. +OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
objproperty1=SET:the value to set
objproperty2=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
objproperty4=EXTRACT:HEADER:X-Myheaderkey:\s*([^\s]*)
options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
object.objproperty5=EXTRACT:BODY:My company name is\s([^\s]*)

Use a ; char as separator to extract or set several properties. OpeningHours=Opening hours OpeningHoursDesc=Enter here the regular opening hours of your company. ResourceSetup=Configuration of Resource module From 9a8e9bdc99ccec244b6b8ae43c5869f0192789a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:29:14 +0200 Subject: [PATCH 193/490] Position of fields --- htdocs/index.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 36aae1f25b8..7f6e462839b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -142,11 +142,11 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'orders', 'invoices', 'donations', - 'contracts', - 'interventions', 'supplier_proposals', 'supplier_orders', 'supplier_invoices', + 'contracts', + 'interventions', 'ticket' ); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2f5e10c1459..afb154408c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3643,7 +3643,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20); } span.boxstatstext { - opacity: 0.7; + opacity: 0.5; line-height: 18px; color: var(--colortext); } From 68512e0281da45963a89c6ce890c080062fc61e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:56:15 +0200 Subject: [PATCH 194/490] Look and feel v12 --- .../core/boxes/box_accountancy_last_manual_entries.php | 5 ++++- htdocs/core/boxes/box_boms.php | 5 ++++- htdocs/core/boxes/box_clients.php | 5 ++++- htdocs/core/boxes/box_commandes.php | 5 ++++- htdocs/core/boxes/box_factures_imp.php | 5 ++++- htdocs/core/boxes/box_ficheinter.php | 9 ++++++--- htdocs/core/boxes/box_fournisseurs.php | 2 +- htdocs/core/boxes/box_goodcustomers.php | 5 ++++- htdocs/core/boxes/box_mos.php | 5 ++++- htdocs/core/boxes/box_prospect.php | 4 ++-- htdocs/core/boxes/box_services_contracts.php | 5 ++++- htdocs/core/boxes/box_shipments.php | 5 ++++- htdocs/core/tools.php | 2 +- htdocs/install/default.css | 2 +- htdocs/install/step5.php | 10 +++++----- 15 files changed, 52 insertions(+), 22 deletions(-) diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index f1ee00c6c59..6198c90e663 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -140,7 +140,10 @@ class box_accountancy_last_manual_entries extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedManualEntries")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedManualEntries") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index 57c5ce2e2e2..c75c4c24e8f 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -153,7 +153,10 @@ class box_boms extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedOrders") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index d82a4aee71e..70718db55b5 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -148,7 +148,10 @@ class box_clients extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedCustomers") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 37a25c8084d..7ec5071b6e3 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -174,7 +174,10 @@ class box_commandes extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedOrders") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 0a44105a853..a374094ea89 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -180,7 +180,10 @@ class box_factures_imp extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoUnpaidCustomerBills")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoUnpaidCustomerBills") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index e289c83d541..4125ce92eaa 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -145,13 +145,16 @@ class box_ficheinter extends ModeleBoxes $i++; } - if ($num == 0) $this->info_box_contents[$i][] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedInterventions")); + if ($num == 0) $this->info_box_contents[$i][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedInterventions") + ); $this->db->free($resql); } else { - $this->info_box_contents[0][] = array( + $this->info_box_contents[0][0] = array( 'td' => '', 'maxlength'=>500, 'text' => ($this->db->error().' sql='.$sql), @@ -160,7 +163,7 @@ class box_ficheinter extends ModeleBoxes } else { - $this->info_box_contents[0][] = array( + $this->info_box_contents[0][0] = array( 'td' => 'class="nohover opacitymedium left"', 'text' => $langs->trans("ReadPermissionNotAllowed") ); diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 2f55a379362..44dd891bfb8 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -136,7 +136,7 @@ class box_fournisseurs extends ModeleBoxes } if ($num == 0) $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', + 'td' => 'class="center opacitymedium"', 'text'=>$langs->trans("NoRecordedSuppliers"), ); diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 79eb6f9ab8e..46dfdff6d23 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -142,7 +142,10 @@ class box_goodcustomers extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedCustomers") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 9b863aa2d5a..ec21d5d00cf 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -149,7 +149,10 @@ class box_mos extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedOrders") + ); $this->db->free($result); } else { diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 54ed1c76051..1024ef1d4ec 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -149,8 +149,8 @@ class box_prospect extends ModeleBoxes if ($num == 0) { $this->info_box_contents[$line][0] = array( - 'td' => 'class="center"', - 'text'=>$langs->trans("NoRecordedProspects"), + 'td' => 'class="center opacitymedium"', + 'text'=> $langs->trans("NoRecordedProspects"), ); } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index f8e6dd22452..7167097672b 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -223,7 +223,10 @@ class box_services_contracts extends ModeleBoxes $i++; } - if ($num == 0) $this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoContractedProducts")); + if ($num == 0) $this->info_box_contents[$i][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoContractedProducts") + ); $this->db->free($result); } diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index 26f45bc08db..278ad974cf5 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -158,7 +158,10 @@ class box_shipments extends ModeleBoxes $line++; } - if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedShipments")); + if ($num == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedShipments") + ); $this->db->free($result); } else { diff --git a/htdocs/core/tools.php b/htdocs/core/tools.php index 348417dd345..accb8eeed00 100644 --- a/htdocs/core/tools.php +++ b/htdocs/core/tools.php @@ -46,7 +46,7 @@ $text = $langs->trans("Tools"); print load_fiche_titre($text, '', 'wrench'); // Show description of content -print '
'.$langs->trans("ToolsDesc").'


'; +print '
'.$langs->trans("ToolsDesc").'


'; // Show logo diff --git a/htdocs/install/default.css b/htdocs/install/default.css index f0e51caecab..f363789c129 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -53,7 +53,7 @@ div.titre { } span.titre { - font-weight: bold; + /* font-weight: bold; */ background: #FFFFFF; color: rgb(0,113,121); border: 1px solid #bbb; diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 1609035e415..b74594ce8da 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -384,10 +384,10 @@ if ($action == "set" && $success) print "
"; - print $langs->trans("YouNeedToPersonalizeSetup")."

"; + print $langs->trans("YouNeedToPersonalizeSetup")."


"; print ''; } else @@ -399,7 +399,7 @@ if ($action == "set" && $success) print "
"; print ''; } } @@ -435,7 +435,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print "

"; print '
'; } else @@ -447,7 +447,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print "
"; print ''; } } From 6ec5dd02b61a21154b55812660f09b57b87994dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 15:27:10 +0200 Subject: [PATCH 195/490] Fix Fatal error with bad triggers --- htdocs/core/class/interfaces.class.php | 89 +++++++++++-------- htdocs/core/modules/DolibarrModules.class.php | 10 ++- .../interface_80_modStripe_Stripe.class.php | 2 +- htdocs/theme/eldy/info-box.inc.php | 4 +- 4 files changed, 59 insertions(+), 46 deletions(-) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index f1daafeb9e7..9302ed09afb 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -328,48 +328,59 @@ class Interfaces continue; } - $objMod = new $modName($db); + try { + $objMod = new $modName($db); - // Define disabledbyname and disabledbymodule - $disabledbyname = 0; - $disabledbymodule = 1; - $module = ''; + if (is_subclass_of($objMod, 'DolibarrTriggers')) + { + // Define disabledbyname and disabledbymodule + $disabledbyname = 0; + $disabledbymodule = 1; + $module = ''; - // Check if trigger file is disabled by name - if (preg_match('/NORUN$/i', $files[$key])) $disabledbyname = 1; - // Check if trigger file is for a particular module - if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg)) - { - $module = preg_replace('/^mod/i', '', $reg[2]); - $constparam = 'MAIN_MODULE_'.strtoupper($module); - if (strtolower($module) == 'all') $disabledbymodule = 0; - elseif (empty($conf->global->$constparam)) $disabledbymodule = 2; - $triggers[$j]['module'] = strtolower($module); + // Check if trigger file is disabled by name + if (preg_match('/NORUN$/i', $files[$key])) $disabledbyname = 1; + // Check if trigger file is for a particular module + if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg)) + { + $module = preg_replace('/^mod/i', '', $reg[2]); + $constparam = 'MAIN_MODULE_'.strtoupper($module); + if (strtolower($module) == 'all') $disabledbymodule = 0; + elseif (empty($conf->global->$constparam)) $disabledbymodule = 2; + $triggers[$j]['module'] = strtolower($module); + } + + // We set info of modules + $triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); + $triggers[$j]['file'] = $files[$key]; + $triggers[$j]['fullpath'] = $fullpath[$key]; + $triggers[$j]['relpath'] = $relpath[$key]; + $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; + $triggers[$j]['version'] = $objMod->getVersion(); + $triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick'); + if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = ''; + + $text = ''.$langs->trans("Description").':
'; + $text .= $objMod->getDesc().'
'; + $text .= '
'.$langs->trans("Status").':
'; + if ($disabledbyname == 1) + { + $text .= $langs->trans("TriggerDisabledByName").'
'; + if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; + } + else + { + if ($disabledbymodule == 0) $text .= $langs->trans("TriggerAlwaysActive").'
'; + if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'
'; + if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; + } + } + else { + print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers
'; + } } - - // We set info of modules - $triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); - $triggers[$j]['file'] = $files[$key]; - $triggers[$j]['fullpath'] = $fullpath[$key]; - $triggers[$j]['relpath'] = $relpath[$key]; - $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; - $triggers[$j]['version'] = $objMod->getVersion(); - $triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick'); - if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = ''; - - $text = ''.$langs->trans("Description").':
'; - $text .= $objMod->getDesc().'
'; - $text .= '
'.$langs->trans("Status").':
'; - if ($disabledbyname == 1) - { - $text .= $langs->trans("TriggerDisabledByName").'
'; - if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; - } - else - { - if ($disabledbymodule == 0) $text .= $langs->trans("TriggerAlwaysActive").'
'; - if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'
'; - if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'
'; + catch(Exception $e) { + print $e->getMessage(); } $triggers[$j]['info'] = $text; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9543cf74442..f9d27fedfa4 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2295,9 +2295,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } - print 'getVersion(1).'">'; - print $this->getVersion(1); - print ''; + if ($this->isCoreOrExternalModule() == 'external') { + print 'getVersion(1).'">'; + print $this->getVersion(1); + print ''; + } /*print ''; print '
'; @@ -2313,7 +2315,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it print '
- '.$this->getName().' + '.$this->getName().' '.nl2br($this->getDesc()).''; /*print 'getVersion(1).'">'; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 27138e6099f..e6c2df36ee1 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; /** * Class of triggers for stripe module */ -class InterfaceStripe +class InterfaceStripe extends DolibarrTriggers { /** * @var DoliDB Database handler. diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3138cd8bfd9..3d9c392f32b 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -8,7 +8,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> */ .info-box-module-external span.info-box-icon-version { - background: #999; + background: #bbb; } .info-box { @@ -74,7 +74,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> height: 80px; width: 80px; font-size: 25px; - line-height: 80px; + line-height: 100px; } .info-box-module .info-box-icon { height: 106px; From 7c01b54d73237b39e8ee45ca0e5784ba8c666adc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 15:42:37 +0200 Subject: [PATCH 196/490] Fix version on module list --- htdocs/admin/modules.php | 4 +++- htdocs/core/modules/DolibarrModules.class.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 6a0ff450346..c0f1991835b 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -680,7 +680,9 @@ if ($mode == 'common' || $mode == 'commonkanban') if (preg_match('/development/i', $version)) $versiontrans .= img_warning($langs->trans("Development"), 'style="float: left"'); if (preg_match('/experimental/i', $version)) $versiontrans .= img_warning($langs->trans("Experimental"), 'style="float: left"'); if (preg_match('/deprecated/i', $version)) $versiontrans .= img_warning($langs->trans("Deprecated"), 'style="float: left"'); - $versiontrans .= $objMod->getVersion(1); + if ($objMod->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { + $versiontrans .= $objMod->getVersion(1); + } // Define imginfo $imginfo = "info"; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index f9d27fedfa4..384c4fc3a7e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2295,8 +2295,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } - if ($this->isCoreOrExternalModule() == 'external') { - print 'getVersion(1).'">'; + + $version = $this->getVersion(0); + $versiontrans = ''; + if (preg_match('/development/i', $version)) $versiontrans .= 'warning'; + if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning'; + if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning'; + if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { + print 'getVersion(1).'">'; print $this->getVersion(1); print ''; } From 3d26351c6b4de6444a4f7230cbfa0d93d165e7e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:03:31 +0200 Subject: [PATCH 197/490] Fix function if hours. --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ae138bcceec..a751f584564 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -912,7 +912,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, $nbOpenDay=$lastday; - if ($inhour == 1) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); + if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); } else From b26c1757e6ab26142aa57ab27e53cb847db47b93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:07:23 +0200 Subject: [PATCH 198/490] Prepare v13 --- .../install/mysql/migration/12.0.0-13.0.0.sql | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 htdocs/install/mysql/migration/12.0.0-13.0.0.sql diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql new file mode 100644 index 00000000000..210fe31d1ef --- /dev/null +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -0,0 +1,36 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 13.0.0 or higher. +-- +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field); +-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): +-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid; +-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid); +-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq'); +-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table; +-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; +-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. + + +-- Missing in v12 + + +-- For v13 + + From 9becb24073c6fc90230289ee0b33170ff517d6a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:40:40 +0200 Subject: [PATCH 199/490] Prepare v13 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 0780154118e..b70419de5f4 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 215cf9e6f804cba007c44cc7c08a68e3b2b38a9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:45:32 +0200 Subject: [PATCH 200/490] Prepare v13 --- htdocs/install/check.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 95e3082cb56..408f4b2a1a8 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -479,7 +479,8 @@ else array('from'=>'8.0.0', 'to'=>'9.0.0'), array('from'=>'9.0.0', 'to'=>'10.0.0'), array('from'=>'10.0.0', 'to'=>'11.0.0'), - array('from'=>'11.0.0', 'to'=>'12.0.0') + array('from'=>'11.0.0', 'to'=>'12.0.0'), + array('from'=>'12.0.0', 'to'=>'13.0.0') ); $count = 0; From 499c2ea30a63c4b5b575576ce02f37f7e554e9b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 16:52:21 +0200 Subject: [PATCH 201/490] FIX #13855 --- htdocs/core/lib/ajax.lib.php | 2 +- htdocs/main.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 64f442633de..1d3e80b90be 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/lib/ajax.lib.php - * \brief Page called by Ajax request for produts + * \brief Page called to enhance interface with Javascript and Ajax features. */ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d4d1f84a344..49c48e34ec1 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -317,7 +317,7 @@ if (!defined('NOLOGIN') && !defined('NOIPCHECK') && !empty($dolibarr_main_restri // Loading of additional presentation includes if (!defined('NOREQUIREHTML')) require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; // Need 660ko memory (800ko in 2.2) -if (!defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; // Need 22ko memory +require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; // Need 22ko memory // If install or upgrade process not done or not completely finished, we call the install page. if (!empty($conf->global->MAIN_NOT_INSTALLED) || !empty($conf->global->MAIN_NOT_UPGRADED)) From 949e0f2326a6f3268b511110903aec472315b5b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 17:27:12 +0200 Subject: [PATCH 202/490] Fix filter on language --- htdocs/website/class/websitepage.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 84eaf0efb27..c63823f51a1 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -332,7 +332,11 @@ class WebsitePage extends CommonObject if ($key == 't.rowid' || $key == 't.fk_website') { $sqlwhere[] = $key.'='.$value; } elseif ($key == 'lang' || $key == 't.lang') { - $sqlwhere[] = $key." = '".$this->db->escape(substr($value, 0, 2))."'"; + $listoflang = array(); + foreach(explode(',', $value) as $tmpvalue) { + $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; + } + $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 991996697dd5e1f529d9e1a36eff465e4256ebf3 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Thu, 14 May 2020 18:03:22 +0200 Subject: [PATCH 203/490] Public photos for customers with TakePOS --- htdocs/takepos/genimg/index.php | 6 +++--- htdocs/takepos/phone.php | 4 ++-- htdocs/takepos/public/auto_order.php | 1 + htdocs/viewimage.php | 12 ++++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index a5686054193..c2bb62b9322 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -25,7 +25,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); -require '../../main.inc.php'; // Load $user and permissions +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../../main.inc.php'; // Load $user and permissions $id = GETPOST('id', 'int'); $w = GETPOST('w', 'int'); @@ -72,12 +72,12 @@ elseif ($query == "pro") $objProd = new Product($db); $objProd->fetch($id); - $image = $objProd->show_photos('product', $conf->product->multidir_output[$entity], 'small', 1); + $image = $objProd->show_photos('product', $conf->product->multidir_output[$objProd->entity], 'small', 1); preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file.'&cache=1'); + else header('Location: '.$file.'&cache=1&publictakepos=1'); } else { diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 8714173e45f..d506c64d2fc 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -77,7 +77,7 @@ if ($action=="productinfo"){ $prod = new Product($db); $prod->fetch($idproduct); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; @@ -95,7 +95,7 @@ elseif ($action=="editline"){ $prod = new Product($db); $prod->fetch($line->fk_product); print "".$prod->label."
"; - print ''; + print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; diff --git a/htdocs/takepos/public/auto_order.php b/htdocs/takepos/public/auto_order.php index c7612711df0..910c00327b4 100644 --- a/htdocs/takepos/public/auto_order.php +++ b/htdocs/takepos/public/auto_order.php @@ -33,4 +33,5 @@ $_SESSION["takeposterminal"] = 1; define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); if (GETPOSTISSET("mobilepage")) require '../invoice.php'; +elseif (GETPOSTISSET("genimg")) require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php'; else require '../phone.php'; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 3cb23b36fbc..39795b62fd8 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -59,6 +59,14 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } +// Used by TakePOS Auto Order +if (isset($_GET["publictakepos"])) +{ + if (!defined("NOLOGIN")) define("NOLOGIN", 1); + if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + // For multicompany $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity); @@ -195,6 +203,10 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } +elseif ($conf->global->TAKEPOS_AUTO_ORDER && isset($_GET["publictakepos"])) +{ + $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable +} else { // Basic protection (against external users only) From 1bf677f53735d66bbb4e0a7e9c9a8896ec99e95d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:14:55 +0200 Subject: [PATCH 204/490] Can set status of a websitepage --- htdocs/core/ajax/objectonoff.php | 11 ++++++++--- htdocs/core/class/commonobject.class.php | 5 ++++- htdocs/core/lib/security.lib.php | 1 + htdocs/website/index.php | 14 +++++++++++++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index dd39bce6d4e..6466df89a07 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -43,9 +43,9 @@ if (!empty($user->socid)) { $socid = $user->socid; } -if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { +/*if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set'); -} +}*/ /* @@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) { $triggerkey = 'COMPANY_UPDATE'; } - $object->setValueFrom($field, $value, $element, $id, $user, $triggerkey); + $tablename = $element; + if ($tablename == 'websitepage') $tablename = 'website_page'; + + $format = 'int'; + + $object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f3f1b9eaee3..6148b55a5cf 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8070,7 +8070,10 @@ abstract class CommonObject { if (empty($id) && empty($ref) && empty($morewhere)) return -1; - $sql = 'SELECT '.$this->getFieldList(); + $fieldlist = $this->getFieldList(); + if (empty($fieldlist)) return 0; + + $sql = 'SELECT '.$fieldlist; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element; if (!empty($id)) $sql .= ' WHERE rowid = '.$id; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 6749f32ffbe..03f1525eb91 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -192,6 +192,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if ($features == 'mo') $features = 'mrp'; if ($features == 'member') $features = 'adherent'; if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; }; + if ($features == 'websitepage') $features = 'website'; // Get more permissions checks from hooks $parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 690dc0efe3b..ac26f2ee7bb 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3170,6 +3170,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pageauthorid = $objectpage->fk_user_creat; $pageusermodifid = $objectpage->fk_user_modif; $pageauthoralias = $objectpage->author_alias; + $pagestatus = $objectpage->status; } else { @@ -3178,6 +3179,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') $pageauthorid = $user->id; $pageusermodifid = 0; $pageauthoralias = ''; + $pagestatus = 1; } if (GETPOST('WEBSITE_TITLE', 'alpha')) $pagetitle = GETPOST('WEBSITE_TITLE', 'alpha'); if (GETPOST('WEBSITE_PAGENAME', 'alpha')) $pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha'); @@ -3186,7 +3188,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') if (GETPOST('WEBSITE_IMAGE', 'alpha')) $pageimage = GETPOST('WEBSITE_IMAGE', 'alpha'); if (GETPOST('WEBSITE_KEYWORDS', 'alpha')) $pagekeywords = GETPOST('WEBSITE_KEYWORDS', 'alpha'); if (GETPOST('WEBSITE_LANG', 'aZ09')) $pagelang = GETPOST('WEBSITE_LANG', 'aZ09'); - if (GETPOST('htmlheader', 'none')) $pagehtmlheader = GETPOST('htmlheader', 'none'); + if (GETPOST('htmlheader', 'none')) $pagehtmlheader = GETPOST('htmlheader', 'none'); // Title print '
'; + if ($action != 'createcontainer') + { + print ''; + } + print '
attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; print '">'; if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); @@ -161,6 +175,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; } + //TODO Improve element and rights detection if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 60c7ee43bb0..2f5e10c1459 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1751,7 +1751,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); /* border-bottom: 2px solid var(--colorbackhmenu1); */ } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { /* border-bottom: 2px solid var(--colorbackhmenu1) !important; */ border-bottom: 2px solid rgb() !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c7ce5709efd..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1799,7 +1799,7 @@ img.photorefnoborder { border-bottom: px solid rgb(); } -.trextrafieldseparator td { +.trextrafieldseparator td, .trextrafields_collapse_last td { border-bottom: 1px solid rgb() !important; } .tdhrthin { From a796122f7b0e1050df2fe5ac635107e4aa3750be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 12:28:17 +0200 Subject: [PATCH 191/490] Fix to solve feedbacks of https://www.dolibarr.fr/forum/t/email-collector-avec-office-365-bug-et-contournement/32726 --- .../class/emailcollector.class.php | 20 +++++++++++++++---- .../install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ .../llx_emailcollector_emailcollector.sql | 3 ++- htdocs/langs/en_US/admin.lang | 1 + 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 11cf2477720..969b83cac5a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -100,8 +100,9 @@ class EmailCollector extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1'), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector'), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1), - 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>100, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), - 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), + 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com'), + 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)'), + 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>101, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>103, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX'), //'filter' => array('type'=>'text', 'label'=>'Filter', 'visible'=>1, 'enabled'=>1, 'position'=>105), @@ -173,6 +174,7 @@ class EmailCollector extends CommonObject public $host; + public $hostcharset; public $login; public $password; public $source_directory; @@ -985,9 +987,10 @@ class EmailCollector extends CommonObject $nbemailprocessed = 0; $nbemailok = 0; $nbactiondone = 0; + $charset = ($this->hostcharset ? $this->hostcharset : "UTF-8"); // Scan IMAP inbox - $arrayofemail = imap_search($connection, $search, null, "UTF-8"); + $arrayofemail = imap_search($connection, $search, null, $charset); if ($arrayofemail === false) { // Nothing found or search string not understood @@ -1086,6 +1089,7 @@ class EmailCollector extends CommonObject } $header = imap_fetchheader($connection, $imapemail, 0); + $header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines $matches = array(); preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches); $headers = array_combine($matches[1], $matches[2]); @@ -1132,7 +1136,10 @@ class EmailCollector extends CommonObject // Can use also imap_mime_header_decode($str) // Can use also mb_decode_mimeheader($str) // Can use also iconv_mime_decode($str, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8') - if (function_exists('imap_mime_header_decode')) { + if (function_exists('iconv_mime_decode')) { + $overview[0]->subject = iconv_mime_decode($overview[0]->subject, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, 'UTF-8'); + } + elseif (function_exists('imap_mime_header_decode')) { $elements = imap_mime_header_decode($overview[0]->subject); $newstring = ''; if (!empty($elements)) { @@ -1146,6 +1153,8 @@ class EmailCollector extends CommonObject elseif (function_exists('mb_decode_mimeheader')) { $overview[0]->subject = mb_decode_mimeheader($overview[0]->subject); } + // Removed emojis + $overview[0]->subject = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $overview[0]->subject); // Parse IMAP email structure global $htmlmsg, $plainmsg, $charset, $attachments; @@ -1153,6 +1162,9 @@ class EmailCollector extends CommonObject //$htmlmsg,$plainmsg,$charset,$attachments $messagetext = $plainmsg ? $plainmsg : dol_string_nohtmltag($htmlmsg, 0); + // Removed emojis + $messagetext = preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $messagetext); + /*var_dump($plainmsg); var_dump($htmlmsg); var_dump($messagetext);*/ diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 8a68e763160..7daf41a05d3 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -285,3 +285,5 @@ ALTER TABLE llx_prelevement_facture ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_menu MODIFY COLUMN module varchar(255); UPDATE llx_actioncomm SET fk_action = 50 where fk_action = 40 AND code = 'TICKET_MSG'; + +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN hostcharset varchar(16) DEFAULT 'UTF-8'; diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index 10f3e4f8b9b..87581f418e8 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -21,7 +21,8 @@ CREATE TABLE llx_emailcollector_emailcollector( ref varchar(128) NOT NULL, label varchar(255), description text, - host varchar(255), + host varchar(255), + hostcharset varchar(16) DEFAULT 'UTF-8', login varchar(128), password varchar(128), source_directory varchar(255) NOT NULL, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1bd7f3d0297..5ce79a12231 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -40,6 +40,7 @@ WebUserGroup=Web server user/group NoSessionFound=Your PHP configuration seems to not allow listing of active sessions. The directory used to save sessions (%s) may be protected (for example by OS permissions or by PHP directive open_basedir). DBStoringCharset=Database charset to store data DBSortingCharset=Database charset to sort data +HostCharset=Host charset ClientCharset=Client charset ClientSortingCharset=Client collation WarningModuleNotActive=Module %s must be enabled From ae0e6e4dc8e449be6c0354d1849bc71f80c35355 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 14:10:04 +0200 Subject: [PATCH 192/490] FIX dol_concatdesc to escape < Better help --- htdocs/admin/emailcollector_card.php | 4 ++-- htdocs/core/class/translate.class.php | 2 +- htdocs/core/lib/functions.lib.php | 9 +++++---- htdocs/emailcollector/class/emailcollector.class.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 74592ff777a..80161eaadc6 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); //var_dump($htmltext); - print $form->textwithpicto('', $htmltext); + print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt'); print ''; - print ''.img_edit().''; + print ''.img_edit().''; print ' '.img_delete().''; print '
'; @@ -3381,6 +3383,16 @@ if ($action == 'editmeta' || $action == 'createcontainer') print $doleditor->Create(1, '', true, 'HTML Header', 'html'); print '
'; + print $langs->trans('Status'); + print ''; + print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled'); + //print dol_print_date($pagedatecreation, 'dayhour'); + print '
'; if ($action == 'createcontainer') { From 7daef0d146d1e5145ab44f6a46c52b15a5b525a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:17:08 +0200 Subject: [PATCH 205/490] Fix bad parameters of function --- htdocs/core/ajax/objectonoff.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index dd39bce6d4e..f7bf1d6299c 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) { $triggerkey = 'COMPANY_UPDATE'; } - $object->setValueFrom($field, $value, $element, $id, $user, $triggerkey); + $tablename = $element; + if ($tablename == 'websitepage') $tablename = 'website_page'; + + $format = 'int'; + + $object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey); } From d8ee049b4c57491112ecfbbb42e9d3949e0d4468 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:41:31 +0200 Subject: [PATCH 206/490] Can select not defined language --- htdocs/website/class/websitepage.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index c63823f51a1..edf1eed51a7 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -333,10 +333,17 @@ class WebsitePage extends CommonObject $sqlwhere[] = $key.'='.$value; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); + $foundnull = 0; foreach(explode(',', $value) as $tmpvalue) { + if ($tmpvalue == 'null') { + $foundnull++; + continue; + } $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; } - $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; + $stringtouse = $key." IN (".join(',', $listoflang).")"; + if ($foundnull) $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; + $sqlwhere[] = $stringtouse; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 4cf7f68b6cbc3d3b7d2d9c9d0655468690f9214b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:44:05 +0200 Subject: [PATCH 207/490] Fix search on pages --- htdocs/website/class/websitepage.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index c63823f51a1..3e518d4d633 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -329,14 +329,23 @@ class WebsitePage extends CommonObject $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website') { + if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { $sqlwhere[] = $key.'='.$value; + } elseif ($key == 'type_container') { + $sqlwhere[] = $key."='".$value."'"; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); + $foundnull = 0; foreach(explode(',', $value) as $tmpvalue) { + if ($tmpvalue == 'null') { + $foundnull++; + continue; + } $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; } - $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; + $stringtouse = $key." IN (".join(',', $listoflang).")"; + if ($foundnull) $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; + $sqlwhere[] = $stringtouse; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } From 40fa0933ebfe2e128e8282999e126c136f0c2511 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:44:21 +0200 Subject: [PATCH 208/490] Fix on sarch pages --- htdocs/website/class/websitepage.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index edf1eed51a7..3e518d4d633 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -329,8 +329,10 @@ class WebsitePage extends CommonObject $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website') { + if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { $sqlwhere[] = $key.'='.$value; + } elseif ($key == 'type_container') { + $sqlwhere[] = $key."='".$value."'"; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); $foundnull = 0; From a660fd61c9495f4faa3ca10eda2333d86bd1ca7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:55:20 +0200 Subject: [PATCH 209/490] Fix lang must be set to null and not 0 when not defined --- htdocs/website/class/websitepage.class.php | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 3e518d4d633..2a72a222265 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -108,6 +108,29 @@ class WebsitePage extends CommonObject const STATUS_VALIDATED = 1; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ // BEGIN MODULEBUILDER PROPERTIES /** @@ -122,7 +145,7 @@ class WebsitePage extends CommonObject 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'image' =>array('type'=>'varchar(255)', 'label'=>'Image', 'enabled'=>1, 'visible'=>1, 'position'=>32, 'searchall'=>0, 'help'=>'Relative path of media. Used if Type is "blogpost"'), 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), - 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), + 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'notnull'=>-1, 'visible'=>1, 'position'=>45, 'searchall'=>0), //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), 'fk_page' =>array('type'=>'integer', 'label'=>'ParentPageId', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'position'=>45, 'searchall'=>0, 'foreignkey'=>'website.rowid'), From 0842259012f041d7f0ed33dbcf9be5d0fc97ddd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 18:55:20 +0200 Subject: [PATCH 210/490] Fix lang must be set to null and not 0 when not defined --- htdocs/website/class/websitepage.class.php | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 3e518d4d633..2a72a222265 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -108,6 +108,29 @@ class WebsitePage extends CommonObject const STATUS_VALIDATED = 1; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ // BEGIN MODULEBUILDER PROPERTIES /** @@ -122,7 +145,7 @@ class WebsitePage extends CommonObject 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), 'image' =>array('type'=>'varchar(255)', 'label'=>'Image', 'enabled'=>1, 'visible'=>1, 'position'=>32, 'searchall'=>0, 'help'=>'Relative path of media. Used if Type is "blogpost"'), 'keywords' =>array('type'=>'varchar(255)', 'label'=>'Keywords', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), - 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'searchall'=>0), + 'lang' =>array('type'=>'varchar(6)', 'label'=>'Lang', 'enabled'=>1, 'notnull'=>-1, 'visible'=>1, 'position'=>45, 'searchall'=>0), //'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>true, 'position'=>1000), 'fk_website' =>array('type'=>'integer', 'label'=>'WebsiteId', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>40, 'searchall'=>0, 'foreignkey'=>'websitepage.rowid'), 'fk_page' =>array('type'=>'integer', 'label'=>'ParentPageId', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'position'=>45, 'searchall'=>0, 'foreignkey'=>'website.rowid'), From 3811586cd0654ef0d99c6369177d7b96cf35b50d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 14 May 2020 20:34:48 +0200 Subject: [PATCH 211/490] FIX Site ec.europa.eu has moved to https:// --- htdocs/societe/checkvat/checkVatPopup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 689df14f3d7..e1f940cfab8 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -28,9 +28,9 @@ require_once NUSOAP_PATH.'/nusoap.php'; $langs->load("companies"); //http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl -$WS_DOL_URL='http://ec.europa.eu/taxation_customs/vies/services/checkVatService'; +$WS_DOL_URL='https://ec.europa.eu/taxation_customs/vies/services/checkVatService'; //$WS_DOL_URL_WSDL=$WS_DOL_URL.'?wsdl'; -$WS_DOL_URL_WSDL='http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; +$WS_DOL_URL_WSDL='https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; $WS_METHOD ='checkVat'; From cb98ec4d232b0be9d776e5b50a0745f307f5b016 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 01:18:53 +0200 Subject: [PATCH 212/490] Fix datapolicycron --- htdocs/datapolicy/class/datapolicycron.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 0d241f75334..81e9d009a56 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -461,7 +461,7 @@ class DataPolicyCron ) ), ); - + $this->db->begin(); foreach ($arrayofparameters as $key => $params) @@ -470,15 +470,15 @@ class DataPolicyCron { $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); - $resql = $db->query($sql); + $resql = $this->db->query($sql); - if ($resql && $db->num_rows($resql) > 0) + if ($resql && $this->db->num_rows($resql) > 0) { - $num = $db->num_rows($resql); + $num = $this->db->num_rows($resql); $i = 0; require_once $params['file']; - $object = new $params['class']($db); + $object = new $params['class']($this->db); while ($i < $num && ! $error) { From e691045c3d6ef5ad11fd9539fc702ed706229165 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 14 May 2020 23:20:39 +0000 Subject: [PATCH 213/490] Fixing style errors. --- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 81e9d009a56..ac364c78f30 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -461,7 +461,7 @@ class DataPolicyCron ) ), ); - + $this->db->begin(); foreach ($arrayofparameters as $key => $params) From 100bfb921f0cdb97ed919ce858e8804ecc3bd68d Mon Sep 17 00:00:00 2001 From: Langlais115 Date: Fri, 15 May 2020 10:25:56 +0200 Subject: [PATCH 214/490] Fix #13805 Add proper type check to "seuil_stock_alerte" parameter. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb2a1652d8f..7b6892552d1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1015,7 +1015,7 @@ class Product extends CommonObject $sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null'); $sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null'); $sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null'); - $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->db->escape($this->seuil_stock_alerte)."'" : "null"); + $sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (int) $this->seuil_stock_alerte : 'null'); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null'); $sql .= ", customcode = '".$this->db->escape($this->customcode)."'"; From bfca151d8553e7e8fe4487d7cf5d73c8459e520f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 11:58:50 +0200 Subject: [PATCH 215/490] Responsive --- htdocs/public/demo/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index c470055dbce..cbed76af71f 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -280,7 +280,7 @@ print ''; print '
'; print '
'; -print '
'.$langs->trans("DemoDesc").'

'; +print '
'.$langs->trans("DemoDesc").'

'; print '
'.$langs->trans("ChooseYourDemoProfil").'
'; print '
'; print '
'; From ad906fc508d3a712ddcd2133299bf0827d16a0b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 12:43:48 +0200 Subject: [PATCH 216/490] Fix use SVG logo instead of PNG --- htdocs/cache.manifest | 2 +- htdocs/core/lib/ticket.lib.php | 6 +++--- htdocs/opensurvey/fonctions.php | 2 +- htdocs/public/demo/index.php | 2 +- htdocs/public/members/new.php | 6 +++--- htdocs/public/onlinesign/newonlinesign.php | 2 +- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/payment/paymentko.php | 2 +- htdocs/public/payment/paymentok.php | 2 +- htdocs/theme/dolibarr_logo.png | Bin 9663 -> 14082 bytes htdocs/user/passwordforgotten.php | 8 ++++---- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest index ebbf1aab4eb..5e514a32a47 100644 --- a/htdocs/cache.manifest +++ b/htdocs/cache.manifest @@ -8,7 +8,7 @@ CACHE MANIFEST # Files listed under CACHE will be ALWAYS cached after they are loaded. # And they will be always used from Cache after (even after refresh). CACHE: -theme/dolibarr_logo.png +theme/dolibarr_logo.svg support/ support/index.php diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 0a50eb7407f..1b2a5c1245f 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -230,8 +230,8 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$mysoc->logo); $width = 150; - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } } } @@ -254,7 +254,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ } print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 30529b49f56..31ec69f3a42 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -121,7 +121,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index cbed76af71f..f0caf948770 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -274,7 +274,7 @@ print "\n"; print '
'; print '
'; -print ''; +print ''; print '
'; print '
'; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5b456893bf9..7f788a84671 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -113,9 +113,9 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 150; } - elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) + elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; $width = 150; } @@ -130,7 +130,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 83e757b78f8..2378728a8d3 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -191,7 +191,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index ddd1943329e..ea7fd71c9e6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -793,7 +793,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 2610219d69d..a3f6d733fcb 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -245,7 +245,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 6b7805cf473..b1d6c149a51 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -181,7 +181,7 @@ if ($urllogo) print '>'; print ''; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/theme/dolibarr_logo.png b/htdocs/theme/dolibarr_logo.png index 77c2146191034eb2b02c61b2f67c26fcf5d6aa19..c15f03c821baf1e72192ebaee9c73477f5668810 100644 GIT binary patch literal 14082 zcmch81y>wRur{v2g1dWw7lQjD!QCB#2ZzOFA-F^E;7-s$a1ZY8EQ`Cl!?(HT`wRE( zIXg4E)6-QwU0w6kQ#FyQ$}$*eBxo=&Fc@;OQtB`;a1zktJQO78cB39X54uBelaSLy zfqwi@EFz%4QJrP=++bkP7yo@>>D^~8pnnnrrFDTCPF6rqGgnI(Pft&FTSq%Lb2Dd4 zb|+Ws%rjvUXd}{pjWlh6_LeY;PS#FTQcm`^U(H-ysif6a*(BAKWPNk}pv_4BH3PT< zZJb=f z`yFh8Qg#NfQDPcd!w>lRf?$Y50$KY%^MN;y zniq)wU=nSYJhc^Wxl@oZAi$oU53-c}mE9U9Z|<|*6X~fj&pG5i(2eJU*h5;uMFLw3 zMcNGF{|?yoi~vto9-DmQ8@MOzN-JZRPI|C>Vf_F4j@X1;x8ZE0$$*n>V1c|j#*&|$Sg+68 za`a|(>b>P;uf^4)S>c@7l=As9y1ZEUjNWyx@c2dEbl)I*uPG^*uV`IySLAt4LKt17 zo2+?@|2bWDoH(RQTUy?vkAiJLD8+ANk%6vkh|j!ki(AL(-u_ydi_*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J5n&_at6-%XVbNuUs3lNqwMn`DVkGdH%%ar?yMaNyA)*u`!bDnS=q4xdv4~+W< z;)6UN9Mb2G`?~7>9}kWP$Aja+@!)uHJUAX4{||GB;Pc0uU}^vW002ovPDHLkV1luw BfOh}@ diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index b0f3a5aab6c..83289521538 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -192,13 +192,13 @@ elseif (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.' $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 128; } -elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png')) +elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.svg'; } -elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) +elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; } // Security graphical code From 8a2741650a6096bdad3f165ce12aa98d54aa051b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 12:46:55 +0200 Subject: [PATCH 217/490] Fix css --- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index afb154408c5..a6e9258ea39 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1362,6 +1362,9 @@ td.showDragHandle { transition: left 0.5s ease; } +.demologo { + width: 200px; +} div.blockvmenulogo { border-bottom: 0 !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index da2df5eb788..38a9ec38fe5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2471,6 +2471,9 @@ font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; font-weight: normal; color: #999; text-decoration: none; } +.demologo { + width: 200px; +} div.blockvmenulogo { border-bottom: 0 !important; From 949ef8d7d89f413cd8b3c72eb5c5f85a9c409e20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 12:49:22 +0200 Subject: [PATCH 218/490] Fix css --- htdocs/public/demo/demo.css | 5 ++++- htdocs/theme/eldy/global.inc.php | 3 --- htdocs/theme/md/style.css.php | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index 9328a8ecd1b..b185f8c933f 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -105,8 +105,11 @@ img.demothumb { object-fit: contain; height: 140px; background-position-y: bottom; + background-position-x: right; +} +.demologo { + width: 200px; } - @media only screen and (max-width: 767px) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a6e9258ea39..afb154408c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1362,9 +1362,6 @@ td.showDragHandle { transition: left 0.5s ease; } -.demologo { - width: 200px; -} div.blockvmenulogo { border-bottom: 0 !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 38a9ec38fe5..da2df5eb788 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2471,9 +2471,6 @@ font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } a.help:link, a.help:visited, a.help:hover, a.help:active, span.help { text-align: ; font-weight: normal; color: #999; text-decoration: none; } -.demologo { - width: 200px; -} div.blockvmenulogo { border-bottom: 0 !important; From 91f87d6834ad67d11caf7edc7b932993a0999029 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 13:52:35 +0200 Subject: [PATCH 219/490] Fix bad param of getNomUrl --- htdocs/compta/accounting-files.php | 12 +++---- htdocs/don/class/don.class.php | 22 +++++++++---- htdocs/loan/class/paymentloan.class.php | 42 ++++++++++++++++--------- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f9bc453d999..7d8b819b75c 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -672,27 +672,27 @@ if (!empty($date_start) && !empty($date_stop)) } elseif ($data['item'] == 'ExpenseReport') { $expensereport->id = $data['id']; $expensereport->ref = $data['ref']; - print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $expensereport->getNomUrl(1, 0, 0, '', 0, 0); } elseif ($data['item'] == 'SalaryPayment') { $salary_payment->id = $data['id']; $salary_payment->ref = $data['ref']; - print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $salary_payment->getNomUrl(1, '', 0, '', 0); } elseif ($data['item'] == 'Donation') { $don->id = $data['id']; $don->ref = $data['ref']; - print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $don->getNomUrl(1, 0, '', 0); } elseif ($data['item'] == 'SocialContributions') { $charge_sociales->id = $data['id']; $charge_sociales->ref = $data['ref']; - print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $charge_sociales->getNomUrl(1, 0, 0, 0, 0); } elseif ($data['item'] == 'VariousPayment') { $various_payment->id = $data['id']; $various_payment->ref = $data['ref']; - print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $various_payment->getNomUrl(1, '', 0, 0); } elseif ($data['item'] == 'LoanPayment') { $payment_loan->id = $data['id']; $payment_loan->ref = $data['ref']; - print $payment_loan->getNomUrl(1, '', 0, 0, '', 0, 0, 0); + print $payment_loan->getNomUrl(1, 0, 0, '', 0); } else { print $data['ref']; } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 77dbd177cbd..59c293e6386 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -916,11 +916,13 @@ class Don extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $notooltip 1=Disable tooltip - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $notooltip 1=Disable tooltip + * @param string $moretitle Add more text to title tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL */ - public function getNomUrl($withpicto = 0, $notooltip = 0) + public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1) { global $conf, $langs; @@ -928,10 +930,18 @@ class Don extends CommonObject $result = ''; $label = ''.$langs->trans("Donation").''; - if (!empty($this->id)) + if (!empty($this->id)) { $label .= '
'.$langs->trans('Ref').': '.$this->id; + } + if ($moretitle) $label .= ' - '.$moretitle; - $linkstart = ''; + $url = DOL_URL_ROOT.'/don/card.php?id='.$this->id; + + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; + if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; + + $linkstart = ''; $linkend = ''; $result .= $linkstart; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 485d48dc443..ce152317710 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -507,25 +507,39 @@ class PaymentLoan extends CommonObject /** * Return clicable name (with eventually a picto) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto - * @param int $maxlen Max length label - * @return string Chaine with URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto + * @param int $maxlen Max length label + * @param int $notooltip 1=Disable tooltip + * @param string $moretitle Add more text to title tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - public function getNomUrl($withpicto = 0, $maxlen = 0) + public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1) { - global $langs; + global $langs, $conf; + + if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; - - if (!empty($this->id)) - { - $link = ''; - $linkend = ''; - - if ($withpicto) $result .= ($link.img_object($langs->trans("ShowPayment").': '.$this->ref, 'payment').$linkend.' '); - if ($withpicto && $withpicto != 2) $result .= ' '; - if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend; + $label = ''.$langs->trans("Loan").''; + if (!empty($this->id)) { + $label .= '
'.$langs->trans('Ref').': '.$this->id; } + if ($moretitle) $label .= ' - '.$moretitle; + + $url = DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id; + + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1; + if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1'; + + $linkstart = ''; + $linkend = ''; + + $result .= $linkstart; + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto != 2) $result .= $this->ref; + $result .= $linkend; return $result; } From 02b40ae8f60cfd76c70453d631af0c21618655ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 13:54:05 +0200 Subject: [PATCH 220/490] Fix scrutinizer --- htdocs/core/class/interfaces.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 9302ed09afb..4199e51cb68 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -328,6 +328,8 @@ class Interfaces continue; } + $text = ''; + try { $objMod = new $modName($db); From 9699ee7263ec8b591b569251c78d5932dd630da2 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Fri, 15 May 2020 11:55:31 +0000 Subject: [PATCH 221/490] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/accountancy/bookkeeping/balance.php | 16 ++++---- htdocs/compta/accounting-files.php | 12 +++--- htdocs/core/class/interfaces.class.php | 2 +- htdocs/core/lib/date.lib.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 28 +++++++------- .../class/emailcollector.class.php | 2 +- htdocs/takepos/invoice.php | 2 +- htdocs/takepos/phone.php | 38 +++++++++---------- 9 files changed, 52 insertions(+), 52 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 85562ebc268..f443fded501 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -296,23 +296,23 @@ if ($action != 'export_csv') } print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).'
' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . ''.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_debit - $sous_total_credit)) . '
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_debit - $sous_total_credit)).'
'.$data['paid'].''.price($data['sens']?$data['amount_ht']:-$data['amount_ht'])."'.price($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'])."'.price($data['sens']?$data['amount_ttc']:-$data['amount_ttc'])."'.price($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'])."'.price($data['sens']?$data['amount_vat']:-$data['amount_vat'])."'.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."'.$data['thirdparty_name']."
'.$langs->trans('Total').''.price(price2num($totalET_credit+$totalET_debit, 'MT')).''.price(price2num($totalIT_credit+$totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit+$totalVAT_debit, 'MT')).''.price(price2num($totalET_credit + $totalET_debit, 'MT')).''.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'
'.$langs->trans("OpportunityProbability").' %'; - print ''; + print ' %'; + print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("Budget").'
'.$langs->trans("OpportunityProbability").' %'; + print ' %'; print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("Budget").'
'; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print ''; print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) @@ -884,8 +897,9 @@ elseif ($object->id > 0) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + $classfortr = ($object->usage_opportunity ? '' : ' hideobject'); // Opportunity status - print '
'.$langs->trans("OpportunityStatus").'
'.$langs->trans("OpportunityStatus").''; print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle'); print '
'.$langs->trans("OpportunityProbability").'
'.$langs->trans("OpportunityProbability").' %'; print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).'
'.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''.price(price2num($sous_total_credit - $sous_total_debit)).' 
'.$langs->trans("OpportunityStatus").'
'.$langs->trans("OpportunityStatus").''; print $formproject->selectOpportunityStatus('opp_status', GETPOST('opp_status') ?GETPOST('opp_status') : $object->opp_status); print '
'.$langs->trans("OpportunityProbability").'
'.$langs->trans("OpportunityProbability").' %'; print ''; print '
'.$langs->trans("OpportunityAmount").'
'.$langs->trans("OpportunityAmount").'
'; $filteronlist = ''; if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; - $text = $form->select_company(GETPOST('socid', 'int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300'); + $text = img_picto('', 'company').$form->select_company(GETPOST('socid', 'int'), 'socid', $filteronlist, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusx'); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); @@ -680,7 +680,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $arrayselected = GETPOST('categories', 'array'); - print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'widthcentpercentminusx', 0, 0); print "
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id)); + print $form->select_country((GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).'
'.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', $conf->global->SOCIETE_EMAIL_MANDATORY).''.img_picto('', 'object_email').'
'.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'url', '', $object, 0).''.img_picto('', 'globe').'
'.img_picto('', 'globe').'
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).''; - // print 'skype).'">'; - // print '
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).''; - // print 'twitter).'">'; - // print '
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).''; - // print 'facebook).'">'; - // print '
'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).''; - // print 'linkedin).'">'; - // print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); - print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'; print $formcompany->selectProspectCustomerType($object->client); print '
'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).''; print ''; - print ''; + print ''; + if ($conf->browser->layout == 'phone') print ''; print ''; + print '
'; @@ -1879,15 +1881,18 @@ else || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; + print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; print $form->selectyesno("fournisseur", $object->fournisseur, 1); print '
'; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); } - print ''; + print ''; print ''; + if ($conf->browser->layout == 'phone') print ''; + print ''; @@ -1944,7 +1951,7 @@ else // Country print ''; @@ -1966,15 +1973,16 @@ else // Phone / Fax print ''; - print ''; + print ''; + if ($conf->browser->layout == 'phone') print ''; print ''; - print ''; + print ''; // EMail / Web print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1990,36 +1998,9 @@ else } } } - // if (! empty($conf->socialnetworks->enabled)) - // { - // // Skype - // if (! empty($conf->global->SOCIALNETWORKS_SKYPE)) - // { - // print ''; - // print ''; - // } - // // Twitter - // if (! empty($conf->global->SOCIALNETWORKS_TWITTER)) - // { - // print ''; - // print ''; - // } - // // Facebook - // if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK)) - // { - // print ''; - // print ''; - // } - // // LinkedIn - // if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN)) - // { - // print ''; - // print ''; - // } - // } // Prof ids - $i = 1; $j = 0; + $i = 1; $j = 0; $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); while ($i <= 6) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); @@ -2027,13 +2008,13 @@ else { $key = 'idprof'.$i; - if (($j % 2) == 0) print ''; + if (($j % $NBCOLS) == 0) print ''; $idprof_mandatory = 'SOCIETE_IDPROF'.($i).'_MANDATORY'; print ''; - if (($j % 2) == 1) print ''; + if (($j % $NBCOLS) == ($NBCOLS - 1)) print ''; $j++; } $i++; @@ -2058,7 +2039,7 @@ else print ''; } print ''; - + if ($conf->browser->layout == 'phone') print ''; print ''; + if ($conf->browser->layout == 'phone') print ''; print '"; } @@ -963,14 +963,14 @@ elseif ($object->id > 0) // Tags-Categories if ($conf->categorie->enabled) { - print '"; } From 9fb1766266877f15742627356a680d8c7babb537 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 17:14:28 +0200 Subject: [PATCH 239/490] CSS --- htdocs/core/lib/project.lib.php | 4 ++-- htdocs/projet/class/project.class.php | 8 +++++--- htdocs/projet/index.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 940c22a59e0..f3690694b01 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2226,10 +2226,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print ''; print ''; - print ''; - print ''; + if ($NBCOLS > 1 && ($j % 2 == 1)) print ''; // Vat is used print ''; @@ -1445,11 +1445,11 @@ else //TODO: Place into a function to control showing by country or study better option if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { - print ''; + print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; } @@ -2019,7 +2019,7 @@ else } $i++; } - if ($j % 2 == 1) print ''; + if ($NBCOLS > 0 && $j % 2 == 1) print ''; // VAT is used print ''; print ''; print ''; + print ''; } if (!in_array('declaredprogress', $hiddenfields)) { From ff84fd8118ebe747a9eb07eda0d5dfca19db0cb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 19:01:12 +0200 Subject: [PATCH 247/490] Fix default language of user. Must separate weblangs and pagelangs. --- htdocs/core/website.inc.php | 7 ++++++- htdocs/langs/en_US/website.lang | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index a00de6a3b01..6456fabf5b3 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -60,11 +60,16 @@ if (!is_object($weblangs)) { $weblangs = new Translate('', $conf); } +if (!is_object($pagelangs)) +{ + $pagelangs = new Translate('', $conf); +} if ($pageid > 0) { $websitepage->fetch($pageid); - $weblangs->setDefaultLang($websitepage->lang ? $websitepage->lang : 'auto'); + $weblangs->setDefaultLang(empty($_COOKIE['weblangs-shortcode']) ? 'auto' : $_COOKIE['weblangs-shortcode']); + $pagelangs->setDefaultLang($websitepage->lang ? $websitepage->lang : $weblangs->shortlang); if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) { diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index f4d88b0d606..2c555b40c20 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -57,7 +57,7 @@ NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">

More examples of HTML or dynamic code available on the wiki documentation
. +YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">

To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open directory for public access), syntax is:
<img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">

More examples of HTML or dynamic code available on the wiki documentation
. ClonePage=Clone page/container CloneSite=Clone site SiteAdded=Website added From 8b79b7f074335f2cc3ea77a8b936121cd0b93fd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 20:00:59 +0200 Subject: [PATCH 248/490] Update changelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcbfb1a959c..67cf9513a4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -78,7 +78,7 @@ FIX: we must export company mail address on contact vcard only if contact email FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create FIX: Wrong Sql on getListOfTowns api method FIX: wrong user right's name to top menu "commercial" -FIX: XSS Vulnerability +FIX: XSS Vulnerability reported by Mehmet Kelepçe / Gais Cyber Security ***** ChangeLog for 11.0.3 compared to 11.0.2 ***** FIX: unit price for selected supplier products not set. NaN was used. From 791c4b48b64feba1da952d1aef43d79a3d3fb199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 20:08:35 +0200 Subject: [PATCH 249/490] Fix --- htdocs/projet/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c4a1eb9a71d..6af779a2295 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -580,7 +580,7 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); @@ -871,7 +871,7 @@ elseif ($object->id > 0) print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("ProjectBillTimeDescription"); From 0847f5350a62f44ca098668611a6ab7d4a39eb2a Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Fri, 15 May 2020 23:44:19 +0200 Subject: [PATCH 250/490] TakePOS Auto Order improvements --- htdocs/takepos/css/phone.css | 96 +++++++++++++++++++++++++++++++-- htdocs/takepos/genimg/index.php | 5 +- htdocs/takepos/invoice.php | 30 ++++++----- htdocs/takepos/phone.php | 76 +++++++++++++++++--------- 4 files changed, 164 insertions(+), 43 deletions(-) diff --git a/htdocs/takepos/css/phone.css b/htdocs/takepos/css/phone.css index 0f3606071f0..37434cfc707 100644 --- a/htdocs/takepos/css/phone.css +++ b/htdocs/takepos/css/phone.css @@ -4,6 +4,7 @@ html,body { margin:0; height:100%; width:100%; + background-color: #FFF !important; } .container{ @@ -17,14 +18,14 @@ html,body { .phonerow1{ margin: 0 auto; width: 100%; - height: 40%; + height: auto; min-height: 40%; } .phonerow2{ margin: 0 auto; width: 100%; - height: 40%; + height: auto; } .phonebuttonsrow{ @@ -90,7 +91,71 @@ button.publicphonebutton { text-align: center; overflow: visible; /* removes extra width in IE */ width:33%; - height:90%; + height:50px; + font-weight: bold; + color: #fff; +} + +.phoneblue{ + color: #fff; + background-color: #428bca; + border-color: #357ebd; +} + +.phonegreen{ + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; + font-size:20px; + text-align:center; + width:20px; +} + +.phonetable{ + width:130px; +} + +.phoneqty{ + font-size:24px; + font-weight: bold; + + +} + +.phonered{ + color: #fff; + background-color: #dc3545; + border-color: #dc3545; + font-size:20px; + text-align:center; + width:20px; +} + +.phoneorange{ + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} + +.total{ + width:100% !important; + font-size:24px; +} + +.width24{ + font-size:24px; +} + +.leftcat{ + margin-top:15px; + float:left; + width: 50%; + text-align:center; + height:150px;; + overflow:hidden; + margin-bottom:5px; + font-size:18px; + color:#5B5858; font-weight: bold; } @@ -107,3 +172,28 @@ button.publicphonebutton2 { font-weight: bold; padding: 8px 16px; } + +.div-table-responsive-no-min{ + margin-top:20px; +} + +.comment { + float: left; + width: 100%; + height: auto; +} + +.comment-text-area { + float: left; + width: 80%; + height: auto; +} + +.textinput { + float: left; + width: 100%; + min-height: 75px; + outline: none; + resize: none; + border: 1px solid grey; +} \ No newline at end of file diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index e668b01aacb..fbb388b9aec 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -77,7 +77,10 @@ elseif ($query == "pro") preg_match('@src="([^"]+)"@', $image, $match); $file = array_pop($match); if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); - else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); + else{ + if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) header('Location: '.$file.'&cache=1'); + else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); + } } else { diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 16012022dc9..3b486b7a3bc 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -70,10 +70,12 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == '; + $arrayofcss = array( + '/takepos/css/pos.css.php', + '/takepos/js/jquery.colorbox-min.js' + ); + $arrayofjs = array('/takepos/js/jquery.colorbox-min.js'); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - print ' - - '; } /** @@ -877,6 +879,7 @@ if ($_SESSION["basiclayout"] != 1) print '
'; print ''; } +else print ''; print "\n"; @@ -889,12 +892,11 @@ if ($_SESSION["basiclayout"] == 1) $categories = $categorie->get_full_arbo('product'); $htmlforlines = ''; foreach ($categories as $row) { - $htmlforlines .= ''; - $htmlforlines .= ''; - $htmlforlines .= ''."\n"; + $htmlforlines .= ''."\n"; } $htmlforlines .= '
'; if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { @@ -1936,7 +1941,9 @@ else // Zip / Town print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth50onsmartphone'); - print ''.$form->editfieldkey('Town', 'town', '', $object, 0).''; + print '
'.$form->editfieldkey('Town', 'town', '', $object, 0).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent'); print '
'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id'); + print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Phone', 'phone', GETPOST('phone', 'alpha'), $object, 0).''.img_picto('', 'object_phoning').' '.img_picto('', 'object_phoning').'
'.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).''.img_picto('', 'object_phoning_fax').'
'.img_picto('', 'object_phoning_fax').'
'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''.img_picto('', 'object_email').'
'.img_picto('', 'object_email').'
'.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''.img_picto('', 'globe').'
'.img_picto('', 'globe').'
'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'
'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'
'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'
'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'
'.$form->editfieldkey($idprof, $key, '', $object, 0, 'string', '', !(empty($conf->global->$idprof_mandatory) || !$object->isACompany())).''; print $formcompany->get_input_id_prof($i, $key, $object->$key, $object->country_code); print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1); if (!isOnlyOneLocalTax(2)) @@ -2132,6 +2113,7 @@ else print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Staff', 'effectif_id', '', $object, 0).''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); From bfbe0037b6147c0611642ce10d00141e26e6f8cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 16:29:18 +0200 Subject: [PATCH 238/490] Fix responsive --- htdocs/projet/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e79d5bafa59..c4a1eb9a71d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -680,7 +680,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $arrayselected = GETPOST('categories', 'array'); - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'widthcentpercentminusx', 0, 0); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print "
'.$langs->trans("Categories").''; + print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_PROJECT); foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, '0'); print "
'; - print $projectstatic->getNomUrl(1); + print $projectstatic->getNomUrl(1, '', 0, '', '-', 0 , -1, 'nowraponall'); if (!in_array('projectlabel', $hiddenfields)) print '
'.dol_trunc($objp->title, 24).''; print '
'; + print ''; if ($objp->fk_soc > 0) { $thirdpartystatic->id = $objp->fk_soc; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 554bc84766a..417a825a77d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1026,18 +1026,19 @@ class Project extends CommonObject } /** - * Return clicable name (with picto eventually) + * Return clickable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option Variant ('', 'nolink') + * @param string $option Variant where the link point to ('', 'nolink') * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string * @param string $moreinpopup Text to add into popup * @param string $sep Separator between ref and label if option addlabel is set * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param string $morecss More css on a link * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1) + public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1, $morecss = '') { global $conf, $langs, $user, $hookmanager; @@ -1115,6 +1116,7 @@ class Project extends CommonObject if (!$this->public) $picto = 'project'; $linkstart = ''; $linkend = ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 3d6903065ab..f9cab81f43c 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -318,7 +318,7 @@ if ($resql) } print '
'; + print ''; if ($obj->socid) { $companystatic->id = $obj->socid; From 4a9960797bc84dd65c74131382ec7eede79a342d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 17:27:12 +0200 Subject: [PATCH 240/490] responsive --- htdocs/societe/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 96a9dd7deed..681d4a37fc9 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1401,7 +1401,7 @@ else } $i++; } - if ($j % 2 == 1) print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); - print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; + print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; From e583dc0a7ff7e183062f49cb56eb887df1cfd758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 May 2020 18:07:17 +0200 Subject: [PATCH 241/490] enhance free email --- htdocs/core/class/html.form.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 999e0463789..d6a4c437c50 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6690,6 +6690,14 @@ class Form text: $.trim(match[1]) + " <" + match[2] + ">" } } + var match = params.term.match(new RegExp("^" + REGEX_EMAIL + "$", "i")); + // console.log(match); + if (match !== null) { + return { + id: $.trim(match[1]) + " <" + match[1] + ">", + text: $.trim(match[1]) + " <" + match[1] + ">" + } + } return null; }'; } From 762ca96203f6bd92050ca547a9dbe48c3324f2a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 18:28:15 +0200 Subject: [PATCH 242/490] FIX #13841 --- htdocs/admin/dict.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2ad521f79a2..b7f65ddf91f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -644,6 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'formula' && empty($_POST['formula'])) continue; + if ($value == 'dayrule' && empty($_POST['dayrule'])) continue; if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position' if ((!isset($_POST[$value]) || $_POST[$value] == '') && (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory From a73eccf70d937f15bd9ebb4040e766845f177c9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 May 2020 18:41:46 +0200 Subject: [PATCH 243/490] FIX env of browser not loaded in website --- htdocs/core/website.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index b5053fcc814..a00de6a3b01 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -27,6 +27,18 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; +// Detection browser (copy of code from main.inc.php) +if (isset($_SERVER["HTTP_USER_AGENT"]) && is_object($conf) && empty($conf->browser->name)) +{ + $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); + $conf->browser->name = $tmp['browsername']; + $conf->browser->os = $tmp['browseros']; + $conf->browser->version = $tmp['browserversion']; + $conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet' + //var_dump($conf->browser); + + if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover = 1; +} // Define $website if (!is_object($website)) { From 1bc87652918b53acae42d2eae34e3eb17fdd801d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 May 2020 18:42:41 +0200 Subject: [PATCH 244/490] enhance free email --- htdocs/core/class/html.form.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 95ed7e26a13..1097692d61a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6692,6 +6692,10 @@ class Form text: $.trim(match[1]) + " <" + match[2] + ">" } } + if (params.term.indexOf("<") >= 0) { + // Return null to disable tag creation + return null; + } var match = params.term.match(new RegExp("^" + REGEX_EMAIL + "$", "i")); // console.log(match); if (match !== null) { From 76bb57bc6bfed3726d11b6c0c02a510b04139ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 May 2020 18:50:37 +0200 Subject: [PATCH 245/490] enhance free email --- htdocs/core/class/html.form.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1097692d61a..49758d55be7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6699,9 +6699,10 @@ class Form var match = params.term.match(new RegExp("^" + REGEX_EMAIL + "$", "i")); // console.log(match); if (match !== null) { + var pos = params.term.indexOf("@"); return { - id: $.trim(match[1]) + " <" + match[1] + ">", - text: $.trim(match[1]) + " <" + match[1] + ">" + id: $.trim(match[1].substring(0, pos)) + " <" + match[1] + ">", + text: $.trim(match[1].substring(0, pos)) + " <" + match[1] + ">" } } return null; From 62e0bfbb5f4e42e0cd4d1220fc8d111f1706f316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 May 2020 18:53:59 +0200 Subject: [PATCH 246/490] enhance free email --- htdocs/core/lib/project.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f3690694b01..b0179c966c7 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2226,7 +2226,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print '
'; - print $projectstatic->getNomUrl(1, '', 0, '', '-', 0 , -1, 'nowraponall'); + print $projectstatic->getNomUrl(1, '', 0, '', '-', 0, -1, 'nowraponall'); if (!in_array('projectlabel', $hiddenfields)) print '
'.dol_trunc($objp->title, 24).''; print '
'; @@ -2288,7 +2288,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $total_plannedworkload += $plannedworkload; if (!in_array('plannedworkload', $hiddenfields)) { - print ''.($plannedworkload ?convertSecondToTime($plannedworkload) : '').''.($plannedworkload ? convertSecondToTime($plannedworkload) : '').''.$langs->trans('Qty').''.$langs->trans('TotalTTCShort').''.$langs->trans('Qty').'
'; + $htmlforlines .= '
'; $htmlforlines .= $row['label']; - $htmlforlines .= '
'; $htmlforlines .= '
'; @@ -910,12 +912,11 @@ if ($_SESSION["basiclayout"] == 1) $prods = $object->getObjectsInCateg("product"); $htmlforlines = ''; foreach ($prods as $row) { - $htmlforlines .= '
'; - $htmlforlines .= $row->label; - $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; - $htmlforlines .= '
'; print $htmlforlines; @@ -991,7 +992,7 @@ if ($placeid > 0) } $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= '
'; - if ($_SESSION["basiclayout"] == 1) $htmlforlines .= $line->qty." x "; + if ($_SESSION["basiclayout"] == 1) $htmlforlines .= ''.$line->qty." x "; //if ($line->product_label) $htmlforlines.= ''.$line->product_label.''; if (isset($line->product_type)) { @@ -1026,7 +1027,8 @@ if ($placeid > 0) } } if (!empty($line->array_options['options_order_notes'])) $htmlforlines .= "
(".$line->array_options['options_order_notes'].")"; - if ($_SESSION["basiclayout"] != 1) + if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '
  '; + if ($_SESSION["basiclayout"] != 1) { $moreinfo = ''; $moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht); diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 90f0aa363dc..113e92ec3bb 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -62,26 +62,34 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI * View */ -// Title -$title = 'TakePOS - Dolibarr '.DOL_VERSION; -if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; -$head = ' - - -'; -top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - -print ''; - if ($action == "productinfo") { $prod = new Product($db); $prod->fetch($idproduct); - print "".$prod->label."
"; + print ''; + print "
".$prod->label."
"; print ''; print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; - print ''; +} +elseif ($action == "publicpreorder") { + print ''; + print "

"; + print '
+ +
'; + print '
'; +} +elseif ($action == "publicpayment") { + $langs->loadLangs(array("orders")); + print '

'.$langs->trans('StatusOrderDelivered').'

'; + print ''; + print '
'; +} +elseif ($action == "checkplease") { + print ''; + print ''; + print '
'; } elseif ($action == "editline") { $placeid = GETPOST('placeid', 'int'); @@ -99,13 +107,22 @@ elseif ($action == "editline") { print "
".$prod->description; print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } } } else { +// Title +$title = 'TakePOS - Dolibarr '.DOL_VERSION; +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; +$head = ' + + +'; +$arrayofcss = array('/takepos/css/phone.css'); +top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> - + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; ?> @@ -301,18 +327,18 @@ function CheckPlease(){ print ''; } else { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } ?> -
-
-
-
+
+
+
+
Date: Sat, 16 May 2020 00:07:13 +0200 Subject: [PATCH 251/490] Fix travis --- htdocs/takepos/phone.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 113e92ec3bb..b876b42bc98 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -114,15 +114,15 @@ elseif ($action == "editline") { } } else { -// Title -$title = 'TakePOS - Dolibarr '.DOL_VERSION; -if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; -$head = ' + // Title + $title = 'TakePOS - Dolibarr '.DOL_VERSION; + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; + $head = ' '; -$arrayofcss = array('/takepos/css/phone.css'); -top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + $arrayofcss = array('/takepos/css/phone.css'); + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> '."\n"; } + elseif ($type == 'organization') + { + $companyname = $mysoc->name; + $url = $mysoc->url; + + $ret = ''."\n"; + $ret .= ''."\n"; + } elseif ($type == 'blogpost') { if (!empty($websitepage->author_alias)) @@ -581,7 +616,7 @@ function getStructuredData($type, $data = array()) $pageurl = str_replace('__WEBSITE_KEY__', $website->ref, $pageurl); $title = str_replace('__WEBSITE_KEY__', $website->ref, $title); - $image = str_replace('__WEBSITE_KEY__', $website->ref, $image); + $image = 'medias/'.str_replace('__WEBSITE_KEY__', $website->ref, $image); $companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname); $description = str_replace('__WEBSITE_KEY__', $website->ref, $description); @@ -598,6 +633,7 @@ function getStructuredData($type, $data = array()) "image": [ "'.dol_escape_json($image).'" ], + "dateCreated": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'", "datePublished": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'", "dateModified": "'.dol_print_date($websitepage->date_modification, 'dayhourrfc').'", "author": { @@ -611,9 +647,20 @@ function getStructuredData($type, $data = array()) "@type": "ImageObject", "url": "/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'" } - }, - "description": "'.dol_escape_json($description).'" - }'."\n"; + },'."\n"; + if ($websitepage->keywords) { + $ret .= '"keywords": ['; + $i = 0; + $arrayofkeywords = explode(',', $websitepage->keywords); + foreach($arrayofkeywords as $keyword) { + $ret.= '"'.dol_escape_json($keyword).'"'; + $i++; + if ($i < count($arrayofkeywords)) $ret .= ', '; + } + $ret .= '],'."\n"; + } + $ret .= '"description": "'.dol_escape_json($description).'"'; + $ret .= "\n".'}'."\n"; $ret .= ''."\n"; } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 62140ba5d89..de65e05d41e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3745,6 +3745,13 @@ class Societe extends CommonObject $this->instagram_url = empty($conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_INSTAGRAM_URL; $this->youtube_url = empty($conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_YOUTUBE_URL; $this->github_url = empty($conf->global->MAIN_INFO_SOCIETE_GITHUB_URL) ? '' : $conf->global->MAIN_INFO_SOCIETE_GITHUB_URL; + $this->socialnetworks = array(); + if (! empty($this->facebook_url)) $this->socialnetworks['facebook'] = $this->facebook_url; + if (! empty($this->twitter_url)) $this->socialnetworks['twitter'] = $this->twitter_url; + if (! empty($this->linkedin_url)) $this->socialnetworks['linkedin'] = $this->linkedin_url; + if (! empty($this->instagram_url)) $this->socialnetworks['instagram'] = $this->instagram_url; + if (! empty($this->youtube_url)) $this->socialnetworks['youtube'] = $this->youtube_url; + if (! empty($this->github_url)) $this->socialnetworks['github'] = $this->github_url; // Id prof generiques $this->idprof1 = empty($conf->global->MAIN_INFO_SIREN) ? '' : $conf->global->MAIN_INFO_SIREN; From 9370f71d018f5cd486850255b707af6a8dda58a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 May 2020 20:03:56 +0200 Subject: [PATCH 266/490] Fix hardcoded value --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index b3419d2faae..f83a38e83cd 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -551,7 +551,7 @@ function getStructuredData($type, $data = array()) "@type": "SoftwareApplication", "name": "'.dol_escape_json($data['name']).'", "operatingSystem": "'.dol_escape_json($data['os']).'", - "applicationCategory": "https://schema.org/GameApplication", + "applicationCategory": "https://schema.org/'.$data['applicationCategory'].'", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "'.$data['ratingvalue'].'", From 02d4ecb21c6b4b858e13443ba8b0d592e4972aa6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 May 2020 20:08:01 +0200 Subject: [PATCH 267/490] Fix url for youtube --- htdocs/core/lib/website.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index f83a38e83cd..aa65e80086f 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -582,14 +582,17 @@ function getStructuredData($type, $data = array()) "@type": "ContactPoint", "contactType": "Contact", "email": "'.dol_escape_json($mysoc->email).'" - },'; + },'."\n"; if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= '"sameAs": ['; $i = 0; foreach($mysoc->socialnetworks as $key => $value) { if ($key == 'linkedin') { $ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"'; - } else { + } elseif ($key == 'youtube') { + $ret.= '"https://www.'.$key.'.com/user/'.dol_escape_json($value).'"'; + } + else { $ret.= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"'; } $i++; From cf96383bf92b93b6492ba89172c00b0f8caf4262 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 18 May 2020 10:44:55 +0200 Subject: [PATCH 268/490] Fix : entity was missing in actioncomm fetch --- htdocs/comm/action/class/actioncomm.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 98b910fdfca..1d86f1eba08 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -572,6 +572,7 @@ class ActionComm extends CommonObject $sql = "SELECT a.id,"; $sql.= " a.id as ref,"; + $sql.= " a.entity,"; $sql.= " a.ref_ext,"; $sql.= " a.datep,"; $sql.= " a.datep2,"; @@ -608,6 +609,7 @@ class ActionComm extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->id; + $this->entity = $obj->entity; $this->ref = $obj->ref; $this->ref_ext = $obj->ref_ext; From baa502a224c92fb795abf3599f08fb67e783d835 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 18 May 2020 10:54:25 +0200 Subject: [PATCH 269/490] Fix third merge issue with contact roles --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a2235097811..8a1b26e9d33 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1576,7 +1576,7 @@ class Contact extends CommonObject public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'socpeople' + 'socpeople', 'societe_contacts' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); From 3d9d5d0ad522a76a65d8a9daaf35b2b693c5a138 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 18 May 2020 11:03:32 +0200 Subject: [PATCH 270/490] Fix : entity was missing in expedition fetch --- htdocs/expedition/class/expedition.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 70e3683b22c..838cbd87152 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -527,7 +527,7 @@ class Expedition extends CommonObject // Check parameters if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet, e.billed"; + $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet, e.billed"; $sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; $sql.= ", e.fk_shipping_method, e.tracking_number"; @@ -555,6 +555,7 @@ class Expedition extends CommonObject $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->ref = $obj->ref; $this->socid = $obj->socid; $this->ref_customer = $obj->ref_customer; From 729cc4fd6fee89f9957d3d588e491f5d8ac74315 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2020 13:26:33 +0200 Subject: [PATCH 271/490] Fix do not show full path --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index aa65e80086f..baee3bd9bd5 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -520,7 +520,7 @@ function includeContainer($containerref) $tmpoutput = ob_get_contents(); ob_end_clean(); - print "\n".''."\n"; + print "\n".''."\n"; print preg_replace(array('/^.*]*>/ims', '/<\/body>.*$/ims'), array('', ''), $tmpoutput); if (!$res) From a9d1519f966163a092a6d994fe6cbb13f472090d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 18 May 2020 14:52:33 +0200 Subject: [PATCH 272/490] FIX php error if multicompany disabled --- htdocs/compta/paiement/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 848cc20d483..27086713b07 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -342,7 +342,7 @@ if ($resql) print '
'.$langs->trans('Bill').''.$langs->trans('Company').''.$langs->trans('Entity').''.$langs->trans('Entity').''.$langs->trans('ExpectedToPay').''.$langs->trans('PayedByThisPayment').''.$langs->trans('RemainderToPay').''; $mc->getInfo($objp->entity); print $mc->label; From d3ac33ce20040c0d192d59a2a20f130c6bde6386 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2020 14:53:35 +0200 Subject: [PATCH 273/490] Fix json-ld file --- htdocs/core/lib/website.lib.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index baee3bd9bd5..782c22a7d33 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -533,8 +533,9 @@ function includeContainer($containerref) /** * Return HTML content to add structured data for an article, news or Blog Post. + * Use the json-ld format. * - * @param string $type 'blogpost', 'product', 'software'... + * @param string $type 'blogpost', 'product', 'software', 'organization', ... * @param array $data Array of data parameters for structured data * @return string HTML content */ @@ -575,13 +576,13 @@ function getStructuredData($type, $data = array()) $ret .= '{ "@context": "https://schema.org", "@type": "Organization", - "name": "'.dol_escape_json($companyname).'", - "url": "'.$url.'", - "logo": "/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'", + "name": "'.dol_escape_json($data['name'] ? $data['name'] : $companyname).'", + "url": "'.dol_escape_json($data['url'] ? $data['url'] : $url).'", + "logo": "'.($data['logo'] ? dol_escape_json($data['logo']) : '/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo)).'", "contactPoint": { "@type": "ContactPoint", "contactType": "Contact", - "email": "'.dol_escape_json($mysoc->email).'" + "email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'" },'."\n"; if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= '"sameAs": ['; From 18a19dafe513942a8a099cac13e60303a7eb3dc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2020 15:01:29 +0200 Subject: [PATCH 274/490] Update cron_run_jobs.php --- scripts/cron/cron_run_jobs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 104443feba1..6438b13e884 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -223,7 +223,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs)>0)) // Reload langs $langcode = (empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT); if (! empty($user->conf->MAIN_LANG_DEFAULT)) $langcode = $user->conf->MAIN_LANG_DEFAULT; - if($langs->getDefaultLang() != $langcode) $langs->setDefaultLang($langcode); + if ($langs->getDefaultLang() != $langcode) $langs->setDefaultLang($langcode); } //If date_next_jobs is less of current date, execute the program, and store the execution time of the next execution in database From 756c1fd73d4f9993379b7c63018f19f67699f63d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2020 15:26:04 +0200 Subject: [PATCH 275/490] Fix tooltip message --- htdocs/admin/security_other.php | 7 +++++-- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index f0ad4352b60..f642cd64182 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -177,7 +177,11 @@ $sessiontimeout = ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout; print '
'.$langs->trans("SessionTimeOut").''; -print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"))); +if (ini_get("session.gc_probability") == 0) { + print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", ini_get("session.gc_maxlifetime"))); +} else { + print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"), ini_get("session.gc_maxlifetime"))); +} print ''; print ' '.strtolower($langs->trans("Seconds")); @@ -185,7 +189,6 @@ print '
'.$langs->trans("MAIN_APPLICATION_TITLE").''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5e485c86dbc..84c64a23615 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1145,6 +1145,7 @@ AvailableModules=Available app/modules ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules). SessionTimeOut=Time out for session SessionExplanation=This number guarantees that the session will never expire before this delay, if the session cleaner is done by Internal PHP session cleaner (and nothing else). Internal PHP session cleaner does not guarantee that the session will expire after this delay. It will expire, after this delay, and when the session cleaner is run, so every %s/%s access, but only during access made by other sessions (if value is 0, it means clearing of session is done only by an external process).
Note: on some servers with an external session cleaning mechanism (cron under debian, ubuntu ...), the sessions can be destroyed after a period defined by an external setup, no matter what the value entered here is. +SessionsPurgedByExternalSystem=Sessions on this server seems to be cleaned by an external mechanism (cron under debian, ubuntu ...), probably every %s seconds (= value of parameter session.gc_maxlifetime), so changing the value here has no effect. You must ask the server administrator to change session delay. TriggersAvailable=Available triggers TriggersDesc=Triggers are files that will modify the behavior of Dolibarr workflow once copied into the directory htdocs/core/triggers. They realize new actions, activated on Dolibarr events (new company creation, invoice validation, ...). TriggerDisabledByName=Triggers in this file are disabled by the -NORUN suffix in their name. From 514009ca6d65fee96e48b89f0b79784fda4cf924 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2020 15:47:21 +0200 Subject: [PATCH 276/490] Add field position in llx_website --- .travis.yml | 4 ++++ htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_website.sql | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 688d706331d..9958556d42d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -404,6 +404,10 @@ script: php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log + php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log + php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log + php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log + # Enable modules not enabled into original dump php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log echo $? diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 210fe31d1ef..782516353b2 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -33,4 +33,4 @@ -- For v13 - +ALTER TABLE llx_website ADD COLUMN position integer DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website.sql index 743d4ec9ca8..717052f795c 100644 --- a/htdocs/install/mysql/tables/llx_website.sql +++ b/htdocs/install/mysql/tables/llx_website.sql @@ -35,6 +35,7 @@ CREATE TABLE llx_website fk_user_creat integer, fk_user_modif integer, date_creation datetime, + position integer DEFAULT 0, tms timestamp, import_key varchar(14) -- import key ) ENGINE=innodb; From 76663ae3e8a82dd7489ffc3438f4d481f12985e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2020 22:40:32 +0200 Subject: [PATCH 277/490] Fix canonical tag --- htdocs/core/lib/website2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index fc56a489d75..0ab35c55fd8 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -196,7 +196,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) else dol_print_error($db); } // Add canonical reference - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; // Add manifest.json on homepage $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; $tplcontent .= ''."\n"; From 7b29ce036a06325e464d39ff7c08af6e13103bac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 00:50:30 +0200 Subject: [PATCH 278/490] Fix input of virtual host and canonical url --- htdocs/core/lib/website2.lib.php | 4 +++- htdocs/website/index.php | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 0ab35c55fd8..ce1f27b49fc 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -196,7 +196,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) else dol_print_error($db); } // Add canonical reference - $tplcontent .= ''."\n"; + if ($object->virtualhost) { + $tplcontent .= ''."\n"; + } // Add manifest.json on homepage $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; $tplcontent .= ''."\n"; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 4f7cba09e89..70cfe780f55 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -681,6 +681,7 @@ if ($action == 'addcontainer') //$objectpage->htmlheader = preg_replace('/]*>\n/ims', '', $objectpage->htmlheader); + $objectpage->htmlheader = preg_replace('/]*rel="alternate[^>]*>\n/ims', '', $objectpage->htmlheader); $objectpage->htmlheader = preg_replace('/]*rel="canonical[^>]*>\n/ims', '', $objectpage->htmlheader); // Now loop to fetch JS @@ -1155,7 +1156,8 @@ if ($action == 'updatecss') if (GETPOSTISSET('virtualhost')) { - if (GETPOST('virtualhost', 'alpha') && !preg_match('/^http/', GETPOST('virtualhost', 'alpha'))) + $tmpvirtualhost = preg_replace('/\/$/', '', GETPOST('virtualhost', 'alpha')); + if ($tmpvirtualhost && !preg_match('/^http/', $tmpvirtualhost)) { $error++; setEventMessages($langs->trans('ErrorURLMustStartWithHttp', $langs->transnoentitiesnoconv("VirtualHost")), null, 'errors'); @@ -1169,7 +1171,7 @@ if ($action == 'updatecss') $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only } - $object->virtualhost = GETPOST('virtualhost', 'alpha'); + $object->virtualhost = $tmpvirtualhost; $object->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $object->otherlang = join(',', $arrayotherlang); $object->use_manifest = GETPOST('use_manifest', 'alpha'); From d35a24ee76b0639d7b3697ba95e0149b053421fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 01:36:33 +0200 Subject: [PATCH 279/490] Removed not expected file --- htdocs/website/index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 htdocs/website/index.html diff --git a/htdocs/website/index.html b/htdocs/website/index.html deleted file mode 100644 index e69de29bb2d..00000000000 From 3e187f8ce06325d0a4e3fca35205006640abe290 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 03:36:29 +0200 Subject: [PATCH 280/490] Fix add check on size limit --- htdocs/compta/prelevement/card.php | 4 ---- htdocs/website/index.php | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index cb3205a0e70..d81e101be3d 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -272,10 +272,6 @@ if ($id > 0 || $ref) print '
'.$langs->trans("TransMetod").''; print $form->selectarray("methode", $object->methodes_trans); print '
'.$langs->trans("File").''; - print ''; - print '
'; - print '

'; print '
'; print ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 70cfe780f55..a48b6d92548 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3069,6 +3069,7 @@ if ($action == 'importsite') print ''.$langs->trans("ZipOfWebsitePackageToImport").'

'; + print ''; print ''; print ''; print ''; From b3a17c8da4550e620fd7e87c9a473d9c3ae09053 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 04:21:38 +0200 Subject: [PATCH 281/490] Look and feel v12 --- htdocs/admin/security.php | 14 +++++++------- htdocs/admin/security_file.php | 4 ++-- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index f016c305a15..d9d61673c5e 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -168,9 +168,9 @@ elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') exit; } -if ($action == 'maj_pattern') +if ($action == 'updatepattern') { - $pattern = GETPOST("pattern"); + $pattern = GETPOST("pattern", "alpha"); $explodePattern = explode(';', $pattern); $patternInError = false; @@ -184,6 +184,7 @@ if ($action == 'maj_pattern') if (!$patternInError) { dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: security.php"); exit; } @@ -336,11 +337,9 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { print ''; print '
'; - print ''; - print ''; - print '
'; + print '
'; print ''.$langs->trans("Save").''; - print '
'; + print '
'; print '

'; print ''."\n"; @@ -1505,9 +1482,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (preg_match('/^(http|\/\/)/i', $jsfile)) { print ''."\n"; - } - else - { + } else { print ''."\n"; } } @@ -1606,9 +1581,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $logouttext .= ''; $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin'); $logouttext .= ''; - } - else - { + } else { $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin opacitymedium'); } @@ -1625,11 +1598,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead { if ($result == 0) $toprightmenu .= $hookmanager->resPrint; // add - else + else { $toprightmenu = $hookmanager->resPrint; // replace - } - else - { + } + } else { $toprightmenu .= $result; // For backward compatibility } @@ -2362,8 +2334,9 @@ function main_area($title = '') print ''."\n"; print ''; print ''."\n"; print ''."\n"; print ''."\n"; @@ -2398,9 +2371,7 @@ function getHelpParamFor($helppagename, $langs) $helpbaseurl = '%s'; $helppage = $helppagename; $mode = 'local'; - } - else - { + } else { // If WIKI URL $reg = array(); if (preg_match('/^es/i', $langs->defaultlang)) @@ -2538,10 +2509,8 @@ if (!function_exists("llxFooter")) { $title = img_warning().' '.$langs->trans('CoreErrorTitle'); print ajax_dialog($title, $langs->trans('CoreErrorMessage')); - } - // html version - else - { + } else { + // html version $msg = img_warning().' '.$langs->trans('CoreErrorMessage'); print '
'.$msg.'
'; } @@ -2683,9 +2652,7 @@ if (!function_exists("llxFooter")) \n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 4005e6a2ed5..1ef1f9c1f50 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -60,14 +60,14 @@ if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type = constant('TEST_DB_FORCE_TYP // Set properties specific to conf file $conf->file->main_limit_users = $dolibarr_main_limit_users; -$conf->file->mailing_limit_sendbyweb = $dolibarr_mailing_limit_sendbyweb; -$conf->file->mailing_limit_sendbycli = $dolibarr_mailing_limit_sendbycli; +$conf->file->mailing_limit_sendbyweb = $dolibarr_mailing_limit_sendbyweb; +$conf->file->mailing_limit_sendbycli = $dolibarr_mailing_limit_sendbycli; $conf->file->main_authentication = empty($dolibarr_main_authentication) ? '' : $dolibarr_main_authentication; // Identification mode $conf->file->main_force_https = empty($dolibarr_main_force_https) ? '' : $dolibarr_main_force_https; // Force https -$conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug) +$conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug) $conf->file->instance_unique_id = empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; // Unique id of instance $conf->file->dol_document_root = array('main' => (string) DOL_DOCUMENT_ROOT); // Define array of document root directories ('/home/htdocs') -$conf->file->dol_url_root = array('main' => (string) DOL_URL_ROOT); // Define array of url root path ('' or '/dolibarr') +$conf->file->dol_url_root = array('main' => (string) DOL_URL_ROOT); // Define array of url root path ('' or '/dolibarr') if (!empty($dolibarr_main_document_root_alt)) { // dolibarr_main_document_root_alt can contains several directories @@ -132,9 +132,7 @@ if (!defined('NOREQUIREDB')) $langs->setDefaultLang('auto'); $langs->load("website"); print $langs->trans("SorryWebsiteIsCurrentlyOffLine"); - } - else - { + } else { print "SorryWebsiteIsCurrentlyOffLine"; } print ''; @@ -225,9 +223,7 @@ if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'" is allowed to connect for the moment.'."\n"; $nexturl = DOL_URL_ROOT.'/user/logout.php'; print 'Please try later or click here to disconnect and change login user...'."\n"; - } - else - { + } else { print 'Sorry, your application is offline. Only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'" is allowed to connect for the moment.'."\n"; $nexturl = DOL_URL_ROOT.'/'; print 'Please try later or click here to change login user...'."\n"; diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index b2534ee92dd..9970026a524 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -155,20 +155,14 @@ if (!empty($hashp)) // We remove first level of directory $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir //var_dump($original_file); exit; - } - else - { + } else { accessforbidden('Bad link. File is from another module part.', 0, 0, 1); } - } - else - { + } else { $modulepart = $moduleparttocheck; $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir } - } - else - { + } else { $langs->load("errors"); accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1); } @@ -208,9 +202,7 @@ elseif (isset($_GET["publictakepos"])) if (! empty($conf->global->TAKEPOS_AUTO_ORDER)) { $accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable } -} -else -{ +} else { // Basic protection (against external users only) if ($user->socid > 0) { @@ -290,9 +282,8 @@ if ($modulepart == 'barcode') { $result = $module->buildBarCode($code, $encoding, $readable); } -} -else // Open and return file -{ +} else { + // Open and return file clearstatcache(); $filename = basename($fullpath_original_file); @@ -314,9 +305,7 @@ else // Open and return file { top_httphead($type); header('Content-Disposition: inline; filename="'.basename($fullpath_original_file).'"'); - } - else - { + } else { top_httphead('image/png'); header('Content-Disposition: inline; filename="'.basename($fullpath_original_file).'"'); } From b70efb5d7b4bdbb76afd8549b62ba64a0b4ca2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 01:10:33 +0200 Subject: [PATCH 325/490] add new rule --- .travis.yml | 4 ++-- htdocs/filefunc.inc.php | 11 +++-------- htdocs/zapier/admin/setup.php | 3 +-- htdocs/zapier/class/hook.class.php | 2 +- htdocs/zapier/hook_agenda.php | 8 ++------ htdocs/zapier/hook_card.php | 8 ++------ htdocs/zapier/hook_document.php | 4 +--- 7 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9958556d42d..752dd572371 100644 --- a/.travis.yml +++ b/.travis.yml @@ -291,8 +291,8 @@ script: # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi + phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . + #if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e echo diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index b70419de5f4..d1a33d24344 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -87,9 +87,7 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done // Note: If calling page was an index.php not into htdocs (ie comm/index.php, ...), then this redirect will fails, // but we don't want to change this because when URL is correct, we must be sure the redirect to install/index.php will be correct. $path = ''; - } - else - { + } else { // If what we look is not index.php, we can try to guess location of root. May not work all the time. // There is no real solution, because the only way to know the apache url relative path is to have it into conf file. // If it fails to find correct $path, then only solution is to ask user to enter the correct URL to index.php or install/index.php @@ -114,9 +112,7 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done if (!empty($dolibarr_strict_mode)) { error_reporting(E_ALL | E_STRICT); -} -else -{ +} else { error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED)); } @@ -156,8 +152,7 @@ if (!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) { $csrfattack = false; if (empty($_SERVER['HTTP_REFERER'])) $csrfattack = true; // An evil browser was used - else - { + else { $tmpa = parse_url($_SERVER['HTTP_HOST']); $tmpb = parse_url($_SERVER['HTTP_REFERER']); if ((empty($tmpa['host']) ? $tmpa['path'] : $tmpa['host']) != (empty($tmpb['host']) ? $tmpb['path'] : $tmpb['host'])) $csrfattack = true; diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php index e608ece5bb7..8a74b525c2b 100644 --- a/htdocs/zapier/admin/setup.php +++ b/htdocs/zapier/admin/setup.php @@ -110,8 +110,7 @@ if ($action == 'edit') { print '
'; print ''.$langs->trans("Modify").''; print '
'; - } else - { + } else { print '
'.$langs->trans("NothingToSetup"); } } diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index b985c77434e..280780f8f25 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -398,7 +398,7 @@ class Hook extends CommonObject { $result = $this->fetchCommon($id, $ref); if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); + //$this->fetchLines(); } return $result; } diff --git a/htdocs/zapier/hook_agenda.php b/htdocs/zapier/hook_agenda.php index ca046392cec..b036057cb04 100644 --- a/htdocs/zapier/hook_agenda.php +++ b/htdocs/zapier/hook_agenda.php @@ -45,9 +45,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else -{ +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); @@ -217,9 +215,7 @@ if ($object->id > 0) if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; - } - else - { + } else { print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index c2755892716..660e972cf28 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -338,9 +338,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($user->rights->mymodule->write) { print ''.$langs->trans("Modify").''."\n"; - } - else - { + } else { print ''.$langs->trans('Modify').''."\n"; } @@ -367,9 +365,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($user->rights->mymodule->delete) { print ''.$langs->trans('Delete').''."\n"; - } - else - { + } else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/zapier/hook_document.php b/htdocs/zapier/hook_document.php index cdc5f8c7ddf..4c390a118e2 100644 --- a/htdocs/zapier/hook_document.php +++ b/htdocs/zapier/hook_document.php @@ -132,9 +132,7 @@ if ($object->id) print ''; dol_fiche_end(); -} -else -{ +} else { accessforbidden('', 0, 0); } From ee6fadd0d57dd74c8ecfa52f6f18c530c6928486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 01:41:27 +0200 Subject: [PATCH 326/490] add new rule --- dev/tools/dolibarr-postgres2mysql.php | 21 +- dev/translation/autotranslator.class.php | 19 +- dev/translation/sanity_check_en_langfiles.php | 6 +- dev/translation/strip_language_file.php | 9 +- htdocs/admin/agenda.php | 6 +- htdocs/admin/agenda_extsites.php | 9 +- htdocs/admin/agenda_other.php | 30 +- htdocs/admin/agenda_reminder.php | 12 +- htdocs/admin/agenda_xcal.php | 3 +- htdocs/admin/bank.php | 12 +- htdocs/admin/barcode.php | 15 +- htdocs/admin/bom.php | 33 +- htdocs/admin/boxes.php | 15 +- htdocs/admin/chequereceipts.php | 12 +- htdocs/admin/clicktodial.php | 6 +- htdocs/admin/commande.php | 48 +- htdocs/admin/company.php | 42 +- htdocs/admin/compta.php | 3 +- htdocs/admin/confexped.php | 3 +- htdocs/admin/const.php | 21 +- htdocs/admin/contract.php | 30 +- htdocs/admin/dav.php | 9 +- htdocs/admin/debugbar.php | 3 +- htdocs/admin/defaultvalues.php | 24 +- htdocs/admin/delais.php | 3 +- htdocs/admin/dict.php | 42 +- .../class/PSWebServiceLibrary.class.php | 22 +- .../admin/dolistore/class/dolistore.class.php | 6 +- htdocs/admin/ecm.php | 9 +- htdocs/admin/emailcollector_card.php | 30 +- htdocs/admin/emailcollector_list.php | 3 +- htdocs/admin/expedition.php | 27 +- htdocs/admin/expensereport.php | 30 +- htdocs/admin/expensereport_ik.php | 3 +- htdocs/admin/expensereport_rules.php | 27 +- htdocs/admin/external_rss.php | 21 +- htdocs/admin/facture.php | 48 +- htdocs/admin/fckeditor.php | 9 +- htdocs/admin/fichinter.php | 36 +- htdocs/admin/geoipmaxmind.php | 6 +- htdocs/admin/holiday.php | 30 +- htdocs/admin/ihm.php | 6 +- htdocs/admin/ldap.php | 21 +- htdocs/admin/ldap_contacts.php | 9 +- htdocs/admin/ldap_groups.php | 9 +- htdocs/admin/ldap_members.php | 9 +- htdocs/admin/ldap_members_types.php | 9 +- htdocs/admin/ldap_users.php | 15 +- htdocs/admin/limits.php | 9 +- htdocs/admin/livraison.php | 30 +- htdocs/admin/loan.php | 6 +- htdocs/admin/mailing.php | 3 +- htdocs/admin/mailman.php | 15 +- htdocs/admin/mails.php | 42 +- htdocs/admin/mails_emailing.php | 39 +- htdocs/admin/mails_senderprofile_list.php | 3 +- htdocs/admin/mails_templates.php | 45 +- htdocs/admin/menus.php | 3 +- htdocs/admin/menus/edit.php | 30 +- htdocs/admin/menus/index.php | 6 +- htdocs/admin/menus/other.php | 3 +- htdocs/admin/modulehelp.php | 18 +- htdocs/admin/modules.php | 65 +- htdocs/admin/mrp.php | 33 +- htdocs/admin/multicurrency.php | 9 +- htdocs/admin/notification.php | 9 +- htdocs/admin/oauth.php | 3 +- htdocs/admin/oauthlogintokens.php | 15 +- htdocs/admin/payment.php | 6 +- htdocs/admin/pdf.php | 3 +- htdocs/admin/perms.php | 3 +- htdocs/admin/prelevement.php | 3 +- htdocs/admin/propal.php | 48 +- htdocs/admin/receiptprinter.php | 6 +- htdocs/admin/reception_setup.php | 24 +- htdocs/admin/resource.php | 3 +- htdocs/admin/security.php | 24 +- htdocs/admin/security_other.php | 21 +- htdocs/admin/sms.php | 9 +- htdocs/admin/socialnetworks.php | 6 +- htdocs/admin/spip.php | 6 +- htdocs/admin/stock.php | 30 +- htdocs/admin/supplier_invoice.php | 27 +- htdocs/admin/supplier_order.php | 36 +- htdocs/admin/supplier_payment.php | 21 +- htdocs/admin/supplier_proposal.php | 45 +- htdocs/admin/syslog.php | 6 +- htdocs/admin/system/about.php | 3 +- htdocs/admin/system/constall.php | 6 +- htdocs/admin/system/database-tables.php | 6 +- htdocs/admin/system/database.php | 3 +- htdocs/admin/system/dbtable.php | 3 +- htdocs/admin/system/dolibarr.php | 18 +- htdocs/admin/system/filecheck.php | 33 +- htdocs/admin/system/modules.php | 9 +- htdocs/admin/system/perf.php | 36 +- htdocs/admin/system/phpinfo.php | 21 +- htdocs/admin/system/xdebug.php | 6 +- htdocs/admin/taxes.php | 18 +- htdocs/admin/ticket.php | 3 +- htdocs/admin/ticket_public.php | 3 +- htdocs/admin/tools/dolibarr_export.php | 17 +- htdocs/admin/tools/dolibarr_import.php | 3 +- htdocs/admin/tools/export.php | 3 +- htdocs/admin/tools/export_files.php | 3 +- htdocs/admin/tools/listevents.php | 6 +- htdocs/admin/tools/listsessions.php | 6 +- htdocs/admin/tools/update.php | 6 +- htdocs/admin/translation.php | 30 +- htdocs/admin/user.php | 33 +- htdocs/admin/usergroup.php | 18 +- htdocs/admin/website.php | 24 +- htdocs/admin/website_options.php | 3 +- htdocs/admin/workflow.php | 9 +- htdocs/api/admin/index.php | 12 +- htdocs/api/class/api.class.php | 3 +- htdocs/api/class/api_access.class.php | 3 +- htdocs/api/class/api_login.class.php | 3 +- htdocs/api/class/api_setup.class.php | 33 +- htdocs/api/index.php | 3 +- htdocs/asset/admin/setup.php | 3 +- htdocs/asset/card.php | 6 +- htdocs/asset/class/asset.class.php | 3 +- htdocs/asset/class/asset_type.class.php | 24 +- htdocs/asset/document.php | 3 +- htdocs/asset/list.php | 3 +- htdocs/asset/type.php | 18 +- htdocs/asterisk/cidlookup.php | 3 +- htdocs/asterisk/wrapper.php | 6 +- htdocs/barcode/codeinit.php | 15 +- htdocs/barcode/printsheet.php | 3 +- htdocs/blockedlog/admin/blockedlog.php | 6 +- htdocs/blockedlog/admin/blockedlog_list.php | 24 +- htdocs/blockedlog/ajax/block-info.php | 3 +- htdocs/blockedlog/class/authority.class.php | 15 +- htdocs/blockedlog/class/blockedlog.class.php | 20 +- htdocs/bom/bom_agenda.php | 6 +- htdocs/bom/bom_card.php | 15 +- htdocs/bom/bom_document.php | 3 +- htdocs/bom/bom_list.php | 15 +- htdocs/bom/class/api_boms.class.php | 3 +- htdocs/bom/class/bom.class.php | 21 +- htdocs/bom/tpl/objectline_create.tpl.php | 3 +- htdocs/bookmarks/admin/bookmark.php | 3 +- htdocs/bookmarks/bookmarks.lib.php | 6 +- htdocs/bookmarks/card.php | 18 +- htdocs/bookmarks/class/bookmark.class.php | 15 +- htdocs/bookmarks/list.php | 12 +- htdocs/cashdesk/admin/cashdesk.php | 9 +- htdocs/cashdesk/affContenu.php | 6 +- htdocs/cashdesk/class/Auth.class.php | 3 +- htdocs/cashdesk/class/Facturation.class.php | 18 +- htdocs/cashdesk/facturation.php | 12 +- htdocs/cashdesk/facturation_dhtml.php | 6 +- htdocs/cashdesk/facturation_verif.php | 15 +- htdocs/cashdesk/index.php | 6 +- htdocs/cashdesk/index_verif.php | 6 +- htdocs/cashdesk/tpl/liste_articles.tpl.php | 3 +- htdocs/cashdesk/tpl/validation1.tpl.php | 3 +- htdocs/cashdesk/validation_verif.php | 18 +- htdocs/comm/action/card.php | 66 +- htdocs/comm/action/class/actioncomm.class.php | 69 +- .../comm/action/class/cactioncomm.class.php | 9 +- htdocs/comm/action/class/ical.class.php | 9 +- htdocs/comm/action/document.php | 6 +- htdocs/comm/action/index.php | 82 +- htdocs/comm/action/list.php | 21 +- htdocs/comm/action/pertype.php | 36 +- htdocs/comm/action/peruser.php | 42 +- htdocs/comm/action/rapport/index.php | 3 +- htdocs/comm/card.php | 54 +- htdocs/comm/contact.php | 3 +- htdocs/comm/index.php | 36 +- htdocs/comm/mailing/advtargetemailing.php | 3 +- htdocs/comm/mailing/card.php | 99 +- htdocs/comm/mailing/cibles.php | 39 +- .../mailing/class/advtargetemailing.class.php | 21 +- .../html.formadvtargetemailing.class.php | 6 +- htdocs/comm/mailing/class/mailing.class.php | 39 +- htdocs/comm/mailing/index.php | 9 +- htdocs/comm/mailing/list.php | 9 +- htdocs/comm/multiprix.php | 3 +- htdocs/comm/propal/card.php | 45 +- .../comm/propal/class/api_proposals.class.php | 6 +- htdocs/comm/propal/class/propal.class.php | 200 +- htdocs/comm/propal/contact.php | 12 +- htdocs/comm/propal/document.php | 3 +- htdocs/comm/propal/index.php | 6 +- htdocs/comm/propal/list.php | 15 +- htdocs/comm/propal/stats/index.php | 9 +- htdocs/comm/prospect/index.php | 3 +- htdocs/comm/prospect/recap-prospect.php | 3 +- htdocs/comm/recap-client.php | 3 +- htdocs/comm/remise.php | 18 +- htdocs/comm/remx.php | 60 +- htdocs/commande/card.php | 63 +- htdocs/commande/class/api_orders.class.php | 3 +- htdocs/commande/class/commande.class.php | 200 +- htdocs/commande/contact.php | 12 +- htdocs/commande/customer.php | 3 +- htdocs/commande/document.php | 6 +- htdocs/commande/index.php | 6 +- htdocs/commande/list.php | 9 +- htdocs/commande/orderstoinvoice.php | 27 +- htdocs/commande/stats/index.php | 9 +- htdocs/core/actions_addupdatedelete.inc.php | 41 +- htdocs/core/actions_builddoc.inc.php | 6 +- htdocs/core/actions_comments.inc.php | 9 +- htdocs/core/actions_extrafields.inc.php | 33 +- htdocs/core/actions_fetchobject.inc.php | 3 +- htdocs/core/actions_linkedfiles.inc.php | 17 +- htdocs/core/actions_massactions.inc.php | 78 +- htdocs/core/actions_sendmails.inc.php | 15 +- htdocs/core/actions_setmoduleoptions.inc.php | 9 +- htdocs/core/ajax/ajaxdirpreview.php | 14 +- htdocs/core/ajax/ajaxdirtree.php | 2 +- htdocs/core/ajax/check_notifications.php | 6 +- htdocs/core/ajax/loadinplace.php | 6 +- htdocs/core/ajax/saveinplace.php | 15 +- htdocs/core/ajax/vatrates.php | 3 +- htdocs/core/ajax/ziptown.php | 5 +- htdocs/core/boxes/box_actions.php | 3 +- htdocs/core/boxes/box_activity.php | 3 +- htdocs/core/boxes/box_bookmarks.php | 3 +- htdocs/core/boxes/box_external_rss.php | 3 +- htdocs/core/boxes/box_factures_imp.php | 3 +- htdocs/core/boxes/box_ficheinter.php | 6 +- .../boxes/box_graph_invoices_permonth.php | 12 +- .../box_graph_invoices_supplier_permonth.php | 12 +- .../core/boxes/box_graph_orders_permonth.php | 12 +- .../box_graph_orders_supplier_permonth.php | 12 +- .../boxes/box_graph_product_distribution.php | 6 +- .../boxes/box_graph_propales_permonth.php | 12 +- htdocs/core/boxes/box_produits.php | 3 +- .../core/boxes/box_produits_alerte_stock.php | 6 +- htdocs/core/boxes/box_project.php | 3 +- htdocs/core/boxes/box_services_contracts.php | 6 +- htdocs/core/boxes/box_services_expired.php | 6 +- htdocs/core/boxes/box_supplier_orders.php | 3 +- ...box_supplier_orders_awaiting_reception.php | 3 +- htdocs/core/boxes/modules_boxes.php | 9 +- htdocs/core/class/CMailFile.class.php | 51 +- htdocs/core/class/CSMSFile.class.php | 15 +- htdocs/core/class/ccountry.class.php | 12 +- htdocs/core/class/comment.class.php | 9 +- .../core/class/commondocgenerator.class.php | 5 +- htdocs/core/class/commoninvoice.class.php | 39 +- htdocs/core/class/commonobject.class.php | 383 +-- htdocs/core/class/commonobjectline.class.php | 3 +- htdocs/core/class/conf.class.php | 3 +- htdocs/core/class/coreobject.class.php | 33 +- htdocs/core/class/cstate.class.php | 9 +- htdocs/core/class/ctypent.class.php | 12 +- htdocs/core/class/cunits.class.php | 24 +- htdocs/core/class/discount.class.php | 51 +- htdocs/core/class/dolgeoip.class.php | 18 +- htdocs/core/class/dolgraph.class.php | 33 +- .../core/class/emailsenderprofile.class.php | 3 +- htdocs/core/class/evalmath.class.php | 6 +- htdocs/core/class/events.class.php | 6 +- htdocs/core/class/extrafields.class.php | 88 +- htdocs/core/class/extralanguages.class.php | 37 +- htdocs/core/class/fileupload.class.php | 9 +- htdocs/core/class/fiscalyear.class.php | 18 +- htdocs/core/class/hookmanager.class.php | 3 +- htdocs/core/class/html.form.class.php | 398 +-- .../core/class/html.formaccounting.class.php | 18 +- htdocs/core/class/html.formactions.class.php | 12 +- htdocs/core/class/html.formadmin.class.php | 12 +- htdocs/core/class/html.formcompany.class.php | 36 +- htdocs/core/class/html.formcontract.class.php | 12 +- htdocs/core/class/html.formfile.class.php | 138 +- .../class/html.formintervention.class.php | 12 +- htdocs/core/class/html.formmail.class.php | 54 +- htdocs/core/class/html.formmargin.class.php | 3 +- htdocs/core/class/html.formother.class.php | 56 +- htdocs/core/class/html.formprojet.class.php | 36 +- htdocs/core/class/html.formpropal.class.php | 9 +- htdocs/core/class/html.formsms.class.php | 30 +- .../class/html.formsocialcontrib.class.php | 9 +- htdocs/core/class/html.formwebsite.class.php | 18 +- htdocs/core/class/infobox.class.php | 20 +- htdocs/core/class/interfaces.class.php | 15 +- htdocs/core/class/ldap.class.php | 92 +- htdocs/core/class/lessc.class.php | 2663 +++++++++-------- htdocs/core/class/link.class.php | 18 +- htdocs/core/class/menubase.class.php | 21 +- htdocs/core/class/notify.class.php | 30 +- htdocs/core/class/openid.class.php | 12 +- htdocs/core/class/rssparser.class.php | 36 +- htdocs/core/class/smtps.class.php | 51 +- htdocs/core/class/stats.class.php | 21 +- htdocs/core/class/translate.class.php | 17 +- htdocs/core/class/utils.class.php | 44 +- htdocs/core/commonfieldsinexport.inc.php | 3 +- htdocs/core/datepicker.php | 18 +- htdocs/core/db/DoliDB.class.php | 17 +- htdocs/core/db/mssql.class.php | 57 +- htdocs/core/db/mysqli.class.php | 27 +- htdocs/core/db/pgsql.class.php | 24 +- htdocs/core/db/sqlite3.class.php | 15 +- htdocs/core/extrafieldsinexport.inc.php | 3 +- .../filemanagerdol/connectors/php/basexml.php | 6 +- .../connectors/php/commands.php | 24 +- .../core/filemanagerdol/connectors/php/io.php | 12 +- .../filemanagerdol/connectors/php/util.php | 6 +- htdocs/core/get_info.php | 5 +- htdocs/core/get_menudiv.php | 2 +- htdocs/core/lib/admin.lib.php | 63 +- htdocs/core/lib/agenda.lib.php | 6 +- htdocs/core/lib/ajax.lib.php | 3 +- htdocs/core/lib/bank.lib.php | 3 +- htdocs/core/lib/barcode.lib.php | 9 +- htdocs/core/lib/company.lib.php | 39 +- htdocs/core/lib/cron.lib.php | 3 +- htdocs/core/lib/date.lib.php | 33 +- htdocs/core/lib/doc.lib.php | 9 +- htdocs/core/lib/doleditor.lib.php | 3 +- htdocs/core/lib/ecm.lib.php | 3 +- htdocs/core/lib/files.lib.php | 101 +- htdocs/core/lib/format_cards.lib.php | 3 +- htdocs/core/lib/functions.lib.php | 247 +- htdocs/core/lib/functions2.lib.php | 68 +- htdocs/core/lib/functionsnumtoword.lib.php | 3 +- htdocs/core/lib/geturl.lib.php | 12 +- htdocs/core/lib/images.lib.php | 12 +- htdocs/core/lib/invoice2.lib.php | 6 +- htdocs/core/lib/json.lib.php | 8 +- htdocs/core/lib/ldap.lib.php | 3 +- htdocs/core/lib/memory.lib.php | 18 +- htdocs/core/lib/modulebuilder.lib.php | 15 +- htdocs/core/lib/parsemd.lib.php | 3 +- htdocs/core/lib/payments.lib.php | 15 +- htdocs/core/lib/pdf.lib.php | 52 +- htdocs/core/lib/price.lib.php | 20 +- htdocs/core/lib/product.lib.php | 3 +- htdocs/core/lib/project.lib.php | 27 +- htdocs/core/lib/security.lib.php | 18 +- htdocs/core/lib/security2.lib.php | 23 +- htdocs/core/lib/sendings.lib.php | 12 +- htdocs/core/lib/signature.lib.php | 6 +- htdocs/core/lib/tax.lib.php | 33 +- htdocs/core/lib/ticket.lib.php | 21 +- htdocs/core/lib/treeview.lib.php | 9 +- htdocs/core/lib/usergroups.lib.php | 105 +- htdocs/core/lib/website.lib.php | 47 +- htdocs/core/lib/xcal.lib.php | 9 +- htdocs/core/login/functions_dolibarr.php | 12 +- htdocs/core/login/functions_ldap.php | 6 +- htdocs/core/login/functions_openid.php | 6 +- htdocs/core/menus/standard/auguria.lib.php | 12 +- htdocs/core/menus/standard/auguria_menu.php | 26 +- htdocs/core/menus/standard/eldy.lib.php | 18 +- htdocs/core/menus/standard/eldy_menu.php | 26 +- htdocs/core/menus/standard/empty.php | 20 +- htdocs/core/modules/DolibarrModules.class.php | 89 +- htdocs/core/modules/action/modules_action.php | 9 +- htdocs/core/modules/action/rapport.pdf.php | 3 +- .../core/modules/bank/doc/pdf_ban.modules.php | 15 +- .../bank/doc/pdf_sepamandate.modules.php | 15 +- .../barcode/mod_barcode_product_standard.php | 18 +- .../bom/doc/doc_generic_bom_odt.modules.php | 20 +- htdocs/core/modules/bom/mod_bom_standard.php | 3 +- .../modules/cheque/mod_chequereceipt_mint.php | 3 +- .../modules/cheque/modules_chequereceipts.php | 9 +- .../doc/doc_generic_order_odt.modules.php | 20 +- .../commande/doc/pdf_einstein.modules.php | 38 +- .../commande/doc/pdf_eratosthene.modules.php | 53 +- .../modules/commande/mod_commande_marbre.php | 3 +- .../doc/doc_generic_contract_odt.modules.php | 20 +- .../contract/doc/pdf_strato.modules.php | 32 +- .../modules/contract/mod_contract_serpis.php | 3 +- .../modules/dons/html_cerfafr.modules.php | 30 +- .../doc/doc_generic_shipment_odt.modules.php | 25 +- .../expedition/doc/pdf_espadon.modules.php | 53 +- .../expedition/doc/pdf_merou.modules.php | 30 +- .../expedition/doc/pdf_rouget.modules.php | 50 +- .../expedition/mod_expedition_safor.php | 3 +- .../doc/pdf_standard.modules.php | 38 +- .../expensereport/mod_expensereport_jade.php | 3 +- .../modules/export/export_csv.modules.php | 6 +- .../export/export_excel2007new.modules.php | 12 +- .../doc/doc_generic_invoice_odt.modules.php | 17 +- .../modules/facture/doc/pdf_crabe.modules.php | 47 +- .../facture/doc/pdf_sponge.modules.php | 59 +- .../core/modules/facture/mod_facture_mars.php | 3 +- .../modules/facture/mod_facture_terre.php | 3 +- .../fichinter/doc/pdf_soleil.modules.php | 29 +- htdocs/core/modules/fichinter/mod_pacific.php | 3 +- .../modules/fichinter/modules_fichinter.php | 9 +- .../modules/holiday/mod_holiday_madonna.php | 3 +- .../modules/import/import_csv.modules.php | 50 +- .../modules/import/import_xlsx.modules.php | 41 +- .../livraison/doc/pdf_typhon.modules.php | 32 +- .../modules/livraison/mod_livraison_jade.php | 3 +- .../mailings/advthirdparties.modules.php | 9 +- .../modules/mailings/contacts1.modules.php | 12 +- .../core/modules/mailings/fraise.modules.php | 9 +- .../modules/mailings/modules_mailings.php | 6 +- .../core/modules/mailings/pomme.modules.php | 3 +- .../modules/mailings/thirdparties.modules.php | 15 +- .../thirdparties_services_expired.modules.php | 6 +- .../modules/mailings/xinputfile.modules.php | 11 +- .../modules/mailings/xinputuser.modules.php | 6 +- .../modules/member/doc/pdf_standard.class.php | 19 +- htdocs/core/modules/member/modules_cards.php | 9 +- htdocs/core/modules/modAgenda.class.php | 3 +- htdocs/core/modules/modBlockedLog.class.php | 3 +- .../mrp/doc/doc_generic_mo_odt.modules.php | 20 +- htdocs/core/modules/mrp/mod_mo_standard.php | 3 +- .../modules/oauth/github_oauthcallback.php | 3 +- .../modules/oauth/google_oauthcallback.php | 3 +- .../oauth/stripelive_oauthcallback.php | 3 +- .../oauth/stripetest_oauthcallback.php | 3 +- .../modules/payment/mod_payment_cicada.php | 3 +- .../modules/printing/printgcp.modules.php | 15 +- .../modules/printing/printipp.modules.php | 6 +- .../doc/pdf_standardlabel.class.php | 10 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 10 +- .../modules/printsheet/modules_labels.php | 9 +- .../doc/doc_generic_product_odt.modules.php | 20 +- .../product/doc/pdf_standard.modules.php | 18 +- .../product/mod_codeproduct_elephant.php | 9 +- .../modules/product/modules_product.class.php | 3 +- .../doc/doc_generic_project_odt.modules.php | 47 +- .../project/doc/pdf_baleine.modules.php | 29 +- .../project/doc/pdf_beluga.modules.php | 26 +- .../project/doc/pdf_timespent.modules.php | 29 +- .../modules/project/mod_project_simple.php | 6 +- .../task/doc/doc_generic_task_odt.modules.php | 29 +- .../modules/project/task/mod_task_simple.php | 6 +- .../doc/doc_generic_proposal_odt.modules.php | 20 +- .../modules/propale/doc/pdf_azur.modules.php | 53 +- .../modules/propale/doc/pdf_cyan.modules.php | 56 +- .../modules/propale/mod_propale_marbre.php | 6 +- .../modules/rapport/pdf_paiement.class.php | 9 +- .../doc/doc_generic_reception_odt.modules.php | 23 +- .../reception/doc/pdf_squille.modules.php | 47 +- .../modules/reception/mod_reception_beryl.php | 3 +- .../societe/doc/doc_generic_odt.modules.php | 17 +- .../societe/mod_codeclient_elephant.php | 9 +- .../modules/societe/mod_codeclient_monkey.php | 24 +- .../societe/mod_codecompta_aquarium.php | 12 +- .../societe/mod_codecompta_digitaria.php | 15 +- .../modules/societe/modules_societe.class.php | 3 +- .../doc/doc_generic_stock_odt.modules.php | 20 +- .../stock/doc/pdf_standard.modules.php | 47 +- .../stock/doc/pdf_stdmovement.modules.php | 53 +- .../doc/pdf_canelle.modules.php | 35 +- .../mod_facture_fournisseur_cactus.php | 3 +- ...doc_generic_supplier_order_odt.modules.php | 23 +- .../supplier_order/doc/pdf_cornas.modules.php | 50 +- .../doc/pdf_muscadet.modules.php | 47 +- .../mod_commande_fournisseur_muguet.php | 3 +- .../doc/pdf_standard.modules.php | 32 +- .../mod_supplier_payment_bronan.php | 3 +- ..._generic_supplier_proposal_odt.modules.php | 23 +- .../doc/pdf_aurore.modules.php | 47 +- .../mod_supplier_proposal_marbre.php | 6 +- .../core/modules/syslog/mod_syslog_file.php | 3 +- .../core/modules/syslog/mod_syslog_syslog.php | 3 +- .../user/doc/doc_generic_user_odt.modules.php | 14 +- .../doc/doc_generic_usergroup_odt.modules.php | 23 +- htdocs/core/photos_resize.php | 17 +- htdocs/core/search.php | 3 +- htdocs/core/search_page.php | 3 +- .../core/tpl/admin_extrafields_edit.tpl.php | 3 +- .../core/tpl/admin_extrafields_view.tpl.php | 3 +- htdocs/core/tpl/bloc_comment.tpl.php | 6 +- htdocs/core/tpl/card_presend.tpl.php | 9 +- htdocs/core/tpl/contacts.tpl.php | 3 +- .../tpl/extrafields_list_print_fields.tpl.php | 3 +- .../tpl/extrafields_list_search_input.tpl.php | 3 +- .../tpl/extrafields_list_search_title.tpl.php | 3 +- htdocs/core/tpl/extrafields_view.tpl.php | 9 +- htdocs/core/tpl/filemanager.tpl.php | 5 +- htdocs/core/tpl/list_print_total.tpl.php | 3 +- htdocs/core/tpl/login.tpl.php | 3 +- htdocs/core/tpl/massactions_pre.tpl.php | 6 +- htdocs/core/tpl/object_discounts.tpl.php | 3 +- htdocs/core/tpl/objectline_create.tpl.php | 21 +- htdocs/core/tpl/objectline_edit.tpl.php | 6 +- htdocs/core/tpl/objectline_view.tpl.php | 12 +- htdocs/core/tpl/resource_view.tpl.php | 3 +- .../interface_20_all_Logevents.class.php | 3 +- ...terface_50_modAgenda_ActionsAuto.class.php | 14 +- ..._modBlockedlog_ActionsBlockedLog.class.php | 3 +- ...odMailmanspip_Mailmanspipsynchro.class.php | 18 +- ...terface_50_modTicket_TicketEmail.class.php | 3 +- .../interface_80_modStripe_Stripe.class.php | 3 +- htdocs/core/website.inc.php | 3 +- htdocs/stripe/admin/stripe.php | 18 +- htdocs/stripe/charge.php | 12 +- htdocs/stripe/class/actions_stripe.class.php | 6 +- htdocs/stripe/class/stripe.class.php | 36 +- htdocs/stripe/config.php | 3 +- htdocs/stripe/payout.php | 6 +- htdocs/stripe/transaction.php | 6 +- htdocs/supplier_proposal/card.php | 33 +- .../class/supplier_proposal.class.php | 156 +- htdocs/supplier_proposal/contact.php | 12 +- htdocs/supplier_proposal/document.php | 3 +- htdocs/supplier_proposal/index.php | 6 +- htdocs/supplier_proposal/list.php | 6 +- htdocs/support/inc.php | 6 +- htdocs/takepos/admin/bar.php | 3 +- htdocs/takepos/admin/orderprinters.php | 6 +- htdocs/takepos/admin/receipt.php | 18 +- htdocs/takepos/admin/setup.php | 6 +- htdocs/takepos/admin/terminal.php | 9 +- htdocs/takepos/ajax/ajax.php | 3 +- htdocs/takepos/genimg/index.php | 6 +- htdocs/takepos/index.php | 12 +- htdocs/takepos/invoice.php | 36 +- htdocs/takepos/pay.php | 6 +- htdocs/takepos/phone.php | 3 +- htdocs/takepos/reduction.php | 6 +- htdocs/theme/eldy/global.inc.php | 6 +- htdocs/theme/eldy/theme_vars.inc.php | 3 +- htdocs/theme/md/style.css.php | 6 +- htdocs/theme/md/theme_vars.inc.php | 3 +- htdocs/ticket/agenda.php | 3 +- htdocs/ticket/card.php | 3 +- htdocs/ticket/class/actions_ticket.class.php | 3 +- htdocs/ticket/class/ticket.class.php | 12 +- htdocs/ticket/document.php | 3 +- htdocs/ticket/list.php | 3 +- htdocs/ticket/messaging.php | 3 +- htdocs/ticket/stats/index.php | 9 +- htdocs/user/bank.php | 18 +- htdocs/user/card.php | 180 +- htdocs/user/class/api_users.class.php | 6 +- htdocs/user/class/user.class.php | 179 +- htdocs/user/class/userbankaccount.class.php | 12 +- htdocs/user/class/usergroup.class.php | 39 +- htdocs/user/clicktodial.php | 8 +- htdocs/user/document.php | 3 +- htdocs/user/group/card.php | 36 +- htdocs/user/group/ldap.php | 12 +- htdocs/user/group/list.php | 6 +- htdocs/user/group/perms.php | 9 +- htdocs/user/hierarchy.php | 9 +- htdocs/user/home.php | 15 +- htdocs/user/ldap.php | 12 +- htdocs/user/list.php | 6 +- htdocs/user/note.php | 3 +- htdocs/user/notify/card.php | 27 +- htdocs/user/param_ihm.php | 9 +- htdocs/user/passwordforgotten.php | 24 +- htdocs/user/perms.php | 12 +- htdocs/variants/combinations.php | 12 +- htdocs/variants/create.php | 3 +- htdocs/webservices/admin/index.php | 3 +- htdocs/webservices/server_actioncomm.php | 15 +- htdocs/webservices/server_category.php | 6 +- htdocs/webservices/server_contact.php | 12 +- htdocs/webservices/server_invoice.php | 21 +- htdocs/webservices/server_order.php | 24 +- htdocs/webservices/server_other.php | 3 +- htdocs/webservices/server_payment.php | 3 +- .../webservices/server_productorservice.php | 42 +- htdocs/webservices/server_project.php | 15 +- .../webservices/server_supplier_invoice.php | 9 +- htdocs/webservices/server_thirdparty.php | 24 +- htdocs/webservices/server_user.php | 42 +- 565 files changed, 5190 insertions(+), 8632 deletions(-) diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php index f2794455ca3..c17a73dfe12 100644 --- a/dev/tools/dolibarr-postgres2mysql.php +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -76,14 +76,12 @@ function getfieldname($l) if (preg_match("/`(.*)`/", $l, $regs)) { if ($regs[1]) return $regs[1]; - else - return null; + else return null; } // if its not in quotes, then it should (we hope!) be the first "word" on the line, up to the first space. elseif (preg_match("/([^\ ]*)/", trim($l), $regs)) { if ($regs[1]) return $regs[1]; - else - return null; + else return null; } } @@ -102,8 +100,7 @@ function formatsize($s) return sprintf("%.1f", round($s / 1024, 1)) . "K"; elseif ($s < pow(2, 30)) return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M"; - else - return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G"; + else return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G"; } /** @@ -146,8 +143,7 @@ function pg2mysql_large($infilename, $outfilename) if ($c % 2 != 0) { if ($inquotes) $inquotes = false; - else - $inquotes = true; + else $inquotes = true; } if ($linenum % 10000 == 0) { @@ -329,8 +325,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $num = $regs[1]; if ($num <= 255) $line = preg_replace("/ character varying\([0-9]*\)/", " varchar($num)", $line); - else - $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line); + else $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line); } // character varying with no size, we will default to varchar(255) if (preg_match("/ character varying/", $line)) { @@ -352,8 +347,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $num = $regs[1]; if ($num <= 255) $line = preg_replace("/ character\([0-9]*\)/", " varchar($num)", $line); - else - $line = preg_replace("/ character\([0-9]*\)/", " text", $line); + else $line = preg_replace("/ character\([0-9]*\)/", " text", $line); } // timestamps $line = str_replace(" timestamp with time zone", " datetime", $line); @@ -465,8 +459,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) if ($c % 2 != 0) { if ($inquotes) $inquotes = false; - else - $inquotes = true; + else $inquotes = true; // echo "inquotes=$inquotes\n"; } } while (substr($lines[$linenumber], - 3, - 1) != ");" || $inquotes); diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index f9657482c86..b51515a42cb 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -77,7 +77,7 @@ class autoTranslator $files = $this->getTranslationFilesArray($this->_refLang); $counter = 1; - foreach($files as $file) + foreach ($files as $file) { if ($this->_limittofile && $this->_limittofile != $file) continue; $counter++; @@ -94,7 +94,7 @@ class autoTranslator // If we must process all languages $arraytmp=dol_dir_list($this->_langDir, 'directories', 0); - foreach($arraytmp as $dirtmp) + foreach ($arraytmp as $dirtmp) { if ($dirtmp['name'] === $this->_refLang) continue; // We discard source language $tmppart=explode('_', $dirtmp['name']); @@ -112,7 +112,7 @@ class autoTranslator } // Process translation of source file for each target languages - foreach($targetlangs as $my_destlang) + foreach ($targetlangs as $my_destlang) { $this->_translatedFiles = array(); @@ -124,15 +124,14 @@ class autoTranslator echo "File not found: " . $destPath . ". We generate it.
\n"; $this->createTranslationFile($destPath, $my_destlang); } - else - { + else { echo "Updating file: " . $destPath . "
\n"; } // Translate lines $fileContentDest = file($destPath, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); $newlines=0; - foreach($fileContent as $line){ + foreach ($fileContent as $line){ $key = $this->getLineKey($line); $value = $this->getLineValue($line); if ($key && $value) @@ -167,7 +166,7 @@ class autoTranslator fwrite($fp, "\n"); fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\n"); fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\n"); - foreach($this->_translatedFiles[$file] as $line) { + foreach ($this->_translatedFiles[$file] as $line) { fwrite($fp, $line . "\n"); } fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\n"); @@ -209,7 +208,7 @@ class autoTranslator { //print "key =".$key."\n"; - foreach($content as $line) { + foreach ($content as $line) { $destKey = $this->getLineKey($line); $destValue = $this->getLineValue($line); // If translated return @@ -273,8 +272,8 @@ class autoTranslator private function getTranslationFilesArray($lang) { $dir = new DirectoryIterator($this->_langDir.$lang); - while($dir->valid()) { - if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { + while ($dir->valid()) { + if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { $files[] = $dir->getFilename(); } $dir->next(); diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index f568ba2b04b..0268fc94ed8 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -360,16 +360,14 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a $unused[$value] = $line; echo $line; // $trad contains the \n } - else - { + else { unset($output); //print 'X'.$output.'Y'; } } if (empty($unused)) print "No string not used found.\n"; - else - { + else { $filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang'; print "Strings in en_US that are never used are saved into file ".$filetosave.":\n"; file_put_contents($filetosave, implode("", $unused)); diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index ce28ca5de63..5a94192b2bd 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -80,8 +80,8 @@ $aEnglish = array(); if ($filesToProcess == 'all') { $dir = new DirectoryIterator('htdocs/langs/'.$lPrimary); - while($dir->valid()) { - if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { + while ($dir->valid()) { + if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) { $files[] = $dir->getFilename(); } $dir->next(); @@ -94,7 +94,7 @@ else $filesToProcess=explode(',', $filesToProcess); // Loop on each file -foreach($filesToProcess as $fileToProcess) +foreach ($filesToProcess as $fileToProcess) { $lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess; $lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess; @@ -285,8 +285,7 @@ foreach($filesToProcess as $fileToProcess) print "Key $key is redundant in file $lPrimaryFile (line: $cnt) - Already found into ".$fileFirstFound[$key]." (line: ".$lineFirstFound[$key].").\n"; continue; } - else - { + else { $fileFirstFound[$key] = $fileToProcess; $lineFirstFound[$key] = $cnt; } diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index b6231a45a10..52a1adc4fd2 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -62,8 +62,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -108,8 +107,7 @@ if ($action == "save" && empty($cancel)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); $db->rollback(); } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 77113ff1e13..dd5d04732ff 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -108,8 +108,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -163,14 +162,12 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1); } -else -{ +else { if (empty($conf->global->AGENDA_DISABLE_EXT)) { print ''.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'off').''; } } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index c5b196146d5..a9e5bccd71b 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -60,8 +60,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -74,8 +73,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -121,14 +119,12 @@ elseif ($action == 'specimen') // For orders header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -214,8 +210,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -263,8 +258,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $module = new $classname($db, $specimenthirdparty); if (method_exists($module, 'info')) print $module->info($langs); - else - print $module->description; + else print $module->description; print "\n"; // Active @@ -277,14 +271,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } - else - { + else { print img_picto($langs->trans("Enabled"), 'switch_on'); } print ""; } - else - { + else { print '
"; @@ -296,8 +288,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -347,8 +338,7 @@ if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } -else -{ +else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 3d51bd3158c..d9b7ead6f2e 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -55,8 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -69,8 +68,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -114,14 +112,12 @@ elseif ($action == 'specimen') // For orders header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 7df74ba6a9d..b6d0472c3af 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -55,8 +55,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("SaveFailed"), null, 'errors'); } diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index b048dea9565..662dc517436 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -128,8 +128,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -359,8 +358,7 @@ foreach ($dirmodels as $reldir) { print "'; // Active @@ -448,8 +446,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) { print ''; print ''; } -else -{ +else { print '"; @@ -509,8 +506,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { print ''; print ''; } -else -{ +else { print '"; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index e577942ab21..90a2525de05 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -81,8 +81,7 @@ elseif ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -265,19 +264,16 @@ if ($resql) //print $url; print ''; } - else - { + else { print $langs->trans("FormatNotSupportedByGenerator"); } } - else - { + else { print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder; } } } - else - { + else { print $langs->trans("ChooseABarCode"); } print ''; @@ -412,8 +408,7 @@ if ($conf->product->enabled) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 6d37def3187..26f3fe75858 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -58,8 +58,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -96,14 +95,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -161,8 +158,7 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -179,8 +175,7 @@ elseif ($action == 'set_BOM_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -262,8 +257,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -328,8 +322,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -399,8 +392,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '"; @@ -412,8 +404,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -442,8 +433,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -489,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c6ff9e94749..46f91e8b366 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -84,8 +84,7 @@ if ($action == 'add') { $i++; } } - else - { + else { setEventMessages($db->lasterror(), null, 'errors'); $error++; } @@ -135,8 +134,7 @@ if ($action == 'add') { $db->commit(); $action = ''; } - else - { + else { $db->rollback(); } } @@ -205,8 +203,7 @@ if ($action == 'switch') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -346,8 +343,7 @@ foreach ($boxtoadd as $box) { $logo = $box->boximg; } - else - { + else { $logo = preg_replace("/^object_/i", "", $box->boximg); } @@ -411,8 +407,7 @@ foreach ($boxactivated as $key => $box) { $logo = $box->boximg; } - else - { + else { $logo = preg_replace("/^object_/i", "", $box->boximg); } diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 8b5e7c433bf..397f289eaee 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -61,8 +61,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -84,8 +83,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -182,8 +180,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -260,8 +257,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 36205697e89..56f4f076e54 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -47,8 +47,7 @@ if ($action == 'setvalue' && $user->admin) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -134,8 +133,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) { print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); } - else - { + else { $langs->load("errors"); print '
'.$langs->trans("WarningClickToDialUserSetupNotComplete").'
'; } diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 76f04d94c15..f1f22203fa2 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -67,8 +67,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -105,14 +104,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -170,8 +167,7 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -188,8 +184,7 @@ elseif ($action == 'set_ORDER_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -218,8 +213,7 @@ elseif ($action == 'setribchq') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -235,8 +229,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -252,8 +245,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -335,8 +327,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -401,8 +392,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -472,8 +462,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '"; @@ -485,8 +474,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -520,8 +508,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -595,14 +582,12 @@ if (empty($conf->facture->enabled)) } print ""; } - else - { + else { print "".$langs->trans("NoActiveBankAccountDefined").""; } } } - else - { + else { print ''.$langs->trans("BankModuleNotActive").''; } } @@ -682,8 +667,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f33a3ea6f93..b5ae98378c9 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -85,8 +85,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) $s = $mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label; dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity); } - else - { + else { dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity); } @@ -165,14 +164,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) $tmparray = explode(':', $result); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } - else - { + else { $error++; setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); @@ -229,8 +226,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity); } - else - { + else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1", 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -241,8 +237,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity); } - else - { + else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -252,8 +247,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -302,16 +296,14 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors'); @@ -583,8 +575,7 @@ if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -598,8 +589,7 @@ if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -613,8 +603,7 @@ if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -628,8 +617,7 @@ if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -643,8 +631,7 @@ if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; @@ -658,8 +645,7 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { print ''; } - else - { + else { print $countrynotdefined; } print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 3ccc2a213ac..7c1c64369ad 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -102,8 +102,7 @@ if ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fd93b0fa83d..3f5cc1cd920 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -136,8 +136,7 @@ if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } -else -{ +else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index bc22a2020fb..9da7fb10bbf 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -86,8 +86,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) $constvalue = ""; $constnote = ""; } - else - { + else { dol_print_error($db); } } @@ -105,8 +104,7 @@ if (!empty($consts) && $action == 'update') { $nbmodified++; } - else - { + else { dol_print_error($db); } } @@ -127,8 +125,7 @@ if (!empty($consts) && $action == 'delete') { $nbdeleted++; } - else - { + else { dol_print_error($db); } } @@ -144,8 +141,7 @@ if ($action == 'delete') { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -231,8 +227,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) print ''; print ''; print ''; } - else - { + else { print '"; @@ -401,8 +394,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -434,8 +426,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'contract').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -483,8 +474,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index bb7e82901f5..b7cb424d2cb 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -101,8 +101,7 @@ if ($action == 'edit') { print $form->selectyesno($key, $conf->global->$key, 1); } - else - { + else { print ''; } print ''; @@ -117,8 +116,7 @@ if ($action == 'edit') print ''; print '
'; } -else -{ +else { print '
'; - if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) + if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) { print ''; + } print '
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).'
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).'
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).'
'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
\n"; if (method_exists($module, 'info')) print $module->info($langs); - else - print $module->description; + else print $module->description; print ''."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; } -else -{ +else { print ''; print ''; } @@ -298,8 +293,7 @@ if ($result) print ''; } - else - { + else { print ''; print ''; } @@ -308,8 +302,7 @@ if ($result) { print ''; } - else - { + else { print ''.img_delete().''; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index ae0c9c89b38..f3c50287107 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -63,8 +63,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -101,14 +100,12 @@ elseif ($action == 'specimen') // For contract header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -169,8 +166,7 @@ elseif ($action == 'set_other') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -252,8 +248,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -317,8 +312,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -388,8 +382,7 @@ foreach ($dirmodels as $reldir) print ''; print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; print ''; @@ -141,8 +139,7 @@ else { print yn($conf->global->$key); } - else - { + else { print $conf->global->$key; } print ''; diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 926080cb9b5..dad99b2ab39 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -59,8 +59,7 @@ if ($action == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($error, null, 'errors'); } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 094c4a8dd7c..2622d5ca514 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -151,8 +151,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac $defaultkey = ''; $defaultvalue = ''; } - else - { + else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); $action = ''; @@ -170,8 +169,7 @@ if ($action == 'delete') { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -198,8 +196,7 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } -else -{ +else { // Button on, click to disable $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); @@ -261,8 +258,7 @@ if ($mode != 'sortorder') { $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); } -else -{ +else { $texthelp = 'field or alias.field'; $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); } @@ -281,8 +277,7 @@ if ($mode != 'focus' && $mode != 'mandatory') } $textvalue = $form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, 'subsitutiontooltip'); } - else - { + else { $texthelp = 'ASC or DESC'; $textvalue = $form->textwithpicto($langs->trans("SortOrder"), $texthelp); } @@ -322,8 +317,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) print ''; // We see environment, but to change it we must switch on other entity print ''; } -else -{ +else { print ''; @@ -394,8 +388,7 @@ if ($result) print '   '; print ''.img_delete().''; } - else - { + else { print ''; print ''; print '
'; @@ -409,8 +402,7 @@ if ($result) $i++; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 3ee262b464a..26f2f87e2d5 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -250,8 +250,7 @@ if ($action == 'edit') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; print '
'; } -else -{ +else { /* * Show parameters */ diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index cce441c4052..7ed84b59629 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -698,8 +698,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $_POST["country"] = ''; } - else - { + else { $ok = 0; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } @@ -792,8 +791,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST = array('id'=>$id); // Clean $_POST array, we keep only } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } @@ -883,8 +881,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete { setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } - else - { + else { dol_print_error($db); } } @@ -1302,8 +1299,7 @@ if ($id) print ''; $filterfound++; } - else - { + else { print ''; print ''; } @@ -1439,8 +1435,7 @@ if ($id) print ''; print ''; } - else - { + else { $tmpaction = 'view'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks @@ -1479,8 +1474,7 @@ if ($id) { $valuetoshow = '-'; } - else - { + else { $key = $langs->trans("Country".strtoupper($obj->country_code)); $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); } @@ -1605,15 +1599,13 @@ if ($id) elseif ($fieldlist[$field] == 'localtax1_type') { if ($obj->localtax1 != 0) $valuetoshow = $localtax_typeList[$valuetoshow]; - else - $valuetoshow = ''; + else $valuetoshow = ''; $class = "center"; } elseif ($fieldlist[$field] == 'localtax2_type') { if ($obj->localtax2 != 0) $valuetoshow = $localtax_typeList[$valuetoshow]; - else - $valuetoshow = ''; + else $valuetoshow = ''; $class = "center"; } elseif ($fieldlist[$field] == 'taux') { @@ -1709,8 +1701,7 @@ if ($id) // Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; - else - { + else { if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); elseif (isset($obj->type) && in_array($obj->type, array('system')) && !empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); @@ -1747,8 +1738,7 @@ if ($id) print ''; } -else -{ +else { /* * Show list of dictionary to show */ @@ -1782,8 +1772,7 @@ else { print ''.$langs->trans($tablib[$i]).''; } - else - { + else { print $langs->trans($tablib[$i]); } print ''; @@ -1796,8 +1785,7 @@ else print ''.$tabname[$i].''; $lastlineisempty = false; } - else - { + else { if (!$lastlineisempty) { $showemptyline = 1; @@ -2003,8 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0); print $formaccounting->select_account($accountancy_account, '.'.$fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); } - else - { + else { $fieldname = $fieldlist[$field]; print ''; } @@ -2028,8 +2015,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $form->selectExpenseRanges($obj->fk_range); print ''; } - else - { + else { $fieldValue = isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''; if ($fieldlist[$field] == 'sortorder') diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 3c735707c4a..6eaf1cf375a 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -136,8 +136,9 @@ class PrestaShopWebservice { if (isset($curl_params[$defkey])) $curl_options[$defkey] = $curl_params[$defkey]; - else + else { $curl_options[$defkey] = $defaultParams[$defkey]; + } } foreach ($curl_params as $defkey => $defval) if (!isset($curl_options[$defkey])) @@ -237,8 +238,9 @@ class PrestaShopWebservice } return $xml; } - else + else { throw new PrestaShopWebserviceException('HTTP response is empty'); + } } /** @@ -264,9 +266,7 @@ class PrestaShopWebservice $url .= '&id_shop='.$options['id_shop']; if (isset($options['id_group_shop'])) $url .= '&id_group_shop='.$options['id_group_shop']; - } - else - { + } else { throw new PrestaShopWebserviceException('Bad parameters given'); } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml)); @@ -323,9 +323,9 @@ class PrestaShopWebservice $url_params[$k] = $options[$k]; if (count($url_params) > 0) $url .= '?'.http_build_query($url_params); - } - else + } else { throw new PrestaShopWebserviceException('Bad parameters given '); + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); self::checkStatusCode($request['status_code']); // check the response validity @@ -356,9 +356,9 @@ class PrestaShopWebservice $url_params[$k] = $options[$k]; if (count($url_params) > 0) $url .= '?'.http_build_query($url_params); - } - else + } else { throw new PrestaShopWebserviceException('Bad parameters given'); + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true)); self::checkStatusCode($request['status_code']); // check the response validity return $request['header']; @@ -387,9 +387,9 @@ class PrestaShopWebservice $url .= '&id_shop='.$options['id_shop']; if (isset($options['id_group_shop'])) $url .= '&id_group_shop='.$options['id_group_shop']; - } - else + } else { throw new PrestaShopWebserviceException('Bad parameters given'); + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); self::checkStatusCode($request['status_code']); // check the response validity diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index a229f3c985d..1d764a849be 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -101,8 +101,7 @@ class Dolistore $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) die('Bad ID'); elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); - else - { + else { print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'
'; print $e->getMessage(); } @@ -183,8 +182,7 @@ class Dolistore $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) die('Bad ID'); elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); - else - { + else { print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'
'; print $e->getMessage(); } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 0c348b25f60..b9af92dc8a5 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -42,8 +42,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -56,8 +55,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -94,8 +92,7 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('ECM_AUTO_TREE_ENABLED'); } -else -{ +else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 80161eaadc6..a554354420d 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -127,8 +127,7 @@ if (GETPOST('addfilter', 'alpha')) { $object->fetchFilters(); } - else - { + else { setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); } } @@ -142,8 +141,7 @@ if ($action == 'deletefilter') { $object->fetchFilters(); } - else - { + else { setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); } } @@ -163,8 +161,7 @@ if (GETPOST('addoperation', 'alpha')) { $object->fetchActions(); } - else - { + else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -182,8 +179,7 @@ if ($action == 'updateoperation') { $object->fetchActions(); } - else - { + else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -196,8 +192,7 @@ if ($action == 'deleteoperation') { $object->fetchActions(); } - else - { + else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -212,8 +207,7 @@ if ($action == 'confirm_collect') $debuginfo = $object->debuginfo; setEventMessages($object->lastresult, null, 'mesgs'); } - else - { + else { $debuginfo = $object->debuginfo; setEventMessages($object->error, null, 'errors'); } @@ -440,8 +434,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); } - else - { + else { $morehtml .= 'IMAP functions not available on your PHP'; } @@ -449,8 +442,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; } - else - { + else { $morehtml .= imap_num_msg($connection); } @@ -582,8 +574,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($res) $arrayoftypes = $hookmanager->resArray; - else - foreach ($hookmanager->resArray as $k=>$desc) + else foreach ($hookmanager->resArray as $k=>$desc) $arrayoftypes[$k] = $desc; @@ -626,8 +617,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print ' '; } - else - { + else { print $ruleaction['actionparam']; } print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index f180cdf10cf..bb17bbdca05 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -242,8 +242,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index be9e7091300..cd9a2976e11 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -69,8 +69,7 @@ if ($action == 'updateMask') { if ($res > 0) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - else - setEventMessages($langs->trans("Error"), null, 'errors'); + else setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -130,14 +129,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -259,8 +256,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -327,8 +323,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -396,8 +391,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -409,8 +403,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -439,8 +432,7 @@ foreach ($dirmodels as $reldir) { print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -487,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index d076e77bf44..20f85dc6a29 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -104,14 +103,12 @@ elseif ($action == 'specimen') // For fiche inter header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -179,8 +176,7 @@ elseif ($action == 'setoptions') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -264,8 +260,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -329,8 +324,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -396,8 +390,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -409,8 +402,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -435,8 +427,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'intervention').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -485,8 +476,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 83bb28ca440..2b089335c40 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -162,8 +162,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) echo ''; echo ''; } - else - { + else { echo ''.img_edit().''; if (!empty($range->ik->id)) echo ''.img_delete().''; // TODO add delete link diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index a40e8d95520..0c99b4e4dda 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -229,8 +229,7 @@ foreach ($rules as $rule) echo '
'.$form->select_dolusers($object->fk_user, 'fk_user').'
'; echo '
'.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'
'; } - else - { + else { if ($rule->is_for_all > 0) echo $tab_apply['A']; elseif ($rule->fk_usergroup > 0) echo $tab_apply['G'].' ('.$rule->getGroupLabel().')'; elseif ($rule->fk_user > 0) echo $tab_apply['U'].' ('.$rule->getUserName().')'; @@ -243,11 +242,9 @@ foreach ($rules as $rule) { echo $form->selectExpense($object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1); } - else - { + else { if ($rule->fk_c_type_fees == -1) echo $langs->trans('AllExpenseReport'); - else - { + else { $key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id'); if ($key != $langs->trans($key)) echo $langs->trans($key); else echo $langs->trans(getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id')); // TODO check to return trans of 'code' @@ -261,8 +258,7 @@ foreach ($rules as $rule) { echo $form->selectarray('code_expense_rules_type', $tab_rules_type, $object->code_expense_rules_type, 0); } - else - { + else { echo $tab_rules_type[$rule->code_expense_rules_type]; } echo ''; @@ -273,8 +269,7 @@ foreach ($rules as $rule) { print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0); } - else - { + else { echo dol_print_date($rule->dates, 'day'); } echo ''; @@ -285,8 +280,7 @@ foreach ($rules as $rule) { print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0); } - else - { + else { echo dol_print_date($rule->datee, 'day'); } echo ''; @@ -297,8 +291,7 @@ foreach ($rules as $rule) { echo ''.$conf->currency; } - else - { + else { echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency); } echo ''; @@ -309,8 +302,7 @@ foreach ($rules as $rule) { echo $form->selectyesno('restrictive', $object->restrictive, 1); } - else - { + else { echo yn($rule->restrictive, 1, 1); } echo ''; @@ -322,8 +314,7 @@ foreach ($rules as $rule) echo ''.img_edit().' '; echo ''.img_delete().''; } - else - { + else { echo ' '; echo ''.$langs->trans('Cancel').''; } diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 8aa1a425778..eac6d7eb8e9 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -61,8 +61,7 @@ if ($result) if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; } } -else -{ +else { dol_print_error($db); } @@ -93,8 +92,7 @@ if ($action == 'add' || GETPOST("modify")) } */ } - else - { + else { // Ajoute boite box_external_rss dans definition des boites $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; $sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')"; @@ -114,8 +112,7 @@ if ($action == 'add' || GETPOST("modify")) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -162,8 +159,7 @@ if ($_POST["delete"]) $db->commit(); } - else - { + else { $db->rollback(); dol_print_error($db, "sql=".$sql); exit; @@ -179,8 +175,7 @@ if ($_POST["delete"]) header("Location: external_rss.php"); exit; } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -293,8 +288,7 @@ if ($resql) { print ''.$langs->trans("Online").''; } - else - { + else { print ''.$langs->trans("Offline"); $langs->load("errors"); if ($rssparser->error) print ' - '.$langs->trans($rssparser->error); @@ -332,8 +326,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 1a484ec8c7e..6c0c03b6dda 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -72,8 +72,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -109,14 +108,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -173,8 +170,7 @@ elseif ($action == 'setribchq') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -190,8 +186,7 @@ elseif ($action == 'set_FACTURE_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -208,8 +203,7 @@ elseif ($action == 'set_INVOICE_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -225,8 +219,7 @@ elseif ($action == 'setforcedate') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -248,8 +241,7 @@ elseif ($action == 'setDefaultPDFModulesByType') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -350,8 +342,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -463,8 +454,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -535,8 +525,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; @@ -548,8 +537,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; @@ -583,8 +571,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -691,14 +678,12 @@ if (!empty($conf->banque->enabled)) } print ""; } - else - { + else { print ''.$langs->trans("NoActiveBankAccountDefined").''; } } } -else -{ +else { print $langs->trans("BankModuleNotActive"); } print ""; @@ -777,8 +762,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 00995a302a5..9dfc2cff6d1 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -127,8 +127,7 @@ if (GETPOST('save', 'alpha')) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -147,8 +146,7 @@ if (empty($conf->use_javascript_ajax)) { setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors'); } -else -{ +else { print ''; print ''; print ''; @@ -212,8 +210,7 @@ else $editor = new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST : 'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly); $editor->Create(); } - else - { + else { print '
'; print $conf->global->FCKEDITOR_TEST; print '
'; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 055384c0084..602570194fd 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -102,14 +101,12 @@ elseif ($action == 'specimen') // For fiche inter header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -167,8 +164,7 @@ elseif ($action == 'set_FICHINTER_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -184,8 +180,7 @@ elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -201,8 +196,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { @@ -325,8 +319,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -389,8 +382,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -458,8 +450,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print ""; @@ -471,8 +462,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -499,8 +489,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'intervention').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -545,8 +534,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index a661f3a8e9a..ba602c4b609 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -65,8 +65,7 @@ if ($action == 'set') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -183,8 +182,7 @@ if ($geoip) if ($result) print $result; else print $langs->trans("Error"); } - else - { + else { print '
'.$ip.' -> '; $result = dol_print_ip($ip, 1); if ($result) print $result; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index aafe01bf5bd..58f39e30ff2 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -65,8 +65,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -103,14 +102,12 @@ elseif ($action == 'specimen') // For contract header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -171,8 +168,7 @@ elseif ($action == 'set_other') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -255,8 +251,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -332,8 +327,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -404,8 +398,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '"; @@ -417,8 +410,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -450,8 +442,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'contract').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -502,8 +493,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1b088f0c2b9..8df8a120c05 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -197,14 +197,12 @@ if ($action == 'update') $tmparray = explode(':', $result); setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } - else - { + else { $error++; setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index bd24e793374..33f1abb251f 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -77,8 +77,7 @@ if (empty($reshook)) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -215,8 +214,7 @@ if (!empty($conf->global->LDAP_SERVER_PORT)) { print ''; } -else -{ +else { print ''; } print ''; @@ -249,8 +247,7 @@ if (!empty($conf->global->LDAP_ADMIN_PASS)) { print ''; // je le met en visible pour test } -else -{ +else { print ''; } print ''; @@ -296,8 +293,7 @@ if (function_exists("ldap_connect")) print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; @@ -305,8 +301,7 @@ if (function_exists("ldap_connect")) print '
'; } } - else - { + else { print img_picto('', 'warning').' '; print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; print '
'; @@ -320,8 +315,7 @@ if (function_exists("ldap_connect")) print ''.$langs->trans("LDAPSetupForVersion3").''; print '
'; } - else - { + else { print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion2").''; print '
'; @@ -329,8 +323,7 @@ if (function_exists("ldap_connect")) $unbind = $ldap->unbind(); } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 834bde4eea5..58eb04e595d 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -79,8 +79,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -293,8 +292,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -307,8 +305,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index fb49c947411..a301738db94 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -71,8 +71,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -234,8 +233,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -248,8 +246,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index f6fa74cb79d..eba84afe925 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -96,8 +96,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -416,8 +415,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -430,8 +428,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 6628dd4d144..6913c477b38 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -69,8 +69,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -216,8 +215,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -230,8 +228,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 7781cf45676..d0d3bb50d0d 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -90,8 +90,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -396,8 +395,7 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; @@ -410,8 +408,7 @@ if (function_exists("ldap_connect")) print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; @@ -477,8 +474,7 @@ if (function_exists("ldap_connect")) $liste[$key] = $label; } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } @@ -491,8 +487,7 @@ if (function_exists("ldap_connect")) print "=> ".count($liste)." records
\n"; print "\n
"; } - else - { + else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 0646c7f6d46..b03067bd581 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -163,8 +163,7 @@ if ($action == 'edit') print ''; print '
'; } -else -{ +else { print '
'.$langs->trans("ActivateFCKeditor").'\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'.$langs->trans("LDAPServerPortExample").'
'.$langs->trans('Password').' (ex: secret)
'; print ''; @@ -204,8 +203,7 @@ if (empty($mysoc->country_code)) $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); print '
'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").''; } -else -{ +else { // Show examples print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); @@ -270,8 +268,7 @@ else } } } - else - { + else { // More examples if not specific vat rate found // This example must be kept for test purpose with current value because value used (2/7, 10/3, and vat 0, 10) // were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule. diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 4cd8f4841e5..f6e3c0e63f9 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -81,8 +80,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -119,14 +117,12 @@ if ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -250,8 +246,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -317,8 +312,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -384,8 +378,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print "
"; @@ -397,8 +390,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -418,8 +410,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'sending').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -463,8 +454,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 45202de342b..23cd1fd6bba 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -64,8 +64,7 @@ if ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -108,8 +107,7 @@ foreach ($list as $key) { print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); } - else - { + else { print ''; } print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 921a4a6338c..020c1ef5241 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -66,8 +66,7 @@ if ($action == 'setvalue') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 05c36128e8d..100b5cf3224 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -66,8 +66,7 @@ if ($action == 'update' || $action == 'add') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -100,8 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf $langs->load("errors"); setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $mailmanspip = new MailmanSpip($db); @@ -119,8 +117,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf $error++; setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("MailmanCreationSuccess"), null); } } @@ -132,8 +129,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf $error++; setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("MailmanDeletionSuccess"), null); } } @@ -212,8 +208,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) print ''; } -else -{ +else { dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); $link = ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 5502d44dae0..42ddb907b7d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -170,8 +170,7 @@ if ($action == 'edit') jQuery("#smtp_server_mess").show(); jQuery("#smtp_port_mess").show();'; } - else - { + else { print ' jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true); @@ -287,8 +286,7 @@ if ($action == 'edit') { print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE); } - else - { + else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -305,8 +303,7 @@ if ($action == 'edit') print ''; } - else - { + else { print ''; } @@ -549,8 +539,7 @@ else { print ''; } - else - { + else { print ''; } @@ -699,8 +688,7 @@ else print $conf->global->MAIN_MAIL_AUTOCOPY_TO; if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); } - else - { + else { print ' '; } print ''; @@ -722,8 +710,7 @@ else print ''.$langs->trans("DoTestServerAvailability").''; } } - else - { + else { print ''.$langs->trans("DoTestServerAvailability").''; } @@ -795,8 +782,7 @@ else $mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext); $result = $mail->check_server_port($server, $port); if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; - else - { + else { $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 84a0d2a0893..98c44f2b503 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -157,8 +157,7 @@ if ($action == 'edit') jQuery("#smtp_port_mess").show(); '; } - else - { + else { print ' jQuery("#MAIN_MAIL_SMTP_SERVER_EMAILING").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_PORT_EMAILING").prop("disabled", true); @@ -237,8 +236,7 @@ if ($action == 'edit') { print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); } - else - { + else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -256,8 +254,7 @@ if ($action == 'edit') print '
'; } - else - { + else { print ''; } @@ -425,8 +415,7 @@ else { print ''; } - else - { + else { print ''; } @@ -507,8 +496,7 @@ else print ''.$langs->trans("DoTestServerAvailability").''; } } - else - { + else { print ''.$langs->trans("DoTestServerAvailability").''; } @@ -539,8 +527,7 @@ else $result = $mail->check_server_port($server, $port); if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; - else - { + else { $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 1c50ebf0949..fd5f4e3b1a7 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -282,8 +282,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit { $num = $nbtotalofrecords; } -else -{ +else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 37d1f903b4a..1dcc621095c 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -123,8 +123,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $helpsubstitforlines .= $key.' -> '.$val.'
'; } } -else -{ +else { $tmp = FormMail::getAvailableSubstitKey('formemailwithlines'); $tmp['__(AnyTranslationKey)__'] = 'Translation'; $helpsubstit = $langs->trans("AvailableVariables").':
'; @@ -297,8 +296,7 @@ if (empty($reshook)) setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); $_POST = array('id'=>$id); // Clean $_POST array, we keep only id } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); } @@ -356,8 +354,7 @@ if (empty($reshook)) { setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($db->error(), null, 'errors'); } } @@ -377,8 +374,7 @@ if (empty($reshook)) { setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); } - else - { + else { dol_print_error($db); } } @@ -577,8 +573,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) elseif ($tmpfieldlist == 'joinfiles') { print ''; } - else - { + else { if ($context != 'hide') { // print ''; $okforextended = true; @@ -587,8 +582,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) $doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%'); print $doleditor->Create(1); } - else - print ' '; + else print ' '; } print ''; if ($tmpfieldlist == 'topic') { @@ -802,8 +796,7 @@ if ($resql) print "\n"; } - else - { + else { $keyforobj = 'type_template'; if (!in_array($obj->$keyforobj, array_keys($elementList))) { @@ -989,15 +982,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { print $form->select_dolusers($obj->{$fieldlist[$field]}, 'fk_user', 1, null, 0, '', null, 0, 0, 1, '', 0, '', 'maxwidth200'); } - else - { + else { if ($context == 'add') // I am not admin and we show the add form { print $user->getNomUrl(1); // Me $forcedvalue = $user->id; } - else - { + else { if ($obj && !empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0) { $fuser = new User($db); @@ -1005,8 +996,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $fuser->getNomUrl(1); $forcedvalue = $fuser->id; } - else - { + else { $forcedvalue = $obj->{$fieldlist[$field]}; } } @@ -1024,8 +1014,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } - else - { + else { if (!empty($obj->{$fieldlist[$field]})) { print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]}); @@ -1046,8 +1035,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $obj->{$fieldlist[$field]}; } - else - { + else { print $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150 maxwidth100onsmartphone'); } print ''; @@ -1055,8 +1043,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; elseif ($context == 'edit' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; - else - { + else { $size = ''; $class = ''; $classtd = ''; if ($fieldlist[$field] == 'code') $class = 'maxwidth100'; if ($fieldlist[$field] == 'label') $class = 'maxwidth100'; @@ -1073,14 +1060,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { print $form->selectyesno($fieldlist[$field], '1', 1); } - else - { + else { //print ''; print $form->selectyesno($fieldlist[$field], (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1); } } - else - { + else { print ''; } print ''; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 856ad50c28b..b66ab89075f 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -97,8 +97,7 @@ if ($action == 'update' && !$cancel) { $db->commit(); } - else - { + else { $error++; setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors'); $db->rollback(); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index ef58c1042d4..a059a76b40c 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -103,9 +103,7 @@ if ($action == 'update') if (is_numeric(GETPOST('menuIdParent', 'alpha'))) { $menu->fk_menu = GETPOST('menuIdParent', 'alpha'); - } - else - { + } else { if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0; else $menu->fk_menu = -1; $menu->fk_mainmenu = $mainmenu; @@ -116,14 +114,10 @@ if ($action == 'update') if ($result > 0) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } - else - { + } else { setEventMessages($menu->error, $menu->errors, 'errors'); } - } - else - { + } else { setEventMessages($menu->error, $menu->errors, 'errors'); } $action = "edit"; @@ -131,8 +125,7 @@ if ($action == 'update') header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler); exit; } @@ -222,8 +215,7 @@ if ($action == 'add') { $menu->fk_menu = GETPOST('menuId', 'alpha', 3); } - else - { + else { if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0; else $menu->fk_menu = -1; $menu->fk_mainmenu = $mainmenu; @@ -236,8 +228,7 @@ if ($action == 'add') header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09')); exit; } - else - { + else { $action = 'create'; setEventMessages($menu->error, $menu->errors, 'errors'); } @@ -261,8 +252,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') llxFooter(); exit; } - else - { + else { $this->db->rollback(); $reload = 0; @@ -359,8 +349,7 @@ if ($action == 'create') print $langs->trans('Left'); print ''; } - else - { + else { print '
'; } - else - { + else { print ''; } print '"; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index d5bf12f1061..7b64dd08bd0 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -105,8 +105,7 @@ foreach ($modulesdir as $dir) continue; } - try - { + try { $res = include_once $dir.$file; if (class_exists($modName)) { @@ -141,8 +140,7 @@ foreach ($modulesdir as $dir) { $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; } - else - { + else { $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } @@ -188,8 +186,7 @@ foreach ($modulesdir as $dir) dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } - else - { + else { print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } @@ -202,8 +199,7 @@ foreach ($modulesdir as $dir) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modulehelp.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -332,8 +328,7 @@ if ($mode == 'desc') $text .= $textexternal; $text .= '
'; } - else - { + else { $text .= '
'.$langs->trans("Origin").': '.$langs->trans("Core").'
'; } @@ -450,8 +445,7 @@ if ($mode == 'feature') { $yesno = 'Yes'; } - else - { + else { $yesno = 'No'; } require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c0f1991835b..dba149a2bb0 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -126,8 +126,7 @@ if ($action == 'install') setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings'); $error++; } - else - { + else { if (!$error && !preg_match('/\.zip$/i', $original_file)) { $langs->load("errors"); @@ -174,8 +173,7 @@ if ($action == 'install') setEventMessages($langs->trans($result['error'], $original_file), null, 'errors'); $error++; } - else - { + else { // Now we move the dir of the module $modulename = preg_replace('/module_/', '', $original_file); $modulename = preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename); @@ -231,8 +229,7 @@ if ($action == 'install') } } } - else - { + else { setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors'); $error++; } @@ -248,8 +245,7 @@ if ($action == 'set' && $user->admin) { $resarray = activateModule($value); if (!empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors'); - else - { + else { //var_dump($resarray);exit; if ($resarray['nbperms'] > 0) { @@ -341,8 +337,7 @@ foreach ($modulesdir as $dir) continue; } - try - { + try { $res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. if (class_exists($modName)) { @@ -376,8 +371,7 @@ foreach ($modulesdir as $dir) { $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; } - else - { + else { $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } @@ -438,8 +432,7 @@ foreach ($modulesdir as $dir) dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } - else - { + else { print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } @@ -452,8 +445,7 @@ foreach ($modulesdir as $dir) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -716,8 +708,7 @@ if ($mode == 'common' || $mode == 'commonkanban') } if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++; } - else - { + else { if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { $codeenabledisable .= 'warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">'; $codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on'); @@ -752,15 +743,13 @@ if ($mode == 'common' || $mode == 'commonkanban') $codetoconfig .= ''.img_picto(ucfirst($page), "setup").''; // print ''.ucfirst($page).' '; } - else - { + else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } - else - { + else { $urltouse = $urlpage; $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } @@ -771,17 +760,15 @@ if ($mode == 'common' || $mode == 'commonkanban') { $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } - else - { + else { $codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').''; } } - else - { + else { $codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15'); } } - else // Module not yet activated + else // Module not yet activated { // Set $codeenabledisable if (!empty($objMod->always_enabled)) @@ -792,8 +779,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $codeenabledisable .= $langs->trans("Disabled"); } - else - { + else { // Module qualified for activation $warningmessage = ''; if (!empty($arrayofwarnings[$modName])) @@ -857,8 +843,7 @@ if ($mode == 'common' || $mode == 'commonkanban') if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"', 1); else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"'); } - else - { + else { print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly"'); } print ' '.$objMod->getName().''; @@ -1028,8 +1013,7 @@ if ($mode == 'deploy') $message = info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); $allowfromweb = -1; } - else - { + else { if ($dirins_ok) { if (!is_writable(dol_osencode($dirins))) @@ -1039,15 +1023,13 @@ if ($mode == 'deploy') $allowfromweb = 0; } } - else - { + else { $message = info_admin($langs->trans("NotExistsDirect", $dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); $allowfromweb = 0; } } } - else - { + else { $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock')); $allowfromweb = 0; } @@ -1068,8 +1050,7 @@ if ($mode == 'deploy') { //print $langs->trans("ThisIsProcessToFollow").'
'; } - else - { + else { print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; print ''.$langs->trans("StepNb", 1).': '; print $langs->trans("FindPackageFromWebSite", $fullurl).'
'; @@ -1150,8 +1131,7 @@ if ($mode == 'deploy') print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1); } } - else - { + else { print ' ('.$langs->trans("UploadDisabled").')'; } @@ -1162,8 +1142,7 @@ if ($mode == 'deploy') print '
'; } - else - { + else { print $langs->trans("UnpackPackageInModulesRoot", $dirins).'
'; print ''.$langs->trans("StepNb", 4).': '; print $langs->trans("SetupIsReadyForUse").'
'; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 9c59b5cf6da..ddf55993fd7 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -59,8 +59,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -97,14 +96,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -162,8 +159,7 @@ elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -180,8 +176,7 @@ elseif ($action == 'set_MRP_MO_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -263,8 +258,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -329,8 +323,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -400,8 +393,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '
"; @@ -413,8 +405,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -443,8 +434,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -490,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 4ba581398ee..1b912b27b5e 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -54,8 +54,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -67,8 +66,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -146,8 +144,7 @@ elseif ($action == 'setapilayer') dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha')); //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); } - else - { + else { $result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID); if ($result > 0) { setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs"); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index ba92aa1ec21..859d36b7c36 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -85,8 +85,7 @@ if ($action == 'settemplates') setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); @@ -107,8 +106,7 @@ if ($action == 'setvalue' && $user->admin) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); @@ -161,8 +159,7 @@ if ($action == 'setfixednotif' && $user->admin) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 785a77ac043..85f9ebf0409 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -120,8 +120,7 @@ foreach ($list as $key) print ''; } - else - { + else { print ''; print ''; print ''; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index d8c65f9a2c5..f0d3c530b71 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -79,8 +79,7 @@ if ($action == 'setconst' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -99,8 +98,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -179,8 +177,7 @@ if ($mode == 'setup' && $user->admin) $urltodelete = ''; $urltocheckperms = ''; } - else - { + else { $urltorenew = ''; $urltodelete = ''; $urltocheckperms = ''; @@ -194,8 +191,7 @@ if ($mode == 'setup' && $user->admin) require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; // Dolibarr storage $storage = new DoliStorage($db, $conf); - try - { + try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); } catch (Exception $e) @@ -226,8 +222,7 @@ if ($mode == 'setup' && $user->admin) { $expiredat = $langs->trans("Unknown"); } - else - { + else { $expiredat = dol_print_date($endoflife, "dayhour"); } } diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index a5b494b62e2..2873cf5d15f 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -57,8 +57,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -184,8 +183,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 496a32923f7..ec4015f6e98 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -190,8 +190,7 @@ for ($i = 1; $i <= 6; $i++) $pid = $langs->transcountry("ProfId".$i, $mysoc->country_code); if ($pid == '-') $pid = false; } - else - { + else { $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; } if ($pid) diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 0486edebeec..7dcaf0fba47 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -230,8 +230,7 @@ if ($result) print img_picto($langs->trans("Active"), 'tick'); print ''; } - else - { + else { print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index e9795304ad3..b33b2396aa2 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -101,8 +101,7 @@ if ($action == "set") $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 73703829b8c..f2c748b4ce2 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -101,14 +100,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -127,8 +124,7 @@ elseif ($action == 'setribchq') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -143,8 +139,7 @@ elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -160,8 +155,7 @@ elseif ($action == 'set_PROPOSAL_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -175,8 +169,7 @@ elseif ($action == 'setdefaultduration') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -191,8 +184,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -311,8 +303,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -377,8 +368,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -449,8 +439,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ""; @@ -462,8 +451,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -497,8 +485,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -572,14 +559,12 @@ if (empty($conf->facture->enabled)) } print ""; } - else - { + else { print "".$langs->trans("NoActiveBankAccountDefined").""; } } } - else - { + else { print ''.$langs->trans("BankModuleNotActive").''; } } @@ -686,8 +671,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 8730f148c07..dc6aa5da33b 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -90,8 +90,7 @@ if ($action == 'addprinter' && $user->admin) { $db->commit(); setEventMessages($langs->trans("PrinterAdded", $printername), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -116,8 +115,7 @@ if ($action == 'deleteprinter' && $user->admin) { $db->commit(); setEventMessages($langs->trans("PrinterDeleted", $printername), null); } - else - { + else { $db->rollback(); dol_print_error($db); } diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 312038d3fcc..68f8f0e62ee 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -72,8 +72,7 @@ if ($action == 'updateMask') { if ($res > 0) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - else - setEventMessages($langs->trans("Error"), null, 'errors'); + else setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -133,14 +132,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=reception&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -264,8 +261,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -332,8 +328,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -402,8 +397,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print '"; @@ -415,8 +409,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -447,8 +440,7 @@ foreach ($dirmodels as $reldir) { print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 3efdd05bdc7..04ff3861c7f 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -92,8 +92,7 @@ if (empty($conf->use_javascript_ajax)) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; } -else -{ +else { print '\n"; @@ -436,8 +431,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) //Do not allow "disable encryption" as passwords cannot be decrypted print ''.$langs->trans("Disable").''; } - else - { + else { print '-'; } print ""; @@ -463,8 +457,7 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) $langs->load("errors"); print img_warning($langs->trans("WarningPassIsEmpty")); } -else -{ +else { if (empty($dolibarr_main_db_encrypted_pass)) { print ''.$langs->trans("Activate").''; @@ -516,8 +509,7 @@ if (GETPOST('info', 'int') > 0) { print $langs->trans("Note: The function password_hash exists on your PHP")."
\n"; } - else - { + else { print $langs->trans("Note: The function password_hash does not exists on your PHP")."
\n"; } print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO."
\n"; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index f642cd64182..b6674f00c5c 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -51,8 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { @@ -62,8 +61,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) Header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -119,20 +117,17 @@ if (function_exists("imagecreatefrompng")) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA'); } - else - { + else { if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } } -else -{ +else { $desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning'); print $desc; } @@ -146,14 +141,12 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS'); } -else -{ +else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 09cc0debfd5..0745203f365 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -123,8 +123,7 @@ if ($action == 'send' && !$_POST['cancel']) setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs'); setEventMessages($smsfile->error, $smsfile->errors, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("ResultKo"), null, 'errors'); setEventMessages($smsfile->error, $smsfile->errors, 'errors'); } @@ -206,8 +205,7 @@ if ($action == 'edit') print ''; print '
'; } -else -{ +else { if (!count($listofmethods)) print '
'.$langs->trans("NoSmsEngine", 'DoliStore').'
'; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : ''); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -319,8 +316,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -337,8 +333,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ''); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -351,8 +346,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -371,8 +365,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); print ''; @@ -392,8 +385,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); print ''; @@ -497,8 +489,7 @@ if ($action == 'edit') print ''; } -else -{ +else { dol_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; @@ -539,8 +530,7 @@ else { print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'
'; print $langs->trans("SeeLocalSendMailSetup"); } - else - { + else { $mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : ''); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -270,8 +267,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -289,8 +285,7 @@ if ($action == 'edit') print ''; print $langs->trans("SeeLocalSendMailSetup"); } - else - { + else { $mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -303,8 +298,7 @@ if ($action == 'edit') print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } - else - { + else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -323,8 +317,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print ''; @@ -342,8 +335,7 @@ if ($action == 'edit') { print ''; } - else - { + else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print ''; @@ -391,8 +383,7 @@ if ($action == 'edit') print ''; } -else -{ +else { dol_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; @@ -415,8 +406,7 @@ else { print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').'
'.$parent_rowid.''.$langs->trans('DetailMenuIdParent'); diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 97f0246ac88..f27968d462d 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -192,8 +192,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler); exit; } - else - { + else { $db->rollback(); $reload = 0; @@ -409,8 +408,7 @@ if ($conf->use_javascript_ajax) print ''; } -else -{ +else { $langs->load("errors"); setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors'); } diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index ed35f48d90e..145ec566057 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -95,8 +95,7 @@ if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } -else -{ +else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; print '
'.$langs->trans("UseTheFollowingUrlAsRedirectURI").''.$langs->trans("FeatureNotYetSupported").''; print ''.img_edit_add().''; print '\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; $arrval = array( '0'=>$langs->trans("No"), diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index d9d61673c5e..161b521337b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -46,8 +46,7 @@ if ($action == 'setgeneraterule') { dol_print_error($db); } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]); exit; } @@ -102,8 +101,7 @@ if ($action == 'activate_encrypt') header("Location: security.php"); exit; } - else - { + else { $db->rollback(); dol_print_error($db, ''); } @@ -132,8 +130,7 @@ if ($action == 'activate_encryptdbpassconf') header("Location: security.php"); exit; } - else - { + else { setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings'); } } @@ -149,8 +146,7 @@ elseif ($action == 'disable_encryptdbpassconf') header("Location: security.php"); exit; } - else - { + else { setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); } } @@ -278,8 +274,7 @@ foreach ($arrayhandler as $key => $module) { print img_picto('', 'tick'); } - else - { + else { print ''.$langs->trans("Activate").''; } print "
'; @@ -265,8 +263,7 @@ else { print ''.$langs->trans("DoTestSend").''; } - else - { + else { print ''.$langs->trans("DoTestSend").''; } print ''; diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php index d2a92aed9e8..fd4329b7023 100644 --- a/htdocs/admin/socialnetworks.php +++ b/htdocs/admin/socialnetworks.php @@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 2ed43e97efd..6c1d1837ea8 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -74,8 +74,7 @@ if ($action == 'update' || $action == 'add') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -154,8 +153,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) print ''; } -else -{ +else { dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); $link = ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 43e610c3052..d3b9061eecc 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -120,8 +118,7 @@ if (!empty($conf->facture->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")); } print "\n\n"; @@ -140,8 +137,7 @@ if (!empty($conf->commande->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name")); } print "\n\n"; @@ -162,8 +158,7 @@ if (!empty($conf->expedition->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); } print "\n\n"; @@ -182,8 +177,7 @@ if (!empty($conf->expedition->enabled)) print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")); } print "\n\n"; @@ -222,8 +216,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } print "\n\n"; @@ -243,8 +236,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER); } } -else -{ +else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } print "\n\n"; @@ -280,8 +272,7 @@ if (!empty($conf->reception->enabled)) print "\n\n"; $found++; } -else -{ +else { print ''; print ''; print '\n\n"; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 977b99d0c99..c52f4296429 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -71,8 +71,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -110,14 +109,12 @@ if ($action == 'specimen') // For invoices header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -186,8 +183,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -273,8 +269,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -341,8 +336,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -410,8 +404,7 @@ foreach ($dirmodels as $reldir) }*/ print ""; } - else - { + else { print '"; @@ -425,8 +418,7 @@ foreach ($dirmodels as $reldir) // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -488,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index db9b3e257f6..f282ee8d7ca 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -69,8 +69,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -108,14 +107,12 @@ elseif ($action == 'specimen') // For orders header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -197,8 +194,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') // Insert $newmodule->insert_permissions(1); } - else - { + else { // Remove all rights with Permission1190 $newmodule->delete_permissions(); @@ -218,8 +214,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -305,8 +300,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -371,8 +365,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -430,14 +423,12 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } - else - { + else { print img_picto($langs->trans("Enabled"), 'switch_on'); } print ""; } - else - { + else { print '"; @@ -449,8 +440,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -554,8 +544,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -573,8 +562,7 @@ if ($conf->reception->enabled) { print ''.$langs->trans("FeatureNotAvailableWithReceptionModule").''; } -else -{ +else { if ($conf->use_javascript_ajax) { print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); } else { diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 5d7a0d0b8d5..1c4cfd5905e 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -58,8 +58,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } }elseif ($action == 'setmod') @@ -132,14 +131,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -207,8 +204,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -283,8 +279,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -399,8 +394,7 @@ foreach ($dirmodels as $reldir) }*/ print ""; } - else - { + else { print '"; @@ -414,8 +408,7 @@ foreach ($dirmodels as $reldir) // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index c1007623a54..bb3454de4f7 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -61,8 +61,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -99,14 +98,12 @@ if ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($module->error, null, 'errors'); dol_syslog($module->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -123,8 +120,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -141,8 +137,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -157,8 +152,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -279,8 +273,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -344,8 +337,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -415,8 +407,7 @@ foreach ($dirmodels as $reldir) print ''; print ''; } - else - { + else { print ""; @@ -428,8 +419,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -463,8 +453,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -512,8 +501,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; } -else -{ +else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -544,21 +532,18 @@ if ($conf->banque->enabled) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); } - else - { + else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } } print ''; } -else -{ +else { print ''; } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 16b273cd6db..44143afb270 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -127,8 +127,7 @@ if ($action == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($error, $errors, 'errors'); } @@ -156,8 +155,7 @@ if ($action == 'setlevel') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 3d0dddd6d10..db7559de17a 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -201,8 +201,7 @@ if ($showpromotemessage) print $langs->trans("ExampleOfNewsMessageForMajorRelease", DOL_VERSION, DOL_VERSION); print ''; } - else - { + else { print $langs->trans("TitleExampleForMaintenanceRelease").':
'; print ''; print '
'.$langs->trans("SmsInfoCharRemain").': '.(160 - dol_strlen($defaultmessage)).'
'; } diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 5ecef635d73..ddc79a3c9cf 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -80,8 +80,7 @@ class FormSocialContrib $sql .= " AND c.fk_pays = ".$mysoc->country_id; $sql .= " ORDER BY c.libelle ASC"; } - else - { + else { $sql = "SELECT c.id, c.libelle as type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_country as co"; $sql .= " WHERE c.active = 1 AND c.fk_pays = co.rowid"; @@ -112,13 +111,11 @@ class FormSocialContrib if ($user->admin && $help) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); if (!empty($conf->use_javascript_ajax)) print ajax_combobox($htmlname); } - else - { + else { print $langs->trans("ErrorNoSocialContributionForSellerCountry", $mysoc->country_code); } } - else - { + else { dol_print_error($db, $db->lasterror()); } } diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 7b067fa11d6..e666260325c 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -80,8 +80,7 @@ class FormWebsite { $out .= '
"; @@ -256,8 +252,7 @@ function displayBox($selectedDate, $month, $year) { $stoploop = 1; } - else - { + else { $mydate = dol_getdate($thedate); if ($firstdate["month"] != $mydate["month"]) $stoploop = 1; } @@ -278,8 +273,7 @@ function displayBox($selectedDate, $month, $year) print sprintf("%02s", $tempDate["mday"]); print ", ".$selectYear; } - else - { + else { print "Click a Date"; } ?> diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 2818eff65e2..f37d3a4b69d 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -121,8 +121,7 @@ abstract class DoliDB implements Database } return $ret; } - else - { + else { $this->transaction_opened++; dol_syslog('', 0, 1); return 1; @@ -147,13 +146,11 @@ abstract class DoliDB implements Database dol_syslog("COMMIT Transaction".($log ? ' '.$log : ''), LOG_DEBUG); return 1; } - else - { + else { return 0; } } - else - { + else { $this->transaction_opened--; return 1; } @@ -175,8 +172,7 @@ abstract class DoliDB implements Database dol_syslog("ROLLBACK Transaction".($log ? ' '.$log : ''), LOG_DEBUG); return $ret; } - else - { + else { $this->transaction_opened--; return 1; } @@ -253,8 +249,7 @@ abstract class DoliDB implements Database } return $return; } - else - { + else { return ''; } } @@ -331,7 +326,7 @@ abstract class DoliDB implements Database if ($res) { $results = array(); - if($this->num_rows($res) > 0){ + if ($this->num_rows($res) > 0){ while ($obj = $this->fetch_object($res)){ $results[] = $obj; } diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 667f1986815..e5bd6c22e36 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -91,8 +91,7 @@ class DoliDBMssql extends DoliDB $this->connected = true; $this->ok = true; } - else - { + else { // host, login ou password incorrect $this->connected = false; $this->ok = false; @@ -109,8 +108,7 @@ class DoliDBMssql extends DoliDB $this->database_name = $name; $this->ok = true; } - else - { + else { $this->database_selected = false; $this->database_name = ''; $this->ok = false; @@ -118,8 +116,7 @@ class DoliDBMssql extends DoliDB dol_syslog(get_class($this)."::DoliDBMssql : Erreur Select_db ".$this->error, LOG_ERR); } } - else - { + else { // Pas de selection de base demandee, ok ou ko $this->database_selected = false; } @@ -250,8 +247,7 @@ class DoliDBMssql extends DoliDB } return $ret; } - else - { + else { return true; } } @@ -276,8 +272,7 @@ class DoliDBMssql extends DoliDB dol_syslog("COMMIT Transaction", LOG_DEBUG); return true; } - else - { + else { return false; } } @@ -368,8 +363,7 @@ class DoliDBMssql extends DoliDB $query .= " WHERE ".implode(" AND ", $query_comp); } } - else - { + else { if (preg_match('/ALTER TABLE\h+(\w+?)\h+ADD\h+PRIMARY\h+KEY\h+(\w+?)\h*\((.+)\)/is', $query, $matches)) { $original_query = $query; @@ -432,8 +426,7 @@ class DoliDBMssql extends DoliDB // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) $ret = mssql_query($query, $this->db); } - else - { + else { $ret = mssql_query($query, $this->db); } @@ -598,8 +591,7 @@ class DoliDBMssql extends DoliDB // Si il y a eu echec de connexion, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } - else - { + else { // Constants to convert a MSSql error code to a generic Dolibarr error code $errorcode_map = array( 1004 => 'DB_ERROR_CANNOT_CREATE', @@ -671,8 +663,7 @@ class DoliDBMssql extends DoliDB { return $data["id"]; } - else - { + else { return -1; } } @@ -849,8 +840,7 @@ class DoliDBMssql extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + else $sqlfields[$i] .= " default '".$field_desc['default']."'"; } elseif (preg_match("/^[^\s]/i", $field_desc['null'])) $sqlfields[$i] .= " ".$field_desc['null']; @@ -892,8 +882,7 @@ class DoliDBMssql extends DoliDB dol_syslog($sql); if (!$this -> query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -910,8 +899,7 @@ class DoliDBMssql extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -958,16 +946,14 @@ class DoliDBMssql extends DoliDB if (preg_match("/^[^\s]/i", $field_desc['default'])) if (preg_match("/null/i", $field_desc['default'])) $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + else $sql .= " default '".$field_desc['default']."'"; if (preg_match("/^[^\s]/i", $field_desc['extra'])) $sql .= " ".$field_desc['extra']; $sql .= " ".$field_position; if (!$this -> query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -991,8 +977,7 @@ class DoliDBMssql extends DoliDB dol_syslog($sql, LOG_DEBUG); if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1038,8 +1023,7 @@ class DoliDBMssql extends DoliDB { return -1; } - else - { + else { // If user already exists, we continue to set permissions dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); } @@ -1051,8 +1035,7 @@ class DoliDBMssql extends DoliDB dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); return -1; } - else - { + else { if ($num) { $this->select_db($dolibarr_main_db_name); @@ -1207,8 +1190,7 @@ class DoliDBMssql extends DoliDB { $where = " IN ('".implode("','", $fields)."')"; } - else - { + else { $where = "='".$this->escape($fields)."'"; } $result = array(); @@ -1220,8 +1202,7 @@ class DoliDBMssql extends DoliDB $result[] = $obj; } } - else - return false; + else return false; return $result; } diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 7c0d680662d..5f797b14c07 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -122,8 +122,7 @@ class DoliDBMysqli extends DoliDB if (!preg_match('/general/', $collation)) $this->db->query("SET collation_connection = ".$collation); } } - else - { + else { $this->database_selected = false; $this->database_name = ''; $this->ok = false; @@ -131,8 +130,7 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DoliDBMysqli : Select_db error ".$this->error, LOG_ERR); } } - else - { + else { // Pas de selection de base demandee, ok ou ko $this->database_selected = false; @@ -270,8 +268,7 @@ class DoliDBMysqli extends DoliDB // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) $ret = $this->db->query($query); } - else - { + else { $ret = $this->db->query($query); } @@ -342,8 +339,7 @@ class DoliDBMysqli extends DoliDB if (!is_object($resultset)) { $resultset = $this->_results; } return $resultset->fetch_row(); } - else - { + else { // si le curseur est un booleen on retourne la valeur 0 return 0; } @@ -747,8 +743,7 @@ class DoliDBMysqli extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -765,8 +760,7 @@ class DoliDBMysqli extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -823,8 +817,7 @@ class DoliDBMysqli extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + else $sql .= " default '".$field_desc['default']."'"; } if (isset($field_desc['extra']) && preg_match("/^[^\s]/i", $field_desc['extra'])) { @@ -882,8 +875,7 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DDLUpdateField ".$sql, LOG_DEBUG); if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -929,8 +921,7 @@ class DoliDBMysqli extends DoliDB { return -1; } - else - { + else { // If user already exists, we continue to set permissions dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING); } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index bf9b468d4a8..f2378bcb998 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -105,8 +105,7 @@ class DoliDBPgsql extends DoliDB $this->connected = true; $this->ok = true; } - else - { + else { // host, login ou password incorrect $this->connected = false; $this->ok = false; @@ -123,8 +122,7 @@ class DoliDBPgsql extends DoliDB $this->database_name = $name; $this->ok = true; } - else - { + else { $this->database_selected = false; $this->database_name = ''; $this->ok = false; @@ -132,8 +130,7 @@ class DoliDBPgsql extends DoliDB dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Select_db ".$this->error, LOG_ERR); } } - else - { + else { // Pas de selection de base demandee, ok ou ko $this->database_selected = false; } @@ -998,8 +995,7 @@ class DoliDBPgsql extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + else $sqlfields[$i] .= " default '".$field_desc['default']."'"; } elseif (preg_match("/^[^\s]/i", $field_desc['null'])) $sqlfields[$i] .= " ".$field_desc['null']; @@ -1041,8 +1037,7 @@ class DoliDBPgsql extends DoliDB dol_syslog($sql, LOG_DEBUG); if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1059,8 +1054,7 @@ class DoliDBPgsql extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1313,8 +1307,7 @@ class DoliDBPgsql extends DoliDB { $fullpathofdump = '/usr/bin/pg_dump'; } - else - { + else { // TODO L'utilisateur de la base doit etre un superadmin pour lancer cette commande $resql = $this->query('SHOW data_directory'); if ($resql) @@ -1344,8 +1337,7 @@ class DoliDBPgsql extends DoliDB { $fullpathofdump = '/usr/bin/'.$tool; } - else - { + else { // TODO L'utilisateur de la base doit etre un superadmin pour lancer cette commande $resql = $this->query('SHOW data_directory'); if ($resql) diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 2d24c232797..e5c9ef6b751 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -112,8 +112,7 @@ class DoliDBSqlite3 extends DoliDB $this->addCustomFunction('date_format'); //$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } - else - { + else { // host, login ou password incorrect $this->connected = false; $this->ok = false; @@ -554,8 +553,7 @@ class DoliDBSqlite3 extends DoliDB if (!is_object($resultset)) { $resultset = $this->_results; } return $resultset->fetchArray(SQLITE3_NUM); } - else - { + else { // si le curseur est un booleen on retourne la valeur 0 return false; } @@ -931,8 +929,7 @@ class DoliDBSqlite3 extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + else $sqlfields[$i] .= " default '".$field_desc['default']."'"; } elseif (preg_match("/^[^\s]/i", $field_desc['null'])) $sqlfields[$i] .= " ".$field_desc['null']; @@ -991,8 +988,7 @@ class DoliDBSqlite3 extends DoliDB if (!$this->query($sql)) return -1; - else - return 1; + else return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1043,8 +1039,7 @@ class DoliDBSqlite3 extends DoliDB { if (preg_match("/null/i", $field_desc['default'])) $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + else $sql .= " default '".$field_desc['default']."'"; } if (preg_match("/^[^\s]/i", $field_desc['extra'])) $sql .= " ".$field_desc['extra']; diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 4f85610e657..db926a2b6bc 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -63,8 +63,7 @@ if ($resql) // This can fail when class is used on old database (during migra $this->export_entities_array[$r][$fieldname] = $keyforelement; } // If this is a computed field - else - { + else { $this->export_fields_array[$r][$fieldname] = $fieldlabel; $this->export_TypeFields_array[$r][$fieldname] = $typeFilter.'Compute'; $this->export_special_array[$r][$fieldname] = $obj->fieldcomputed; diff --git a/htdocs/core/filemanagerdol/connectors/php/basexml.php b/htdocs/core/filemanagerdol/connectors/php/basexml.php index 0f50f33e988..22eae8093d4 100644 --- a/htdocs/core/filemanagerdol/connectors/php/basexml.php +++ b/htdocs/core/filemanagerdol/connectors/php/basexml.php @@ -98,8 +98,7 @@ function SendError($number, $text) SendErrorNode($number, $text); CreateXmlFooter(); } - else - { + else { SetXmlHeaders(); dol_syslog('Error: '.$number.' '.$text, LOG_ERR); @@ -127,6 +126,5 @@ function SendErrorNode($number, $text) { if ($text) echo ''; - else - echo ''; + else echo ''; } diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index dcc1650d4cd..01a4caf9420 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -86,8 +86,7 @@ function GetFoldersAndFiles($resourceType, $currentFolder) { if (is_dir($sServerDir.$sFile)) $aFolders[] = ''; - else - { + else { $iFileSize = @filesize($sServerDir.$sFile); if (!$iFileSize) { $iFileSize = 0; @@ -147,8 +146,7 @@ function CreateFolder($resourceType, $currentFolder) if (strpos($sNewFolderName, '..') !== false) $sErrorNumber = '102'; // Invalid folder name. - else - { + else { // Map the virtual path to the local server path of the current folder. $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'CreateFolder'); @@ -172,12 +170,10 @@ function CreateFolder($resourceType, $currentFolder) break; } } - else - $sErrorNumber = '103'; + else $sErrorNumber = '103'; } } - else - $sErrorNumber = '102'; + else $sErrorNumber = '102'; // Create the "Error" node. echo ''; @@ -255,8 +251,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') $sFileName = RemoveExtension($sOriginalFileName).'('.$iCounter.').'.$sExtension; $sErrorNumber = '201'; } - else - { + else { move_uploaded_file($oFile['tmp_name'], $sFilePath); if (is_file($sFilePath)) @@ -297,11 +292,9 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') } } } - else - $sErrorNumber = '202'; + else $sErrorNumber = '202'; } - else - $sErrorNumber = '202'; + else $sErrorNumber = '202'; $sFileUrl = CombinePaths(GetResourceTypePath($resourceType, $sCommand), $currentFolder); @@ -315,8 +308,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') // this line already exists so wrap the if block around it SendUploadResults($sErrorNumber, $sFileUrl, $sFileName); } - else - { + else { //issue the CKEditor Callback SendCKEditorResults( $CKEcallback, diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 2a9ac9f146b..2da8b4d5baa 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -46,8 +46,7 @@ function GetResourceTypePath($resourceType, $sCommand) if ($sCommand == "QuickUpload") return $Config['QuickUploadPath'][$resourceType]; - else - return $Config['FileTypesPath'][$resourceType]; + else return $Config['FileTypesPath'][$resourceType]; } /** @@ -68,8 +67,7 @@ function GetResourceTypeDirectory($resourceType, $sCommand) // Map the "UserFiles" path to a local directory. return Server_MapPath($Config['QuickUploadPath'][$resourceType]); } - else - { + else { if (strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) return $Config['FileTypesAbsolutePath'][$resourceType]; @@ -179,8 +177,7 @@ function CreateServerFolder($folderPath, $lastFolder = null) { mkdir($folderPath); } - else - { + else { $permissions = '0777'; if (isset($Config['ChmodOnFolderCreate']) && $Config['ChmodOnFolderCreate']) { @@ -203,8 +200,7 @@ function CreateServerFolder($folderPath, $lastFolder = null) return $sErrorMsg; } - else - return ''; + else return ''; } /** diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index 1349ed00dad..5af89333a48 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -82,8 +82,7 @@ function ConvertToXmlAttribute($value) { $os = PHP_OS; } - else - { + else { $os = php_uname(); } @@ -91,8 +90,7 @@ function ConvertToXmlAttribute($value) { return (utf8_encode(htmlspecialchars($value))); } - else - { + else { return (htmlspecialchars($value)); } } diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 1564fc3f9bc..969de383da0 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -90,8 +90,7 @@ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $logouttext .= ''; $logouttext .= ''; } - else - { + else { $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); } @@ -118,7 +117,7 @@ $result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note if (is_numeric($result)) { if (empty($result)) $toprightmenu .= $hookmanager->resPrint; // add - else $toprightmenu = $hookmanager->resPrint; // replace + else $toprightmenu = $hookmanager->resPrint; // replace } else $toprightmenu .= $result; // For backward compatibility diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 92b8dc34a0e..6a034377ce7 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -178,7 +178,7 @@ if (empty($user->socid)) // If internal user or not defined { $conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED); } -else // If external user +else // If external user { $conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED); } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b78c0478370..d86f823f4c9 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -186,7 +186,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle $qualified = 0; } } - else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE + else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE { $dbcollation = strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)); //var_dump($reg[2]); @@ -226,8 +226,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle if ($buffer) $arraysql[$i] = $buffer; fclose($fp); } - else - { + else { dol_syslog("Admin.lib::run_sql failed to open file ".$sqlfile, LOG_ERR); } @@ -252,8 +251,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle $listofmaxrowid[$table] = $obj->max; if (empty($listofmaxrowid[$table])) $listofmaxrowid[$table] = 0; } - else - { + else { if (!$silent) print '"; if (!$silent) print ''; @@ -370,8 +368,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle } // print ''; } - else - { + else { $errno = $db->errno(); if (!$silent) print ''."\n"; @@ -414,8 +411,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle if (!$silent) print ''."\n"; $ok = 1; } - else - { + else { if (!$silent) print ''; if (!$silent) print ''."\n"; $ok = 0; @@ -458,8 +454,7 @@ function dolibarr_del_const($db, $name, $entity = 1) $conf->global->$name = ''; return 1; } - else - { + else { dol_print_error($db); return -1; } @@ -555,8 +550,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $conf->global->$name = $value; return 1; } - else - { + else { $error = $db->lasterror(); $db->rollback(); return -1; @@ -971,8 +965,7 @@ function activateModule($value, $withdeps = 1) { $ret['errors'][] = $objMod->error; } - else - { + else { if ($withdeps) { if (isset($objMod->depends) && is_array($objMod->depends) && !empty($objMod->depends)) @@ -1009,8 +1002,7 @@ function activateModule($value, $withdeps = 1) $ret['nbmodules'] += $resarray['nbmodules']; $ret['nbperms'] += $resarray['nbperms']; } - else - { + else { $ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring); } } @@ -1082,7 +1074,7 @@ function unActivateModule($value, $requiredby = 1) $result = $objMod->remove(); if ($result <= 0) $ret = $objMod->error; } - else // We come here when we try to unactivate a module when module does not exists anymore in sources + else // We come here when we try to unactivate a module when module does not exists anymore in sources { //print $dir.$modFile;exit; // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded @@ -1163,8 +1155,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab { $j = $objMod->numero; } - else - { + else { $j = 1000 + $i; } @@ -1210,8 +1201,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab print 'Error in descriptor of module '.$const_name.'. Array ->dictionaries has not same number of record for key "tabname", "tablib", "tabsql" and "tabsqlsort"'; //print "$const_name: $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp\n"; } - else - { + else { $taborder[] = 0; // Add an empty line } } @@ -1225,8 +1215,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -1291,8 +1280,7 @@ function activateModulesRequiredByCountry($country_code) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -1348,8 +1336,7 @@ function complete_elementList_with_modules(&$elementList) { $j = $objMod->numero; } - else - { + else { $j = 1000 + $i; } @@ -1393,8 +1380,7 @@ function complete_elementList_with_modules(&$elementList) } closedir($handle); } - else - { + else { dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING); } } @@ -1448,16 +1434,14 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') if (is_numeric($key)) { // Very old behaviour $type = 'string'; } - else - { + else { if (is_array($const)) { $type = $const['type']; $label = $const['label']; $const = $key; } - else - { + else { $type = $const; $const = $key; } @@ -1549,8 +1533,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ''; print ''; } - else - { + else { print ''; } - else - { + else { print "'; } - else - { + else { //print ''; print ''; print ''; @@ -455,8 +452,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') } $db->free($resql); } - else - { + else { dol_print_error($db); } diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 837f505c132..8dd24c87df6 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -63,8 +63,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '') if ($mode == 0) $out .= urlencode($ref); $out .= ($mode ? '' : ''); if ($mode == 1) $out .= '&hashp=hash_of_file'; - else - { + else { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propaltmp = new Propal($db); $res = $propaltmp->fetch(0, $ref); @@ -81,8 +80,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '') $out = $langs->trans("FeatureOnlineSignDisabled"); return $out; } - else - { + else { $out .= '&hashp='.$hashp; } } diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index cdf9fe29b1c..46682addf2c 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -175,8 +175,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -274,8 +273,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $company_id = $assoc['company_id']; } } - else - { + else { dol_print_error($db); return -3; } @@ -323,8 +321,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -425,8 +422,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $company_id = $assoc['company_id']; } } - else - { + else { dol_print_error($db); return -3; } @@ -529,8 +525,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $company_id = $assoc['company_id']; } } - else - { + else { dol_print_error($db); return -3; } @@ -580,8 +575,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $paymentfacturetable = 'paiement_facture'; $invoicefieldref = 'ref'; } - else - { + else { $invoicetable = 'facture_fourn'; $invoicedettable = 'facture_fourn_det'; $fk_facture = 'fk_facture_fourn'; @@ -644,8 +638,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -743,8 +736,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $rate = $assoc['rate']; } } - else - { + else { dol_print_error($db); return -3; } @@ -792,8 +784,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql .= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)"; $sql .= " ORDER BY d.rowid, d.".$fk_facture; } - else - { + else { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; @@ -894,8 +885,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $rate = $assoc['rate']; } } - else - { + else { dol_print_error($db); return -3; } @@ -998,8 +988,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $rate = $assoc['rate']; } } - else - { + else { dol_print_error($db); return -3; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index cf6607e6960..4ed30dbcb2f 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -163,16 +163,14 @@ function showDirectPublicLink($object) { $out .= ''.$langs->trans("PublicInterfaceNotEnabled").''; } - else - { + else { $out .= img_picto('', 'object_globe.png').' '.$langs->trans("TicketPublicAccess").':
'; if ($url) { $out .= ''; $out .= ajax_autoselect("directpubliclink", 0); } - else - { + else { $out .= ''.$langs->trans("TicketNotCreatedFromPublicInterface").''; } } @@ -315,8 +313,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no if (is_object($objcon) && $objcon->id > 0) { $sql = "SELECT DISTINCT a.id, a.label as label,"; } - else - { + else { $sql = "SELECT a.id, a.label as label,"; } $sql .= " a.datep as dp,"; @@ -402,14 +399,12 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no { if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'"; - else - { + else { if ($actioncode == 'AC_OTH') $sql .= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_OTH_AUTO') $sql .= " AND c.type = 'systemauto'"; } } - else - { + else { if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'"; else $sql .= " AND c.code = '".$db->escape($actioncode)."'"; @@ -527,8 +522,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $i++; } } - else - { + else { dol_print_error($db); } @@ -555,8 +549,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no { $out .= ''; } - else - { + else { $out .= ''; } if ($filterobj && get_class($filterobj) == 'Societe') $out .= ''; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 0dcb6e8242d..8f7f6152c97 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -80,8 +80,7 @@ function tree_showpad(&$fulltree, $key, $silent = 0) if ($fulltree[$key]['level'] == $pos) print img_picto_common('', 'treemenu/branch.gif'); else print img_picto_common('', 'treemenu/line.gif'); } - else - { + else { if ($fulltree[$key]['level'] == $pos) print img_picto_common('', 'treemenu/branchbottom.gif'); else print img_picto_common('', 'treemenu/linebottom.gif'); } @@ -175,8 +174,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print $tab[$x]['buttons']; print '
'.$langs->trans("ReStockOnDispatchOrder").''; @@ -294,8 +285,7 @@ else print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER); } } - else - { + else { print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")); } print "
'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').'
'; if (!$silent) print '
'.$langs->trans("Failed to get max rowid for ".$table)."
OK'.$langs->trans("OK").'
'.$langs->trans("ProcessMigrateScript").''.$langs->trans("KO").'
'; print ''; print ''; @@ -1595,7 +1578,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') //var_dump($arrayofmessagename); print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1); } - else // type = 'string' ou 'chaine' + else // type = 'string' ou 'chaine' { print ''; } @@ -1685,8 +1668,7 @@ function addDocumentModel($name, $type, $label = '', $description = '') $db->commit(); return 1; } - else - { + else { dol_print_error($db); $db->rollback(); return -1; @@ -1718,8 +1700,7 @@ function delDocumentModel($name, $type) $db->commit(); return 1; } - else - { + else { dol_print_error($db); $db->rollback(); return -1; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 5d450aa4b04..6070264d487 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -305,8 +305,7 @@ function show_array_actions_to_do($max = 5) $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -394,8 +393,7 @@ function show_array_last_actions_done($max = 5) $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 1d3e80b90be..e917f99defb 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -495,8 +495,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof if (empty($conf->global->$code)) print ''.img_picto($langs->trans("Disabled"), 'off').''; else print ''.img_picto($langs->trans("Enabled"), 'on').''; } - else - { + else { $out = "\n".' '; } - else - { + else { $return = $out; } } @@ -6954,8 +6889,7 @@ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'o $tmpmesgstring = preg_replace('/<\/div>/', '', $tmpmesgstring); $newmesgarray[] = $tmpmesgstring; } - else - { + else { dol_syslog("Error call of dol_htmloutput_mesg with an array with a value that is not a string", LOG_WARNING); } } @@ -7012,8 +6946,7 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen { $temp[$key] = $array[$key]->$index; } - else - { + else { $temp[$key] = $array[$key][$index]; } } @@ -7149,8 +7082,7 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = $db->free($resql); return $cache_codes[$tablename][$key][$fieldid]; } - else - { + else { return -1; } } @@ -7204,8 +7136,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1) if ($hideerrors) return @eval('return '.$s.';'); else return eval('return '.$s.';'); } - else - { + else { if ($hideerrors) @eval($s); else eval($s); } @@ -7249,8 +7180,7 @@ function picto_from_langcode($codelang, $moreatt = '') ); if (isset($langtocountryflag[$codelang])) $flagImage = $langtocountryflag[$codelang]; - else - { + else { $tmparray = explode('_', $codelang); $flagImage = empty($tmparray[1]) ? $tmparray[0] : $tmparray[1]; } @@ -7469,8 +7399,7 @@ function getLanguageCodeFromCountryCode($countrycode) } } } - else - { + else { dol_syslog("Warning Exention php-intl is not available", LOG_WARNING); } @@ -7913,8 +7842,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) { $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$numnewcrit; } - else - { + else { $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false } $i2++; // a criteria was added to string @@ -7965,7 +7893,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) } } } - else // $mode=0 + else // $mode=0 { $tmpcrits = explode('|', $crit); $i3 = 0; @@ -7979,8 +7907,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) { $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ?trim($tmpcrit) : '0'); } - else - { + else { $newres .= $field." LIKE '"; $tmpcrit = trim($tmpcrit); @@ -8271,8 +8198,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield $dictvalues[$tablename][$obj->{$rowidfield}] = $obj; } } - else - { + else { dol_print_error($db); } } @@ -8305,8 +8231,7 @@ function colorIsLight($stringcolor) $g = $tmp[1]; $b = $tmp[2]; } - else - { + else { $hexr = $stringcolor[0].$stringcolor[1]; $hexg = $stringcolor[2].$stringcolor[3]; $hexb = $stringcolor[4].$stringcolor[5]; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 531e0fe242c..dcdd31a1cc2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -233,8 +233,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_creation->id) print $object->user_creation->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_creation_id ? $object->user_creation_id : $object->user_creation); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -269,8 +268,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_modification->id) print $object->user_modification->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_modification_id ? $object->user_modification_id : $object->user_modification); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -305,8 +303,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_validation->id) print $object->user_validation->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_validation_id ? $object->user_validation_id : $object->user_validation); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -341,8 +338,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_approve->id) print $object->user_approve->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_approve_id ? $object->user_approve_id : $object->user_approve); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -405,8 +401,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_cloture->id) print $object->user_cloture->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_cloture); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -441,8 +436,7 @@ function dol_print_object_info($object, $usetable = 0) if ($object->user_rappro->id) print $object->user_rappro->getNomUrl(1, '', 0, 0, 0); else print $langs->trans("Unknown"); } - else - { + else { $userstatic = new User($db); $userstatic->fetch($object->user_rappro); if ($userstatic->id) print $userstatic->getNomUrl(1, '', 0, 0, 0); @@ -760,8 +754,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskcounter = $reg[1]; $hasglobalcounter = true; } - else - { + else { // setting some defaults so the rest of the code won't fail if there is a third party counter $masktri = '00000'; $maskcounter = '00000'; @@ -799,8 +792,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdpaty typent_code (where n is length in mask) $masktype_value = str_pad($masktype_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask } - else - { + else { $masktype = ''; $masktype_value = ''; } @@ -815,8 +807,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskuser_value = substr($lastname, 0, dol_strlen($regType[1])); // get n first characters of user firstname (where n is length in mask) $maskuser_value = str_pad($maskuser_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask } - else - { + else { $maskuser = ''; $maskuser_value = ''; } @@ -961,7 +952,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $sqlwhere .= "(SUBSTRING(".$field.", ".$yearpos.", ".$yearlen.") = '".$yearcomp."'"; $sqlwhere .= " AND SUBSTRING(".$field.", ".$monthpos.", ".$monthlen.") = '".str_pad($monthcomp, $monthlen, '0', STR_PAD_LEFT)."')"; } - else // reset is done on january + else // reset is done on january { $sqlwhere .= '(SUBSTRING('.$field.', '.$yearpos.', '.$yearlen.") = '".$yearcomp."')"; } @@ -974,8 +965,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ { $posnumstart = mb_strrpos($maskwithnocode, $maskcounter, 'UTF-8'); } - else - { + else { $posnumstart = strrpos($maskwithnocode, $maskcounter); } // Pos of counter in final string (from 0 to ...) if ($posnumstart < 0) return 'ErrorBadMaskFailedToLocatePosOfSequence'; @@ -1142,7 +1132,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $numFinal = preg_replace('/\{yy\}/i', date("y", $date) + $yearoffset, $numFinal); $numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1) + $yearoffset, $numFinal); } - else // we want yyyy to be current year + else // we want yyyy to be current year { $numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date), $numFinal); $numFinal = preg_replace('/\{yy\}/i', date("y", $date), $numFinal); @@ -1224,8 +1214,7 @@ function check_value($mask, $value) $maskcounter = $reg[1]; $hasglobalcounter = true; } - else - { + else { // setting some defaults so the rest of the code won't fail if there is a third party counter $masktri = '00000'; $maskcounter = '00000'; @@ -1422,8 +1411,7 @@ function numero_semaine($time) { $numeroSemaine = 53; } - else - { + else { $numeroSemaine = 1; } } @@ -1528,8 +1516,7 @@ function dol_set_user_param($db, $conf, &$user, $tab) $user->conf->$key = $value; //print "key=".$key." user->conf->key=".$user->conf->$key; } - else - { + else { unset($user->conf->$key); } } @@ -1552,8 +1539,7 @@ function dol_print_reduction($reduction, $langs) { $string = $langs->transnoentities("Offered"); } - else - { + else { $string = vatrate($reduction, true); } @@ -1674,13 +1660,11 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $liste[$obj->id.':'.$record['fullname']] = dol_trunc($record['name'], $max, 'middle'); } } - else - { + else { $liste[0] = $obj->label.': '.$langs->trans("None"); } } - else - { + else { if ($type == 'member' && $obj->doc_template_name == 'standard') // Special case, if member template, we add variant per format { global $_Avery_Labels; @@ -1690,7 +1674,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $liste[$obj->id.':'.$key] = ($obj->label ? $obj->label : $obj->doc_template_name).' '.$val['name']; } } - else // Common usage + else // Common usage { $liste[$obj->id] = $obj->label ? $obj->label : $obj->doc_template_name; } @@ -1698,8 +1682,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $i++; } } - else - { + else { dol_print_error($db); return -1; } @@ -1777,8 +1760,7 @@ function getSoapParams() 'trace' => 1 ); } - else - { + else { $params = array('connection_timeout'=>$timeout, 'response_timeout'=>$response_timeout, 'proxy_use' => 0, @@ -1968,8 +1950,7 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $i++; } } - else - { + else { dol_print_error($db); } @@ -2148,7 +2129,7 @@ function colorAgressiveness($hex, $ratio = -50, $brightness = 0) if ($color > 127) $color += ((255 - $color) * ($ratio / 100)); if ($color < 128) $color -= ($color * ($ratio / 100)); } - else // We decrease agressiveness + else // We decrease agressiveness { if ($color > 128) $color -= (($color - 128) * (abs($ratio) / 100)); if ($color < 127) $color += ((128 - $color) * (abs($ratio) / 100)); @@ -2157,8 +2138,7 @@ function colorAgressiveness($hex, $ratio = -50, $brightness = 0) { $color = ($color * (100 + abs($brightness)) / 100); } - else - { + else { $color = ($color * (100 - abs($brightness)) / 100); } diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 26db2bbec90..f3dfa25c05c 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -213,8 +213,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON); if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON == 1) $entexto .= " MILLÓN "; - else - $entexto .= " MILLONES "; + else $entexto .= " MILLONES "; } if ($number >= 1000) { $cdm = (int) ($numero / 100000); diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index ae0eb86882e..0175ed83e61 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -88,8 +88,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $array_param = null; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' if (!is_array($param)) parse_str($param, $array_param); - else - { + else { dol_syslog("parameter param must be a string", LOG_WARNING); $array_param = $param; } @@ -109,8 +108,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); // POST } - else - { + else { curl_setopt($ch, CURLOPT_POST, 0); // GET } @@ -144,8 +142,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = dol_syslog("getURLContent response array is ".join(',', $rep)); } - else - { + else { $info = curl_getinfo($ch); // Ad keys to $rep @@ -183,8 +180,7 @@ function getDomainFromURL($url, $mode = 0) { $tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)\.([^\.]+)$/', '\1.\2.\3', $tmpdomain); // Remove part 'www.' before 'abc.mydomain.com' } - else - { + else { $tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)$/', '\1.\2', $tmpdomain); // Remove part 'www.abc.' before 'mydomain.com' } if (empty($mode)) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 4f65ca3a2bf..c13c9c0f56c 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -221,8 +221,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, // Compatibilite image GIF $imgThumb = imagecreate($newWidth, $newHeight); } - else - { + else { $imgThumb = imagecreatetruecolor($newWidth, $newHeight); } @@ -359,8 +358,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) if ($fileDest === false) { return $img; } - else - { + else { // In fact there exif is only for JPG but just in case // Create image on disk $image = false; @@ -597,8 +595,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $thumbWidth = $maxWidth; $thumbHeight = $thumbWidth / $imgWhFact; } - else - { + else { // Si hauteur determinante $thumbHeight = $maxHeight; $thumbWidth = $thumbHeight * $imgWhFact; @@ -615,8 +612,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', // Compatibilite image GIF $imgThumb = imagecreate($thumbWidth, $thumbHeight); } - else - { + else { $imgThumb = imagecreatetruecolor($thumbWidth, $thumbHeight); } diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index d5ca3431845..64ecdcf9e69 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -262,15 +262,13 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte $result = 1; } - else - { + else { if ($usestdout) print "No invoices found for criteria.\n"; else dol_syslog("No invoices found for criteria"); $result = 0; } } - else - { + else { dol_print_error($db); dol_syslog("scripts/invoices/rebuild_merge.php: Error"); $error++; diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 44ad9cc6ff1..9bf2db7278c 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -54,8 +54,7 @@ function dol_json_encode($elements) { foreach ($elements as $key => $value) $num++; } - else - { + else { $num = count($elements); } //var_dump($num); @@ -75,8 +74,7 @@ function dol_json_encode($elements) } $output .= ']'; } - else - { + else { // associative (object) $output = '{'; $last = $num - 1; @@ -201,7 +199,7 @@ function _val($val) elseif (is_int($val)) return sprintf('%d', $val); elseif (is_float($val)) return sprintf('%F', $val); elseif (is_bool($val)) return ($val ? 'true' : 'false'); - else return 'null'; + else return 'null'; } if (!function_exists('json_decode')) diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 038791ce1cc..b5ea5faf3c5 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -122,8 +122,7 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass) $langs->load("errors"); print ''.$butlabel.''; } - else - { + else { print ''.$butlabel.''; } print '

'; diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index a301ac40a2b..6ed00c10b34 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -64,8 +64,7 @@ function dol_setcache($memoryid, $data) { return count($data); } - else - { + else { return -$rescode; } } @@ -87,8 +86,7 @@ function dol_setcache($memoryid, $data) { return count($data); } - else - { + else { return -1; } } @@ -134,8 +132,7 @@ function dol_getcache($memoryid) { return $data; } - else - { + else { return -$rescode; } } @@ -159,8 +156,7 @@ function dol_getcache($memoryid) { return $data; } - else - { + else { return -1; } } @@ -236,8 +232,7 @@ function dol_setshmop($memoryid, $data) shmop_close($handle); return ($shm_bytes_written1 + $shm_bytes_written2); } - else - { + else { print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size; return -1; } @@ -264,8 +259,7 @@ function dol_getshmop($memoryid) else return -1; shmop_close($handle); } - else - { + else { return -2; } return $data; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index b9a958160d4..373e80e2a67 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -83,8 +83,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = //$pathoffiletoedittmp=$destdir.'/class/'.strtolower($objectname).'.class.php.tmp'; //dol_delete_file($pathoffiletoedittmp, 0, 1, 1); - try - { + try { include_once $pathoffiletoeditsrc; if (class_exists($objectname)) $object = new $objectname($db); else return -4; @@ -234,8 +233,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' } // Load object from myobject.class.php - try - { + try { if (!is_object($object)) { include_once $pathoffiletoclasssrc; @@ -270,8 +268,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' $texttoinsert .= "\t".$key." ".$type; if ($key == 'rowid') $texttoinsert .= ' AUTO_INCREMENT PRIMARY KEY'; if ($key == 'entity') $texttoinsert .= ' DEFAULT 1'; - else - { + else { if ($val['default'] != '') { if (preg_match('/^null$/i', $val['default'])) $texttoinsert .= " DEFAULT NULL"; @@ -293,8 +290,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' { @chmod($pathoffiletoedittarget, octdec($newmask)); } - else - { + else { $error++; } @@ -338,8 +334,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' { @chmod($pathoffiletoedittarget, octdec($newmask)); } - else - { + else { $error++; } diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 7dfd025609c..6a83fad87be 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -46,8 +46,7 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) $Parsedown = new Parsedown(); $content = $Parsedown->text($content); } - else - { + else { $content = nl2br($content); } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index d031984552e..eedc8034d01 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -190,8 +190,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -208,8 +207,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -226,8 +224,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -244,8 +241,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); @@ -262,8 +258,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 63789a18e62..bfa49911b02 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -55,8 +55,7 @@ function pdf_getFormat(Translate $outputlangs = null, $mode = 'setup') include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $pdfformat = dol_getDefaultFormat($outputlangs); } - else - { + else { $pdfformat = $conf->global->MAIN_PDF_FORMAT; } @@ -306,8 +305,7 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) if ($end_page == $start_page) { $height = $end_y - $start_y; } - else - { + else { for ($page = $start_page; $page <= $end_page; ++$page) { $pdf->setPage($page); $tmpm = $pdf->getMargins(); @@ -514,8 +512,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t } } } - else - { + else { $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); // Country if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress .= ($stringaddress ? "\n" : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); @@ -804,8 +801,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $cury += 8; } } - else - { + else { $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); @@ -1059,8 +1055,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } $freetextheight = $pdf->getStringHeight($width, $line); } - else - { + else { $freetextheight = pdfGetHeightForHtmlContent($pdf, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); // New method (works for HTML content) //print '
'.$freetextheight;exit; } @@ -1076,8 +1071,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ { $pdf->MultiCell(0, 3, $line, 0, $align, 0); } - else - { + else { $pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); } $posy -= $freetextheight; @@ -1245,8 +1239,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $prodser = new ProductFournisseur($db); } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $prodser = new Product($db); } @@ -1328,8 +1321,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $discount->fetch($object->lines[$i]->fk_remise_except); $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromExcessPaid", $discount->ref_invoice_supplier_source); } - else - { + else { if ($idprod) { if (empty($hidedesc)) @@ -1338,14 +1330,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, { $libelleproduitservice = $desc."\n".$libelleproduitservice; } - else - { + else { $libelleproduitservice .= $desc; } } } - else - { + else { $libelleproduitservice .= $desc; } } @@ -1360,8 +1350,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, { $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." "; } - else - { + else { $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product")." "; } } @@ -1374,14 +1363,13 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $ref_prodserv = $ref_supplier; elseif ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 2) $ref_prodserv = $ref_supplier.' ('.$outputlangs->transnoentitiesnoconv("InternalRef").' '.$prodser->ref.')'; - else // Common case + else // Common case { $ref_prodserv = $prodser->ref; // Show local ref if ($ref_supplier) $ref_prodserv .= ($prodser->ref ? ' (' : '').$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.($prodser->ref ? ')' : ''); } } - else - { + else { $ref_prodserv = $prodser->ref; // Show local ref only } @@ -1944,8 +1932,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm } $result = ($object->lines[$i]->situation_percent - $prev_progress).'%'; } - else - $result = $object->lines[$i]->situation_percent.'%'; + else $result = $object->lines[$i]->situation_percent.'%'; } } return $result; @@ -2001,8 +1988,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0) } $result .= price($sign * ($total_ht / ($object->lines[$i]->situation_percent / 100)) * $progress, 0, $outputlangs); } - else - { + else { $result .= price($sign * $total_ht, 0, $outputlangs); } } @@ -2187,8 +2173,7 @@ function pdf_getLinkedObjects($object, $outputlangs) //if (! empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'].=' / '; //$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs); } - else - { + else { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); @@ -2235,7 +2220,7 @@ function pdf_getSizeForImage($realpath) $width = $maxwidth; $height = (int) round($maxwidth * $tmp['height'] / $tmp['width']); } - else // No pb with maxheight + else // No pb with maxheight { $height = $maxheight; } @@ -2261,8 +2246,7 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = { return $outputlangs->transnoentities("Option"); } - else - { + else { if (is_object($hookmanager)) { $special_code = $object->lines[$i]->special_code; diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index c06c4431562..8f77d24bdab 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -132,7 +132,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $localtax2_type = $localtaxes_array[2]; $localtax2_rate = $localtaxes_array[3]; } - else // deprecated method. values and type for localtaxes must be provided by caller and loaded with getLocalTaxesFromRate using the full vat rate (including text code) + else // deprecated method. values and type for localtaxes must be provided by caller and loaded with getLocalTaxesFromRate using the full vat rate (including text code) { dol_syslog("Price.lib::calcul_price_total search vat information using old deprecated method", LOG_WARNING); @@ -159,8 +159,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // pu calculation from pu_devise if pu empty if (empty($pu) && !empty($pu_devise)) { if (!empty($multicurrency_tx)) $pu = $pu_devise / $multicurrency_tx; - else - { + else { dol_syslog('Price.lib::calcul_price_total function called with bad parameters combination (multicurrency_tx empty when pu_devise not) ', LOG_ERR); return array(); } @@ -169,8 +168,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // pu_devise calculation from pu if (empty($pu_devise) && !empty($multicurrency_tx)) { if (is_numeric($pu) && is_numeric($multicurrency_tx)) $pu_devise = $pu * $multicurrency_tx; - else - { + else { dol_syslog('Price.lib::calcul_price_total function called with bad parameters combination (pu or multicurrency_tx are not numeric)', LOG_ERR); return array(); } @@ -193,8 +191,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $tot_avec_remise_wt = price2num($tot_avec_remise * (1 + ($txtva / 100)), 'MU'); $pu_wt = price2num($pu * (1 + ($txtva / 100)), 'MU'); } - else - { + else { $tot_sans_remise_wt = $tot_sans_remise; $tot_avec_remise_wt = $tot_avec_remise; $pu_wt = $pu; @@ -269,8 +266,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result5bis = price2num($pu * (1 + ($txtva / 100)) + $localtaxes[2], 'MU'); // Si TVA consideree normale (non NPR) $result[4] = price2num($result5bis - ($result[3] + $localtaxes[2]), 'MU'); } - else - { + else { // We work to define prices using the price with tax $result[8] = price2num($tot_sans_remise + $localtaxes[0], 'MT'); $result[6] = price2num($tot_sans_remise / (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)), 'MT'); // Selon TVA NPR ou non @@ -355,8 +351,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result[9] = round($result[9] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; $result[10] = round($result[10] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; } - else - { + else { $result[1] = round($result[1] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; $result[2] = round($result[2] / $conf->global->MAIN_ROUNDING_RULE_TOT, 0) * $conf->global->MAIN_ROUNDING_RULE_TOT; $result[0] = price2num($result[2] - $result[1], 'MT'); @@ -406,8 +401,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result[25] = $newresult[9]; $result[26] = $newresult[10]; } - else - { + else { $result[16] = $result[0]; $result[17] = $result[1]; $result[18] = $result[2]; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 43acb16ba2a..e1ed6efc805 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -553,8 +553,7 @@ function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_sho 't.active' => 1 ); } - else - { + else { $arrayforfilter = array( 't.rowid' => $unit, 't.unit_type' => $measuring_style, diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index bef3d9fd0dc..c84762f8575 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -419,14 +419,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t { $showlineingray = 1; // We will show line but in gray } - else - { + else { $showline = 0; // No reason to show line } } } - else - { + else { // Caller did not ask to filter on tasks of a specific user (this probably means he want also tasks of all users, into public project // or into all other projects if user has permission to). if (empty($user->rights->projet->all->lire)) @@ -682,8 +680,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($lines[$i]->planned_workload) $total_projectlinesa_declared_if_planned += $lines[$i]->planned_workload * $lines[$i]->progress / 100; } } - else - { + else { //$level--; } } @@ -1380,8 +1377,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr } $level--; } - else - { + else { //$level--; } } @@ -1745,8 +1741,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } $level--; } - else - { + else { //$level--; } } @@ -2006,8 +2001,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & } $level--; } - else - { + else { //$level--; } } @@ -2110,8 +2104,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as ctc"; } - else - { + else { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; } $sql .= " WHERE p.entity IN (".getEntity('project').")"; @@ -2339,8 +2332,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -2475,8 +2467,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide } $out .= ' '; } - else - { + else { // bad $out .= '
'; $out .= '
'; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 03f1525eb91..76ce3cb5b01 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -504,8 +504,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; $sql .= " AND dbt.entity IS NOT NULL"; } - else - { + else { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; $sql .= " AND ((ug.fk_user = dbt.rowid"; @@ -518,8 +517,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; } } - else - { + else { $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; } @@ -590,8 +588,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $tmparray = explode(',', $tmps); if (!in_array($objectid, $tmparray)) return false; } - else - { + else { $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; @@ -611,8 +608,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $tmparray = explode(',', $tmps); if (!in_array($task->fk_project, $tmparray)) return false; } - else - { + else { $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")"; @@ -662,8 +658,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $obj = $db->fetch_object($resql); if (!$obj || $obj->nb < count(explode(',', $objectid))) return false; } - else - { + else { return false; } } @@ -723,8 +718,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho print $langs->trans("CurrentLogin").': '.$user->login.'
'; print $langs->trans("ErrorForbidden2", $langs->transnoentitiesnoconv("Home"), $langs->transnoentitiesnoconv("Users")); } - else - { + else { print $langs->trans("ErrorForbidden3"); } } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 04d16084365..fba8ba346c6 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -102,8 +102,7 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth $dol_screenheight = GETPOST('screenheight'); } } - else - { + else { dol_syslog("Authentication KO - failed to load file '".$authfile."'", LOG_ERR); sleep(1); // Load translation files required by the page @@ -180,8 +179,7 @@ if (!function_exists('dol_loginfunction')) if (file_exists($tmp)) { $template_dir = preg_replace('/login\.tpl\.php$/', '', $tmp); break; } } } - else - { + else { $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/"; } @@ -376,8 +374,7 @@ function encodedecode_dbpassconf($level = 0) $val = dol_decode($val); $passwd = $val; } - else - { + else { $passwd = $val; $val = dol_encode($val); $passwd_crypted = $val; @@ -401,8 +398,7 @@ function encodedecode_dbpassconf($level = 0) //print 'passwd = '.$passwd.' - passwd_crypted = '.$passwd_crypted; //exit; } - else - { + else { $config .= $buffer; } } @@ -423,14 +419,12 @@ function encodedecode_dbpassconf($level = 0) return 1; } - else - { + else { dol_syslog("encodedecode_dbpassconf Failed to open conf.php file for writing", LOG_WARNING); return -1; } } - else - { + else { dol_syslog("encodedecode_dbpassconf Failed to read conf.php", LOG_ERR); return -2; } @@ -476,7 +470,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len $generated_password = str_shuffle($randomCode); } - else // Old platform, non cryptographic random + else // Old platform, non cryptographic random { $max = strlen($lowercase) - 1; for ($x = 0; $x < $nbofchar; $x++) { @@ -514,8 +508,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len { $generated_password = str_replace($replaceambiguouschars, $numbers{random_int(0, $max)}, $generated_password); } - else - { + else { $generated_password = str_replace($replaceambiguouschars, $numbers{mt_rand(0, $max)}, $generated_password); } } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index ad1e6304d03..541aab2358e 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -305,8 +305,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - { + else { $label = (!empty($objp->label) ? $objp->label : $objp->product_label); } @@ -333,8 +332,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print '
"; if ($objp->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -440,8 +438,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print dol_print_date($receiving->date_delivery, 'day'); print '   
'; } - else - { + else { print $tab[$x]['entry']; } //print ' -> A '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'
'."\n"; @@ -211,8 +209,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print $tab[$x]['buttons']; print ''; } - else - { + else { print $tab[$x]['entry']; } //print ' -> B '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'
'."\n"; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 9ac9383e516..2fbc6eee325 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -347,8 +347,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ' '; print ''; } - else - { + else { $dirthemestring = ''; foreach ($dirthemes as $dirtheme) { @@ -404,8 +403,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print ' '.$subdir.''; } - else - { + else { print ' '.$subdir; } print ''; @@ -442,8 +440,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { // Nothing } - else - { + else { // Show logo print ''.$langs->trans("EnableShowLogo").''; if ($edit) @@ -451,8 +448,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ajax_constantonoff('MAIN_SHOW_LOGO', array(), null, 0, 0, 1); //print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1); } - else - { + else { print yn($conf->global->MAIN_SHOW_LOGO); } print ''; @@ -487,8 +483,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = $langs->trans('No'); print ''; print ''.$langs->trans("TopMenuDisableImages").''; @@ -498,8 +493,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ajax_constantonoff('THEME_TOPMENU_DISABLE_IMAGE', array(), null, 0, 0, 1); //print $form->selectyesno('THEME_TOPMENU_DISABLE_IMAGE', $conf->global->THEME_TOPMENU_DISABLE_IMAGE, 1); } - else - { + else { print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -532,8 +526,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { print ''; print ''.$langs->trans("BackgroundColor").''; print ''; @@ -542,8 +535,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''), 'THEME_ELDY_BACKBODY', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -578,8 +570,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = (empty($colorbackhmenu1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbackhmenu1))); print ''; @@ -589,8 +580,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''), 'THEME_ELDY_TOPMENU_BACK1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -625,8 +615,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = (empty($colorbackvmenu1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbackvmenu1))); print ''; @@ -636,8 +625,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''), 'THEME_ELDY_VERMENU_BACK1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -652,8 +640,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colortexttitlenotab) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlenotab))); print ''; @@ -663,8 +650,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLENOTAB, array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -678,8 +664,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colorbacktitle1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacktitle1))); print ''; @@ -689,8 +674,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1, array()), ''), 'THEME_ELDY_BACKTITLE1', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; // $colorbacktitle1 in CSS @@ -704,8 +688,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colortexttitle) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitle))); print ''; @@ -715,8 +698,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLE, array()), ''), 'THEME_ELDY_TEXTTITLE', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -730,8 +712,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default=(empty($colortexttitlelink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlelink))); print ''; @@ -741,8 +722,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLELINK, array()), ''), 'THEME_ELDY_TEXTTITLELINK', 'formcolor', 1).' '; } - else - { + else { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default")); } print '   '.$langs->trans("Default").': '.$default.' '; @@ -757,8 +737,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colorbacklineimpair1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklineimpair1))); print ''; @@ -768,8 +747,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''), 'THEME_ELDY_LINEIMPAIR1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -784,8 +762,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($foruserprofile) { } - else - { + else { $default = (empty($colorbacklinepair1) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklinepair1))); print ''; @@ -795,8 +772,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''), 'THEME_ELDY_LINEPAIR1', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''); if ($color) print ''; else print $langs->trans("Default"); @@ -831,8 +807,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '';*/ } - else - { + else { $default = (empty($colortextlink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortextlink))); print ''; @@ -842,12 +817,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''), 'THEME_ELDY_TEXTLINK', 'formcolor', 1).' '; } - else - { + else { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''); if ($color) print ''; - else - { + else { //print ''; //print ''.$langs->trans("Default").''; print $langs->trans("Default"); @@ -887,8 +860,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', 'formcolor', 1).' '; } - else - { + else { if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover)); else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), ''); if ($color) @@ -917,8 +889,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; */ } - else - { + else { $default = (empty($colorbacklinepairchecked) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklinepairchecked))); print ''; @@ -932,8 +903,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), ''); print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', 'formcolor', 1).' '; } - else - { + else { if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color = 'e6edf0'; else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), ''); if ($color) @@ -962,14 +932,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1); } - else - { + else { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print yn($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER); } - else - { + else { print yn(1); if (empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' ('.$langs->trans("ForcedByGlobalSetup").')'; } @@ -979,8 +947,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; } - else - { + else { /*var_dump($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); $default=$langs->trans('No'); print ''; @@ -1024,8 +991,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) { print $form->selectArray('MAIN_OPTIMIZEFORCOLORBLIND', $colorBlindOptions, $fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND, 0); } - else - { + else { if (!empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND) && isset($colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND])) { print $colorBlindOptions[$fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND]; } @@ -1038,8 +1004,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; } - else - { + else { } print ''; } diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 1864ca27bea..9dd7708c36d 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -94,8 +94,7 @@ function dolKeepOnlyPhpCode($str) { $newstr .= $partlings[0].'?>'; } - else - { + else { $newstr .= $part.'?>'; } } @@ -300,7 +299,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') $content = str_replace('!~!~!~', '', $content); } } - else // REPLACEMENT OF LINKS When page called from virtual host + else // REPLACEMENT OF LINKS When page called from virtual host { $symlinktomediaexists = 1; if ($website->virtualhost) { @@ -336,8 +335,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') $content = preg_replace('/(]*src=")\/?viewimage\.php/', '\1/wrapper.php', $content, -1, $nbrep); $content = preg_replace('/(]*href=")\/?documents\.php/', '\1/wrapper.php', $content, -1, $nbrep); } - else - { + else { // ]*src=")\/?image\//', '\1/medias/image/', $content, -1, $nbrep); $content = preg_replace('/(url\(["\']?)\/?image\//', '\1/medias/image/', $content, -1, $nbrep); @@ -426,8 +424,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri { $containerref = $tmpwebsitepage->pageurl; } - else - { + else { print "Error, page contains a redirect to the alternative alias '".$containeraliasalt."' that does not exists in web site (".$website->id." / ".$website->ref.")"; exit; } @@ -464,18 +461,16 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri print "Error, page with uri '.$currenturi.' try a redirect to the same alias page '".$containerref."' in web site '".$website->ref."'"; exit; } - else - { + else { $newurl = preg_replace('/&pageref=([^&]+)/', '&pageref='.$containerref, $currenturi); } } - else - { + else { $newurl = $currenturi.'&pageref='.urlencode($containerref); } } } - else // When page called from virtual host server + else // When page called from virtual host server { $newurl = '/'.$containerref.'.php'; } @@ -488,8 +483,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri header("Location: ".$newurl); exit; } - else - { + else { print "Error, page contains a redirect to the alias page '".$containerref."' that does not exists in web site (".$website->id." / ".$website->ref.")"; exit; } @@ -601,7 +595,7 @@ function getStructuredData($type, $data = array()) if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= '"sameAs": ['; $i = 0; - foreach($mysoc->socialnetworks as $key => $value) { + foreach ($mysoc->socialnetworks as $key => $value) { if ($key == 'linkedin') { $ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"'; } elseif ($key == 'youtube') { @@ -670,7 +664,7 @@ function getStructuredData($type, $data = array()) $ret .= '"keywords": ['; $i = 0; $arrayofkeywords = explode(',', $websitepage->keywords); - foreach($arrayofkeywords as $keyword) { + foreach ($arrayofkeywords as $keyword) { $ret.= '"'.dol_escape_json($keyword).'"'; $i++; if ($i < count($arrayofkeywords)) $ret .= ', '; @@ -810,8 +804,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $arrayresult['code'] = 'KO'; $arrayresult['message'] = $weblangs->trans("ErrorSearchCriteriaTooSmall"); } - else - { + else { $tmparrayoftype = explode(',', $type); foreach ($tmparrayoftype as $tmptype) { if (!in_array($tmptype, array('', 'page', 'blogpost'))) { @@ -873,8 +866,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $i++; } } - else - { + else { $error++; $arrayresult['code'] = $db->lasterrno(); $arrayresult['message'] = $db->lasterror(); @@ -934,8 +926,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $arrayresult['message'] = $weblangs->trans("NoRecordFound"); } } - else - { + else { $error++; $arrayresult['code'] = 'KO'; $arrayresult['message'] = 'No supported algorithm found'; @@ -985,8 +976,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify $urltograbdirrootwithoutslash = getRootURLFromURL($urltograb); $urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot } - else - { + else { $urltograbbis = $urltograb.'/'.$regs[2][$key]; // We use dir of grabbed file } @@ -1029,8 +1019,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors'); $action = 'create'; } - else - { + else { $alreadygrabbed[$urltograbbis] = 1; // Track that file was alreay grabbed. dol_mkdir(dirname($filetosave)); @@ -1062,8 +1051,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify $urltograbdirrootwithoutslash = getRootURLFromURL($urltograb); $urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot } - else - { + else { $urltograbbis = $urltograb.'/'.$regs[2][$key]; // We use dir of grabbed file } @@ -1108,8 +1096,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors'); $action = 'create'; } - else - { + else { $alreadygrabbed[$urltograbbis] = 1; // Track that file was alreay grabbed. dol_mkdir(dirname($filetosave)); diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 440f1147cbf..33db8490a75 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -230,8 +230,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) $enddate = dol_time_plus_duree($startdate, 1, "d"); } } - else - { + else { if (empty($enddate)) { $enddate = $startdate + $duration; @@ -316,8 +315,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } } - else - { + else { dol_syslog("xcal.lib.php::build_calfile Failed to open file ".$outputfile." for writing"); return -2; } @@ -526,8 +524,7 @@ function calEncode($line) $out .= $newpara; } - else - { + else { $strlength = dol_strlen($line); for ($j = 0; $j < $strlength; $j++) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index ea3fa2f3a19..333e4741cd1 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -107,8 +107,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes { $login = $obj->login; } - else - { + else { sleep(2); // Anti brut force protection dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE); @@ -124,8 +123,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes global $mc; if (!isset($mc)) $conf->multicompany->enabled = false; // Global not available, disable $conf->multicompany->enabled for safety - else - { + else { $ret = $mc->checkRight($obj->rowid, $entitytotest); if ($ret < 0) { @@ -135,8 +133,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes } } } - else - { + else { dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE); sleep(1); @@ -146,8 +143,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword"); } } - else - { + else { dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO db error for '".$usertotest."' error=".$db->lasterror(), LOG_ERR); sleep(1); $_SESSION["dol_loginmesg"] = $db->lasterror(); diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 3a8b274c109..9f7f5f1d81c 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -127,8 +127,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) return ''; } } - else - { + else { if ($ldapdebug) print "DEBUG: ".$ldap->error."
\n"; } $ldap->close(); @@ -219,8 +218,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword"); } } - else - { + else { /* Login failed. Return false, together with the error code and text from ** the LDAP server. The common error codes and reasons are listed below : ** (for iPlanet, other servers may differ) diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php index a401dfd7764..c354d2d8d0e 100644 --- a/htdocs/core/login/functions_openid.php +++ b/htdocs/core/login/functions_openid.php @@ -57,8 +57,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest) $openid->SetApprovedURL($protocol.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]); // Send Response from OpenID server to this script $openid->Redirect(); // This will redirect user to OpenID Server } - else - { + else { $error = $openid->GetError(); return false; } @@ -96,8 +95,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest) $error = $openid->GetError(); return false; } - else - { + else { // Signature Verification Failed //echo "INVALID AUTHORIZATION"; return false; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 4b4a4c54151..c58c8049c27 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -145,8 +145,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ - else - { + else { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo_squarred_alpha.png'; $logoContainerAdditionalClass = ''; } @@ -411,8 +410,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $i++; } } - else - { + else { // Should not happend. Entries are added $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); } @@ -474,8 +472,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t { print '
'."\n"; } - else - { + else { print '
'."\n"; } } @@ -539,8 +536,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t print ''."\n"; $lastlevel0 = 'greyed'; } - else - { + else { $lastlevel0 = 'hidden'; } if ($showmenu) diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 2a67d43c1e3..c654e823b5c 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -79,8 +79,7 @@ class MenuManager $_SESSION["mainmenu"] = $mainmenu; $_SESSION["leftmenuopened"] = ""; } - else - { + else { // On va le chercher en session si non defini par le lien $mainmenu = isset($_SESSION["mainmenu"]) ? $_SESSION["mainmenu"] : ''; } @@ -97,8 +96,7 @@ class MenuManager //$leftmenu=""; $_SESSION["leftmenuopened"] = ""; } - else - { + else { $_SESSION["leftmenuopened"] = $leftmenu; } } else { @@ -146,8 +144,7 @@ class MenuManager if ($mode == 'top') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); if ($mode == 'left') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata); } - else - { + else { $conf->global->MAIN_SHOW_LOGO = 0; if ($mode == 'top') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0); if ($mode == 'left') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); @@ -226,8 +223,7 @@ class MenuManager { $lastlevel[0] = 'greyed'; } - else - { + else { $lastlevel[0] = 'hidden'; } } @@ -259,8 +255,7 @@ class MenuManager { $relurl2 = dol_buildpath($val2['url'], 1); } - else - { + else { $relurl2 = $val2['url']; } $canonurl2 = preg_replace('/\?.*$/', '', $val2['url']); @@ -286,20 +281,18 @@ class MenuManager print '>'; $lastlevel2[$val2['level']] = 'enabled'; } - else // Not allowed but visible (greyed) + else // Not allowed but visible (greyed) { print ''; $lastlevel2[$val2['level']] = 'greyed'; } } - else - { + else { if ($val2['enabled']) // Allowed { $lastlevel2[$val2['level']] = 'enabled'; } - else - { + else { $lastlevel2[$val2['level']] = 'greyed'; } } @@ -308,8 +301,7 @@ class MenuManager { if ($val2['enabled']) // Allowed print ''; - else - print ''; + else print ''; } print ''."\n"; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3f539260856..39f94d6eb2f 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -440,8 +440,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $mtitle .= $langs->trans($item); } } - else - { + else { $mtitle = $langs->trans($smenu->title); } // Add item @@ -512,8 +511,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ - else - { + else { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo_squarred_alpha.png'; $logoContainerAdditionalClass = ''; } @@ -1309,8 +1307,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $i++; } } - else - { + else { // Should not happend. Entries are added $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->rights->accounting->comptarapport->lire); } @@ -1625,8 +1622,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); } - else - { + else { $newmenu->add("/product/inventory/list.php?leftmenu=stock", $langs->trans("Inventory"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock'); $newmenu->add("/product/inventory/card.php?action=create", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); $newmenu->add("/product/inventory/list.php", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); @@ -1987,8 +1983,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM { print '
'."\n"; } - else - { + else { print '
'."\n"; } } @@ -2052,8 +2047,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM print ''."\n"; $lastlevel0 = 'greyed'; } - else - { + else { $lastlevel0 = 'hidden'; } if ($showmenu) diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 5276a509ae5..2d62f9f7275 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -78,8 +78,7 @@ class MenuManager $_SESSION["mainmenu"] = $mainmenu; $_SESSION["leftmenuopened"] = ""; } - else - { + else { // On va le chercher en session si non defini par le lien $mainmenu = isset($_SESSION["mainmenu"]) ? $_SESSION["mainmenu"] : ''; } @@ -96,8 +95,7 @@ class MenuManager //$leftmenu=""; $_SESSION["leftmenuopened"] = ""; } - else - { + else { $_SESSION["leftmenuopened"] = $leftmenu; } } else { @@ -147,8 +145,7 @@ class MenuManager if ($mode == 'top') print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); if ($mode == 'left') print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata); } - else - { + else { $conf->global->MAIN_SHOW_LOGO = 0; if ($mode == 'top') print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0); if ($mode == 'left') print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode); @@ -231,8 +228,7 @@ class MenuManager { $lastlevel[0] = 'greyed'; } - else - { + else { $lastlevel[0] = 'hidden'; } } @@ -264,8 +260,7 @@ class MenuManager { $relurl2 = dol_buildpath($val2['url'], 1); } - else - { + else { $relurl2 = $val2['url']; } $canonurl2 = preg_replace('/\?.*$/', '', $val2['url']); @@ -291,20 +286,18 @@ class MenuManager print '>'; $lastlevel2[$val2['level']] = 'enabled'; } - else // Not allowed but visible (greyed) + else // Not allowed but visible (greyed) { print ''; $lastlevel2[$val2['level']] = 'greyed'; } } - else - { + else { if ($val2['enabled']) // Allowed { $lastlevel2[$val2['level']] = 'enabled'; } - else - { + else { $lastlevel2[$val2['level']] = 'greyed'; } } @@ -313,8 +306,7 @@ class MenuManager { if ($val2['enabled']) // Allowed print ''; - else - print ''; + else print ''; } print ''."\n"; } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 923f4e84965..2b2a000fa3b 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -231,8 +231,7 @@ class MenuManager { $lastlevel[0] = 'greyed'; } - else - { + else { $lastlevel[0] = 'hidden'; } } @@ -282,20 +281,18 @@ class MenuManager print '>'; $lastlevel2[$val2['level']] = 'enabled'; } - else // Not allowed but visible (greyed) + else // Not allowed but visible (greyed) { print ''; $lastlevel2[$val2['level']] = 'greyed'; } } - else - { + else { if ($val2['enabled']) // Allowed { $lastlevel2[$val2['level']] = 'enabled'; } - else - { + else { $lastlevel2[$val2['level']] = 'greyed'; } } @@ -376,8 +373,7 @@ class MenuManager { print '
'."\n"; } - else - { + else { print '
'."\n"; } } @@ -398,8 +394,7 @@ class MenuManager { print ''."\n"; } - else - { + else { print ''."\n"; } print ''."\n"; @@ -420,8 +415,7 @@ class MenuManager if ($this->menu->liste[$i]['url']) print $this->menu->liste[$i]['titre'].''; else print ''; } - else - { + else { print $tabstring.''.$this->menu->liste[$i]['titre'].''; } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 24811ad854d..0911dc85719 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -438,8 +438,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->error = $this->db->lasterror(); $err++; } - else - { + else { dol_syslog(get_class($this)."::_init Warning ".$this->db->lasterror(), LOG_WARNING); } } @@ -451,8 +450,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return 0; } @@ -538,8 +536,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return 0; } @@ -561,8 +558,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // If module name translation exists return $langs->transnoentitiesnoconv("Module".$this->numero."Name"); } - else - { + else { // If module name translation using it's unique id does not exist, we try to use its name to find translation if (is_array($this->langfiles)) { foreach ($this->langfiles as $val) @@ -597,8 +593,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // If module description translation exists return $langs->transnoentitiesnoconv("Module".$this->numero."Desc"); } - else - { + else { // If module description translation does not exist using its unique id, we can use its name to find translation if (is_array($this->langfiles)) { foreach ($this->langfiles as $val) @@ -651,13 +646,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it ) ); } - else - { + else { $content = nl2br($content); } } - else - { + else { // Mostly for internal modules if (!empty($this->descriptionlong)) { if (is_array($this->langfiles)) { @@ -746,8 +739,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; $content = dolMd2Html($content, 'parsedown', array('doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1))); } - else - { + else { $content = nl2br($content); } } @@ -859,8 +851,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // Translation not found return $langs->trans($this->export_label[$r]); } - else - { + else { // Translation found return $langs->trans($langstring); } @@ -884,8 +875,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // Translation not found return $langs->transnoentitiesnoconv($this->import_label[$r]); } - else - { + else { // Translation found return $langs->transnoentitiesnoconv($langstring); } @@ -913,8 +903,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { $err++; } - else - { + else { $obj = $this->db->fetch_object($resql); if ($obj) { return $this->db->jdate($obj->tms); @@ -946,8 +935,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it { $err++; } - else - { + else { $obj = $this->db->fetch_object($resql); $tmp = array(); if ($obj->note) { @@ -1233,16 +1221,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$err) { $this->db->commit(); } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); } } // else box already registered into database } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -1428,16 +1414,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$err) { $this->db->commit(); } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); } } // else box already registered into database } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -1629,13 +1613,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $err++; } } - else - { + else { dol_syslog(get_class($this)."::insert_const constant '".$name."' already exists", LOG_WARNING); } } - else - { + else { $err++; } } @@ -1738,16 +1720,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql .= " VALUES "; $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')"; } - else - { + else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; $sql .= " (id, entity, libelle, module, type, bydefault, perms)"; $sql .= " VALUES "; $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."')"; } } - else - { + else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def "; $sql .= " (id, entity, libelle, module, type, bydefault)"; $sql .= " VALUES "; @@ -1793,15 +1773,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($result > 0) { $tmpuser->addrights($r_id, '', '', 0, 1); } - else - { + else { dol_syslog(get_class($this)."::insert_permissions Failed to add the permission to user because fetch return an error", LOG_ERR); } $i++; } } - else - { + else { dol_print_error($this->db); } } @@ -1816,8 +1794,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } $this->db->free($resql); } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -1885,8 +1862,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$this->menu[$key]['fk_menu']) { $menu->fk_menu = 0; } - else - { + else { $foundparent = 0; $fk_parent = $this->menu[$key]['fk_menu']; if (preg_match('/^r=/', $fk_parent)) // old deprecated method @@ -1934,8 +1910,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($result > 0) { $this->menu[$key]['rowid'] = $result; } - else - { + else { $this->error = $menu->error; dol_syslog(get_class($this).'::insert_menus result='.$result." ".$this->error, LOG_ERR); $err++; @@ -1947,8 +1922,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (!$err) { $this->db->commit(); } - else - { + else { dol_syslog(get_class($this)."::insert_menus ".$this->error, LOG_ERR); $this->db->rollback(); } @@ -2081,8 +2055,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->query($sql); } } - else - { + else { $this->error = $this->db->lasterror(); $err++; } @@ -2153,7 +2126,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (isset($value['entity'])) { $entity = $value['entity']; } } - else // when hook is declared with syntax 'hook'=>array('hookcontext1','hookcontext2',...) + else // when hook is declared with syntax 'hook'=>array('hookcontext1','hookcontext2',...) { $newvalue = json_encode($value); } @@ -2184,8 +2157,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $error++; $this->error = $this->db->lasterror(); } - else - { + else { dol_syslog(get_class($this)."::insert_module_parts for ".$this->const_name."_".strtoupper($key)." Record already exists.", LOG_WARNING); } } @@ -2291,8 +2263,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (preg_match('/^\//i', $this->picto)) print img_picto($alttext, $this->picto, 'class="inline-block valignmiddle"', 1); else print img_object($alttext, $this->picto, 'class="inline-block valignmiddle"'); } - else - { + else { print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } diff --git a/htdocs/core/modules/action/modules_action.php b/htdocs/core/modules/action/modules_action.php index bf957175f84..ea3b961b63f 100644 --- a/htdocs/core/modules/action/modules_action.php +++ b/htdocs/core/modules/action/modules_action.php @@ -86,8 +86,7 @@ function action_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $h { $modele = $conf->global->ACTION_EVENT_ADDON_PDF; } - else - { + else { $modele = 'soleil'; } } @@ -142,15 +141,13 @@ function action_create($db, $object, $modele, $outputlangs, $hidedetails = 0, $h return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "action_pdf_create Error: ".$obj->error); return 0; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; } diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b978bed1eab..0b489e7202c 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -295,8 +295,7 @@ class CommActionRapport if ($obj->dp2) { if (dol_print_date($this->db->jdate($obj->dp), "day") != dol_print_date($this->db->jdate($obj->dp2), "day")) $textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "day")." - ".dol_print_date($this->db->jdate($obj->dp2), "hour"); - else - $textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "hour"); + else $textdate .= " -> ".dol_print_date($this->db->jdate($obj->dp2), "hour"); } $textdate = $outputlangs->trans("ID").' '.$obj->id.' - '.$textdate; $pdf->MultiCell(45 - $this->marge_gauche, $height, $textdate, 0, 'L', 0); diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 1bf2b836269..dc19b2c0907 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -119,8 +119,7 @@ class pdf_ban extends ModeleBankAccountDoc $dir = $conf->bank->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->bank->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -204,8 +203,7 @@ class pdf_ban extends ModeleBankAccountDoc $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -224,8 +222,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -263,8 +260,7 @@ class pdf_ban extends ModeleBankAccountDoc return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } @@ -332,8 +328,7 @@ class pdf_ban extends ModeleBankAccountDoc $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 23868eef643..8bcb06b72da 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -124,8 +124,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc else $dir = $conf->bank->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); if (!empty($moreparams['force_dir_output'])) $dir = $moreparams['force_dir_output']; else $dir = $conf->bank->dir_output."/".$objectref; @@ -210,8 +209,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -368,8 +366,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -416,8 +413,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } @@ -567,8 +563,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 5b561f90c1c..b01df64c088 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -209,8 +209,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { $result = -2; } - else - { + else { if ($this->verif_syntax($code, $type) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $product); @@ -218,19 +217,16 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { $result = -3; } - else - { + else { $result = 0; } } - else - { + else { if (dol_strlen($code) == 0) { $result = -2; } - else - { + else { $result = -1; } } @@ -264,13 +260,11 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 9755369793e..4260cd4d8c4 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -130,8 +130,7 @@ class doc_generic_bom_odt extends ModelePDFBom unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -268,8 +267,7 @@ class doc_generic_bom_odt extends ModelePDFBom if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -302,8 +300,7 @@ class doc_generic_bom_odt extends ModelePDFBom $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -386,7 +383,7 @@ class doc_generic_bom_odt extends ModelePDFBom if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -397,8 +394,7 @@ class doc_generic_bom_odt extends ModelePDFBom } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -422,8 +418,7 @@ class doc_generic_bom_odt extends ModelePDFBom $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -497,8 +492,7 @@ class doc_generic_bom_odt extends ModelePDFBom return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index 08acd30451c..2246412997b 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -130,8 +130,7 @@ class mod_bom_standard extends ModeleNumRefboms if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_bom_standard::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index daa2e04366d..ea431b5a2ce 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -127,8 +127,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(__METHOD__, LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 7cc72a865d8..bbe9bc119a4 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -179,8 +179,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) { $modele = $conf->global->CHEQUERECEIPT_ADDON_PDF; } - else - { + else { //print $langs->trans("Error")." ".$langs->trans("Error_FACTURE_ADDON_PDF_NotDefined"); //return 0; $modele = 'blochet'; @@ -204,15 +203,13 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) $outputlangs->charset_output = $sav_charset_output; return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "chequereceipt_pdf_create Error: ".$obj->error); return -1; } } - else - { + else { dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $dir.$file)); return -1; } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 75c5103c4ab..f992996403a 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -137,8 +137,7 @@ class doc_generic_order_odt extends ModelePDFCommandes unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -280,8 +279,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -314,8 +312,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -402,7 +399,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -413,8 +410,7 @@ class doc_generic_order_odt extends ModelePDFCommandes } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -438,8 +434,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -513,8 +508,7 @@ class doc_generic_order_odt extends ModelePDFCommandes return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3838b9146e6..f5568452221 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -173,8 +173,7 @@ class pdf_einstein extends ModelePDFCommandes $this->posxqty = 135; $this->posxunit = 151; } - else - { + else { $this->posxtva = 110; $this->posxup = 126; $this->posxqty = 145; @@ -240,8 +239,7 @@ class pdf_einstein extends ModelePDFCommandes $dir = $conf->commande->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->commande->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -441,17 +439,15 @@ class pdf_einstein extends ModelePDFCommandes $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -567,8 +563,7 @@ class pdf_einstein extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -583,8 +578,7 @@ class pdf_einstein extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -599,8 +593,7 @@ class pdf_einstein extends ModelePDFCommandes // Show square if ($pagenb == 1) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos @@ -643,14 +636,12 @@ class pdf_einstein extends ModelePDFCommandes return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "COMMANDE_OUTPUTDIR"); return 0; } @@ -915,8 +906,7 @@ class pdf_einstein extends ModelePDFCommandes { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1282,16 +1272,14 @@ class pdf_einstein extends ModelePDFCommandes $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1910dd0c048..dc13ad237b7 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -233,8 +233,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -254,13 +253,11 @@ class pdf_eratosthene extends ModelePDFCommandes { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -289,8 +286,7 @@ class pdf_eratosthene extends ModelePDFCommandes $dir = $conf->commande->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->commande->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -532,8 +528,7 @@ class pdf_eratosthene extends ModelePDFCommandes $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -583,8 +578,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -622,17 +616,15 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -785,8 +777,7 @@ class pdf_eratosthene extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -801,8 +792,7 @@ class pdf_eratosthene extends ModelePDFCommandes { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -817,8 +807,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Show square if ($pagenb == $pageposbeforeprintlines) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos @@ -861,14 +850,12 @@ class pdf_eratosthene extends ModelePDFCommandes return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "COMMANDE_OUTPUTDIR"); return 0; } @@ -1130,8 +1117,7 @@ class pdf_eratosthene extends ModelePDFCommandes { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1450,16 +1436,14 @@ class pdf_eratosthene extends ModelePDFCommandes $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1853,8 +1837,7 @@ class pdf_eratosthene extends ModelePDFCommandes { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 87e5666be4b..a5558f2d0b2 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -130,8 +130,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_commande_marbre::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index c938f40cfb2..b5bc55633ee 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -136,8 +136,7 @@ class doc_generic_contract_odt extends ModelePDFContract unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -267,8 +266,7 @@ class doc_generic_contract_odt extends ModelePDFContract if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -301,8 +299,7 @@ class doc_generic_contract_odt extends ModelePDFContract $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -382,7 +379,7 @@ class doc_generic_contract_odt extends ModelePDFContract if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -394,8 +391,7 @@ class doc_generic_contract_odt extends ModelePDFContract } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -419,8 +415,7 @@ class doc_generic_contract_odt extends ModelePDFContract $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -490,8 +485,7 @@ class doc_generic_contract_odt extends ModelePDFContract return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f8b7908654b..68c8cd1b96c 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -194,8 +194,7 @@ class pdf_strato extends ModelePDFContract $dir = $conf->contrat->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->contrat->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -388,18 +387,16 @@ class pdf_strato extends ModelePDFContract $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -426,8 +423,7 @@ class pdf_strato extends ModelePDFContract { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -442,8 +438,7 @@ class pdf_strato extends ModelePDFContract { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -462,8 +457,7 @@ class pdf_strato extends ModelePDFContract $this->tabSignature($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $this->tabSignature($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, $outputlangs); $bottomlasttab = $this->page_hauteur - $heightforfooter - $heightforfooter + 1; @@ -499,14 +493,12 @@ class pdf_strato extends ModelePDFContract return 1; } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "CONTRACT_OUTPUTDIR"); return 0; } @@ -636,16 +628,14 @@ class pdf_strato extends ModelePDFContract $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index 52950778738..2becdf52219 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -139,8 +139,7 @@ class mod_contract_serpis extends ModelNumRefContracts if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_contract_serpis::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 4c025750f04..d3ee39e8a5f 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -104,8 +104,7 @@ class html_cerfafr extends ModeleDon $dir = $conf->don->dir_output; $file = $dir."/SPECIMEN.html"; } - else - { + else { $donref = dol_sanitizeFileName($don->ref); $dir = $conf->don->dir_output."/".$donref; $file = $dir."/".$donref.".html"; @@ -142,8 +141,7 @@ class html_cerfafr extends ModeleDon elseif ($don->modepaymentcode == 'VIR' || $don->modepaymentcode == 'PRE' || $don->modepaymentcode == 'CB') { $ModePaiement = ' Remise d\'espèces Chèque Virement, prélèvement, carte bancaire'; } - else - { + else { $ModePaiement = ' Remise d\'espèces Chèque Virement, prélèvement, carte bancaire'; } @@ -217,8 +215,7 @@ class html_cerfafr extends ModeleDon { $art200 = '200 du CGI'; } - else - { + else { $art200 = '200 du CGI'; } } @@ -230,8 +227,7 @@ class html_cerfafr extends ModeleDon { $art238 = '238 bis du CGI'; } - else - { + else { $art238 = '238 bis du CGI'; } } @@ -243,8 +239,7 @@ class html_cerfafr extends ModeleDon { $art978 = '978 du CGI'; } - else - { + else { $art978 = '978 du CGI'; } } @@ -262,14 +257,12 @@ class html_cerfafr extends ModeleDon return 1; } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "DON_OUTPUTDIR"); return 0; } @@ -412,15 +405,13 @@ class html_cerfafr extends ModeleDon $somme = $trio[3].' '.$secon[3].' '.$prim[3].' million '; elseif (($cent[3] != 0 && $cent[3] != '') || ($dix[3] != 0 && $dix[3] != '') || ($unite[3] != 0 && $unite[3] != '')) $somme = $trio[3].' '.$secon[3].' '.$prim[3].' millions '; - else - $somme = $trio[3].' '.$secon[3].' '.$prim[3]; + else $somme = $trio[3].' '.$secon[3].' '.$prim[3]; if (($cent[2] == 0 || $cent[2] == '') && ($dix[2] == 0 || $dix[2] == '') && ($unite[2] == 1)) $somme = $somme.' mille '; elseif (($cent[2] != 0 && $cent[2] != '') || ($dix[2] != 0 && $dix[2] != '') || ($unite[2] != 0 && $unite[2] != '')) $somme = $somme.$trio[2].' '.$secon[2].' '.$prim[2].' milles '; - else - $somme = $somme.$trio[2].' '.$secon[2].' '.$prim[2]; + else $somme = $somme.$trio[2].' '.$secon[2].' '.$prim[2]; $somme = $somme.$trio[1].' '.$secon[1].' '.$prim[1]; @@ -428,7 +419,6 @@ class html_cerfafr extends ModeleDon if (($cent_c == '0' || $cent_c == '') && ($dix_c == '0' || $dix_c == '')) return $somme.' et zéro '.$dev2; - else - return $somme.$trio_c.' '.$secon_c.' '.$dev2; + else return $somme.$trio_c.' '.$secon_c.' '.$dev2; } } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 1ea817709e1..a9be573f80d 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -138,8 +138,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -280,8 +279,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -385,7 +383,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -407,7 +405,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -431,7 +429,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -452,7 +450,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -478,7 +476,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -489,8 +487,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -512,8 +509,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -585,8 +581,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index c232edbe81c..2aa28f3b7db 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -196,8 +196,7 @@ class pdf_espadon extends ModelePdfExpedition $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product') . $object->lines[$i]->fk_product ."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -212,13 +211,11 @@ class pdf_espadon extends ModelePdfExpedition { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -241,8 +238,7 @@ class pdf_espadon extends ModelePdfExpedition $dir = $conf->expedition->dir_output."/sending"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $expref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/sending/".$expref; $file = $dir."/".$expref.".pdf"; @@ -413,8 +409,7 @@ class pdf_espadon extends ModelePdfExpedition $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -464,8 +459,7 @@ class pdf_espadon extends ModelePdfExpedition // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } @@ -504,17 +498,15 @@ class pdf_espadon extends ModelePdfExpedition $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -608,8 +600,7 @@ class pdf_espadon extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -624,8 +615,7 @@ class pdf_espadon extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -643,8 +633,7 @@ class pdf_espadon extends ModelePdfExpedition $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -678,14 +667,12 @@ class pdf_espadon extends ModelePdfExpedition return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -889,16 +876,14 @@ class pdf_espadon extends ModelePdfExpedition $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -908,8 +893,7 @@ class pdf_espadon extends ModelePdfExpedition { $posx = 105; } - else - { + else { $posx = $this->marge_gauche + 3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); @@ -1275,8 +1259,7 @@ class pdf_espadon extends ModelePdfExpedition { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 7899df494fc..bd698d72519 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -193,8 +193,7 @@ class pdf_merou extends ModelePdfExpedition $dir = $conf->expedition->dir_output."/sending"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $expref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/sending/".$expref; $file = $dir."/".$expref.".pdf"; @@ -288,8 +287,7 @@ class pdf_merou extends ModelePdfExpedition $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -366,8 +364,7 @@ class pdf_merou extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -381,8 +378,7 @@ class pdf_merou extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -398,8 +394,7 @@ class pdf_merou extends ModelePdfExpedition $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -435,14 +430,12 @@ class pdf_merou extends ModelePdfExpedition return 1; } - else - { + else { $this->error = $outputlangs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $outputlangs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -564,16 +557,14 @@ class pdf_merou extends ModelePdfExpedition $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, 10, 5, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(70, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -673,8 +664,7 @@ class pdf_merou extends ModelePdfExpedition } } } - else - { + else { $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Deliverer")." ".$outputlangs->convToOutputCharset($this->livreur->getFullName($outputlangs)), '', 'L'); } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 2e0733f1ba2..99dfd20301f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -219,8 +219,7 @@ class pdf_rouget extends ModelePdfExpedition $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -234,13 +233,11 @@ class pdf_rouget extends ModelePdfExpedition { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -262,8 +259,7 @@ class pdf_rouget extends ModelePdfExpedition $dir = $conf->expedition->dir_output."/sending"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $expref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/sending/".$expref; $file = $dir."/".$expref.".pdf"; @@ -422,8 +418,7 @@ class pdf_rouget extends ModelePdfExpedition $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -463,8 +458,7 @@ class pdf_rouget extends ModelePdfExpedition // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -503,18 +497,16 @@ class pdf_rouget extends ModelePdfExpedition $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -599,8 +591,7 @@ class pdf_rouget extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -615,8 +606,7 @@ class pdf_rouget extends ModelePdfExpedition { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -634,8 +624,7 @@ class pdf_rouget extends ModelePdfExpedition $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -669,14 +658,12 @@ class pdf_rouget extends ModelePdfExpedition return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -924,16 +911,14 @@ class pdf_rouget extends ModelePdfExpedition $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -943,8 +928,7 @@ class pdf_rouget extends ModelePdfExpedition { $posx = 105; } - else - { + else { $posx = $this->marge_gauche + 3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index afbeec748ea..f2d49ba6409 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -134,8 +134,7 @@ class mod_expedition_safor extends ModelNumRefExpedition if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_expedition_safor::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 3a66a8ae961..91539b979c2 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -227,8 +227,7 @@ class pdf_standard extends ModeleExpenseReport $dir = $conf->expensereport->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->expensereport->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -340,8 +339,7 @@ class pdf_standard extends ModeleExpenseReport $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -410,17 +408,15 @@ class pdf_standard extends ModeleExpenseReport $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -459,8 +455,7 @@ class pdf_standard extends ModeleExpenseReport { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -475,8 +470,7 @@ class pdf_standard extends ModeleExpenseReport { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -493,8 +487,7 @@ class pdf_standard extends ModeleExpenseReport $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -561,14 +554,12 @@ class pdf_standard extends ModeleExpenseReport return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "EXPENSEREPORT_OUTPUTDIR"); return 0; } @@ -710,8 +701,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -858,8 +848,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(96, 4, $outputlangs->transnoentities("DATE_CANCEL")." : ".dol_print_date($object->date_cancel, "day", false, $outputlangs), 0, 'L'); } } - else - { + else { if ($object->fk_user_approve > 0) { $userfee = new User($this->db); $userfee->fetch($object->fk_user_approve); $posy += 6; @@ -1106,8 +1095,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("RemainderToPay"), 0, 'L', 0); } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index 9093e55f78f..bae163227e4 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -187,8 +187,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_expensereport_jade::getNextValue", LOG_DEBUG); return 0; } diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 5124cb3f160..0e57634f488 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -218,8 +218,7 @@ class ExportCsv extends ModeleExports { $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; } - else - { + else { $outputlangs->charset_output = 'ISO-8859-1'; } @@ -254,8 +253,7 @@ class ExportCsv extends ModeleExports { $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; } - else - { + else { $outputlangs->charset_output = 'ISO-8859-1'; } diff --git a/htdocs/core/modules/export/export_excel2007new.modules.php b/htdocs/core/modules/export/export_excel2007new.modules.php index 779f2240155..a96d51634b0 100644 --- a/htdocs/core/modules/export/export_excel2007new.modules.php +++ b/htdocs/core/modules/export/export_excel2007new.modules.php @@ -274,8 +274,7 @@ class ExportExcel2007new extends ModeleExports { $this->worksheet->write($this->row, $this->col, $outputlangs->transnoentities($alias), $formatheader); } - else - { + 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 { @@ -333,8 +332,7 @@ class ExportExcel2007new extends ModeleExports { $newvalue = $outputlangs->transnoentities($reg[1]); } - else - { + else { $newvalue = $outputlangs->convToOutputCharset($newvalue); } @@ -352,8 +350,7 @@ class ExportExcel2007new extends ModeleExports $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate(); $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd h:mm:ss'); } - else - { + else { if ($typefield == 'Text' || $typefield == 'TextAuto') { //$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING); @@ -362,8 +359,7 @@ class ExportExcel2007new extends ModeleExports $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@'); $this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); } - else - { + else { $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $newvalue); } } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index acbebd54da8..a25f07384a3 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -137,8 +137,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -280,8 +279,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -410,7 +408,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -421,8 +419,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -446,8 +443,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -519,8 +515,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index cf91ec4806c..ea5376981a4 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -184,8 +184,7 @@ class pdf_crabe extends ModelePDFFactures $this->posxqty = 135; $this->posxunit = 151; } - else - { + else { $this->posxtva = 110; $this->posxup = 126; $this->posxqty = 145; @@ -288,8 +287,7 @@ class pdf_crabe extends ModelePDFFactures $dir = $conf->facture->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->facture->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -518,8 +516,7 @@ class pdf_crabe extends ModelePDFFactures // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -556,18 +553,16 @@ class pdf_crabe extends ModelePDFFactures $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -701,8 +696,7 @@ class pdf_crabe extends ModelePDFFactures { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -717,8 +711,7 @@ class pdf_crabe extends ModelePDFFactures { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -736,8 +729,7 @@ class pdf_crabe extends ModelePDFFactures $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -780,14 +772,12 @@ class pdf_crabe extends ModelePDFFactures return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "FAC_OUTPUTDIR"); return 0; } @@ -882,8 +872,7 @@ class pdf_crabe extends ModelePDFFactures $i++; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -936,8 +925,7 @@ class pdf_crabe extends ModelePDFFactures return $tab3_top + $y + 3; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1216,8 +1204,7 @@ class pdf_crabe extends ModelePDFFactures { // Nothing to do } - else - { + else { // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT @@ -1663,16 +1650,14 @@ class pdf_crabe extends ModelePDFFactures $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 8f48f31fddb..acdb6063d5f 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -251,8 +251,7 @@ class pdf_sponge extends ModelePDFFactures $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -272,13 +271,11 @@ class pdf_sponge extends ModelePDFFactures { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -309,8 +306,7 @@ class pdf_sponge extends ModelePDFFactures $dir = $conf->facture->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->facture->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -586,8 +582,7 @@ class pdf_sponge extends ModelePDFFactures $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -635,8 +630,7 @@ class pdf_sponge extends ModelePDFFactures // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -674,17 +668,15 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -849,8 +841,7 @@ class pdf_sponge extends ModelePDFFactures if ($pagenb == $pageposbeforeprintlines) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -864,8 +855,7 @@ class pdf_sponge extends ModelePDFFactures if ($pagenb == $pageposafter) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -883,8 +873,7 @@ class pdf_sponge extends ModelePDFFactures $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -927,14 +916,12 @@ class pdf_sponge extends ModelePDFFactures return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "FAC_OUTPUTDIR"); return 0; } @@ -1032,8 +1019,7 @@ class pdf_sponge extends ModelePDFFactures $i++; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1075,8 +1061,7 @@ class pdf_sponge extends ModelePDFFactures return $tab3_top + $y + 3; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1474,8 +1459,7 @@ class pdf_sponge extends ModelePDFFactures { // Nothing to do } - else - { + else { // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT @@ -1909,16 +1893,14 @@ class pdf_sponge extends ModelePDFFactures $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -2396,8 +2378,7 @@ class pdf_sponge extends ModelePDFFactures { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 6b4b5f0451d..ae349f6f5cb 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -174,8 +174,7 @@ class mod_facture_mars extends ModeleNumRefFactures if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index caa47db3529..c16e751d7db 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -203,8 +203,7 @@ class mod_facture_terre extends ModeleNumRefFactures if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index d7509feff7c..a88e3c32bf3 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -186,8 +186,7 @@ class pdf_soleil extends ModelePDFFicheinter $dir = $conf->ficheinter->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->ficheinter->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -289,8 +288,7 @@ class pdf_soleil extends ModelePDFFicheinter $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -378,7 +376,7 @@ class pdf_soleil extends ModelePDFFicheinter } } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -404,8 +402,7 @@ class pdf_soleil extends ModelePDFFicheinter { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -420,8 +417,7 @@ class pdf_soleil extends ModelePDFFicheinter { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -440,8 +436,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -470,14 +465,12 @@ class pdf_soleil extends ModelePDFFicheinter return 1; } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "FICHEINTER_OUTPUTDIR"); return 0; } @@ -591,16 +584,14 @@ class pdf_soleil extends ModelePDFFicheinter $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index b592e65b0d3..5a56b849e5f 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -107,8 +107,7 @@ class mod_pacific extends ModeleNumRefFicheinter { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index 140ce27cf03..b3b5906f683 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -179,8 +179,7 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, { $modele = $conf->global->FICHEINTER_ADDON_PDF; } - else - { + else { $modele = 'soleil'; } } @@ -235,15 +234,13 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "fichinter_pdf_create Error: ".$obj->error); return 0; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; } diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index 3de92c4a05e..90c419bd260 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -140,8 +140,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_holiday_madonna::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index de32e84d43a..2e8d1d80097 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -199,8 +199,7 @@ class ImportCsv extends ModeleImports $this->error = $langs->trans("ErrorFailToOpenFile", $file); $ret = -1; } - else - { + else { $this->file = $file; } @@ -265,21 +264,19 @@ class ImportCsv extends ModeleImports $newarrayres[$key]['val'] = $val; $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } - else - { + else { $newarrayres[$key]['val'] = utf8_encode($val); $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } } - else // Autodetect format (UTF8 or ISO) + else // Autodetect format (UTF8 or ISO) { if (utf8_check($val)) { $newarrayres[$key]['val'] = $val; $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } - else - { + else { $newarrayres[$key]['val'] = utf8_encode($val); $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null } @@ -347,8 +344,7 @@ class ImportCsv extends ModeleImports $this->warnings[$warning]['type'] = 'EMPTY'; $warning++; } - else - { + else { $last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id) $updatedone = false; $insertdone = false; @@ -375,8 +371,7 @@ class ImportCsv extends ModeleImports } else dol_print_error($this->db); } - else - { + else { //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); } @@ -411,8 +406,7 @@ class ImportCsv extends ModeleImports $error++; } // Test format only if field is not a missing mandatory field (field may be a value or empty but not mandatory) - else - { + else { // We convert field if required if (!empty($objimport->array_import_convertvalue[0][$val])) { @@ -438,8 +432,7 @@ class ImportCsv extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -478,8 +471,7 @@ class ImportCsv extends ModeleImports { $newval = $classinstance->id; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); else $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; @@ -542,8 +534,7 @@ class ImportCsv extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -560,8 +551,7 @@ class ImportCsv extends ModeleImports { $newval = $scaleorid ? $scaleorid : 0; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; $this->errors[$error]['type'] = 'FOREIGNKEY'; @@ -688,8 +678,7 @@ class ImportCsv extends ModeleImports $i++; } } - else - { + else { dol_print_error($this->db); } } @@ -761,8 +750,7 @@ class ImportCsv extends ModeleImports $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); $listvalues[] = "'".$tmp[1]."'"; } - else - { + else { $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; $error++; @@ -812,8 +800,7 @@ class ImportCsv extends ModeleImports // No record found with filters, insert will be tried below } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -841,8 +828,7 @@ class ImportCsv extends ModeleImports $lastinsertid = 0; } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -872,8 +858,7 @@ class ImportCsv extends ModeleImports // No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed $updatedone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -907,8 +892,7 @@ class ImportCsv extends ModeleImports $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). $insertdone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 35aee35869e..dc5bac9568c 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -375,8 +375,7 @@ class ImportXlsx extends ModeleImports $this->warnings[$warning]['type'] = 'EMPTY'; $warning++; } - else - { + else { $last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id) $updatedone = false; $insertdone = false; @@ -403,8 +402,7 @@ class ImportXlsx extends ModeleImports } else dol_print_error($this->db); } - else - { + else { //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); } @@ -439,8 +437,7 @@ class ImportXlsx extends ModeleImports $error++; } // Test format only if field is not a missing mandatory field (field may be a value or empty but not mandatory) - else - { + else { // We convert field if required if (!empty($objimport->array_import_convertvalue[0][$val])) { @@ -465,8 +462,7 @@ class ImportXlsx extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -505,8 +501,7 @@ class ImportXlsx extends ModeleImports { $newval = $classinstance->id; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element'])); else $this->errors[$error]['lib'] = 'ErrorBadDefinitionOfImportProfile'; @@ -569,8 +564,7 @@ class ImportXlsx extends ModeleImports { $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval]; } - else - { + else { $resultload = dol_include_once($file); if (empty($resultload)) { @@ -587,8 +581,7 @@ class ImportXlsx extends ModeleImports { $newval = $scaleorid ? $scaleorid : 0; } - else - { + else { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); else $this->errors[$error]['lib'] = 'ErrorFieldValueNotIn'; $this->errors[$error]['type'] = 'FOREIGNKEY'; @@ -715,8 +708,7 @@ class ImportXlsx extends ModeleImports $i++; } } - else - { + else { dol_print_error($this->db); } } @@ -752,7 +744,7 @@ class ImportXlsx extends ModeleImports // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert if (empty($newval) && $arrayrecord[($key - 1)]['type'] < 0) $listvalues[] = ($newval == '0' ? $newval : "null"); elseif (empty($newval) && $arrayrecord[($key - 1)]['type'] == 0) $listvalues[] = "''"; - else $listvalues[] = "'".$this->db->escape($newval)."'"; + else $listvalues[] = "'".$this->db->escape($newval)."'"; } $i++; } @@ -784,8 +776,7 @@ class ImportXlsx extends ModeleImports $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); $listvalues[] = "'".$tmp[1]."'"; } - else - { + else { $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; $this->errors[$error]['type'] = 'Import profile setup'; $error++; @@ -834,8 +825,7 @@ class ImportXlsx extends ModeleImports // No record found with filters, insert will be tried below } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -863,8 +853,7 @@ class ImportXlsx extends ModeleImports $lastinsertid = 0; } } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -894,8 +883,7 @@ class ImportXlsx extends ModeleImports // No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed $updatedone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; @@ -929,8 +917,7 @@ class ImportXlsx extends ModeleImports $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). $insertdone = true; } - else - { + else { //print 'E'; $this->errors[$error]['lib'] = $this->db->lasterror(); $this->errors[$error]['type'] = 'SQL'; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index cda16561f8d..2a1b79bf4f3 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -205,8 +205,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $dir = $conf->expedition->dir_output."/receipt"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/receipt/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -358,8 +357,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -404,17 +402,15 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -490,8 +486,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -506,8 +501,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -525,8 +519,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -627,8 +620,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } @@ -775,8 +767,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); @@ -799,8 +790,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_delivery, "%d %b %Y", false, $outputlangs, true), '', 'R'); } - else - { + else { $pdf->SetTextColor(255, 0, 0); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryNotValidated"), '', 'R'); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 840b6a6f0a6..599a33578f5 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -143,8 +143,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 464c657fa7b..858e44693b4 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -114,8 +114,7 @@ class mailing_advthirdparties extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; @@ -169,8 +168,7 @@ class mailing_advthirdparties extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; @@ -273,8 +271,7 @@ class mailing_advthirdparties extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 9d7a23ce9fd..1a4570df63f 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -191,8 +191,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { $s .= ''; } } @@ -266,8 +265,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { $s .= ''; } } @@ -308,8 +306,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { $s .= ''; } } @@ -448,8 +445,7 @@ class mailing_contacts1 extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 8a504ff28b5..e94fe57aa3b 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -155,8 +155,7 @@ class mailing_fraise extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } @@ -194,8 +193,7 @@ class mailing_fraise extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } @@ -314,8 +312,7 @@ class mailing_fraise extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index ffba2571d23..9c042de1112 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -99,8 +99,7 @@ class MailingTargets // This can't be abstract as it is used for some method $obj = $this->db->fetch_object($result); return $obj->nb; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -193,8 +192,7 @@ class MailingTargets // This can't be abstract as it is used for some method { $j++; } - else - { + else { if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { // Si erreur autre que doublon diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index aa3e9bbc703..1f80623bece 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -214,8 +214,7 @@ class mailing_pomme extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 05e9f4f12c4..4773203e5ad 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -80,8 +80,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " AND s.entity IN (".getEntity('societe').")"; $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; } - else - { + else { $addFilter = ""; if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') { @@ -103,8 +102,7 @@ class mailing_thirdparties extends MailingTargets { $addDescription .= $langs->trans('ProspectCustomer'); } - else - { + else { $addDescription .= "Unknown status ".$_POST["filter_client"]; } } @@ -120,8 +118,7 @@ class mailing_thirdparties extends MailingTargets $addFilter .= " AND s.status=1"; $addDescription .= $langs->trans("Enabled"); } - else - { + else { $addFilter .= " AND s.status=0"; $addDescription .= $langs->trans("Disabled"); } @@ -187,8 +184,7 @@ class mailing_thirdparties extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->error()); $this->error = $this->db->error(); return -1; @@ -286,8 +282,7 @@ class mailing_thirdparties extends MailingTargets $i++; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 866712d4bb0..1c76a924883 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -74,8 +74,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $this->arrayofproducts[$i] = $obj->ref; } } - else - { + else { dol_print_error($this->db); } } @@ -154,8 +153,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $i++; } } - else - { + else { dol_syslog($this->db->lasterror()); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 9d08cb3565d..040baddd7c2 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -180,8 +180,7 @@ class mailing_xinputfile extends MailingTargets $j++; } } - else - { + else { $i++; $langs->load("errors"); $msg = $langs->trans("ErrorFoundBadEmailInFile", $i, $cpt, $email); @@ -197,16 +196,14 @@ class mailing_xinputfile extends MailingTargets return -$i; } } - else - { + else { $this->error = $langs->trans("ErrorFaildToOpenFile"); return -1; } dol_syslog(get_class($this)."::add_to_target mailing ".$cpt." targets found"); } - else - { + else { $langs->load("errors"); if ($resupload < 0) // Unknown error { @@ -216,7 +213,7 @@ class mailing_xinputfile extends MailingTargets { $this->error = '
'.$langs->trans("ErrorFileIsInfectedWithAVirus").'
'; } - else // Known error + else // Known error { $this->error = '
'.$langs->trans($resupload).'
'; } diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 0875b02ed56..56bbaa58137 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -149,15 +149,13 @@ class mailing_xinputuser extends MailingTargets return parent::addTargetsToDatabase($mailing_id, $cibles); } - else - { + else { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $email); return -1; } } - else - { + else { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEmail", $email); return -1; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 1582b1c1c34..e586de52b38 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -166,8 +166,7 @@ class pdf_standard extends CommonStickerGenerator // Output left area if ($textleft == '__LOGO__' && $logo) $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -188,7 +187,7 @@ class pdf_standard extends CommonStickerGenerator $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $widthtouse - $xleft - $xleft - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } - else // text on halft left and text on half right + else // text on halft left and text on half right { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); @@ -196,13 +195,12 @@ class pdf_standard extends CommonStickerGenerator $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } } - else // Only a right part + else // Only a right part { // Output right area if ($textright == '__LOGO__' && $logo) $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textright == '__PHOTO__' && $photo) $pdf->Image($photo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } @@ -306,8 +304,7 @@ class pdf_standard extends CommonStickerGenerator $arrayofrecords = $arrayofmembers; } - else - { + else { $arrayofrecords = $object; } @@ -337,8 +334,7 @@ class pdf_standard extends CommonStickerGenerator $title = $outputlangs->transnoentities('MembersCards'); $keywords = $outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name); } - else - { + else { dol_print_error('', 'Bad value for $mode'); return -1; } @@ -350,8 +346,7 @@ class pdf_standard extends CommonStickerGenerator $dir = $outputdir."/".get_exdir(0, 0, 0, 0, $object, 'member'); $file = $dir.'/'.$filename; } - else - { + else { $outputdir = $conf->adherent->dir_temp; $dir = $outputdir; $file = $dir.'/'.$filename; diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index f9bdd58af24..5f2f7f8b8ae 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -100,8 +100,7 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o { $code = $conf->global->ADHERENT_CARDS_ADDON_PDF; } - else - { + else { $code = $modele; } } @@ -154,16 +153,14 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o $outputlangs->charset_output = $sav_charset_output; return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "members_card_pdf_create Error: ".$obj->error); return -1; } } - else - { + else { dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); return -1; } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 2184500db8c..04283daf8b4 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -98,8 +98,7 @@ class modAgenda extends DolibarrModules $this->const[] = array('MAIN_AGENDA_ACTIONAUTO_'.$obj->code, "chaine", "1", '', 0, 'current'); } } - else - { + else { dol_print_error($this->db->lasterror()); } diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 5b645747380..4527b620074 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -234,8 +234,7 @@ class modBlockedLog extends DolibarrModules { $res = $b->create($user, '0000000000'); // If already used for something else than SET or UNSET, we log with error } - else - { + else { $res = $b->create($user); } if ($res <= 0) { diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index e276fe1f5f7..ec0b497e7cd 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -137,8 +137,7 @@ class doc_generic_mo_odt extends ModelePDFMo unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -275,8 +274,7 @@ class doc_generic_mo_odt extends ModelePDFMo if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -309,8 +307,7 @@ class doc_generic_mo_odt extends ModelePDFMo $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -393,7 +390,7 @@ class doc_generic_mo_odt extends ModelePDFMo if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -404,8 +401,7 @@ class doc_generic_mo_odt extends ModelePDFMo } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -429,8 +425,7 @@ class doc_generic_mo_odt extends ModelePDFMo $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -504,8 +499,7 @@ class doc_generic_mo_odt extends ModelePDFMo return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/mrp/mod_mo_standard.php b/htdocs/core/modules/mrp/mod_mo_standard.php index 3fd3b1ad87e..8b0edd9c129 100644 --- a/htdocs/core/modules/mrp/mod_mo_standard.php +++ b/htdocs/core/modules/mrp/mod_mo_standard.php @@ -130,8 +130,7 @@ class mod_mo_standard extends ModeleNumRefMos if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_mo_standard::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index 4320481abb1..766d615f884 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -153,8 +153,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { $url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated } diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 68aba389f31..0af4113fb0a 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -151,8 +151,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { $url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated } diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index b2ff4165563..8be1be11cc8 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -157,8 +157,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_LIVE_ID.'&scope=read_write'; diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 925a55c7ca1..4374f65746e 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -157,8 +157,7 @@ else // If entry on page with no parameter, we arrive here { $url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state'))); } - else - { + else { //$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated //https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write $url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_TEST_ID.'&scope=read_write'; diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index 5650ad43707..b9909d64fea 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -137,8 +137,7 @@ class mod_payment_cicada extends ModeleNumRefPayments if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(__METHOD__, LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 1a225518518..90f3825d007 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -157,8 +157,7 @@ class printing_printgcp extends PrintingDriver { $expiredat = $langs->trans("Unknown"); } - else - { + else { $expiredat = dol_print_date($endoflife, "dayhour"); } @@ -220,8 +219,7 @@ class printing_printgcp extends PrintingDriver { $html .= img_picto($langs->trans("Default"), 'on'); } - else - $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; + else $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; $html .= ''; $html .= ''."\n"; } @@ -326,14 +324,12 @@ class printing_printgcp extends PrintingDriver { $printer_id = $obj->printer_id; } - else - { + else { if (!empty($conf->global->PRINTING_GCP_DEFAULT)) { $printer_id = $conf->global->PRINTING_GCP_DEFAULT; } - else - { + else { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; return $error; @@ -507,8 +503,7 @@ class printing_printgcp extends PrintingDriver $html .= ''; } } - else - { + else { $html .= ''; $html .= ''.$langs->trans("None").''; $html .= ''; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 5a3d2481c6d..a305b648cfe 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -116,15 +116,13 @@ class printing_printipp extends PrintingDriver dol_syslog("Found a default printer for user ".$user->id." = ".$obj->printer_id); $ipp->setPrinterURI($obj->printer_id); } - else - { + else { if (!empty($conf->global->PRINTIPP_URI_DEFAULT)) { dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); } - else - { + else { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; return $error; diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index f85984ab9bd..9155baa8aac 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -153,8 +153,7 @@ class pdf_standardlabel extends CommonStickerGenerator // Output left area if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -175,7 +174,7 @@ class pdf_standardlabel extends CommonStickerGenerator $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $widthtouse - $xleft - $xleft - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } - else // text on halft left and text on half right + else // text on halft left and text on half right { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); @@ -183,13 +182,12 @@ class pdf_standardlabel extends CommonStickerGenerator $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } } - else // Only a right part + else // Only a right part { // Output right area if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 568d850765f..3a877049a26 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -167,8 +167,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); } - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } @@ -219,7 +218,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->MultiCell($widthtouse - $logoWidth - 1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); } } - else // text on halft left and text on half right + else // text on halft left and text on half right { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell(round($this->_Width / 2), $this->_Line_Height, $outputlangs->convToOutputCharset($textleft), 0, 'L'); @@ -227,7 +226,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->MultiCell(round($this->_Width / 2) - 2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } } - else // Only a right part + else // Only a right part { // Output right area if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, 0, $logoHeight); @@ -235,8 +234,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX + $this->_Width - $widthtouse - $xleft, $_PosY + $ytop, $widthtouse, $heighttouse); } - else - { + else { $pdf->SetXY($_PosX + $xleft, $_PosY + $ytop); $pdf->MultiCell($this->_Width - $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R'); } diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index f99ddafc4b8..ddf6d73a2a3 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -101,8 +101,7 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp { $code = $conf->global->ADHERENT_ETIQUETTE_TYPE; } - else - { + else { $code = $modele; } } @@ -156,15 +155,13 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp $outputlangs->charset_output = $sav_charset_output; return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "doc_label_pdf_create Error: ".$obj->error); return -1; } } - else - { + else { dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); return -1; } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index c0fa4d0f6eb..3965bd1be5d 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -141,8 +141,7 @@ class doc_generic_product_odt extends ModelePDFProduct unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -294,8 +293,7 @@ class doc_generic_product_odt extends ModelePDFProduct if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -329,8 +327,7 @@ class doc_generic_product_odt extends ModelePDFProduct $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -417,7 +414,7 @@ class doc_generic_product_odt extends ModelePDFProduct if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -428,8 +425,7 @@ class doc_generic_product_odt extends ModelePDFProduct } } // Replace tags of lines - try - { + try { $listlines = $odfHandler->setSegment('supplierprices'); if (!empty($object->supplierprices)) { foreach ($object->supplierprices as $supplierprice) @@ -441,8 +437,7 @@ class doc_generic_product_odt extends ModelePDFProduct $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($array_lines as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -514,8 +509,7 @@ class doc_generic_product_odt extends ModelePDFProduct return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index cbe618b488f..20c3ba9c087 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -182,8 +182,7 @@ class pdf_standard extends ModelePDFProduct $dir = $conf->product->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->product->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -335,8 +334,7 @@ class pdf_standard extends ModelePDFProduct $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -574,14 +572,12 @@ class pdf_standard extends ModelePDFProduct return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PRODUCT_OUTPUTDIR"); return 0; } @@ -741,16 +737,14 @@ class pdf_standard extends ModelePDFProduct $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index ba6329004e3..dc6d7bfd6ef 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -280,8 +280,7 @@ class mod_codeproduct_elephant extends ModeleProductCode { $result = -2; } - else - { + else { // Get Mask value $mask = ''; if ($type == 0) $mask = empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT) ? '' : $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT; @@ -328,13 +327,11 @@ class mod_codeproduct_elephant extends ModeleProductCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 80bc9f7ce0a..1ecd734dec2 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -170,8 +170,7 @@ abstract class ModeleProductCode $i++; } } - else - { + else { return -1; } return $liste; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 542ea728f84..585edee00ee 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -408,8 +408,7 @@ class doc_generic_project_odt extends ModelePDFProjects unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -544,8 +543,7 @@ class doc_generic_project_odt extends ModelePDFProjects if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -636,7 +634,7 @@ class doc_generic_project_odt extends ModelePDFProjects if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -648,8 +646,7 @@ class doc_generic_project_odt extends ModelePDFProjects } // Replace tags of lines for tasks - try - { + try { $listlines = $odfHandler->setSegment('tasks'); $taskstatic = new Task($this->db); @@ -667,8 +664,7 @@ class doc_generic_project_odt extends ModelePDFProjects //complete_substitutions_array($tmparray, $outputlangs, $object, $task, "completesubstitutionarray_lines"); foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -718,8 +714,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlinestaskres->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -768,8 +763,7 @@ class doc_generic_project_odt extends ModelePDFProjects $tmparray = $this->get_substitutionarray_taskstime($row, $outputlangs); foreach ($tmparray as $key => $val) { - try - { + try { $listlinestasktime->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -808,8 +802,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlinestasktime->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -841,8 +834,7 @@ class doc_generic_project_odt extends ModelePDFProjects //dol_syslog(get_class($this).'::main $tmparray'.var_export($tmparray,true)); foreach ($tmparray as $key => $val) { - try - { + try { $listtasksfiles->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -873,8 +865,7 @@ class doc_generic_project_odt extends ModelePDFProjects } // Replace tags of project files - try - { + try { $listlines = $odfHandler->setSegment('projectfiles'); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); @@ -887,8 +878,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -923,8 +913,7 @@ class doc_generic_project_odt extends ModelePDFProjects } if ((is_array($contact_arrray) && count($contact_arrray) > 0)) { - try - { + try { $listlines = $odfHandler->setSegment('projectcontacts'); foreach ($contact_arrray as $contact) @@ -946,8 +935,7 @@ class doc_generic_project_odt extends ModelePDFProjects $tmparray = $this->get_substitutionarray_project_contacts($contact, $outputlangs); foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -1084,8 +1072,7 @@ class doc_generic_project_odt extends ModelePDFProjects ); //Insert reference - try - { + try { $listlines = $odfHandler->setSegment('projectrefs'); foreach ($listofreferent as $keyref => $valueref) @@ -1147,8 +1134,7 @@ class doc_generic_project_odt extends ModelePDFProjects foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -1217,8 +1203,7 @@ class doc_generic_project_odt extends ModelePDFProjects return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 59e3f855ebf..53b81ef5419 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -301,8 +301,7 @@ class pdf_baleine extends ModelePDFProjects $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -359,15 +358,13 @@ class pdf_baleine extends ModelePDFProjects $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; $forcedesconsamepage = 1; if ($forcedesconsamepage) @@ -397,7 +394,7 @@ class pdf_baleine extends ModelePDFProjects } //var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak); } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -452,8 +449,7 @@ class pdf_baleine extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -468,8 +464,7 @@ class pdf_baleine extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -484,8 +479,7 @@ class pdf_baleine extends ModelePDFProjects // Show square if ($pagenb == 1) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Footer of the page @@ -514,14 +508,12 @@ class pdf_baleine extends ModelePDFProjects return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "PROJECT_OUTPUTDIR"); return 0; } @@ -613,8 +605,7 @@ class pdf_baleine extends ModelePDFProjects $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 4044676461e..0888a029d5b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -274,8 +274,7 @@ class pdf_beluga extends ModelePDFProjects $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -509,15 +508,13 @@ class pdf_beluga extends ModelePDFProjects $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; $forcedesconsamepage = 1; if ($forcedesconsamepage) @@ -547,7 +544,7 @@ class pdf_beluga extends ModelePDFProjects } //var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak); } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -590,8 +587,7 @@ class pdf_beluga extends ModelePDFProjects $fuser->fetch($element->fk_user_author); $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L'); } - else - { + else { $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty) ? $element->thirdparty->name : ''), 1, 'L'); } @@ -608,8 +604,7 @@ class pdf_beluga extends ModelePDFProjects $textforamount = dol_trunc($element->label, 26); $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, $textforamount, 1, 'L'); } - else - { + else { $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); } } @@ -688,14 +683,12 @@ class pdf_beluga extends ModelePDFProjects return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "PROJECT_OUTPUTDIR"); return 0; } @@ -787,8 +780,7 @@ class pdf_beluga extends ModelePDFProjects $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 2a13aa8ab57..0b0190cffd2 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -232,8 +232,7 @@ class pdf_timespent extends ModelePDFProjects $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -290,15 +289,13 @@ class pdf_timespent extends ModelePDFProjects $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; $forcedesconsamepage = 1; if ($forcedesconsamepage) @@ -328,7 +325,7 @@ class pdf_timespent extends ModelePDFProjects } //var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak); } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -383,8 +380,7 @@ class pdf_timespent extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -399,8 +395,7 @@ class pdf_timespent extends ModelePDFProjects { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -415,8 +410,7 @@ class pdf_timespent extends ModelePDFProjects // Show square if ($pagenb == 1) $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - else - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + else $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Pied de page @@ -445,14 +439,12 @@ class pdf_timespent extends ModelePDFProjects return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "PROJECT_OUTPUTDIR"); return 0; } @@ -544,8 +536,7 @@ class pdf_timespent extends ModelePDFProjects $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index 301e226020c..9929dd357cb 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -107,8 +107,7 @@ class mod_project_simple extends ModeleNumRefProjects { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -141,8 +140,7 @@ class mod_project_simple extends ModeleNumRefProjects if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_project_simple::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 9b7b15a884d..eee9945bb8a 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -377,8 +377,7 @@ class doc_generic_task_odt extends ModelePDFTask unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -565,7 +564,7 @@ class doc_generic_task_odt extends ModelePDFTask if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -575,8 +574,7 @@ class doc_generic_task_odt extends ModelePDFTask } // Replace tags of lines for tasks - try - { + try { // Security check $socid = 0; if (!empty($project->fk_soc)) $socid = $project->fk_soc; @@ -674,8 +672,7 @@ class doc_generic_task_odt extends ModelePDFTask foreach ($tmparray as $key => $val) { - try - { + try { $listlinestasktime->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -709,8 +706,7 @@ class doc_generic_task_odt extends ModelePDFTask //dol_syslog(get_class($this).'::main $tmparray'.var_export($tmparray,true)); foreach ($tmparray as $key => $val) { - try - { + try { $listtasksfiles->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -738,8 +734,7 @@ class doc_generic_task_odt extends ModelePDFTask // Replace tags of project files - try - { + try { $listlines = $odfHandler->setSegment('projectfiles'); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); @@ -753,8 +748,7 @@ class doc_generic_task_odt extends ModelePDFTask foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -789,8 +783,7 @@ class doc_generic_task_odt extends ModelePDFTask } if ((is_array($contact_arrray) && count($contact_arrray) > 0)) { - try - { + try { $listlines = $odfHandler->setSegment('projectcontacts'); foreach ($contact_arrray as $contact) @@ -813,8 +806,7 @@ class doc_generic_task_odt extends ModelePDFTask foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -875,8 +867,7 @@ class doc_generic_task_odt extends ModelePDFTask return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index cb186594b84..8a409765526 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -108,8 +108,7 @@ class mod_task_simple extends ModeleNumRefTask { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -141,8 +140,7 @@ class mod_task_simple extends ModeleNumRefTask if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_task_simple::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 33850c5d882..e0bcefbd880 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -140,8 +140,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -309,8 +308,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -343,8 +341,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -431,7 +428,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -442,8 +439,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -467,8 +463,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -540,8 +535,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c285f560678..409df828876 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -173,8 +173,7 @@ class pdf_azur extends ModelePDFPropales $this->posxqty = 135; $this->posxunit = 151; } - else - { + else { $this->posxtva = 110; $this->posxup = 126; $this->posxqty = 145; @@ -245,8 +244,7 @@ class pdf_azur extends ModelePDFPropales $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -270,13 +268,11 @@ class pdf_azur extends ModelePDFPropales { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -304,8 +300,7 @@ class pdf_azur extends ModelePDFPropales $dir = $conf->propal->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->propal->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -509,8 +504,7 @@ class pdf_azur extends ModelePDFPropales // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -548,18 +542,16 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -677,8 +669,7 @@ class pdf_azur extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -693,8 +684,7 @@ class pdf_azur extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -712,8 +702,7 @@ class pdf_azur extends ModelePDFPropales $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } @@ -782,8 +771,7 @@ class pdf_azur extends ModelePDFPropales $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; } } - else - { + else { if (!empty($conf->product->enabled)) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); } elseif (!empty($conf->service->enabled)) { @@ -836,14 +824,12 @@ class pdf_azur extends ModelePDFPropales return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PROP_OUTPUTDIR"); return 0; } @@ -1101,8 +1087,7 @@ class pdf_azur extends ModelePDFPropales { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1494,16 +1479,14 @@ class pdf_azur extends ModelePDFPropales $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1af66ca645e..1490dfe4adc 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -232,8 +232,7 @@ class pdf_cyan extends ModelePDFPropales $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } - else - { + else { $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -257,13 +256,11 @@ class pdf_cyan extends ModelePDFPropales { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -292,8 +289,7 @@ class pdf_cyan extends ModelePDFPropales $dir = $conf->propal->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->propal->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -551,8 +547,7 @@ class pdf_cyan extends ModelePDFPropales $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -602,8 +597,7 @@ class pdf_cyan extends ModelePDFPropales // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } @@ -644,17 +638,15 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -808,8 +800,7 @@ class pdf_cyan extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -824,8 +815,7 @@ class pdf_cyan extends ModelePDFPropales { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -843,8 +833,7 @@ class pdf_cyan extends ModelePDFPropales $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; } @@ -913,8 +902,7 @@ class pdf_cyan extends ModelePDFPropales $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; } } - else - { + else { if (!empty($conf->product->enabled)) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product').dol_sanitizeFileName($product->ref); } elseif (!empty($conf->service->enabled)) { @@ -967,14 +955,12 @@ class pdf_cyan extends ModelePDFPropales return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PROP_OUTPUTDIR"); return 0; } @@ -1232,8 +1218,7 @@ class pdf_cyan extends ModelePDFPropales { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1568,16 +1553,14 @@ class pdf_cyan extends ModelePDFPropales $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -2006,8 +1989,7 @@ class pdf_cyan extends ModelePDFPropales { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 4dde423a5e6..d342f9d6a4a 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -109,8 +109,7 @@ class mod_propale_marbre extends ModeleNumRefPropales { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -142,8 +141,7 @@ class mod_propale_marbre extends ModeleNumRefPropales if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 103d0fdffba..4f8c8221e79 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -211,8 +211,7 @@ class pdf_paiement // If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiement ASC"; - else - $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; + else $sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; break; case "fourn": $sql = "SELECT p.datep as dp, f.ref as ref"; @@ -245,8 +244,7 @@ class pdf_paiement // If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payement fourn are ordered by paiement_code if (!empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD)) $sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiementfourn ASC"; - else - $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; + else $sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC"; break; } @@ -274,8 +272,7 @@ class pdf_paiement $i++; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 89a532c2556..1a7076095ec 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -132,8 +132,7 @@ class doc_generic_reception_odt extends ModelePdfReception unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -272,8 +271,7 @@ class doc_generic_reception_odt extends ModelePdfReception if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -301,8 +299,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->thirdparty; } - else - { + else { $socobject = $object->thirdparty; } @@ -371,7 +368,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -391,7 +388,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -409,7 +406,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -431,7 +428,7 @@ class doc_generic_reception_odt extends ModelePdfReception if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -440,8 +437,7 @@ class doc_generic_reception_odt extends ModelePdfReception } } // Replace tags of lines - try - { + try { $listlines = $odfHandler->setSegment('lines'); foreach ($object->lines as $line) { @@ -513,8 +509,7 @@ class doc_generic_reception_odt extends ModelePdfReception return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 25b7b62388f..1901a9fc044 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -149,13 +149,11 @@ class pdf_squille extends ModelePdfReception { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } } - else - { + else { $filename = $obj['photo']; } @@ -177,8 +175,7 @@ class pdf_squille extends ModelePdfReception $dir = $conf->reception->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $rcpref = dol_sanitizeFileName($object->ref); $dir = $conf->reception->dir_output."/".$rcpref; $file = $dir."/".$rcpref.".pdf"; @@ -336,8 +333,7 @@ class pdf_squille extends ModelePdfReception $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -378,8 +374,7 @@ class pdf_squille extends ModelePdfReception // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (isset($imglinesize['width']) && isset($imglinesize['height'])) @@ -419,18 +414,16 @@ class pdf_squille extends ModelePdfReception $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -512,8 +505,7 @@ class pdf_squille extends ModelePdfReception { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -527,8 +519,7 @@ class pdf_squille extends ModelePdfReception { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -545,8 +536,7 @@ class pdf_squille extends ModelePdfReception $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -578,14 +568,12 @@ class pdf_squille extends ModelePdfReception return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "EXP_OUTPUTDIR"); return 0; } @@ -822,16 +810,14 @@ class pdf_squille extends ModelePdfReception $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -841,8 +827,7 @@ class pdf_squille extends ModelePdfReception { $posx = 105; } - else - { + else { $posx = $this->marge_gauche + 3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 66576eaab76..ee3122749a3 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -114,8 +114,7 @@ class mod_reception_beryl extends ModelNumRefReception if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog("mod_reception_beryl::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 2a7e0cf287f..cff1ae3f897 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -117,8 +117,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); if (!$tmpdir) { unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -250,8 +249,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -313,8 +311,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc } if ((is_array($contact_arrray) && count($contact_arrray) > 0)) { - try - { + try { $listlines = $odfHandler->setSegment('companycontacts'); foreach ($contact_arrray as $array_key => $contact_id) @@ -323,8 +320,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact'); foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -370,7 +366,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -439,8 +435,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 22ec06c8aa6..ce85de4670d 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -286,8 +286,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode { $result = -2; } - else - { + else { // Get Mask value $mask = ''; if ($type == 0) $mask = empty($conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER) ? '' : $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER; @@ -336,13 +335,11 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 15519688f98..5582e6459af 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -145,8 +145,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } @@ -189,8 +188,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { $result = -2; } - else - { + else { if ($this->verif_syntax($code) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $soc, $type); @@ -198,19 +196,16 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { $result = -3; } - else - { + else { $result = 0; } } - else - { + else { if (dol_strlen($code) == 0) { $result = -2; } - else - { + else { $result = -1; } } @@ -250,13 +245,11 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { return 0; } - else - { + else { return -1; } } - else - { + else { return -2; } } @@ -278,8 +271,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode { $res = -1; } - else - { + else { $res = 0; } return $res; diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 78b0e2fae8e..27b1572555e 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -147,8 +147,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode $codetouse = (!empty($societe->code_fournisseur) ? $societe->code_fournisseur : 'SUPPCODE'); $prefix = $this->prefixsupplieraccountancycode; } - else - { + else { $this->error = 'Bad value for parameter type'; return -1; } @@ -172,8 +171,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode { $this->code = $codetouse; } - else - { + else { // Pour retour $this->code = $codetouse; } @@ -211,14 +209,12 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode dol_syslog("mod_codecompta_aquarium::verif code '".$code."' available"); return 1; // Dispo } - else - { + else { dol_syslog("mod_codecompta_aquarium::verif code '".$code."' not available"); return 0; // Non dispo } } - else - { + else { $this->error = $db->error()." sql=".$sql; return -1; // Erreur } diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index d97ac5df0ff..3a689b8df93 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -170,8 +170,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode $prefix = $this->prefixcustomeraccountancycode; $width = $this->customeraccountancycodecharacternumber; } - else - { + else { $this->error = 'Bad value for parameter type'; return -1; } @@ -221,8 +220,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode { return 0; // return ok } - else - { + else { return -1; // return ko } } @@ -245,8 +243,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode { $typethirdparty = 'code_compta'; } - else - { + else { $this->error = 'Bad value for parameter type'; return -1; } @@ -262,14 +259,12 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode dol_syslog("mod_codecompta_digitaria::checkIfAccountancyCodeIsAlreadyUsed '".$code."' available"); return 0; // Available } - else - { + else { dol_syslog("mod_codecompta_digitaria::checkIfAccountancyCodeIsAlreadyUsed '".$code."' not available"); return -1; // Not available } } - else - { + else { $this->error = $db->error()." sql=".$sql; return -2; // Error } diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index a6df7aaea20..ea10843a94a 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -173,8 +173,7 @@ abstract class ModeleThirdPartyCode $i++; } } - else - { + else { return -1; } return $liste; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index d5ccf5dbd89..c68d1c37642 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -141,8 +141,7 @@ class doc_generic_stock_odt extends ModelePDFStock unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -295,8 +294,7 @@ class doc_generic_stock_odt extends ModelePDFStock if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -330,8 +328,7 @@ class doc_generic_stock_odt extends ModelePDFStock $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -418,7 +415,7 @@ class doc_generic_stock_odt extends ModelePDFStock if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -429,8 +426,7 @@ class doc_generic_stock_odt extends ModelePDFStock } } // Replace tags of lines - try - { + try { $listlines = $odfHandler->setSegment('supplierprices'); if (!empty($object->supplierprices)) { foreach ($object->supplierprices as $supplierprice) @@ -442,8 +438,7 @@ class doc_generic_stock_odt extends ModelePDFStock $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($array_lines as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -515,8 +510,7 @@ class doc_generic_stock_odt extends ModelePDFStock return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index c50f3d2a2f8..708f06a4491 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -211,8 +211,7 @@ class pdf_standard extends ModelePDFStock $dir = $conf->stock->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->stock->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -380,18 +379,16 @@ class pdf_standard extends ModelePDFStock $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -476,8 +473,7 @@ class pdf_standard extends ModelePDFStock { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -492,8 +488,7 @@ class pdf_standard extends ModelePDFStock { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -544,8 +539,7 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($totalvaluesell, 'MT'), 0, $outputlangs), 0, 'R', 0); } } - else - { + else { dol_print_error($db); } @@ -570,8 +564,7 @@ class pdf_standard extends ModelePDFStock $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -705,8 +698,7 @@ class pdf_standard extends ModelePDFStock $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -745,14 +737,12 @@ class pdf_standard extends ModelePDFStock return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PRODUCT_OUTPUTDIR"); return 0; } @@ -913,16 +903,14 @@ class pdf_standard extends ModelePDFStock $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -965,8 +953,7 @@ class pdf_standard extends ModelePDFStock { $pdf->MultiCell(150, 3, $e->label, '', 'R'); } - else - { + else { $pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R'); } @@ -1004,8 +991,7 @@ class pdf_standard extends ModelePDFStock $obj = $db->fetch_object($resqlbis); $lastmovementdate = $db->jdate($obj->datem); } - else - { + else { dol_print_error($db); } @@ -1013,8 +999,7 @@ class pdf_standard extends ModelePDFStock { $toWrite = dol_print_date($lastmovementdate, 'dayhour').' '; } - else - { + else { $toWrite = $outputlangs->transnoentities("None"); } diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index d0e9ba9d1e4..dcf461fd9c0 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -286,8 +286,7 @@ class pdf_stdmovement extends ModelePDFMovement { if ($year > 0) $sql .= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'"; - else - $sql .= " AND date_format(m.datem, '%m') = '$month'"; + else $sql .= " AND date_format(m.datem, '%m') = '$month'"; } elseif ($year > 0) { @@ -363,8 +362,7 @@ class pdf_stdmovement extends ModelePDFMovement $i = 0; $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; if ($msid) $texte = $langs->trans('StockMovementForId', $msid); - else - { + else { $texte = $langs->trans("ListOfStockMovements"); if ($id) $texte .= ' ('.$langs->trans("ForThisWarehouse").')'; } @@ -376,8 +374,7 @@ class pdf_stdmovement extends ModelePDFMovement $dir = $conf->stock->dir_output."/movement"; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); if (!empty($search_inventorycode)) $objectref .= "_".$id."_".$search_inventorycode; if ($search_type_mouvement) $objectref .= "_".$search_type_mouvement; @@ -540,18 +537,16 @@ class pdf_stdmovement extends ModelePDFMovement $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -667,8 +662,7 @@ class pdf_stdmovement extends ModelePDFMovement { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -683,8 +677,7 @@ class pdf_stdmovement extends ModelePDFMovement { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -720,8 +713,7 @@ class pdf_stdmovement extends ModelePDFMovement $pdf->SetXY($this->postotalht, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $totalunit, 0, 'R', 0); } - else - { + else { dol_print_error($db); } @@ -746,8 +738,7 @@ class pdf_stdmovement extends ModelePDFMovement $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } - else - { + else { $height_note = 0; } @@ -763,8 +754,7 @@ class pdf_stdmovement extends ModelePDFMovement $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -803,14 +793,12 @@ class pdf_stdmovement extends ModelePDFMovement return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "PRODUCT_OUTPUTDIR"); return 0; } @@ -994,16 +982,14 @@ class pdf_stdmovement extends ModelePDFMovement $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1046,8 +1032,7 @@ class pdf_stdmovement extends ModelePDFMovement { $pdf->MultiCell(150, 3, $e->label, '', 'R'); } - else - { + else { $pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R'); } @@ -1085,8 +1070,7 @@ class pdf_stdmovement extends ModelePDFMovement $obj = $db->fetch_object($resqlbis); $lastmovementdate = $db->jdate($obj->datem); } - else - { + else { dol_print_error($db); } @@ -1094,8 +1078,7 @@ class pdf_stdmovement extends ModelePDFMovement { $toWrite = dol_print_date($lastmovementdate, 'dayhour').' '; } - else - { + else { $toWrite = $outputlangs->transnoentities("None"); } 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 2e3b4e177d7..551d960008a 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -234,8 +234,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $dir = $conf->fournisseur->facture->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$objectref; @@ -425,17 +424,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -536,8 +533,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -552,8 +548,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -571,8 +566,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -615,14 +609,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices return 1; // No error } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->transnoentities("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -733,8 +725,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2, 0, $outputlangs), 0, 'R', 1); } } - else - { + else { //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 @@ -1049,8 +1040,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $i++; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1148,8 +1138,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); } - else - { + else { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(255, 0, 0); diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index c821e6b60aa..70c20a77fb3 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -193,8 +193,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { return -1; } diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index d7f48915308..7be80850526 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -138,8 +138,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -239,8 +238,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $dir = $conf->fournisseur->commande->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->commande->dir_output.'/'.$objectref; @@ -274,8 +272,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -308,8 +305,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -396,7 +392,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -407,8 +403,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -432,8 +427,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -507,8 +501,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 657160a9a1b..b08adfcb97c 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -222,8 +222,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -258,8 +257,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $dir = $conf->fournisseur->commande->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->commande->dir_output.'/'.$objectref; @@ -491,8 +489,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $tab_height = $tab_height - $height_note; $tab_top = $posyafter + 6; } - else - { + else { $height_note = 0; } @@ -535,8 +532,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -574,17 +570,15 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -734,8 +728,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -750,8 +743,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -769,8 +761,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -813,14 +804,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -1009,8 +998,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } - else - { + else { //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 @@ -1243,16 +1231,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1296,8 +1282,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date_commande, "day", false, $outputlangs, true), '', 'R'); } - else - { + else { $posy += 5; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(255, 0, 0); @@ -1645,8 +1630,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders { $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } - else - { + else { $this->cols = $hookmanager->resArray; } } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 4a27b58f8ae..c2a6af6c05e 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -238,8 +238,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -274,8 +273,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $dir = $conf->fournisseur->commande->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->commande->dir_output.'/'.$objectref; @@ -447,8 +445,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -467,8 +464,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $descWidth = $this->posxpicture - $curX; } - else - { + else { $descWidth = $this->posxtva - $curX; } pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); @@ -492,17 +488,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -617,8 +611,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -633,8 +626,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -652,8 +644,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -696,14 +687,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -892,8 +881,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } - else - { + else { //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 @@ -1159,16 +1147,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1212,8 +1198,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date_commande, "day", false, $outputlangs, true), '', 'R'); } - else - { + else { $posy += 5; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(255, 0, 0); diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index df4a60b10e2..c8129f1e491 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -117,8 +117,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 0ad8b391faf..060394beca6 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -231,8 +231,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $dir = $conf->fournisseur->payment->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier); $dir = $conf->fournisseur->payment->dir_output.'/'.$objectref; @@ -360,17 +359,15 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -433,8 +430,7 @@ class pdf_standard extends ModelePDFSuppliersPayments { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -449,8 +445,7 @@ class pdf_standard extends ModelePDFSuppliersPayments { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -468,8 +463,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -506,14 +500,12 @@ class pdf_standard extends ModelePDFSuppliersPayments return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR"); return 0; } @@ -663,16 +655,14 @@ class pdf_standard extends ModelePDFSuppliersPayments $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php index 9baa8d2dafe..4ee8ed90490 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php @@ -137,8 +137,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(__METHOD__, LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index c97d2f94d63..8b0d7f108a1 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -142,8 +142,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -307,8 +306,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -338,15 +336,13 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal { $socobject = $object->contact; } - else - { + else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -432,7 +428,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -443,8 +439,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -468,8 +463,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { $listlines->setVars($key, $val, true, 'UTF-8'); } catch (OdfException $e) @@ -541,8 +535,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index afaf4987e04..fd5fb653a5a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -234,8 +234,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } - else - { + else { $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } @@ -266,8 +265,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $dir = $conf->supplier_proposal->dir_output; $file = $dir."/SPECIMEN.pdf"; } - else - { + else { $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->supplier_proposal->dir_output."/".$objectref; $file = $dir."/".$objectref.".pdf"; @@ -432,8 +430,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) @@ -452,8 +449,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $descWidth = $this->posxpicture - $curX; } - else - { + else { $descWidth = $this->posxtva - $curX; } pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); @@ -480,17 +476,15 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->setPage($pageposafter + 1); } } - else - { + else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) $showpricebeforepagebreak = 1; - else - $showpricebeforepagebreak = 0; + else $showpricebeforepagebreak = 0; } } - else // No pagebreak + else // No pagebreak { $pdf->commitTransaction(); } @@ -613,8 +607,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -629,8 +622,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf, $object, $outputlangs, 1); @@ -648,8 +640,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - else - { + else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } @@ -694,14 +685,12 @@ class pdf_aurore extends ModelePDFSupplierProposal return 1; // No error } - else - { + else { $this->error = $langs->trans("ErrorCanNotCreateDir", $dir); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorConstantNotDefined", "SUPPLIER_PROPOSAL_OUTPUTDIR"); return 0; } @@ -943,8 +932,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { // Nothing to do } - else - { + else { //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1315,16 +1303,14 @@ class pdf_aurore extends ModelePDFSupplierProposal $height = pdf_getHeightForLogo($logo); $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) } - else - { + else { $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); } } - else - { + else { $text = $this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } @@ -1453,8 +1439,7 @@ class pdf_aurore extends ModelePDFSupplierProposal else $socname = $object->thirdparty->name; $carac_client_name = $outputlangs->convToOutputCharset($socname); } - else - { + else { $carac_client_name = $outputlangs->convToOutputCharset($object->thirdparty->name); } diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index 37ba98b0058..02b1c5a6684 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -109,8 +109,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal { return true; } - else - { + else { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -142,8 +141,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal if ($obj) $max = intval($obj->max); else $max = 0; } - else - { + else { dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index dedf0844245..76869791d93 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -152,8 +152,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface print 'Failed to open log file '.($dolibarr_main_prod ?basename($logfile) : $logfile); } } - else - { + else { $logLevels = array( LOG_EMERG => 'EMERG', LOG_ALERT => 'ALERT', diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 56ca1825ab4..d2f1200cc08 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -93,8 +93,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface dol_syslog("admin/syslog: facility ".$facility); } - else - { + else { $errors[] = $langs->trans("ErrorUnknownSyslogConstant", $facility); } diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 881ba4cb469..5c2468e29c6 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -139,8 +139,7 @@ class doc_generic_user_odt extends ModelePDFUser unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -289,8 +288,7 @@ class doc_generic_user_odt extends ModelePDFUser if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -322,8 +320,7 @@ class doc_generic_user_odt extends ModelePDFUser $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } @@ -370,7 +367,7 @@ class doc_generic_user_odt extends ModelePDFUser if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -429,8 +426,7 @@ class doc_generic_user_odt extends ModelePDFUser return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 1b1d6ba1dab..9e227a43588 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -142,8 +142,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup unset($listofdir[$key]); continue; } if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); - else - { + else { $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); } @@ -292,8 +291,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup if ($format == '1') $format = '%Y%m%d%H%M%S'; $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; } - else - { + else { $filename = $newfiletmp.'.'.$newfileformat; } $file = $dir.'/'.$filename; @@ -325,8 +323,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $contactobject = $object->contact; } } - else - { + else { $socobject = $object->thirdparty; } // Make substitution @@ -402,14 +399,13 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key=>$value) { - try - { + try { if (preg_match('/logo$/', $key)) // Image { if (file_exists($value)) $odfHandler->setImage($key, $value); else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - else // Text + else // Text { $odfHandler->setVars($key, $value, true, 'UTF-8'); } @@ -420,8 +416,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup } } // Replace tags of lines - try - { + try { $foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); @@ -445,8 +440,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks foreach ($tmparray as $key => $val) { - try - { + try { if (!is_array($val)) { $listlines->setVars($key, $val, true, 'UTF-8'); } @@ -520,8 +514,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup return 1; // Success } - else - { + else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return -1; } diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 2686efa6419..959d944352b 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -87,7 +87,7 @@ elseif ($modulepart == 'bank') if (!$user->rights->banque->lire) accessforbidden(); $accessallowed = 1; } -else // ticket, holiday, expensereport, societe... +else // ticket, holiday, expensereport, societe... { $result = restrictedArea($user, $modulepart, $id, $modulepart); if (empty($user->rights->$modulepart->read) && empty($user->rights->$modulepart->lire)) accessforbidden(); @@ -286,8 +286,7 @@ if ($cancel) header("Location: ".$backtourl); exit; } - else - { + else { dol_print_error('', 'Cancel on photo_resize with a not supported value of modulepart='.$modulepart); exit; } @@ -347,14 +346,12 @@ if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") header("Location: ".$backtourl); exit; } - else - { + else { dol_print_error('', 'confirm_resize on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } - else - { + else { setEventMessages($result, null, 'errors'); $_GET['file'] = $_POST["file"]; $action = ''; @@ -417,14 +414,12 @@ if ($action == 'confirm_crop') header("Location: ".$backtourl); exit; } - else - { + else { dol_print_error('', 'confirm_crop on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } - else - { + else { setEventMessages($result, null, 'errors'); $_GET['file'] = $_POST["file"]; $action = ''; diff --git a/htdocs/core/search.php b/htdocs/core/search.php index b82536edbd2..01c7c078214 100644 --- a/htdocs/core/search.php +++ b/htdocs/core/search.php @@ -148,7 +148,6 @@ if (!empty($_SERVER['HTTP_REFERER'])) header("Location: ".$_SERVER['HTTP_REFERER']); exit; } -else -{ +else { print 'The wrapper search.php was called without any search criteria'; } diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 119d7ff9a41..5d61ccecdb3 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -75,8 +75,7 @@ if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile $selected = -1; $searchform .= '

'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0); } -else -{ +else { $usedbyinclude = 1; // Used into next include $showtitlebefore = GETPOST('showtitlebefore', 'int'); include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 80a7cac7de3..960e0e57401 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -218,8 +218,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) } print ''; } -else -{ +else { print $type2label[$type]; print ''; } diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 96620da28d9..4a6c7d67494 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -118,8 +118,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print ""; } } -else -{ +else { $colspan = 13; if (!empty($conf->multicompany->enabled)) $colspan++; diff --git a/htdocs/core/tpl/bloc_comment.tpl.php b/htdocs/core/tpl/bloc_comment.tpl.php index 0e9e63bff12..d20894d6a03 100644 --- a/htdocs/core/tpl/bloc_comment.tpl.php +++ b/htdocs/core/tpl/bloc_comment.tpl.php @@ -112,8 +112,7 @@ if (!empty($object->comments)) $doleditor = new DolEditor('comment_description', $comment->description, '', 80, 'dolibarr_notes', 'In', 0, true, true, ROWS_3, '100%'); print $doleditor->Create(1); } - else - { + else { print $comment->description; } print '
'; // End comment-description @@ -125,8 +124,7 @@ if (!empty($object->comments)) print ''; } - else - { + else { if ($fk_user == $user->id || $user->admin == 1) { print ''; diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 7e2dc1f420e..6087ca6e906 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -52,8 +52,7 @@ if ($action == 'presend') { $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); } - else - { + else { $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); } @@ -104,8 +103,7 @@ if ($action == 'presend') { $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); } - else - { + else { $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); } @@ -161,8 +159,7 @@ if ($action == 'presend') { $liste['thirdparty'] = $object->getFullName($outputlangs)." <".$object->email.">"; } - else - { + else { if (is_object($object->thirdparty)) { foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index e9f881accd2..0c1931d480f 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -178,8 +178,7 @@ foreach (array('internal', 'external') as $source) { $contactlist = $objectsrc->liste_contact(-1, $source); } - else - { + else { $contactlist = $object->liste_contact(-1, $source); } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 0d2949b4e24..efb89043b6b 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -36,8 +36,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e } $value = $datenotinstring; } - else - { + else { $value = $obj->$tmpkey; } // If field is a computed field, we make computation to get value diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index d6ebb8b919f..b3512136a10 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -39,8 +39,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // TODO // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes } - else - { + else { // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') $morecss = ''; if (in_array($typeofextrafield, array('link', 'sellist'))) $morecss = 'maxwidth200'; diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php index 9a83cbb42aa..169dd34fee1 100644 --- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php @@ -27,8 +27,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') { print ''; } - else - { + else { $tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key]; print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align ? 'align="'.$align.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n"; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 198a3910747..a7379a69d94 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -87,8 +87,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] { $value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]); } - else - { + else { $value = $object->array_options["options_".$key]; //var_dump($key.' - '.$value); } @@ -114,8 +113,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $lastseparatorkeyfound = $key; } - else - { + else { print ''; print ''; } -else -{ +else { print ''; print ''; print ''; @@ -178,7 +177,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg print ''; } - else // Show filtree when ajax is disabled (rare) + else // Show filtree when ajax is disabled (rare) { print ''; diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 33be5fb99d1..f4f6974ac08 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -15,8 +15,7 @@ if (isset($totalarray['pos'])) { $i++; if (!empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; - else - { + else { if ($i == 1) { if ($num < $limit) print ''.$langs->trans("Total").''; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 97bece99852..e0245175768 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -254,8 +254,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil $url = $conf->global->MAIN_AUTHENTICATION_OPENID_URL; if (!empty($url)) print ''.$langs->trans("LoginUsingOpenID").''; - else - { + else { $langs->load("errors"); print ''.$langs->trans("ErrorOpenIDSetupNotComplete", 'MAIN_AUTHENTICATION_OPENID_URL').''; } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 492590c65e4..c507144b151 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -99,8 +99,7 @@ if ($massaction == 'presend') $fuser->fetch($thirdpartyid); $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; } - else - { + else { $soc = new Societe($db); $soc->fetch($thirdpartyid); foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) { @@ -159,8 +158,7 @@ if ($massaction == 'presend') print ' - '.$langs->trans("GoBack").''; $arrayofmassactions = array(); } - else - { + else { print $formmail->get_form(); } diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 8af029ce071..10db8476bef 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -43,8 +43,7 @@ if ($fixedDiscount > 0) $translationKey = (!empty($discount_type)) ? 'HasRelativeDiscountFromSupplier' : 'CompanyHasRelativeDiscount'; print $langs->trans($translationKey, $fixedDiscount).'.'; } -else -{ +else { $translationKey = (!empty($discount_type)) ? 'HasNoRelativeDiscountFromSupplier' : 'CompanyHasNoRelativeDiscount'; print $langs->trans($translationKey).'.'; } diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 0fb1aff011d..baa57c7d1c9 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -136,8 +136,7 @@ if ($nolinesbefore) { print ''; if ($conf->global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); - else - echo $langs->trans('CostPrice'); + else echo $langs->trans('CostPrice'); echo ''; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''.$langs->trans('MarginRate').''; if (!empty($conf->global->DISPLAY_MARK_RATES)) echo ''.$langs->trans('MarkRate').''; @@ -187,8 +186,7 @@ if ($nolinesbefore) { echo ''; echo ' '; } - else - { + else { echo ''; // Show type selector if ($forceall >= 0) @@ -214,8 +212,7 @@ if ($nolinesbefore) { elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); else echo $langs->trans('PredefinedProductsAndServicesToSell'); } - else - { + else { if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); @@ -232,8 +229,7 @@ if ($nolinesbefore) { // hide products in closed warehouse, but show products for internal transfer $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } - else - { + else { $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS)) @@ -255,8 +251,7 @@ if ($nolinesbefore) { array('remise_percent' => 'discount') // html id tags that will be edited with each ajax json response key ); @@ -449,8 +443,7 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat print '   '.$langs->trans("DateEndPlanned").' '; print $form->selectDate($date_end, "date_end", $usehm, $usehm, 1, "addproduct"); } - else - { + else { print $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0); print ' '.$langs->trans('to').' '; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index d316afb6966..8957021d359 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -231,8 +231,7 @@ $coldisplay++; // if credit note, dont allow to modify margin if ($line->subprice < 0) echo ''.$margin_rate.'%'; - else - echo '%'; + else echo '%'; $coldisplay++; } elseif (!empty($conf->global->DISPLAY_MARK_RATES)) @@ -241,8 +240,7 @@ $coldisplay++; // if credit note, dont allow to modify margin if ($line->subprice < 0) echo ''.$mark_rate.'%'; - else - echo '%'; + else echo '%'; $coldisplay++; } } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 8849020b885..34f78ae7fcc 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -111,22 +111,19 @@ if (($line->info_bits & 2) == 2) { $discount->fetch($line->fk_remise_except); print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); } - else - { + else { print ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description); } } } -else -{ +else { $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day'; if ($line->fk_product > 0) { print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } - else - { + else { $type = (!empty($line->product_type) ? $line->product_type : $line->fk_product_type); if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -178,8 +175,7 @@ if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0) { print $productfourn->getNomUrl(); } - else - { + else { print $productfourn->ref_supplier; } } diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index 2680a763a59..3e92af33a4d 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -50,8 +50,7 @@ if ((array) $linked_resources && count($linked_resources) > 0) print '
'; print '
'; } - else - { + else { $class = ''; if ($linked_resource['rowid'] == GETPOST('lineid')) $class = 'highlight'; diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index fceb1552f0b..591939c6156 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -203,8 +203,7 @@ class InterfaceLogevents extends DolibarrTriggers { return 1; } - else - { + else { $error = "Failed to insert security event: ".$event->error; $this->errors[] = $error; $this->error = $error; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 49939277f49..46a5df282d2 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -812,8 +812,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $tmpuser->fetch($object->oldcopy->fk_user_assign); $object->actionmsg .= "\n".$langs->transnoentities("OldUser").': '.$tmpuser->getFullName($langs); } - else - { + else { $object->actionmsg .= "\n".$langs->transnoentities("OldUser").': '.$langs->trans("None"); } if ($object->fk_user_assign > 0) @@ -822,14 +821,13 @@ class InterfaceActionsAuto extends DolibarrTriggers $tmpuser->fetch($object->fk_user_assign); $object->actionmsg .= "\n".$langs->transnoentities("NewUser").': '.$tmpuser->getFullName($langs); } - else - { + else { $object->actionmsg .= "\n".$langs->transnoentities("NewUser").': '.$langs->trans("None"); } $object->sendtoid = 0; } // TODO Merge all previous cases into this generic one - else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ... + else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ... { // Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function). // Note that these key can be set in agenda setup, only if defined into c_action_trigger @@ -867,8 +865,7 @@ class InterfaceActionsAuto extends DolibarrTriggers { if (count($object->sendtoid) == 1) $contactforaction->fetch(reset($object->sendtoid)); } - else - { + else { if ($object->sendtoid > 0) $contactforaction->fetch($object->sendtoid); } // Set societeforaction. @@ -952,8 +949,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $_SESSION['LAST_ACTION_CREATED'] = $ret; return 1; } - else - { + else { $this->error = "Failed to insert event : ".$actioncomm->error." ".join(',', $actioncomm->errors); $this->errors = $actioncomm->errors; diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 2135f463ca7..7740191c94b 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -143,8 +143,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers $this->errors = $b->errors; return -1; } - else - { + else { return 1; } } diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index be5465c06f2..ce9e156883d 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -72,8 +72,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers $this->errors = $object->context['linkto']->errors; $return = -1; } - else - { + else { $return = 1; } @@ -90,8 +89,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers $this->errors = $object->context['unlinkoff']->errors; $return = -1; } - else - { + else { $return = 1; } @@ -110,8 +108,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->error)) $this->errors[] = $object->error; $return = -1; } - else - { + else { $return = 1; } @@ -133,8 +130,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->oldcopy->error)) $this->errors[] = $object->oldcopy->error; $return = -1; } - else - { + else { $return = 1; } } @@ -145,8 +141,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->error)) $this->errors[] = $object->error; $return = -1; } - else - { + else { $return = 1; } } @@ -165,8 +160,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers if (!empty($object->error)) $this->errors[] = $object->error; $return = -1; } - else - { + else { $return = 1; } diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 6bd33c5b2f9..b3625c09e47 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -171,8 +171,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $ok = 1; } - else - { + else { $this->error = $userstat->error; $this->errors = $userstat->errors; } diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index e6c2df36ee1..303f4a523ad 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -178,8 +178,7 @@ class InterfaceStripe extends DolibarrTriggers $customer->createTaxId($customer->id, array('type'=>'eu_vat', 'value'=>$vatcleaned)); } } - else - { + else { $taxids = $customer->allTaxIds($customer->id); if (is_array($taxids->data)) { diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 5c618b089a3..4ac9d00ca53 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -118,8 +118,7 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing header("Location: ".DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$newpageid.'&l='.GETPOST('l', 'aZ09')); exit; } - else - { + else { $newpageref = $obj->pageurl; header("Location: ".$newpageref.'.php?l='.GETPOST('l', 'aZ09')); exit; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index a8bca51dda3..f20ac732fd4 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -137,8 +137,7 @@ if ($action == "setlive") if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -238,15 +237,13 @@ if (empty($conf->stripeconnect->enabled)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; } - else - { + else { print img_picto($langs->trans("inactive"), 'statut5'); } } @@ -311,22 +308,19 @@ if (empty($conf->stripeconnect->enabled)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; } - else - { + else { print img_picto($langs->trans("inactive"), 'statut5'); } } print ''; } -else -{ +else { print ''.$langs->trans("StripeConnect").''; print ''.$langs->trans("StripeConnect_Mode").''; } diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 44c7db306a2..74fa1aafc43 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -66,8 +66,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } -else -{ +else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -86,8 +85,7 @@ if (!$rowid) { $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc)); } - else - { + else { $list = \Stripe\Charge::all($option); } @@ -184,16 +182,14 @@ if (!$rowid) { $societestatic->fetch($charge->metadata->dol_thirdparty_id); } - else - { + else { $societestatic->id = 0; } if (!empty($tmparray['MEM']) && $tmparray['MEM'] > 0) { $memberstatic->fetch($tmparray['MEM']); } - else - { + else { $memberstatic->id = 0; } diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 33b19384085..4b68ad72b09 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -76,8 +76,7 @@ class ActionsStripeconnect $service = 'StripeTest'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } - else - { + else { $service = 'StripeLive'; } @@ -209,8 +208,7 @@ class ActionsStripeconnect $langs->load("withdrawals"); print ''.$langs->trans("StripeConnectPay").''; } - else - { + else { print ''.$langs->trans("StripeConnectPay").''; } } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index a72e5291f58..4a56a2a1542 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -261,8 +261,7 @@ class Stripe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } @@ -499,8 +498,7 @@ class Stripe extends CommonObject } } } - else - { + else { $_SESSION["stripe_payment_intent"] = $paymentintent; } } @@ -532,8 +530,7 @@ class Stripe extends CommonObject { return $paymentintent; } - else - { + else { return null; } } @@ -675,8 +672,7 @@ class Stripe extends CommonObject dol_syslog("getSetupIntent ".(is_object($setupintent) ? $setupintent->id : ''), LOG_INFO, -1); return $setupintent; } - else - { + else { dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); return null; } @@ -721,8 +717,7 @@ class Stripe extends CommonObject { $card = $cu->sources->retrieve($cardref); } - else - { + else { $card = \Stripe\PaymentMethod::retrieve($cardref); } } else { @@ -769,8 +764,7 @@ class Stripe extends CommonObject $this->error = 'Creation of card on Stripe has failed'; } } - else - { + else { $connect = ''; if (!empty($stripeacc)) $connect = $stripeacc.'/'; $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; @@ -793,8 +787,7 @@ class Stripe extends CommonObject $this->error = 'Creation of card on Stripe has failed'; } } - else - { + else { $connect = ''; if (!empty($stripeacc)) $connect = $stripeacc.'/'; $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; @@ -832,8 +825,7 @@ class Stripe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } @@ -944,8 +936,7 @@ class Stripe extends CommonObject { $charge->status = 'ok'; } - else - { + else { $charge->status = 'failed'; $charge->failure_code = $stripe->code; $charge->failure_message = $stripe->error; @@ -1039,16 +1030,14 @@ class Stripe extends CommonObject $charge->status = 'ok'; $charge->id = $paymentintent->id; } - else - { + else { $charge->status = 'failed'; $charge->failure_code = $stripe->code; $charge->failure_message = $stripe->error; $charge->failure_declinecode = $stripe->declinecode; } } - else - { + else { $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description", "stripe_account" => "$account")); } } @@ -1061,8 +1050,7 @@ class Stripe extends CommonObject { $return->message = 'Payment retreived by card status = '.$charge->status; } - else - { + else { if ($charge->source->type == 'card') { $return->message = $charge->source->card->brand." ....".$charge->source->card->last4; } elseif ($charge->source->type == 'three_d_secure') { diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 730203245f4..1efe9a7f386 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -48,8 +48,7 @@ if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')) { $stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test } -else -{ +else { $stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live } diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 17f2423327f..741921ac63c 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -65,8 +65,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } -else -{ +else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -115,8 +114,7 @@ if (!$rowid) { { $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); } - else - { + else { $payout = \Stripe\Payout::all(array("limit" => $limit)); } diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 3829eba4d0d..eb0ce7df09e 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -66,8 +66,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } -else -{ +else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -114,8 +113,7 @@ if (!$rowid) { { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); } - else - { + else { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit)); } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 08479b95871..d911e310d90 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -134,16 +134,14 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { if ($object->id > 0) { $result = $object->createFromClone($user, $socid); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit(); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -411,8 +409,7 @@ if (empty($reshook)) $error++; } } // Standard creation - else - { + else { $id = $object->create($user); } @@ -443,14 +440,12 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit(); } - else - { + else { $db->rollback(); $action = 'create'; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $action = 'create'; @@ -552,8 +547,7 @@ if (empty($reshook)) $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $price_ht = ''; $tva_tx = ''; @@ -622,8 +616,7 @@ if (empty($reshook)) $productsupplier->ref_supplier = ''; } } - else - { + else { $fksoctosearch = $object->thirdparty->id; $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist } @@ -738,8 +731,7 @@ if (empty($reshook)) { $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings } - else - { + else { $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings } @@ -835,8 +827,7 @@ if (empty($reshook)) unset($_POST['date_endmonth']); unset($_POST['date_endyear']); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); @@ -1139,8 +1130,7 @@ if ($action == 'create') if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } } - else - { + else { $cond_reglement_id = $soc->cond_reglement_supplier_id; $mode_reglement_id = $soc->mode_reglement_supplier_id; if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; @@ -1895,8 +1885,7 @@ if ($action == 'create') if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { print ''; - } else - print ''; + } else print ''; } } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 97c0ee27e4e..42c30c333d6 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -274,8 +274,7 @@ class SupplierProposal extends CommonObject { $price = $prod->multiprices[$this->thirdparty->price_level]; } - else - { + else { $price = $prod->price; } @@ -347,21 +346,18 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $supplier_proposalligne->error; $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -2; } @@ -431,8 +427,7 @@ class SupplierProposal extends CommonObject { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -493,16 +488,14 @@ class SupplierProposal extends CommonObject return -1; } } - else - { + else { $this->error = $prod->error; $this->db->rollback(); return -1; } } } - else - { + else { $product_type = $type; } @@ -623,22 +616,19 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $this->line->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->line->error; $this->db->rollback(); return -2; } } - else - { + else { $this->error = 'BadStatusOfObjectToAddLine'; return -5; } @@ -809,15 +799,13 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $result; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::updateline Erreur -2 SupplierProposal en mode incompatible pour cette action"); return -2; } @@ -845,13 +833,11 @@ class SupplierProposal extends CommonObject return 1; } - else - { + else { return -1; } } - else - { + else { return -2; } } @@ -1080,15 +1066,13 @@ class SupplierProposal extends CommonObject // End call triggers } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1099,14 +1083,12 @@ class SupplierProposal extends CommonObject dol_syslog(get_class($this)."::create done id=".$this->id); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1168,8 +1150,7 @@ class SupplierProposal extends CommonObject // TODO Change product price if multi-prices } - else - { + else { $objsoc->fetch($this->socid); } @@ -1218,8 +1199,7 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -1411,8 +1391,7 @@ class SupplierProposal extends CommonObject } $this->db->free($result); } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1427,8 +1406,7 @@ class SupplierProposal extends CommonObject $this->error = "Record Not Found"; return 0; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1464,8 +1442,7 @@ class SupplierProposal extends CommonObject { $num = $this->getNextNumRef($soc); } - else - { + else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -1539,14 +1516,12 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { dol_syslog("You don't have permission to validate supplier proposal", LOG_WARNING); return -2; } @@ -1574,8 +1549,7 @@ class SupplierProposal extends CommonObject $this->date_livraison = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this)."::set_date_livraison Erreur SQL"); return -1; @@ -1609,8 +1583,7 @@ class SupplierProposal extends CommonObject $this->update_price(1); return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1645,8 +1618,7 @@ class SupplierProposal extends CommonObject $this->update_price(1); return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1709,8 +1681,7 @@ class SupplierProposal extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1783,14 +1754,12 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->errors[] = $this->db->lasterror(); $this->db->rollback(); @@ -1958,8 +1927,7 @@ class SupplierProposal extends CommonObject return -1; } } - else - { + else { return -1; } } @@ -2024,8 +1992,7 @@ class SupplierProposal extends CommonObject { $ga[$obj->supplier_proposalid] = $obj->ref.' ('.$obj->name.')'; } - else - { + else { $ga[$i]['id'] = $obj->supplier_proposalid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -2036,8 +2003,7 @@ class SupplierProposal extends CommonObject } return $ga; } - else - { + else { dol_print_error($this->db); return -1; } @@ -2134,29 +2100,25 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return 0; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -1; } @@ -2210,8 +2172,7 @@ class SupplierProposal extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2341,8 +2302,7 @@ class SupplierProposal extends CommonObject } return $response; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2410,8 +2370,7 @@ class SupplierProposal extends CommonObject $line->total_tva = 9.8; $line->remise_percent = 50; } - else - { + else { $line->total_ht = 100; $line->total_ttc = 119.6; $line->total_tva = 19.6; @@ -2470,8 +2429,7 @@ class SupplierProposal extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; @@ -2521,14 +2479,12 @@ class SupplierProposal extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; return ""; } } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("SupplierProposal")); return ""; @@ -2699,8 +2655,7 @@ class SupplierProposal extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2995,8 +2950,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -3042,8 +2996,7 @@ class SupplierProposalLine extends CommonObjectLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -3130,8 +3083,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -3178,8 +3130,7 @@ class SupplierProposalLine extends CommonObjectLine return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -3225,8 +3176,7 @@ class SupplierProposalLine extends CommonObjectLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -3301,8 +3251,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -3336,8 +3285,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 43c9b91f563..8f606ad4f67 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -66,15 +66,13 @@ if ($action == 'addcontact' && $permissiontoedit) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -87,8 +85,7 @@ elseif ($action == 'swapstatut' && $permissiontoedit) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -195,8 +192,7 @@ if ($id > 0 || !empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; } - else - { + else { // Contact not found print "ErrorRecordNotFound"; } diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 3f471e28b3f..3096e6fbbdb 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -167,8 +167,7 @@ if ($object->id > 0) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index e8432ad8fe4..7a575007be2 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -163,8 +163,7 @@ if ($resql) print ''.$langs->trans("Total").''.$total.''; print "

"; } -else -{ +else { dol_print_error($db); } @@ -384,8 +383,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa print "

"; } } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index ded5d9ca2bf..eba1db92a94 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -359,8 +359,7 @@ if ($resql) $soc->fetch($socid); $title = $langs->trans('ListOfSupplierProposals').' - '.$soc->name; } - else - { + else { $title = $langs->trans('ListOfSupplierProposals'); } @@ -951,8 +950,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_supplier_proposal', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 7e5b6aaf531..3f09ac541d3 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -111,13 +111,11 @@ if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > } } } - else - { + else { $includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot'; } } - else - { + else { $includeconferror = 'ErrorBadFormatForConfFile'; } } diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 2508ab56040..a33f337cc96 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -53,8 +53,7 @@ if (GETPOST('action', 'alpha') == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index 566f18ac1a4..f0410f812d9 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -147,8 +147,7 @@ if ($nbofentries > 0) } print ''; } -else -{ +else { print ''; print ''; print ''; } -else -{ +else { print ''; print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; @@ -177,8 +176,7 @@ if ($nbofentries > 0) } print '
'; print '\n"; @@ -122,8 +120,7 @@ if ($conf->receiptprinter->enabled) { { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; @@ -139,8 +136,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; @@ -176,8 +172,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P { print ''; } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -192,8 +187,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P { print ''; } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 85406c46faa..f4e86677a1b 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -97,8 +97,7 @@ if ($action == 'set') { $db->commit(); } - else - { + else { $db->rollback(); } } elseif ($action == 'updateMask') { @@ -196,8 +195,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 46d168ddd24..e2996ad763d 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -103,8 +103,7 @@ if (GETPOST('action', 'alpha') == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -188,8 +187,7 @@ if (!empty($conf->stock->enabled)) if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); } - else - { + else { if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); } @@ -208,8 +206,7 @@ if (!empty($conf->stock->enabled)) print $formproduct->selectWarehouses($conf->global->{'CASHDESK_ID_WAREHOUSE'.$terminal}, 'CASHDESK_ID_WAREHOUSE'.$terminal, '', 1, $disabled); print ' '; } - else - { + else { print ''.$langs->trans("StockDecreaseForPointOfSaleDisabled").''; } print ''; diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index d1f59325c1f..75c40e6607e 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -65,8 +65,7 @@ if ($action == 'getProducts') { } echo json_encode($prods); } - else - { + else { echo 'Failed to load category with id='.$category; } } diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index e668b01aacb..8a752a5d3a5 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -56,8 +56,7 @@ if ($query == "cat") { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); @@ -79,8 +78,7 @@ elseif ($query == "pro") if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); } -else -{ +else { // TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded. // The file diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index dbc68afeaf4..94cc526434e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -135,8 +135,7 @@ foreach ($categories as $key => $categorycursor) { $maincategories[$key] = $categorycursor; } - else - { + else { $subcategories[$key] = $categorycursor; } } @@ -858,8 +857,7 @@ if (empty($conf->global->TAKEPOS_BAR_RESTAURANT)) { $menus[$r++] = array('title'=>'
'.$langs->trans("New").'
', 'action'=>'New();'); } -else -{ +else { // BAR RESTAURANT specific menu $menus[$r++] = array('title'=>'
'.$langs->trans("Place").'
', 'action'=>'Floors();'); } @@ -988,8 +986,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { //echo ''; echo ''; } - else - { + else { echo ''; } ?> @@ -1023,8 +1020,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { //echo ''; print ''; } - else - { + else { print '
'; print ''; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 16012022dc9..274e47a1185 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -57,8 +57,7 @@ if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == if ($_SESSION["takeposterminal"] == "") { if ($conf->global->TAKEPOS_NUM_TERMINALS == "1") $_SESSION["takeposterminal"] = 1; - else - { + else { header("Location: ".DOL_URL_ROOT."/takepos/index.php"); exit; } @@ -118,8 +117,7 @@ if ($invoiceid > 0) { $ret = $invoice->fetch($invoiceid); } -else -{ +else { $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')'); } if ($ret > 0) @@ -143,8 +141,7 @@ if ($action == 'valid' && $user->rights->facture->creer) if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility - else - { + else { $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; $bankaccount = $conf->global->$accountname; } @@ -211,8 +208,7 @@ if ($action == 'valid' && $user->rights->facture->creer) $conf->global->STOCK_CALCULATE_ON_BILL = $savconst; } - else - { + else { $res = $invoice->validate($user); } @@ -275,8 +271,7 @@ if (($action == "addline" || $action == "freezone") && $placeid == 0) $langs->load('errors'); dol_htmloutput_errors($langs->trans("ErrorModuleSetupNotComplete", "TakePos"), null, 1); } - else - { + else { $placeid = $invoice->create($user); if ($placeid < 0) { @@ -421,8 +416,7 @@ if ($action == "delete") { { $db->commit(); } - else - { + else { $db->rollback(); } @@ -581,8 +575,7 @@ if ($action == "valid" || $action == "history") { $sectionwithinvoicelink .= $langs->trans('RemainToPay').': '.price($remaintopay, 1, $langs, 1, -1, -1, $conf->currency).''; } - else - { + else { if ($invoice->paye) $sectionwithinvoicelink .= ''.$langs->trans("Paid").''; else $sectionwithinvoicelink .= $langs->trans('BillShortStatusValidated'); } @@ -814,14 +807,12 @@ $( document ).ready(function() { $s .= " ".img_warning($langs->trans("Late")); } } - else - { + else { $s .= '
'.$langs->trans("SubscriptionNotReceived"); if ($adh->statut > 0) $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } } - else - { + else { $s .= '
'.$langs->trans("ThirdpartyNotLinkedToMember"); } $s .= ''; @@ -968,8 +959,7 @@ if ($placeid > 0) { $htmlsupplements[$line->fk_parent_line] .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); } - else - { + else { $htmlsupplements[$line->fk_parent_line] .= $line->desc; } } @@ -1019,8 +1009,7 @@ if ($placeid > 0) { $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); } - else - { + else { $htmlforlines .= $line->desc; } } @@ -1048,8 +1037,7 @@ if ($placeid > 0) print $htmlforlines; } } - else - { + else { print ''; } } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index b2534272ae2..f370387d72e 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -52,8 +52,7 @@ if ($invoiceid > 0) { $invoice->fetch($invoiceid); } -else -{ +else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -65,8 +64,7 @@ else { $invoiceid = 0; // Invoice does not exist yet } - else - { + else { $invoice->fetch($invoiceid); } } diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 90f0aa363dc..1cad9a9ede4 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -136,8 +136,7 @@ else { { $maincategories[$key] = $categorycursor; } - else - { + else { $subcategories[$key] = $categorycursor; } } diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 7be5ee85938..4d11663ea85 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -52,8 +52,7 @@ if ($invoiceid > 0) { $invoice->fetch($invoiceid); } -else -{ +else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -65,8 +64,7 @@ else { $invoiceid = 0; // Invoice does not exist yet } - else - { + else { $invoice->fetch($invoiceid); } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index fc365ae5812..dc25fa4b44a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2120,8 +2120,7 @@ a.tmenuimage:hover{ content: "\f249"; }'."\n"; } - else - { + else { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n"; $url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1); print "div.mainmenu.".$val." {\n"; @@ -2130,8 +2129,7 @@ a.tmenuimage:hover{ } $generic++; } - else - { + else { print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index d2a11725ecf..6a4f1ebf7e1 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -41,8 +41,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php p { $theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } - else - { + else { // for now we use the same configuration for all types of color blind $theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c43fa9cd7d9..a7b759cfea0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2148,8 +2148,7 @@ div.mainmenu.website { content: "\f249"; }'; } - else - { + else { print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one. */\n"; print "/* Overwrite this definition in your own css with a different content to use your own font awesome icon. */\n"; $url = dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic, 4))."_over.png", 1); @@ -2159,8 +2158,7 @@ div.mainmenu.website { } $generic++; } - else - { + else { print "div.mainmenu.".$val." {\n"; print " background-image: url(".$url.");\n"; print "}\n"; diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index ffad2cc66b5..7d492bcae6a 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -37,8 +37,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) // File is run after an include of a php p { $theme_datacolor = array(array(157, 56, 191), array(0, 147, 183), array(250, 190, 30), array(221, 75, 57), array(0, 166, 90), array(140, 140, 220), array(190, 120, 120), array(190, 190, 100), array(115, 125, 150), array(100, 170, 20), array(150, 135, 125), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } - else - { + else { // for now we use the same configuration for all types of color blind $theme_datacolor = array(array(248, 220, 1), array(9, 85, 187), array(42, 208, 255), array(0, 0, 0), array(169, 169, 169), array(253, 102, 136), array(120, 154, 190), array(146, 146, 55), array(0, 52, 251), array(196, 226, 161), array(222, 160, 41), array(85, 135, 150), array(150, 135, 80), array(150, 80, 150)); } diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 2c473a9de54..2fd3b2643e0 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -57,8 +57,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 6e400b3eeaa..2e61ce15045 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1207,8 +1207,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd } print ''."\n"; } - else - { + else { print '
'; } diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 0fb5835cb4c..f701fabc2c0 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -397,8 +397,7 @@ class ActionsTicket { $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action } - else - { + else { $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status; } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4db98cfe7ad..0f6994d6a03 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -542,8 +542,7 @@ class Ticket extends CommonObject $this->db->free($resql); return 1; } - else - { + else { return 0; } } else { @@ -1354,8 +1353,7 @@ class Ticket extends CommonObject { $sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut = ".Ticket::STATUS_ASSIGNED; } - else - { + else { $sql .= " SET fk_user_assign=null, fk_statut = ".Ticket::STATUS_READ; } $sql .= " WHERE rowid = ".$this->id; @@ -2767,8 +2765,7 @@ class Ticket extends CommonObject } return $response; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2810,8 +2807,7 @@ class Ticket extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index d48001a680e..86f671d876b 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -196,8 +196,7 @@ if ($object->id) include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 1); } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1331e2be12e..4d1cb7a5d60 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -286,8 +286,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 0a6c8067db5..c35b60ab42e 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -57,8 +57,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index b39ba0fd366..e6760ba9c4d 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -85,8 +85,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filenamenb = $dir.'/ticketsnbinyear-'.$user->id.'-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/ticketsnbinyear-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsnbinyear-'.$year.'.png'; } @@ -126,8 +125,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filenameamount = $dir.'/ticketsamountinyear-'.$user->id.'-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsamountinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenameamount = $dir.'/ticketsamountinyear-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsamountinyear-'.$year.'.png'; } @@ -165,8 +163,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filename_avg = $dir.'/ticketsaverage-'.$user->id.'-'.$year.'.png'; $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsaverage-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filename_avg = $dir.'/ticketsaverage-'.$year.'.png'; $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsaverage-'.$year.'.png'; } diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 3bdc6b5390c..a02e2c17ec6 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -72,8 +72,7 @@ if (!$bankid) { $account->fetch(0, '', $id); } -else -{ +else { $account->fetch($bankid); } if (empty($account->userid)) $account->userid = $object->id; @@ -107,8 +106,7 @@ if ($action == 'add' && !$cancel) setEventMessages($account->error, $account->errors, 'errors'); $action = 'edit'; // Force chargement page edition } - else - { + else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = ''; } @@ -138,8 +136,7 @@ if ($action == 'update' && !$cancel) setEventMessages($account->error, $account->errors, 'errors'); $action = 'edit'; // Force chargement page edition } - else - { + else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = ''; } @@ -284,8 +281,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco if ($num <= 0) print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 83b31569a7b..7ed4f2786b2 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -58,8 +58,7 @@ if (GETPOST('action', 'alpha') == 'set') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -105,8 +104,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser") { print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "
'.$langs->trans("Empty").'
'.$langs->trans("None").''; print "
"; } - else - { + else { dol_print_error($db); } } @@ -340,8 +336,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco if ($num <= 0) print '
'.$langs->trans("None").''; print "
"; } - else - { + else { dol_print_error($db); } } @@ -395,8 +390,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco if ($num <= 0) print ''.$langs->trans("None").''; print ""; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cd115dbe292..3e7b36e5189 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -295,8 +295,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } - else - { + else { $langs->load("errors"); $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); @@ -326,8 +325,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -429,13 +427,11 @@ if (empty($reshook)) { { $object->entity = 1; // all users in master entity } - else - { + else { $object->entity = (!GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); } } - else - { + else { $object->entity = (!GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); } @@ -455,8 +451,7 @@ if (empty($reshook)) { { $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); @@ -472,8 +467,7 @@ if (empty($reshook)) { $langs->load("errors"); setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -565,8 +559,7 @@ if (empty($reshook)) { } } } - else - { + else { if ($caneditpassword) // Case we can edit only password { dol_syslog("Not allowed to change fields, only password"); @@ -603,13 +596,11 @@ if (empty($reshook)) { { setEventMessages($langs->trans("PasswordChangedAndSentTo", $object->email), null, 'mesgs'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("PasswordChangedTo", $newpassword), null, 'warnings'); } } @@ -666,8 +657,7 @@ if (empty($reshook)) { } } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } } @@ -765,13 +755,11 @@ if ($action == 'create' || $action == 'adduserldap') $liste[$key] = $label; } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } @@ -822,8 +810,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_lastname; } - else - { + else { print ''; } print ''; @@ -836,8 +823,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_firstname; } - else - { + else { print ''; } print ''; @@ -855,8 +841,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_loginsmb; } - else - { + else { print ''; } print ''; @@ -887,8 +872,7 @@ if ($action == 'create' || $action == 'adduserldap') $valuetoshow .= ($valuetoshow ? ', ' : '').''; // Dolibarr password is preffiled with LDAP known password $valuetoshow .= preg_replace('/./i', '*', $ldap_pass); } - else - { + else { // We do not use a field password but a field text to show new password to use. $valuetoshow .= ($valuetoshow ? ', ' : '').''; } @@ -914,8 +898,7 @@ if ($action == 'create' || $action == 'adduserldap') print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_api_key" class="linkobject"'); print ''; } - else - { + else { // PARTIAL WORKAROUND $generated_fake_api_key = getRandomPassword(false); print ''; @@ -1060,8 +1043,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_phone; } - else - { + else { print ''; } print ''; @@ -1074,8 +1056,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_mobile; } - else - { + else { print ''; } print ''; @@ -1088,8 +1069,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_fax; } - else - { + else { print ''; } print ''; @@ -1102,8 +1082,7 @@ if ($action == 'create' || $action == 'adduserldap') print ''; print $ldap_mail; } - else - { + else { print ''; } print ''; @@ -1237,8 +1216,7 @@ if ($action == 'create' || $action == 'adduserldap') print "".$mc->select_entities($conf->entity); print "\n"; } - else - { + else { print ''; } } @@ -1358,8 +1336,7 @@ if ($action == 'create' || $action == 'adduserldap') print ""; } -else -{ +else { /* ************************************************************************** */ /* */ /* View and edition */ @@ -1411,8 +1388,7 @@ else } } } - else - { + else { $userDisabled = 1; $statutUACF = "ACCOUNTDISABLE"; } @@ -1430,8 +1406,7 @@ else $title = $langs->trans("Employee"); $linkback = ''.$langs->trans("BackToList").''; } - else - { + else { $title = $langs->trans("User"); $linkback = ''; @@ -1503,8 +1478,7 @@ else { print ''.$langs->trans("LoginAccountDisableInDolibarr").''; } - else - { + else { print ''.$object->login.''; } print ''."\n"; @@ -1530,13 +1504,11 @@ else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("LdapUacf_".$statutUACF, $ldap->domainFQDN).''; } - else - { + else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("PasswordOfUserInLDAP"); } } - else - { + else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("PasswordOfUserInLDAP"); } } @@ -1547,8 +1519,7 @@ else if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if ($object->pass) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); - else - { + else { if ($user->admin) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("Crypted").': '.$object->pass_indatabase_crypted; else $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("Hidden").''; } @@ -1582,8 +1553,7 @@ else { print $form->textwithpicto(yn($object->admin), $langs->trans("AdministratorDesc"), 1, "admin"); } - else - { + else { print yn($object->admin); } print ''."\n"; @@ -1826,8 +1796,7 @@ else $societe->fetch($object->socid); print $societe->getNomUrl(1, ''); } - else - { + else { print $langs->trans("ThisUserIsNot"); } if (!empty($object->contactid)) @@ -1855,8 +1824,7 @@ else $adh->ref = $adh->getFullname($langs); // Force to show login instead of id print $adh->getNomUrl(1); } - else - { + else { print $langs->trans("UserNotLinkedToMember"); } print ''; @@ -1894,8 +1862,7 @@ else $langs->load("mails"); print ''; } - else - { + else { $langs->load("mails"); print ''; } @@ -1907,8 +1874,7 @@ else { print ''; } - else - { + else { print ''; } } @@ -1955,8 +1921,7 @@ else { print ''; } - else - { + else { if ($user->id == $id) { print ''; @@ -1970,8 +1935,7 @@ else { print ''; } - else - { + else { print ''; } } @@ -2055,8 +2019,7 @@ else { print $group->getNomUrl(1); } - else - { + else { print img_object($langs->trans("ShowGroup"), "group").' '.$group->name; } print ''; @@ -2067,15 +2030,13 @@ else print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; } - else - { + else { print " "; } print "\n"; } } - else - { + else { print ''.$langs->trans("None").''; } @@ -2123,8 +2084,7 @@ else { print ''; } - else - { + else { print ''; print $object->lastname; } @@ -2138,8 +2098,7 @@ else { print ''; } - else - { + else { print ''; print $object->firstname; } @@ -2152,8 +2111,7 @@ else { print ''; } - else - { + else { print ''; print $object->login; } @@ -2178,8 +2136,7 @@ else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } - else - { + else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); } } @@ -2214,8 +2171,7 @@ else print ' ('.$langs->trans("ExternalUser").')'; print ''; } - else - { + else { print ''; $nbAdmin = $user->getNbOfUsers('active', '', 1); $nbSuperAdmin = $user->getNbOfUsers('active', 'superadmin', 1); @@ -2276,8 +2232,7 @@ else print ' '.$langs->trans("SuperAdministrator"); } } - else - { + else { $yn = yn($object->admin); print ''; print ''; @@ -2298,8 +2253,7 @@ else print $form->textwithpicto($type, $langs->trans("InternalExternalDesc")); if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')'; } - else - { + else { // Select mode $type = 0; if ($object->contactid) $type = $object->contactid; @@ -2351,8 +2305,7 @@ else { print $form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print ''; $huser = new User($db); $huser->fetch($object->fk_user); @@ -2371,8 +2324,7 @@ else { print $form->select_dolusers($object->fk_user_expense_validator, 'fk_user_expense_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print ''; $evuser = new User($db); $evuser->fetch($object->fk_user_expense_validator); @@ -2391,8 +2343,7 @@ else { print $form->select_dolusers($object->fk_user_holiday_validator, 'fk_user_holiday_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print ''; $hvuser = new User($db); $hvuser->fetch($object->fk_user_holiday_validator); @@ -2461,8 +2412,7 @@ else { print ''; } - else - { + else { print ''; print $object->office_phone; } @@ -2475,8 +2425,7 @@ else { print ''; } - else - { + else { print ''; print $object->user_mobile; } @@ -2489,8 +2438,7 @@ else { print ''; } - else - { + else { print ''; print $object->office_fax; } @@ -2503,8 +2451,7 @@ else { print ''; } - else - { + else { print ''; print $object->email; } @@ -2538,8 +2485,7 @@ else { print ''; } - else - { + else { print ''; print $object->openid; } @@ -2558,8 +2504,7 @@ else { print ''; } - else - { + else { print ''; print $object->accountancy_code; } @@ -2632,8 +2577,7 @@ else print ' / '.img_object($langs->trans("ShowContact"), 'contact').' '.dol_trunc($contact->getFullName($langs), 32).''; } } - else - { + else { print $langs->trans("ThisUserIsNot"); } print ' ('.$langs->trans("UseTypeFieldToChange").')'; @@ -2654,8 +2598,7 @@ else $adh->ref = $adh->login; // Force to show login instead of id print $adh->getNomUrl(1); } - else - { + else { print $langs->trans("UserNotLinkedToMember"); } print ''; @@ -2675,8 +2618,7 @@ else print "".$mc->select_entities($object->entity, 'entity', '', 0, 1, false, false, 1); // last parameter 1 means, show also a choice 0=>'all entities' print "\n"; } - else - { + else { print ''; } } @@ -2705,8 +2647,7 @@ else $doleditor = new DolEditor('signature', $object->signature, '', 138, 'dolibarr_notes', 'In', false, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); print $doleditor->Create(1); } - else - { + else { print dol_htmlentitiesbr($object->signature); } print ''; @@ -2733,8 +2674,7 @@ else { print ''; } - else - { + else { print ''; print $object->job; } diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 46022d066f3..54681974e04 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -289,8 +289,7 @@ class Users extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->useraccount->error); } } @@ -364,8 +363,7 @@ class Users extends DolibarrApi { $entity = (!empty($entity) ? $entity : $conf->entity); } - else - { + else { // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to // hack the security by giving himself permissions on another entity. $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 11d0cec3654..a4daebe3b9a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -295,17 +295,15 @@ class User extends CommonObject { $sql .= " WHERE u.entity IN (0,".$conf->entity.")"; } - else - { + else { $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database } } - else // The fetch was forced on an entity + else // The fetch was forced on an entity { if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database - else - $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : $conf->entity).")"; // search in entity provided in parameter + else $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : $conf->entity).")"; // search in entity provided in parameter } if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba @@ -320,8 +318,7 @@ class User extends CommonObject { $sql .= " AND u.email = '".$this->db->escape($email)."'"; } - else - { + else { $sql .= " AND u.rowid = ".$id; } $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities @@ -420,8 +417,7 @@ class User extends CommonObject $this->db->free($result); } - else - { + else { $this->error = "USERNOTFOUND"; dol_syslog(get_class($this)."::fetch user not found", LOG_DEBUG); @@ -429,8 +425,7 @@ class User extends CommonObject return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -457,8 +452,7 @@ class User extends CommonObject } $this->db->free($resql); } - else - { + else { $this->error = $this->db->lasterror(); return -2; } @@ -525,8 +519,7 @@ class User extends CommonObject return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -592,8 +585,7 @@ class User extends CommonObject { $whereforadd = 'allmodules'; } - else - { + else { $whereforadd = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -629,8 +621,7 @@ class User extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -713,8 +704,7 @@ class User extends CommonObject { $wherefordel = 'allmodules'; } - else - { + else { $wherefordel = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -750,8 +740,7 @@ class User extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -833,8 +822,7 @@ class User extends CommonObject { $sql .= " AND r.entity IN (0,".(!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "").$conf->entity.")"; } - else - { + else { $sql .= " AND ur.entity = ".$conf->entity; } $sql .= " AND ur.fk_user= ".$this->id; @@ -866,8 +854,7 @@ class User extends CommonObject if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } - else - { + else { if (empty($this->rights->$module->$perms)) $this->nb_rights++; $this->rights->$module->$perms = 1; } @@ -892,8 +879,7 @@ class User extends CommonObject $sql .= " AND r.entity = ".$conf->entity; } } - else - { + else { $sql .= " AND gr.entity = ".$conf->entity; $sql .= " AND gu.entity = ".$conf->entity; $sql .= " AND r.entity = ".$conf->entity; @@ -926,8 +912,7 @@ class User extends CommonObject if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } - else - { + else { if (empty($this->rights->$module->$perms)) $this->nb_rights++; // if we have already define a subperm like this $this->rights->$module->level1->level2 with llx_user_rights, we don't want override level1 because the level2 can be not define on user group if (!is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = 1; @@ -948,8 +933,7 @@ class User extends CommonObject // que les droits sont en cache (car tous charges) pour cet instance de user $this->all_permissions_are_loaded = 1; } - else - { + else { // If module defined, we flag it as loaded into cache $this->_tab_loaded[$moduletag] = 1; } @@ -993,8 +977,7 @@ class User extends CommonObject $this->db->rollback(); return -$error; } - else - { + else { $this->db->commit(); return 1; } @@ -1133,8 +1116,7 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1200,8 +1182,7 @@ class User extends CommonObject $this->db->rollback(); return -6; } - else - { + else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid,entity)"; $sql .= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->db->escape($this->ldap_sid)."',".$this->db->escape($this->entity).")"; $result = $this->db->query($sql); @@ -1253,24 +1234,21 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { //$this->error=$interface->error; dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1339,16 +1317,14 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { // $this->error deja positionne dol_syslog(get_class($this)."::create_from_contact - 0"); @@ -1424,8 +1400,7 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -1439,8 +1414,7 @@ class User extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { // $this->error deja positionne $this->db->rollback(); return -2; @@ -1752,8 +1726,7 @@ class User extends CommonObject $error++; } } - else - { + else { $this->error = $tmpobj->error; $this->errors = $tmpobj->errors; $error++; @@ -1786,15 +1759,13 @@ class User extends CommonObject $this->db->commit(); return $nbrowsaffected; } - else - { + else { dol_syslog(get_class($this)."::update error=".$this->error, LOG_ERR); $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -1827,8 +1798,7 @@ class User extends CommonObject $this->datelastlogin = $now; return 1; } - else - { + else { $this->error = $this->db->lasterror().' sql='.$sql; return -1; } @@ -1877,8 +1847,7 @@ class User extends CommonObject { $sql .= ", pass = null"; } - else - { + else { $sql .= ", pass = '".$this->db->escape($password)."'"; } $sql .= " WHERE rowid = ".$this->id; @@ -1912,8 +1881,7 @@ class User extends CommonObject $error++; } } - else - { + else { $this->error = $adh->error; $error++; } @@ -1932,21 +1900,18 @@ class User extends CommonObject $this->db->commit(); return $this->pass; } - else - { + else { $this->db->rollback(); return 0; } } - else - { + else { $this->db->rollback(); dol_print_error($this->db); return -1; } } - else - { + else { // We store clear password in password temporary field. // After receiving confirmation link, we will crypt it and store it in pass_crypted $sql = "UPDATE ".MAIN_DB_PREFIX."user"; @@ -1959,8 +1924,7 @@ class User extends CommonObject { return $password; } - else - { + else { dol_print_error($this->db); return -3; } @@ -2001,8 +1965,7 @@ class User extends CommonObject if ($this->conf->MAIN_LANG_DEFAULT) { $outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT); } - else - { // If user has not defined its own language, we used current language + else { // If user has not defined its own language, we used current language $outputlangs = $langs; } @@ -2033,8 +1996,7 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); } - else - { + else { $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.urlencode($this->login)."&passwordhash=".dol_hash($password); $mesg .= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n"; @@ -2072,8 +2034,7 @@ class User extends CommonObject { return 1; } - else - { + else { $langs->trans("errors"); $this->error = $langs->trans("ErrorFailedToSendPassword").' '.$mailfile->error; return -1; @@ -2122,8 +2083,7 @@ class User extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2161,8 +2121,7 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -2217,15 +2176,13 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::SetInGroup ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -2274,15 +2231,13 @@ class User extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::RemoveFromGroup ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -2774,8 +2729,7 @@ class User extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2802,8 +2756,7 @@ class User extends CommonObject $this->db->free($resql); return $nb; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2828,8 +2781,7 @@ class User extends CommonObject $sql .= " WHERE entity = 0"; if ($admin >= 0) $sql .= " AND admin = ".$admin; } - else - { + else { $sql .= " WHERE entity IN (".getEntity('user', 0).")"; if ($limitTo == 'active') $sql .= " AND statut = 1"; if ($admin >= 0) $sql .= " AND admin = ".$admin; @@ -2844,8 +2796,7 @@ class User extends CommonObject $this->db->free($resql); return $nb; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2917,8 +2868,7 @@ class User extends CommonObject } return $users; } - else - { + else { dol_print_error($this->db); return -1; } @@ -2952,8 +2902,7 @@ class User extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -3023,8 +2972,7 @@ class User extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -3083,8 +3031,7 @@ class User extends CommonObject { $childids = $this->cache_childids[$this->id]; } - else - { + else { // Init this->users $this->get_full_tree(); @@ -3196,8 +3143,7 @@ class User extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -3228,8 +3174,7 @@ class User extends CommonObject { $modele = $conf->global->USER_ADDON_PDF; } - else - { + else { $modele = 'bluesky'; } } @@ -3272,8 +3217,7 @@ class User extends CommonObject } return $user_property; } - else - { + else { dol_print_error($this->db); } } @@ -3310,13 +3254,11 @@ class User extends CommonObject $sql .= " OR t.entity = 0)"; // Show always superadmin } } - else - { + else { $sql .= " WHERE t.entity IN (".getEntity('user').")"; } } - else - { + else { $sql .= " WHERE 1"; } @@ -3365,8 +3307,7 @@ class User extends CommonObject } return $num; } - else - { + else { $this->errors[] = $this->db->lasterror(); return -1; } diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 79df9d287ec..02a046a60ad 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -105,8 +105,7 @@ class UserBankAccount extends Account return $this->update($user); } } - else - { + else { print $this->db->error(); return 0; } @@ -142,8 +141,7 @@ class UserBankAccount extends Account if (trim($this->label) != '') $sql .= ",label = '".$this->db->escape($this->label)."'"; - else - $sql .= ",label = NULL"; + else $sql .= ",label = NULL"; $sql .= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); @@ -151,8 +149,7 @@ class UserBankAccount extends Account { return 1; } - else - { + else { dol_print_error($this->db); return 0; } @@ -204,8 +201,7 @@ class UserBankAccount extends Account return 1; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index bc5396e9f51..f56358963c9 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -155,8 +155,7 @@ class UserGroup extends CommonObject { $result = $this->fetchCommon(0, '', ' AND nom = \''.$this->db->escape($groupname).'\''); } - else - { + else { $result = $this->fetchCommon($id); } @@ -171,8 +170,7 @@ class UserGroup extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -201,8 +199,7 @@ class UserGroup extends CommonObject { $sql .= " AND g.entity IS NOT NULL"; } - else - { + else { $sql .= " AND g.entity IN (0,".$conf->entity.")"; } $sql .= " ORDER BY g.nom"; @@ -227,8 +224,7 @@ class UserGroup extends CommonObject return $ret; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -258,8 +254,7 @@ class UserGroup extends CommonObject { $sql .= " AND u.entity IS NOT NULL"; } - else - { + else { $sql .= " AND u.entity IN (0,".$conf->entity.")"; } if (!empty($excludefilter)) $sql .= ' AND ('.$excludefilter.')'; @@ -290,8 +285,7 @@ class UserGroup extends CommonObject return $ret; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -357,8 +351,7 @@ class UserGroup extends CommonObject { $whereforadd = 'allmodules'; } - else - { + else { $whereforadd = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -394,8 +387,7 @@ class UserGroup extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -481,8 +473,7 @@ class UserGroup extends CommonObject { $wherefordel = 'allmodules'; } - else - { + else { $wherefordel = "module='".$this->db->escape($allmodule)."'"; if (!empty($allperms)) $whereforadd .= " AND perms='".$this->db->escape($allperms)."'"; } @@ -518,8 +509,7 @@ class UserGroup extends CommonObject $i++; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -605,8 +595,7 @@ class UserGroup extends CommonObject if (empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } - else - { + else { if (empty($this->rights->$module->$perms)) $this->nb_rights++; $this->rights->$module->$perms = 1; } @@ -623,8 +612,7 @@ class UserGroup extends CommonObject // que les droits sont en cache (car tous charges) pour cet instance de group $this->all_permissions_are_loaded = 1; } - else - { + else { // If module defined, we flag it as loaded into cache $this->_tab_loaded[$moduletag] = 1; } @@ -902,8 +890,7 @@ class UserGroup extends CommonObject { $modele = $conf->global->USERGROUP_ADDON_PDF; } - else - { + else { $modele = 'grass'; } } diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index c81e4068558..302e0729bb8 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -122,8 +122,7 @@ if ($id > 0) $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } - else - { + else { print '     '.$form->textwithpicto($langs->trans("KeepEmptyToUseDefault").': '.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc")); } print ''; @@ -147,7 +146,7 @@ if ($id > 0) print ''; } - else // View mode + else // View mode { print ''; @@ -162,8 +161,7 @@ if ($id > 0) $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } - else - { + else { print $form->textwithpicto((empty($object->clicktodial_url) ? $langs->trans("DefaultLink").': ' : '').$url, $langs->trans("ClickToDialUrlDesc")); } print ''; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 2b8c67d7ae6..912675dd636 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -172,8 +172,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 1); } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 1cd3b3edc37..524fc25b51a 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -115,8 +115,7 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT."/user/group/list.php?restore_lastsearch_values=1"); exit; } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } @@ -153,8 +152,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { $db->rollback(); $langs->load("errors"); @@ -163,8 +161,7 @@ if (empty($reshook)) { } } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } @@ -190,14 +187,12 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($edituser->error, $edituser->errors, 'errors'); } } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'errors'); } @@ -232,14 +227,12 @@ if (empty($reshook)) { setEventMessages($langs->trans("GroupModified"), null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorForbidden'), null, 'mesgs'); } @@ -287,8 +280,7 @@ if ($action == 'create') print "\n"; } - else - { + else { print ''; } } @@ -318,8 +310,7 @@ if ($action == 'create') /* Visu et edition */ /* */ /* ************************************************************************** */ -else -{ +else { if ($id) { $res = $object->fetch_optionals(); @@ -488,15 +479,13 @@ else print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; } - else - { + else { print "-"; } print "\n"; } } - else - { + else { print ''; } print "
".$mc->select_entities($conf->entity); print "
'.$langs->trans("None").'
"; @@ -557,8 +546,7 @@ else print "".$mc->select_entities($object->entity); print "\n"; } - else - { + else { print ''; } } diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index 5462167b4af..b72fc7718f9 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -84,8 +84,7 @@ if ($action == 'dolibarr2ldap') { setEventMessages($langs->trans("GroupSynchronized"), null, 'mesgs'); } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } } @@ -196,20 +195,17 @@ if ($result > 0) { print ''.$langs->trans("ErrorFailedToReadLDAP").''; } - else - { + else { $result = show_ldap_content($records, 0, $records['count'], true); } } - else - { + else { print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')'; } $ldap->unbind(); $ldap->close(); } -else -{ +else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 1701d2ae9c1..48c56a20218 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -117,8 +117,7 @@ if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global { $sql .= " WHERE g.entity IS NOT NULL"; } -else -{ +else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; } if (!empty($search_group)) natural_search(array("g.nom", "g.note"), $search_group); @@ -222,8 +221,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 70030dbf1af..8c8a59fa536 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -189,8 +189,7 @@ if ($object->id > 0) } $db->free($result); } - else - { + else { dol_print_error($db); } @@ -325,8 +324,7 @@ if ($object->id > 0) print img_picto($langs->trans("Active"), 'tick'); print ''; } - else - { + else { // Do not own permission if ($caneditperms) { @@ -335,8 +333,7 @@ if ($object->id > 0) print ' '; } } - else - { + else { // Do not own permission if ($caneditperms) { diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 3a05bb3d640..520821ad84f 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -80,8 +80,7 @@ if (!is_array($user_arbo) && $user_arbo < 0) { setEventMessages($userstatic->error, $userstatic->errors, 'warnings'); } -else -{ +else { // Define fulltree array $fulltree = $user_arbo; //var_dump($fulltree); @@ -113,8 +112,7 @@ else { $entitystring = $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($entity); $entitystring = $mc->label; } @@ -197,8 +195,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''; print ''; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 4c46c502acc..cec26f72dcc 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -170,8 +170,7 @@ if ($resql) { print $companystatic->getNomUrl(1); } - else - { + else { print $langs->trans("InternalUser"); } if ($obj->ldap_sid) @@ -188,8 +187,7 @@ if ($resql) { $entitystring = $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($entity); $entitystring = $mc->label; } @@ -210,8 +208,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -229,8 +226,7 @@ if ($canreadperms) { $sql .= " WHERE g.entity IS NOT NULL"; } - else - { + else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; } $sql .= $db->order("g.datec", "DESC"); @@ -284,8 +280,7 @@ if ($canreadperms) $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 71410eb223a..674ef0f64b6 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -114,8 +114,7 @@ if ($object->ldap_sid) { print ''; } -else -{ +else { print ''; } print ''; @@ -199,21 +198,18 @@ if ($result > 0) { print ''; } - else - { + else { $result = show_ldap_content($records, 0, $records['count'], true); } } - else - { + else { print ''; } $ldap->unbind(); $ldap->close(); } -else -{ +else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ef6e205fd0d..ca2f39b4e9f 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -580,8 +580,7 @@ while ($i < min($num, $limit)) { print $langs->trans("DomainUser"); } - else - { + else { print $langs->trans("InternalUser"); } print ''; @@ -597,8 +596,7 @@ while ($i < min($num, $limit)) { print $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($obj->entity); print $mc->label; } diff --git a/htdocs/user/note.php b/htdocs/user/note.php index ab4df07e193..988b879653f 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -121,8 +121,7 @@ if ($id) $doleditor = new DolEditor('note_private', $object->note_private, '', 280, 'dolibarr_notes', 'In', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); } - else - { + else { print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)); } print ""; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 84fbf2793e3..33dded8a304 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -88,8 +88,7 @@ if ($action == 'add') dol_print_error($db); } } - else - { + else { dol_print_error($db); } @@ -97,8 +96,7 @@ if ($action == 'add') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -152,8 +150,7 @@ if ($result > 0) { print ''; } - else - { + else { print ''; } print ''."\n"; @@ -228,8 +225,7 @@ if ($result > 0) { print ' <'.$object->email.'>'; } - else - { + else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email); } @@ -244,8 +240,7 @@ if ($result > 0) print ''; print ''; } - else - { + else { print ''; @@ -272,8 +267,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -312,8 +306,7 @@ if ($result > 0) { print ' <'.$obj->email.'>'; } - else - { + else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); } @@ -421,8 +414,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -471,8 +463,7 @@ if ($result > 0) print $userstatic->getNomUrl(1); print $obj->email ? ' <'.$obj->email.'>' : $langs->trans("NoMail"); } - else - { + else { print $obj->email; } print ''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index f9ebd310cfa..068ea0047b1 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -325,8 +325,7 @@ if ($action == 'edit') print ''; print ''; } -else -{ +else { dol_fiche_head($head, 'guisetup', $title, -1, 'user'); $linkback = ''.$langs->trans("BackToList").''; @@ -397,14 +396,12 @@ else { print "trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify").""; } - else - { + else { if ($caneditfield || !empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin { print 'id.'">'.$langs->trans("Modify").''; } - else - { + else { print "trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify").""; } } diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 83289521538..43202a01028 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -73,8 +73,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) { $message = '
'.$langs->trans("ErrorLoginDoesNotExists", $username).'
'; } - else - { + else { if (dol_verifyHash($edituser->pass_temp, $passwordhash)) { // Clear session @@ -86,8 +85,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) header("Location: ".DOL_URL_ROOT.'/'); exit; } - else - { + else { $langs->load("errors"); $message = '
'.$langs->trans("ErrorFailedToValidatePasswordReset").'
'; } @@ -104,8 +102,7 @@ if ($action == 'buildnewpassword' && $username) { $message = '
'.$langs->trans("ErrorBadValueForCode").'
'; } - else - { + else { $edituser = new User($db); $result = $edituser->fetch('', $username, '', 1); if ($result == 0 && preg_match('/@/', $username)) @@ -118,30 +115,26 @@ if ($action == 'buildnewpassword' && $username) $message = '
'.$langs->trans("ErrorLoginDoesNotExists", $username).'
'; $username = ''; } - else - { + else { if (!$edituser->email) { $message = '
'.$langs->trans("ErrorLoginHasNoEmail").'
'; } - else - { + else { $newpassword = $edituser->setPassword($user, '', 1); if ($newpassword < 0) { // Failed $message = '
'.$langs->trans("ErrorFailedToChangePassword").'
'; } - else - { + else { // Success if ($edituser->send_password($user, $newpassword, 1) > 0) { $message = ''; $username = ''; } - else - { + else { $message .= '
'.$edituser->error.'
'; } } @@ -166,8 +159,7 @@ if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten { $template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/"; } -else -{ +else { $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/"; } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 5d06973abf6..408900eb406 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -209,8 +209,7 @@ if ($result) } $db->free($result); } -else -{ +else { dol_print_error($db); } @@ -240,8 +239,7 @@ if ($result) } $db->free($result); } -else -{ +else { dol_print_error($db); } @@ -411,8 +409,7 @@ if ($result) print img_picto($langs->trans("Active"), 'tick'); print ''; } - else - { + else { // Do not own permission if ($caneditperms) { @@ -421,8 +418,7 @@ if ($result) print ''; } } - else - { + else { // Do not own permission if ($caneditperms) { diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 15e019dd311..f29cc49f35b 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -106,8 +106,7 @@ if ($_POST) { if (!$features) { setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } - else - { + else { $reference = trim($reference); if (empty($reference)) { $reference = false; @@ -361,8 +360,7 @@ if (!empty($id) || !empty($ref)) { print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); } - else - { + else { print ' '; } print "\n"; @@ -628,8 +626,7 @@ if (!empty($id) || !empty($ref)) print ''; } - else - { + else { if ($action === 'delete') { if ($prodcomb->fetch($valueid) > 0) { $prodstatic->fetch($prodcomb->fk_product_child); @@ -801,8 +798,7 @@ if (!empty($id) || !empty($ref)) print ''; } } - else - { + else { print ''; } print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.'
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')
'.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.'
'; print $langs->trans("YouMustAssignUserMailFirst"); print '
 
'.$langs->trans("None").'
'; diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 55bf1c81f34..567dc902a5a 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -43,8 +43,7 @@ if ($_POST) { { header('Location: '.$backtopage); } - else - { + else { header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$resid.'&backtopage='.urlencode($backtopage)); } exit; diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 819694f5041..cb0940bb61c 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -48,8 +48,7 @@ if ($actionsave) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 39ed3b3cdf5..10ef9cfbd7e 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -328,14 +328,12 @@ function getActionComm($authentication, $id) 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'actioncomm'=>$actioncomm_result_fields); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -389,14 +387,12 @@ function getListActionCommType($authentication) 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'actioncommtypes'=>$resultarray); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -482,8 +478,7 @@ function createActionComm($authentication, $actioncomm) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index de1fb73d3c0..d7382447749 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -262,14 +262,12 @@ function getCategory($authentication, $id) 'categorie'=> $cat ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 804cb3f7db1..023cdc1c4ac 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -333,14 +333,12 @@ function getContact($authentication, $id, $ref_ext) 'contact'=>$contact_result_fields ); } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref_ext='.$ref_ext; } @@ -451,8 +449,7 @@ function createContact($authentication, $contact) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -584,8 +581,7 @@ function getContactsForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 46590688f88..8b15ade0a6a 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -370,14 +370,12 @@ function getInvoice($authentication, $id = '', $ref = '', $ref_ext = '') 'lines' => $linesresp )); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -511,8 +509,7 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } @@ -627,8 +624,7 @@ function createInvoice($authentication, $invoice) $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$new_invoice->id, 'ref'=>$new_invoice->ref, 'ref_ext'=>$new_invoice->ref_ext); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -707,14 +703,12 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '' } } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id_order.' nor ref='.$ref_order.' nor ref_ext='.$ref_ext_order; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -724,8 +718,7 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '' { $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); } - else - { + else { $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref, 'ref_ext'=>$newobject->ref_ext); } diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 0b22ea9aab6..7018f5fb5c8 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -473,15 +473,13 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') )); } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; @@ -640,8 +638,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } @@ -786,8 +783,7 @@ function createOrder($authentication, $order) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { dol_syslog("Webservice server_order:: order creation or validation failed, rollback", LOG_ERR); $db->rollback(); $error++; @@ -848,24 +844,21 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $outputlangs = $langs; $order->generateDocument($order->modelpdf, $outputlangs); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; $errorlabel = $order->error; } } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; $errorlabel = $order->error; } } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -877,8 +870,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) { $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); } - else - { + else { $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'')); } diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 4ae702ade15..71ee78d3c4d 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -304,8 +304,7 @@ function getDocument($authentication, $modulepart, $file, $refname = '') 'document'=>$objectret ); } - else - { + else { dol_syslog("File doesn't exist ".$original_file); $errorcode = 'NOT_FOUND'; $errorlabel = ''; diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index 38dab505bac..5145c4a3b7b 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.php @@ -197,8 +197,7 @@ function createPayment($authentication, $payment) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$new_payment->id); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index a98d8b2a6cd..68563bfab38 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -450,14 +450,12 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = '' 'product'=>$productorservice_result_fields ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -613,8 +611,7 @@ function createProductOrService($authentication, $product) $newobject->error = 'You set a different value for stock, but correction of stock count (before='.$getstockreal.', after='.$savstockreal.') fails with error '.$newobject->error; } } - else - { + else { $error++; $newobject->error = 'You set a different value for stock but we failed to find warehouse '.$product['warehouse_ref'].' to make correction.'; } @@ -627,8 +624,7 @@ function createProductOrService($authentication, $product) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -754,8 +750,7 @@ function updateProductOrService($authentication, $product) { $error++; } - else - { + else { // Update stock if stock count is provided and differs from database after creation or update if (isset($product['stock_real']) && $product['stock_real'] != '' && !empty($conf->global->stock->enabled)) { @@ -785,8 +780,7 @@ function updateProductOrService($authentication, $product) $newobject->error = 'You set a different value for stock, but correction of stock count (before='.$getstockreal.', after='.$savstockreal.') fails with error '.$newobject->error; } } - else - { + else { $error++; $newobject->error = 'You set a different value for stock but we failed to find warehouse '.$product['warehouse_ref'].' to make correction.'; } @@ -819,8 +813,7 @@ function updateProductOrService($authentication, $product) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -890,8 +883,7 @@ function deleteProductOrService($authentication, $listofidstring) $firsterror = 'Product or service with id '.$id.' not found'; break; } - else - { + else { $result = $newobject->delete($user); if ($result <= 0) { @@ -910,8 +902,7 @@ function deleteProductOrService($authentication, $listofidstring) //$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'listofid'=>$listofiddeleted); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'nbdeleted'=>count($listofiddeleted)); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -983,8 +974,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) $i++; } } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); @@ -998,8 +988,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) 'products'=>$arrayproducts ); } - else - { + else { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), 'products'=>$arrayproducts @@ -1139,21 +1128,18 @@ function getProductsForCategory($authentication, $id, $lang = '') 'products'=> $products ); } - else - { + else { $errorcode = 'NORECORDS_FOR_ASSOCIATION'; $errorlabel = 'No products associated'.$sql; $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); dol_syslog("getProductsForCategory:: ".$errorcode, LOG_DEBUG); } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 5bbaaaf035a..dc8fc81db2c 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -298,8 +298,7 @@ function createProject($authentication, $project) $error++; } } - else - { + else { $error++; } @@ -308,16 +307,14 @@ function createProject($authentication, $project) $db->commit(); $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; $errorlabel = $newobject->error; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -424,14 +421,12 @@ function getProject($authentication, $id = '', $ref = '') 'project'=>$project_result_fields ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 78a00ced40e..ecf2c51fd1f 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -303,14 +303,12 @@ function getSupplierInvoice($authentication, $id = '', $ref = '', $ref_ext = '') )); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -441,8 +439,7 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) ); } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); } diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index d69b481323e..1e9f8355d52 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -378,14 +378,12 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'thirdparty'=>$thirdparty_result_fields); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -515,8 +513,7 @@ function createThirdParty($authentication, $thirdparty) $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -750,8 +747,7 @@ function getListOfThirdParties($authentication, $filterthirdparty) $i++; } } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); @@ -765,8 +761,7 @@ function getListOfThirdParties($authentication, $filterthirdparty) 'thirdparties'=>$arraythirdparties ); } - else - { + else { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), 'thirdparties'=>$arraythirdparties @@ -828,8 +823,7 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'')); } - else - { + else { $db->rollback(); $error++; $errorcode = 'KO'; @@ -837,14 +831,12 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') dol_syslog("Function: deleteThirdParty cant delete"); } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 8793d2f02fa..c37e920f61d 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -372,14 +372,12 @@ function getUser($authentication, $id, $ref = '', $ref_ext = '') ) ); } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -426,8 +424,7 @@ function getListOfGroups($authentication) { $sql .= " WHERE g.entity IS NOT NULL"; } - else - { + else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; } $sql .= " GROUP BY g.rowid, g.nom, g.entity, g.datec"; @@ -444,8 +441,7 @@ function getListOfGroups($authentication) $i++; } } - else - { + else { $error++; $errorcode = $db->lasterrno(); $errorlabel = $db->lasterror(); @@ -459,8 +455,7 @@ function getListOfGroups($authentication) 'groups'=>$arraygroups ); } - else - { + else { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), 'groups'=>$arraygroups @@ -526,8 +521,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) $error++; $errorcode = 'ALREADY_EXIST'; $errorlabel = 'Object not create : company or contact exists '.$thirdpartywithuser['email']; } - else - { + else { $db->begin(); /* * Company creation @@ -633,14 +627,12 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) if ($thirdpartywithuser['group_id'] > 0) $edituser->SetInGroup($thirdpartywithuser['group_id'], $conf->entity); } - else - { + else { $error++; $errorcode = 'NOT_CREATE'; $errorlabel = 'Object not create : '.$edituser->error; } } - else - { + else { $error++; $errorcode = 'NOT_CREATE'; $errorlabel = 'Object not create : '.$contact->error; } @@ -651,22 +643,19 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) $error = 0; } } - else - { + else { $error++; $errors = ($thirdparty->error ? array($thirdparty->error) : $thirdparty->errors); } } } - else - { + else { // retour creation KO $error++; $errorcode = 'NOT_CREATE'; $errorlabel = 'Object not create'; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } @@ -732,20 +721,17 @@ function setUserPassword($authentication, $shortuser) 'groups'=>$arraygroups ); } - else - { + else { $error++; $errorcode = 'NOT_MODIFIED'; $errorlabel = 'Error when changing password'; } } - else - { + else { $error++; $errorcode = 'NOT_FOUND'; $errorlabel = 'User not found'; } } - else - { + else { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; } From f5688b2eecf8a56effd263936ac1ac8bf0dbdf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 01:52:25 +0200 Subject: [PATCH 327/490] add new rule --- htdocs/compta/accounting-files.php | 12 +- htdocs/compta/ajaxpayment.php | 6 +- htdocs/compta/bank/annuel.php | 27 +-- htdocs/compta/bank/bankentries_list.php | 71 ++---- htdocs/compta/bank/budget.php | 3 +- htdocs/compta/bank/card.php | 30 +-- htdocs/compta/bank/categ.php | 3 +- htdocs/compta/bank/class/account.class.php | 72 ++---- .../bank/class/api_bankaccounts.class.php | 9 +- .../bank/class/paymentvarious.class.php | 24 +- htdocs/compta/bank/graph.php | 54 ++--- htdocs/compta/bank/line.php | 51 ++--- htdocs/compta/bank/list.php | 6 +- htdocs/compta/bank/releve.php | 24 +- htdocs/compta/bank/transfer.php | 9 +- htdocs/compta/bank/treso.php | 9 +- htdocs/compta/bank/various_payment/card.php | 21 +- .../compta/bank/various_payment/document.php | 3 +- htdocs/compta/bank/various_payment/list.php | 6 +- .../compta/cashcontrol/cashcontrol_card.php | 24 +- .../compta/cashcontrol/cashcontrol_list.php | 3 +- htdocs/compta/cashcontrol/report.php | 6 +- htdocs/compta/charges/index.php | 18 +- htdocs/compta/clients.php | 3 +- htdocs/compta/deplacement/card.php | 45 ++-- .../deplacement/class/deplacement.class.php | 21 +- htdocs/compta/deplacement/document.php | 3 +- htdocs/compta/deplacement/index.php | 3 +- htdocs/compta/deplacement/list.php | 3 +- htdocs/compta/deplacement/stats/index.php | 3 +- htdocs/compta/facture/card-rec.php | 99 +++----- htdocs/compta/facture/card.php | 131 ++++------- .../facture/class/api_invoices.class.php | 9 +- .../facture/class/facture-rec.class.php | 97 +++----- htdocs/compta/facture/class/facture.class.php | 214 ++++++------------ .../facture/class/paymentterm.class.php | 18 +- htdocs/compta/facture/contact.php | 12 +- htdocs/compta/facture/document.php | 6 +- .../compta/facture/invoicetemplate_list.php | 15 +- htdocs/compta/facture/list.php | 21 +- htdocs/compta/facture/prelevement.php | 48 ++-- htdocs/compta/facture/stats/index.php | 9 +- .../facture/tpl/linkedobjectblock.tpl.php | 3 +- htdocs/compta/index.php | 48 ++-- htdocs/compta/journal/purchasesjournal.php | 5 +- htdocs/compta/journal/sellsjournal.php | 5 +- htdocs/compta/localtax/card.php | 15 +- .../compta/localtax/class/localtax.class.php | 45 ++-- htdocs/compta/localtax/clients.php | 24 +- htdocs/compta/localtax/index.php | 12 +- htdocs/compta/localtax/list.php | 3 +- htdocs/compta/localtax/quadri_detail.php | 21 +- htdocs/compta/paiement.php | 21 +- htdocs/compta/paiement/card.php | 24 +- htdocs/compta/paiement/cheque/card.php | 60 ++--- .../cheque/class/remisecheque.class.php | 75 ++---- htdocs/compta/paiement/cheque/index.php | 6 +- htdocs/compta/paiement/cheque/list.php | 6 +- .../compta/paiement/class/paiement.class.php | 69 ++---- htdocs/compta/paiement/list.php | 8 +- htdocs/compta/paiement/rapport.php | 3 +- htdocs/compta/paiement/tovalidate.php | 3 +- htdocs/compta/paiement_charge.php | 9 +- htdocs/compta/payment_sc/card.php | 9 +- htdocs/compta/paymentbybanktransfer/index.php | 9 +- htdocs/compta/prelevement/bons.php | 3 +- htdocs/compta/prelevement/card.php | 6 +- .../class/bonprelevement.class.php | 123 ++++------ .../class/ligneprelevement.class.php | 6 +- .../class/rejetprelevement.class.php | 27 +-- htdocs/compta/prelevement/create.php | 18 +- htdocs/compta/prelevement/demandes.php | 6 +- htdocs/compta/prelevement/factures.php | 6 +- htdocs/compta/prelevement/fiche-rejet.php | 9 +- htdocs/compta/prelevement/fiche-stat.php | 6 +- htdocs/compta/prelevement/index.php | 9 +- htdocs/compta/prelevement/line.php | 24 +- htdocs/compta/prelevement/list.php | 3 +- htdocs/compta/prelevement/rejets.php | 3 +- htdocs/compta/prelevement/stats.php | 6 +- htdocs/compta/recap-compta.php | 9 +- htdocs/compta/resultat/clientfourn.php | 53 ++--- htdocs/compta/resultat/index.php | 26 +-- htdocs/compta/resultat/result.php | 4 +- htdocs/compta/sociales/card.php | 30 +-- .../sociales/class/chargesociales.class.php | 27 +-- .../class/paymentsocialcontribution.class.php | 27 +-- htdocs/compta/sociales/document.php | 3 +- htdocs/compta/sociales/list.php | 12 +- htdocs/compta/sociales/payments.php | 18 +- htdocs/compta/stats/byratecountry.php | 3 +- htdocs/compta/stats/cabyprodserv.php | 3 +- htdocs/compta/stats/cabyuser.php | 5 +- htdocs/compta/stats/casoc.php | 5 +- htdocs/compta/stats/index.php | 23 +- htdocs/compta/stats/supplier_turnover.php | 18 +- .../stats/supplier_turnover_by_prodserv.php | 3 +- .../stats/supplier_turnover_by_thirdparty.php | 3 +- htdocs/compta/tva/card.php | 18 +- htdocs/compta/tva/class/tva.class.php | 51 ++--- htdocs/compta/tva/clients.php | 12 +- htdocs/compta/tva/document.php | 3 +- htdocs/compta/tva/index.php | 12 +- htdocs/compta/tva/list.php | 9 +- htdocs/compta/tva/quadri_detail.php | 18 +- htdocs/contact/agenda.php | 6 +- .../actions_contactcard_common.class.php | 9 +- .../actions_contactcard_default.class.php | 3 +- htdocs/contact/card.php | 69 ++---- htdocs/contact/class/contact.class.php | 60 ++--- htdocs/contact/consumption.php | 12 +- htdocs/contact/ldap.php | 15 +- htdocs/contact/list.php | 9 +- htdocs/contact/perso.php | 24 +- htdocs/contact/vcard.php | 3 +- htdocs/contrat/agenda.php | 3 +- htdocs/contrat/card.php | 102 +++------ htdocs/contrat/class/api_contracts.class.php | 6 +- htdocs/contrat/class/contrat.class.php | 113 ++++----- htdocs/contrat/contact.php | 6 +- htdocs/contrat/document.php | 3 +- htdocs/contrat/index.php | 33 +-- htdocs/contrat/list.php | 3 +- htdocs/contrat/services_list.php | 12 +- htdocs/cron/admin/cron.php | 6 +- htdocs/cron/card.php | 33 +-- htdocs/cron/class/cronjob.class.php | 42 ++-- htdocs/cron/list.php | 15 +- htdocs/dav/dav.class.php | 30 +-- htdocs/dav/dav.lib.php | 6 +- .../class/DataCollector/DolLogsCollector.php | 3 +- htdocs/ecm/ajax/ecmdatabase.php | 9 +- htdocs/ecm/class/ecmdirectory.class.php | 48 ++-- htdocs/ecm/class/ecmfiles.class.php | 6 +- htdocs/ecm/class/htmlecm.form.class.php | 6 +- htdocs/ecm/dir_add_card.php | 16 +- htdocs/ecm/dir_card.php | 46 ++-- htdocs/ecm/file_card.php | 27 +-- htdocs/ecm/index.php | 15 +- htdocs/ecm/index_auto.php | 15 +- .../class/emailcollector.class.php | 72 ++---- .../class/emailcollectoraction.class.php | 3 +- .../class/emailcollectorfilter.class.php | 3 +- htdocs/expedition/card.php | 150 ++++-------- .../expedition/class/api_shipments.class.php | 6 +- htdocs/expedition/class/expedition.class.php | 174 +++++--------- .../class/expeditionbatch.class.php | 12 +- htdocs/expedition/contact.php | 3 +- htdocs/expedition/index.php | 3 +- htdocs/expedition/list.php | 6 +- htdocs/expedition/shipment.php | 33 +-- htdocs/expedition/stats/index.php | 3 +- htdocs/expensereport/ajax/ajaxik.php | 12 +- htdocs/expensereport/ajax/ajaxprojet.php | 6 +- htdocs/expensereport/card.php | 159 +++++-------- .../class/api_expensereports.class.php | 3 +- .../class/expensereport.class.php | 192 ++++++---------- .../class/expensereport_ik.class.php | 12 +- .../class/expensereport_rule.class.php | 9 +- .../class/paymentexpensereport.class.php | 30 +-- htdocs/expensereport/document.php | 3 +- htdocs/expensereport/index.php | 3 +- htdocs/expensereport/list.php | 18 +- htdocs/expensereport/payment/card.php | 12 +- htdocs/expensereport/payment/payment.php | 6 +- htdocs/expensereport/stats/index.php | 3 +- .../tpl/expensereport_linktofile.tpl.php | 6 +- htdocs/fichinter/card-rec.php | 21 +- htdocs/fichinter/card.php | 72 ++---- htdocs/fichinter/class/fichinter.class.php | 87 +++---- htdocs/fichinter/contact.php | 3 +- htdocs/fichinter/document.php | 3 +- htdocs/fichinter/index.php | 3 +- htdocs/fichinter/list.php | 3 +- htdocs/fichinter/stats/index.php | 9 +- htdocs/fourn/card.php | 36 +-- .../class/api_supplier_invoices.class.php | 3 +- htdocs/fourn/class/fournisseur.class.php | 12 +- .../class/fournisseur.commande.class.php | 210 ++++++----------- .../fournisseur.commande.dispatch.class.php | 15 +- .../fourn/class/fournisseur.facture.class.php | 133 ++++------- .../fourn/class/fournisseur.product.class.php | 44 ++-- htdocs/fourn/class/paiementfourn.class.php | 48 ++-- htdocs/fourn/commande/card.php | 144 ++++-------- htdocs/fourn/commande/contact.php | 12 +- htdocs/fourn/commande/dispatch.php | 24 +- htdocs/fourn/commande/document.php | 3 +- htdocs/fourn/commande/index.php | 9 +- htdocs/fourn/commande/info.php | 6 +- htdocs/fourn/commande/list.php | 18 +- htdocs/fourn/commande/note.php | 3 +- htdocs/fourn/commande/orderstoinvoice.php | 6 +- htdocs/fourn/contact.php | 3 +- htdocs/fourn/facture/card.php | 131 ++++------- htdocs/fourn/facture/contact.php | 12 +- htdocs/fourn/facture/document.php | 3 +- htdocs/fourn/facture/impayees.php | 3 +- htdocs/fourn/facture/list.php | 6 +- htdocs/fourn/facture/paiement.php | 27 +-- htdocs/fourn/facture/rapport.php | 3 +- .../facture/tpl/linkedobjectblock.tpl.php | 3 +- htdocs/fourn/index.php | 9 +- htdocs/fourn/paiement/card.php | 24 +- htdocs/fourn/product/list.php | 3 +- htdocs/fourn/recap-fourn.php | 9 +- htdocs/ftp/admin/ftpclient.php | 15 +- htdocs/ftp/index.php | 71 ++---- htdocs/holiday/card.php | 78 +++---- htdocs/holiday/class/holiday.class.php | 108 +++------ htdocs/holiday/define_holiday.php | 12 +- htdocs/holiday/document.php | 12 +- htdocs/holiday/list.php | 9 +- htdocs/holiday/month_report.php | 3 +- htdocs/imports/class/import.class.php | 12 +- htdocs/imports/import.php | 71 ++---- 215 files changed, 1910 insertions(+), 3784 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index faf2feeb7a0..b14e3adafad 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -335,8 +335,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; } - else - { + else { foreach ($files as $key => $file) { $file['id'] = $objd->id; @@ -384,8 +383,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $i++; } } - else - { + else { dol_print_error($db); } @@ -492,8 +490,7 @@ if ($result && $action == "dl" && !$error) exit(); } - else - { + else { setEventMessages($langs->trans("FailedToOpenFile", $zipname), null, 'errors'); } } @@ -626,8 +623,7 @@ if (!empty($date_start) && !empty($date_stop)) { print ''.$langs->trans("NoItem").''; } - else - { + else { // Sort array by date ASC to calculate balance $totalET_debit = 0; diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php index f380d8b4ee5..0129d1e5f43 100644 --- a/htdocs/compta/ajaxpayment.php +++ b/htdocs/compta/ajaxpayment.php @@ -81,13 +81,11 @@ if ($currentInvId) // Here to breakdown $remainAmount = $currentRemain - $currentAmount; // To keep value between curRemain and curAmount $result += $remainAmount; // result must be deduced by $currentAmount += $remainAmount; // curAmount put to curRemain - } else - { + } else { $currentAmount = $currentRemain; $result += $currentRemain; } - } else - { + } else { // Reset the substraction for this amount $result += price2num($currentAmount); $currentAmount = 0; diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 1f6e5e6620c..51d838878b8 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -51,8 +51,7 @@ if (!$year_start) $year_start = $year_current - 2; $year_end = $year_current; } -else -{ +else { $year_end = $year_start + 2; } @@ -108,8 +107,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -136,8 +134,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -158,8 +155,7 @@ if (!empty($id)) { dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); } - else - { + else { $bankaccount = new Account($db); $listid = explode(',', $id); foreach ($listid as $key => $aId) @@ -171,8 +167,7 @@ if (!empty($id)) } } } -else -{ +else { print $langs->trans("AllAccounts"); } @@ -281,8 +276,7 @@ if ($result < 0) $error++; setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); } -else -{ +else { // Calcul de $min et $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -299,8 +293,7 @@ else $min = $db->jdate($obj->min); $max = $db->jdate($obj->max); } - else - { + else { dol_print_error($db); } $log = "graph.php: min=".$min." max=".$max; @@ -339,8 +332,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -426,8 +418,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 7d059734126..d5fb533016e 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -69,8 +69,7 @@ if ($fielvalue) if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype); } -else -{ +else { if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque'); } @@ -242,15 +241,13 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' } } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("NoRecordSelected"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors'); @@ -287,8 +284,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) { $amount = price2num($_POST["addcredit"]); } - else - { + else { $amount = - price2num($_POST["adddebit"]); } @@ -338,13 +334,11 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : '')); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $action = 'addline'; } } @@ -469,8 +463,7 @@ if ($id > 0 || !empty($ref)) } } } -else -{ +else { llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); } @@ -675,8 +668,7 @@ if ($resql) print $liste; if ($numr <= 0) print ''.$langs->trans("None").''; } - else - { + else { dol_print_error($db); } @@ -793,13 +785,12 @@ if ($resql) { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); } - else // If direct entries is not done using miscellaneous payments + else // If direct entries is not done using miscellaneous payments { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier); } } - else - { + else { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1); } } @@ -1041,8 +1032,7 @@ if ($resql) $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount); } // If sort is asc,asc,asc then total of previous date is balance of line before the next line to show - else - { + else { $balance = $objforbalance->previoustotal; } } @@ -1129,8 +1119,7 @@ if ($resql) $balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc) $balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT'); } - else - { + else { $balancebefore = price2num($balance, 'MT'); // balancebefore = balance of previous line (sort is asc) $balance = price2num($balance + ($sign * $objp->amount), 'MT'); } @@ -1142,8 +1131,7 @@ if ($resql) $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; } - else - { + else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -1279,8 +1267,7 @@ if ($resql) print $bankstatic->getNomUrl(1, ''); print ')'; } - else - { + else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("TransferFrom").' '; @@ -1306,8 +1293,7 @@ if ($resql) elseif ($links[$key]['type'] == 'sc') { } - else - { + else { // Show link with label $links[$key]['label'] if (!empty($objp->label) && !empty($links[$key]['label'])) print ' - '; print ''; @@ -1317,8 +1303,7 @@ if ($resql) if ($reg[1] == 'paiement') $reg[1] = 'Payment'; print ' '.$langs->trans($reg[1]); } - else - { + else { print ' '.$links[$key]['label']; } print ''; @@ -1396,8 +1381,7 @@ if ($resql) $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; print $companystatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -1450,13 +1434,11 @@ if ($resql) { print ' '.price($balancebefore).''; } - else - { + else { print ' '.price($balancebefore).''; } } - else - { + else { print '-'; } if (!$i) $totalarray['nbfield']++; @@ -1470,13 +1452,11 @@ if ($resql) { print ' '.price($balance).''; } - else - { + else { print ' '.price($balance).''; } } - else - { + else { print '-'; } if (!$i) $totalarray['nbfield']++; @@ -1523,16 +1503,14 @@ if ($resql) print img_edit(); print ''; } - else - { + else { if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { print ''; print img_edit(); print ''; } - else - { + else { print ''; print img_view(); print ''; @@ -1610,8 +1588,7 @@ if ($resql) print ''; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 042117808d5..3a15ddf72e1 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -90,8 +90,7 @@ if ($result) print ''.price($total).''; print ''.price($totalnb ?price2num($total / $totalnb, 'MT') : 0).''; } -else -{ +else { dol_print_error($db); } print ""; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 593893878e0..3af40ffb2a0 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -100,8 +100,7 @@ if ($action == 'add') { $object->account_number = ''; } - else - { + else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int'); @@ -168,8 +167,7 @@ if ($action == 'add') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -206,8 +204,7 @@ if ($action == 'update') { $object->account_number = ''; } - else - { + else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int'); @@ -260,8 +257,7 @@ if ($action == 'update') $_GET["id"] = $_POST["id"]; // Force chargement page en mode visu } - else - { + else { $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; // Force chargement page edition @@ -272,8 +268,7 @@ if ($action == 'update') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -291,8 +286,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights-> header("Location: ".DOL_URL_ROOT."/compta/bank/list.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -399,8 +393,7 @@ if ($action == 'create') { $formcompany->select_departement(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : '', $selectedcode, 'account_state_id'); } - else - { + else { print $countrynotdefined; } print ''; @@ -545,8 +538,7 @@ if ($action == 'create') print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1); print ''; } - else - { + else { print ''.$langs->trans("AccountancyCode").''; print 'account_number).'">'; } @@ -577,8 +569,7 @@ if ($action == 'create') /* Visu et edition */ /* */ /* ************************************************************************** */ -else -{ +else { if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') { $object = new Account($db); @@ -887,8 +878,7 @@ else { print $formcompany->select_state(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : $object->state_id, $selectedcode, 'account_state_id'); } - else - { + else { print $countrynotdefined; } print ''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 308dad5dbca..b7bbb4d157e 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -133,8 +133,7 @@ if ($result) print ''; print ""; } - else - { + else { print "".$objp->label.""; print ''; print ''.img_edit().''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 3fcbffba3b2..cae83563b42 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -404,8 +404,7 @@ class Account extends CommonObject $rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_url"); return $rowid; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -510,8 +509,7 @@ class Account extends CommonObject $obj = $this->db->fetch_object($resql); $oper = $obj->code; } - else - { + else { dol_print_error($this->db, 'Failed to get payment type code'); return -1; } @@ -721,13 +719,11 @@ class Account extends CommonObject // End call triggers } } - else - { + else { $error++; } } - else - { + else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $langs->trans("ErrorBankLabelAlreadyExists"); @@ -744,8 +740,7 @@ class Account extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -837,8 +832,7 @@ class Account extends CommonObject // End call triggers } } - else - { + else { $error++; $this->error = $this->db->lasterror(); dol_print_error($this->db); @@ -849,8 +843,7 @@ class Account extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -908,8 +901,7 @@ class Account extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_print_error($this->db); return -1; @@ -1007,13 +999,11 @@ class Account extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror; $this->errors[] = $this->error; return -1; @@ -1114,8 +1104,7 @@ class Account extends CommonObject } } } - else - { + else { $error++; $this->error = "Error ".$this->db->lasterror(); } @@ -1126,8 +1115,7 @@ class Account extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1292,8 +1280,7 @@ class Account extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -1331,8 +1318,7 @@ class Account extends CommonObject } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -1476,8 +1462,7 @@ class Account extends CommonObject { return 1; } - else - { + else { return 0; } } @@ -1897,8 +1882,7 @@ class AccountLine extends CommonObject $this->db->free($result); return $ret; } - else - { + else { return -1; } } @@ -2015,8 +1999,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -$nbko; } @@ -2054,8 +2037,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -$nbko; } @@ -2086,8 +2068,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; @@ -2152,8 +2133,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2190,8 +2170,7 @@ class AccountLine extends CommonObject return 1; } } - else - { + else { dol_print_error($this->db); return 0; } @@ -2257,8 +2236,7 @@ class AccountLine extends CommonObject return 1; } } - else - { + else { dol_print_error($this->db); return 0; } @@ -2334,8 +2312,7 @@ class AccountLine extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2477,8 +2454,7 @@ class AccountLine extends CommonObject $alreadydispatched = $obj->nb; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index ad75559b362..6943d2bc5e1 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -226,8 +226,7 @@ class BankAccounts extends DolibarrApi { $amount_to = $amount; } - else - { + else { if (!$amount_to || empty($amount_to)) { throw new RestException(422, 'You must provide amount_to value since bankaccount_from and bankaccount_to does not share the same currency.'); @@ -304,8 +303,7 @@ class BankAccounts extends DolibarrApi ) ); } - else - { + else { $this->db->rollback(); throw new RestException(500, $accountfrom->error.' '.$accountto->error); } @@ -339,8 +337,7 @@ class BankAccounts extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $account->error); } } diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 6af394ad4b4..ec88fea3f84 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -170,8 +170,7 @@ class PaymentVarious extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -245,8 +244,7 @@ class PaymentVarious extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -431,8 +429,7 @@ class PaymentVarious extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $error++; } @@ -469,14 +466,12 @@ class PaymentVarious extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -500,8 +495,7 @@ class PaymentVarious extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -677,8 +671,7 @@ class PaymentVarious extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -706,8 +699,7 @@ class PaymentVarious extends CommonObject $alreadydispatched = $obj->nb; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 347353be84f..796529a24d9 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -85,8 +85,7 @@ if ($result < 0) $error++; setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); } -else -{ +else { // Calcul $min and $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -103,8 +102,7 @@ else $min = $db->jdate($obj->min); $max = $db->jdate($obj->max); } - else - { + else { dol_print_error($db); } if (empty($min)) $min = dol_now() - 3600 * 24; @@ -152,8 +150,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -175,8 +172,7 @@ else $solde = $row[0]; $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -200,8 +196,7 @@ else { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph } - else - { + else { $datas[$i] = $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -295,8 +290,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -318,8 +312,7 @@ else $solde = $row[0]; $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -344,8 +337,7 @@ else { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph } - else - { + else { $datas[$i] = $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -432,8 +424,7 @@ else $i++; } } - else - { + else { dol_print_error($db); } @@ -460,8 +451,7 @@ else { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph } - else - { + else { $datas[$i] = 0 + $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -558,8 +548,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -592,8 +581,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -675,8 +663,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } $sql = "SELECT date_format(b.datev,'%m')"; @@ -700,8 +687,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -771,15 +757,13 @@ if ($account) $morehtml = ''.$langs->trans("ShowAllAccounts").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam, 0, '', '', 1); } - else - { + else { $morehtml = ''.$langs->trans("BackToAccount").''; print $langs->trans("AllAccounts"); //print $morehtml; } } - else - { + else { $bankaccount = new Account($db); $listid = explode(',', $account); foreach ($listid as $key => $id) @@ -791,8 +775,7 @@ if ($account) } } } -else -{ +else { print $langs->trans("AllAccounts"); } @@ -809,8 +792,7 @@ if ($mode == 'showalltime') print $langs->trans("GoBack"); print ''; } -else -{ +else { print ''; print $langs->trans("ShowAllTimeBalance"); print ''; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index bf8dc6f5649..a1c37d59050 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -100,8 +100,7 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->ban dol_print_error($db); } } - else - { + else { setEventMessages($langs->trans("MissingIds"), null, 'errors'); } } @@ -121,8 +120,7 @@ if ($user->rights->banque->modifier && $action == "update") { $actarget->fetch(GETPOST('accountid', 'int')); } - else - { + else { $actarget->fetch($id); } @@ -192,8 +190,7 @@ if ($user->rights->banque->modifier && $action == "update") setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -230,8 +227,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -325,8 +321,7 @@ if ($result) { $form->select_comptes($acct->id, 'accountid', 0, '', 0); } - else - { + else { print $acct->getNomUrl(1, 'transactions', 'reflabel'); } print ''; @@ -464,8 +459,7 @@ if ($result) } print ''; } - else - { + else { print ''.$objp->fk_type.' '.$objp->num_chq.''; } print ""; @@ -480,8 +474,7 @@ if ($result) print ''; print ''; } - else - { + else { print ''.$objp->emetteur.''; } print ""; @@ -496,8 +489,7 @@ if ($result) print ''; print ''; } - else - { + else { print ''.$objp->banque.''; } print ""; @@ -518,8 +510,7 @@ if ($result) } print ''; } - else - { + else { print ''; print dol_print_date($db->jdate($objp->do), "day"); print ''; @@ -542,8 +533,7 @@ if ($result) } print ''; } - else - { + else { print ''; print dol_print_date($db->jdate($objp->dv), "day"); print ''; @@ -561,23 +551,20 @@ if ($result) // Label generique car entre parentheses. On l'affiche en le traduisant print $langs->trans($reg[1]); } - else - { + else { print $objp->label; } print '">'; print ''; } - else - { + else { print ''; if (preg_match('/^\((.*)\)$/i', $objp->label, $reg)) { // Label generique car entre parentheses. On l'affiche en le traduisant print $langs->trans($reg[1]); } - else - { + else { print $objp->label; } print ''; @@ -592,8 +579,7 @@ if ($result) print 'rappro ? ' disabled' : '').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$acct->currency_code); print ''; } - else - { + else { print ''; print price($objp->amount); print ''; @@ -650,15 +636,13 @@ if ($result) print $langs->trans("AccountStatement").' rappro ? ' disabled' : '').'>'; print ''; } - else - { + else { print $langs->trans("AccountStatement").' rappro ? ' disabled' : '').'>'; } if ($objp->num_releve) print '   ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; print ''; } - else - { + else { print ''.$objp->num_releve.' '; } print ''; @@ -670,8 +654,7 @@ if ($result) print 'rappro ? ' checked="checked"' : '')).'">'; print ''; } - else - { + else { print ''.yn($objp->rappro).''; } print ''; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index b1c76c529ad..bc45c708f33 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -488,8 +488,7 @@ foreach ($accounts as $key=>$type) $accountingaccount->fetch('', $objecttmp->account_number, 1); print $accountingaccount->getNomUrl(0, 1, 1, '', 1); } - else - { + else { print $objecttmp->account_number; } print ''; @@ -506,8 +505,7 @@ foreach ($accounts as $key=>$type) $accountingjournal->fetch($objecttmp->fk_accountancy_journal); print $accountingjournal->getNomUrl(0, 1, 1, '', 1); } - else - { + else { print ''; } print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index c737af4a89e..65476665963 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -296,16 +296,14 @@ if (empty($numref)) { // } - else - { + else { print ''; print ''; if ($action != 'editbankreceipt' || $objp->numr != $brref) { print ''.$objp->numr.''; } - else - { + else { print ''; print ''; print ''; @@ -356,13 +354,11 @@ if (empty($numref)) print "\n
\n"; } - else - { + else { dol_print_error($db); } } -else -{ +else { /** * Show list of record into a bank statement */ @@ -554,8 +550,7 @@ else print $bankstatic->getNomUrl(1, ''); print ')'; } - else - { + else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("from").' '; @@ -626,8 +621,7 @@ else $ii++; } } - else - { + else { dol_print_error($db); } } @@ -639,8 +633,7 @@ else $totald = $totald + abs($objp->amount); print ''.price($objp->amount * -1)." \n"; } - else - { + else { $totalc = $totalc + abs($objp->amount); print ' '.price($objp->amount)."\n"; } @@ -653,8 +646,7 @@ else print img_edit(); print ""; } - else - { + else { print " "; } print ""; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index aa4c39e55ee..99a66321648 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -88,8 +88,7 @@ if ($action == 'add') { $amountto = $amount; } - else - { + else { if (!$amountto) { $error++; @@ -131,14 +130,12 @@ if ($action == 'add') setEventMessages($mesgs, null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors'); $db->rollback(); } } - else - { + else { $error++; setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); } diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index b8d259cdc8d..929a1611775 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -73,8 +73,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) { $viewline = $vline; } - else - { + else { $viewline = 20; } @@ -305,8 +304,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $i++; } } - else - { + else { dol_print_error($db); } @@ -327,8 +325,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) print ""; print "
"; } -else -{ +else { print $langs->trans("ErrorBankAccountNotFound"); } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index c4fdc3be56a..ffabd082bfa 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -164,8 +164,7 @@ if (empty($reshook)) header("Location: ".$urltogo); exit; } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -199,21 +198,18 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/list.php'); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); } } @@ -392,8 +388,7 @@ if ($action == 'create') { print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1, ''); } - else - { + else { print ''; } print ''; @@ -565,13 +560,11 @@ if ($id) print ''; } } - else - { + else { print ''; } } - else - { + else { print ''; } diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index d81b9bdd41a..624ead86073 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -150,8 +150,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 5f68440809c..5fa44ba8555 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -76,8 +76,7 @@ if (!GETPOST('typeid')) if ($part[0] == 'v.fk_typepayment') $typeid = $part[1]; } } -else -{ +else { $typeid = GETPOST('typeid'); } @@ -374,8 +373,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 3780fbc1afe..fce50a977e4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -178,8 +178,7 @@ elseif ($action == "add") $db->commit(); $action = "view"; } - else - { + else { $db->rollback; $action = "view"; } @@ -218,8 +217,7 @@ if ($action == "valid") // validate = close setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } - else - { + else { setEventMessages($langs->trans("CashFenceDone"), null); $db->commit(); } @@ -254,8 +252,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) header("Location: ".$backurlforlist); exit; } - else - { + else { if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, null, 'errors'); } @@ -330,8 +327,7 @@ if ($action == "create" || $action == "start" || $action == 'close') } else dol_print_error($db); } - else - { + else { setEventMessages($langs->trans("SetupOfTerminalNotComplete", $terminaltouse), null, 'errors'); $error++; } @@ -350,8 +346,7 @@ if ($action == "create" || $action == "start" || $action == 'close') if ($key == 'cash') $sql .= " AND cp.code = 'LIQ'"; elseif ($key == 'cheque') $sql .= " AND cp.code = 'CHQ'"; elseif ($key == 'card') $sql .= " AND cp.code = 'CB'"; - else - { + else { dol_print_error('Value for key = '.$key.' not supported'); exit; } @@ -394,8 +389,7 @@ if ($action == "create" || $action == "start" || $action == 'close') print ''; print ''; } - else - { + else { print ''; } @@ -470,8 +464,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { print ''; } - else - { + else { print ''; } print ''; @@ -712,8 +705,7 @@ if (empty($action) || $action == "view" || $action == "close") print ''; print ''; } - else - { + else { print ''; } diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index a98c9ea83f5..5269c07bab2 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -260,8 +260,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 1ea06eba9e9..5b9079f9d72 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -173,8 +173,7 @@ if ($resql) $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; } - else - { + else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -312,8 +311,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 93065219248..991d039d1fb 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -104,8 +104,7 @@ if ($mode != 'sconly') $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1); } -else -{ +else { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0); } @@ -241,8 +240,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''.price($totalpaye).""; print ""; } - else - { + else { dol_print_error($db); } print ''; @@ -357,8 +355,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -380,8 +377,7 @@ elseif ($mysoc->localtax2_assuj == "1") $j = 2; $numlt = 3; } -else -{ +else { $j = 0; $numlt = 0; } @@ -452,8 +448,7 @@ while ($j < $numlt) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -566,8 +561,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) print "
"; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 6c1439d5466..74cc0d594e5 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -197,8 +197,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 463d9ea699f..b688bd17907 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -71,8 +71,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -89,8 +88,7 @@ elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -104,8 +102,7 @@ elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depla header("Location: index.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -150,19 +147,16 @@ elseif ($action == 'add' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } } - else - { + else { $action = 'create'; } } - else - { + else { header("Location: index.php"); exit; } @@ -190,13 +184,11 @@ elseif ($action == 'update' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -413,8 +405,7 @@ elseif ($id) print ''; } - else - { + else { /* * Confirm delete trip */ @@ -493,8 +484,7 @@ elseif ($id) { $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } - else - { + else { $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0); } print ''; @@ -529,8 +519,7 @@ elseif ($id) { print ''.$langs->trans('Modify').''; } - else - { + else { print ''.$langs->trans('Modify').''; } } @@ -541,8 +530,7 @@ elseif ($id) { print ''.$langs->trans('Validate').''; } - else - { + else { print ''.$langs->trans('Validate').''; } } @@ -553,8 +541,7 @@ elseif ($id) { print ''.$langs->trans('ClassifyRefunded').''; } - else - { + else { print ''.$langs->trans('ClassifyRefunded').''; } } @@ -563,16 +550,14 @@ elseif ($id) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } print ''; } } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index ec4610179e2..8051d074db5 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -200,15 +200,13 @@ class Deplacement extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return $result; } } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -268,8 +266,7 @@ class Deplacement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -313,8 +310,7 @@ class Deplacement extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -339,8 +335,7 @@ class Deplacement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -461,8 +456,7 @@ class Deplacement extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); } @@ -508,8 +502,7 @@ class Deplacement extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 2cef0b3e6cd..4ad2044c0f1 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -124,8 +124,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 9d45bafd20f..9ed6e430c4c 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -193,8 +193,7 @@ if ($result) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print '
'; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index a4cc8f24019..1ebaeb5c6fa 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -197,8 +197,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index cf745b784fc..91c6546a83c 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -168,8 +168,7 @@ if (!$user->rights->societe->client->voir || $user->socid) if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index cad443940f4..8256aeacc5a 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -239,8 +239,7 @@ if (empty($reshook)) $action = "create"; } } - else - { + else { $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -253,8 +252,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); exit; } - else - { + else { $db->rollback(); $error++; @@ -357,8 +355,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -381,8 +378,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -419,14 +415,12 @@ if (empty($reshook)) $db->commit(); $object->fetch($object->id); // Reload lines } - else - { + else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($line->error, $line->errors, 'errors'); } @@ -467,8 +461,7 @@ if (empty($reshook)) $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -579,8 +572,7 @@ if (empty($reshook)) { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } - else - { + else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -604,8 +596,7 @@ if (empty($reshook)) $desc = (!empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; } - else - { + else { $desc = $prod->description; } @@ -641,8 +632,7 @@ if (empty($reshook)) $type = $prod->type; $fk_unit = $prod->fk_unit; } - else - { + else { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); @@ -673,8 +663,7 @@ if (empty($reshook)) $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } - else - { + else { // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice); @@ -739,8 +728,7 @@ if (empty($reshook)) unset($_POST['situations']); unset($_POST['progress']); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } @@ -948,8 +936,7 @@ if (empty($reshook)) unset($_POST['situations']); unset($_POST['progress']); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1145,8 +1132,7 @@ if ($action == 'create') print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); print ""; } - else - { + else { print ''; } @@ -1199,13 +1185,11 @@ if ($action == 'create') print ''; print "\n"; } - else - { + else { dol_print_error('', "Error, no invoice ".$object->id); } } -else -{ +else { /* * View mode */ @@ -1329,8 +1313,7 @@ else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } - else - { + else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); } } else { @@ -1351,8 +1334,7 @@ else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } - else - { + else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none'); } print ''; @@ -1460,8 +1442,7 @@ else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } - else - { + else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -1487,8 +1468,7 @@ else $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); } - else - { + else { print $object->modelpdf; } print ""; @@ -1537,14 +1517,12 @@ else print ''; print ''; } - else - { + else { if ($object->frequency > 0) { print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); } - else - { + else { print $langs->trans("NotARecurringInvoiceTemplate"); } } @@ -1556,8 +1534,7 @@ else { print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); } - else - { + else { print $langs->trans("NextDateToExecution"); } print ''; @@ -1570,8 +1547,7 @@ else { if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late")); } - else - { + else { print img_info($langs->trans("MaxNumberOfGenerationReached")); } print ''; @@ -1583,8 +1559,7 @@ else { print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer); } - else - { + else { print $langs->trans("MaxPeriodNumber"); } print ''; @@ -1592,8 +1567,7 @@ else { print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max ? $object->nb_gen_max : '', $object, $user->rights->facture->creer); } - else - { + else { print ''; } print ''; @@ -1603,8 +1577,7 @@ else print ''; if ($action == 'auto_validate' || $object->frequency > 0) print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer); - else - print $langs->trans("StatusOfGeneratedInvoices"); + else print $langs->trans("StatusOfGeneratedInvoices"); print ''; $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); if ($action == 'auto_validate' || $object->frequency > 0) @@ -1619,8 +1592,7 @@ else print ''; if ($action == 'generate_pdf' || $object->frequency > 0) print $form->editfieldkey($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $user->rights->facture->creer); - else - print $langs->trans("StatusOfGeneratedDocuments"); + else print $langs->trans("StatusOfGeneratedDocuments"); print ''; print ''; $select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); @@ -1631,8 +1603,7 @@ else print ''; print ''; } - else - { + else { print ''; } @@ -1734,20 +1705,17 @@ else { print ''; } - else - { + else { if (empty($object->frequency) || $object->date_when <= $today) { print ''; } - else - { + else { print ''; } } } - else - { + else { print ''; } } @@ -1758,8 +1726,7 @@ else { print ''; } - else - { + else { print ''; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ab2262844bf..68b1a6e91df 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -619,8 +619,7 @@ if (empty($reshook)) } } } - else - { + else { //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') { @@ -696,8 +695,7 @@ if (empty($reshook)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { if (count($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, $object->errors, 'errors'); } @@ -972,8 +970,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -981,8 +978,7 @@ if (empty($reshook)) $db->commit(); } } - else - { + else { setEventMessages($discount->error, $discount->errors, 'errors'); $db->rollback(); } @@ -1176,8 +1172,7 @@ if (empty($reshook)) $searchPreviousInvoice = false; // find, exit; break; } - else - { + else { $lineIndex--; // go to previous invoice in cycle } } @@ -1470,8 +1465,7 @@ if (empty($reshook)) $amountdeposit[$tva] += $am / (1 + $tva / 100); // Convert into HT for the addline } } - else - { + else { if ($typeamount == 'amount') { $amountdeposit[0] = $valuedeposit; @@ -1725,8 +1719,7 @@ if (empty($reshook)) $error++; } } - else - { // If some invoice's lines coming from page + else { // If some invoice's lines coming from page $id = $object->create($user); for ($i = 1; $i <= $NBLINES; $i++) { @@ -1853,8 +1846,7 @@ if (empty($reshook)) { $mesg = $object->error; } - else - { + else { $nextSituationInvoice = new Facture($db); $nextSituationInvoice->fetch($id); @@ -1895,8 +1887,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit(); } - else - { + else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -1922,8 +1913,7 @@ if (empty($reshook)) $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -1971,8 +1961,7 @@ if (empty($reshook)) } $error++; } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -1999,8 +1988,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; } - else - { + else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error++; } @@ -2065,8 +2053,7 @@ if (empty($reshook)) { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } - else - { + else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -2357,8 +2344,7 @@ if (empty($reshook)) } $error++; } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -2458,8 +2444,7 @@ if (empty($reshook)) $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $result = -1; - } else - $object->update_percent($line, $_POST['all_progress']); + } else $object->update_percent($line, $_POST['all_progress']); } } } @@ -2540,8 +2525,7 @@ if (empty($reshook)) $searchPreviousInvoice = false; // find, exit; break; } - else - { + else { $lineIndex--; // go to previous invoice in cycle } } @@ -2569,18 +2553,15 @@ if (empty($reshook)) setEventMessages($langs->trans('Updated'), '', 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); } - else - { + else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceCreditNote'), array(), 'errors'); } } - else - { + else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceOnUpdate'), array(), 'errors'); } } - else - { + else { setEventMessages($langs->trans('ErrorFindNextSituationInvoice'), array(), 'errors'); } } @@ -2875,8 +2856,7 @@ if ($action == 'create') $expesrc->fetch_optionals(); $object->array_options = $expesrc->array_options; } - else - { + else { $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); @@ -2895,8 +2875,7 @@ if ($action == 'create') } } } - else - { + else { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; $fk_account = $soc->fk_account; @@ -2979,8 +2958,7 @@ if ($action == 'create') print ''; print ''."\n"; } - else - { + else { print ''.$langs->trans('Customer').''; print ''; print $form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); @@ -3204,8 +3182,7 @@ if ($action == 'create') print ''; } } - else - { + else { if (!empty($conf->global->INVOICE_USE_SITUATION)) { print '
'; @@ -3311,8 +3288,7 @@ if ($action == 'create') print '
'; } } - else - { + else { print '
'; if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp = ' '; else $tmp = ' '; @@ -3790,8 +3766,7 @@ elseif ($id > 0 || !empty($ref)) ); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1); } - else - { + else { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', 'no', 1); } } else { @@ -4128,8 +4103,7 @@ elseif ($id > 0 || !empty($ref)) foreach ($facidavoir as $id) { if ($i == 0) print ' '; - else - print ','; + else print ','; $facavoir = new Facture($db); $facavoir->fetch($id); print $facavoir->getNomUrl(1); @@ -4274,8 +4248,7 @@ elseif ($id > 0 || !empty($ref)) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } - else - { + else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none', 'CRDT'); } print ''; @@ -4339,8 +4312,7 @@ elseif ($id > 0 || !empty($ref)) { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } - else - { + else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -4362,8 +4334,7 @@ elseif ($id > 0 || !empty($ref)) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -4377,7 +4348,7 @@ elseif ($id > 0 || !empty($ref)) $displayWarranty = false; } - if($displayWarranty) { + if ($displayWarranty) { // Retained Warranty print ''; print ''; @@ -4433,8 +4403,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); if (!$displayWarranty) { print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" '); @@ -4468,8 +4437,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { print dol_print_date($object->retained_warranty_date_limit, 'day'); } print ''; @@ -4831,8 +4799,7 @@ elseif ($id > 0 || !empty($ref)) print ''; $resteapayeraffiche = $resteapayer; @@ -4928,8 +4895,7 @@ elseif ($id > 0 || !empty($ref)) { $retainedWarranty = $total_global_ttc * $object->retained_warranty / 100; } - else - { + else { // Because one day retained warranty could be used on standard invoices $retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; } @@ -5119,8 +5085,7 @@ elseif ($id > 0 || !empty($ref)) } } } - else - { + else { print ''.$langs->trans('Modify').''; } } @@ -5159,8 +5124,7 @@ elseif ($id > 0 || !empty($ref)) } else { if ($usercansend) { print ''.$langs->trans('SendMail').''; - } else - print ''.$langs->trans('SendMail').''; + } else print ''.$langs->trans('SendMail').''; } } } @@ -5179,13 +5143,11 @@ elseif ($id > 0 || !empty($ref)) print ''.$langs->trans('MakeWithdrawRequest').''; } } - else - { + else { //print ''.$langs->trans("MakeWithdrawRequest").''; } } - else - { + else { //print ''.$langs->trans("MakeWithdrawRequest").''; } } @@ -5220,8 +5182,7 @@ elseif ($id > 0 || !empty($ref)) { print ''.$langs->trans('DoPaymentBack').''; } - else - { + else { print ''.$langs->trans('DoPaymentBack').''; } } @@ -5261,16 +5222,14 @@ elseif ($id > 0 || !empty($ref)) // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; } - else - { + else { if (empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) { if ($objectidnext) { print ''.$langs->trans('ClassifyCanceled').''; } - else - { + else { print ''.$langs->trans('ClassifyCanceled').''; } } @@ -5333,8 +5292,7 @@ elseif ($id > 0 || !empty($ref)) { print ''.$langs->trans("RemoveSituationFromCycle").''; } - else - { + else { print ''.$langs->trans("RemoveSituationFromCycle").''; } } @@ -5375,8 +5333,7 @@ elseif ($id > 0 || !empty($ref)) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } else { diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 85da9cd5c37..d56d1b5cfef 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -549,8 +549,7 @@ class Invoices extends DolibarrApi if ($updateRes > 0) { return $this->get($id); } - else - { + else { throw new RestException(405, $this->invoice->error); } } @@ -1125,8 +1124,7 @@ class Invoices extends DolibarrApi { $this->db->commit(); } - else - { + else { $this->db->rollback(); throw new RestException(500, 'Could not set paid'); } @@ -1134,8 +1132,7 @@ class Invoices extends DolibarrApi $this->db->commit(); } } - else - { + else { $this->db->rollback(); throw new RestException(500, 'Discount creation error'); } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 71be89f30f5..904f59ea432 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -378,7 +378,7 @@ class FactureRec extends CommonInvoice } } } - 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); @@ -395,21 +395,18 @@ class FactureRec extends CommonInvoice { $this->db->rollback(); } - else - { + else { $this->db->commit(); return $this->id; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -1; } @@ -461,8 +458,7 @@ class FactureRec extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -585,15 +581,13 @@ class FactureRec extends CommonInvoice } return 1; } - else - { + else { $this->error = 'Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -2; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -723,8 +717,7 @@ class FactureRec extends CommonInvoice $this->db->free($result); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -3; } @@ -767,14 +760,12 @@ class FactureRec extends CommonInvoice $res = $this->deleteExtraFields(); if ($res < 0) $error = -4; } - else - { + else { $this->error = $this->db->lasterror(); $error = -1; } } - else - { + else { $this->error = $this->db->lasterror(); $error = -2; } @@ -784,8 +775,7 @@ class FactureRec extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return $error; } @@ -861,8 +851,7 @@ class FactureRec extends CommonInvoice { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -970,8 +959,7 @@ class FactureRec extends CommonInvoice $this->update_price(); return $lineId; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1046,8 +1034,7 @@ class FactureRec extends CommonInvoice { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -1132,8 +1119,7 @@ class FactureRec extends CommonInvoice $this->update_price(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1226,8 +1212,7 @@ class FactureRec extends CommonInvoice if ($num) $this->output .= $langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; - else - $this->output .= $langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); + else $this->output .= $langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); $saventity = $conf->entity; @@ -1289,8 +1274,7 @@ class FactureRec extends CommonInvoice } } } - else - { + else { $error++; $this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n"; $this->errors[] = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity; @@ -1304,8 +1288,7 @@ class FactureRec extends CommonInvoice $nb_create++; $this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n"; } - else - { + else { $db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref); } @@ -1435,8 +1418,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); } @@ -1457,8 +1439,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); } @@ -1480,8 +1461,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1506,8 +1486,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1532,8 +1511,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1559,8 +1537,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1672,7 +1649,7 @@ class FactureRec extends CommonInvoice $line->total_tva = 9.8; $line->remise_percent = 50; } - else // (product line) + else // (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -1762,8 +1739,7 @@ class FactureRec extends CommonInvoice if (!empty($unit)) $this->unit_frequency = $unit; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1795,8 +1771,7 @@ class FactureRec extends CommonInvoice if ($increment_nb_gen_done > 0) $this->nb_gen_done++; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1828,8 +1803,7 @@ class FactureRec extends CommonInvoice $this->nb_gen_max = $nb; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1859,8 +1833,7 @@ class FactureRec extends CommonInvoice $this->auto_validate = $validate; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1890,8 +1863,7 @@ class FactureRec extends CommonInvoice $this->generate_pdf = $validate; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1921,8 +1893,7 @@ class FactureRec extends CommonInvoice $this->modelpdf = $model; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -2068,8 +2039,7 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->free($result); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -3; } @@ -2150,8 +2120,7 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fd6a6d32642..55adb5eb138 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -679,7 +679,7 @@ class Facture extends CommonInvoice } } } - 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); @@ -988,28 +988,24 @@ class Facture extends CommonInvoice $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -4; } } - else - { + else { $this->error = $langs->trans('FailedToUpdatePrice'); $this->db->rollback(); return -3; } } - else - { + else { dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -1241,8 +1237,7 @@ class Facture extends CommonInvoice $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -1646,15 +1641,13 @@ class Facture extends CommonInvoice } return 1; } - else - { + else { $this->error = 'Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found'; dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1776,8 +1769,7 @@ class Facture extends CommonInvoice $this->db->free($result); return 1; } - else - { + else { $this->error = $this->db->error(); return -3; } @@ -1816,8 +1808,7 @@ class Facture extends CommonInvoice { $this->tab_previous_situation_invoice[] = $invoice; } - else - { + else { $this->tab_next_situation_invoice[] = $invoice; } } @@ -1934,8 +1925,7 @@ class Facture extends CommonInvoice $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -2022,22 +2012,19 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $facligne->error; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $facligne->error; $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -3; } @@ -2063,8 +2050,7 @@ class Facture extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; if (empty($ref_client)) $sql .= ' SET ref_client = NULL'; - else - $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; + else $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; $sql .= ' WHERE rowid = '.$this->id; dol_syslog(__METHOD__.' this->id='.$this->id.', ref_client='.$ref_client, LOG_DEBUG); @@ -2095,8 +2081,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2261,22 +2246,19 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -6; } } - else - { + else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -4; } } - else - { + else { $this->db->rollback(); return -2; } @@ -2322,8 +2304,7 @@ class Facture extends CommonInvoice if ($result < 0) $error++; // End call triggers } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -2333,14 +2314,12 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { return 0; } } @@ -2377,8 +2356,7 @@ class Facture extends CommonInvoice if ($result < 0) $error++; // End call triggers } - else - { + else { $error++; $this->error = $this->db->error(); dol_print_error($this->db); @@ -2389,8 +2367,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2446,15 +2423,13 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -2; @@ -2573,8 +2548,7 @@ class Facture extends CommonInvoice } $num = $this->getNextNumRef($this->thirdparty); } - else - { + else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -2804,8 +2778,7 @@ class Facture extends CommonInvoice } } } - else - { + else { $error++; } @@ -2814,8 +2787,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2943,14 +2915,12 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -3070,8 +3040,7 @@ class Facture extends CommonInvoice { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -3213,22 +3182,19 @@ class Facture extends CommonInvoice $this->db->commit(); return $this->line->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->line->error; $this->db->rollback(); return -2; } } - else - { + else { dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR); return -3; } @@ -3444,15 +3410,13 @@ class Facture extends CommonInvoice $this->db->commit(); return $result; } - else - { + else { $this->error = $this->line->error; $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Invoice statut makes operation forbidden"; return -2; } @@ -3573,15 +3537,13 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } - else - { + else { $this->db->rollback(); $this->error = $line->error; return -1; @@ -3640,8 +3602,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3709,8 +3670,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3869,8 +3829,7 @@ class Facture extends CommonInvoice } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -3933,8 +3892,7 @@ class Facture extends CommonInvoice { $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; } - else - { + else { $ga[$i]['id'] = $obj->fid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -3944,8 +3902,7 @@ class Facture extends CommonInvoice } return $ga; } - else - { + else { dol_print_error($this->db); return -1; } @@ -3994,8 +3951,7 @@ class Facture extends CommonInvoice //print_r($return); return $return; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -4042,8 +3998,7 @@ class Facture extends CommonInvoice $sqlSit .= " ORDER BY fs.situation_counter"; $sql .= " AND ( f.type != ".self::TYPE_SITUATION." OR f.rowid IN (".$sqlSit.") )"; // Type non 5 si facture non avoir } - else - { + else { $sql .= " AND f.type != ".self::TYPE_SITUATION; // Type non 5 si facture non avoir } @@ -4069,8 +4024,7 @@ class Facture extends CommonInvoice return $return; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -4147,8 +4101,7 @@ class Facture extends CommonInvoice $error++; } } - else - { + else { $this->error = 'WithdrawRequestErrorNilAmount'; dol_syslog(get_class($this).'::demandeprelevement WithdrawRequestErrorNilAmount'); $error++; @@ -4167,22 +4120,19 @@ class Facture extends CommonInvoice if ($error) return -1; return 1; } - else - { + else { $this->error = "A request already exists"; dol_syslog(get_class($this).'::demandeprelevement Impossible de creer une demande, demande deja en cours'); return 0; } } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::demandeprelevement Erreur -2'); return -2; } } - else - { + else { $this->error = "Status of invoice does not allow this"; dol_syslog(get_class($this)."::demandeprelevement ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); return -3; @@ -4207,8 +4157,7 @@ class Facture extends CommonInvoice { return 0; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); return -1; @@ -4274,8 +4223,7 @@ class Facture extends CommonInvoice return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4419,7 +4367,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_tva = 19.6; $line->remise_percent = 50; } - else // (product line) + else // (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -4506,8 +4454,7 @@ class Facture extends CommonInvoice $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4669,8 +4616,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -4760,8 +4706,7 @@ class Facture extends CommonInvoice { $hasDelay = 1; } - else - { + else { $hasDelay = 0; } } @@ -4852,8 +4797,7 @@ class Facture extends CommonInvoice return -1; } } - else - { + else { // Because one day retained warranty could be used on standard invoices $retainedWarrantyAmount = $this->total_ttc * $this->retained_warranty / 100; } @@ -4890,15 +4834,13 @@ class Facture extends CommonInvoice $this->retained_warranty = floatval($value); return 1; } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarranty Erreur '.$sql.' - '.$this->db->error()); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarranty, status of the object is incompatible'); $this->error = 'Status of the object is incompatible '.$this->statut; return -2; @@ -4933,15 +4875,13 @@ class Facture extends CommonInvoice $this->retained_warranty_date_limit = $timestamp; return 1; } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit Erreur '.$sql.' - '.$this->db->error()); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit, status of the object is incompatible'); $this->error = 'Status of the object is incompatible '.$this->statut; return -2; @@ -5123,8 +5063,7 @@ class FactureLigne extends CommonInvoiceLine return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -5178,8 +5117,7 @@ class FactureLigne extends CommonInvoiceLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -5296,8 +5234,7 @@ class FactureLigne extends CommonInvoiceLine return -3; } } - else - { + else { $result = $discount->link_to_invoice($this->rowid, 0); if ($result < 0) { @@ -5308,16 +5245,14 @@ class FactureLigne extends CommonInvoiceLine } } } - else - { + else { $this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } - else - { + else { $this->error = $discount->error; dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -5340,8 +5275,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -5395,8 +5329,7 @@ class FactureLigne extends CommonInvoiceLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -5475,8 +5408,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -5519,8 +5451,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -5561,8 +5492,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 427daf445c5..1fddf20b023 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -146,8 +146,7 @@ class PaymentTerm // extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -203,8 +202,7 @@ class PaymentTerm // extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -240,8 +238,7 @@ class PaymentTerm // extends CommonObject $this->db->free($resql); return $ret; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -306,8 +303,7 @@ class PaymentTerm // extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -346,8 +342,7 @@ class PaymentTerm // extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -397,8 +392,7 @@ class PaymentTerm // extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 8eb47268186..77ff0f813c3 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -70,15 +70,13 @@ if ($action == 'addcontact' && $user->rights->facture->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -91,8 +89,7 @@ elseif ($action == 'swapstatut' && $user->rights->facture->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -208,8 +205,7 @@ if ($id > 0 || !empty($ref)) if ($res) break; } } - else - { + else { // Record not found print "ErrorRecordNotFound"; } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index a901b985342..7e95b92cc3d 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -182,13 +182,11 @@ if ($id > 0 || !empty($ref)) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } - else - { + else { dol_print_error($db); } } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 65e9044f4f7..8275dbcf450 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -610,8 +610,7 @@ if ($resql) { if (!$objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late")); } - else - { + else { print img_info($langs->trans("MaxNumberOfGenerationReached")); } print ''; @@ -660,13 +659,11 @@ if ($resql) print ''; print $langs->trans("CreateBill").''; } - else - { + else { print $form->textwithpicto('', $langs->trans("DateIsNotEnough")); } } - else - { + else { print " "; } if (!$i) $totalarray['nbfield']++; @@ -677,8 +674,7 @@ if ($resql) $i++; } } - else - { + else { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } print ''; @@ -694,8 +690,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8b9e204f17e..7b3025db810 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -314,8 +314,7 @@ elseif ($massaction == 'withdrawrequest') $error++; setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); } - else - { + else { //Checking error $error = 0; @@ -387,8 +386,7 @@ elseif ($massaction == 'withdrawrequest') $db->commit(); $nbwithdrawrequestok++; } - else - { + else { $db->rollback(); setEventMessages($aBill->error, $aBill->errors, 'errors'); } @@ -516,8 +514,7 @@ if ($search_status != '-1' && $search_status != '') if ($search_status == '2') $sql .= " AND f.fk_statut = 2"; // payed Not that some corrupted data may contains f.fk_statut = 1 AND f.paye = 1 (it means payed too but should not happend. If yes, reopen and reclassify billed) if ($search_status == '3') $sql .= " AND f.fk_statut = 3"; // abandonned } - else - { + else { $sql .= " AND f.fk_statut IN (".$db->escape($search_status).")"; // When search_status is '1,2' for example } } @@ -564,8 +561,7 @@ if (!$sall) foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : ''); } } -else -{ +else { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } @@ -1220,8 +1216,7 @@ if ($resql) { print $obj->ref; } - else - { + else { print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1); } @@ -1317,8 +1312,7 @@ if ($resql) { print $thirdpartystatic->name; } - else - { + else { print $thirdpartystatic->getNomUrl(1, 'customer'); } print ''; @@ -1620,8 +1614,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 74de1c640d4..109231a240d 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -87,8 +87,7 @@ if (empty($reshook)) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -293,13 +292,11 @@ if ($object->id > 0) { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate'); } - else - { + else { print dol_print_date($object->date, 'daytext'); } } - else - { + else { print dol_print_date($object->date, 'daytext'); } print ''; @@ -319,13 +316,11 @@ if ($object->id > 0) { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } - else - { + else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); } } - else - { + else { print ' '; } print ''; @@ -344,16 +339,14 @@ if ($object->id > 0) { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date_lim_reglement, 'paymentterm'); } - else - { + else { print dol_print_date($object->date_lim_reglement, 'daytext'); if ($object->hasDelay()) { print img_warning($langs->trans('Late')); } } } - else - { + else { print ' '; } print ''; @@ -370,8 +363,7 @@ if ($object->id > 0) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id'); } - else - { + else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); } print ''; @@ -389,8 +381,7 @@ if ($object->id > 0) { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } - else - { + else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -503,8 +494,7 @@ if ($object->id > 0) $num = $db->num_rows($result_sql); $numopen = $num; } - else - { + else { dol_print_error($db); } @@ -521,8 +511,7 @@ if ($object->id > 0) $obj = $db->fetch_object($result_sql); if ($obj) $pending = $obj->amount; } - else - { + else { dol_print_error($db); } @@ -550,18 +539,15 @@ if ($object->id > 0) print ''; print ''; } - else - { + else { print ''.$langs->trans("MakeWithdrawRequest").''; } } - else - { + else { print ''.$langs->trans("MakeWithdrawRequest").''; } } - else - { + else { if ($num == 0) { if ($object->statut > Facture::STATUS_DRAFT) print ''.$langs->trans("MakeWithdrawRequest").''; @@ -635,8 +621,7 @@ if ($object->id > 0) $db->free($result_sql); } - else - { + else { dol_print_error($db); } @@ -697,8 +682,7 @@ if ($object->id > 0) $db->free($result); } - else - { + else { dol_print_error($db); } diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 284186b73ce..d0c7eacffc6 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; -if(!empty($conf->category->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +if (!empty($conf->category->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); @@ -60,7 +60,7 @@ if ($user->socid > 0) $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -if(!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2; +if (!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2; else $startyear=$year-1; $endyear = $year; @@ -68,7 +68,7 @@ $endyear = $year; /* * View */ -if(!empty($conf->category->enabled)) $langs->load('categories'); +if (!empty($conf->category->enabled)) $langs->load('categories'); $form = new Form($db); $formcompany = new FormCompany($db); $formother = new FormOther($db); @@ -181,8 +181,7 @@ if (!$user->rights->societe->client->voir || $user->socid) if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index a02a0fc1682..571a00d6b47 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -79,8 +79,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) $total = $total + $sign * $objectlink->total_ht; echo price($objectlink->total_ht); } - else - { + else { echo ''.price($objectlink->total_ht).''; } } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 00b4987ad66..2efe20a2fc5 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -215,15 +215,13 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print ''; } - else - { + else { print ''; } print "
'; @@ -4398,8 +4369,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { print price($object->retained_warranty).'%'; } print '
'; if ($object->type != Facture::TYPE_DEPOSIT) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); - else - print $langs->trans('AlreadyPaid'); + else print $langs->trans('AlreadyPaid'); print ' :'.price($totalpaye).' 
'.$langs->trans("NoRecordFound").'
'.price($tot_ttc).'
'.$langs->trans("NoInvoice").'

"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -303,15 +301,13 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''.price($tot_ttc).''; print ''; } - else - { + else { print ''.$langs->trans("NoInvoice").''; } print "

"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -429,8 +425,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $i++; } } - else - { + else { $colspan = 5; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; @@ -438,8 +433,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -530,16 +524,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $i++; } } - else - { + else { $colspan = 5; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; } - else - { + else { dol_print_error($db); } } @@ -609,8 +601,7 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print '
'; @@ -687,15 +678,13 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ' '; print ''; } - else - { + else { print ''.$langs->trans("None").''; } print "
"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -816,8 +805,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user } $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -940,8 +928,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print ' '; print ''; } - else - { + else { $colspan = 6; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; @@ -949,8 +936,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -1050,16 +1036,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ' '; print ''; } - else - { + else { $colspan = 6; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 1459bbf2402..91d855d4454 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -91,7 +91,7 @@ $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescPurchasesJournal").'
'; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); -else $description .= $langs->trans("DepositsAreIncluded"); +else $description .= $langs->trans("DepositsAreIncluded"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink); @@ -239,8 +239,7 @@ foreach ($tabfac as $key => $val) print ''.($mt < 0 ?price(-$mt) : '').""; print ''.($mt >= 0 ?price($mt) : '').""; } - else - { + else { print ''.($mt >= 0 ?price($mt) : '').""; print ''.($mt < 0 ?price(-$mt) : '').""; } diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 98bd5e989f7..a7eb09de31a 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -93,7 +93,7 @@ $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescSellsJournal").'
'; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); -else $description .= $langs->trans("DepositsAreIncluded"); +else $description .= $langs->trans("DepositsAreIncluded"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink); @@ -269,8 +269,7 @@ foreach ($tabfac as $key => $val) print ''.($mt >= 0 ?price($mt) : '').""; print ''.($mt < 0 ?price(-$mt) : '').""; } - else - { + else { print ''.($mt < 0 ?price(-$mt) : '').""; print ''.($mt >= 0 ?price($mt) : '').""; } diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 51275c7159f..e5a20b5486b 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -81,8 +81,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) header("Location: list.php?localTaxType=".$lttype); exit; } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $_GET["action"] = "create"; @@ -114,21 +113,18 @@ if ($action == 'delete') header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$object->ltt); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; setEventMessages($mesg, null, 'errors'); } @@ -290,8 +286,7 @@ if ($id) { print ''.$langs->trans("Delete").''; } - else - { + else { print ''.$langs->trans("Delete").''; } print ""; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 6aa7c2b1a87..59adc220c8f 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -138,14 +138,12 @@ class Localtax extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -207,8 +205,7 @@ class Localtax extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -271,8 +268,7 @@ class Localtax extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -378,14 +374,12 @@ class Localtax extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -419,14 +413,12 @@ class Localtax extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -462,14 +454,12 @@ class Localtax extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -548,8 +538,7 @@ class Localtax extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $ok = 0; } @@ -568,21 +557,18 @@ class Localtax extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -605,8 +591,7 @@ class Localtax extends CommonObject if ($result) { return 1; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 61a11a042f2..12112766c24 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -54,16 +54,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month")) { $date_start = dol_get_first_day($year_start, GETPOST("month"), false); $date_end = dol_get_last_day($year_start, GETPOST("month"), false); } - else - { + else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -202,8 +200,7 @@ if ($calc == 0 || $calc == 2) { $intra = $langs->trans('Unknown'); } - else - { + else { $intra = ''; } } @@ -230,15 +227,13 @@ if ($calc == 0 || $calc == 2) print ''.price($total).''; print ''; } - else - { + else { $langs->load("errors"); if ($coll_list == -1) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; elseif ($coll_list == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; - else - print ''.$langs->trans("Error").''; + else print ''.$langs->trans("Error").''; } } @@ -275,8 +270,7 @@ if ($calc == 0 || $calc == 1) { { $intra = $langs->trans('Unknown'); } - else - { + else { $intra = ''; } } @@ -305,15 +299,13 @@ if ($calc == 0 || $calc == 1) { print ''; } - else - { + else { $langs->load("errors"); if ($coll_list == -1) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; elseif ($coll_list == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; - else - print ''.$langs->trans("Error").''; + else print ''.$langs->trans("Error").''; } } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index a08ac99d6bd..b8a906ac818 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -53,14 +53,12 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -153,8 +151,7 @@ function pt($db, $sql, $date) $previousmode = ''; $previousmonth = ''; } - else - { + else { $previousmode = $obj->mode; $previousmonth = $obj->dm; } @@ -389,8 +386,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc //'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 47a0f44be47..58ec8cb090e 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -96,8 +96,7 @@ if ($result) print ""; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 8e2e871251f..45d34f10cce 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -64,16 +64,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -222,11 +220,9 @@ if (!is_array($x_coll) || !is_array($x_paye)) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; elseif ($x_coll == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; - else - print ''.$langs->trans("Error").''; + else print ''.$langs->trans("Error").''; } -else -{ +else { $x_both = array(); //now, from these two arrays, get another array with one rate per line @@ -373,8 +369,7 @@ else print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); } - else - { + else { if ($type) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) @@ -533,8 +528,7 @@ else print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); } - else - { + else { if ($type) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); @@ -573,8 +567,7 @@ else { print $langs->trans("NA"); } - else - { + else { print price(price2num($fields['payment_amount'], 'MT')); if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 4a7e387987c..5c0f258a091 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -313,8 +313,7 @@ if (empty($reshook)) header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -504,8 +503,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $form->select_comptes($accountid, 'accountid', 0, '', 2); print ''; } - else - { + else { print ' '; } print "\n"; @@ -561,8 +559,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $sql .= ' AND type IN (0,1,3,5)'; // Standard invoice, replacement, deposit, situation } - else - { + else { $sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes } // Sort invoices by date and serial number: the older one comes first @@ -666,8 +663,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; } - else - { + else { print ''; } @@ -711,8 +707,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; } - else - { + else { print ''; print ''; } @@ -747,8 +742,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; } - else - { + else { print ''; print ''; } @@ -804,8 +798,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } $db->free($resql); } - else - { + else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index e14581f6531..f67a2e2c12a 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -66,8 +66,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement) $db->commit(); $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -88,14 +87,12 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture-> header("Location: ".$backtopage); exit; } - else - { + else { header("Location: list.php"); exit; } } - else - { + else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -132,8 +129,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture-> header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); exit; } - else - { + else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -148,8 +144,7 @@ if ($action == 'setnum_paiement' && !empty($_POST['num_paiement'])) { setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors'); } } @@ -163,8 +158,7 @@ if ($action == 'setdatep' && !empty($_POST['datepday'])) { setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors'); } } @@ -414,8 +408,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -446,8 +439,7 @@ if ($user->socid == 0 && $action == '') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index eeb578ad731..44a160b35e0 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -80,8 +80,7 @@ if ($action == 'setdate' && $user->rights->banque->cheque) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -99,8 +98,7 @@ if ($action == 'setrefext' && $user->rights->banque->cheque) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -118,8 +116,7 @@ if ($action == 'setref' && $user->rights->banque->cheque) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -150,13 +147,11 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs'); $action = 'new'; } @@ -171,8 +166,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -186,8 +180,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c header("Location: index.php"); exit; } - else - { + else { setEventMessages($paiement->error, $paiement->errors, 'errors'); } } @@ -213,8 +206,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -233,8 +225,7 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban //exit; $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -262,8 +253,7 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) dol_print_error($db, $object->error); exit; } - else - { + else { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc')); exit; } @@ -315,8 +305,7 @@ if ($action == 'new') print load_fiche_titre($langs->trans("Cheques"), '', 'bank_account'); } -else -{ +else { $result = $object->fetch($id, $ref); if ($result < 0) { @@ -510,8 +499,7 @@ if ($action == 'new') { print $paymentstatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -522,8 +510,7 @@ if ($action == 'new') { print $accountlinestatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -544,16 +531,14 @@ if ($action == 'new') { print ''; } - else - { + else { print ''.$langs->trans('NewCheckDepositOn', $account_label).''; } print '
'; print ''; } } -else -{ +else { $paymentstatic = new Paiement($db); $accountlinestatic = new AccountLine($db); $accountstatic = new Account($db); @@ -588,8 +573,7 @@ else print ''; print ''; } - else - { + else { print $object->date_bordereau ? dol_print_date($object->date_bordereau, 'day') : ' '; } @@ -700,8 +684,7 @@ else { print $paymentstatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -712,8 +695,7 @@ else { print $accountlinestatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -737,8 +719,7 @@ else $i++; } } - else - { + else { print ''; print $langs->trans("None"); print ''; @@ -756,8 +737,7 @@ else print ""; } - else - { + else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 746065647d5..9d252a7456e 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -121,8 +121,7 @@ class RemiseCheque extends CommonObject { $this->ref = "(PROV".$this->id.")"; } - else - { + else { $this->ref = $obj->ref; } } @@ -130,8 +129,7 @@ class RemiseCheque extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -228,8 +226,7 @@ class RemiseCheque extends CommonObject } $this->db->free($resql); } - else - { + else { $this->errno = -1026; dol_syslog("RemiseCheque::Create Error ".$this->errno, LOG_ERR); } @@ -270,8 +267,7 @@ class RemiseCheque extends CommonObject } } } - else - { + else { $this->errno = -1; $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); @@ -289,8 +285,7 @@ class RemiseCheque extends CommonObject dol_syslog("RemiseCheque::Create end", LOG_DEBUG); return $this->id; } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::Create end", LOG_DEBUG); return $this->errno; @@ -342,8 +337,7 @@ class RemiseCheque extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::Delete ROLLBACK ($this->errno)"); } @@ -386,14 +380,12 @@ class RemiseCheque extends CommonObject $this->ref = $numref; $this->statut = 1; } - else - { + else { $this->errno = -1029; dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR); } } - else - { + else { $this->errno = -1033; dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR); } @@ -405,8 +397,7 @@ class RemiseCheque extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::Validate ".$this->errno, LOG_ERR); return $this->errno; @@ -489,8 +480,7 @@ class RemiseCheque extends CommonObject return $numref; } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Bank")); return ""; @@ -545,8 +535,7 @@ class RemiseCheque extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -585,8 +574,7 @@ class RemiseCheque extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -665,16 +653,14 @@ class RemiseCheque extends CommonObject //$outputlangs->charset_output=$sav_charset_output; return 1; } - else - { + else { //$outputlangs->charset_output=$sav_charset_output; dol_syslog("Error"); dol_print_error($this->db, $docmodel->error); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorFileDoesNotExists", $dir.$file); return -1; } @@ -721,8 +707,7 @@ class RemiseCheque extends CommonObject dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); } } - else - { + else { $this->errno = -1031; dol_syslog("RemiseCheque::updateAmount ERREUR SELECT ($this->errno)"); } @@ -731,8 +716,7 @@ class RemiseCheque extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::updateAmount ROLLBACK ($this->errno)"); } @@ -762,8 +746,7 @@ class RemiseCheque extends CommonObject { $this->updateAmount(); } - else - { + else { $this->errno = -1032; dol_syslog("RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)"); } @@ -839,30 +822,26 @@ class RemiseCheque extends CommonObject $this->db->commit(); return $rejectedPayment->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $rejectedPayment->error; $this->errors = $rejectedPayment->errors; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $rejectedPayment->error; $this->errors = $rejectedPayment->errors; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -936,14 +915,12 @@ class RemiseCheque extends CommonObject $this->date_bordereau = $date; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } @@ -971,14 +948,12 @@ class RemiseCheque extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index c85553d59a8..7971a34db0d 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -77,8 +77,7 @@ if ($resql) { print ''; print "\n"; } -else -{ +else { dol_print_error($db); } @@ -141,8 +140,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index fe1f7c31050..cda8c2a679d 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -222,8 +222,7 @@ if ($resql) $i++; } } - else - { + else { print ''; print ''.$langs->trans("None").""; print ''; @@ -232,8 +231,7 @@ if ($resql) print ""; print "\n"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 9b0ee645fc7..99250bd9373 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -201,14 +201,12 @@ class Paiement extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->db->free($resql); return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -243,8 +241,7 @@ class Paiement extends CommonObject $amounts = &$this->amounts; $amounts_to_update = &$this->multicurrency_amounts; } - else - { + else { $amounts = &$this->multicurrency_amounts; $amounts_to_update = &$this->amounts; } @@ -283,8 +280,7 @@ class Paiement extends CommonObject $total = $totalamount; $mtotal = $totalamount_converted; // Maybe use price2num with MT for the converted value } - else - { + else { $total = $totalamount_converted; // Maybe use price2num with MT for the converted value $mtotal = $totalamount; } @@ -340,8 +336,7 @@ class Paiement extends CommonObject if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice, nor situation invoice. We do nothing more."); elseif ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); //else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); - else - { + else { // If invoice is a down payment, we also convert down payment to discount if ($invoice->type == Facture::TYPE_DEPOSIT) { @@ -430,14 +425,12 @@ class Paiement extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } } - else - { + else { dol_syslog(get_class($this).'::Create Amount line '.$key.' not a number. We discard it.'); } } @@ -450,8 +443,7 @@ class Paiement extends CommonObject // Fin appel triggers } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -464,8 +456,7 @@ class Paiement extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -502,8 +493,7 @@ class Paiement extends CommonObject return -1; } } - else - { + else { $this->db->rollback(); return -2; } @@ -568,8 +558,7 @@ class Paiement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error; $this->db->rollback(); return -5; @@ -731,8 +720,7 @@ class Paiement extends CommonObject // Fin appel triggers } } - else - { + else { $this->error = $acc->error; $error++; } @@ -741,8 +729,7 @@ class Paiement extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); } } @@ -751,8 +738,7 @@ class Paiement extends CommonObject { return $bank_line_id; } - else - { + else { return -1; } } @@ -777,8 +763,7 @@ class Paiement extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::update_fk_bank '.$this->error); return -1; @@ -840,8 +825,7 @@ class Paiement extends CommonObject $this->db->commit(); return 0; } - else - { + else { $this->db->rollback(); return -2; } @@ -871,8 +855,7 @@ class Paiement extends CommonObject $this->num_payment = $this->db->escape($num); return 0; } - else - { + else { $this->error = 'Error -1 '.$this->db->error(); return -2; } @@ -896,8 +879,7 @@ class Paiement extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::valide '.$this->error); return -1; @@ -920,8 +902,7 @@ class Paiement extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::reject '.$this->error); return -1; @@ -966,8 +947,7 @@ class Paiement extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -1000,8 +980,7 @@ class Paiement extends CommonObject return $billsarray; } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' -', LOG_DEBUG); return -1; @@ -1034,8 +1013,7 @@ class Paiement extends CommonObject return $amounts; } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::getAmountsArray Error '.$this->error.' -', LOG_DEBUG); return -1; @@ -1119,8 +1097,7 @@ class Paiement extends CommonObject return $numref; } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice")); return ""; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 20401d81a1a..dbdf4f4675e 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -130,8 +130,7 @@ if (GETPOST("orphelins", "alpha")) $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } -else -{ +else { $sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives $sql .= " p.statut, p.num_paiement as num_payment,"; $sql .= " c.code as paiement_code,"; @@ -161,7 +160,7 @@ else if ($userid) { if ($userid == -1) $sql .= " AND f.fk_user_author IS NULL"; - else $sql .= " AND f.fk_user_author = ".$userid; + else $sql .= " AND f.fk_user_author = ".$userid; } // Search criteria $sql .= dolSqlDateFilter("p.datep", $day, $month, $year); @@ -379,8 +378,7 @@ if ($resql) print ""; print "\n"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 76a1ce72d76..66f239fdf96 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -71,8 +71,7 @@ if ($action == 'builddoc') { $outputlangs->charset_output = $sav_charset_output; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, $obj->error); } diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 91ef2c215e6..b978fc8e218 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -127,8 +127,7 @@ if ($resql) { print ''.$langs->trans("PaymentStatusToValidShort").''; } - else - { + else { print "-"; } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 509e20f3613..d1b448c5932 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -142,8 +142,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -284,8 +283,7 @@ if ($action == 'create') { print ''.dol_print_date($objp->date_ech, 'day').''."\n"; } - else - { + else { print "!!!\n"; } @@ -306,8 +304,7 @@ if ($action == 'create') print ''; print ''; } - else - { + else { print '-'; } print ""; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 5fdfe327056..69b425356d1 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -67,8 +67,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char header("Location: ".DOL_URL_ROOT."/compta/sociales/payments.php?mode=sconly"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -284,8 +283,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -317,8 +315,7 @@ if ($action == '') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index fd87dd5e447..d2611e8a354 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -159,14 +159,12 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).''; } print "
"; } -else -{ +else { dol_print_error($db); } @@ -221,8 +219,7 @@ if ($result) print "
"; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index c7c717e702b..106f848f732 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -191,8 +191,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index d81e101be3d..d5051e06bfa 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -409,8 +409,7 @@ if ($id > 0 || $ref) { print ''.$langs->trans("StatusRefused").''; } - else - { + else { print " "; } @@ -443,8 +442,7 @@ if ($id > 0 || $ref) $db->free($result); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0c21a3e6d2b..91a165ee454 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -152,20 +152,17 @@ class BonPrelevement extends CommonObject { $result = 0; } - else - { + else { $result = -1; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } } - else - { + else { $result = -2; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } } - else - { + else { $result = -3; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } @@ -209,13 +206,11 @@ class BonPrelevement extends CommonObject { $num = $this->db->num_rows($resql); } - else - { + else { $result = -1; } } - else - { + else { /* * No aggregate */ @@ -244,8 +239,7 @@ class BonPrelevement extends CommonObject $line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes"); $result = 0; } - else - { + else { dol_syslog(get_class($this)."::addline Error -2"); $result = -2; } @@ -321,14 +315,12 @@ class BonPrelevement extends CommonObject return 1; } - else - { + else { dol_syslog(get_class($this)."::Fetch Erreur aucune ligne retournee"); return -1; } } - else - { + else { return -2; } } @@ -397,16 +389,14 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 0; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::set_credite ROLLBACK "); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_credite Ouverture transaction SQL impossible "); return -2; } @@ -491,8 +481,7 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::set_infocredit AddPayment Error"); $error++; } - else - { + else { $result = $paiement->addPaymentToBank($user, 'payment', '(WithdrawalPayment)', $bankaccount, '', ''); if ($result < 0) { @@ -517,8 +506,7 @@ class BonPrelevement extends CommonObject $error++; } } - else - { + else { dol_syslog(get_class($this)."::set_infocredit Update Bons Error"); $error++; } @@ -534,27 +522,23 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 0; } - else - { + else { $this->db->rollback(); dol_syslog("bon-prelevment::set_infocredit ROLLBACK "); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_infocredit 1025 Open SQL transaction impossible "); return -1025; } } - else - { + else { dol_syslog("bon-prelevment::set_infocredit 1027 Date de credit < Date de trans "); return -1027; } } - else - { + else { return -1026; } } @@ -597,8 +581,7 @@ class BonPrelevement extends CommonObject // TODO Call trigger to create a notification using notification module } - else - { + else { $error++; } @@ -610,16 +593,14 @@ class BonPrelevement extends CommonObject return 0; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::set_infotrans ROLLBACK", LOG_ERR); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT); return -2; } @@ -664,8 +645,7 @@ class BonPrelevement extends CommonObject { $row = $this->db->fetch_row($resql); if (!$amounts) $arr[$i] = $row[0]; - else - { + else { $arr[$i] = array( $row[0], $row[1] @@ -676,8 +656,7 @@ class BonPrelevement extends CommonObject } $this->db->free($resql); } - else - { + else { dol_syslog(get_class($this)."::getListInvoices Erreur"); } @@ -715,8 +694,7 @@ class BonPrelevement extends CommonObject return $obj->nb; } - else - { + else { $error = 1; dol_syslog(get_class($this)."::SommeAPrelever Erreur -1"); dol_syslog($this->db->error()); @@ -760,8 +738,7 @@ class BonPrelevement extends CommonObject return $obj->nb; } - else - { + else { $this->error = get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error(); return -1; } @@ -849,8 +826,7 @@ class BonPrelevement extends CommonObject $this->db->free($resql); dol_syslog(__METHOD__."::Read invoices, ".$i." invoices to withdraw", LOG_DEBUG); } - else - { + else { $error++; dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR); } @@ -895,26 +871,22 @@ class BonPrelevement extends CommonObject $i++; //dol_syslog(__METHOD__."::RIB is ok", LOG_DEBUG); } - else - { + else { dol_syslog(__METHOD__."::Check RIB Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_WARNING); $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } - else - { + else { dol_syslog(__METHOD__."::Check RIB Failed to read company", LOG_WARNING); } } - else - { + else { dol_syslog(__METHOD__."::Check RIB Failed to read invoice", LOG_WARNING); } } } - else - { + else { dol_syslog(__METHOD__."::Check RIB No invoice to process", LOG_WARNING); } } @@ -941,8 +913,7 @@ class BonPrelevement extends CommonObject { $ok = 1; } - else - { + else { print $langs->trans("ModeWarning"); //"Option for real mode was not set, we stop after this simulation\n"; } } @@ -1000,14 +971,12 @@ class BonPrelevement extends CommonObject $this->id = $prev_id; $this->ref = $ref; } - else - { + else { $error++; dol_syslog(__METHOD__."::Create withdraw receipt ".$this->db->lasterror(), LOG_ERR); } } - else - { + else { $error++; dol_syslog(__METHOD__."::Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR); } @@ -1129,15 +1098,13 @@ class BonPrelevement extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); } return count($factures_prev); } - else - { + else { return 0; } } @@ -1198,8 +1165,7 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1301,8 +1267,7 @@ class BonPrelevement extends CommonObject { return 0; } - else - { + else { return -1; } } @@ -1327,8 +1292,7 @@ class BonPrelevement extends CommonObject { return 0; } - else - { + else { return -1; } } @@ -1359,8 +1323,7 @@ class BonPrelevement extends CommonObject { $result = 0; } - else - { + else { $result = -1; dol_syslog(get_class($this)."::AddNotification Error $result"); } @@ -1464,8 +1427,7 @@ class BonPrelevement extends CommonObject } $nbtotalDrctDbtTxInf = $i; } - else - { + else { fputs($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers $result = -2; } @@ -1475,8 +1437,7 @@ class BonPrelevement extends CommonObject { $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); } - else - { + else { fputs($this->file, 'ERROR CREDITOR'.$CrLf); // CREDITOR = My company } @@ -1543,8 +1504,7 @@ class BonPrelevement extends CommonObject $i++; } } - else - { + else { $result = -2; } @@ -1915,8 +1875,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; } - else - { + else { fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf); $result = -2; } diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 88b612554df..accd64e2694 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -97,16 +97,14 @@ class LignePrelevement $this->bon_ref = $obj->ref; $this->bon_rowid = $obj->bon_rowid; } - else - { + else { $result++; dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0"); } $this->db->free($resql); } - else - { + else { $result++; dol_syslog("LignePrelevement::Fetch rowid=$rowid"); dol_syslog($this->db->error()); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 8c033353637..1edd942fc42 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -161,8 +161,7 @@ class RejetPrelevement $error++; dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]); } - else - { + else { $result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', ''); if ($result < 0) { @@ -192,8 +191,7 @@ class RejetPrelevement dol_syslog("RejetPrelevement::Create Commit"); $this->db->commit(); } - else - { + else { dol_syslog("RejetPrelevement::Create Rollback"); $this->db->rollback(); } @@ -228,8 +226,7 @@ class RejetPrelevement $userid = $row[0]; } } - else - { + else { dol_syslog("RejetPrelevement::_send_email Erreur lecture user"); } @@ -266,13 +263,11 @@ class RejetPrelevement { dol_syslog("RejetPrelevement::_send_email email envoye"); } - else - { + else { dol_syslog("RejetPrelevement::_send_email Erreur envoi email"); } } - else - { + else { dol_syslog("RejetPrelevement::_send_email Userid invalide"); } } @@ -310,8 +305,7 @@ class RejetPrelevement { $row = $this->db->fetch_row($resql); if (!$amounts) $arr[$i] = $row[0]; - else - { + else { $arr[$i] = array( $row[0], $row[1] @@ -322,8 +316,7 @@ class RejetPrelevement } $this->db->free($resql); } - else - { + else { dol_syslog("getListInvoices", LOG_ERR); } @@ -359,14 +352,12 @@ class RejetPrelevement return 0; } - else - { + else { dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid numrows=0"); return -1; } } - else - { + else { dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid"); return -2; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 5306b6799b9..505ad070645 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -94,8 +94,7 @@ if (empty($reshook)) $mesg .= ''.$val."
\n"; } } - else - { + else { setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); } } @@ -175,21 +174,18 @@ if ($nb) { print ''.$langs->trans("CreateAll")."\n"; } } - else - { + else { if ($mysoc->isInEEC()) { print ''.$langs->trans("CreateForSepaFRST")."\n"; print ''.$langs->trans("CreateForSepaRCUR")."\n"; } - else - { + else { print ''.$langs->trans("CreateAll")."\n"; } } } -else -{ +else { print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; } @@ -308,16 +304,14 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print ""; print ""; print "
\n"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 181f71a678c..64ac904db6c 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -89,8 +89,7 @@ if (!$status) { $title = $langs->trans("RequestStandingOrderToTreat"); } -else -{ +else { $title = $langs->trans("RequestStandingOrderTreated"); } @@ -143,8 +142,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index fb0a5548426..bb3cced3eb4 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -135,8 +135,7 @@ if ($prev_id > 0 || $ref) dol_fiche_end(); } - else - { + else { dol_print_error($db); } } @@ -290,8 +289,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 1cc454a3d4d..4bfc07b0292 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -136,8 +136,7 @@ if ($prev_id > 0 || $ref) dol_fiche_end(); } - else - { + else { dol_print_error($db); } } @@ -221,8 +220,7 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } @@ -239,8 +237,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 18028e2059a..5dd01bad41d 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -133,8 +133,7 @@ if ($prev_id > 0 || $ref) dol_fiche_end(); } - else - { + else { $langs->load("errors"); print $langs->trans("Error"); } @@ -186,8 +185,7 @@ if ($prev_id > 0 || $ref) print ""; $db->free($resql); } - else - { + else { print $db->error().' '.$sql; } } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index eb2932fd4cb..faa56184891 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -159,14 +159,12 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders")).''; } print "
"; } -else -{ +else { dol_print_error($db); } @@ -221,8 +219,7 @@ if ($result) print "
"; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 9169f71a377..89d6ad93636 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -103,13 +103,11 @@ if ($action == 'confirm_rejet') exit; } } - else - { + else { $action = "rejet"; } } - else - { + else { header("Location: line.php?id=".$id); exit; } @@ -162,15 +160,13 @@ if ($id) /* Historique pour certaines install */ print $langs->trans("Unknown"); } - else - { + else { print dol_print_date($rej->date_rejet, 'day'); } print ''; print ''.$langs->trans("RefusedInvoicing").''.$rej->invoicing.''; } - else - { + else { print ''.$resf.''; } } @@ -178,8 +174,7 @@ if ($id) print ''; dol_fiche_end(); } - else - { + else { dol_print_error($db); } @@ -246,13 +241,11 @@ if ($id) { print "id\">".$langs->trans("StandingOrderReject").""; } - else - { + else { print "trans("NotAllowed")."\">".$langs->trans("StandingOrderReject").""; } } - else - { + else { print "trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject").""; } } @@ -330,8 +323,7 @@ if ($id) $db->free($result); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 48f9bcc7c54..b93042df8e6 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -236,8 +236,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 6d1994b7a4b..a7e7a6f3a53 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -118,8 +118,7 @@ if ($result) print ""; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index c6d1962ff46..609c75e065d 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -126,8 +126,7 @@ if ($resql) print ""; $db->free(); } -else -{ +else { dol_print_error($db); } @@ -220,8 +219,7 @@ if ($resql) print ""; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 3f2112537b1..83388f21e49 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -212,14 +212,12 @@ if ($id > 0) $db->free($resqlp); } - else - { + else { dol_print_error($db); } } } - else - { + else { dol_print_error($db); } @@ -289,8 +287,7 @@ if ($id > 0) print ""; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 27bc4526a3e..8d7c0343b30 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -151,7 +151,7 @@ if ($modecompta == "CREANCES-DETTES") $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesResultDue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -213,8 +213,7 @@ if ($modecompta == 'BOOKKEEPING') { print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'amount', '', $param, 'class="right"', $sortfield, $sortorder); } -else -{ +else { if ($modecompta == 'CREANCES-DETTES') { print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], 'amount_ht', '', $param, 'class="right"', $sortfield, $sortorder); @@ -313,15 +312,13 @@ if ($modecompta == 'BOOKKEEPING') $i++; } } - else - { + else { print ''.$langs->trans("NoRecordFound").''; } } else dol_print_error($db); } -else -{ +else { /* * Factures clients */ @@ -336,8 +333,7 @@ else $sql .= " AND f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2,5)"; - else - $sql .= " AND f.type IN (0,1,2,3,5)"; + else $sql .= " AND f.type IN (0,1,2,3,5)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } @@ -463,8 +459,7 @@ else $sql .= " AND f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2)"; - else - $sql .= " AND f.type IN (0,1,2,3)"; + else $sql .= " AND f.type IN (0,1,2,3)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } @@ -518,8 +513,7 @@ else $i++; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; @@ -768,15 +762,13 @@ else $i++; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; } } - else - { + else { dol_print_error($db); } print ''; @@ -854,15 +846,13 @@ else print ''; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; } } - else - { + else { dol_print_error($db); } print ''; @@ -888,8 +878,7 @@ else $sql .= " WHERE p.entity IN (".getEntity('donation').")"; $sql .= " AND fk_statut in (1,2)"; } - else - { + else { $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."don as p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; @@ -936,15 +925,13 @@ else $i++; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; } } - else - { + else { dol_print_error($db); } print ''; @@ -1083,8 +1070,7 @@ else $sql .= " WHERE f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2,5)"; - else - $sql .= " AND f.type IN (0,1,2,3,5)"; + else $sql .= " AND f.type IN (0,1,2,3,5)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -1131,8 +1117,7 @@ else $sql .= " WHERE f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2)"; - else - $sql .= " AND f.type IN (0,1,2,3)"; + else $sql .= " AND f.type IN (0,1,2,3)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; $sql .= " AND f.entity = ".$conf->entity; @@ -1173,8 +1158,7 @@ else print ''.price($amount)."\n"; print "\n"; } - else - { + else { // VAT really already paid $amount = 0; $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; @@ -1254,8 +1238,7 @@ else } $db->free($result); } - else - { + else { dol_print_error($db); } print ' '; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index ad81a3943c1..04bed25d6b2 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -131,7 +131,7 @@ if ($modecompta == 'CREANCES-DETTES') $description = $langs->trans("RulesAmountWithTaxIncluded"); $description .= '
'.$langs->trans("RulesResultDue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= "
".$langs->trans("DepositsAreNotIncluded"); - else $description .= "
".$langs->trans("DepositsAreIncluded"); + else $description .= "
".$langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -724,8 +724,7 @@ if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' | } } } - else - { + else { dol_print_error($db); } } @@ -786,8 +785,7 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } } } - else - { + else { dol_print_error($db); } } @@ -826,8 +824,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba } } } - else - { + else { dol_print_error($db); } @@ -856,8 +853,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba } } } - else - { + else { dol_print_error($db); } } @@ -894,8 +890,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan } } } - else - { + else { dol_print_error($db); } } @@ -961,8 +956,7 @@ if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) } } } - else - { + else { dol_print_error($db); } } @@ -1042,8 +1036,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $totsorties[$annee] += $decaiss[$case]; } } - else - { + else { if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0) { print ''.price(price2num($decaiss_ttc[$case], 'MT')).''; @@ -1063,8 +1056,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $totentrees[$annee] += $encaiss[$case]; } } - else - { + else { if (isset($encaiss_ttc[$case])) { print ''.price(price2num($encaiss_ttc[$case], 'MT')).''; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 66adea3371f..172929aabff 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -178,7 +178,7 @@ if ($modecompta == "CREANCES-DETTES") //$periodlink=''.img_previous().' '.img_next().''; $description = $langs->trans("RulesResultDue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -375,7 +375,7 @@ elseif ($modecompta == "BOOKKEEPING") print "\n"; //var_dump($sommes); - } else // normal category + } else // normal category { $code = $cat['code']; // Category code we process diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index d7f20622a43..0cb706d3177 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -129,8 +129,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') header("Location: list.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -166,8 +165,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer) setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } - else - { + else { $object->type = $actioncode; $object->label = GETPOST('label', 'alpha'); $object->date_ech = $dateech; @@ -211,8 +209,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->cre setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } - else - { + else { $result = $object->fetch($id); $object->date_ech = $dateech; @@ -272,8 +269,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $id = $originalId; $db->rollback(); @@ -281,8 +277,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char } } } - else - { + else { $db->rollback(); dol_print_error($db, $object->error); } @@ -432,8 +427,7 @@ if ($id > 0) { $formquestion[] = array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1); } - else - { + else { $formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1); } @@ -536,8 +530,7 @@ if ($id > 0) { print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1); } - else - { + else { print dol_print_date($object->periode, "day"); } print ""; @@ -675,8 +668,7 @@ if ($id > 0) $i++; } } - else - { + else { print ''.$langs->trans("None").''; print ''; print ''; @@ -696,8 +688,7 @@ if ($id > 0) $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -768,8 +759,7 @@ if ($id > 0) print ""; } } - else - { + else { /* Social contribution not found */ dol_print_error('', $object->error); } diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6d3f4dffa4a..0c709c031d5 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -172,13 +172,11 @@ class ChargeSociales extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -258,8 +256,7 @@ class ChargeSociales extends CommonObject return -1 * $error; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -329,8 +326,7 @@ class ChargeSociales extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -387,8 +383,7 @@ class ChargeSociales extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -422,13 +417,11 @@ class ChargeSociales extends CommonObject $this->db->free($result); return $obj->amount; } - else - { + else { return 0; } } - else - { + else { print $this->db->error(); return -1; } @@ -613,8 +606,7 @@ class ChargeSociales extends CommonObject $this->db->free($resql); return $amount; } - else - { + else { return -1; } } @@ -668,8 +660,7 @@ class ChargeSociales extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index bae8d28a756..9164ab39f1e 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -200,8 +200,7 @@ class PaymentSocialContribution extends CommonObject } } } - else - { + else { $error++; } } @@ -216,8 +215,7 @@ class PaymentSocialContribution extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -287,8 +285,7 @@ class PaymentSocialContribution extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -359,8 +356,7 @@ class PaymentSocialContribution extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -415,8 +411,7 @@ class PaymentSocialContribution extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -466,8 +461,7 @@ class PaymentSocialContribution extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -578,8 +572,7 @@ class PaymentSocialContribution extends CommonObject } } } - else - { + else { $this->error = $acc->error; $error++; } @@ -589,8 +582,7 @@ class PaymentSocialContribution extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -614,8 +606,7 @@ class PaymentSocialContribution extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 3c73c8e6614..e63c5f354d0 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -164,8 +164,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 9d210c23d85..be5f7e6f973 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -81,8 +81,7 @@ if (!GETPOSTISSET('search_typeid')) if ($part[0] == 'cs.fk_type') $search_typeid = $part[1]; } } -else -{ +else { $search_typeid = GETPOST('search_typeid', 'int'); } @@ -209,8 +208,7 @@ if ($resql) print $countrynotdefined; print ''; } - else - { + else { print '
'; print ''."\n"; @@ -314,8 +312,7 @@ if ($resql) { print 'jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode), 'day').''; } - else - { + else { print ' '; } print "\n"; @@ -346,8 +343,7 @@ if ($resql) } print ''; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 5cfa5df06ed..05808877df9 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -93,8 +93,7 @@ if ($mode != 'sconly') $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); } -else -{ +else { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit); } @@ -209,8 +208,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print '"; print ""; } - else - { + else { dol_print_error($db); } print '
'.price($totalpaye)."
'; @@ -288,8 +286,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -311,8 +308,7 @@ elseif ($mysoc->localtax2_assuj == "1") $j = 2; $numlt = 3; } -else -{ +else { $j = 0; $numlt = 0; } @@ -389,8 +385,7 @@ while ($j < $numlt) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -473,8 +468,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) print "
"; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index acd58f90217..3859b19df91 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -78,8 +78,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 5831467ce63..513b0ffa350 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -104,8 +104,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 4d4f56a1354..6d720b4f96d 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -97,8 +97,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } } -else -{ +else { // TODO We define q } // $date_start and $date_end are defined. We force $year_start and $nbofyear @@ -154,7 +153,7 @@ if ($modecompta == "CREANCES-DETTES") { //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index bec20998cfa..85a27c7574a 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -114,8 +114,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } } -else -{ +else { // TODO We define q } @@ -180,7 +179,7 @@ if ($modecompta == "CREANCES-DETTES") //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index d1a64e218d2..cfc521c7c13 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -124,7 +124,7 @@ if ($modecompta == "CREANCES-DETTES") $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -260,8 +260,7 @@ if ($modecompta == 'RECETTES-DEPENSES') $i++; } } - else - { + else { dol_print_error($db); } } @@ -340,8 +339,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre. print ''.price($cum_ht[$case], 1).''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -357,8 +355,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print price($cum[$case], 1); if ($modecompta != 'BOOKKEEPING') print ''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -391,8 +388,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print '-'; } } - else - { + else { print ''; if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } @@ -484,8 +480,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total_ht[$annee] ?price($total_ht[$annee]) : "0").""; } - else - { + else { print ' '; } } @@ -495,8 +490,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total[$annee] ?price($total[$annee]) : "0").""; } - else - { + else { print ' '; } @@ -520,8 +514,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) print '+0%'; } } - else - { + else { print ''; if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; } diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 3ff41f4d114..e9e0ec5926c 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -290,8 +290,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre. print ''.price($cum_ht[$case], 1).''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -307,8 +306,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print price($cum[$case], 1); if ($modecompta != 'BOOKKEEPING') print ''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -341,8 +339,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print '-'; } } - else - { + else { print ''; if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } @@ -369,8 +366,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total_ht[$annee] ?price($total_ht[$annee]) : "0").""; } - else - { + else { print ' '; } } @@ -380,8 +376,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total[$annee] ?price($total[$annee]) : "0").""; } - else - { + else { print ' '; } @@ -405,8 +400,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) print '+0%'; } } - else - { + else { print ''; if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; } diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index fafb967ace1..9b25488c280 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -101,8 +101,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index fcae12f744b..76f9c246e87 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -108,8 +108,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } } -else -{ +else { // TODO We define q } diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 658c9353a00..3df7419019a 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -132,8 +132,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) header("Location: list.php"); exit; } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -167,21 +166,18 @@ if ($action == 'delete') header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php'); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; setEventMessages($mesg, null, 'errors'); } @@ -389,13 +385,11 @@ if ($id) { print ''; } - else - { + else { print ''; } } - else - { + else { print ''; } print "
"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index c01408f3c9a..baeaff7a5d6 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -151,14 +151,12 @@ class Tva extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -225,8 +223,7 @@ class Tva extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -294,8 +291,7 @@ class Tva extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -405,14 +401,12 @@ class Tva extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -446,14 +440,12 @@ class Tva extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -489,14 +481,12 @@ class Tva extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -613,8 +603,7 @@ class Tva extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $ok = 0; } @@ -633,20 +622,17 @@ class Tva extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -670,8 +656,7 @@ class Tva extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -753,8 +738,7 @@ class Tva extends CommonObject $this->db->free($resql); return $amount; } - else - { + else { return -1; } } @@ -800,8 +784,7 @@ class Tva extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index bcedba7a074..158c974114d 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -67,8 +67,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", 'int')) { $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), false); } - else - { + else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; @@ -92,8 +91,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -322,8 +320,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) 'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { $invoice_supplier->id = $x_paye[$my_paye_thirdpartyid]['facid'][$id]; $invoice_supplier->ref = $x_paye[$my_paye_thirdpartyid]['facnum'][$id]; $invoice_supplier->type = $x_paye[$my_paye_thirdpartyid]['type'][$id]; @@ -694,8 +691,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print $langs->trans("NA"); } - else - { + else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index fabaf1ee705..45efc9681d8 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -149,8 +149,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 0a785aa78cd..c85f2bbdb8f 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -58,8 +58,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; @@ -83,8 +82,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -177,8 +175,7 @@ function pt($db, $sql, $date) $previousmode = ''; $previousmonth = ''; } - else - { + else { $previousmode = $obj->mode; $previousmonth = $obj->dm; } @@ -372,8 +369,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc //'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 003a7eabcad..98eede887c8 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -73,8 +73,7 @@ if (empty($_REQUEST['typeid'])) if ($part[0] == 't.fk_typepayment') $typeid = $part[1]; } } -else -{ +else { $typeid = $_REQUEST['typeid']; } @@ -229,8 +228,7 @@ if ($result) { $type = ''.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; } - else - { + else { $type = ' '; } @@ -292,8 +290,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 79ee69a030c..6e16165ab6c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -67,8 +67,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; @@ -92,8 +91,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -316,8 +314,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) 'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { $invoice_supplier->id = $x_paye[$my_paye_rate]['facid'][$id]; $invoice_supplier->ref = $x_paye[$my_paye_rate]['facnum'][$id]; $invoice_supplier->type = $x_paye[$my_paye_rate]['type'][$id]; @@ -440,8 +437,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); } } - else - { + else { if ($type) { $text = img_object($langs->trans('Service'), 'service'); } else { @@ -621,8 +617,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); } } - else - { + else { if ($type) { $text = img_object($langs->trans('Service'), 'service'); } else { @@ -674,8 +669,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print $langs->trans("NA"); } - else - { + else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 625cf524169..874a964a965 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -77,8 +77,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); @@ -160,8 +159,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index fbd31812fe8..e005d3dca7b 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -120,8 +120,7 @@ abstract class ActionsContactCardCommon $this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company_id'] = $objsoc->id; } - else - { + else { $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); } @@ -223,8 +222,7 @@ abstract class ActionsContactCardCommon $objsoc->fetch($this->object->socid); $this->tpl['company'] = $objsoc->getNomUrl(1); } - else - { + else { $this->tpl['company'] = $langs->trans("ContactNotLinkedToCompany"); } @@ -310,8 +308,7 @@ abstract class ActionsContactCardCommon { $obj = $this->db->fetch_object($resql); } - else - { + else { dol_print_error($this->db); } $this->object->country_id = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label; diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 54b3f137967..6ac81ac8bd4 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -105,8 +105,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); } - else - { + else { // Confirm delete contact if ($action == 'delete' && $user->rights->societe->contact->supprimer) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index a6e5bee1898..885878138ba 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -129,20 +129,17 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $error = $nuser->error; $errors = $nuser->errors; $db->rollback(); } } - else - { + else { $error = $nuser->error; $errors = $nuser->errors; $db->rollback(); } } - else - { + else { $error = $object->error; $errors = $object->errors; } } @@ -156,8 +153,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -171,8 +167,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -278,8 +273,7 @@ if (empty($reshook)) header("Location: ".$url); exit; } - else - { + else { $db->rollback(); } } @@ -300,14 +294,12 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -351,8 +343,7 @@ if (empty($reshook)) { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); // Create thumbs @@ -360,13 +351,11 @@ if (empty($reshook)) } } } - else - { + else { $errors[] = "ErrorBadImageFormat"; } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -452,8 +441,7 @@ if (empty($reshook)) } } } - else - { + else { $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = '".$db->escape($object->email)."' AND entity = ".$db->escape(getEntity('mailing', 0)); $resql = $db->query($sql); } @@ -465,8 +453,7 @@ if (empty($reshook)) $object->old_firstname = ''; $action = 'view'; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } @@ -526,8 +513,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -703,8 +689,7 @@ else { print ''; } - else - { + else { print ''; } @@ -712,8 +697,7 @@ else { print $formcompany->select_state(GETPOST("state_id", 'alpha') ? GETPOST("state_id", 'alpha') : $object->state_id, $object->country_code, 'state_id'); } - else - { + else { print $countrynotdefined; } print ''; @@ -871,8 +855,7 @@ else { print $form->selectDate($object->birthday, 'birthday', 0, 0, 0, "perso", 1, 0); } - else - { + else { print $form->selectDate('', 'birthday', 0, 0, 1, "perso", 1, 0); } print ''; @@ -882,8 +865,7 @@ else { print ''; } - else - { + else { print ''; } print ''; @@ -900,8 +882,7 @@ else print '     '; print ''; } - else - { + else { print '     '; print ''; } @@ -1031,8 +1012,7 @@ else { print ''; } - else - { + else { print ''; } @@ -1070,8 +1050,7 @@ else print ''.$langs->trans("NbOfEMailingsSend").''; print ''.$object->getNbOfEMailings().''; } - else - { + else { print ''; } print ''; @@ -1096,8 +1075,7 @@ else print ''; print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ?GETPOST("no_email", 'alpha') : $noemail), 1).''; } - else - { + else { print ''; } print ''; @@ -1479,8 +1457,7 @@ else $langs->load("mails"); print ''; } - else - { + else { $langs->load("mails"); print ''; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d9753001db2..fc640e7e032 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -288,8 +288,7 @@ class Contact extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; @@ -389,15 +388,13 @@ class Contact extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -597,15 +594,13 @@ class Contact extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -$error; } } - else - { + else { $this->error = $this->db->lasterror().' sql='.$sql; $this->db->rollback(); return -1; @@ -762,13 +757,11 @@ class Contact extends CommonObject $this->error = $this->db->lasterror(); } } - else - { + else { $result = true; } } - else - { + else { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert "; $sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id; $result = $this->db->query($sql); @@ -792,8 +785,7 @@ class Contact extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -$error; @@ -846,8 +838,7 @@ class Contact extends CommonObject $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; if ($id) $sql .= " WHERE c.rowid = ".$id; - else - { + else { $sql .= " WHERE c.entity IN (".getEntity($this->element).")"; if ($ref_ext) { $sql .= " AND c.ref_ext = '".$this->db->escape($ref_ext)."'"; @@ -943,8 +934,7 @@ class Contact extends CommonObject } $this->db->free($resql); } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -971,8 +961,7 @@ class Contact extends CommonObject } $this->db->free($resql); } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -988,14 +977,12 @@ class Contact extends CommonObject return 1; } - else - { + else { $this->error = $langs->trans("RecordNotFound"); return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1062,8 +1049,7 @@ class Contact extends CommonObject $this->db->free($resql); return 0; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1119,8 +1105,7 @@ class Contact extends CommonObject $i++; } } - else - { + else { $error++; $this->error = $this->db->error().' sql='.$sql; } @@ -1187,8 +1172,7 @@ class Contact extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); dol_syslog("Error ".$this->error, LOG_ERR); return -1; @@ -1236,8 +1220,7 @@ class Contact extends CommonObject $this->db->free($resql); } - else - { + else { print $this->db->error(); } } @@ -1263,8 +1246,7 @@ class Contact extends CommonObject $this->db->free($resql); return $nb; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1526,8 +1508,7 @@ class Contact extends CommonObject $this->db->rollback(); return -$error; } - else - { + else { $this->db->commit(); return 1; } @@ -1681,8 +1662,7 @@ class Contact extends CommonObject return $tab; } - else - { + else { $this->error = $this->db->error(); dol_print_error($this->db); return -1; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index ad4b5ca08f5..ff3570e7e82 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -424,8 +424,7 @@ if ($sql_select) { print $documentstaticline->getLibStatut(2); } - else - { + else { print $documentstatic->getLibStatut(2); } print ''; @@ -468,8 +467,7 @@ if ($sql_select) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - { + else { $label = $objp->product_label; } @@ -516,14 +514,12 @@ if ($sql_select) // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } - else - { + else { echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } } - else - { + else { if ($objp->fk_product > 0) { echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 842d03cb3a6..7934bbd5996 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -68,8 +68,7 @@ if ($action == 'dolibarr2ldap') setEventMessages($langs->trans("ContactSynchronized"), null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); $db->rollback(); } @@ -107,8 +106,7 @@ if ($object->socid > 0) print ''.$langs->trans("ThirdParty").''.$thirdparty->getNomUrl(1).''; } -else -{ +else { print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; @@ -184,21 +182,18 @@ if ($result > 0) { print ''.$langs->trans("ErrorFailedToReadLDAP").''; } - else - { + else { $result = show_ldap_content($records, 0, $records['count'], true); } } - else - { + else { print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')'; } $ldap->unbind(); $ldap->close(); } -else -{ +else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9e7485d189f..a6add5c7d75 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -327,8 +327,7 @@ if ($search_priv != '0' && $search_priv != '1') { $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id."))"; } -else -{ +else { if ($search_priv == '0') $sql .= " AND p.priv='0'"; if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; } @@ -404,8 +403,7 @@ if ($view == "recent") { $sql .= $db->order("p.datec", "DESC"); } -else -{ +else { $sql .= $db->order($sortfield, $sortorder); } @@ -923,8 +921,7 @@ while ($i < min($num, $limit)) $objsoc->fetch($obj->socid); print $objsoc->getNomUrl(1); } - else - print ' '; + else print ' '; print ''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 5a6ea3eb032..5665030b6d5 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -86,20 +86,17 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- { setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } - else - { + else { // Create thumbs $object->addThumbs($newfile); } } } - else - { + else { setEventMessages("ErrorBadImageFormat", null, 'errors'); } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -112,8 +109,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- } } } - else - { + else { $error = $object->error; } } @@ -184,8 +180,7 @@ if ($action == 'edit') print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } - else - { + else { print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; @@ -208,8 +203,7 @@ if ($action == 'edit') { print ''; } - else - { + else { print ''; } print ''; @@ -226,8 +220,7 @@ if ($action == 'edit') print ""; } -else -{ +else { // View mode dol_fiche_head($head, 'perso', $title, -1, 'contact'); @@ -302,8 +295,7 @@ else else print $langs->trans("BirthdayAlertOff"); print ''; } - else - { + else { print ''.$langs->trans("DateToBirth").''; } print ""; diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 75362491424..ee325317033 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -102,8 +102,7 @@ if ($company->id) $v->setEmail($company->email, 'INTERNET'); } // when e-mail of contact and company complete different use company e-mail at first (and contact e-mail at second) - else - { + else { $v->setEmail($company->email); // support by Microsoft Outlook (2019 and possible earlier) diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 0055b0ba428..36a9c950069 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -40,8 +40,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9f825cdf009..7a2f8cf311f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -133,8 +133,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -303,8 +302,7 @@ if (empty($reshook)) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; } - else - { + else { $label = $lines[$i]->product_label; } $desc = ($lines[$i]->desc && $lines[$i]->desc != $lines[$i]->libelle) ?dol_htmlentitiesbr($lines[$i]->desc) : ''; @@ -355,8 +353,7 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); $error++; } @@ -368,14 +365,12 @@ if (empty($reshook)) if ($reshook < 0) $error++; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } } - else - { + else { $result = $object->create($user); if ($result > 0) { @@ -408,8 +403,7 @@ if (empty($reshook)) $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -514,8 +508,7 @@ if (empty($reshook)) { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } - else - { + else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -526,8 +519,7 @@ if (empty($reshook)) $fk_unit = $prod->fk_unit; } - else - { + else { $pu_ht = GETPOST('price_ht'); $price_base_type = 'HT'; $tva_tx = GETPOST('tva_tx') ?str_replace('*', '', GETPOST('tva_tx')) : 0; // tva_tx field may be disabled, so we use vat rate 0 @@ -543,8 +535,7 @@ if (empty($reshook)) $fk_fournprice = $_POST['fournprice']; if (!empty($_POST['buying_price'])) $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; + else $pa_ht = null; $info_bits = 0; if ($tva_npr) $info_bits |= 0x01; @@ -555,8 +546,7 @@ if (empty($reshook)) $object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); $result = -1; } - else - { + else { // Insert line $result = $object->addline( $desc, @@ -630,8 +620,7 @@ if (empty($reshook)) unset($_POST['date_endmonth']); unset($_POST['date_endyear']); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -692,8 +681,7 @@ if (empty($reshook)) $fk_fournprice = $_POST['fournprice']; if (!empty($_POST['buying_price'])) $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; + else $pa_ht = null; $fk_unit = GETPOST('unit', 'alpha'); @@ -745,8 +733,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -760,8 +747,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -789,8 +775,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -832,8 +817,7 @@ if (empty($reshook)) header("Location: list.php?restore_lastsearch_values=1"); return; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -851,13 +835,11 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); return; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } } @@ -1015,15 +997,13 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1058,8 +1038,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { if ($object->id > 0) { $result = $object->createFromClone($user, $socid); if ($result > 0) { @@ -1120,8 +1099,7 @@ if ($action == 'create') { $projectid = GETPOST('originid'); } - else - { + else { // For compatibility if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } @@ -1196,8 +1174,7 @@ if ($action == 'create') print ''; print ''; } - else - { + else { print ''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); print ' '.$langs->trans("AddThirdParty").''; @@ -1292,8 +1269,7 @@ if ($action == 'create') print "\n"; } -else -/* *************************************************************************** */ +else /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ @@ -1600,8 +1576,7 @@ else print ''; } - else - { + else { print ''.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."\n"; } // VAT @@ -1623,8 +1598,7 @@ else { print ''.$objp->remise_percent."%\n"; } - else - { + else { print ' '; } @@ -1709,8 +1683,7 @@ else } } // Line in mode update - else - { + else { // Ligne carac print ''; print ''; @@ -1724,8 +1697,7 @@ else print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; print '
'; } - else - { + else { print $objp->label ? $objp->label.'
' : ''; } @@ -1802,8 +1774,7 @@ else $db->free($result); } - else - { + else { dol_print_error($db); } @@ -1874,8 +1845,7 @@ else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEndReal")), null, 'errors'); } - else - { + else { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne', 'int')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService", dol_print_date($dateactend, "%A %d %B %Y")), "confirm_closeline", '', 0, 1); } print '
'; @@ -2112,8 +2082,7 @@ else if ($object->statut == 1) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { print ''; - } else - print ''; + } else print ''; } } @@ -2153,8 +2122,7 @@ else { print ''; } - else - { + else { print ''; } } @@ -2164,8 +2132,7 @@ else { print ''; } - else - { + else { print ''; } @@ -2185,8 +2152,7 @@ else { print ''; } - else - { + else { print ''; } } diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index a35d3c871de..9caa33fca2d 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -465,8 +465,7 @@ class Contracts extends DolibarrApi if ($updateRes > 0) { return $this->get($id); } - else - { + else { throw new RestException(405, $this->contract->error); } } @@ -502,8 +501,7 @@ class Contracts extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->contract->error); } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 1dec473edac..304628d97cc 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -299,15 +299,13 @@ class Contrat extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; dol_print_error($db, get_class($this)."::getNextValue ".$obj->error); return ""; } } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Contract")); return ""; @@ -411,8 +409,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -468,8 +465,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -513,8 +509,7 @@ class Contrat extends CommonObject { $num = $this->getNextNumRef($this->thirdparty); } - else - { + else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -592,8 +587,7 @@ class Contrat extends CommonObject $this->date_validation = $now; } } - else - { + else { $error++; } @@ -602,8 +596,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -667,8 +660,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -771,15 +763,13 @@ class Contrat extends CommonObject return $this->id; } } - else - { + else { dol_syslog(get_class($this)."::fetch Contract not found"); $this->error = "Contract not found"; return 0; } } - else - { + else { dol_syslog(get_class($this)."::fetch Error searching contract"); $this->error = $this->db->error(); return -1; @@ -940,8 +930,7 @@ class Contrat extends CommonObject } $this->db->free($result); } - else - { + else { dol_syslog(get_class($this)."::Fetch Error when reading lines of contracts linked to products"); return -3; } @@ -1082,7 +1071,7 @@ class Contrat extends CommonObject } } } - 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); @@ -1146,23 +1135,20 @@ class Contrat extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { dol_syslog(get_class($this)."::create - 30 - ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } - else - { + else { $this->error = "Failed to add contract"; dol_syslog(get_class($this)."::create - 20 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $langs->trans("UnknownError: ".$this->db->error()." -", LOG_DEBUG); $this->db->rollback(); @@ -1332,8 +1318,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1427,8 +1412,7 @@ class Contrat extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1506,8 +1490,7 @@ class Contrat extends CommonObject { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -1559,8 +1542,7 @@ class Contrat extends CommonObject { return $result; } - else - { + else { $pa_ht = $result; } } @@ -1632,21 +1614,18 @@ class Contrat extends CommonObject $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return $contractlineid; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error()." sql=".$sql; return -1; } } - else - { + else { dol_syslog(get_class($this)."::addline ErrorTryToAddLineOnValidatedContract", LOG_ERR); return -2; } @@ -1699,8 +1678,7 @@ class Contrat extends CommonObject $remise = round(($pu * $remise_percent / 100), 2); $price = $pu - $remise; } - else - { + else { $remise_percent = 0; } @@ -1751,8 +1729,7 @@ class Contrat extends CommonObject { return $result; } - else - { + else { $pa_ht = $result; } } @@ -1826,15 +1803,13 @@ class Contrat extends CommonObject return 1; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::updateline Erreur -2"); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); dol_syslog(get_class($this)."::updateline Erreur -1"); @@ -1896,8 +1871,7 @@ class Contrat extends CommonObject return -1; } } - else - { + else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } @@ -1994,8 +1968,7 @@ class Contrat extends CommonObject $text .= ($mode == 7 ? '' : ''); return $text; } - else - { + else { return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } } @@ -2114,8 +2087,7 @@ class Contrat extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2151,8 +2123,7 @@ class Contrat extends CommonObject } return $tab; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2189,8 +2160,7 @@ class Contrat extends CommonObject } return $tab; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2291,8 +2261,7 @@ class Contrat extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2334,8 +2303,7 @@ class Contrat extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2960,8 +2928,7 @@ class ContratLigne extends CommonObjectLine return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -3047,8 +3014,7 @@ class ContratLigne extends CommonObjectLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -3196,8 +3162,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -3279,8 +3244,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error()." sql=".$sql; return -1; @@ -3334,8 +3298,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 1da2416ce84..250d89e3e88 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -71,8 +71,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $msg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); @@ -91,8 +90,7 @@ if ($action == 'swapstatut' && $user->rights->contrat->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db, $object->error); } } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index fd3b3f66e4a..e43db63826f 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -194,8 +194,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 2a7c9c0d91a..4530d01a6af 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -141,8 +141,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } // Search by status (only expired) @@ -180,8 +179,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -299,15 +297,13 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) $i++; } } - else - { + else { print ''.$langs->trans("NoContracts").''; } print "
"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -384,8 +380,7 @@ if ($result) print ""; } -else -{ +else { dol_print_error($db); } @@ -440,8 +435,7 @@ if ($resql) $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } - else - { + else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -463,8 +457,7 @@ if ($resql) print ""; } -else -{ +else { dol_print_error($db); } @@ -520,8 +513,7 @@ if ($resql) $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } - else - { + else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -542,8 +534,7 @@ if ($resql) print ""; } -else -{ +else { dol_print_error($db); } @@ -600,8 +591,7 @@ if ($resql) $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } - else - { + else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -622,8 +612,7 @@ if ($resql) print ""; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a7205730817..5053b703966 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -732,8 +732,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } - else - { + else { print ' '; } print ''; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 2b81ceff5fa..62a853270e1 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -98,14 +98,12 @@ if ($search_status != '') $tmp = explode('&', $search_status); $mode = $tmp[0]; if (empty($tmp[1])) $filter = ''; - else - { + else { if ($tmp[1] == 'filter=notexpired') $filter = 'notexpired'; if ($tmp[1] == 'filter=expired') $filter = 'expired'; } } -else -{ +else { $search_status = $mode; if ($filter == 'expired') $search_status .= '&filter=expired'; if ($filter == 'notexpired') $search_status .= '&filter=notexpired'; @@ -598,8 +596,7 @@ while ($i < min($num, $limit)) print $obj->label ? ' - '.dol_trunc($obj->label, 16) : ''; if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) print '
'.dol_nl2br($obj->description); } - else - { + else { if ($obj->type == 0) print img_object($obj->description, 'product').' '.dol_trunc($obj->description, 24); if ($obj->type == 1) print img_object($obj->description, 'service').' '.dol_trunc($obj->description, 24); } @@ -725,8 +722,7 @@ while ($i < min($num, $limit)) // If contract is draft, we say line is also draft print $contractstatic->LibStatut(0, 5); } - else - { + else { print $staticcontratligne->LibStatut($obj->statut, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now) ? 1 : 0); } print ''; diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index b9c00885d69..fe5b015214a 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -51,8 +51,7 @@ if (!empty($actionsave)) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -97,8 +96,7 @@ if (empty($conf->global->CRON_DISABLE_KEY_CHANGE)) if (!empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); } -else -{ +else { print (!empty($conf->global->CRON_KEY) ? $conf->global->CRON_KEY : ''); print ''; } diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 9ebbcda6c44..0d2455ae620 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -66,15 +66,13 @@ if (!empty($cancel)) { $action = ''; } - else - { + else { if ($backtourl) { header("Location: ".$backtourl); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/cron/list.php'); exit; } @@ -91,8 +89,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } - else - { + else { Header("Location: ".DOL_URL_ROOT.'/cron/list.php'); exit; } @@ -106,8 +103,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors'); $action = ''; } - else - { + else { $now = dol_now(); // Date we start $result = $object->run_jobs($user->login); @@ -117,8 +113,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } - else - { + else { $res = $object->reprogram_jobs($user->login, $now); if ($res > 0) { @@ -126,8 +121,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex else setEventMessages($langs->trans("JobFinished"), null, 'mesgs'); $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -416,8 +410,7 @@ if (($action == "create") || ($action == "edit")) { print ""; } - else - { + else { print ""; } } @@ -473,8 +466,7 @@ if (($action == "create") || ($action == "edit")) { print $form->selectDate($object->datestart, 'datestart', 1, 1, '', "cronform"); } - else - { + else { print $form->selectDate('', 'datestart', 1, 1, '', "cronform"); } print ""; @@ -527,8 +519,7 @@ if (($action == "create") || ($action == "edit")) { print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, '', "cronform"); } - else - { + else { print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform"); } print ""; @@ -548,8 +539,7 @@ if (($action == "create") || ($action == "edit")) print "\n"; } -else -{ +else { /* * view card */ @@ -622,8 +612,7 @@ else { print $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($object->entity); print $mc->label; } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 92a132a6789..f3c02c72cbb 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -280,8 +280,7 @@ class Cronjob extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -378,8 +377,7 @@ class Cronjob extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -518,8 +516,7 @@ class Cronjob extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -655,8 +652,7 @@ class Cronjob extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -697,8 +693,7 @@ class Cronjob extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -753,8 +748,7 @@ class Cronjob extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -895,8 +889,7 @@ class Cronjob extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -952,8 +945,7 @@ class Cronjob extends CommonObject $conf->entity = $savcurrententity; return -1; } - else - { + else { if (empty($user->id)) { $this->error = " User user login:".$userlogin." do not exists"; @@ -1057,8 +1049,7 @@ class Cronjob extends CommonObject { $result = call_user_func(array($object, $this->methodename), $this->params); } - else - { + else { $result = call_user_func_array(array($object, $this->methodename), $params_arr); } @@ -1079,8 +1070,7 @@ class Cronjob extends CommonObject $retval = $this->lastresult; $error++; } - else - { + else { dol_syslog(get_class($this)."::run_jobs END"); $this->lastoutput = $object->output; $this->lastresult = var_export($result, true); @@ -1117,8 +1107,7 @@ class Cronjob extends CommonObject { $result = call_user_func($this->methodename, $this->params); } - else - { + else { $result = call_user_func_array($this->methodename, $params_arr); } @@ -1132,8 +1121,7 @@ class Cronjob extends CommonObject $retval = $this->lastresult; $error++; } - else - { + else { $this->lastoutput = var_export($result, true); $this->lastresult = var_export($result, true); // Return code $retval = $this->lastresult; @@ -1202,8 +1190,7 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; } - else - { + else { if (empty($user->id)) { $this->error = " User user login:".$userlogin." do not exists"; @@ -1230,8 +1217,7 @@ class Cronjob extends CommonObject // TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit) } } - else - { + else { //$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency); dol_syslog(get_class($this)."::reprogram_jobs datenextrun is already in future, we do not change it"); } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index e9afad3b48b..a91dd4b9d66 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -133,8 +133,7 @@ if (empty($reshook)) setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors'); $action = ''; } - else - { + else { $object = new Cronjob($db); $job = $object->fetch($id); @@ -156,8 +155,7 @@ if (empty($reshook)) } $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -197,8 +195,7 @@ if (empty($reshook)) //else dol_print_error($db, 'Bad value for massaction'); if ($result < 0) setEventMessages($tmpcron->error, $tmpcron->errors, 'errors'); } - else - { + else { $error++; } } @@ -445,8 +442,7 @@ if ($num > 0) print $object->getNomUrl(0, '', 1); $object->ref = $obj->rowid; } - else - { + else { //print $langs->trans('CronNone'); } print ''; @@ -587,8 +583,7 @@ if ($num > 0) $i++; } } -else -{ +else { print ''.$langs->trans('CronNoJobs').''; } diff --git a/htdocs/dav/dav.class.php b/htdocs/dav/dav.class.php index 60912b86a8a..673c42e27a0 100644 --- a/htdocs/dav/dav.class.php +++ b/htdocs/dav/dav.class.php @@ -89,8 +89,7 @@ class CdavLib LEFT JOIN '.MAIN_DB_PREFIX.'socpeople AS sp ON (sp.fk_soc = sc.fk_soc AND sp.rowid = a.fk_contact) LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_cdav AS ac ON (a.id = ac.fk_object)'; } - else - { + else { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON (s.rowid = a.fk_soc) LEFT JOIN '.MAIN_DB_PREFIX.'socpeople AS sp ON (sp.rowid = a.fk_contact) LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_cdav AS ac ON (a.id = ac.fk_object)'; @@ -106,8 +105,7 @@ class CdavLib { $sql .= ' AND a.id = '.intval($oid); } - else - { + else { $sql .= ' AND (a.id = '.intval($oid).' OR ac.uuidext = \''.$this->db->escape($ouri).'\')'; } } @@ -161,8 +159,7 @@ class CdavLib if ($obj->percent == -1 && trim($obj->datep) != '') $type = 'VEVENT'; - else - $type = 'VTODO'; + else $type = 'VTODO'; $timezone = date_default_timezone_get(); @@ -176,8 +173,7 @@ class CdavLib $caldata .= "DTSTAMP:".gmdate('Ymd\THis', strtotime($obj->lastupd))."Z\n"; if ($obj->sourceuid == '') $caldata .= "UID:".$obj->id.'-ev-'.$calid.'-cal-'.constant('CDAV_URI_KEY')."\n"; - else - $caldata .= "UID:".$obj->sourceuid."\n"; + else $caldata .= "UID:".$obj->sourceuid."\n"; $caldata .= "SUMMARY:".$obj->label."\n"; $caldata .= "LOCATION:".$location."\n"; $caldata .= "PRIORITY:".$obj->priority."\n"; @@ -188,21 +184,18 @@ class CdavLib { if (trim($obj->datep2) != '') $caldata .= "DTEND;VALUE=DATE:".date('Ymd', strtotime($obj->datep2) + 1)."\n"; - else - $caldata .= "DTEND;VALUE=DATE:".date('Ymd', strtotime($obj->datep) + (25 * 3600))."\n"; + else $caldata .= "DTEND;VALUE=DATE:".date('Ymd', strtotime($obj->datep) + (25 * 3600))."\n"; } elseif (trim($obj->datep2) != '') $caldata .= "DUE;VALUE=DATE:".date('Ymd', strtotime($obj->datep2) + 1)."\n"; } - else - { + else { $caldata .= "DTSTART;TZID=".$timezone.":".strtr($obj->datep, array(" "=>"T", ":"=>"", "-"=>""))."\n"; if ($type == 'VEVENT') { if (trim($obj->datep2) != '') $caldata .= "DTEND;TZID=".$timezone.":".strtr($obj->datep2, array(" "=>"T", ":"=>"", "-"=>""))."\n"; - else - $caldata .= "DTEND;TZID=".$timezone.":".strtr($obj->datep, array(" "=>"T", ":"=>"", "-"=>""))."\n"; + else $caldata .= "DTEND;TZID=".$timezone.":".strtr($obj->datep, array(" "=>"T", ":"=>"", "-"=>""))."\n"; } elseif (trim($obj->datep2) != '') $caldata .= "DUE;TZID=".$timezone.":".strtr($obj->datep2, array(" "=>"T", ":"=>"", "-"=>""))."\n"; @@ -210,8 +203,7 @@ class CdavLib $caldata .= "CLASS:PUBLIC\n"; if ($obj->transparency == 1) $caldata .= "TRANSP:TRANSPARENT\n"; - else - $caldata .= "TRANSP:OPAQUE\n"; + else $caldata .= "TRANSP:OPAQUE\n"; if ($type == 'VEVENT') $caldata .= "STATUS:CONFIRMED\n"; @@ -219,8 +211,7 @@ class CdavLib $caldata .= "STATUS:NEEDS-ACTION\n"; elseif ($obj->percent == 100) $caldata .= "STATUS:COMPLETED\n"; - else - { + else { $caldata .= "STATUS:IN-PROCESS\n"; $caldata .= "PERCENT-COMPLETE:".$obj->percent."\n"; } @@ -285,8 +276,7 @@ class CdavLib 'component' => strpos($calendardata, 'BEGIN:VEVENT') > 0 ? 'vevent' : 'vtodo', ); } - else - { + else { $calevents[] = array( // 'calendardata' => $calendardata, not necessary because etag+size are present 'uri' => $obj->id.'-ev-'.constant('CDAV_URI_KEY'), diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index b306ec7161a..bb4835c4d52 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -26,8 +26,7 @@ if (!defined('CDAV_CONTACT_TAG')) { if (isset($conf->global->CDAV_CONTACT_TAG)) define('CDAV_CONTACT_TAG', $conf->global->CDAV_CONTACT_TAG); - else - define('CDAV_CONTACT_TAG', ''); + else define('CDAV_CONTACT_TAG', ''); } // define CDAV_URI_KEY if not @@ -35,8 +34,7 @@ if (!defined('CDAV_URI_KEY')) { if (isset($conf->global->CDAV_URI_KEY)) define('CDAV_URI_KEY', $conf->global->CDAV_URI_KEY); - else - define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8)); + else define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8)); } diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index fd9f993e1e8..03d91fff140 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -78,8 +78,7 @@ class DolLogsCollector extends MessagesCollector { $this->getStorageLogs($this->path); } - else - { + else { $log_levels = $this->getLevels(); foreach ($conf->logbuffer as $line) { diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php index 9f4820cd723..91564ec8f80 100644 --- a/htdocs/ecm/ajax/ecmdatabase.php +++ b/htdocs/ecm/ajax/ecmdatabase.php @@ -115,14 +115,12 @@ if (isset($action) && !empty($action)) $fk_parent = $parentdirisindatabase; //break; // We found parent, we can stop the while loop } - else - { + else { dol_syslog("No"); //print "No
\n"; } } - else - { + else { dol_syslog("Parent is root"); $fk_parent = 0; // Parent is root } @@ -149,8 +147,7 @@ if (isset($action) && !empty($action)) //var_dump($sqltree); $adirwascreated = 1; } - else - { + else { dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR); } } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 3bddd70bfaa..fc450e9864e 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -165,8 +165,7 @@ class EcmDirectory // extends CommonObject dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); return -1; } - else - { + else { $this->db->begin(); // Insert request @@ -208,14 +207,12 @@ class EcmDirectory // extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -274,8 +271,7 @@ class EcmDirectory // extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -303,8 +299,7 @@ class EcmDirectory // extends CommonObject $this->error = "Error ".$this->db->lasterror(); return -1; } - else - { + else { if (preg_match('/[0-9]+/', $value)) $this->cachenbofdoc = (int) $value; elseif ($value == '+') $this->cachenbofdoc++; elseif ($value == '-') $this->cachenbofdoc--; @@ -359,8 +354,7 @@ class EcmDirectory // extends CommonObject return $obj ? 1 : 0; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -399,8 +393,7 @@ class EcmDirectory // extends CommonObject $this->error = "Error ".$this->db->lasterror(); return -2; } - else - { + else { // Call trigger $result = $this->call_trigger('MYECMDIR_DELETE', $user); if ($result < 0) @@ -418,8 +411,7 @@ class EcmDirectory // extends CommonObject { $result = @dol_delete_dir_recursive($file, 0, 0); } - else - { + else { $result = @dol_delete_dir($file, 0); } } @@ -428,8 +420,7 @@ class EcmDirectory // extends CommonObject { $this->db->commit(); } - else - { + else { $this->error = 'ErrorFailToDeleteDir'; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); @@ -565,8 +556,7 @@ class EcmDirectory // extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -673,8 +663,7 @@ class EcmDirectory // extends CommonObject //print "this->cats[$i]['id_children'] est deja un tableau de $newelem elements
"; $this->cats[$obj->rowid]['id_children'][$newelempos] = $obj->rowid_fille; } - else - { + else { //print "this->cats[".$obj->rowid."]['id_children'] n'est pas encore un tableau
"; $this->cats[$obj->rowid]['id_children'] = array($obj->rowid_fille); } @@ -682,8 +671,7 @@ class EcmDirectory // extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -723,8 +711,7 @@ class EcmDirectory // extends CommonObject $this->cats[$id_categ]['fulllabel'] = $this->cats[$this->cats[$id_categ]['id_mere']]['fulllabel']; $this->cats[$id_categ]['fulllabel'] .= ' >> '.$this->cats[$id_categ]['label']; } - else - { + else { $this->cats[$id_categ]['fullpath'] = '_'.$id_categ; $this->cats[$id_categ]['fullrelativename'] = $this->cats[$id_categ]['label']; $this->cats[$id_categ]['fulllabel'] = $this->cats[$id_categ]['label']; @@ -768,8 +755,7 @@ class EcmDirectory // extends CommonObject { $sql .= " WHERE rowid = ".$this->id; } - else - { + else { $sql .= " WHERE entity = ".$conf->entity; } @@ -780,8 +766,7 @@ class EcmDirectory // extends CommonObject $this->cachenbofdoc = count($filelist); return $this->cachenbofdoc; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -813,8 +798,7 @@ class EcmDirectory // extends CommonObject { $this->errors = array_merge($this->errors, $interface->errors); } - else - { + else { $this->errors = $interface->errors; } } diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 6921b8aabd6..e24af560143 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -200,15 +200,13 @@ class EcmFiles extends CommonObject $obj = $this->db->fetch_object($resql); $maxposition = (int) $obj->maxposition; } - else - { + else { $this->errors[] = 'Error '.$this->db->lasterror(); return --$error; } $maxposition = $maxposition + 1; } - else - { + else { $maxposition = $this->position; } diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index de9f289eb79..e1e7bf40873 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -81,8 +81,7 @@ class FormEcm if (is_array($cate_arbo)) { if (!count($cate_arbo)) $output .= ''; - else - { + else { $output .= ''; foreach ($cate_arbo as $key => $value) { @@ -91,8 +90,7 @@ class FormEcm { $add = 'selected '; } - else - { + else { $add = ''; } $output .= ''; diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 4d6f2bdce5a..9eb95c1f198 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -57,7 +57,7 @@ if ($module == 'ecm') { $upload_dir = $conf->ecm->dir_output.'/'.$urlsection; } -else // For example $module == 'medias' +else // For example $module == 'medias' { $upload_dir = $conf->medias->multidir_output[$conf->entity]; } @@ -116,8 +116,7 @@ if ($action == 'add' && $permtoadd) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'.($module ? '&module='.$module : '')); exit; } @@ -156,7 +155,7 @@ if ($action == 'add' && $permtoadd) $action = 'create'; } } - else // For example $module == 'medias' + else // For example $module == 'medias' { $dirfornewdir = ''; if ($module == 'medias') @@ -178,8 +177,7 @@ if ($action == 'add' && $permtoadd) setEventMessages($langs->trans('ErrorFailToCreateDir', $label), null, 'errors'); $error++; } - else - { + else { setEventMessages($langs->trans("ECMSectionWasCreated", $label), null, 'mesgs'); } } @@ -193,8 +191,7 @@ if ($action == 'add' && $permtoadd) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'); exit; } @@ -302,8 +299,7 @@ if (empty($action) || $action == 'delete_section') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 9b3da9d8aae..78b7d16bb5d 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -75,7 +75,7 @@ if ($module == 'ecm') $relativepath = $ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; } -else // For example $module == 'medias' +else // For example $module == 'medias' { $relativepath = $section; $upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath; @@ -111,8 +111,7 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { $result = $ecmdir->changeNbOfFiles('+'); } - else - { + else { $langs->load("errors"); if ($resupload < 0) // Unknown error { @@ -121,14 +120,13 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) // Files infected by a virus setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors'); } - else // Known error + else // Known error { setEventMessages($langs->trans($resupload), null, 'errors'); } } } - else - { + else { // Failed transfer (exceeding the limit file?) $langs->load("errors"); setEventMessages($langs->trans("ErrorFailToCreateDir", $upload_dir), null, 'errors'); @@ -168,19 +166,16 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes') setEventMessages($langs->trans($ecmdir->error, $ecmdir->label), null, 'errors'); } } - else - { + else { if ($deletedirrecursive) { $resbool = dol_delete_dir_recursive($upload_dir, 0, 1); } - else - { + else { $resbool = dol_delete_dir($upload_dir, 1); } if ($resbool) $result = 1; - else - { + else { $langs->load('errors'); setEventMessages($langs->trans("ErrorFailToDeleteDir", $upload_dir), null, 'errors'); $result = 0; @@ -204,8 +199,7 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha')) $olddir = $ecmdir->getRelativePath(0); $olddir = $conf->ecm->dir_output.'/'.$olddir; } - else - { + else { $olddir = GETPOST('section', 'alpha'); $olddir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath; } @@ -243,19 +237,16 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha')) $relativepath = $ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); setEventMessages($ecmdir->error, $ecmdir->errors, 'errors'); } } - else - { + else { $newdir = $conf->medias->multidir_output[$conf->entity].'/'.GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha'); $result = @rename($olddir, $newdir); @@ -341,8 +332,7 @@ if ($module == 'ecm') $s = ' -> '.$s; $result = $tmpecmdir->fetch($tmpecmdir->fk_parent); } - else - { + else { $tmpecmdir = 0; } $i++; @@ -412,8 +402,7 @@ if ($module == 'ecm') { print dol_print_date($ecmdir->date_c, 'dayhour'); } -else -{ +else { //var_dump($upload_dir); print dol_print_date(dol_filemtime($upload_dir), 'dayhour'); } @@ -423,8 +412,7 @@ if ($module == 'ecm') { print '/ecm/'.$relativepath; } -else -{ +else { print '/'.$module.'/'.$relativepath; } print ''; @@ -478,8 +466,7 @@ if ($action != 'edit' && $action != 'delete') { print ''.$langs->trans('ECMAddSection').''; } - else - { + else { print ''.$langs->trans('ECMAddSection').''; } @@ -489,8 +476,7 @@ if ($action != 'edit' && $action != 'delete') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } /*} diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 1c94fd1700b..bddbd0f6294 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -114,8 +114,7 @@ if ($cancel) header("Location: ".$backtopage); exit; } - else - { + else { header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section).($module ? '&module='.urlencode($module) : '')); exit; } @@ -171,8 +170,7 @@ if ($action == 'update') require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $object->share = getRandomPassword(true); } - else - { + else { $object->share = ''; } @@ -185,8 +183,7 @@ if ($action == 'update') setEventMessages($object->error, $object->errors, 'warnings'); } } - else - { + else { // Call create to insert record $object->entity = $conf->entity; $object->filepath = preg_replace('/[\\/]+$/', '', $newdirrelativetodocument); @@ -212,8 +209,7 @@ if ($action == 'update') header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section)); exit; } - else - { + else { $db->rollback(); } } @@ -258,8 +254,7 @@ while ($tmpecmdir && $result > 0) $s = ' -> '.$s; $result = $tmpecmdir->fetch($tmpecmdir->fk_parent); } - else - { + else { $tmpecmdir = 0; } $i++; @@ -299,8 +294,7 @@ if (!empty($object->label)) { print $object->label; } -else -{ +else { print img_warning().' '.$langs->trans("FileNotYetIndexedInDatabase"); } print ''; @@ -349,19 +343,16 @@ if (!empty($object->share)) else print $fulllink; if ($action != 'edit') print ' '.$langs->trans("Download").''; // No target here } - else - { + else { print 'share ? ' checked="checked"' : '').' /> '; } } -else -{ +else { if ($action != 'edit') { print ''.$langs->trans("FileNotShared").''; } - else - { + else { print 'share ? ' checked="checked"' : '').' /> '; } } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 43b9ca6dcce..09350d2b245 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -136,8 +136,7 @@ if ($action == 'confirm_deletefile') setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs'); $result = $ecmdir->changeNbOfFiles('-'); } - else - { + else { setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors'); } @@ -159,8 +158,7 @@ if ($action == 'add' && $user->rights->ecm->setup) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors'); $action = "create"; } @@ -247,14 +245,12 @@ if ($action == 'refreshmanual') $fk_parent = $parentdirisindatabase; //break; // We found parent, we can stop the while loop } - else - { + else { dol_syslog("No"); //print "No
\n"; } } - else - { + else { dol_syslog("Parent is root"); $fk_parent = 0; // Parent is root } @@ -281,8 +277,7 @@ if ($action == 'refreshmanual') //var_dump($sqltree); $adirwascreated = 1; } - else - { + else { dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR); } } diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 39bdc9a1612..9b8c82ca05e 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -103,8 +103,7 @@ if ($action == 'add' && $user->rights->ecm->setup) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors'); $action = "create"; } @@ -222,14 +221,12 @@ if ($action == 'refreshmanual') $fk_parent = $parentdirisindatabase; //break; // We found parent, we can stop the while loop } - else - { + else { dol_syslog("No"); //print "No
\n"; } } - else - { + else { dol_syslog("Parent is root"); $fk_parent = 0; // Parent is root } @@ -256,8 +253,7 @@ if ($action == 'refreshmanual') //var_dump($sqltree); $adirwascreated = 1; } - else - { + else { dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR); } } @@ -419,8 +415,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act print $val['label']; print ''; } - else - { + else { print ''; print $val['label']; print ''; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index bf1a4e26de7..1cbd01d39e8 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -586,8 +586,7 @@ class EmailCollector extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -773,8 +772,7 @@ class EmailCollector extends CommonObject $tmpclass = $tmparray[0]; $tmpproperty = $tmparray[1]; } - else - { + else { $tmpproperty = $tmparray[0]; } if ($tmpclass && ($tmpclass != $object->element)) continue; // Property is for another type of object @@ -818,14 +816,12 @@ class EmailCollector extends CommonObject // Overwrite param $tmpproperty $object->$tmpproperty = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null; } - else - { + else { // Regex not found $object->$tmpproperty = null; } } - else - { + else { // Nothing can be done for this param $errorforthisaction++; $this->error = 'The extract rule to use has on an unknown source (must be HEADER, SUBJECT or BODY)'; @@ -863,8 +859,7 @@ class EmailCollector extends CommonObject else $object->$tmpproperty = $valuetouse; } } - else - { + else { $errorforthisaction++; $this->error = 'Bad syntax for description of action parameters: '.$actionparam; $this->errors[] = $this->error; @@ -1239,8 +1234,7 @@ class EmailCollector extends CommonObject $from = $reg[2]; $fromtext = $reg[1]; } - else - { + else { $from = $fromstring; $fromtext = ''; } @@ -1313,8 +1307,7 @@ class EmailCollector extends CommonObject { $result = $projectstatic->fetch($projectid); if ($result <= 0) $projectstatic->id = 0; - else - { + else { $projectid = $projectstatic->id; $projectfoundby = 'trackid ('.$trackid.')'; if (empty($contactid)) $contactid = $projectstatic->fk_contact; @@ -1326,8 +1319,7 @@ class EmailCollector extends CommonObject { $result = $contactstatic->fetch($contactid); if ($result <= 0) $contactstatic->id = 0; - else - { + else { $contactid = $contactstatic->id; $contactfoundby = 'trackid ('.$trackid.')'; if (empty($thirdpartyid)) $thirdpartyid = $contactstatic->fk_soc; @@ -1338,8 +1330,7 @@ class EmailCollector extends CommonObject { $result = $thirdpartystatic->fetch($thirdpartyid); if ($result <= 0) $thirdpartystatic->id = 0; - else - { + else { $thirdpartyid = $thirdpartystatic->id; $thirdpartyfoundby = 'trackid ('.$trackid.')'; } @@ -1409,8 +1400,7 @@ class EmailCollector extends CommonObject $this->error = "Action loadthirdparty or loadandcreatethirdparty has empty parameter. Must be 'SET:xxx' or 'EXTRACT:(body|subject):regex' to define how to extract data"; $this->errors[] = $this->error; } - else - { + else { $actionparam = $operation['actionparam']; $nametouseforthirdparty = ''; @@ -1445,15 +1435,13 @@ class EmailCollector extends CommonObject // Overwrite param $tmpproperty $nametouseforthirdparty = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null; } - else - { + else { // Regex not found $nametouseforthirdparty = null; } //var_dump($object->$tmpproperty);exit; } - else - { + else { // Nothing can be done for this param $errorforactions++; $this->error = 'The extract rule to use to load thirdparty has on an unknown source (must be HEADER, SUBJECT or BODY)'; @@ -1466,8 +1454,7 @@ class EmailCollector extends CommonObject //else $object->$tmpproperty = $reg[1]; $nametouseforthirdparty = $reg[2]; } - else - { + else { $errorforactions++; $this->error = 'Bad syntax for description of action parameters: '.$actionparam; $this->errors[] = $this->error; @@ -1511,8 +1498,7 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { $result = $thirdpartystatic->create($user); if ($result <= 0) { @@ -1598,8 +1584,7 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { $result = $actioncomm->create($user); if ($result <= 0) { @@ -1701,15 +1686,13 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { if (empty($projecttocreate->ref) || (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0)) { $errorforactions++; $this->error = 'Failed to create project: Can\'t get a valid value for the field ref with numbering template = '.$modele.', thirdparty id = '.$thirdpartystatic->id; } - else - { + else { // Create project $result = $projecttocreate->create($user); if ($result <= 0) @@ -1849,15 +1832,13 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { if (is_numeric($tickettocreate->ref) && $tickettocreate->ref <= 0) { $errorforactions++; $this->error = 'Failed to create ticket: Can\'t get a valid value for the field ref with numbering template = '.$modele.', thirdparty id = '.$thirdpartystatic->id; } - else - { + else { // Create project $result = $tickettocreate->create($user); if ($result <= 0) @@ -1890,13 +1871,11 @@ class EmailCollector extends CommonObject dol_syslog(imap_last_error()); } } - else - { + else { dol_syslog("EmailCollector::doCollectOneCollector message ".$imapemail." to ".$connectstringtarget." was set to read", LOG_DEBUG); } } - else - { + else { $errorforemail++; } @@ -1921,8 +1900,7 @@ class EmailCollector extends CommonObject break; } } - else - { + else { $error++; $this->db->rollback(); @@ -1933,8 +1911,7 @@ class EmailCollector extends CommonObject dol_syslog("End of loop on emails", LOG_INFO, -1); } - else - { + else { $output = $langs->trans('NoNewEmailToProcess'); } @@ -2071,8 +2048,7 @@ class EmailCollector extends CommonObject // so append parts together with blank row. if (strtolower($p->subtype) == 'plain') $plainmsg .= trim($data)."\n\n"; - else - $htmlmsg .= $data."

"; + else $htmlmsg .= $data."

"; $charset = $params['charset']; // assume all parts are same charset } diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index d0d6239a7f2..b4fdf52ca5b 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -504,8 +504,7 @@ class EmailCollectorAction extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 63521e81c3a..106d57c23c5 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -479,8 +479,7 @@ class EmailCollectorFilter extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 95b6f6208a5..cdc4da7fe51 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -266,8 +266,7 @@ if (empty($reshook)) $totalqty += $subtotalqty; } - else - { + else { // No detail were provided for lots if (!empty($_POST[$qty])) { @@ -296,8 +295,7 @@ if (empty($reshook)) $qty = "qtyl".$i.'_'.$j; } } - else - { + else { //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; //shipment line for product with no batch management and no multiple stock location if (GETPOST($qty, 'int') > 0) $totalqty += GETPOST($qty, 'int'); @@ -342,8 +340,7 @@ if (empty($reshook)) } } } - else - { + else { if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; @@ -361,8 +358,7 @@ if (empty($reshook)) } } } - else - { + else { // batch mode if ($batch_line[$i]['qty'] > 0) { @@ -389,8 +385,7 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToShip").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; } @@ -401,8 +396,7 @@ if (empty($reshook)) header("Location: card.php?id=".$object->id); exit; } - else - { + else { $db->rollback(); $_GET["commande_id"] = GETPOST('commande_id', 'int'); $action = 'create'; @@ -420,8 +414,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/livraison/card.php?action=create_delivery&id='.$result); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -440,8 +433,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans($object->error), $object->errors, 'errors'); } - else - { + else { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -470,8 +462,7 @@ if (empty($reshook)) { $result = $object->setStatut(-1); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -485,8 +476,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -601,8 +591,7 @@ if (empty($reshook)) } } } - else - { + else { // delete single warehouse line $line->id = $line_id; if (!$error && $line->delete($user) < 0) @@ -618,8 +607,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit(); } - else - { + else { setEventMessages($line->error, $line->errors, 'errors'); } } @@ -684,8 +672,7 @@ if (empty($reshook)) $error++; } } - else - { + else { setEventMessages($lotStock->error, $lotStock->errors, 'errors'); $error++; } @@ -738,14 +725,12 @@ if (empty($reshook)) $error++; } } - else - { + else { setEventMessages($line->error, $line->errors, 'errors'); $error++; } } - else - { + else { // create new line with new lot $line->origin_line_id = $lines[$i]->origin_line_id; $line->entrepot_id = $lotStock->warehouseid; @@ -761,15 +746,13 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($lotStock->error, $lotStock->errors, 'errors'); $error++; } } } - else - { + else { if ($lines[$i]->fk_product > 0) { // line without lot @@ -813,8 +796,7 @@ if (empty($reshook)) } } } - else - { + else { // Product no predefined $qty = "qtyl".$line_id; $line->id = $line_id; @@ -850,8 +832,7 @@ if (empty($reshook)) $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To redisplay the form being edited exit(); } @@ -1133,8 +1114,7 @@ if ($action == 'create') { print ''.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'; } - else - { + else { print ''.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' ('.$langs->trans("Stock").')'; } } @@ -1195,8 +1175,7 @@ if ($action == 'create') print ''; } - else - { + else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1232,8 +1211,7 @@ if ($action == 'create') { $quantityToBeDelivered = 0; } - else - { + else { $quantityToBeDelivered = $quantityAsked - $quantityDelivered; } $warehouse_id = GETPOST('entrepot_id', 'int'); @@ -1289,8 +1267,7 @@ if ($action == 'create') } } } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1321,8 +1298,7 @@ if ($action == 'create') } } } - else - { + else { // Product need lot print ''; // end line and start a new one for lot/serial print ''; @@ -1377,8 +1353,7 @@ if ($action == 'create') print ''; } } - else - { + else { print ''; print ''; print ' '; @@ -1390,8 +1365,7 @@ if ($action == 'create') } } } - else - { + else { // ship from multiple locations if (empty($conf->productbatch->enabled) || !$product->hasbatch()) { @@ -1440,8 +1414,7 @@ if ($action == 'create') print ''; print '('.$stock.')'; } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1480,8 +1453,7 @@ if ($action == 'create') } } } - else - { + else { print ''; print ''; // end line and start a new one for lot/serial @@ -1553,8 +1525,7 @@ if ($action == 'create') } print ' '; } - else - { + else { print $langs->trans("NA"); } print ''; @@ -1569,14 +1540,12 @@ if ($action == 'create') $warehouseObject->fetch($warehouse_selected_id); print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->label); } - else - { + else { if ($line->fk_product) print img_warning().' '.$langs->trans("StockTooLow"); else print ''; } } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1617,8 +1586,7 @@ if ($action == 'create') print '
'; } - else - { + else { dol_print_error($db); } } @@ -1687,8 +1655,7 @@ elseif ($id || $ref) { $numref = $object->getNextNumRef($soc); } - else - { + else { $numref = $object->ref; } @@ -1834,8 +1801,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -1858,8 +1824,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -1893,8 +1858,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueHeight; print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; } @@ -1971,8 +1935,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey @@ -2004,8 +1967,7 @@ elseif ($id || $ref) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -2065,8 +2027,7 @@ elseif ($id || $ref) { print $langs->trans("QtyToShip").' - '; } - else - { + else { print $langs->trans("QtyShipped").' - '; } if (!empty($conf->stock->enabled)) @@ -2079,14 +2040,12 @@ elseif ($id || $ref) } print ''; } - else - { + else { if ($object->statut <= 1) { print ''.$langs->trans("QtyToShip").''; } - else - { + else { print ''.$langs->trans("QtyShipped").''; } if (!empty($conf->stock->enabled)) @@ -2196,8 +2155,7 @@ elseif ($id || $ref) $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; } - else - $label = (!empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); + else $label = (!empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); print ''; @@ -2231,8 +2189,7 @@ elseif ($id || $ref) } print "\n"; } - else - { + else { print ''; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -2343,14 +2300,12 @@ elseif ($id || $ref) print ''; } } - else - { + else { print ''; print ''.$langs->trans("NotEnoughStock").''; } } - else - { + else { print ''; print ''; // Qty to ship or shipped @@ -2365,8 +2320,7 @@ elseif ($id || $ref) print ''; } - else - { + else { // Qty to ship or shipped print ''.$lines[$i]->qty_shipped.''; @@ -2417,8 +2371,7 @@ elseif ($id || $ref) } print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); } - else - { + else { print $langs->trans("NA"); } print ''; @@ -2484,8 +2437,7 @@ elseif ($id || $ref) { print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); } - else - { + else { print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); } } @@ -2526,8 +2478,7 @@ elseif ($id || $ref) { print ''.$langs->trans("Validate").''; } - else - { + else { print ''.$langs->trans("Validate").''; } } @@ -2540,8 +2491,7 @@ elseif ($id || $ref) { print ''.$langs->trans("ClassifyUnbilled").''; } - else - { + else { print ''.$langs->trans("ReOpen").''; } } diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index e337ee5ffb8..42cb273fbcd 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -399,8 +399,7 @@ class Shipments extends DolibarrApi if ($updateRes > 0) { return $this->get($id); } - else - { + else { throw new RestException(405, $this->shipment->error); } } @@ -436,8 +435,7 @@ class Shipments extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->shipment->error); } } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 1ccfe9944f7..3250ba8aa5e 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -252,14 +252,12 @@ class Expedition extends CommonObject { return $numref; } - else - { + else { dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error); return ""; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_EXPEDITION_ADDON_NUMBER_NotDefined"); return ""; } @@ -366,8 +364,7 @@ class Expedition extends CommonObject $error++; } } - else - { // with batch management + else { // with batch management if (!$this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) > 0) { $error++; @@ -406,8 +403,7 @@ class Expedition extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -417,24 +413,21 @@ class Expedition extends CommonObject return -1 * $error; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $error++; $this->error = $this->db->error()." - sql=$sql"; $this->db->rollback(); @@ -504,8 +497,7 @@ class Expedition extends CommonObject { $error++; } - else - { + else { // create shipment batch lines for stockLocation foreach ($tab as $detbatch) { @@ -647,15 +639,13 @@ class Expedition extends CommonObject return 1; } - else - { + else { dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR); $this->error = 'Delivery with id '.$id.' not found'; return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -707,8 +697,7 @@ class Expedition extends CommonObject { $numref = $this->getNextNumRef($soc); } - else - { + else { $numref = "EXP".$this->id; } $this->newref = dol_sanitizeFileName($numref); @@ -760,8 +749,7 @@ class Expedition extends CommonObject { $qty = $obj->qty; } - else - { + else { $qty = $obj->edbqty; } if ($qty <= 0) continue; @@ -784,8 +772,7 @@ class Expedition extends CommonObject break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. @@ -800,8 +787,7 @@ class Expedition extends CommonObject } } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; @@ -876,8 +862,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -908,8 +893,7 @@ class Expedition extends CommonObject { return $result; } - else - { + else { $this->error = $delivery->error; return $result; } @@ -968,8 +952,7 @@ class Expedition extends CommonObject $product->load_stock('warehouseopen'); $product_stock = $product->stock_warehouse[$entrepot_id]->real; } - else - $product_stock = $product->stock_reel; + else $product_stock = $product->stock_reel; $product_type = $product->type; if ($product_type == 0 && $product_stock < $qty) @@ -1165,8 +1148,7 @@ class Expedition extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1261,8 +1243,7 @@ class Expedition extends CommonObject break; } } - else - { + else { // We increment stock of batches // We use warehouse selected for each line foreach ($lotArray as $lot) @@ -1278,8 +1259,7 @@ class Expedition extends CommonObject } } } - else - { + else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -1358,35 +1338,30 @@ class Expedition extends CommonObject return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; }//*/ } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } } - else - { + else { $this->db->rollback(); return -1; } @@ -1481,8 +1456,7 @@ class Expedition extends CommonObject break; } } - else - { + else { // We increment stock of batches // We use warehouse selected for each line foreach ($lotArray as $lot) @@ -1498,8 +1472,7 @@ class Expedition extends CommonObject } } } - else - { + else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -1584,35 +1557,30 @@ class Expedition extends CommonObject return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } } - else - { + else { $this->db->rollback(); return -1; } @@ -1770,8 +1738,7 @@ class Expedition extends CommonObject { $line->detail_batch = $newdetailbatch; } - else - { + else { $line->detail_batch = array_merge($line->detail_batch, $newdetailbatch); } } @@ -1782,8 +1749,7 @@ class Expedition extends CommonObject $this->lines[$lineindex] = $line; $lineindex++; } - else - { + else { $line->total_ht += $tabprice[0]; $line->total_localtax1 += $tabprice[9]; $line->total_localtax2 += $tabprice[10]; @@ -1797,8 +1763,7 @@ class Expedition extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = $this->db->error(); return -3; } @@ -1831,14 +1796,12 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } @@ -2039,14 +2002,12 @@ class Expedition extends CommonObject $this->date_delivery = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } @@ -2132,8 +2093,7 @@ class Expedition extends CommonObject $sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')"; $resql = $this->db->query($sql); } - else - { + else { $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql .= " code='".$this->db->escape($this->update['code'])."'"; $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'"; @@ -2208,8 +2168,7 @@ class Expedition extends CommonObject $url = str_replace('{TRACKID}', $value, $tracking); $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); } - else - { + else { $this->tracking_url = $value; } } @@ -2300,8 +2259,7 @@ class Expedition extends CommonObject { $qty = $obj->qty; } - else - { + else { $qty = $obj->edbqty; } if ($qty <= 0) continue; @@ -2322,8 +2280,7 @@ class Expedition extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -2336,8 +2293,7 @@ class Expedition extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -2352,8 +2308,7 @@ class Expedition extends CommonObject } } } - else - { + else { dol_print_error($this->db); $error++; } @@ -2363,8 +2318,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->statut = self::STATUS_VALIDATED; $this->db->rollback(); return -1; @@ -2408,8 +2362,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->statut = self::STATUS_VALIDATED; $this->billed = 0; $this->db->rollback(); @@ -2477,8 +2430,7 @@ class Expedition extends CommonObject { $qty = $obj->qty; } - else - { + else { $qty = $obj->edbqty; } if ($qty <= 0) continue; @@ -2500,8 +2452,7 @@ class Expedition extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -2514,8 +2465,7 @@ class Expedition extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -2538,8 +2488,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->statut = self::STATUS_CLOSED; $this->billed = $oldbilled; $this->db->rollback(); @@ -2792,8 +2741,7 @@ class ExpeditionLigne extends CommonObjectLine return 1; } - else - { + else { $this->errors[] = $this->db->lasterror(); $this->error = $this->db->lasterror(); return -1; @@ -2886,8 +2834,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->rollback(); return -1 * $error; } - else - { + else { $error++; } } @@ -2947,8 +2894,7 @@ class ExpeditionLigne extends CommonObjectLine // End call triggers } } - else - { + else { $this->errors[] = $this->db->lasterror()." - sql=$sql"; $error++; } @@ -2957,8 +2903,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -3001,8 +2946,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[] = 'ErrorBadParameters'; $error++; } - else - { + else { $batch = $this->detail_batch[0]->batch; $batch_id = $this->detail_batch[0]->fk_origin_stock; $expedition_batch_id = $this->detail_batch[0]->id; @@ -3057,8 +3001,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[] = $this->db->lasterror()." - ExpeditionLineBatch::fetchAll"; $error++; } - else - { + else { // caculate new total line qty foreach ($lotArray as $lot) { @@ -3156,8 +3099,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 6c9942dd9a8..131d2abc261 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -91,8 +91,7 @@ class ExpeditionLineBatch extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -136,8 +135,7 @@ class ExpeditionLineBatch extends CommonObject $this->fk_expeditiondet = $id_line_expdet; return $this->id; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -167,8 +165,7 @@ class ExpeditionLineBatch extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -231,8 +228,7 @@ class ExpeditionLineBatch extends CommonObject $db->free($resql); return $ret; } - else - { + else { dol_print_error($db); return -1; } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 36d471b59d3..1ea47ea199b 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -88,8 +88,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index d3fec260d95..15dc8168a54 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -120,8 +120,7 @@ if ($resql) print ''; $i++; } - } else - { + } else { print ''.$langs->trans("None").''; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 999bde3fb32..b6de8adc74d 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -687,8 +687,7 @@ if ($resql) print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no'); print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1); } - else - { + else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -804,8 +803,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_sendings', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 75ee2ef4da3..1c874d402b5 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -377,8 +377,7 @@ if ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { print dol_print_date($object->date_livraison, 'daytext'); if ($object->hasDelay() && !empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); @@ -531,8 +530,7 @@ if ($id > 0 || !empty($ref)) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -644,8 +642,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("RealStock").''; } - else - { + else { print ' '; } print "\n"; @@ -697,8 +694,7 @@ if ($id > 0 || !empty($ref)) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - $label = (!empty($objp->label) ? $objp->label : $objp->product_label); + else $label = (!empty($objp->label) ? $objp->label : $objp->product_label); print ''; print ''; // ancre pour retourner sur la ligne @@ -739,8 +735,7 @@ if ($id > 0 || !empty($ref)) print ''; } - else - { + else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -776,8 +771,7 @@ if ($id > 0 || !empty($ref)) $toBeShippedTotal += $toBeShipped[$objp->fk_product]; print $toBeShipped[$objp->fk_product]; } - else - { + else { print '0 ('.$langs->trans("Service").')'; } print ''; @@ -799,8 +793,7 @@ if ($id > 0 || !empty($ref)) } print ''; } - else - { + else { print ' '; } print "\n"; @@ -844,8 +837,7 @@ if ($id > 0 || !empty($ref)) print ""; } - else - { + else { dol_print_error($db); } @@ -871,8 +863,7 @@ if ($id > 0 || !empty($ref)) print ' '.img_warning($langs->trans("WarningNoQtyLeftToSend")); } } - else - { + else { print ''.$langs->trans("CreateShipment").''; } } @@ -935,8 +926,7 @@ if ($id > 0 || !empty($ref)) $somethingshown = 1; } - else - { + else { print ''; @@ -945,8 +935,7 @@ if ($id > 0 || !empty($ref)) show_list_sending_receive('commande', $object->id); } - else - { + else { /* Order not found */ setEventMessages($langs->trans("NonExistentOrder"), null, 'errors'); } diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index db28b094e65..ce305ea41bb 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -75,8 +75,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; } diff --git a/htdocs/expensereport/ajax/ajaxik.php b/htdocs/expensereport/ajax/ajaxik.php index b2c89f68e41..413bc061fbf 100644 --- a/htdocs/expensereport/ajax/ajaxik.php +++ b/htdocs/expensereport/ajax/ajaxik.php @@ -52,22 +52,18 @@ $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat'); if (empty($fk_expense) || $fk_expense < 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'))); elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'))); -else -{ +else { // @see ndfp.class.php:3576 (method: compute_total_km) $expense = new ExpenseReport($db); if ($expense->fetch($fk_expense) <= 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'fk_expense' => $fk_expense)); - else - { + else { $userauthor = new User($db); if ($userauthor->fetch($expense->fk_user_author) <= 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'fk_user_author' => $expense->fk_user_author)); - else - { + else { $range = ExpenseReportIk::getRangeByUser($userauthor, $fk_c_exp_tax_cat); if (empty($range)) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'range' => $range)); - else - { + else { $ikoffset = price($range->ikoffset, 0, $langs, 1, -1, -1, $conf->currency); echo json_encode(array('up' => $range->coef, 'ikoffset' => $range->ikoffset, 'title' => $langs->transnoentitiesnoconv('ExpenseRangeOffset', $offset), 'comment' => 'offset should be apply on addline or updateline')); } diff --git a/htdocs/expensereport/ajax/ajaxprojet.php b/htdocs/expensereport/ajax/ajaxprojet.php index 2fdb0cd4fdb..57b86ac9c7f 100644 --- a/htdocs/expensereport/ajax/ajaxprojet.php +++ b/htdocs/expensereport/ajax/ajaxprojet.php @@ -77,12 +77,10 @@ if (GETPOST('fk_projet') != '') echo json_encode($return_arr); } - else - { + else { echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); } } -else -{ +else { echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 2a0f804b196..c4a2d176e59 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -178,8 +178,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { if ($object->id > 0) { // Because createFromClone modifies the object, we must clone it so that we can restore it later if it fails @@ -191,8 +190,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $object = $orig; $action = ''; @@ -211,8 +209,7 @@ if (empty($reshook)) header("Location: index.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -265,8 +262,7 @@ if (empty($reshook)) Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $action = 'create'; @@ -298,8 +294,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -357,8 +352,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } @@ -416,8 +410,7 @@ if (empty($reshook)) $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($emailFrom, 2), $mailfile->getValidAddress($emailTo, 2)); setEventMessages($mesg, null, 'mesgs'); } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -426,20 +419,17 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } @@ -451,8 +441,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $db->rollback(); } } @@ -543,8 +532,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -553,26 +541,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -666,8 +650,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -676,26 +659,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedtoSetToApprove"), null, 'warnings'); $action = ''; } @@ -787,8 +766,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -797,26 +775,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedtoSetToDeny"), null, 'warnings'); $action = ''; } @@ -829,8 +803,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } - else - { + else { $object = new ExpenseReport($db); $object->fetch($id); @@ -917,8 +890,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -927,32 +899,27 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedToSetToCancel"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -991,13 +958,11 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages("NOT_AUTHOR", '', 'errors'); } } @@ -1132,8 +1097,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -1142,26 +1106,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedToSetPaid"), null, 'warnings'); $action = ''; } @@ -1313,8 +1273,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1408,8 +1367,7 @@ if (empty($reshook)) //header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); //exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1497,8 +1455,7 @@ if ($action == 'create') $object = new ExpenseReport($db); $include_users = $object->fetch_users_approver_expensereport(); if (empty($include_users)) print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateExpenseReport"); - else - { + else { $defaultselectuser = (empty($user->fk_user_expense_validator) ? $user->fk_user : $user->fk_user_expense_validator); // Will work only if supervisor has permission to approve so is inside include_users if (!empty($conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR)) $defaultselectuser = $conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR; // Can force default approver if (GETPOST('fk_user_validator', 'int') > 0) $defaultselectuser = GETPOST('fk_user_validator', 'int'); @@ -1559,8 +1516,7 @@ if ($action == 'create') print ''; } -else -{ +else { if ($id > 0 || $ref) { $result = $object->fetch($id, $ref); @@ -1602,8 +1558,7 @@ else { print ''; } - else - { + else { print ''; } @@ -1661,8 +1616,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''.$langs->trans("VALIDOR").''; print ''; @@ -1698,8 +1652,7 @@ else print ''; } - else - { + else { dol_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); // Clone confirmation @@ -1894,8 +1847,7 @@ else print ''.dol_print_date($object->date_cancel, 'dayhour').''; print ''; } - else - { + else { print ''; print ''.$langs->trans("ApprovedBy").''; print ''; @@ -2093,8 +2045,7 @@ else $db->free($resql); } - else - { + else { dol_print_error($db); } print ""; @@ -2201,8 +2152,7 @@ else { print price($line->value_unit_ht); } - else - { + else { $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $line->vatrate)); $pricenettoshow = price2num($line->value_unit / (1 + $tmpvat / 100), 'MU'); print $pricenettoshow; @@ -2246,8 +2196,7 @@ else print ''; print ''; } - else - { + else { $modulepart = 'expensereport'; $thumbshown = 0; if (preg_match('/\.pdf$/i', $ecmfilesstatic->filename)) @@ -2625,8 +2574,7 @@ else dol_fiche_end(); } // end edit or not edit } // end of if result - else - { + else { dol_print_error($db); } } //fin si id > 0 @@ -2749,8 +2697,7 @@ if ($action != 'create' && $action != 'edit') { print '
'.$langs->trans('DoPayment').'
'; } - else - { + else { print ''; } } diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 18fef29e04c..050a7902a43 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -412,8 +412,7 @@ class ExpenseReports extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->expensereport->error); } } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 70d8a3d9b59..124a1fe4e7d 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -352,27 +352,23 @@ class ExpenseReport extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -4; } } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -1; @@ -441,8 +437,7 @@ class ExpenseReport extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -505,15 +500,13 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; @@ -606,13 +599,11 @@ class ExpenseReport extends CommonObject return $result; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -659,21 +650,18 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->commit(); return 0; } } - else - { + else { $this->db->rollback(); dol_print_error($this->db); return -1; @@ -781,8 +769,7 @@ class ExpenseReport extends CommonObject } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); } } @@ -947,8 +934,7 @@ class ExpenseReport extends CommonObject print ' '; print ''; } - else - { + else { $this->error = $db->lasterror(); return -1; } @@ -992,14 +978,13 @@ class ExpenseReport extends CommonObject if ($result): $this->db->free($result); return 1; - else: + else : $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR); return -3; endif; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR); return -3; @@ -1032,8 +1017,7 @@ class ExpenseReport extends CommonObject { $sql .= ' ORDER BY de.rang ASC, de.rowid ASC'; } - else - { + else { $sql .= ' ORDER BY de.rang ASC, de.date ASC'; } @@ -1083,8 +1067,7 @@ class ExpenseReport extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::fetch_lines: Error ".$this->error, LOG_ERR); return -3; @@ -1114,16 +1097,14 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -6; } } - else - { + else { $this->error = $this->db->error()." sql=".$sql; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); @@ -1159,8 +1140,7 @@ class ExpenseReport extends CommonObject { $num = $this->getNextNumRef(); } - else - { + else { $num = $this->ref; } if (empty($num) || $num < 0) return -1; @@ -1244,15 +1224,13 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -1294,14 +1272,12 @@ class ExpenseReport extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_save_from_refuse expensereport already with save status", LOG_WARNING); } } @@ -1346,22 +1322,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::setApproved expensereport already with approve status", LOG_WARNING); } @@ -1413,22 +1386,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::setDeny expensereport already with refuse status", LOG_WARNING); } } @@ -1474,22 +1444,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_unpaid expensereport already with unpaid status", LOG_WARNING); } } @@ -1538,22 +1505,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_cancel expensereport already with cancel status", LOG_WARNING); } } @@ -1597,16 +1561,14 @@ class ExpenseReport extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; $this->errors = $obj->errors; //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); return -1; } } - else - { + else { $this->error = "Error_EXPENSEREPORT_ADDON_NotDefined"; return -2; } @@ -1703,7 +1665,7 @@ class ExpenseReport extends CommonObject $result = $this->db->query($sql); if ($result): return 1; - else: + else : $this->error = $this->db->error(); return -1; endif; @@ -1733,7 +1695,7 @@ class ExpenseReport extends CommonObject $result = $this->db->query($sql); if ($result): return 1; - else: + else : $this->error = $this->db->error(); return -1; endif; @@ -1823,22 +1785,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return $this->line->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->line->error; dol_syslog(get_class($this)."::addline error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { dol_syslog(get_class($this)."::addline status of expense report must be Draft to allow use of ->addline()", LOG_ERR); $this->error = 'ErrorExpenseNotDraft'; return -3; @@ -1888,8 +1847,7 @@ class ExpenseReport extends CommonObject $new_current_total_ttc -= $amount_to_test - $rule->amount; // ex, entered 16€, limit 12€, subtracts 4€; $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationError', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency), $langs->trans('by'.$rule->code_expense_rules_type, price($new_current_total_ttc, 0, $langs, 1, -1, -1, $conf->currency))); } - else - { + else { $this->error = 'ExpenseReportConstraintViolationWarning'; $this->errors[] = $this->error; @@ -1985,8 +1943,7 @@ class ExpenseReport extends CommonObject $num = $this->db->num_rows($resql); if ($num > 0) return true; } - else - { + else { dol_print_error($this->db); } @@ -2106,8 +2063,7 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->line->error; $this->errors = $this->line->errors; $this->db->rollback(); @@ -2188,13 +2144,11 @@ class ExpenseReport extends CommonObject if ($existe) return 1; else return 0; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::periode_existe Error ".$this->error, LOG_ERR); return -1; @@ -2236,8 +2190,7 @@ class ExpenseReport extends CommonObject } return $users_validator; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::fetch_users_approver_expensereport Error ".$this->error, LOG_ERR); return -1; @@ -2302,8 +2255,7 @@ class ExpenseReport extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); } return $ret; @@ -2335,8 +2287,7 @@ class ExpenseReport extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2383,8 +2334,7 @@ class ExpenseReport extends CommonObject $response->labelShort = $langs->trans("ToApprove"); $response->url = DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=2'; } - else - { + else { $response->warning_delay = $conf->expensereport->payment->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("ExpenseReportsToPay"); $response->labelShort = $langs->trans("StatusToPay"); @@ -2402,8 +2352,7 @@ class ExpenseReport extends CommonObject $response->nbtodolate++; } } - else - { + else { if ($this->db->jdate($obj->date_valid) < ($now - $conf->expensereport->payment->warning_delay)) { $response->nbtodolate++; } @@ -2412,8 +2361,7 @@ class ExpenseReport extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2439,8 +2387,7 @@ class ExpenseReport extends CommonObject { return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); } - else - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + else return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); } /** @@ -2464,8 +2411,7 @@ class ExpenseReport extends CommonObject $alreadydispatched = $obj->nb; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2499,8 +2445,7 @@ class ExpenseReport extends CommonObject $this->db->free($resql); return $obj->amount; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2695,8 +2640,7 @@ class ExpenseReportLine } } } - else - { + else { $error++; } @@ -2705,8 +2649,7 @@ class ExpenseReportLine $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog("ExpenseReportLine::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -2748,8 +2691,7 @@ class ExpenseReportLine $amount = (double) $obj->total_amount; } } - else - { + else { dol_print_error($this->db); } @@ -2813,15 +2755,13 @@ class ExpenseReportLine $this->errors = $tmpparent->errors; } } - else - { + else { $error++; $this->error = $tmpparent->error; $this->errors = $tmpparent->errors; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -2831,8 +2771,7 @@ class ExpenseReportLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog("ExpenseReportLine::update Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -2868,8 +2807,7 @@ function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $u { print '
'; print ''; print ''; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 808ba9739ba..3d0dc302283 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -41,8 +41,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 918950179c7..219e68171d2 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -163,8 +163,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) echo json_encode($outjson); } -else -{ +else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $langs->loadLangs(array("main", "products")); diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 1612448c1bb..da99efc337d 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -288,8 +288,7 @@ class ActionsCardProduct } $this->db->free($resql); } - else - { + else { dol_print_error($this->db, $sql); } } @@ -428,8 +427,7 @@ class ActionsCardProduct } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 331cecb3071..aaf9b584068 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -268,8 +268,7 @@ class ActionsCardService } $this->db->free($resql); } - else - { + else { dol_print_error($this->db, $sql); } } @@ -361,8 +360,7 @@ class ActionsCardService } $this->db->free($resql); } - else - { + else { print $sql; } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 87e86e8e0bc..bd18737bd6b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -175,8 +175,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { $langs->load("errors"); if ($result == -1) $errors[] = 'ErrorBadBarCodeSyntax'; elseif ($result == -2) $errors[] = 'ErrorBarCodeRequired'; @@ -222,12 +221,10 @@ if (empty($reshook)) if ($object->price_base_type == 'TTC') $object->price_ttc = GETPOST('price'); - else - $object->price = GETPOST('price'); + else $object->price = GETPOST('price'); if ($object->price_base_type == 'TTC') $object->price_min_ttc = GETPOST('price_min'); - else - $object->price_min = GETPOST('price_min'); + else $object->price_min = GETPOST('price_min'); $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' @@ -340,8 +337,7 @@ if (empty($reshook)) $object->multiprices["$i"] = price2num($_POST["price_".$i], 'MU'); $object->multiprices_base_type["$i"] = $_POST["multiprices_base_type_".$i]; } - else - { + else { $object->multiprices["$i"] = ""; } } @@ -369,14 +365,12 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } } - else - { + else { if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors'); $action = "create"; @@ -391,8 +385,7 @@ if (empty($reshook)) { $action = ''; } - else - { + else { if ($object->id > 0) { $object->oldcopy = clone $object; @@ -489,15 +482,13 @@ if (empty($reshook)) $action = 'view'; } - else - { + else { if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors'); $action = 'edit'; } } - else - { + else { if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans("ErrorProductBadRefOrLabel"), null, 'errors'); $action = 'edit'; @@ -514,8 +505,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { $db->begin(); $originalId = $id; @@ -578,8 +568,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $id = $originalId; if ($object->error == 'ErrorProductAlreadyExists') @@ -594,16 +583,14 @@ if (empty($reshook)) setEventMessages($mesg, null, 'errors'); $object->fetch($id); } - else - { + else { $db->rollback(); if (count($object->errors)) { setEventMessages($object->error, $object->errors, 'errors'); dol_print_error($db, $object->errors); } - else - { + else { setEventMessages($langs->trans($object->error), null, 'errors'); dol_print_error($db, $object->error); } @@ -613,8 +600,7 @@ if (empty($reshook)) unset($object->context['createfromclone']); } } - else - { + else { $db->rollback(); dol_print_error($db, $object->error); } @@ -632,8 +618,7 @@ if (empty($reshook)) header('Location: '.DOL_URL_ROOT.'/product/list.php?type='.$object->type.'&delprod='.urlencode($object->ref)); exit; } - else - { + else { setEventMessages($langs->trans($object->error), null, 'errors'); $reload = 0; $action = ''; @@ -743,8 +728,7 @@ if (empty($reshook)) dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } - else - { + else { $buyprice = $result; } @@ -786,8 +770,7 @@ if (empty($reshook)) dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } - else - { + else { $buyprice = $result; } @@ -829,8 +812,7 @@ if (empty($reshook)) dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } - else - { + else { $buyprice = $result; } @@ -937,8 +919,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -1030,8 +1011,7 @@ else { $fk_barcode_type = GETPOST('fk_barcode_type'); } - else - { + else { if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; @@ -1080,8 +1060,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''; } @@ -1215,8 +1194,7 @@ else print '
'; } - else - { + else { print ''; // Price @@ -1416,8 +1394,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''; } @@ -1432,8 +1409,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''; } @@ -1463,8 +1439,7 @@ else { $fk_barcode_type = GETPOST('fk_barcode_type'); } - else - { + else { $fk_barcode_type = $object->barcode_type; if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; } @@ -1526,8 +1501,7 @@ else print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); print ''; } - else - { + else { // Nature print ''."\n"; @@ -2012,8 +1983,7 @@ else print ''; } - else - { + else { // Nature print '\n"; @@ -2042,8 +2011,7 @@ else if ($object->height) print " x ".$object->height; print ' '.measuringUnitString(0, "size", $object->length_units); } - else - { + else { print ' '; } print "\n"; @@ -2056,8 +2024,7 @@ else { print $object->surface." ".measuringUnitString(0, "surface", $object->surface_units); } - else - { + else { print ' '; } print "\n"; @@ -2070,8 +2037,7 @@ else { print $object->volume." ".measuringUnitString(0, "volume", $object->volume_units); } - else - { + else { print ' '; } print "\n"; @@ -2085,8 +2051,7 @@ else { print $object->net_measure." ".measuringUnitString($object->net_measure_units); } - else - { + else { print ' '; } } @@ -2215,8 +2180,7 @@ if ($action != 'create' && $action != 'edit') { print ''.$langs->trans('ToClone').''."\n"; } - else - { + else { print 'id.'">'.$langs->trans("ToClone").''; } } @@ -2231,18 +2195,15 @@ if ($action != 'create' && $action != 'edit') { print ''.$langs->trans('Delete').''."\n"; } - else - { + else { print 'id.'">'.$langs->trans("Delete").''; } } - else - { + else { print ''.$langs->trans("Delete").''; } } - else - { + else { print ''.$langs->trans("Delete").''; } } @@ -2276,8 +2237,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == $html .= $form->selectarray("propalid", $otherprop, 0, 1); $html .= ''; } - else - { + else { $html .= ''; } - else - { + else { $html .= ''; } - else - { + else { $html .= ''; @@ -247,8 +242,7 @@ if ($id > 0 || !empty($ref)) { print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); } - else - { + else { print price($object->price_min).' '.$langs->trans($object->price_base_type ? $object->price_base_type : 'HT'); } print ''; @@ -299,8 +293,7 @@ if ($id > 0 || !empty($ref)) print ''; } } - else - { + else { print ''; print ''; print ''; @@ -378,8 +371,7 @@ if ($id > 0 || !empty($ref)) { $pricesell = 'Variable'; } - else - { + else { $totallinesell = price2num($value['nb'] * ($pricesell), 'MT'); $totalsell += $totallinesell; } @@ -405,8 +397,7 @@ if ($id > 0 || !empty($ref)) print ''."\n"; } - else - { + else { $hide = ''; if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide = ' hideobject'; // By default, we do not show this. It makes screen very difficult to understand @@ -469,8 +460,7 @@ if ($id > 0 || !empty($ref)) print ''; print ''."\n"; } - else - { + else { $colspan = 8; if (!empty($conf->stock->enabled)) $colspan++; @@ -600,8 +590,7 @@ if ($id > 0 || !empty($ref)) $qty = $object->is_sousproduit_qty; $incdec = $object->is_sousproduit_incdec; } - else - { + else { //$addchecked = ''; $qty = 0; $incdec = 0; @@ -615,8 +604,7 @@ if ($id > 0 || !empty($ref)) // Inc Dec print ''; } } - else - { + else { dol_print_error($db); } print '
'.$langs->trans("Nature").''; $statutarray = array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); @@ -1734,8 +1708,7 @@ else print ''; } // Fiche en mode visu - else - { + else { $showbarcode = empty($conf->barcode->enabled) ? 0 : 1; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode = 0; @@ -1791,8 +1764,7 @@ else { print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type'); } - else - { + else { $object->fetch_barcode(); print $object->barcode_type_label ? $object->barcode_type_label : ($object->barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); } @@ -1819,8 +1791,7 @@ else print ' '; print ''; } - else - { + else { print $object->barcode; } print '
'.$langs->trans("Nature").''; print $object->getLibFinished(); @@ -2025,8 +1995,7 @@ else { print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); } - else - { + else { print ' '; } print "
'; $html .= $langs->trans("AddToDraftProposals").''; $html .= $langs->trans("NoDraftProposals"); @@ -2300,8 +2260,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == $html .= $form->selectarray("commandeid", $othercom, 0, 1); $html .= '
'; $html .= $langs->trans("AddToDraftOrders").''; $html .= $langs->trans("NoDraftOrders"); @@ -2324,8 +2283,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == $html .= $form->selectarray("factureid", $otherinvoice, 0, 1); $html .= '
'; $html .= $langs->trans("AddToDraftInvoices").''; $html .= $langs->trans("NoDraftInvoices"); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index b04560dab32..66cef158439 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -303,8 +303,7 @@ class Products extends DolibarrApi // We update price only if it was changed $pricemodified = false; if ($this->product->price_base_type != $oldproduct->price_base_type) { $pricemodified = true; - } else - { + } else { if ($this->product->tva_tx != $oldproduct->tva_tx) { $pricemodified = true; } if ($this->product->tva_npr != $oldproduct->tva_npr) { $pricemodified = true; @@ -318,8 +317,7 @@ class Products extends DolibarrApi if ($this->product->price_min_ttc != $oldproduct->price_min_ttc) { $pricemodified = true; } } - else - { + else { if ($this->product->price != $oldproduct->price) { $pricemodified = true; } if ($this->product->price_min != $oldproduct->price_min) { $pricemodified = true; @@ -805,7 +803,7 @@ class Products extends DolibarrApi $product_fourn = new ProductFournisseur($this->db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0); - foreach($product_fourn_list as $tmpobj) { + foreach ($product_fourn_list as $tmpobj) { $this->_cleanObjectDatas($tmpobj); } //var_dump($product_fourn_list->db);exit; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 0eeddd15c07..b38501cb788 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -102,8 +102,7 @@ class FormProduct { $sql .= ", pb.qty as stock"; } - else - { + else { $sql .= ", ps.reel as stock"; } } @@ -126,8 +125,7 @@ class FormProduct { $sql .= " AND e.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")"; } - else - { + else { $sql .= " AND e.statut = 1"; } @@ -179,8 +177,7 @@ class FormProduct return $num; } - else - { + else { dol_print_error($this->db); return -1; } @@ -271,8 +268,7 @@ class FormProduct if ($arraytypes['stock'] <= 0) { $label .= ' ('.$langs->trans("Stock").':'.$arraytypes['stock'].')'; } - else - { + else { $label .= ' ('.$langs->trans("Stock").':'.$arraytypes['stock'].')'; } } @@ -437,8 +433,7 @@ class FormProduct { if (!empty($fk_product)) $productIdArray[] = $fk_product; } - else - { + else { foreach ($objectLines as $line) { if ($line->fk_product) $productIdArray[] = $line->fk_product; } @@ -459,8 +454,7 @@ class FormProduct { $productIdArray = array($fk_product); // only show lot stock for product } - else - { + else { foreach ($this->cache_lot as $key => $value) { $productIdArray[] = $key; @@ -527,8 +521,7 @@ class FormProduct { return count($this->cache_lot); } - else - { + else { // clear cache $this->cache_lot = array(); $productIdList = implode(',', $productIdArray); @@ -561,8 +554,7 @@ class FormProduct return $num; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7b6892552d1..f072d04916e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -457,8 +457,7 @@ class Product extends CommonObject if ($err > 0) { return 0; } - else - { + else { return 1; } } @@ -683,34 +682,29 @@ class Product extends CommonObject $error++; } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } } - else - { + else { $error++; $this->error = 'ErrorFailedToGetInsertedId'; } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } } - else - { + else { // Product already exists with this ref $langs->load("products"); $error++; $this->error = "ErrorProductAlreadyExists"; } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -727,14 +721,12 @@ class Product extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -$error; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::Create fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -811,8 +803,7 @@ class Product extends CommonObject $result = $mod->verif($this->db, $valuetotest, $this, 0, $typefortest); return $result; } - else - { + else { return 0; } } @@ -1104,14 +1095,12 @@ class Product extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -$error; } } - else - { + else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); if (empty($conf->barcode->enabled) || empty($this->barcode)) { @@ -1123,8 +1112,7 @@ class Product extends CommonObject $this->db->rollback(); return -1; } - else - { + else { $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; $this->errors[] = $this->error; $this->db->rollback(); @@ -1132,8 +1120,7 @@ class Product extends CommonObject } } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::Update fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1281,8 +1268,7 @@ class Product extends CommonObject $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -1292,8 +1278,7 @@ class Product extends CommonObject return -$error; } } - else - { + else { $this->error = "ErrorRecordIsUsedCantDelete"; return 0; } @@ -1332,8 +1317,7 @@ class Product extends CommonObject } $sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'"; } - else - { + else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_lang (fk_product, lang, label, description"; if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note"; } @@ -1370,8 +1354,7 @@ class Product extends CommonObject } $sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'"; } - else - { + else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_lang (fk_product, lang, label, description"; if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note"; } @@ -1392,8 +1375,7 @@ class Product extends CommonObject } } } - else - { + else { // language is not current language and we didn't provide a multilang description for this language } } @@ -1435,8 +1417,7 @@ class Product extends CommonObject // End call triggers return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR); return -1; @@ -1498,8 +1479,7 @@ class Product extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1538,8 +1518,7 @@ class Product extends CommonObject } return 1; } - else - { + else { $this->error = "Error: ".$this->db->lasterror()." - ".$sql; return -1; } @@ -1581,8 +1560,7 @@ class Product extends CommonObject dol_print_error($this->db); return -1; } - else - { + else { return 1; } } @@ -1609,8 +1587,7 @@ class Product extends CommonObject if ($resql) { return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1687,8 +1664,7 @@ class Product extends CommonObject { $pu_ht = $priceforthequantityarray['unitprice']; } - else - { + else { $pu_ttc = $priceforthequantityarray['unitprice']; } break; @@ -1708,8 +1684,7 @@ class Product extends CommonObject { $pu_ht = $priceforthequantityarray['unitprice']; } - else - { + else { $pu_ttc = $priceforthequantityarray['unitprice']; } break; @@ -1852,20 +1827,17 @@ class Product extends CommonObject $result = $obj->fk_product; return $result; } - else - { + else { return -1; // Ce produit n'existe pas avec cet id tarif fournisseur ou existe mais qte insuffisante, ni pour le couple produit/ref fournisseur dans la quantité. } } - else - { + else { $this->error = $this->db->lasterror(); return -3; } } } - else - { + else { $this->error = $this->db->lasterror(); return -2; } @@ -1937,14 +1909,12 @@ class Product extends CommonObject $price_min = price2num($newminprice) / (1 + ($newvat / 100)); $price_min = price2num($price_min, 'MU'); } - else - { + else { $price_min = 0; $price_min_ttc = 0; } } - else - { + else { $price = price2num($newprice, 'MU'); $price_ttc = ($newnpr != 1) ? price2num($newprice) * (1 + ($newvat / 100)) : $price; $price_ttc = price2num($price_ttc, 'MU'); @@ -1955,8 +1925,7 @@ class Product extends CommonObject $price_min_ttc = price2num($price_min_ttc, 'MU'); //print 'X'.$newminprice.'-'.$price_min; } - else - { + else { $price_min = 0; $price_min_ttc = 0; } @@ -1969,7 +1938,7 @@ class Product extends CommonObject $localtaxtype2 = $localtaxes_array['2']; $localtax2 = $localtaxes_array['3']; } - else // old method. deprecated because ot can't retreive type + else // old method. deprecated because ot can't retreive type { $localtaxtype1 = '0'; $localtax1 = get_localtax($newvat, 1); @@ -2045,8 +2014,7 @@ class Product extends CommonObject $this->db->commit(); } - else - { + else { $this->db->rollback(); dol_print_error($this->db); } @@ -2281,8 +2249,7 @@ class Product extends CommonObject } }*/ } - else - { + else { dol_print_error($this->db); return -1; } @@ -2330,15 +2297,13 @@ class Product extends CommonObject } $this->prices_by_qty_list[0] = $resultat; } - else - { + else { dol_print_error($this->db); return -1; } } } - else - { + else { dol_print_error($this->db); return -1; } @@ -2394,15 +2359,13 @@ class Product extends CommonObject } $this->prices_by_qty_list[$i] = $resultat; } - else - { + else { dol_print_error($this->db); return -1; } } } - else - { + else { dol_print_error($this->db); return -1; } @@ -2427,13 +2390,11 @@ class Product extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -2507,8 +2468,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2558,8 +2518,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2661,8 +2620,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_commande = $hookmanager->resArray['stats_commande']; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2718,8 +2676,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -2802,8 +2759,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2855,8 +2811,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2946,8 +2901,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -3020,8 +2974,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -3094,8 +3047,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -3147,8 +3099,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -3182,8 +3133,7 @@ class Product extends CommonObject $i++; } } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -3192,8 +3142,7 @@ class Product extends CommonObject $year = strftime('%Y', time()); $month = strftime('%m', time()); } - else - { + else { $month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year. } $result = array(); @@ -3674,8 +3623,7 @@ class Product extends CommonObject dol_print_error($this->db); return -1; } - else - { + else { $result = $this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); @@ -3683,16 +3631,14 @@ class Product extends CommonObject $this->error = "isFatherOfThis"; return -1; } - else - { + else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec)'; $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.', '.$incdec.')'; if (!$this->db->query($sql)) { dol_print_error($this->db); return -1; } - else - { + else { return 1; } } @@ -3736,8 +3682,7 @@ class Product extends CommonObject dol_print_error($this->db); return -1; } - else - { + else { return 1; } } @@ -3800,13 +3745,11 @@ class Product extends CommonObject return true; } - else - { + else { return false; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -3896,21 +3839,18 @@ class Product extends CommonObject $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } } // If the supplier price already exists for this product and quantity - else - { + else { $this->product_fourn_price_id = $obj->rowid; return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -2; } @@ -4106,8 +4046,7 @@ class Product extends CommonObject $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return 1; } @@ -4218,8 +4157,7 @@ class Product extends CommonObject if ($obj) { $nb = $obj->nb; } } - else - { + else { return -1; } @@ -4304,8 +4242,7 @@ class Product extends CommonObject } return $prods; } - else - { + else { dol_print_error($this->db); return -1; } @@ -4369,8 +4306,7 @@ class Product extends CommonObject return $prods; } - else - { + else { dol_print_error($this->db); return -1; } @@ -4498,8 +4434,7 @@ class Product extends CommonObject $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"'; $linkclose .= ' class="nowraponall classfortooltip"'; } - else - { + else { $linkclose = ' class="nowraponall"'; } @@ -4574,8 +4509,7 @@ class Product extends CommonObject if (!empty($conf->global->PRODUCT_ADDON_PDF)) { $modele = $conf->global->PRODUCT_ADDON_PDF; } - else - { + else { $modele = 'strato'; } } @@ -4744,8 +4678,7 @@ class Product extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $movementstock->error; $this->errors = $movementstock->errors; @@ -4792,8 +4725,7 @@ class Product extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $movementstock->error; $this->errors = $movementstock->errors; @@ -4872,8 +4804,7 @@ class Product extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -5019,8 +4950,7 @@ class Product extends CommonObject } return $result; } - else - { + else { dol_print_error($this->db); $this->db->rollback(); return array(); @@ -5258,8 +5188,7 @@ class Product extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -5395,8 +5324,7 @@ class Product extends CommonObject $this->db->free($resql); return $label; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; dol_syslog(get_class($this)."::getLabelOfUnit Error ".$this->error, LOG_ERR); return -1; @@ -5629,8 +5557,7 @@ class Product extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 05cfd7523e0..3c56221863c 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -120,8 +120,7 @@ class Productbatch extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -179,8 +178,7 @@ class Productbatch extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -233,8 +231,7 @@ class Productbatch extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -275,8 +272,7 @@ class Productbatch extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -331,8 +327,7 @@ class Productbatch extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -425,8 +420,7 @@ class Productbatch extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -495,8 +489,7 @@ class Productbatch extends CommonObject return $ret; } - else - { + else { $error = "Error ".$db->lasterror(); return -1; } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 9ca53d167cf..26c627ee0e4 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -140,8 +140,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -199,8 +198,7 @@ class Propalmergepdfproduct extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -273,8 +271,7 @@ class Propalmergepdfproduct extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch_by_product ".$this->error, LOG_ERR); return -1; @@ -334,8 +331,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -377,8 +373,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -427,8 +422,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -470,8 +464,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -526,8 +519,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index dbdb6cb6f42..194a342d391 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -81,27 +81,23 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se //var_dump($i.' '.GETPOST("prod_id_".$i, 'int'), $qty, GETPOST("prod_incdec_".$i, 'int')); $action = 'edit'; } - else - { + else { $error++; $action = 're-edit'; if ($object->error == "isFatherOfThis") { setEventMessages($langs->trans("ErrorAssociationIsFatherOfThis"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } } - else - { + else { if ($object->del_sousproduit($id, GETPOST("prod_id_".$i, 'int')) > 0) { $action = 'edit'; } - else - { + else { $error++; $action = 're-edit'; setEventMessages($object->error, $object->errors, 'errors'); @@ -235,8 +231,7 @@ if ($id > 0 || !empty($ref)) { print price($object->price_ttc).' '.$langs->trans($object->price_base_type); } - else - { + else { print price($object->price).' '.$langs->trans($object->price_base_type ? $object->price_base_type : 'HT'); } print '
'.$langs->trans("None").'
'; if ($qty) print ''; - else - { + else { // TODO Hide field and show it when setting a qty print ''; //print ''; @@ -636,8 +624,7 @@ if ($id > 0 || !empty($ref)) print '
'; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index e5702078dd2..db233fbe84c 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -314,8 +314,7 @@ if ($object->id) $checked = ' checked '; } } - else - { + else { if (array_key_exists($filetoadd['name'], $filetomerge->lines)) { $checked = ' checked '; @@ -338,8 +337,7 @@ if ($object->id) } } } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 420d5aaddb2..4f40e2b6c6f 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -124,8 +124,7 @@ class PriceExpression $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -163,13 +162,11 @@ class PriceExpression $this->expression = $obj->expression; return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -206,8 +203,7 @@ class PriceExpression $this->db->free($resql); return $retarray; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -237,13 +233,11 @@ class PriceExpression { return (int) $obj->rowid; } - else - { + else { return 0; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -302,8 +296,7 @@ class PriceExpression $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -360,8 +353,7 @@ class PriceExpression $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } 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 acede724da5..7f241518e4c 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -129,8 +129,7 @@ class PriceGlobalVariable $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -163,13 +162,11 @@ class PriceGlobalVariable $this->checkParameters(); return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -226,8 +223,7 @@ class PriceGlobalVariable $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -283,8 +279,7 @@ class PriceGlobalVariable $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -350,8 +345,7 @@ class PriceGlobalVariable $this->db->free($resql); return $retarray; } - else - { + else { $this->error = $this->db->error(); return -1; } 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 0c8e25e8751..12e497c0f2c 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 @@ -145,8 +145,7 @@ class PriceGlobalVariableUpdater $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -183,13 +182,11 @@ class PriceGlobalVariableUpdater $this->checkParameters(); return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -250,8 +247,7 @@ class PriceGlobalVariableUpdater $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -306,8 +302,7 @@ class PriceGlobalVariableUpdater $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -400,8 +395,7 @@ class PriceGlobalVariableUpdater $this->db->free($resql); return $retarray; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -442,8 +436,7 @@ class PriceGlobalVariableUpdater $this->db->free($resql); return $retarray; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -599,8 +592,7 @@ class PriceGlobalVariableUpdater $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -645,8 +637,7 @@ class PriceGlobalVariableUpdater $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index bf2f58f63f3..778f749f983 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -78,8 +78,7 @@ if ($action == 'add') if ($price_result < 0) { //Expression is not valid setEventMessages($priceparser->translatedError(), null, 'errors'); } - else - { + else { $price_expression->title = $title; $price_expression->expression = $expression; $result = $price_expression->create($user); @@ -88,8 +87,7 @@ if ($action == 'add') $eid = $price_expression->id; setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } - else - { + else { setEventMessages("add: ".$price_expression->error, $price_expression->errors, 'errors'); } } @@ -98,8 +96,7 @@ if ($action == 'add') { setEventMessages("add find: ".$price_expression->error, $price_expression->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); } } @@ -118,8 +115,7 @@ if ($action == 'update') if ($price_result < 0) { //Expression is not valid setEventMessages($priceparser->translatedError(), null, 'errors'); } - else - { + else { $price_expression->id = $eid; $price_expression->title = $title; $price_expression->expression = $expression; @@ -128,8 +124,7 @@ if ($action == 'update') { setEventMessages("update: ".$price_expression->error, $price_expression->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } } @@ -138,8 +133,7 @@ if ($action == 'update') { setEventMessages("update find: ".$price_expression->error, $price_expression->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); } } @@ -221,8 +215,7 @@ if ($eid == 0) { print '
'.$langs->trans('Delete').'
'."\n"; } -else -{ +else { print ''; } print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 7cc5d3966c1..3c4ebfc6acb 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -128,8 +128,7 @@ if (empty($reshook)) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action = ''; } - else - { + else { $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -211,8 +210,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors'); } - else - { + else { $_POST["price"] = 0; } } @@ -316,8 +314,7 @@ if (empty($reshook)) $error++; setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { if (!empty($conf->dynamicprices->enabled) && $price_expression !== '') { //Check the expression validity by parsing it @@ -347,13 +344,11 @@ if (empty($reshook)) $db->commit(); $action = ''; } - else - { + else { $db->rollback(); } } - else - { + else { $action = 'add_price'; } } @@ -453,8 +448,7 @@ if ($id > 0 || $ref) $object->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price print load_fiche_titre($langs->trans("ChangeSupplierPrice")); } - else - { + else { print load_fiche_titre($langs->trans("AddSupplierPrice")); } @@ -478,8 +472,7 @@ if ($id > 0 || $ref) print ''; print ''; } - else - { + else { $events = array(); $events[] = array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array()); print $form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events); @@ -503,8 +496,7 @@ if ($id > 0 || $ref) print ''; print ''; } - else - { + else { print ''; } print ''; @@ -529,8 +521,7 @@ if ($id > 0 || $ref) print ''; print $object->fourn_qty; } - else - { + else { print ''; } // Units @@ -564,8 +555,7 @@ if ($id > 0 || $ref) $default_vat = $tmpproductsupplier->fourn_tva_tx; $default_npr = $tmpproductsupplier->fourn_tva_npr; } - else - { + else { if (empty($default_vat)) { $default_vat = $object->tva_tx; @@ -945,8 +935,7 @@ SCRIPT; { print ''.$productfourn->getNomUrl().''; } - else - { + else { print ''.$productfourn->fourn_ref.''; } @@ -1099,8 +1088,7 @@ SCRIPT; print ''; } } - else - { + else { dol_print_error($db); } @@ -1110,8 +1098,7 @@ SCRIPT; } } } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 3067cc63733..ebe55716bae 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -226,8 +226,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA { $dataseries[] = array($obj->label, round($obj->nb)); } - else - { + else { $rest += $obj->nb; } $total += $obj->nb; @@ -248,8 +247,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $dolgraph->draw('idstatscategproduct'); print $dolgraph->show($total ? 0 : 1); } - else - { + else { while ($i < $num) { $obj = $db->fetch_object($result); @@ -386,8 +384,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print '
'; } } - else - { + else { dol_print_error($db); } } @@ -457,8 +454,7 @@ function activitytrim($product_type) if ($product_type == 0) print ''.$langs->trans("ProductSellByQuarterHT").''; - else - print ''.$langs->trans("ServiceSellByQuarterHT").''; + else print ''.$langs->trans("ServiceSellByQuarterHT").''; print ''.$langs->trans("Quarter1").''; print ''.$langs->trans("Quarter2").''; print ''.$langs->trans("Quarter3").''; diff --git a/htdocs/product/inventory/ajax/ajax.inventory.php b/htdocs/product/inventory/ajax/ajax.inventory.php index 1ea99480bd6..c258b63de2b 100644 --- a/htdocs/product/inventory/ajax/ajax.inventory.php +++ b/htdocs/product/inventory/ajax/ajax.inventory.php @@ -21,8 +21,7 @@ switch ($put) echo $det->qty_view; } - else - { + else { echo -2; } @@ -41,8 +40,7 @@ switch ($put) echo $det->new_pmp; } - else - { + else { echo -2; } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 0e8ab8bda55..a5084c296a1 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -42,8 +42,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $id); } -else -{ +else { $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } @@ -81,8 +80,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $permissiontoadd = $user->rights->stock->creer; $permissiontodelete = $user->rights->stock->supprimer; } -else -{ +else { $permissiontoadd = $user->rights->stock->inventory_advance->write; $permissiontodelete = $user->rights->stock->inventory_advance->write; } @@ -337,8 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans("Modify").''."\n"; } - else - { + else { print ''.$langs->trans('Modify').''."\n"; } @@ -346,8 +343,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans("Validate").''."\n"; } - else - { + else { print ''.$langs->trans('Validate').''."\n"; } @@ -355,8 +351,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans('Delete').''."\n"; } - else - { + else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index e24fe4e0ad2..381c40d0aa4 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -466,8 +466,7 @@ class Inventory extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 3f0989251b5..373164eeae4 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -42,8 +42,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $id); } -else -{ +else { $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } @@ -81,8 +80,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $permissiontoadd = $user->rights->stock->creer; $permissiontodelete = $user->rights->stock->supprimer; } -else -{ +else { $permissiontoadd = $user->rights->stock->inventory_advance->write; $permissiontodelete = $user->rights->stock->inventory_advance->write; } @@ -283,8 +281,7 @@ if ($object->id > 0) { print ''.$langs->trans("Edit").''."\n"; } - else - { + else { print ''.$langs->trans('Edit').''."\n"; } } @@ -295,8 +292,7 @@ if ($object->id > 0) { print ''.$langs->trans("Validate").''."\n"; } - else - { + else { print ''.$langs->trans('Validate').''."\n"; } } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index f3f7621b821..c799ab7da87 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -77,8 +77,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $objectid); } -else -{ +else { $result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance'); } @@ -256,8 +255,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit { $num = $nbtotalofrecords; } -else -{ +else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 17dd18b567b..347281f0c75 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -292,13 +292,11 @@ if ($search_type != '' && $search_type != '-1') { $texte = $langs->trans("Services"); } - else - { + else { $texte = $langs->trans("Products"); } } -else -{ +else { $texte = $langs->trans("ProductsAndServices"); } @@ -1411,8 +1409,7 @@ if ($resql) print ""; print ''; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/product/popucom.php b/htdocs/product/popucom.php index 2c28266ad15..c21afa711e7 100644 --- a/htdocs/product/popucom.php +++ b/htdocs/product/popucom.php @@ -67,8 +67,7 @@ elseif ($type == '1') { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } -else -{ +else { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } $title = $langs->trans("Statistics"); @@ -153,8 +152,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } //var_dump($infoprod); diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index bf2ae9020ec..92de8b33546 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -67,8 +67,7 @@ elseif ($type == '1') { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } -else -{ +else { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } $title = $langs->trans("Statistics"); @@ -153,8 +152,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } //var_dump($infoprod); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index f2109b94795..1db2219bf63 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -170,8 +170,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -767,8 +766,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ //print vatrate($object->multiprices_tva_tx[$soc->price_level], true); print ''; } - else - { + else { // TVA print ''.$langs->trans("DefaultTaxRate").''; @@ -787,8 +785,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''; } } - else - { + else { if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility { // We show only vat for level 1 @@ -796,8 +793,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''.vatrate($object->multiprices_tva_tx[1], true).''; print ''; } - else - { + else { // TVA print ''.$langs->trans("DefaultTaxRate").''; @@ -846,8 +842,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ' '; print ''; } - else - { + else { print $langs->trans("SellingPrice").' '.$i; if (!empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); } @@ -872,8 +867,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ { print price($object->multiprices_min_ttc[$i]).' '.$langs->trans($object->multiprices_base_type[$i]); } - else - { + else { print price($object->multiprices_min[$i]).' '.$langs->trans($object->multiprices_base_type[$i]); } print ''; @@ -954,8 +948,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ } } } -else -{ +else { // TVA print ''.$langs->trans("DefaultTaxRate").''; @@ -998,8 +991,7 @@ else if ($object->prices_by_qty[0] == 0) { print '  ('.$langs->trans("Activate").')'; } - else - { + else { print '  ('.$langs->trans("DisablePriceByQty").')'; } print ''; @@ -1289,8 +1281,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) print '
'; } - else - { + else { print ''."\n"; ?> '."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } } diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index c92108d7723..045f726fe1d 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -88,8 +88,7 @@ if ($resql) { print "".dolGetFirstLastname($objp->firstname, $objp->lastname)." ".$objp->societe."\n"; } - else - { + else { print "Anonyme Anonyme\n"; } print "".dol_print_date($db->jdate($objp->datedon))."\n"; @@ -99,13 +98,11 @@ if ($resql) } print ""; } - else - { + else { print "Aucun don publique"; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 7f788a84671..71e28c94da8 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -391,8 +391,7 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } @@ -408,8 +407,7 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } @@ -425,8 +423,7 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } @@ -442,14 +439,12 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } } - else - { + else { dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); exit; } @@ -458,8 +453,7 @@ if ($action == 'add') if (!empty($entity)) $urlback .= '&entity='.$entity; dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); } - else - { + else { $error++; $errmsg .= join('
', $adh->errors); } @@ -472,8 +466,7 @@ if ($action == 'add') Header("Location: ".$urlback); exit; } - else - { + else { $db->rollback(); } } @@ -575,8 +568,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty); print ''."\n"; } -else -{ +else { $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); print ''; } @@ -589,8 +581,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print ''."\n"; } -else -{ +else { print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; print ''; } @@ -733,8 +724,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) { print ''; } - else - { + else { print ''; print ''; } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 04fe1f75fca..a955c9605f2 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -85,8 +85,7 @@ if ($id > 0) { print $langs->trans("ErrorThisMemberIsNotPublic"); } - else - { + else { print ''; print '\n"; diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 459926707b8..1a885ed3596 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -153,8 +153,7 @@ if ($result) print $form->showphoto('memberphoto', $objp, 64); print ''."\n"; } - else - { + else { print "\n"; } print ""; @@ -162,8 +161,7 @@ if ($result) } print "
'.$langs->trans("Type").''.$object->type."
 
"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index 626aba2cd32..b3b362fa6b2 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.php @@ -39,8 +39,7 @@ if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml' print 'Sorry, it seems your internet connexion is off.
'; print 'You need to be connected to network to use this software.
'; } -else -{ +else { $langs->load("error"); $langs->load("other"); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 2378728a8d3..20b029f960d 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -236,8 +236,7 @@ if ($source == 'proposal') $mesg = $proposal->error; $error++; } - else - { + else { $result = $proposal->fetch_thirdparty($proposal->socid); } @@ -277,13 +276,11 @@ if ($action != 'dosign') if ($found && !$error) // We are in a management option and no error { } - else - { + else { dol_print_error_email('ERRORNEWONLINESIGN'); } } -else -{ +else { // Print } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index d0ce716bb7d..f26d31c483d 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -133,8 +133,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); $error++; } - else - { + else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $resql = $db->query($sql); @@ -173,8 +172,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout else dol_print_error($db); } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } } @@ -392,8 +390,7 @@ if ($object->format == "D") print ''."\n"; } } -else -{ +else { //display of survey topics print ''."\n"; print ''."\n"; @@ -481,8 +478,7 @@ while ($compteur < $num) } } } - else - { + else { //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs if ($compteur == $ligneamodifier) { @@ -509,8 +505,7 @@ while ($compteur < $num) print ''."\n"; } } - else - { + else { for ($i = 0; $i < $nbcolonnes; $i++) { $car = substr($ensemblereponses, $i, 1); @@ -695,8 +690,7 @@ if ($object->allow_spy) { $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').' ('.dol_print_date($toutsujet[$i], '%A').')'; } } - else - { + else { $tmps = explode('@', $toutsujet[$i]); $meilleursujet .= dol_htmlentities($tmps[0]); } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index ea7fd71c9e6..b82dcc3360b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -211,8 +211,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } - else - { + else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } if ($SECUREKEY != $token) @@ -371,8 +370,7 @@ if ($action == 'dopayment') if ($paymentmethod == 'stripe') { if (GETPOST('newamount', 'alpha')) $amount = price2num(GETPOST('newamount', 'alpha'), 'MT'); - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $action = ''; } @@ -469,8 +467,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) setEventMessages('Failed to create card record', null, 'errors'); $action = ''; } - else - { + else { if (!empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; if (!empty($dol_id)) $metadata["dol_id"] = $dol_id; if (!empty($dol_type)) $metadata["dol_type"] = $dol_type; @@ -497,8 +494,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) } } } - else - { + else { $vatcleaned = $vatnumber ? $vatnumber : null; /*$taxinfo = array('type'=>'vat'); @@ -670,8 +666,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) setEventMessages($paymentintent->status, null, 'errors'); $action = ''; } - else - { + else { // TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method // Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here. //dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe'); @@ -701,8 +696,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) header("Location: ".$urlko); exit; } - else - { + else { header("Location: ".$urlok); exit; } @@ -914,8 +908,7 @@ if ($source == 'order') $mesg = $order->error; $error++; } - else - { + else { $result = $order->fetch_thirdparty($order->socid); } $object = $order; @@ -1009,8 +1002,7 @@ if ($source == 'order') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($order->thirdparty)) print ''."\n"; @@ -1037,8 +1029,7 @@ if ($source == 'invoice') $mesg = $invoice->error; $error++; } - else - { + else { $result = $invoice->fetch_thirdparty($invoice->socid); } $object = $invoice; @@ -1103,8 +1094,7 @@ if ($source == 'invoice') print ''; } } - else - { + else { print ''.price($object->total_ttc, 1, $langs).''; } // Currency @@ -1139,8 +1129,7 @@ if ($source == 'invoice') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($invoice->thirdparty)) print ''."\n"; @@ -1168,8 +1157,7 @@ if ($source == 'contractline') $mesg = $contractline->error; $error++; } - else - { + else { if ($contractline->fk_contrat > 0) { $result = $contract->fetch($contractline->fk_contrat); @@ -1177,14 +1165,12 @@ if ($source == 'contractline') { $result = $contract->fetch_thirdparty($contract->socid); } - else - { + else { $mesg = $contract->error; $error++; } } - else - { + else { $mesg = 'ErrorRecordNotFound'; $error++; } @@ -1207,8 +1193,7 @@ if ($source == 'contractline') $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; $price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level]; } - else - { + else { $pu_ht = $product->price; $pu_ttc = $product->price_ttc; $price_base_type = $product->price_base_type; @@ -1294,8 +1279,7 @@ if ($source == 'contractline') { $dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("DurationDays"), "w"=>$langs->trans("DurationWeeks"), "m"=>$langs->trans("DurationMonths"), "y"=>$langs->trans("DurationYears")); } - else - { + else { $dur = array("h"=>$langs->trans("Hour"), "d"=>$langs->trans("DurationDay"), "w"=>$langs->trans("DurationWeek"), "m"=>$langs->trans("DurationMonth"), "y"=>$langs->trans("DurationYear")); } $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; @@ -1352,8 +1336,7 @@ if ($source == 'contractline') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($contract->thirdparty)) print ''."\n"; @@ -1380,8 +1363,7 @@ if ($source == 'membersubscription') $mesg = $member->error; $error++; } - else - { + else { $member->fetch_thirdparty(); $subscription = new Subscription($db); } @@ -1523,8 +1505,7 @@ if ($source == 'membersubscription') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($member->thirdparty)) print ''."\n"; @@ -1549,8 +1530,7 @@ if ($source == 'donation') $mesg = $don->error; $error++; } - else - { + else { $don->fetch_thirdparty(); } $object = $don; @@ -1668,8 +1648,7 @@ if ($source == 'donation') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($don->thirdparty)) print ''."\n"; @@ -1705,8 +1684,7 @@ if ($action != 'dopayment') { print '

'.$langs->trans("DonationPaid").''; } - else - { + else { // Membership can be paid and we still allow to make renewal if ($source == 'membersubscription' && $object->datefin > dol_now()) { @@ -1796,13 +1774,11 @@ if ($action != 'dopayment') } } } - else - { + else { dol_print_error_email('ERRORNEWPAYMENT'); } } -else -{ +else { // Print } @@ -1940,8 +1916,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { print '
'.$langs->trans("Error").'
'; } - else - { + else { print ''; //$_SESSION["paymentintent_id"] = $paymentintent->id; } @@ -1956,8 +1931,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment $langs->load("errors"); print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error'); } - else - { + else { print ''; print ''."\n"; print ''."\n"; @@ -2173,7 +2147,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment // Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off @@ -2241,7 +2215,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment }); /* Use 3DS source */ diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index a3f6d733fcb..a261c6101a0 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -78,8 +78,7 @@ if (empty($paymentmethod)) dol_print_error(null, 'The back url does not contains a parameter fulltag that should help us to find the payment method used'); exit; } -else -{ +else { dol_syslog("paymentmethod=".$paymentmethod); } @@ -187,8 +186,7 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } - else - { + else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index b1d6c149a51..a1d562b8690 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -222,8 +222,7 @@ if (!empty($conf->paypal->enabled)) // Nothing to do dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment'); } - else - { + else { dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment'); } @@ -251,8 +250,7 @@ if (!empty($conf->paypal->enabled)) $ispaymentok = true; } - else - { + else { dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING, 0, '_payment'); //Display a user friendly Error on the page using any of the following error information returned by PayPal @@ -262,13 +260,11 @@ if (!empty($conf->paypal->enabled)) $ErrorSeverityCode = urldecode($resArray2["L_SEVERITYCODE0"]); } } - else - { + else { dol_print_error('', 'Session expired'); } } - else - { + else { dol_print_error('', '$PAYPALTOKEN not defined'); } } @@ -420,8 +416,7 @@ if ($ispaymentok) $postactionmessages[] = $errmsg; $ispostactionok = -1; } - else - { + else { $postactionmessages[] = 'Subscription created'; $ispostactionok = 1; } @@ -443,8 +438,7 @@ if ($ispaymentok) $postactionmessages = array_merge($postactionmessages, $object->errors); $ispostactionok = -1; } - else - { + else { if ($option == 'bankviainvoice') { $postactionmessages[] = 'Invoice, payment and bank record created'; @@ -523,8 +517,7 @@ if ($ispaymentok) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -590,8 +583,7 @@ if ($ispaymentok) $postactionmessages[] = $errmsg; $ispostactionok = -1; } - else - { + else { if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; else $postactionmessages[] = 'Email sent to member (without any attached document)'; @@ -600,14 +592,12 @@ if ($ispaymentok) } } } - else - { + else { $postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'].'. May be payment was already recorded.'; $ispostactionok = -1; } } - else - { + else { $postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found'; $ispostactionok = -1; } @@ -648,8 +638,7 @@ if ($ispaymentok) { $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id } - else - { + else { $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; @@ -672,8 +661,7 @@ if ($ispaymentok) $ispostactionok = -1; $error++; } - else - { + else { $postactionmessages[] = 'Payment created'; $ispostactionok = 1; } @@ -697,14 +685,12 @@ if ($ispaymentok) $ispostactionok = -1; $error++; } - else - { + else { $postactionmessages[] = 'Bank transaction of payment created'; $ispostactionok = 1; } } - else - { + else { $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; $ispostactionok = -1; $error++; @@ -715,25 +701,21 @@ if ($ispaymentok) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'].'. May be payment was already recorded.'; $ispostactionok = -1; } } - else - { + else { $postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found'; $ispostactionok = -1; } } - else - { + else { // Nothing done } } @@ -811,8 +793,7 @@ if ($ispaymentok) //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."
\n"; $content .= $companylangs->trans("Link").':
'.$url.''."
\n"; } - else - { + else { $content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."
\n"; } $content .= $companylangs->transnoentities("PostActionAfterPayment").' : '; @@ -825,8 +806,7 @@ if ($ispaymentok) { $content .= $companylangs->transnoentitiesnoconv("None"); } - else - { + else { $topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')'); $content .= ''.$companylangs->transnoentitiesnoconv("Error").''; } @@ -865,15 +845,13 @@ if ($ispaymentok) dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); //dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0); } - else - { + else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); //dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0); } } } -else -{ +else { // Get on url call $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; $payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID; @@ -952,8 +930,7 @@ else { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } - else - { + else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } diff --git a/htdocs/public/stripe/confirm_payment.php b/htdocs/public/stripe/confirm_payment.php index 9a45a2cbeec..9c6346842c8 100644 --- a/htdocs/public/stripe/confirm_payment.php +++ b/htdocs/public/stripe/confirm_payment.php @@ -49,8 +49,7 @@ if (isset($_GET['connect'])) $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -63,8 +62,7 @@ else { $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; $servicestatus = 1; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 4291cb6f834..e3cc21b327b 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -49,8 +49,7 @@ if (isset($_GET['connect'])) $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -63,8 +62,7 @@ else { $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -189,8 +187,7 @@ if ($event->type == 'payout.created') { http_response_code(200); // PHP 5.4 or greater return 1; } - else - { + else { $error++; http_response_code(500); // PHP 5.4 or greater return -1; @@ -270,8 +267,7 @@ elseif ($event->type == 'payout.paid') { http_response_code(200); // PHP 5.4 or greater return 1; } - else - { + else { $error++; http_response_code(500); // PHP 5.4 or greater return -1; @@ -344,8 +340,7 @@ elseif ($event->type == 'payment_method.attached') { { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -381,8 +376,7 @@ elseif ($event->type == 'payment_method.updated') { { $db->commit(); } - else - { + else { $db->rollback(); } } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index c326b4a6bd2..cbe88b006d4 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -46,8 +46,7 @@ if (empty($usedolheader)) trans('TicketMessagesList'), '', 'object_conversation'); $object->viewTicketMessages(false, true, $object->dao); } - else - { + else { print ''; } } else { diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php index 95f2efa492a..2f18de010a0 100644 --- a/htdocs/public/website/index.php +++ b/htdocs/public/website/index.php @@ -106,8 +106,7 @@ if (empty($pageid)) } } } - else - { + else { if ($object->fk_default_home > 0) { $result = $objectpage->fetch($object->fk_default_home); @@ -165,8 +164,7 @@ if ($pageid == 'css') // No more used ? header('Cache-Control: no-cache'); $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/styles.css.php'; } -else -{ +else { $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/page'.$pageid.'.tpl.php'; } diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php index ce416bdd7b6..24125178f5d 100644 --- a/htdocs/public/website/styles.css.php +++ b/htdocs/public/website/styles.css.php @@ -78,8 +78,7 @@ if (empty($pageid)) $object->fetch($websiteid); $website = $object->ref; } - else - { + else { $object->fetch(0, $website); } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3d8547f9322..2ada4b1c447 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -233,8 +233,7 @@ if (empty($reshook)) if ($object->origin == "supplierorder") $classname = 'CommandeFournisseur'; - else - $classname = ucfirst($object->origin); + else $classname = ucfirst($object->origin); $objectsrc = new $classname($db); $objectsrc->fetch($object->origin_id); @@ -354,8 +353,7 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToReceive").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; } @@ -366,8 +364,7 @@ if (empty($reshook)) header("Location: card.php?id=".$object->id); exit; } - else - { + else { $db->rollback(); $_GET["commande_id"] = GETPOST('commande_id', 'int'); $action = 'create'; @@ -388,8 +385,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans($object->error), null, 'errors'); } - else - { + else { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -418,8 +414,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/reception/index.php'); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -567,8 +562,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit(); } - else - { + else { setEventMessages($line->error, $line->errors, 'errors'); } } @@ -667,8 +661,7 @@ if (empty($reshook)) $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1049,8 +1042,7 @@ if ($action == 'create') print ''; } - else - { + else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1089,8 +1081,7 @@ if ($action == 'create') { $quantityToBeDelivered = 0; } - else - { + else { $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; } $warehouse_id = $dispatchLines[$indiceAsked]['ent']; @@ -1131,8 +1122,7 @@ if ($action == 'create') print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0, 0, $line->fk_product, '', 1); } } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1195,8 +1185,7 @@ if ($action == 'create') print '
'; } - else - { + else { dol_print_error($db); } } @@ -1247,8 +1236,7 @@ elseif ($id || $ref) { $numref = $object->getNextNumRef($soc); } - else - { + else { $numref = $object->ref; } @@ -1413,8 +1401,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -1437,8 +1424,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -1472,8 +1458,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueHeight; print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; } @@ -1551,8 +1536,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey @@ -1585,8 +1569,7 @@ elseif ($id || $ref) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -1640,8 +1623,7 @@ elseif ($id || $ref) { print $langs->trans("QtyToReceive").' - '; } - else - { + else { print $langs->trans("QtyReceived").' - '; } if (!empty($conf->stock->enabled)) @@ -1654,14 +1636,12 @@ elseif ($id || $ref) } print ''; } - else - { + else { if ($object->statut <= 1) { print ''.$langs->trans("QtyToReceive").''; } - else - { + else { print ''.$langs->trans("QtyReceived").''; } if (!empty($conf->stock->enabled)) @@ -1769,8 +1749,7 @@ elseif ($id || $ref) $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label; } - else - $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label); + else $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label); print ''; @@ -1785,8 +1764,7 @@ elseif ($id || $ref) } print "\n"; } - else - { + else { print ""; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1806,8 +1784,7 @@ elseif ($id || $ref) { print ''; } - else - { + else { print ''.$lines[$i]->comment.''; } @@ -1873,8 +1850,7 @@ elseif ($id || $ref) } print ''; } - else - { + else { print ''; print ''; // Qty to receive or received @@ -1888,8 +1864,7 @@ elseif ($id || $ref) } print ''; } - else - { + else { // Qty to receive or received print ''.$lines[$i]->qty.''; @@ -1926,8 +1901,7 @@ elseif ($id || $ref) print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); } - else - { + else { print $langs->trans("NA"); } print ''; @@ -1988,8 +1962,7 @@ elseif ($id || $ref) { print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); } - else - { + else { print $line->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); } } @@ -2027,8 +2000,7 @@ elseif ($id || $ref) { print ''.$langs->trans("Validate").''; } - else - { + else { print ''.$langs->trans("Validate").''; } } @@ -2045,8 +2017,7 @@ elseif ($id || $ref) { print ''.$langs->trans("ClassifyUnbilled").''; } - else - { + else { print ''.$langs->trans("ReOpen").''; } } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index a95d6217c1c..111846347be 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -179,14 +179,12 @@ class Reception extends CommonObject { return $numref; } - else - { + else { dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error); return ""; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_RECEPTION_ADDON_NUMBER_NotDefined"); return ""; } @@ -325,8 +323,7 @@ class Reception extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -336,16 +333,14 @@ class Reception extends CommonObject return -1 * $error; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $error++; $this->error = $this->db->error()." - sql=$sql"; $this->db->rollback(); @@ -473,15 +468,13 @@ class Reception extends CommonObject return 1; } - else - { + else { dol_syslog(get_class($this).'::Fetch no reception found', LOG_ERR); $this->error = 'Delivery with id '.$id.' not found'; return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -602,8 +595,7 @@ class Reception extends CommonObject break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. @@ -618,8 +610,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; @@ -694,8 +685,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR); @@ -867,8 +857,7 @@ class Reception extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -922,8 +911,7 @@ class Reception extends CommonObject $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed } } - else - { + else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -1000,35 +988,30 @@ class Reception extends CommonObject return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } } - else - { + else { $this->db->rollback(); return -1; } @@ -1274,14 +1257,12 @@ class Reception extends CommonObject $this->date_delivery = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } @@ -1365,8 +1346,7 @@ class Reception extends CommonObject $sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')"; $resql = $this->db->query($sql); } - else - { + else { $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql .= " code='".$this->db->escape($this->update['code'])."'"; $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'"; @@ -1442,8 +1422,7 @@ class Reception extends CommonObject $url = str_replace('{TRACKID}', $value, $tracking); $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); } - else - { + else { $this->tracking_url = $value; } } @@ -1545,8 +1524,7 @@ class Reception extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1560,8 +1538,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1576,8 +1553,7 @@ class Reception extends CommonObject } } } - else - { + else { dol_print_error($this->db); $error++; } @@ -1587,8 +1563,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1633,8 +1608,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1710,8 +1684,7 @@ class Reception extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1724,8 +1697,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1755,8 +1727,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1846,8 +1817,7 @@ class Reception extends CommonObject break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1860,8 +1830,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1912,8 +1881,7 @@ class Reception extends CommonObject return -1; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index b2d30bf7c7f..b5e526bb1b3 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -91,8 +91,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index c6cfcd5264c..c753cf3e873 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -279,15 +279,13 @@ if (empty($reshook)) $result = $object->insert_discount($discountid); //$result=$discount->link_to_invoice($lineid,$id); } - else - { + else { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; break; } } - else - { + else { // Positive line $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Date start @@ -335,8 +333,7 @@ if (empty($reshook)) { $lineid = $result; } - else - { + else { $lineid = 0; $error++; break; @@ -391,8 +388,7 @@ if (empty($reshook)) $db->commit(); setEventMessage($langs->trans('BillCreated', $nb_bills_created)); } - else - { + else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -585,8 +581,7 @@ if ($resql) print $form->selectyesno('validate_invoices', 0, 1, 1); print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; } - else - { + else { print $form->selectyesno('validate_invoices', 0, 1); } print ''; @@ -937,8 +932,7 @@ if ($resql) print ''; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index e7e8ef7e090..4a0bcb4fd04 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -78,8 +78,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/receptionsnbinyear-'.$year.'.png'; } diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 1035d17d5f9..fa99e4610d5 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -49,8 +49,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index b403c0516f9..9f2a044525d 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -100,8 +100,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $action = 'create'; } - else - { + else { $object->ref = $ref; $object->description = $description; $object->fk_code_type_resource = $fk_code_type_resource; @@ -119,16 +118,14 @@ if (empty($reshook)) Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { // Creation KO setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } } } - else - { + else { Header("Location: list.php"); exit; } @@ -166,14 +163,12 @@ if (empty($reshook)) Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } @@ -198,13 +193,11 @@ if (empty($reshook)) Header('Location: '.DOL_URL_ROOT.'/resource/list.php'); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -228,8 +221,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) print load_fiche_titre($title, '', 'object_resource'); dol_fiche_head(''); } - else - { + else { $head = resource_prepare_head($object); dol_fiche_head($head, 'resource', $title, -1, 'resource'); } @@ -292,8 +284,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) print ''; } - else - { + else { $formconfirm = ''; // Confirm deleting resource line diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 1b4223e1fff..41c0db7ec15 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -165,8 +165,7 @@ class Dolresource extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -224,8 +223,7 @@ class Dolresource extends CommonObject return $this->id; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -330,8 +328,7 @@ class Dolresource extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -389,8 +386,7 @@ class Dolresource extends CommonObject return $this->id; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -428,8 +424,7 @@ class Dolresource extends CommonObject $error++; } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -476,8 +471,7 @@ class Dolresource extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -568,8 +562,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -646,8 +639,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -725,8 +717,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -817,8 +808,7 @@ class Dolresource extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -925,8 +915,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 4836ed1a0f1..3eeebeaee45 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -127,8 +127,7 @@ class FormResource { $out .= ''; } - else - { + else { $out .= ''; } @@ -147,8 +146,7 @@ class FormResource $out .= ''; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index cbc94c2e843..dc916aa5f77 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -63,8 +63,7 @@ if ($action == 'addcontact' && $user->rights->resource->write) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index d0d4e2300d8..0e6b20923b5 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -137,8 +137,7 @@ if ($object->id > 0) include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 1ce3957071a..8e353b59788 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -98,8 +98,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Resource")), null, 'errors'); $action = ''; } - else - { + else { $objstat = fetchObjectByElement($element_id, $element, $element_ref); $objstat->element = $element; // For externals module, we need to keep @xx @@ -266,8 +265,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -298,8 +296,7 @@ if ($ret == -1) { if (!$ret) { print '
'.$langs->trans('NoResourceInDatabase').'
'; } -else -{ +else { // Confirmation suppression resource line if ($action == 'delete_resource') { @@ -412,8 +409,7 @@ else } $_SESSION['assignedtouser'] = json_encode($listofuserid); } - else - { + else { if (!empty($_SESSION['assignedtouser'])) { $listofuserid = json_decode($_SESSION['assignedtouser'], true); @@ -601,8 +597,7 @@ else { $tpl = dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_add.tpl.php'); } - else - { + else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/resource_add.tpl.php'; } if (empty($conf->file->strict_mode)) { @@ -621,8 +616,7 @@ else { $tpl = dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_view.tpl.php'); } - else - { + else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/resource_view.tpl.php'; } if (empty($conf->file->strict_mode)) { diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 033d49ae8c8..4f94c6c3e17 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -282,8 +282,7 @@ if ($ret) print ''; } } -else -{ +else { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } print ''.$langs->trans("NoRecordFound").''; diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index 29e3c325ee0..b1f1f627a99 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -63,8 +63,7 @@ if ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -115,8 +114,7 @@ foreach ($list as $key) { print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); } - else - { + else { print ''; } print ''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ade8924b0d0..d7b71edbf0b 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -159,8 +159,7 @@ if ($action == 'add' && empty($cancel)) exit; } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -194,21 +193,18 @@ if ($action == 'delete') header("Location: ".DOL_URL_ROOT.'/salaries/list.php'); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); } } @@ -494,13 +490,11 @@ if ($id) { print ''; } - else - { + else { print ''; } } - else - { + else { print ''; } print ""; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 82cdf3c80ce..9fddd59ce51 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -183,8 +183,7 @@ class PaymentSalary extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -264,8 +263,7 @@ class PaymentSalary extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -481,8 +479,7 @@ class PaymentSalary extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $error++; } @@ -532,14 +529,12 @@ class PaymentSalary extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -563,8 +558,7 @@ class PaymentSalary extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -676,8 +670,7 @@ class PaymentSalary extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index ff709816d18..0e6a1bccba0 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -129,8 +129,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index fd6e7a3ec95..b06ad2348e4 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -68,8 +68,7 @@ if (!GETPOST('typeid', 'int')) if ($part[0] == 's.fk_typepayment') $typeid = $part[1]; } } -else -{ +else { $typeid = GETPOST('typeid', 'int'); } @@ -318,8 +317,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index fb6663be951..307b903787e 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -54,8 +54,7 @@ if ($action == 'setcodeclient') header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -67,8 +66,7 @@ if ($action == 'setcodecompta') header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -84,8 +82,7 @@ if ($action == 'updateoptions') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -99,8 +96,7 @@ if ($action == 'updateoptions') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -114,8 +110,7 @@ if ($action == 'updateoptions') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -178,8 +173,7 @@ if ($action == 'setdoc') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -193,8 +187,7 @@ if ($action == "setaddrefinlist") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -208,8 +201,7 @@ if ($action == "setaddadressinlist") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -223,8 +215,7 @@ if ($action == "setaskforshippingmet") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -238,8 +229,7 @@ if ($action == "setdisableprospectcustomer") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -255,8 +245,7 @@ if ($action == 'setprofid') //header("Location: ".$_SERVER["PHP_SELF"]); //exit; } - else - { + else { dol_print_error($db); } } @@ -272,8 +261,7 @@ if ($action == 'setprofidmandatory') //header("Location: ".$_SERVER["PHP_SELF"]); //exit; } - else - { + else { dol_print_error($db); } } @@ -289,8 +277,7 @@ if ($action == 'setprofidinvoicemandatory') //header("Location: ".$_SERVER["PHP_SELF"]); //exit; } - else - { + else { dol_print_error($db); } } @@ -305,8 +292,7 @@ if ($action == 'sethideinactivethirdparty') header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -318,8 +304,7 @@ if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -412,8 +397,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) print img_picto($langs->trans("Activated"), 'switch_on'); print "\n"; } - else - { + else { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print ''; if (!$disabled) print ''; @@ -498,8 +482,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -538,8 +521,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -608,16 +590,14 @@ foreach ($dirsociete as $dirroot) //} print ""; } - else - { + else { if (versioncompare($module->phpmin, versionphparray()) > 0) { print "\n"; print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", join('.', $module->phpmin))), 'switch_off'); print ""; } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -644,8 +624,7 @@ foreach ($dirsociete as $dirroot) { $linkspec = ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { $linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print $linkspec; @@ -715,8 +694,7 @@ foreach ($profid as $key => $val) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -728,8 +706,7 @@ foreach ($profid as $key => $val) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -741,8 +718,7 @@ foreach ($profid as $key => $val) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -784,8 +760,7 @@ if (!$conf->use_javascript_ajax) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ""; } -else -{ +else { print ''; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', @@ -808,8 +783,7 @@ if (!$conf->use_javascript_ajax) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ""; } -else -{ +else { print ''; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', @@ -834,8 +808,7 @@ if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -851,8 +824,7 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -870,8 +842,7 @@ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -888,8 +859,7 @@ if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index dba483c52eb..4142231261d 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -39,8 +39,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 4fe737ca31c..1622b81384d 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -68,8 +68,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) echo json_encode($outjson); } -else -{ +else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $langs->load("companies"); diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index dcf0b1a4483..0558d7d31c8 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -72,8 +72,7 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) $sql .= " OR code_client LIKE '".$db->escape($socid)."%'"; $sql .= " OR code_fournisseur LIKE '".$db->escape($socid)."%'"; } - else - { + else { $sql .= "nom LIKE '%".$db->escape($socid)."%'"; $sql .= " OR code_client LIKE '%".$db->escape($socid)."%'"; $sql .= " OR code_fournisseur LIKE '%".$db->escape($socid)."%'"; @@ -101,12 +100,10 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) echo json_encode($return_arr); } - else - { + else { echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); } } -else -{ +else { echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 70ac0577cb9..0cd103a2855 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -259,8 +259,7 @@ abstract class ActionsCardCommon } } } - else - { + else { $head = societe_prepare_head($this->object); $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company'); @@ -335,8 +334,7 @@ abstract class ActionsCardCommon $adh->ref = $adh->getFullName($langs); $this->tpl['linked_member'] = $adh->getNomUrl(1); } - else - { + else { $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember"); } } diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 0601760e34a..348163195d9 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -135,18 +135,15 @@ class ActionsCardCompany extends ActionsCardCommon $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } - else - { + else { $this->tpl['tva_intra'] = $s; } } - else - { + else { // Confirm delete third party if ($action == 'delete') { @@ -174,18 +171,15 @@ class ActionsCardCompany extends ActionsCardCommon $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } - else - { + else { $this->tpl['tva_intra'] = $s; } } - else - { + else { $this->tpl['tva_intra'] = ' '; } @@ -197,8 +191,7 @@ class ActionsCardCompany extends ActionsCardCommon $this->tpl['parent_company'] = $socm->getNomUrl(1).' '.($socm->code_client ? "(".$socm->code_client.")" : ""); $this->tpl['parent_company'] .= ($socm->town ? ' - '.$socm->town : ''); } - else - { + else { $this->tpl['parent_company'] = $langs->trans("NoParentCompany"); } } diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 9f236c8015e..6a93ac3e939 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -111,8 +111,7 @@ class ActionsCardIndividual extends ActionsCardCommon { $this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civility_id')); } - else - { + else { // Confirm delete third party if ($action == 'delete' || $conf->use_javascript_ajax) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 681d4a37fc9..77299e3ee89 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -137,8 +137,7 @@ if (empty($reshook)) $langs->load('errors'); setEventMessages($langs->trans('ErrorThirdPartyIdIsMandatory', $langs->transnoentitiesnoconv('MergeOriginThirdparty')), null, 'errors'); } - else - { + else { if (!$error && $soc_origin->fetch($soc_origin_id) < 1) { setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors'); @@ -302,8 +301,7 @@ if (empty($reshook)) setEventMessages($langs->trans('ThirdpartiesMergeSuccess'), null, 'mesgs'); $db->commit(); } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorsThirdpartyMerge'), null, 'errors'); $db->rollback(); @@ -404,8 +402,7 @@ if (empty($reshook)) $object->name_bis = GETPOST('name', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); } - else - { + else { $object->name = GETPOST('name', 'alpha'); } $object->entity = (GETPOSTISSET('entity') ?GETPOST('entity', 'int') : $conf->entity); @@ -609,16 +606,14 @@ if (empty($reshook)) { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { // Create thumbs $object->addThumbs($newfile); } } } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -632,8 +627,7 @@ if (empty($reshook)) } // Gestion du logo de la société } - else - { + else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case { $duplicate_code_error = true; @@ -656,8 +650,7 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { $url = $_SERVER["PHP_SELF"]."?socid=".$object->id; // Old method if (($object->client == 1 || $object->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $url = DOL_URL_ROOT."/comm/card.php?socid=".$object->id; elseif ($object->fournisseur == 1) $url = DOL_URL_ROOT."/fourn/card.php?socid=".$object->id; @@ -666,8 +659,7 @@ if (empty($reshook)) exit; } } - else - { + else { $db->rollback(); $action = 'create'; } @@ -684,8 +676,7 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } @@ -760,8 +751,7 @@ if (empty($reshook)) { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { // Create thumbs $object->addThumbs($newfile); @@ -777,13 +767,11 @@ if (empty($reshook)) } } } - else - { + else { $errors[] = "ErrorBadImageFormat"; } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -818,21 +806,18 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } } - else - { + else { $object->id = $socid; $action = "edit"; } } } - else - { + else { $action = ($action == 'add' ? 'create' : 'edit'); } } @@ -849,8 +834,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT."/societe/list.php?restore_lastsearch_values=1&delsoc=".urlencode($object->name)); exit; } - else - { + else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -920,8 +904,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -1062,8 +1045,7 @@ else { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { // Create thumbs $object->addThumbs($newfile); } @@ -1205,8 +1187,7 @@ else { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; } - else - { + else { print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; @@ -1342,8 +1323,7 @@ else { print ''.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } - else - { + else { print ''.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } @@ -1432,8 +1412,7 @@ else $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $s .= 'country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } @@ -1485,8 +1464,7 @@ else { print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); } - else - { + else { print $countrynotdefined; } print ''; @@ -1579,8 +1557,7 @@ else print '     '; print ''; } - else - { + else { print '     '; print ''; } @@ -1837,8 +1814,7 @@ else print ''; print $object->prefix_comm; } - else - { + else { print ''; } print ''; @@ -1864,8 +1840,7 @@ else { print ''; } - else - { + else { print $object->code_client; print ''; } @@ -1905,8 +1880,7 @@ else { print ''; } - else - { + else { print $object->code_fournisseur; print ''; } @@ -1962,8 +1936,7 @@ else { print ''.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } - else - { + else { print ''.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } @@ -2099,8 +2072,7 @@ else $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } @@ -2243,8 +2215,7 @@ else print ''; } } - else - { + else { /* * View */ @@ -2406,8 +2377,7 @@ else $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); print ''; } - else - { + else { print ''.$object->localtax1_value.''; } print ''; @@ -2500,15 +2470,13 @@ else $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } print $s; } - else - { + else { print ' '; } print ''; @@ -2586,8 +2554,7 @@ else { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?socid='.$object->id); } print ''; @@ -2621,8 +2588,7 @@ else { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'editparentcompany', 's.rowid <> '.$object->id, 1); } - else - { + else { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'none', 's.rowid <> '.$object->id, 1); } print ''; @@ -2645,8 +2611,7 @@ else $adh->ref = $adh->getFullName($langs); print $adh->getNomUrl(1); } - else - { + else { print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; } print ''; @@ -2696,8 +2661,7 @@ else $langs->load("mails"); print ''.$langs->trans('SendMail').''; } - else - { + else { $langs->load("mails"); print ''.$langs->trans('SendMail').''; } @@ -2729,8 +2693,7 @@ else { print ''.$langs->trans('Delete').''."\n"; } - else - { + else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 91d0fe9bb1a..99e18f036aa 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -50,8 +50,7 @@ if (!$vatNumber) print '
'; print ''.$langs->transnoentities("ErrorFieldRequired", $langs->trans("VATIntraShort")).'
'; } -else -{ +else { $vatNumber = preg_replace('/\^\w/', '', $vatNumber); $vatNumber = str_replace(array(' ', '.'), '', $vatNumber); $countryCode = substr($vatNumber, 0, 2); @@ -127,8 +126,7 @@ else print $langs->trans("ValueIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; //$messagetoshow=$soapclient->response; } - else - { + else { // Syntaxe ok if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'
'; print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
'; @@ -137,8 +135,7 @@ else { print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE", $countryCode).'
'; } - else - { + else { if (!empty($result['valid']) && ($result['valid'] == 1 || $result['valid'] == 'true')) { print ''.$langs->trans("Yes").''; @@ -146,8 +143,7 @@ else print $langs->trans("Name").': '.$result['name'].'
'; print $langs->trans("Address").': '.$result['address'].'
'; } - else - { + else { print ''.$langs->trans("No").''; print '
'."\n"; } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index c50a746c444..3ec6243a2c7 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -467,8 +467,7 @@ class Thirdparties extends DolibarrApi throw new RestException(500, 'Error failed to merged thirdparty '.$this->companytoremove->id.' into '.$id.'. Enable and read log file for more information.'); } - else - { + else { $db->commit(); } @@ -1313,8 +1312,7 @@ class Thirdparties extends DolibarrApi $i++; } } - else - { + else { throw new RestException(404, 'Bank account not found'); } @@ -1331,8 +1329,7 @@ class Thirdparties extends DolibarrApi { return array("success" => $result); } - else - { + else { throw new RestException(500); } } diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 06c56b027cd..803d0ddebe3 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -84,8 +84,7 @@ class Client extends Societe $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 7211802721e..00737c04504 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -112,19 +112,16 @@ class CompanyBankAccount extends Account { return 1; } - else - { + else { return 0; } } - else - { + else { return 1; } } } - else - { + else { print $this->db->error(); return 0; } @@ -167,8 +164,7 @@ class CompanyBankAccount extends Account } if (trim($this->label) != '') $sql .= ",label = '".$this->db->escape($this->label)."'"; - else - $sql .= ",label = NULL"; + else $sql .= ",label = NULL"; $sql .= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); @@ -184,18 +180,15 @@ class CompanyBankAccount extends Account { return 1; } - else - { + else { return -1; } } - else - { + else { return 1; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -259,8 +252,7 @@ class CompanyBankAccount extends Account return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -308,8 +300,7 @@ class CompanyBankAccount extends Account $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -355,8 +346,7 @@ class CompanyBankAccount extends Account { return 0; } - else - { + else { $obj = $this->db->fetch_object($result1); $this->db->begin(); @@ -377,15 +367,13 @@ class CompanyBankAccount extends Account $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return 1; } } } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 5ba268f6687..ca75b904b11 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -440,8 +440,7 @@ class CompanyPaymentMode extends CommonObject { return 0; } - else - { + else { $obj = $this->db->fetch_object($result1); $type = ''; @@ -467,15 +466,13 @@ class CompanyPaymentMode extends CommonObject $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return 1; } } } - else - { + else { dol_print_error($this->db); return -1; } @@ -566,8 +563,7 @@ class CompanyPaymentMode extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index de65e05d41e..e2b24577bf9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -827,22 +827,19 @@ class Societe extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { dol_syslog(get_class($this)."::Create echec update ".$this->error." ".join(',', $this->errors), LOG_ERR); $this->db->rollback(); return -4; } } - else - { + else { if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $langs->trans("ErrorCompanyNameAlreadyExists", $this->name); // duplicate on a field (code or profid or ...) $result = -1; } - else - { + else { $this->error = $this->db->lasterror(); $result = -2; } @@ -850,8 +847,7 @@ class Societe extends CommonObject return $result; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::Create fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1007,8 +1003,7 @@ class Societe extends CommonObject } } } - else - { + else { //var_dump($conf->global->SOCIETE_EMAIL_UNIQUE); //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') @@ -1337,8 +1332,7 @@ class Societe extends CommonObject unset($this->state); } } - else - { + else { unset($this->country_code); // We clean this, in the doubt, because it may have been changed after an update of country_id unset($this->country); unset($this->state_code); @@ -1425,22 +1419,19 @@ class Societe extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // Doublon $this->error = $langs->trans("ErrorDuplicateField"); $result = -1; } - else - { + else { $this->error = $this->db->lasterror(); $result = -2; } @@ -1448,8 +1439,7 @@ class Societe extends CommonObject return $result; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::Update fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1675,15 +1665,13 @@ class Societe extends CommonObject // fetch optionals attributes and labels $this->fetch_optionals(); } - else - { + else { $result = 0; } $this->db->free($resql); } - else - { + else { $this->error = $this->db->lasterror(); $result = -3; } @@ -1822,8 +1810,7 @@ class Societe extends CommonObject return 1; } - else - { + else { dol_syslog($this->error, LOG_ERR); $this->db->rollback(); return -1; @@ -2051,8 +2038,7 @@ class Societe extends CommonObject { return $result; } - else - { + else { $this->error = $discount->error; return -3; } @@ -2079,8 +2065,7 @@ class Societe extends CommonObject { return $result; } - else - { + else { $this->error = $discountstatic->error; return -1; } @@ -2108,8 +2093,7 @@ class Societe extends CommonObject $sql .= " AND ug.entity = ".$conf->entity.")"; $sql .= " OR u.admin = 1)"; } - else - $sql .= " WHERE entity in (0, ".$conf->entity.")"; + else $sql .= " WHERE entity in (0, ".$conf->entity.")"; $sql .= " AND u.rowid = sc.fk_user AND sc.fk_soc = ".$this->id; @@ -2136,8 +2120,7 @@ class Societe extends CommonObject $reparray[$i]['login'] = $obj->login; $reparray[$i]['photo'] = $obj->photo; } - else - { + else { $reparray[] = $obj->rowid; } $i++; @@ -2249,8 +2232,7 @@ class Societe extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2335,8 +2317,7 @@ class Societe extends CommonObject { $name = $code.' '.$name; } - else - { + else { $name = $code; } } @@ -2629,8 +2610,7 @@ class Societe extends CommonObject { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname, $obj->lastname)).($obj->poste ? " - ".$obj->poste : "").(($mode != 'poste' && $property) ? " ".$sepa.$property.$sepb : ''); } - else - { + else { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname, $obj->lastname)).(($mode != 'poste' && $property) ? " ".$sepa.$property.$sepb : ''); } } @@ -2638,8 +2618,7 @@ class Societe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } return $contact_property; @@ -2673,8 +2652,7 @@ class Societe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } return $contacts; @@ -2710,8 +2688,7 @@ class Societe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } return $contacts; @@ -2750,8 +2727,7 @@ class Societe extends CommonObject } return $contact_property; } - else - { + else { dol_print_error($this->db); } } @@ -2918,8 +2894,7 @@ class Societe extends CommonObject if ($mod->code_modifiable) return 1; // A mettre en dernier return 0; } - else - { + else { return 0; } } @@ -2954,8 +2929,7 @@ class Societe extends CommonObject if ($mod->code_modifiable) return 1; // A mettre en dernier return 0; } - else - { + else { return 0; } } @@ -2992,8 +2966,7 @@ class Societe extends CommonObject $result = $mod->verif($this->db, $this->code_client, $this, 0); return $result; } - else - { + else { return 0; } } @@ -3029,8 +3002,7 @@ class Societe extends CommonObject $result = $mod->verif($this->db, $this->code_fournisseur, $this, 1); return $result; } - else - { + else { return 0; } } @@ -3072,14 +3044,12 @@ class Societe extends CommonObject return $result; } - else - { + else { $this->error = 'ErrorAccountancyCodeNotDefined'; return -1; } } - else - { + else { if ($type == 'customer') $this->code_compta = ''; elseif ($type == 'supplier') $this->code_compta_fournisseur = ''; @@ -3109,8 +3079,7 @@ class Societe extends CommonObject $this->parent = $id; return 1; } - else - { + else { return -1; } } @@ -3205,8 +3174,7 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); $count = $obj->idprof; } - else - { + else { $count = 0; print $this->db->error(); } @@ -3306,8 +3274,7 @@ class Societe extends CommonObject if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string)) if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1)) return 1; - else - return -1; + else return -1; //algorithm checking type code CIF $sum = $num[2] + $num[4] + $num[6]; @@ -3319,29 +3286,25 @@ class Societe extends CommonObject if (preg_match('/^[KLM]{1}/', $string)) if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1)) return 1; - else - return -1; + else return -1; //Check CIF if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string)) if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1)) return 2; - else - return -2; + else return -2; //Check NIE T if (preg_match('/^[T]{1}/', $string)) if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string)) return 3; - else - return -3; + else return -3; //Check NIE XYZ if (preg_match('/^[XYZ]{1}/', $string)) if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X', 'Y', 'Z'), array('0', '1', '2'), $string), 0, 8) % 23, 1)) return 3; - else - return -3; + else return -3; //Can not be verified return -4; @@ -3440,8 +3403,7 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); $count = $obj->numproj; } - else - { + else { $count = 0; print $this->db->error(); } @@ -3491,8 +3453,7 @@ class Societe extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -3558,8 +3519,7 @@ class Societe extends CommonObject } return 0; } - else - { + else { return -1; } } @@ -3581,8 +3541,7 @@ class Societe extends CommonObject if ($resql = $this->db->query($sql)) return 0; } - else - { + else { return 0; } return -1; @@ -3645,16 +3604,14 @@ class Societe extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { // $this->error deja positionne dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".join(',', $this->errors), LOG_ERR); @@ -3696,7 +3653,7 @@ class Societe extends CommonObject $country_code = $tmp[1]; $country_label = $tmp[2]; } - else // For backward compatibility + else // For backward compatibility { dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -3721,7 +3678,7 @@ class Societe extends CommonObject $state_code = $tmp[1]; $state_label = $tmp[2]; } - else // For backward compatibility + else // For backward compatibility { dol_syslog("Your state setup use an old syntax. Reedit it using setup area.", LOG_ERR); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -3904,8 +3861,7 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); return (($obj->nb > 0) ?true:false); } - else - { + else { $this->error = $this->db->lasterror(); return false; } @@ -3991,8 +3947,7 @@ class Societe extends CommonObject elseif ($status == '1' || $status == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1).' '.$langs->trans("StatusProspect1"); elseif ($status == '2' || $status == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2).' '.$langs->trans("StatusProspect2"); elseif ($status == '3' || $status == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3).' '.$langs->trans("StatusProspect3"); - else - { + else { return img_action(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label, 0).' '.(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label); } } @@ -4003,8 +3958,7 @@ class Societe extends CommonObject elseif ($status == '1' || $status == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1); elseif ($status == '2' || $status == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2); elseif ($status == '3' || $status == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3); - else - { + else { return img_action(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label, 0); } } @@ -4015,8 +3969,7 @@ class Societe extends CommonObject elseif ($status == '1' || $status == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1).' '.$langs->trans("StatusProspect1"); elseif ($status == '2' || $status == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2).' '.$langs->trans("StatusProspect2"); elseif ($status == '3' || $status == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3).' '.$langs->trans("StatusProspect3"); - else - { + else { return img_action(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label, 0).' '.(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label); } } @@ -4074,8 +4027,7 @@ class Societe extends CommonObject } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } - else - return array(); + else return array(); } /** @@ -4114,8 +4066,7 @@ class Societe extends CommonObject } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } - else - return array(); + else return array(); } /** @@ -4157,8 +4108,7 @@ class Societe extends CommonObject require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $tmpobject = new FactureFournisseur($this->db); } - else - { + else { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $tmpobject = new Facture($this->db); } @@ -4194,8 +4144,7 @@ class Societe extends CommonObject } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } - else - { + else { return array(); } } @@ -4255,8 +4204,7 @@ class Societe extends CommonObject if (!$result) dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); $result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } - else - { + else { // Positionne le modele sur le nom du modele a utiliser if (!dol_strlen($modele)) { @@ -4264,8 +4212,7 @@ class Societe extends CommonObject { $modele = $conf->global->COMPANY_ADDON_PDF; } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_COMPANY_ADDON_PDF_NotDefined"); return 0; } diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 98bdeffa637..1f99e9bae8a 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -557,8 +557,7 @@ class SocieteAccount extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index ad7383d81af..2660625bd1c 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -428,8 +428,7 @@ if ($sql_select) { print $documentstaticline->getLibStatut(2); } - else - { + else { print $documentstatic->getLibStatut(2); } print ''; @@ -472,8 +471,7 @@ if ($sql_select) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - { + else { $label = $objp->product_label; } @@ -522,14 +520,12 @@ if ($sql_select) // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } - else - { + else { echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } } - else - { + else { if ($objp->fk_product > 0) { echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index d082ae6baa5..9f3751fd5b2 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -167,8 +167,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 0); } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 0000494a3fe..c62ec602ecd 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -120,8 +120,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + print $dolgraph->show(); print ''."\n"; } -else -{ +else { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; @@ -186,8 +185,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA { $dataseries[] = array($obj->label, round($obj->nb)); } - else - { + else { $rest += $obj->nb; } $total += $obj->nb; @@ -207,8 +205,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $dolgraph->draw('idgraphcateg'); print $dolgraph->show(); } - else - { + else { while ($i < $num) { $obj = $db->fetch_object($result); @@ -335,8 +332,7 @@ if ($result) print "\n"; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1df7c38d6c5..cb94da91e2f 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1050,8 +1050,7 @@ while ($i < min($num, $limit)) { print $obj->name; } - else - { + else { print $companystatic->getNomUrl(1, '', 100, 0, 1); } print "\n"; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 2e3e3ec4532..48a31085eb4 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -123,8 +123,7 @@ if ($object->id > 0) dol_fiche_end(); } -else -{ +else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 191f9c4bb2c..0650261cefc 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -105,8 +105,7 @@ if (empty($reshook)) dol_print_error($db); } } - else - { + else { dol_print_error($db); } @@ -114,8 +113,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -264,8 +262,7 @@ if ($result > 0) print ''; print ''; } - else - { + else { print ''; print $langs->trans("YouMustCreateContactFirst"); print ''; @@ -294,8 +291,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -334,8 +330,7 @@ if ($result > 0) { print ' <'.$obj->email.'>'; } - else - { + else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); } @@ -444,8 +439,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -494,8 +488,7 @@ if ($result > 0) print $contactstatic->getNomUrl(1); print $obj->email ? ' <'.$obj->email.'>' : $langs->trans("NoMail"); } - else - { + else { print $obj->email; } print ''; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6385346ce5d..2d5e0612959 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -176,8 +176,7 @@ if (empty($reshook)) { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } - else - { + else { // If this account is the default bank account, we disable others if ($companybankaccount->default_rib) { @@ -231,8 +230,7 @@ if (empty($reshook)) { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } - else - { + else { // If this account is the default bank account, we disable others if ($companypaymentmode->default_rib) { @@ -339,8 +337,7 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { $db->rollback(); } } @@ -408,8 +405,7 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { $db->rollback(); } } @@ -425,8 +421,7 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { setEventMessages($db->lasterror, null, 'errors'); } } @@ -452,13 +447,11 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } } - else - { + else { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } } @@ -474,13 +467,11 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } } - else - { + else { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } } @@ -516,8 +507,7 @@ if (empty($reshook)) $error++; setEventMessages('ThisThirdpartyIsNotACustomer', null, 'errors'); } - else - { + else { // Creation of Stripe customer + update of societe_account $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus, 1); if (!$cu) @@ -525,8 +515,7 @@ if (empty($reshook)) $error++; setEventMessages($stripe->error, $stripe->errors, 'errors'); } - else - { + else { $stripecu = $cu->id; } } @@ -541,8 +530,7 @@ if (empty($reshook)) $error++; setEventMessages('ThisPaymentModeIsNotACard', null, 'errors'); } - else - { + else { // Get the Stripe customer $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); if (!$cu) @@ -613,8 +601,7 @@ if (empty($reshook)) $stripecu = $newcu; $db->commit(); } - else - { + else { $db->rollback(); } } @@ -670,8 +657,7 @@ if (empty($reshook)) $stripesupplieracc = $newsup; $db->commit(); } - else - { + else { $db->rollback(); } } @@ -699,8 +685,7 @@ if (empty($reshook)) { $cu->invoice_settings->default_payment_method = (string) $source; // New } - else - { + else { $cu->default_source = (string) $source; // Old } $result = $cu->save(); @@ -726,8 +711,7 @@ if (empty($reshook)) $payment_method->detach(); } } - else - { + else { $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); $card = $cu->sources->retrieve("$source"); if ($card) { @@ -783,8 +767,7 @@ if (!$id) $companybankaccount->fetch(0, $object->id); $companypaymentmode->fetch(0, null, $object->id, 'card'); } -else -{ +else { $companybankaccount->fetch($id); $companypaymentmode->fetch($id); } @@ -976,8 +959,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' { $listofsources = $customerstripe->sources->data; } - else - { + else { $service = 'StripeTest'; $servicestatus = 0; if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 6d69e692a96..2f0595cf15d 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -467,8 +467,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ""; } - else - { + else { print $langs->trans('None'); } @@ -476,8 +475,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print "\n
\n"; } - else - { + else { // View mode /* ************************************************************************** */ @@ -591,8 +589,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n"; } } - else - { + else { $colspan = 9; if ($user->rights->produit->supprimer || $user->rights->service->supprimer) $colspan += 1; print ''.$langs->trans('None').''; diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 5ff86ff0064..e25b5c5e606 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -79,15 +79,13 @@ if ($action == 'addcontact' && $user->rights->societe->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; } - else - { + else { $mesg = '
'.$object->error.'
'; } } @@ -100,8 +98,7 @@ elseif ($action == 'swapstatut' && $user->rights->societe->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -328,16 +325,14 @@ if ($id > 0 || !empty($ref)) } print ''; } - else - { + else { print ''; if ($objp->subscription == 'yes') { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) print " ".img_warning(); } - else - { + else { print ' '; } print ''; @@ -351,8 +346,7 @@ if ($id > 0 || !empty($ref)) } } } - else - { + else { // Contrat non trouve print "ErrorRecordNotFound"; } From ae06b35c63a5adde998074a5f93958c23942155b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 02:06:40 +0200 Subject: [PATCH 330/490] add new rule --- htdocs/categories/admin/categorie.php | 12 +-- htdocs/categories/card.php | 6 +- .../categories/class/api_categories.class.php | 3 +- htdocs/categories/class/categorie.class.php | 99 +++++++------------ htdocs/categories/edit.php | 9 +- htdocs/categories/index.php | 5 +- htdocs/categories/photos.php | 9 +- htdocs/categories/viewcat.php | 69 +++++-------- htdocs/collab/index.php | 9 +- htdocs/don/admin/donation.php | 33 +++---- htdocs/don/card.php | 24 ++--- htdocs/don/class/api_donations.class.php | 3 +- htdocs/don/class/don.class.php | 54 ++++------ htdocs/don/class/paymentdonation.class.php | 27 ++--- htdocs/don/document.php | 3 +- htdocs/don/list.php | 3 +- htdocs/don/payment/card.php | 12 +-- htdocs/don/payment/payment.php | 6 +- htdocs/don/stats/index.php | 3 +- 19 files changed, 130 insertions(+), 259 deletions(-) diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 6dd313692db..017de5cd1e6 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages($db->lasterror(), null, 'errors'); } } @@ -62,8 +61,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages($db->lasterror(), null, 'errors'); } } @@ -108,14 +106,12 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('CATEGORIE_RECURSIV_ADD'); } -else -{ +else { if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 67adacb5aae..a91a3df7827 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -119,8 +119,7 @@ if ($action == 'add' && $user->rights->categorie->creer) header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); exit; } @@ -156,8 +155,7 @@ if ($action == 'add' && $user->rights->categorie->creer) $action = 'confirmed'; $_POST["addcat"] = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index d6eff682908..205e38f3e5e 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -244,8 +244,7 @@ class Categories extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->category->error); } } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index dc451855c0a..d8f5ef4eeeb 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -321,8 +321,7 @@ class Categorie extends CommonObject { $sql .= " WHERE ref_ext LIKE '".$this->db->escape($ref_ext)."'"; } - else - { + else { $sql .= " WHERE label = '".$this->db->escape($label)."' AND entity IN (".getEntity('category').")"; if (!is_null($type)) $sql .= " AND type = ".$this->db->escape($type); } @@ -362,13 +361,11 @@ class Categorie extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -483,20 +480,17 @@ class Categorie extends CommonObject $this->db->commit(); return $id; } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -574,8 +568,7 @@ class Categorie extends CommonObject return 1; } - else - { + else { $this->db->rollback(); dol_print_error($this->db); return -1; @@ -661,8 +654,7 @@ class Categorie extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -722,8 +714,7 @@ class Categorie extends CommonObject } } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -748,22 +739,19 @@ class Categorie extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $this->db->lasterrno(); return -3; } - else - { + else { $this->error = $this->db->lasterror(); } return -1; @@ -815,14 +803,12 @@ class Categorie extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -874,8 +860,7 @@ class Categorie extends CommonObject { $objs[] = $rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])]; } - else - { + else { $obj = new $this->MAP_OBJ_CLASS[$type]($this->db); $obj->fetch($rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])]); $objs[] = $obj; @@ -883,8 +868,7 @@ class Categorie extends CommonObject } return $objs; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -1046,8 +1030,7 @@ class Categorie extends CommonObject } return $cats; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1080,8 +1063,7 @@ class Categorie extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1124,8 +1106,7 @@ class Categorie extends CommonObject { $markafterid = array($markafterid); } - else - { + else { $markafterid = array(); } } @@ -1166,8 +1147,7 @@ class Categorie extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -1312,8 +1292,7 @@ class Categorie extends CommonObject } return $cats; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1376,8 +1355,7 @@ class Categorie extends CommonObject dol_syslog(get_class($this)."::already_exists no category with same name=".$this->label." and same parent ".$this->fk_parent." than category id=".$this->id, LOG_DEBUG); return 0; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1430,8 +1408,7 @@ class Categorie extends CommonObject $linkend = ''; $w[] = $link.($addpicto ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend; } - else - { + else { $w[] = "".($addpicto ? img_object('', 'category') : '').$cat->label.""; } } @@ -1473,8 +1450,7 @@ class Categorie extends CommonObject } return $parents; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1554,14 +1530,12 @@ class Categorie extends CommonObject } } } - else - { + else { dol_print_error($this->db); return -1; } } - else - { + else { $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as ct, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id." AND c.type = ".$this->MAP_ID[$type]; @@ -1583,8 +1557,7 @@ class Categorie extends CommonObject } } } - else - { + else { dol_print_error($this->db); return -1; } @@ -1632,8 +1605,7 @@ class Categorie extends CommonObject $nom = '%'.str_replace('*', '%', $nom).'%'; if (!$case) $sql .= " AND label LIKE '".$this->db->escape($nom)."'"; - else - $sql .= " AND label LIKE BINARY '".$this->db->escape($nom)."'"; + else $sql .= " AND label LIKE BINARY '".$this->db->escape($nom)."'"; } if ($id) { @@ -1652,8 +1624,7 @@ class Categorie extends CommonObject return $cats; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -1879,8 +1850,7 @@ class Categorie extends CommonObject $sql2 .= " description='".$this->db->escape($this->description)."'"; $sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'"; } - else - { + else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)"; $sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->label); $sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')"; @@ -1901,8 +1871,7 @@ class Categorie extends CommonObject $sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; $sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'"; } - else - { + else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)"; $sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->multilangs["$key"]["label"]); $sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')"; @@ -1961,8 +1930,7 @@ class Categorie extends CommonObject } return 1; } - else - { + else { $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; return -1; } @@ -2067,8 +2035,7 @@ class Categorie extends CommonObject { return " AND (".implode(' AND ', $searchCategorySqlList).")"; } - else - { + else { return ""; } } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 48bd82b9326..dfd8f01f381 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -90,8 +90,7 @@ if ($action == 'update' && $user->rights->categorie->creer) if ($parent != "-1") $object->fk_parent = $parent; - else - $object->fk_parent = ""; + else $object->fk_parent = ""; if (empty($object->label)) @@ -110,13 +109,11 @@ if ($action == 'update' && $user->rights->categorie->creer) header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index b36101750f2..d88e1a0ff8c 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -54,7 +54,7 @@ $typetext = $type; if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea'); elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea'); elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea'); -else $title = $langs->trans(ucfirst($type).'sCategoriesArea'); +else $title = $langs->trans(ucfirst($type).'sCategoriesArea'); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); @@ -207,8 +207,7 @@ if ($nbofentries > 0) tree_recur($data, $data[0], 0); print ''; } -else -{ +else { print ''; print ''; print ''; print ''; } -else -{ +else { $categstatic = new Categorie($db); $fulltree = $categstatic->get_full_arbo($type, $object->id, 1); @@ -408,8 +404,7 @@ else print ''; print ''; } - else - { + else { print ''; print '\n"; } } - else - { + else { print ''; } print "
'.img_picto_common('', 'treemenu/branchbottom.gif').''; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 07e5d56d268..7443bc5b532 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -180,8 +180,7 @@ if ($object->id) print ''; print $langs->trans("AddPhoto").''; } - else - { + else { print ''; print $langs->trans("AddPhoto").''; } @@ -232,8 +231,7 @@ if ($object->id) { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } @@ -281,8 +279,7 @@ if ($object->id) } } } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 803b4ae34ab..921a1f12061 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -162,8 +162,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -181,14 +180,12 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' { setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs'); } - else - { + else { if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -337,8 +334,7 @@ elseif (count($cats) < 1) print ''.$langs->trans("NoSubCat").'
'; print ''; @@ -451,8 +446,7 @@ if ($type == Categorie::TYPE_PRODUCT) { dol_print_error($db, $prods->error, $prods->errors); } - else - { + else { // Form to add record into a category $showclassifyform = 1; if ($showclassifyform) @@ -515,8 +509,7 @@ if ($type == Categorie::TYPE_PRODUCT) print "\n"; } } - else - { + else { print ''; } print "
'.$langs->trans("ThisCategoryHasNoItems").'
\n"; @@ -534,8 +527,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { dol_print_error($db, $socs->error, $socs->errors); } - else - { + else { print '
'; print ''; print ''; @@ -576,8 +568,7 @@ if ($type == Categorie::TYPE_SUPPLIER) print "
'.$langs->trans("ThisCategoryHasNoItems").'
\n"; @@ -595,8 +586,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { dol_print_error($db, $socs->error, $socs->errors); } - else - { + else { print ''; print ''; print ''; @@ -636,8 +626,7 @@ if ($type == Categorie::TYPE_CUSTOMER) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -658,8 +647,7 @@ if ($type == Categorie::TYPE_MEMBER) { dol_print_error($db, $prods->error, $prods->errors); } - else - { + else { print ''; print ''; print ''; @@ -701,8 +689,7 @@ if ($type == Categorie::TYPE_MEMBER) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -721,8 +708,7 @@ if ($type == Categorie::TYPE_CONTACT) { dol_print_error($db, $contacts->error, $contacts->errors); } - else - { + else { print ''; print ''; print ''; @@ -765,8 +751,7 @@ if ($type == Categorie::TYPE_CONTACT) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -787,8 +772,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { dol_print_error($db, $accounts->error, $accounts->errors); } - else - { + else { print ''; print ''; print ''; @@ -829,8 +813,7 @@ if ($type == Categorie::TYPE_ACCOUNT) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -851,8 +834,7 @@ if ($type == Categorie::TYPE_PROJECT) { dol_print_error($db, $object->error, $object->errors); } - else - { + else { print ''; print ''; print ''; @@ -894,8 +876,7 @@ if ($type == Categorie::TYPE_PROJECT) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -914,8 +895,7 @@ if ($type == Categorie::TYPE_USER) { dol_print_error($db, $object->error, $object->errors); } - else - { + else { print ''; print ''; print ''; @@ -954,8 +934,7 @@ if ($type == Categorie::TYPE_USER) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -977,8 +956,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { dol_print_error($db, $object->error, $object->errors); } - else - { + else { print ''; print ''; print ''; @@ -1020,8 +998,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index c570e12ba31..f6344f4ebf0 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -95,8 +95,7 @@ if ($action == 'add') setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs'); $action = ''; } - else - { + else { $db->rollback(); } @@ -130,13 +129,11 @@ if ($action == 'delete') header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); exit; } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index e8e7fa4f5b9..514d79dcd77 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -71,14 +71,12 @@ if ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=donation&file=SPECIMEN.html"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -130,8 +128,7 @@ if ($action == 'set_DONATION_ACCOUNTINGACCOUNT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -148,8 +145,7 @@ if ($action == 'set_DONATION_MESSAGE') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -165,8 +161,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -179,8 +174,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -223,8 +217,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -276,15 +269,13 @@ if (is_resource($handle)) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; print ''; } } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -297,8 +288,7 @@ if (is_resource($handle)) print img_picto($langs->trans("Default"), 'on'); print ''; } - else - { + else { print ""; print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; print ''; @@ -371,8 +361,7 @@ if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); } -else -{ +else { print ''; } print ''; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 505d2fbed29..7af11d46ebf 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -181,8 +181,7 @@ if ($action == 'add') header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -196,8 +195,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights- header("Location: index.php"); exit; } - else - { + else { dol_syslog($object->error, LOG_DEBUG); setEventMessages($object->error, $object->errors, 'errors'); } @@ -355,8 +353,7 @@ if ($action == 'create') print ')'; print ''; } - else - { + else { print ''; print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer informations. Note, this clear other input @@ -520,8 +517,7 @@ if (!empty($id) && $action == 'edit') { print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; } - else - { + else { print ''.$langs->trans("Amount").''; print price($object->amount, 0, $langs, 0, 0, -1, $conf->currency); print ''; @@ -777,8 +773,7 @@ if (!empty($id) && $action != 'edit') print ""; $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -815,8 +810,7 @@ if (!empty($id) && $action != 'edit') { print '
'.$langs->trans('DoPayment').'
'; } - else - { + else { print ''; } } @@ -834,13 +828,11 @@ if (!empty($id) && $action != 'edit') { print '"; } - else - { + else { print '"; } } - else - { + else { print '"; } diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 872e2009b9b..69bd1e58042 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -231,8 +231,7 @@ class Donations extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->don->error); } } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 59c293e6386..f80feff1869 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -315,8 +315,7 @@ class Don extends CommonObject $error_string[] = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Amount')); $err++; } - else - { + else { if ($this->amount < $minimum && $minimum > 0) { $error_string[] = $langs->trans('MinimumAmount', $langs->transnoentitiesnoconv('$minimum')); @@ -330,8 +329,7 @@ class Don extends CommonObject $this->errors = $error_string; return 0; } - else - { + else { return 1; } } @@ -423,8 +421,7 @@ class Don extends CommonObject // End call triggers } } - else - { + else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); $error++; @@ -453,8 +450,7 @@ class Don extends CommonObject $this->db->commit(); return $ret; } - else - { + else { $this->db->rollback(); return -1; } @@ -534,14 +530,12 @@ class Don extends CommonObject $this->db->commit(); $result = 1; } - else - { + else { $this->db->rollback(); $result = -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; $this->db->rollback(); @@ -613,8 +607,7 @@ class Don extends CommonObject $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -709,8 +702,7 @@ class Don extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -762,8 +754,7 @@ class Don extends CommonObject } } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -773,8 +764,7 @@ class Don extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -805,13 +795,11 @@ class Don extends CommonObject { return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -836,13 +824,11 @@ class Don extends CommonObject { return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -905,8 +891,7 @@ class Don extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -991,8 +976,7 @@ class Don extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -1089,16 +1073,14 @@ class Don extends CommonObject dol_delete_preview($object); return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_syslog("Erreur dans don_create"); dol_print_error($this->db, $obj->error); return 0; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 64644d18971..416884c3a24 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -168,8 +168,7 @@ class PaymentDonation extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_donation"); $this->ref = $this->id; } - else - { + else { $error++; } } @@ -189,8 +188,7 @@ class PaymentDonation extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -259,8 +257,7 @@ class PaymentDonation extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -342,8 +339,7 @@ class PaymentDonation extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -412,8 +408,7 @@ class PaymentDonation extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -467,8 +462,7 @@ class PaymentDonation extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -593,8 +587,7 @@ class PaymentDonation extends CommonObject } } } - else - { + else { $this->error = $acc->error; $error++; } @@ -604,8 +597,7 @@ class PaymentDonation extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -629,8 +621,7 @@ class PaymentDonation extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/don/document.php b/htdocs/don/document.php index f2994b95577..98884af9c6f 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -187,8 +187,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 65ec24b1458..8c5ad9a36e0 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -284,8 +284,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index e1784dc4b8b..57d5fe160a0 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp header("Location: ".DOL_URL_ROOT."/don/index.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -102,8 +101,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->cree header('Location: card.php?id='.$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -254,8 +252,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -290,8 +287,7 @@ if (empty($action)) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index b3ab7e2d360..162193dc51d 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -138,8 +138,7 @@ if ($action == 'add_payment') header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -261,8 +260,7 @@ if ($action == 'create') $namef = "amount_".$objp->id; print ''; } - else - { + else { print '-'; } print ""; diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 46b0d93d564..247656dc2ad 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -76,8 +76,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; } From a636f81eacac399e03d99be64dd359718736d291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 02:17:21 +0200 Subject: [PATCH 331/490] add new rule --- dev/examples/code/create_invoice.php | 9 +- dev/examples/code/create_order.php | 9 +- dev/examples/code/create_product.php | 6 +- dev/examples/code/create_user.php | 9 +- dev/initdata/dbf/importdb-products.php | 3 +- dev/initdata/dbf/importdb-thirdparties.php | 9 +- dev/initdata/dbf/includes/dbase.class.php | 9 +- dev/initdata/generate-invoice.php | 6 +- dev/initdata/generate-order.php | 6 +- dev/initdata/generate-proposal.php | 6 +- dev/initdata/generate-thirdparty.php | 3 +- dev/initdata/import-products.php | 12 +- dev/initdata/import-thirdparties.php | 15 +- dev/initdata/import-users.php | 6 +- dev/initdata/purge-data.php | 11 +- htdocs/exports/class/export.class.php | 56 +-- htdocs/exports/export.php | 45 +- htdocs/install/check.php | 63 +-- htdocs/install/inc.php | 12 +- htdocs/install/repair.php | 99 ++--- htdocs/install/step1.php | 44 +- htdocs/install/step2.php | 51 +-- htdocs/install/step5.php | 36 +- htdocs/install/upgrade.php | 15 +- htdocs/install/upgrade2.php | 451 +++++++-------------- 25 files changed, 333 insertions(+), 658 deletions(-) diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index 1b212e0a5d7..0b2c4e54697 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -87,14 +87,12 @@ if ($idobject > 0) // Change status to validated $result=$obj->validate($user); if ($result > 0) print "OK Object created with id ".$idobject."\n"; - else - { + else { $error++; dol_print_error($db, $obj->error); } } -else -{ +else { $error++; dol_print_error($db, $obj->error); } @@ -107,8 +105,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index 703254ad5e9..d46913f3fcf 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -85,14 +85,12 @@ if ($idobject > 0) // Change status to validated $result=$com->valid($user); if ($result > 0) print "OK Object created with id ".$idobject."\n"; - else - { + else { $error++; dol_print_error($db, $com->error); } } -else -{ +else { $error++; dol_print_error($db, $com->error); } @@ -105,8 +103,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 234658388df..fb09c5f6e43 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -83,8 +83,7 @@ if ($idobject > 0) { print "OK Object created with id ".$idobject."\n"; } -else -{ +else { $error++; dol_print_error($db, $myproduct->error); } @@ -96,8 +95,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index 96d369085d2..79fe30b73bf 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -74,8 +74,7 @@ if ($idobject > 0) // Change status to validated $result=$obj->setStatut(1); if ($result > 0) print "OK Object created with id ".$idobject."\n"; - else - { + else { $error++; dol_print_error($db, $obj->error); } @@ -84,8 +83,7 @@ elseif ($obj->error == 'ErrorLoginAlreadyExists') { print "User with login ".$obj->login." already exists\n"; } -else -{ +else { $error++; dol_print_error($db, $obj->error); } @@ -98,8 +96,7 @@ if (! $error) $db->commit(); print '--- end ok'."\n"; } -else -{ +else { print '--- end error code='.$error."\n"; $db->rollback(); } diff --git a/dev/initdata/dbf/importdb-products.php b/dev/initdata/dbf/importdb-products.php index 845064f0688..2c06c07e103 100644 --- a/dev/initdata/dbf/importdb-products.php +++ b/dev/initdata/dbf/importdb-products.php @@ -227,8 +227,7 @@ while ($fields = $db->fetch_array($resql)) { $error++; // $errorrecord will be reset } $j++; -} else - die("error : $sql"); +} else die("error : $sql"); diff --git a/dev/initdata/dbf/importdb-thirdparties.php b/dev/initdata/dbf/importdb-thirdparties.php index 8f0eb0635f0..a6b2697eed8 100644 --- a/dev/initdata/dbf/importdb-thirdparties.php +++ b/dev/initdata/dbf/importdb-thirdparties.php @@ -179,8 +179,7 @@ while ($fields = $db->fetch_array($resql)) { $object->town = trim($fields['FVILLE']); if ($fields['FPAYS']) $object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid'); - else - $object->country_id = 1; + else $object->country_id = 1; $object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']); $object->phone = substr($object->phone, 0, 20); $object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']); @@ -299,8 +298,7 @@ while ($fields = $db->fetch_array($resql)) { $contact->town = trim($fields['LVILLE']); if ($fields['FPAYS']) $contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid'); - else - $contact->country_id = 1; + else $contact->country_id = 1; $contact->email = $fields['LMAIL']; $contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']); $contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']); @@ -340,8 +338,7 @@ while ($fields = $db->fetch_array($resql)) { $error++; // $errorrecord will be reset } $j++; -} else - die("error : $sql"); +} else die("error : $sql"); $db->commit(); diff --git a/dev/initdata/dbf/includes/dbase.class.php b/dev/initdata/dbf/includes/dbase.class.php index 0c2f6820a96..e70f18087c4 100644 --- a/dev/initdata/dbf/includes/dbase.class.php +++ b/dev/initdata/dbf/includes/dbase.class.php @@ -207,8 +207,7 @@ class DBase $value = true; elseif ($value == 'f' || $value == 'n') $value = false; - else - $value = null; + else $value = null; } $record[$i] = $value; } @@ -295,8 +294,7 @@ class DBase $i = unpack("S$n", $data); if ($n == 1) return (int) $i[1]; - else - return array_merge($i); + else return array_merge($i); } private static function putInt16($fd, $value) @@ -310,8 +308,7 @@ class DBase $i = unpack("L$n", $data); if ($n == 1) return (int) $i[1]; - else - return array_merge($i); + else return array_merge($i); } private static function putInt32($fd, $value) diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index 3fe058e8d3e..d4522ef047e 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -180,13 +180,11 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) { print " OK with ref ".$object->ref."\n";; } - else - { + else { dol_print_error($db, $object->error); } } - else - { + else { dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index 1dc56aa5582..f63d50a1967 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -207,15 +207,13 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $db->commit(); print " OK with ref ".$object->ref."\n"; } - else - { + else { print " KO\n"; $db->rollback(); dol_print_error($db, $object->error); } } - else - { + else { print " KO\n"; $db->rollback(); dol_print_error($db, $object->error); diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 4c5d70aadc4..60ba418b43b 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -211,15 +211,13 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $db->commit(); print " OK with ref ".$object->ref."\n"; } - else - { + else { print " KO\n"; $db->rollback(); dol_print_error($db, $object->error); } } - else - { + else { dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 05ac6416aa3..f7bde473038 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -137,8 +137,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) print "Company ".$s." created nom=".$soc->name."\n"; } - else - { + else { print "Error: ".$soc->error."\n"; } } diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 4288c5bf3b1..78f3a0789f8 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -164,8 +164,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else - { + else { print " - Creation OK with ref ".$produit->ref." - id = ".$ret; } @@ -181,8 +180,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString(); $errorrecord++; } - else - { + else { print " - updatePrice OK"; } } @@ -201,8 +199,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else - { + else { print " - setMultiLangs OK"; } } @@ -228,8 +225,7 @@ if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) print "Rollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index ef1dfcc99ab..87fef83de0f 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -182,8 +182,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - Creation OK with name ".$object->name." - id = ".$ret; } } @@ -213,8 +212,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create link with sale representative result code = ".$result." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - create link sale representative OK"; } } @@ -244,8 +242,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - create contact OK"; } } @@ -278,8 +275,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - create contact OK"; } } @@ -306,8 +302,7 @@ if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) print "Rollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 4247415288c..25fa6a69e2d 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -143,8 +143,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else - { + else { print " - Creation OK with login ".$object->login." - id = ".$ret; } @@ -169,8 +168,7 @@ if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) print "Rollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index b1aadd56ed8..f9d8420b1e1 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -198,7 +198,7 @@ if (empty($option)) if ($option != 'all') { $listofoptions=explode(',', $option); - foreach($listofoptions as $cursoroption) + foreach ($listofoptions as $cursoroption) { if (! in_array($cursoroption, array_keys($sqls))) { print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; @@ -264,7 +264,7 @@ function processfamily($family, $date) global $db, $sqls; $error=0; - foreach($sqls[$family] as $sql) + foreach ($sqls[$family] as $sql) { if (preg_match('/^@/', $sql)) { @@ -302,10 +302,10 @@ function processfamily($family, $date) $db->begin(); $listofoptions=explode(',', $option); -foreach($listofoptions as $cursoroption) +foreach ($listofoptions as $cursoroption) { $oldfamily=''; - foreach($sqls as $family => $familysql) + foreach ($sqls as $family => $familysql) { if ($cursoroption && $cursoroption != 'all' && $cursoroption != $family) continue; @@ -326,8 +326,7 @@ if ($error || $mode != 'confirm') print "\nRollback any changes.\n"; $db->rollback(); } -else -{ +else { print "Commit all changes.\n"; $db->commit(); } diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 978a3059ace..a6873f2894a 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -142,8 +142,7 @@ class Export { $bool = $user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]}; } - else - { + else { $bool = $user->rights->{$perm[0]}->{$perm[1]}; } if ($perm[0] == 'user' && $user->admin) $bool = true; @@ -295,8 +294,7 @@ class Export case 'Text': if (!(strpos($ValueField, '%') === false)) $szFilterQuery .= " ".$NameField." LIKE '".$ValueField."'"; - else - $szFilterQuery .= " ".$NameField." = '".$ValueField."'"; + else $szFilterQuery .= " ".$NameField." = '".$ValueField."'"; break; case 'Date': if (strpos($ValueField, "+") > 0) @@ -306,12 +304,10 @@ class Export $szFilterQuery = "(".$this->conditionDate($NameField, trim($ValueArray[0]), ">="); $szFilterQuery .= " AND ".$this->conditionDate($NameField, trim($ValueArray[1]), "<=").")"; } - else - { + else { if (is_numeric(substr($ValueField, 0, 1))) $szFilterQuery = $this->conditionDate($NameField, trim($ValueField), "="); - else - $szFilterQuery = $this->conditionDate($NameField, trim(substr($ValueField, 1)), substr($ValueField, 0, 1)); + else $szFilterQuery = $this->conditionDate($NameField, trim(substr($ValueField, 1)), substr($ValueField, 0, 1)); } break; case 'Duree': @@ -325,12 +321,10 @@ class Export $szFilterQuery = "(".$NameField.">=".$ValueArray[0]; $szFilterQuery .= " AND ".$NameField."<=".$ValueArray[1].")"; } - else - { + else { if (is_numeric(substr($ValueField, 0, 1))) $szFilterQuery = " ".$NameField."=".$ValueField; - else - $szFilterQuery = " ".$NameField.substr($ValueField, 0, 1).substr($ValueField, 1); + else $szFilterQuery = " ".$NameField.substr($ValueField, 0, 1).substr($ValueField, 1); } break; case 'Boolean': @@ -343,8 +337,7 @@ class Export else { if (!(strpos($ValueField, '%') === false)) $szFilterQuery = " ".$NameField." LIKE '".$ValueField."'"; - else - $szFilterQuery = " ".$NameField." = '".$ValueField."'"; + else $szFilterQuery = " ".$NameField." = '".$ValueField."'"; } break; default: @@ -367,7 +360,7 @@ class Export // TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN if (strlen($Value) == 4) $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$Value."'"; elseif (strlen($Value) == 6) $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; - else $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; + else $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; return $Condition; } @@ -428,8 +421,7 @@ class Export if (!empty($InfoFieldList[3])) $keyList = $InfoFieldList[3]; - else - $keyList = 'rowid'; + else $keyList = 'rowid'; $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3]) ? '' : ', '.$InfoFieldList[3].' as code'); if ($InfoFieldList[1] == 'c_stcomm') $sql = 'SELECT id as id, '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3]) ? '' : ', '.$InfoFieldList[3].' as code'); if ($InfoFieldList[1] == 'c_country') $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label, code as code'; @@ -474,8 +466,7 @@ class Export { $szFilterField .= ''; } - else - { + else { $szFilterField .= ''; } $i++; @@ -564,8 +555,7 @@ class Export $objmodel = new $classname($this->db); if (!empty($sqlquery)) $sql = $sqlquery; - else - { + else { // Define value for indice from $datatoexport $foundindice = 0; foreach ($this->array_export_code as $key => $dataset) @@ -595,8 +585,7 @@ class Export //$this->array_export_label[$indice] if ($conf->global->EXPORT_PREFIX_SPEC) $filename = $conf->global->EXPORT_PREFIX_SPEC."_".$datatoexport; - else - $filename = "export_".$datatoexport; + else $filename = "export_".$datatoexport; $filename .= '.'.$objmodel->getDriverExtension(); $dirname = $conf->export->dir_temp.'/'.$user->id; @@ -665,8 +654,7 @@ class Export } $obj->$alias = $remaintopay; } - else - { + else { // TODO FIXME Export of compute field does not work. $obj containt $obj->alias_field and formulat will contains $obj->field $computestring = $this->array_export_special[$indice][$key]; $tmp = dol_eval($computestring, 1, 0); @@ -689,15 +677,13 @@ class Export return 1; } - else - { + else { $this->error = $objmodel->error; dol_syslog("Export::build_file Error: ".$this->error, LOG_ERR); return -1; } } - else - { + else { $this->error = $this->db->error()." - sql=".$sql; return -1; } @@ -740,8 +726,7 @@ class Export $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); $this->db->rollback(); @@ -777,14 +762,12 @@ class Export return 1; } - else - { + else { $this->error = "ModelNotFound"; return -2; } } - else - { + else { dol_print_error($this->db); return -3; } @@ -823,8 +806,7 @@ class Export $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 6543747d1f7..b6b0e7b7fa5 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -174,8 +174,7 @@ if ($action == 'selectfield') // Selection of field at step 2 $_SESSION["export_selected_fields"] = $array_selected; } } - else - { + else { $warnings = array(); $array_selected[$field] = count($array_selected) + 1; // We tag the key $field as "selected" @@ -223,8 +222,7 @@ if ($action == 'unselectfield') $array_selected = array(); $_SESSION["export_selected_fields"] = $array_selected; } - else - { + else { unset($array_selected[$_GET["field"]]); // Renumber fields of array_selected (from 1 to nb_elements) asort($array_selected); @@ -288,8 +286,7 @@ if ($action == 'builddoc') setEventMessages($objexport->error, $objexport->errors, 'errors'); $sqlusedforexport = $objexport->sqlusedforexport; } - else - { + else { setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); $sqlusedforexport = $objexport->sqlusedforexport; } @@ -351,17 +348,14 @@ if ($action == 'add_export_model') { setEventMessages($langs->trans("ExportModelSaved", $objexport->model_name), null, 'mesgs'); } - else - { + else { $langs->load("errors"); if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') setEventMessages($langs->trans("ErrorExportDuplicateProfil"), null, 'errors'); - else - setEventMessages($objexport->error, $objexport->errors, 'errors'); + else setEventMessages($objexport->error, $objexport->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportModelName")), null, 'errors'); } } @@ -473,15 +467,13 @@ if ($step == 1 || !$datatoexport) { print ''.img_picto($langs->trans("NewExport"), 'filenew').''; } - else - { + else { print $langs->trans("NotEnoughPermissions"); } print ''; } } - else - { + else { print ''.$langs->trans("NoExportableData").''; } print ''; @@ -615,8 +607,7 @@ if ($step == 2 && $datatoexport) { $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]."
"; } - else - { + else { $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)."
"; } if (!empty($objexport->array_export_examplevalues[0][$code])) @@ -643,8 +634,7 @@ if ($step == 2 && $datatoexport) //print ' ('.$code.')'; print ''; } - else - { + else { // Fields not selected print ''; //print $text.'-'.$htmltext."
"; @@ -673,13 +663,11 @@ if ($step == 2 && $datatoexport) { print ''.$langs->trans("NextStep").''; } - else - { + else { print ''.$langs->trans("NextStep").''; } } - else - { + else { print ''.$langs->trans("NextStep").''; } @@ -811,8 +799,7 @@ if ($step == 3 && $datatoexport) { $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]."
"; } - else - { + else { $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)."
"; } if (!empty($objexport->array_export_examplevalues[0][$code])) @@ -842,8 +829,7 @@ if ($step == 3 && $datatoexport) $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter); print $form->textwithpicto($tmp, $szInfoFiltre); } - else - { + else { print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter); } } @@ -1006,8 +992,7 @@ if ($step == 4 && $datatoexport) { $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]."
"; } - else - { + else { $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)."
"; } if (!empty($objexport->array_export_examplevalues[0][$code])) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 408f4b2a1a8..792f72d8831 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -88,8 +88,7 @@ elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) // print 'Error '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); $checksok = 0; // 0=error, 1=warning } -else -{ +else { print 'Ok '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray()); } if (empty($force_install_nophpinfo)) print ' ('.$langs->trans("MoreInformation").')'; @@ -104,8 +103,7 @@ if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) print "
\n"; $checksok = 0; } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportPOSTGETOk")."
\n"; } @@ -116,8 +114,7 @@ if (!function_exists("session_id")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; $checksok = 0; } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportSessions")."
\n"; } @@ -129,8 +126,7 @@ if (!function_exists("imagecreate")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportGD")."
\n"; } @@ -142,8 +138,7 @@ if (!function_exists("curl_init")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportCurl")."
\n"; } @@ -152,8 +147,7 @@ if (!function_exists("easter_date")) { print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportCalendar")."
\n"; } @@ -165,8 +159,7 @@ if (!function_exists("utf8_encode")) print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupportUTF8")."
\n"; } @@ -180,8 +173,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } - else - { + else { print 'Ok '.$langs->trans("PHPSupportIntl")."
\n"; } } @@ -192,8 +184,7 @@ if (!class_exists('ZipArchive')) print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } -else -{ +else { print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; } @@ -215,8 +206,7 @@ if ($memmaxorig != '') { print 'Ok '.$langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; } - else - { + else { print 'Warning '.$langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; } } @@ -236,13 +226,11 @@ if (is_readable($conffile) && filesize($conffile) > 8) // Already installed for all parts (config and database). We can propose upgrade. $allowupgrade = true; } - else - { + else { $allowupgrade = false; } } -else -{ +else { // If not, we create it dolibarr_install_syslog("check: we try to create conf file '".$conffile."'"); $confexists = 0; @@ -253,8 +241,7 @@ else // Success dolibarr_install_syslog("check: successfully copied file ".$conffile.".example into ".$conffile); } - else - { + else { // If failed, we try to create an empty file dolibarr_install_syslog("check: failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING); @@ -285,8 +272,7 @@ if (!file_exists($conffile)) print $langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok'); $err++; } -else -{ +else { if (dol_is_dir($conffile)) { print 'Warning '.$langs->trans("ConfFileMustBeAFileNotADir", $conffiletoshow); @@ -300,8 +286,7 @@ else { print 'Ok '.$langs->trans("ConfFileExists", $conffiletoshow); } - else - { + else { print 'Ok '.$langs->trans("ConfFileCouldBeCreated", $conffiletoshow); } print "
"; @@ -311,14 +296,12 @@ else $allowinstall = 0; } // File exists and can be modified - else - { + else { if ($confexists) { print 'Ok '.$langs->trans("ConfFileExists", $conffiletoshow); } - else - { + else { print 'Ok '.$langs->trans("ConfFileCouldBeCreated", $conffiletoshow); } print "
"; @@ -345,8 +328,7 @@ else print 'A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.
'."\n"; dol_syslog("A '".$conffiletoshow."' file exists with a dolibarr_main_document_root to ".$dolibarr_main_document_root." that seems wrong. Try to fix or remove the '".$conffiletoshow."' file.", LOG_WARNING); } - else - { + else { require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; // If password is encoded, we decode it @@ -440,8 +422,7 @@ else { $choice .= ''.$langs->trans("Start").''; } - else - { + else { $choice .= ($foundrecommandedchoice ? '' : '').$langs->trans("InstallNotAllowed").($foundrecommandedchoice ? '' : ''); } $choice .= ''."\n"; @@ -560,13 +541,11 @@ else { $choice .= ''.$langs->trans("NotYetAvailable").''; } - else - { + else { $choice .= ''.$langs->trans("Start").''; } } - else - { + else { $choice .= $langs->trans("NotAvailable"); } $choice .= ''; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 3a3adc2322c..aab1615ed64 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -124,13 +124,11 @@ if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > } } } - else - { + else { $includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot'; } } - else - { + else { $includeconferror = 'ErrorBadFormatForConfFile'; } } @@ -210,8 +208,7 @@ if (@file_exists($lockfile)) print $langs->trans("ClickHereToGoToApp"); print ''; } - else - { + else { print 'If you always reach this page, you must remove install.lock file manually.
'; } exit; @@ -365,8 +362,7 @@ function pHeader($subtitle, $next, $action = 'set', $param = '', $forcejqueryurl $jQueryCustomPath = $forcejqueryurl; $jQueryUiCustomPath = $forcejqueryurl; } - else - { + else { $jQueryCustomPath = (defined('JS_JQUERY') && constant('JS_JQUERY')) ? JS_JQUERY : false; $jQueryUiCustomPath = (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) ? JS_JQUERY_UI : false; } diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 034741c7c7e..f6f5eb83003 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -124,8 +124,7 @@ if ($db->connected) dolibarr_install_syslog("repair: ".$langs->transnoentities("ServerConnection").": ".$dolibarr_main_db_host.$langs->transnoentities("OK")); $ok = 1; } -else -{ +else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->transnoentities("Error").""; dolibarr_install_syslog("repair: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -140,8 +139,7 @@ if ($ok) dolibarr_install_syslog("repair: database connection successful: ".$dolibarr_main_db_name); $ok = 1; } - else - { + else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->trans("Error").""; dolibarr_install_syslog("repair: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -257,8 +255,7 @@ if ($ok && GETPOST('standard', 'alpha')) $fieldname = $obj->Field; $fieldtype = $obj->Type; } - else - { + else { $fieldname = isset($obj->Key) ? $obj->Key : $obj->attname; $fieldtype = isset($obj->Type) ? $obj->Type : 'varchar'; } @@ -318,13 +315,11 @@ if ($ok && GETPOST('standard', 'alpha')) { print "KO ".$db->lasterror."
\n"; } - else - { + else { print "OK
\n"; } } - else - { + else { print ' - Mode test, no column added.'; } } @@ -332,8 +327,7 @@ if ($ok && GETPOST('standard', 'alpha')) print " \n"; } - else - { + else { dol_print_error($db); } } @@ -399,13 +393,11 @@ if ($ok && GETPOST('standard', 'alpha')) print 'Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we delete record'; } - else - { + else { print 'Widget '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module '.$name.' not enabled in entity '.$obj->entity.', we should delete record (not done, mode test)'; } } - else - { + else { //print 'Constant '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module found in entity '.$obj->entity.', we keep record'; } } @@ -472,13 +464,11 @@ if ($ok && GETPOST('standard', 'alpha')) print 'Constant '.$obj->file.' set in boxes_def for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we delete record'; } - else - { + else { print 'Constant '.$obj->file.' set in boxes_def for entity '.$obj->entity.' but MAIN_MODULE_'.strtoupper($module).' not defined in entity '.$obj->entity.', we should delete record (not done, mode test)'; } } - else - { + else { //print 'Constant '.$obj->name.' set in entity '.$obj->entity.' with value '.$obj->value.' -> Module found in entity '.$obj->entity.', we keep record'; } } @@ -567,8 +557,7 @@ if ($ok && GETPOST('restore_thirdparties_logos')) $i++; } } - else - { + else { $ok = 0; dol_print_error($db); } @@ -671,8 +660,7 @@ if ($ok && GETPOST('restore_user_pictures', 'alpha')) $i++; } } - else - { + else { $ok = 0; dol_print_error($db); } @@ -730,8 +718,7 @@ if ($ok && GETPOST('rebuild_product_thumbs', 'alpha')) $i++; } } - else - { + else { $ok = 0; dol_print_error($db); } @@ -816,16 +803,13 @@ if ($ok && GETPOST('clean_menus', 'alpha')) $error++; dol_print_error($db); } - else - print ' - Cleaned'; + else print ' - Cleaned'; } - else - { + else { print ' - Canceled (test mode)'; } } - else - { + else { print ' - Module condition '.$modulecond.' is ok, we do nothing.'; } } @@ -840,13 +824,11 @@ if ($ok && GETPOST('clean_menus', 'alpha')) $i++; } } - else - { + else { print 'No menu entries of disabled menus found'; } } - else - { + else { dol_print_error($db); } } @@ -1049,8 +1031,7 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } @@ -1066,13 +1047,11 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) $i++; } } - else - { + else { print 'Nothing to do'; } } - else - { + else { dol_print_error($db); } } @@ -1156,13 +1135,11 @@ if ($ok && GETPOST('set_empty_time_spent_amount', 'alpha')) $i++; } } - else - { + else { print 'No time spent with empty line on users with a hourly rate defined'; } } - else - { + else { dol_print_error($db); } } @@ -1257,16 +1234,13 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) $error++; dol_print_error($db); } - else - print ' - Cleaned'; + else print ' - Cleaned'; } - else - { + else { print ' - Canceled (test mode)'; } } - else - { + else { print ' - File of '.$key.' ('.$reloffile.') found, we do nothing.'; } } @@ -1282,13 +1256,11 @@ if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) $i++; } } - else - { + else { print 'No active module with missing files found by searching on MAIN_MODULE_(.*)_'.strtoupper($key).''; } } - else - { + else { dol_print_error($db); } } @@ -1334,13 +1306,11 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) $i++; } } - else - { + else { print 'No lines of a disabled external module (with id > 100000) found into table rights_def'; } } - else - { + else { dol_print_error($db); } } @@ -1392,8 +1362,7 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) $resql = $db->query($sql); } } - else - { + else { print 'Not available with database type '.$db->type.''; } } @@ -1496,8 +1465,7 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { { $resql_attach = $db->query($sql_attach); } - else - { + else { $resql_attach = true; // Force success in test mode } @@ -1552,8 +1520,7 @@ if ($oneoptionset) print $langs->trans("GoToDolibarr"); print ''; } -else -{ +else { print '
'; print $langs->trans("SetAtLeastOneOptionAsUrlParameter"); print '
'; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index a5e6b9d3377..6bf2e1d3dff 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -231,8 +231,7 @@ if (!$error) { { $databasefortest = 'postgres'; } - else - { + else { $databasefortest = 'master'; } } @@ -275,8 +274,7 @@ if (!$error) { } } } - else - { + else { print "
\nFailed to include_once(\"".$main_dir."/core/db/".$db_type.".class.php\")
\n"; print '
'.$langs->trans("ErrorWrongValueForParameter", $langs->transnoentities("WebPagesDirectory")).'
'; //print ''; @@ -286,8 +284,7 @@ if (!$error) { } } -else -{ +else { if (isset($db)) print $db->lasterror(); if (isset($db) && !$db->connected) print '
'.$langs->trans("BecauseConnectionFailedParametersMayBeWrong").'

'; print $langs->trans("ErrorGoBackAndCorrectParameters"); @@ -318,7 +315,7 @@ if (!$error && $db->connected) $defaultCharacterSet = $db->forcecharset; $defaultDBSortingCollation = $db->forcecollate; } - else // If already created, we take current value + else // If already created, we take current value { $defaultCharacterSet = $db->getDefaultCharacterSetDatabase(); $defaultDBSortingCollation = $db->getDefaultCollationDatabase(); @@ -401,8 +398,7 @@ if (!$error && $db->connected && $action == "set") print '
'.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').''; $error++; } - else - { + else { // Create .htaccess file in document directory $pathhtaccess = $main_data_dir.'/.htaccess'; if (!file_exists($pathhtaccess)) @@ -438,8 +434,7 @@ if (!$error && $db->connected && $action == "set") { dolibarr_install_syslog("step1: directory '".$dir[$i]."' exists"); } - else - { + else { if (dol_mkdir($dir[$i]) < 0) { print ""; @@ -449,8 +444,7 @@ if (!$error && $db->connected && $action == "set") print ""; $error++; } - else - { + else { dolibarr_install_syslog("step1: directory '".$dir[$i]."' created"); } } @@ -472,8 +466,7 @@ if (!$error && $db->connected && $action == "set") print ""; print '
'.$langs->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').''; } - else - { + else { //ODT templates $srcroot = $main_dir.'/install/doctemplates'; $destroot = $main_data_dir.'/doctemplates'; @@ -592,8 +585,7 @@ if (!$error && $db->connected && $action == "set") print ''; print 'Ok'; } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_USER_ALREADY_EXISTS') @@ -605,8 +597,7 @@ if (!$error && $db->connected && $action == "set") print ''; print ''.$langs->trans("LoginAlreadyExists").''; } - else - { + else { dolibarr_install_syslog("step1: failed to create user", LOG_ERR); print ''; print $langs->trans("UserCreation").' : '; @@ -618,8 +609,7 @@ if (!$error && $db->connected && $action == "set") $db->close(); } - else - { + else { print ''; print $langs->trans("UserCreation").' : '; print $dolibarr_main_db_user; @@ -668,8 +658,7 @@ if (!$error && $db->connected && $action == "set") //if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('step1: value for character_set is not the one asked for database creation', LOG_WARNING); //if ($check2 != $dolibarr_main_db_collation) dolibarr_install_syslog('step1: value for collation is not the one asked for database creation', LOG_WARNING); } - else - { + else { // warning message print '
'; print $langs->trans("ErrorFailedToCreateDatabase", $dolibarr_main_db_name).'
'; @@ -735,8 +724,7 @@ if (!$error && $db->connected && $action == "set") $error = 0; } - else - { + else { dolibarr_install_syslog("step1: connection to database ".$conf->db->name." by user ".$conf->db->user." failed", LOG_ERR); print ""; print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; @@ -755,8 +743,7 @@ if (!$error && $db->connected && $action == "set") $error++; } } - else - { + else { dolibarr_install_syslog("step1: connection to server by user ".$conf->db->user." failed", LOG_ERR); print ""; print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : "; @@ -1031,8 +1018,7 @@ function write_conf_file($conffile) print 'Ok'; print ""; } - else - { + else { $error++; } } diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 5b794b781bd..f33319ba57c 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -100,8 +100,7 @@ if ($action == "set") print $langs->trans("ServerConnection")." : ".$conf->db->host.'Ok'; $ok = 1; } - else - { + else { print "Failed to connect to server : ".$conf->db->host.'Error'; } @@ -111,8 +110,7 @@ if ($action == "set") { dolibarr_install_syslog("step2: successful connection to database: ".$conf->db->name); } - else - { + else { dolibarr_install_syslog("step2: failed connection to database :".$conf->db->name, LOG_ERR); print "Failed to select database ".$conf->db->name.'Error'; $ok = 0; @@ -202,8 +200,7 @@ if ($action == "set") { $buffer = preg_replace('/type=innodb/i', 'ENGINE=innodb', $buffer); } - else - { + else { // Keyword ENGINE is MySQL-specific, so scrub it for // other database types (mssql, pgsql) $buffer = preg_replace('/type=innodb/i', '', $buffer); @@ -226,15 +223,13 @@ if ($action == "set") // print "OK requete ==== $buffer"; $db->free($resql); } - else - { + else { if ($db->errno() == 'DB_ERROR_TABLE_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_TABLE_OR_KEY_ALREADY_EXISTS') { //print "Deja existante"; } - else - { + else { print "".$langs->trans("CreateTableAndPrimaryKey", $name); print "
\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer.'
Executed query : '.$db->lastquery; print "\n"; @@ -243,8 +238,7 @@ if ($action == "set") } } } - else - { + else { print "".$langs->trans("CreateTableAndPrimaryKey", $name); print ""; print ''.$langs->trans("Error").' Failed to open file '.$dir.$file.''; @@ -262,8 +256,7 @@ if ($action == "set") $ok = 1; } } - else - { + else { print ''.$langs->trans("ErrorFailedToFindSomeFiles", $dir).'Error'; dolibarr_install_syslog("step2: failed to find files to create database in directory ".$dir, LOG_ERR); } @@ -369,8 +362,7 @@ if ($action == "set") //print "OK requete ==== $buffer"; $db->free($resql); } - else - { + else { if ($db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_CANNOT_CREATE' || $db->errno() == 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS' || @@ -380,8 +372,7 @@ if ($action == "set") //print "Deja existante"; $key_exists = 1; } - else - { + else { print "".$langs->trans("CreateOtherKeysForTable", $name); print "
\n".$langs->trans("Request").' '.$requestnb.' : '.$db->lastqueryerror(); print "\n"; @@ -392,8 +383,7 @@ if ($action == "set") } } } - else - { + else { print "".$langs->trans("CreateOtherKeysForTable", $name); print ""; print ''.$langs->trans("Error")." Failed to open file ".$dir.$file.""; @@ -465,15 +455,13 @@ if ($action == "set") $ok = 1; $db->free($resql); } - else - { + else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS') { //print "Insert line : ".$buffer."
\n"; } - else - { + else { $ok = 0; print "".$langs->trans("FunctionsCreation"); @@ -491,8 +479,7 @@ if ($action == "set") { print 'Ok'; } - else - { + else { print 'Error'; $ok = 1; } @@ -589,14 +576,12 @@ if ($action == "set") { //$db->free($resql); // Not required as request we launch here does not return memory needs. } - else - { + else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { //print "Insertion ligne : $buffer"; } - else - { + else { $ok = 0; $okallfile = 0; print ''.$langs->trans("ErrorSQL")." : ".$db->lasterrno()." - ".$db->lastqueryerror()." - ".$db->lasterror()."
"; @@ -614,16 +599,14 @@ if ($action == "set") { print 'Ok'; } - else - { + else { print 'Error'; $ok = 1; // Data loading are not blocking errors } } print ''; } -else -{ +else { print 'Parameter action=set not defined'; } diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index b74594ce8da..a30a6040fb9 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -187,8 +187,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities if (function_exists('password_hash')) dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'password_hash', 'chaine', 0, '', 0); // All entities - else - dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities + else dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities } dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO); @@ -215,16 +214,14 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."
"; $success = 1; } - else - { + else { if ($newuser->error == 'ErrorLoginAlreadyExists') { dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING); print '
'.$langs->trans("AdminLoginAlreadyExists", $login)."

"; $success = 1; } - else - { + else { dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR); print '
'.$langs->trans("FailedToCreateAdminLogin").' '.$newuser->error.'


'; } @@ -241,8 +238,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) $conf->global->MAIN_VERSION_FIRST_INSTALL = $targetversion; $db->commit(); } - else - { + else { //if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists $db->commit(); } @@ -293,8 +289,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) $db->commit(); } } - else - { + else { print $langs->trans("ErrorFailedToConnect")."
"; } } @@ -311,8 +306,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) // Define if we need to update the MAIN_VERSION_LAST_UPGRADE value in database $tagdatabase = false; if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) $tagdatabase = true; // We don't know what it was before, so now we consider we are version choosed. - else - { + else { $mainversionlastupgradearray = preg_split('/[.-]/', $conf->global->MAIN_VERSION_LAST_UPGRADE); $targetversionarray = preg_split('/[.-]/', $targetversion); if (versioncompare($targetversionarray, $mainversionlastupgradearray) > 0) $tagdatabase = true; @@ -327,18 +321,15 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) if (!$resql) dol_print_error($db, 'Error in setup program'); $conf->global->MAIN_VERSION_LAST_UPGRADE = $targetversion; } - else - { + else { dolibarr_install_syslog('step5: we run an upgrade to version '.$targetversion.' but database was already upgraded to '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'. We keep MAIN_VERSION_LAST_UPGRADE as it is.'); } } - else - { + else { print $langs->trans("ErrorFailedToConnect")."
"; } } - else - { + else { dol_print_error('', 'step5.php: unknown choice of action'); } @@ -390,8 +381,7 @@ if ($action == "set" && $success) print ' '.$langs->trans("GoToSetupArea"); print '
'; } - else - { + else { // If here MAIN_VERSION_LAST_UPGRADE is not empty print $langs->trans("VersionLastUpgrade").': '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'; print $langs->trans("VersionProgram").': '.DOL_VERSION.'
'; @@ -438,8 +428,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print ' '.$langs->trans("GoToDolibarr").'...'; print '
'; } - else - { + else { // If here MAIN_VERSION_LAST_UPGRADE is not empty print $langs->trans("VersionLastUpgrade").': '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'; print $langs->trans("VersionProgram").': '.DOL_VERSION.''; @@ -451,8 +440,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action)) print ''; } } -else -{ +else { dol_print_error('', 'step5.php: unknown choice of action'); } diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index b71707bef4b..91242b7429a 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -151,8 +151,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerConnection").": $dolibarr_main_db_host ".$langs->transnoentities("OK")); $ok = 1; } - else - { + else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->transnoentities("Error")."\n"; dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -167,8 +166,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ dolibarr_install_syslog("upgrade: Database connection successful: ".$dolibarr_main_db_name); $ok = 1; } - else - { + else { print "".$langs->trans("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)."".$langs->trans("Error")."\n"; dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name)); $ok = 0; @@ -293,8 +291,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } $db->free($resql); } - else - { + else { if ($db->lasterrno() != 'DB_ERROR_NOSUCHTABLE') { print ''.$sql.' : '.$db->lasterror()."
\n"; @@ -335,8 +332,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } sort($filesindir); } - else - { + else { print '
'.$langs->trans("ErrorCanNotReadDir", $dir).'
'; } @@ -357,8 +353,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ { print '
'.$langs->trans("ErrorNoMigrationFilesFoundForParameters").'
'; } - else - { + else { $listoffileprocessed = array(); // Protection to avoid to process twice the same file // Loop on each migrate files diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 765a8796a76..b8e9ad30076 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -68,8 +68,7 @@ $err = error_reporting(); error_reporting(0); if (!empty($conf->global->MAIN_OVERRIDE_TIME_LIMIT)) @set_time_limit((int) $conf->global->MAIN_OVERRIDE_TIME_LIMIT); -else - @set_time_limit(600); +else @set_time_limit(600); error_reporting($err); $setuplang = GETPOST("selectlang", 'aZ09', 3) ?GETPOST("selectlang", 'aZ09', 3) : 'auto'; @@ -159,8 +158,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ { dolibarr_install_syslog('upgrade2: database connection successful :'.$dolibarr_main_db_name); } - else - { + else { $error++; } } @@ -536,16 +534,14 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print ""; print ''; } - else - { + else { print ''; print ''.$langs->trans('UpgradeExternalModule').': OK'; print ""; print ''; } } - else - { + else { //if (! empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) // If there is at least one module with one hook, we show message to say nothing was done { @@ -585,8 +581,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print '

'.$langs->trans("MigrationFinished").'
'; } -else -{ +else { print '
'.$langs->trans('ErrorWrongParameters').'
'; $error++; } @@ -646,8 +641,7 @@ function migrate_paiements($db, $langs, $conf) $i++; } } - else - { + else { dol_print_error($db); } @@ -678,19 +672,16 @@ function migrate_paiements($db, $langs, $conf) $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } } - else - { + else { print $langs->trans('MigrationPaymentsNothingToUpdate')."
\n"; } } - else - { + else { print $langs->trans('MigrationPaymentsNothingToUpdate')."
\n"; } @@ -753,8 +744,7 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) $i++; } } - else - { + else { dol_print_error($db); } @@ -794,8 +784,7 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) print $langs->trans('MigrationProcessPaymentUpdate', 'facid='.$facid.'-paymentid='.$row[$i]['paymentid'].'-amount='.$row[$i]['pamount'])."
\n"; } } - else - { + else { print 'ERROR'; } } @@ -804,20 +793,17 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) { print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } $db->commit(); } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -879,8 +865,7 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) $i++; } } - else - { + else { dol_print_error($db); } @@ -921,8 +906,7 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) print $langs->trans('MigrationProcessPaymentUpdate', 'facid='.$facid.'-paymentid='.$row[$i]['paymentid'].'-amount='.$row[$i]['pamount'])."
\n"; } } - else - { + else { print 'ERROR'; $nberr++; } @@ -932,15 +916,13 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) { print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } $db->commit(); } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -954,14 +936,12 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) { $db->commit(); } - else - { + else { print 'ERROR'; $db->rollback(); } } - else - { + else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -1032,8 +1012,7 @@ function migrate_contracts_det($db, $langs, $conf) { print $langs->trans('MigrationContractsLineCreation', $obj->cref)."
\n"; } - else - { + else { dol_print_error($db); $nberr++; } @@ -1047,19 +1026,16 @@ function migrate_contracts_det($db, $langs, $conf) $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } } - else - { + else { print $langs->trans('MigrationContractsNothingToUpdate')."
\n"; } } - else - { + else { print $langs->trans('MigrationContractsFieldDontExist')."
\n"; // dol_print_error($db); } @@ -1133,8 +1109,7 @@ function migrate_links_transfert($db, $langs, $conf) $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; } - else - { + else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } @@ -1143,8 +1118,7 @@ function migrate_links_transfert($db, $langs, $conf) print $langs->trans('MigrationBankTransfertsNothingToUpdate')."
\n"; } } - else - { + else { dol_print_error($db); } @@ -1172,8 +1146,7 @@ function migrate_contracts_date1($db, $langs, $conf) if (!$resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) print $langs->trans('MigrationContractsEmptyDatesUpdateSuccess')."
\n"; - else - print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."
\n"; $sql = "update ".MAIN_DB_PREFIX."contrat set datec=tms where datec is null"; dolibarr_install_syslog("upgrade2::migrate_contracts_date1"); @@ -1181,8 +1154,7 @@ function migrate_contracts_date1($db, $langs, $conf) if (!$resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) print $langs->trans('MigrationContractsEmptyCreationDatesUpdateSuccess')."
\n"; - else - print $langs->trans('MigrationContractsEmptyCreationDatesNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsEmptyCreationDatesNothingToUpdate')."
\n"; print ''; } @@ -1244,12 +1216,10 @@ function migrate_contracts_date2($db, $langs, $conf) if ($nbcontratsmodifie) print $langs->trans('MigrationContractsInvalidDatesNumber', $nbcontratsmodifie)."
\n"; - else - print $langs->trans('MigrationContractsInvalidDatesNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsInvalidDatesNothingToUpdate')."
\n"; } } - else - { + else { dol_print_error($db); } @@ -1277,8 +1247,7 @@ function migrate_contracts_date3($db, $langs, $conf) if (!$resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) print $langs->trans('MigrationContractsIncoherentCreationDateUpdateSuccess')."
\n"; - else - print $langs->trans('MigrationContractsIncoherentCreationDateNothingToUpdate')."
\n"; + else print $langs->trans('MigrationContractsIncoherentCreationDateNothingToUpdate')."
\n"; print ''; } @@ -1333,8 +1302,7 @@ function migrate_contracts_open($db, $langs, $conf) if ($nbcontratsmodifie) print $langs->trans('MigrationReopenedContractsNumber', $nbcontratsmodifie)."
\n"; - else - print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; + else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; } } else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; @@ -1416,23 +1384,20 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) $nb++; print ''.$langs->trans("OK").''; } - else - { + else { print 'Error on insert'; $error++; } print ''; } } - else - { + else { $error++; } $i++; } } - else - { + else { $error++; } @@ -1447,14 +1412,12 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) $sql = "ALTER TABLE ".MAIN_DB_PREFIX."paiementfourn DROP COLUMN fk_facture_fourn"; $db->query($sql); } - else - { + else { print ''.$langs->trans("Error").''; $db->rollback(); } } - else - { + else { print ''.$langs->trans("AlreadyDone").''; } } @@ -1540,14 +1503,12 @@ function migrate_price_facture($db, $langs, $conf) { //print $facture->id; } - else - { + else { print "Error id=".$facture->id; $err++; } } - else - { + else { print "Error #3"; $err++; } @@ -1557,16 +1518,14 @@ function migrate_price_facture($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } $db->free($resql); $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $err++; @@ -1665,8 +1624,7 @@ function migrate_price_propal($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1674,8 +1632,7 @@ function migrate_price_propal($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1754,8 +1711,7 @@ function migrate_price_contrat($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1763,8 +1719,7 @@ function migrate_price_contrat($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1861,8 +1816,7 @@ function migrate_price_commande($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1880,8 +1834,7 @@ function migrate_price_commande($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1978,8 +1931,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans("AlreadyDone"); } @@ -1997,8 +1949,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) $db->commit(); } - else - { + else { print "Error #1 ".$db->error(); $db->rollback(); @@ -2126,19 +2077,16 @@ function migrate_commande_expedition($db, $langs, $conf) print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2202,8 +2150,7 @@ function migrate_commande_livraison($db, $langs, $conf) dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } @@ -2219,19 +2166,16 @@ function migrate_commande_livraison($db, $langs, $conf) print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2310,14 +2254,12 @@ function migrate_detail_livraison($db, $langs, $conf) dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } } - else - { + else { $error++; dol_print_error($db); } @@ -2333,19 +2275,16 @@ function migrate_detail_livraison($db, $langs, $conf) print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { $result = $db->DDLDescTable(MAIN_DB_PREFIX."livraisondet", "fk_origin_line"); $obj = $db->fetch_object($result); if (!$obj) @@ -2402,8 +2341,7 @@ function migrate_stocks($db, $langs, $conf) if ($resql2) { } - else - { + else { $error++; dol_print_error($db); } @@ -2416,13 +2354,11 @@ function migrate_stocks($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -2478,8 +2414,7 @@ function migrate_menus($db, $langs, $conf) if ($resql2) { } - else - { + else { $error++; dol_print_error($db); } @@ -2492,19 +2427,16 @@ function migrate_menus($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2567,8 +2499,7 @@ function migrate_commande_deliveryaddress($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2576,19 +2507,16 @@ function migrate_commande_deliveryaddress($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2670,13 +2598,11 @@ function migrate_restore_missing_links($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -2729,8 +2655,7 @@ function migrate_restore_missing_links($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2738,13 +2663,11 @@ function migrate_restore_missing_links($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -2826,24 +2749,20 @@ function migrate_project_user_resp($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2918,24 +2837,20 @@ function migrate_project_task_actors($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -3006,8 +2921,7 @@ function migrate_relationship_tables($db, $langs, $conf, $table, $fk_source, $so $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3018,24 +2932,20 @@ function migrate_relationship_tables($db, $langs, $conf, $table, $fk_source, $so { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3104,8 +3014,7 @@ function migrate_project_task_time($db, $langs, $conf) if (!empty($totaltime[$obj->fk_task])) $totaltime[$obj->fk_task] += $newtime; else $totaltime[$obj->fk_task] = $newtime; } - else - { + else { if (!empty($totaltime[$obj->fk_task])) $totaltime[$obj->fk_task] += $obj->task_duration; else $totaltime[$obj->fk_task] = $obj->task_duration; } @@ -3131,23 +3040,19 @@ function migrate_project_task_time($db, $langs, $conf) } } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } } - else - { + else { dol_print_error($db); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } } - else - { + else { dol_print_error($db); } @@ -3155,8 +3060,7 @@ function migrate_project_task_time($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -3229,8 +3133,7 @@ function migrate_customerorder_shipping($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3238,26 +3141,22 @@ function migrate_customerorder_shipping($db, $langs, $conf) { $db->commit(); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3331,16 +3230,14 @@ function migrate_shipping_delivery($db, $langs, $conf) } print ". "; } - else - { + else { $error++; dol_print_error($db); } $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3355,20 +3252,17 @@ function migrate_shipping_delivery($db, $langs, $conf) $sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."livraison DROP COLUMN fk_expedition"; $db->query($sqlDrop); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3436,8 +3330,7 @@ function migrate_shipping_delivery2($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3445,14 +3338,12 @@ function migrate_shipping_delivery2($db, $langs, $conf) { $db->commit(); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -3511,14 +3402,12 @@ function migrate_actioncomm_element($db, $langs, $conf) //$db->query($sqlDrop); //print ". "; } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } } @@ -3603,14 +3492,12 @@ function migrate_mode_reglement($db, $langs, $conf) { $db->commit(); } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -3694,16 +3581,14 @@ function migrate_clean_association($db, $langs, $conf) print ''.$langs->trans("RemoveDuplicates").' '.$langs->trans("Success").' ('.$num.'=>'.count($couples).')'; $db->commit(); } - else - { + else { print ''.$langs->trans("MigrationCategorieAssociation").''; print ''.$langs->trans("RemoveDuplicates").' '.$langs->trans("Failed").''; $db->rollback(); } } } - else - { + else { print ''.$langs->trans("Error").''; print '
'.$db->lasterror().'
'; } @@ -3764,8 +3649,7 @@ function migrate_categorie_association($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3786,19 +3670,16 @@ function migrate_categorie_association($db, $langs, $conf) $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3858,8 +3739,7 @@ function migrate_event_assignement($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3867,13 +3747,11 @@ function migrate_event_assignement($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -3935,8 +3813,7 @@ function migrate_event_assignement_contact($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3944,13 +3821,11 @@ function migrate_event_assignement_contact($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4022,8 +3897,7 @@ function migrate_reset_blocked_log($db, $langs, $conf) $error++; dol_print_error($db); } - else - { + else { // Add set line $object = new stdClass(); $object->id = 1; @@ -4041,21 +3915,18 @@ function migrate_reset_blocked_log($db, $langs, $conf) } } } - else - { + else { print ' - '.$langs->trans('AlreadyInV7').'
'; } } - else - { + else { dol_print_error($db); } $i++; } } - else - { + else { print $langs->trans('NothingToDo')."
\n"; } @@ -4063,13 +3934,11 @@ function migrate_reset_blocked_log($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4132,8 +4001,7 @@ function migrate_remise_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4141,13 +4009,11 @@ function migrate_remise_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4207,8 +4073,7 @@ function migrate_remise_except_entity($db, $langs, $conf) $sqlSelect2 .= " WHERE fd.rowid = ".$obj->fk_facture_line; $sqlSelect2 .= " AND fd.fk_facture = f.rowid"; } - else - { + else { $sqlSelect2 = "SELECT s.entity"; $sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sqlSelect2 .= " WHERE s.rowid = ".$obj->fk_soc; @@ -4233,8 +4098,7 @@ function migrate_remise_except_entity($db, $langs, $conf) } } } - else - { + else { $error++; dol_print_error($db); } @@ -4243,8 +4107,7 @@ function migrate_remise_except_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4252,13 +4115,11 @@ function migrate_remise_except_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4319,8 +4180,7 @@ function migrate_user_rights_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4328,13 +4188,11 @@ function migrate_user_rights_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4395,8 +4253,7 @@ function migrate_usergroup_rights_entity($db, $langs, $conf) $i++; } } - else - { + else { print $langs->trans('AlreadyDone')."
\n"; } @@ -4404,13 +4261,11 @@ function migrate_usergroup_rights_entity($db, $langs, $conf) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); $db->rollback(); } @@ -4774,8 +4629,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->init($reloadmode); } } - else - { + else { $reg = array(); $tmp = preg_match('/MAIN_MODULE_([a-zA-Z0-9]+)/', $moduletoreload, $reg); if (!empty($reg[1])) @@ -4784,7 +4638,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo { $moduletoreloadshort = ucfirst(strtolower($reg[1])); } - else // If key is a mix of up and low case + else // If key is a mix of up and low case { $moduletoreloadshort = $reg[1]; } @@ -4796,8 +4650,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - else - { + else { dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'); $res = @dol_include_once(strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php'); @@ -4807,14 +4660,12 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - else - { + else { dolibarr_install_syslog('Failed to include '.strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php'); } } } - else - { + else { dolibarr_install_syslog("Error, can't find module with name ".$moduletoreload, LOG_WARNING); print "Error, can't find module with name ".$moduletoreload; } @@ -4949,7 +4800,7 @@ function migrate_user_photospath() // dol_delete_dir($origin.'/'.$file); } } - else // it is a file + else // it is a file { if (!dol_is_file($destin.'/'.$file)) { From def53338de2c55147ff3d7e7b95a5f5389cb2147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 09:07:10 +0200 Subject: [PATCH 332/490] add new rule --- build/generate_filelist_xml.php | 4 +- dev/initdemo/sftpget_and_loaddump.php | 8 +- dev/initdemo/updatedemo.php | 4 +- htdocs/core/class/cunits.class.php | 8 +- htdocs/document.php | 12 +- htdocs/main.inc.php | 36 ++-- htdocs/website/class/website.class.php | 12 +- htdocs/website/class/websitepage.class.php | 5 +- htdocs/website/index.php | 169 ++++++------------ htdocs/website/samples/wrapper.php | 18 +- .../accountancy/export-thirdpartyaccount.php | 6 +- scripts/bank/export-bank-receipts.php | 3 +- .../email_expire_services_to_customers.php | 15 +- ...ail_expire_services_to_representatives.php | 9 +- scripts/cron/cron_run_jobs.php | 9 +- scripts/emailings/mailing-send.php | 15 +- .../email_unpaid_invoices_to_customers.php | 9 +- ...ail_unpaid_invoices_to_representatives.php | 3 +- .../members/sync_members_ldap2dolibarr.php | 6 +- .../sync_members_types_ldap2dolibarr.php | 3 +- scripts/user/sync_groups_ldap2dolibarr.php | 3 +- scripts/user/sync_users_ldap2dolibarr.php | 6 +- 22 files changed, 125 insertions(+), 238 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 976f2cb6ba3..581353b758b 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -110,7 +110,7 @@ print "Working on files into : ".DOL_DOCUMENT_ROOT."\n"; print "Include custom in signature : ".$includecustom."\n"; print "Include constants in signature : "; foreach ($includeconstants as $countrycode => $tmp) { - foreach($tmp as $constname => $constvalue) { + foreach ($tmp as $constname => $constvalue) { print $constname.'='.$constvalue." "; } } @@ -130,7 +130,7 @@ fputs($fp, ''."\n"); - foreach($tmp as $constname => $constvalue) { + foreach ($tmp as $constname => $constvalue) { $valueforchecksum=(empty($constvalue)?'0':$constvalue); $checksumconcat[]=$valueforchecksum; fputs($fp, ' '.$valueforchecksum.''."\n"); diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php index 5b16d3afe9b..4da5ffaad58 100755 --- a/dev/initdemo/sftpget_and_loaddump.php +++ b/dev/initdemo/sftpget_and_loaddump.php @@ -95,8 +95,7 @@ if ($connection) dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR); exit(-5); } - else - { + else { //$stream = ssh2_exec($connection, '/usr/bin/php -i'); /* print "Generate dump ".$filesys1.'.bz2'."\n"; @@ -125,14 +124,13 @@ if ($connection) $return_var=0; print strftime("%Y%m%d-%H%M%S").' '.$fullcommand."\n"; exec($fullcommand, $output, $return_var); - foreach($output as $line) print $line."\n"; + foreach ($output as $line) print $line."\n"; //ssh2_sftp_unlink($sftp, $fileinstalllock); //print $output; } } -else -{ +else { print 'Failed to connect to ssh2 to '.$server; exit(-6); } diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index 0cc43a18a9d..95d5ad12c83 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -87,7 +87,7 @@ while ($year <= $currentyear) if ($delta1) { - foreach($tables as $tablekey => $tableval) + foreach ($tables as $tablekey => $tableval) { print "Correct ".$tablekey." for year ".$year." and move them to current year ".$currentyear." "; $sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)"; @@ -105,7 +105,7 @@ while ($year <= $currentyear) print "."; $sql2="UPDATE ".MAIN_DB_PREFIX.$tablekey." set "; $j=0; - foreach($tableval as $field) + foreach ($tableval as $field) { if ($j) $sql2.=", "; $sql2.= $field." = ".$db->ifsql("DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR) > NOW()", "DATE_ADD(".$field.", INTERVAL ".$delta2." YEAR)", "DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR)"); diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 0b56b4c0831..80ea8e2f0cc 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -432,11 +432,9 @@ class CUnits // extends CommonObject return round($value, 2); } - - /** * get scale of unit factor - * @param $id int id of unit in dictionary + * @param int $id id of unit in dictionary * @return float|int */ public function scaleOfUnitPow($id) @@ -444,9 +442,9 @@ class CUnits // extends CommonObject $base = 10; // TODO : add base col into unit dictionary table $unit = $this->db->getRow('SELECT scale, unit_type from '.MAIN_DB_PREFIX.'c_units WHERE rowid = '.intval($id)); - if ($unit){ + if ($unit) { // TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60 - if ($unit->unit_type == 'time'){ + if ($unit->unit_type == 'time') { return doubleval($unit->scale); } diff --git a/htdocs/document.php b/htdocs/document.php index c1ed149649e..0d08296e63e 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -134,19 +134,16 @@ if (!empty($hashp)) $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir //var_dump($original_file); exit; } - else - { + else { accessforbidden('Bad link. File is from another module part.', 0, 0, 1); } } - else - { + else { $modulepart = $moduleparttocheck; $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir } } - else - { + else { $langs->load("errors"); accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1); } @@ -185,8 +182,7 @@ if (!empty($hashp)) $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } -else -{ +else { // Basic protection (against external users only) if ($user->socid > 0) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 733ded3e447..569f4aa6c57 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1340,23 +1340,17 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr else print ''."\n"; if (!defined('DISABLE_JQUERY_TABLEDND')) print ''."\n"; // jQuery jnotify - if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) - { + if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) { print ''."\n"; } // Flot - if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'jflot') - { - if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT')) - { - if (constant('JS_JQUERY_FLOT')) - { + if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'jflot') { + if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT')) { + if (constant('JS_JQUERY_FLOT')) { print ''."\n"; print ''."\n"; print ''."\n"; - } - else - { + } else { print ''."\n"; print ''."\n"; print ''."\n"; @@ -1375,14 +1369,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } } // Chart - if ($conf->global->MAIN_JS_GRAPH == 'chart') - { + if ($conf->global->MAIN_JS_GRAPH == 'chart') { print ''."\n"; } // jQuery jeditable for Edit In Place features - if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) - { + if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) { print ''."\n"; print ''."\n"; print ''."\n"; @@ -1401,28 +1393,26 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; } // jQuery Timepicker - if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) - { + if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { print ''."\n"; print ''."\n"; } - if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) // jQuery plugin "mutiselect", "multiple-select", "select2", ... - { + if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) { + // jQuery plugin "mutiselect", "multiple-select", "select2", ... $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; print ''."\n"; // We include full because we need the support of containerCssClass } } - if (!$disablejs && !empty($conf->use_javascript_ajax)) - { + if (!$disablejs && !empty($conf->use_javascript_ajax)) { // CKEditor if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) { print ''."\n"; $pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/'; $jsckeditor = 'ckeditor.js'; - if (constant('JS_CKEDITOR')) // To use external ckeditor 4 js lib - { + if (constant('JS_CKEDITOR')) { + // To use external ckeditor 4 js lib $pathckeditor = constant('JS_CKEDITOR'); } print ''."\n"; } - if (is_object($objsoc) && $objsoc->id > 0) - { + if (is_object($objsoc) && $objsoc->id > 0) { $this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company_id'] = $objsoc->id; } else { @@ -126,8 +122,7 @@ abstract class ActionsAdherentCardCommon $this->tpl['select_civility'] = $formcompany->select_civility($this->object->civility_id); // Predefined with third party - if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE')) - { + if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE')) { if (dol_strlen(trim($this->object->address)) == 0) $this->tpl['address'] = $objsoc->address; if (dol_strlen(trim($this->object->zip)) == 0) $this->object->zip = $objsoc->zip; if (dol_strlen(trim($this->object->town)) == 0) $this->object->town = $objsoc->town; @@ -159,18 +154,15 @@ abstract class ActionsAdherentCardCommon $this->tpl['select_morphy'] = $form->selectarray('morphy', $selectarray, $this->object->morphy, 0); } - if ($action == 'view' || $action == 'edit' || $action == 'delete') - { + if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing - if (!empty($conf->mailing->enabled)) - { + if (!empty($conf->mailing->enabled)) { $langs->load("mails"); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); } // Dolibarr user - if ($this->object->user_id) - { + if ($this->object->user_id) { $dolibarr_user = new User($this->db); $result = $dolibarr_user->fetch($this->object->user_id); $this->tpl['dolibarr_user'] = $dolibarr_user->getLoginUrl(1); @@ -178,12 +170,10 @@ abstract class ActionsAdherentCardCommon else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess"); } - if ($action == 'view' || $action == 'delete') - { + if ($action == 'view' || $action == 'delete') { $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'id'); - if ($this->object->socid > 0) - { + if ($this->object->socid > 0) { $objsoc = new Societe($this->db); $objsoc->fetch($this->object->socid); @@ -210,8 +200,7 @@ abstract class ActionsAdherentCardCommon $this->tpl['note'] = nl2br($this->object->note); } - if ($action == 'create_user') - { + if ($action == 'create_user') { // Full firstname and lastname separated with a dot : firstname.lastname include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; @@ -259,12 +248,10 @@ abstract class ActionsAdherentCardCommon $this->object->canvas = $_POST["canvas"]; // We set country_id, and country_code label of the chosen country - if ($this->object->country_id) - { + if ($this->object->country_id) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_country WHERE rowid = ".$this->object->country_id; $resql = $this->db->query($sql); - if ($resql) - { + if ($resql) { $obj = $this->db->fetch_object($resql); $this->object->country_code = $obj->code; diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index f248256a547..db2473c55d9 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -90,8 +90,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon $this->tpl['error'] = $this->error; $this->tpl['errors'] = $this->errors; - if ($action == 'view') - { + if ($action == 'view') { // Card header $head = member_prepare_head($this->object); $title = $this->getTitle($action); @@ -107,14 +106,12 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); } else { // Confirm delete contact - if ($action == 'delete' && $user->rights->adherent->supprimer) - { + if ($action == 'delete' && $user->rights->adherent->supprimer) { $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("DeleteAdherent"), $langs->trans("ConfirmDeleteAdherent"), "confirm_delete", '', 0, 1); } } - if ($action == 'list') - { + if ($action == 'list') { $this->LoadListDatas($limit, $offset, $sortfield, $sortorder); } } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php index 92f1e11d7a2..b6c0b542d27 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php @@ -17,8 +17,7 @@ */ // Protection to avoid direct call of template -if (empty($conf) || !is_object($conf)) -{ +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php index 36e2deab14c..92a4fbddd38 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php @@ -17,8 +17,7 @@ */ // Protection to avoid direct call of template -if (empty($conf) || !is_object($conf)) -{ +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index b738f549247..8789b2fcb34 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -17,8 +17,7 @@ */ // Protection to avoid direct call of template -if (empty($conf) || !is_object($conf)) -{ +if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7a5880fc317..cf5253e3bf8 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -55,8 +55,7 @@ $typeid = GETPOST('typeid', 'int'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); -if (!empty($conf->mailmanspip->enabled)) -{ +if (!empty($conf->mailmanspip->enabled)) { include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $langs->load('mailmanspip'); @@ -76,8 +75,7 @@ $socialnetworks = getArrayOfSocialNetworks(); $object->getCanvas($id); $canvas = $object->canvas ? $object->canvas : GETPOST("canvas"); $objcanvas = null; -if (!empty($canvas)) -{ +if (!empty($canvas)) { require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; $objcanvas = new Canvas($db, $action); $objcanvas->getCanvas('adherent', 'membercard', $canvas); @@ -86,16 +84,14 @@ if (!empty($canvas)) // Security check $result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', $objcanvas); -if ($id > 0) -{ +if ($id > 0) { // Load member $result = $object->fetch($id); // Define variables to know what current user can do on users $canadduser = ($user->admin || $user->rights->user->user->creer); // Define variables to know what current user can do on properties of user linked to edited member - if ($object->user_id) - { + if ($object->user_id) { // $User is the user who edits, $object->user_id is the id of the related user in the edited member $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer) || (($user->id != $object->user_id) && $user->rights->user->user->creer)); @@ -107,8 +103,7 @@ if ($id > 0) // Define variables to determine what the current user can do on the members $canaddmember = $user->rights->adherent->creer; // Define variables to determine what the current user can do on the properties of a member -if ($id) -{ +if ($id) { $caneditfieldmember = $user->rights->adherent->creer; } @@ -125,34 +120,26 @@ $parameters = array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas, 'confirm'= $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if (empty($reshook)) -{ - if ($cancel) - { - if (!empty($backtopage)) - { +if (empty($reshook)) { + if ($cancel) { + if (!empty($backtopage)) { header("Location: ".$backtopage); exit; } $action = ''; } - if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) - { + if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) { $error = 0; - if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only - { - if ($userid != $user->id && $userid != $object->user_id) - { + if (empty($user->rights->user->user->creer)) { // If can edit only itself user, we can link to itself only + if ($userid != $user->id && $userid != $object->user_id) { $error++; setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } - if (!$error) - { - if ($userid != $object->user_id) // If link differs from currently in database - { + if (!$error) { + if ($userid != $object->user_id) { // If link differs from currently in database $result = $object->setUserId($userid); if ($result < 0) dol_print_error($object->db, $object->error); $action = ''; @@ -160,22 +147,17 @@ if (empty($reshook)) } } - if ($action == 'setsocid') - { + if ($action == 'setsocid') { $error = 0; - if (!$error) - { - if ($socid != $object->socid) // If link differs from currently in database - { + if (!$error) { + if ($socid != $object->socid) { // If link differs from currently in database $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; $sql .= " WHERE socid = '".$socid."'"; $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $obj = $db->fetch_object($resql); - if ($obj && $obj->rowid > 0) - { + if ($obj && $obj->rowid > 0) { $othermember = new Adherent($db); $othermember->fetch($obj->rowid); $thirdparty = new Societe($db); @@ -185,8 +167,7 @@ if (empty($reshook)) } } - if (!$error) - { + if (!$error) { $result = $object->setThirdPartyId($socid); if ($result < 0) dol_print_error($object->db, $object->error); $action = ''; @@ -196,16 +177,13 @@ if (empty($reshook)) } // Create user from a member - if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user->user->creer) - { - if ($result > 0) - { + if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user->user->creer) { + if ($result > 0) { // Creation user $nuser = new User($db); $result = $nuser->create_from_member($object, GETPOST('login', 'alphanohtml')); - if ($result < 0) - { + if ($result < 0) { $langs->load("errors"); setEventMessages($langs->trans($nuser->error), null, 'errors'); } @@ -215,16 +193,13 @@ if (empty($reshook)) } // Create third party from a member - if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) - { - if ($result > 0) - { + if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) { + if ($result > 0) { // User creation $company = new Societe($db); $result = $company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha')); - if ($result < 0) - { + if ($result < 0) { $langs->load("errors"); setEventMessages($langs->trans($company->error), null, 'errors'); setEventMessages($company->error, $company->errors, 'errors'); @@ -234,15 +209,13 @@ if (empty($reshook)) } } - if ($action == 'update' && !$cancel && $user->rights->adherent->creer) - { + if ($action == 'update' && !$cancel && $user->rights->adherent->creer) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $birthdate = ''; if (isset($_POST["birthday"]) && $_POST["birthday"] && isset($_POST["birthmonth"]) && $_POST["birthmonth"] - && isset($_POST["birthyear"]) && $_POST["birthyear"]) - { + && isset($_POST["birthyear"]) && $_POST["birthyear"]) { $birthdate = dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]); } $lastname = $_POST["lastname"]; @@ -267,16 +240,14 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Company")), null, 'errors'); } // Check if the login already exists - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) - { + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($login)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")), null, 'errors'); } } // Create new object - if ($result > 0 && !$error) - { + if ($result > 0 && !$error) { $object->oldcopy = clone $object; // Change values @@ -329,32 +300,27 @@ if (empty($reshook)) // Check if we need to also synchronize user information $nosyncuser = 0; - if ($object->user_id) // If linked to a user - { + if ($object->user_id) { // If linked to a user if ($user->id != $object->user_id && empty($user->rights->user->user->creer)) $nosyncuser = 1; // Disable synchronizing } // Check if we need to also synchronize password information $nosyncuserpass = 0; - if ($object->user_id) // If linked to a user - { + if ($object->user_id) { // If linked to a user if ($user->id != $object->user_id && empty($user->rights->user->user->password)) $nosyncuserpass = 1; // Disable synchronizing } $result = $object->update($user, 0, $nosyncuser, $nosyncuserpass); - if ($result >= 0 && !count($object->errors)) - { + if ($result >= 0 && !count($object->errors)) { $categories = GETPOST('memcats', 'array'); $object->setCategories($categories); // Logo/Photo save $dir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos'; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); - if ($file_OK) - { - if (GETPOST('deletephoto')) - { + if ($file_OK) { + if (GETPOST('deletephoto')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileimg = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/'.$object->photo; $dirthumbs = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/thumbs'; @@ -362,15 +328,12 @@ if (empty($reshook)) dol_delete_dir_recursive($dirthumbs); } - if (image_format_supported($_FILES['photo']['name']) > 0) - { + if (image_format_supported($_FILES['photo']['name']) > 0) { dol_mkdir($dir); - if (@is_dir($dir)) - { + if (@is_dir($dir)) { $newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); - if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0) - { + if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0) { setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } else { // Create thumbs @@ -381,8 +344,7 @@ if (empty($reshook)) setEventMessages("ErrorBadImageFormat", null, 'errors'); } } else { - switch ($_FILES['photo']['error']) - { + switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form $errors[] = "ErrorFileSizeTooLarge"; @@ -397,8 +359,7 @@ if (empty($reshook)) $id = $object->id; $action = ''; - if (!empty($backtopage)) - { + if (!empty($backtopage)) { header("Location: ".$backtopage); exit; } @@ -411,19 +372,16 @@ if (empty($reshook)) } } - if ($action == 'add' && $user->rights->adherent->creer) - { + if ($action == 'add' && $user->rights->adherent->creer) { if ($canvas) $object->canvas = $canvas; $birthdate = ''; if (isset($_POST["birthday"]) && $_POST["birthday"] && isset($_POST["birthmonth"]) && $_POST["birthmonth"] - && isset($_POST["birthyear"]) && $_POST["birthyear"]) - { + && isset($_POST["birthyear"]) && $_POST["birthyear"]) { $birthdate = dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]); } $datesubscription = ''; - if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"])) - { + if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"])) { $datesubscription = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); } @@ -508,8 +466,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MemberNature")), null, 'errors'); } // Tests if the login already exists - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) - { + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($login)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")), null, 'errors'); @@ -557,14 +514,12 @@ if (empty($reshook)) $public = 0; if (isset($public)) $public = 1; - if (!$error) - { + if (!$error) { $db->begin(); // Email about right and login does not exist $result = $object->create($user); - if ($result > 0) - { + if ($result > 0) { // Foundation categories $memcats = GETPOST('memcats', 'array'); $object->setCategories($memcats); @@ -590,13 +545,10 @@ if (empty($reshook)) } } - if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes') - { + if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes') { $result = $object->delete($id, $user); - if ($result > 0) - { - if (!empty($backtopage)) - { + if ($result > 0) { + if (!empty($backtopage)) { header("Location: ".$backtopage); exit; } else { @@ -608,8 +560,7 @@ if (empty($reshook)) } } - if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == 'yes') - { + if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == 'yes') { $error = 0; $db->begin(); @@ -619,11 +570,9 @@ if (empty($reshook)) $result = $object->validate($user); - if ($result >= 0 && !count($object->errors)) - { + if ($result >= 0 && !count($object->errors)) { // Send confirmation email (according to parameters of member type. Otherwise generic) - if ($object->email && GETPOST("send_mail")) - { + if ($object->email && GETPOST("send_mail")) { $subject = ''; $msg = ''; @@ -641,8 +590,7 @@ if (empty($reshook)) if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) - { + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } @@ -661,8 +609,7 @@ if (empty($reshook)) $moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); - if ($result < 0) - { + if ($result < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -677,8 +624,7 @@ if (empty($reshook)) } } - if (!$error) - { + if (!$error) { $db->commit(); } else { $db->rollback(); @@ -686,21 +632,17 @@ if (empty($reshook)) $action = ''; } - if ($user->rights->adherent->supprimer && $action == 'confirm_resign') - { + if ($user->rights->adherent->supprimer && $action == 'confirm_resign') { $error = 0; - if ($confirm == 'yes') - { + if ($confirm == 'yes') { $adht = new AdherentType($db); $adht->fetch($object->typeid); $result = $object->resiliate($user); - if ($result >= 0 && !count($object->errors)) - { - if ($object->email && GETPOST("send_mail")) - { + if ($result >= 0 && !count($object->errors)) { + if ($object->email && GETPOST("send_mail")) { $subject = ''; $msg = ''; @@ -718,8 +660,7 @@ if (empty($reshook)) if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) - { + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } @@ -738,8 +679,7 @@ if (empty($reshook)) $moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); - if ($result < 0) - { + if ($result < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -756,31 +696,24 @@ if (empty($reshook)) $action = ''; } } - if (!empty($backtopage) && !$error) - { + if (!empty($backtopage) && !$error) { header("Location: ".$backtopage); exit; } } // SPIP Management - if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes') - { - if (!count($object->errors)) - { - if (!$mailmanspip->del_to_spip($object)) - { + if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes') { + if (!count($object->errors)) { + if (!$mailmanspip->del_to_spip($object)) { setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } } - if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') - { - if (!count($object->errors)) - { - if (!$mailmanspip->add_to_spip($object)) - { + if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') { + if (!count($object->errors)) { + if (!$mailmanspip->add_to_spip($object)) { setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors'); } } @@ -817,13 +750,11 @@ llxHeader('', $title, $help_url); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) -{ +if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- - if (empty($object->error) && $id) - { + if (empty($object->error) && $id) { $object = new Adherent($db); $result = $object->fetch($id); if ($result <= 0) dol_print_error('', $object->error); @@ -835,8 +766,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // When used in standard mode // ----------------------------------------- - if ($action == 'create') - { + if ($action == 'create') { /* ************************************************************************** */ /* */ /* Creation mode */ @@ -847,8 +777,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // We set country_id, country_code and country for the selected country $object->country_id = GETPOST('country_id', 'int') ?GETPOST('country_id', 'int') : $mysoc->country_id; - if ($object->country_id) - { + if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; @@ -858,8 +787,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $object = new Societe($db); if ($socid > 0) $object->fetch($socid); - if (!($object->id > 0)) - { + if (!($object->id > 0)) { $langs->load("errors"); print($langs->trans('ErrorRecordNotFound')); exit; @@ -870,8 +798,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print load_fiche_titre($langs->trans("NewMember"), '', 'members'); - if ($conf->use_javascript_ajax) - { + if ($conf->use_javascript_ajax) { print "\n".''; - } - } - } - - return $out; - } - - /** - * Fill array_options property of object by extrafields value (using for data sent by forms) - * - * @param array $extralabels Deprecated (old $array of extrafields, now set this to null) - * @param object $object Object - * @param string $onlykey Only the following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must set this to avoid to have other extrafields being reset. - * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) - */ - public function setOptionalsFromPost($extralabels, &$object, $onlykey = '') - { - global $_POST, $langs; - - $nofillrequired = 0; // For error when required field left blank - $error_field_required = array(); - - if (is_array($this->attributes[$object->table_element]['label'])) $extralabels = $this->attributes[$object->table_element]['label']; - - if (is_array($extralabels)) - { - // Get extra fields - foreach ($extralabels as $key => $value) - { - if (!empty($onlykey) && $key != $onlykey) continue; - - $key_type = $this->attributes[$object->table_element]['type'][$key]; - if ($key_type == 'separate') continue; - - $enabled = 1; - if (isset($this->attributes[$object->table_element]['list'][$key])) - { - $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); - } - $perms = 1; - if (isset($this->attributes[$object->table_element]['perms'][$key])) - { - $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); - } - if (empty($enabled)) continue; - if (empty($perms)) continue; - - if ($this->attributes[$object->table_element]['required'][$key]) // Value is required - { - // Check if empty without using GETPOST, value can be alpha, int, array, etc... - if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0') - || (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select') - || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) - { - //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; - $nofillrequired++; - $error_field_required[] = $langs->transnoentitiesnoconv($value); - } - } - - if (in_array($key_type, array('date'))) - { - // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - elseif (in_array($key_type, array('datetime'))) - { - // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) - { - $value_arr = GETPOST("options_".$key, 'array'); // check if an array - if (!empty($value_arr)) { - $value_key = implode($value_arr, ','); - } else { - $value_key = ''; - } - } - elseif (in_array($key_type, array('price', 'double'))) - { - $value_arr = GETPOST("options_".$key, 'alpha'); - $value_key = price2num($value_arr); - } - else - { - $value_key = GETPOST("options_".$key); - if (in_array($key_type, array('link')) && $value_key == '-1') $value_key = ''; - } - - $object->array_options["options_".$key] = $value_key; - } - - if ($nofillrequired) { - $langs->load('errors'); - setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ', $error_field_required), null, 'errors'); - return -1; - } - else { - return 1; - } - } - else { - return 0; - } - } - - /** - * return array_options array of data of extrafields value of object sent by a search form - * - * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @return array|int array_options set or 0 if no value - */ - public function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix = '', $keysuffix = '') - { - global $_POST; - - if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label'])) - { - $extralabels = $this->attributes[$extrafieldsobjectkey]['label']; - } - else - { - $extralabels = $extrafieldsobjectkey; - } - - if (is_array($extralabels)) - { - $array_options = array(); - - // Get extra fields - foreach ($extralabels as $key => $value) - { - $key_type = ''; - if (is_string($extrafieldsobjectkey)) - { - $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - } - - if (in_array($key_type, array('date', 'datetime'))) - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. - // Clean parameters - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); - } - elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. - $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); - // Make sure we get an array even if there's only one checkbox - $value_arr = (array) $value_arr; - $value_key = implode(',', $value_arr); - } - elseif (in_array($key_type, array('price', 'double', 'int'))) - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. - $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); - $value_key = price2num($value_arr); - } - else - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. - $value_key = GETPOST($keysuffix."options_".$key.$keyprefix); - } - - $array_options[$keysuffix."options_".$key] = $value_key; // No keyprefix here. keyprefix is used only for read. - } - - return $array_options; - } - - return 0; - } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 32abc8f7240..d7e46922f56 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -368,6 +368,8 @@ class Form $s = picto_from_langcode($langcode, 'class="pictoforlang paddingright"'); $resultforextrlang .= $s; + + // TODO Use the showInputField() method of ExtraLanguages object if ($typeofdata == 'textarea') { $resultforextrlang .= '', null, 'warnings'); setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings'); $action = ''; - } - elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) + } elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings'); $action = ''; - } - else { + } else { $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); if ($object->statut == 0) @@ -232,8 +228,7 @@ if (empty($reshook)) $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - } - else { + } else { $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$obj->source_id, 2); $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'order'.$obj->source_id, 2); $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'invoice'.$obj->source_id, 2); @@ -312,8 +307,7 @@ if (empty($reshook)) if (!$resql2) { dol_print_error($db); - } - else { + } else { //if cheack read is use then update prospect contact status if (strpos($message, '__CHECK_READ__') !== false) { @@ -345,8 +339,7 @@ if (empty($reshook)) } //test if CHECK READ change statut prospect contact - } - else { + } else { // Mail failed $nbko++; @@ -363,8 +356,7 @@ if (empty($reshook)) $i++; } - } - else { + } else { setEventMessages($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"), null, 'mesgs'); } @@ -374,14 +366,12 @@ if (empty($reshook)) $statut = 2; // Status 'sent partially' (because at least one error) if ($nbok > 0) setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs'); else setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs'); - } - else { + } else { if ($nbok >= $num) { $statut = 3; // Send to everybody setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs'); - } - else { + } else { $statut = 2; // Status 'sent partially' (because not send to everybody) setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs'); } @@ -394,8 +384,7 @@ if (empty($reshook)) { dol_print_error($db); } - } - else { + } else { dol_syslog($db->error()); dol_print_error($db); } @@ -462,8 +451,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("MailSuccessfulySent", $mailfile->getValidAddress($object->email_from, 2), $mailfile->getValidAddress($object->sendto, 2)), null, 'mesgs'); $action = ''; - } - else { + } else { setEventMessages($langs->trans("ResultKo").'
'.$mailfile->error.' '.$result, null, 'errors'); $action = 'test'; } @@ -600,8 +588,7 @@ if (empty($reshook)) setEventMessages($mesg, $mesgs, 'errors'); $action = "edit"; - } - else { + } else { $action = "edit"; } } @@ -615,8 +602,7 @@ if (empty($reshook)) setEventMessages($langs->trans("MailingSuccessfullyValidated"), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } @@ -632,12 +618,10 @@ if (empty($reshook)) //setEventMessages($langs->trans("MailingSuccessfullyValidated"), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { dol_print_error($db); } } @@ -660,13 +644,11 @@ if (empty($reshook)) $db->commit(); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } - } - else { + } else { dol_print_error($db); } } @@ -766,8 +748,7 @@ if ($action == 'create') print '
'; print ''; -} -else { +} else { if ($object->id > 0) { $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); @@ -823,8 +804,7 @@ else { setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings'); if (!empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings'); $_GET["action"] = ''; - } - elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) + } elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { if (!empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings'); if (!empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings'); @@ -837,8 +817,7 @@ else { setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings'); // You can send online with constant... } $_GET["action"] = ''; - } - else { + } else { if (!empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings'); if (!empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings'); @@ -920,8 +899,7 @@ else { if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0) { $text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB); - } - else { + } else { $text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed'); } } @@ -929,8 +907,7 @@ else { if ($text) { print $form->textwithpicto($nbemail, $text, 1, 'warning'); - } - else { + } else { print $nbemail; } } @@ -977,8 +954,7 @@ else { if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { print ''.$langs->trans("EditWithEditor").''; - } - else { + } else { print ''.$langs->trans("EditWithTextEditor").''; } @@ -990,8 +966,7 @@ else { if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("TestMailing").''; - } - else { + } else { print ''.$langs->trans("TestMailing").''; } @@ -1000,12 +975,10 @@ else { if ($object->nbemail <= 0) { print ''.$langs->trans("ValidMailing").''; - } - elseif (empty($user->rights->mailing->valider)) + } elseif (empty($user->rights->mailing->valider)) { print ''.$langs->trans("ValidMailing").''; - } - else { + } else { print ''.$langs->trans("ValidMailing").''; } } @@ -1015,12 +988,10 @@ else { if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { print ''.$langs->trans("SendMailing").''; - } - elseif (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) + } elseif (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("SendMailing").''; - } - else { + } else { print ''.$langs->trans("SendMailing").''; } } @@ -1035,8 +1006,7 @@ else { if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("ResetMailing").''; - } - else { + } else { print ''.$langs->trans("ResetMailing").''; } } @@ -1046,8 +1016,7 @@ else { if ($object->statut > 0 && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->delete)) { print ''.$langs->trans("DeleteMailing").''; - } - else { + } else { print ''.$langs->trans("DeleteMailing").''; } } @@ -1126,8 +1095,7 @@ else { print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name']; print '
'; } - } - else { + } else { print ''.$langs->trans("NoAttachedFiles").'
'; } print ''; @@ -1148,13 +1116,11 @@ else { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', false, true, empty($conf->global->FCKEDITOR_ENABLE_MAILING) ? 0 : 1, 20, '90%', $readonly); $doleditor->Create(); - } - else print dol_htmlentitiesbr($object->body); + } else print dol_htmlentitiesbr($object->body); print ''; dol_fiche_end(); - } - else { + } else { /* * Mailing en mode edition (CKeditor or HTML source) */ @@ -1200,8 +1166,7 @@ else { if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0) { $text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB); - } - else { + } else { $text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed'); } } @@ -1209,8 +1174,7 @@ else { if ($text) { print $form->textwithpicto($nbemail, $text, 1, 'warning'); - } - else { + } else { print $nbemail; } } @@ -1284,8 +1248,7 @@ else { $out .= ' '; $out .= '
'; } - } - else { + } else { $out .= $langs->trans("NoAttachedFiles").'
'; } // Add link to add file @@ -1334,8 +1297,7 @@ else { print ''; print '
'; } - } - else { + } else { dol_print_error($db, $object->error); } } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index e89a645cf20..27e0c2e5b0c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -160,8 +160,7 @@ if (GETPOST('exportcsv', 'int')) } exit; - } - else { + } else { dol_print_error($db); } exit; @@ -180,13 +179,11 @@ if ($action == 'delete') $obj->update_nb($id); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - } - else { + } else { header("Location: list.php"); exit; } - } - else { + } else { dol_print_error($db); } } @@ -290,8 +287,7 @@ if ($object->fetch($id) >= 0) if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0) { $text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB); - } - else { + } else { $text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed'); } } @@ -299,8 +295,7 @@ if ($object->fetch($id) >= 0) if ($text) { print $form->textwithpicto($nbemail, $text, 1, 'warning'); - } - else { + } else { print $nbemail; } } @@ -400,8 +395,7 @@ if ($object->fetch($id) >= 0) { print '
'; print ''; - } - else { + } else { print '
'; } @@ -414,8 +408,7 @@ if ($object->fetch($id) >= 0) try { $nbofrecipient = $obj->getNbOfRecipients(''); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -424,8 +417,7 @@ if ($object->fetch($id) >= 0) if ($nbofrecipient >= 0) { print $nbofrecipient; - } - else { + } else { print $langs->trans("Error").' '.img_error($obj->error); } print '
'; @@ -435,8 +427,7 @@ if ($object->fetch($id) >= 0) { try { $filter = $obj->formFilter(); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -449,8 +440,7 @@ if ($object->fetch($id) >= 0) if ($allowaddtarget) { print ''; - } - else { + } else { print ''; //print $langs->trans("MailNoChangePossible"); print " "; @@ -624,29 +614,24 @@ if ($object->fetch($id) >= 0) if (empty($obj->source_id) || empty($obj->source_type)) { print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility - } - else { + } else { if ($obj->source_type == 'member') { $objectstaticmember->fetch($obj->source_id); print $objectstaticmember->getNomUrl(1); - } - elseif ($obj->source_type == 'user') + } elseif ($obj->source_type == 'user') { $objectstaticuser->fetch($obj->source_id); print $objectstaticuser->getNomUrl(1); - } - elseif ($obj->source_type == 'thirdparty') + } elseif ($obj->source_type == 'thirdparty') { $objectstaticcompany->fetch($obj->source_id); print $objectstaticcompany->getNomUrl(1); - } - elseif ($obj->source_type == 'contact') + } elseif ($obj->source_type == 'contact') { $objectstaticcontact->fetch($obj->source_id); print $objectstaticcontact->getNomUrl(1); - } - else { + } else { print $obj->source_url; } } @@ -666,8 +651,7 @@ if ($object->fetch($id) >= 0) print ''; print $object::libStatutDest($obj->statut, 2, ''); print ''; - } - else { + } else { // Date sent print ''.$obj->date_envoi.''; @@ -693,8 +677,7 @@ if ($object->fetch($id) >= 0) $i++; } - } - else { + } else { if ($object->statut < 2) { print ''; @@ -708,8 +691,7 @@ if ($object->fetch($id) >= 0) print '
'; $db->free($resql); - } - else { + } else { dol_print_error($db); } diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index dd6f59e80b9..983ad374980 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -165,8 +165,7 @@ class AdvanceTargetingMailing extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -220,8 +219,7 @@ class AdvanceTargetingMailing extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -282,8 +280,7 @@ class AdvanceTargetingMailing extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -348,8 +345,7 @@ class AdvanceTargetingMailing extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -407,8 +403,7 @@ class AdvanceTargetingMailing extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -448,8 +443,7 @@ class AdvanceTargetingMailing extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -683,8 +677,7 @@ class AdvanceTargetingMailing extends CommonObject if (!empty($arrayquery['contact_no_email'])) { $tmpwhere .= "(t.email IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape($arrayquery['contact_no_email'])."'))"; - } - else { + } else { $tmpwhere .= "(t.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape($arrayquery['contact_no_email'])."'))"; } $sqlwhere[] = $tmpwhere; diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index fd674945beb..e6f928d539f 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -314,8 +314,7 @@ class FormAdvTargetEmailing extends Form $i++; } } - } - else { + } else { dol_print_error($this->db); } @@ -399,8 +398,7 @@ class FormAdvTargetEmailing extends Form $i++; } } - } - else { + } else { dol_print_error($this->db); } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index a6c44c96a8d..1bb4864876c 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -144,16 +144,14 @@ class Mailing extends CommonObject if ($this->update($user) > 0) { $this->db->commit(); - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } return $this->id; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -184,8 +182,7 @@ class Mailing extends CommonObject if ($result) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -250,13 +247,11 @@ class Mailing extends CommonObject $this->extraparams = (array) json_decode($obj->extraparams, true); return 1; - } - else { + } else { dol_syslog(get_class($this)."::fetch Erreur -1"); return -1; } - } - else { + } else { dol_syslog(get_class($this)."::fetch Erreur -2"); return -2; } @@ -363,8 +358,7 @@ class Mailing extends CommonObject ); } } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -380,8 +374,7 @@ class Mailing extends CommonObject { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -405,8 +398,7 @@ class Mailing extends CommonObject if ($this->db->query($sql)) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -429,8 +421,7 @@ class Mailing extends CommonObject if ($resql) { return $this->delete_targets(); - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -453,8 +444,7 @@ class Mailing extends CommonObject if ($resql) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return 0; } @@ -480,8 +470,7 @@ class Mailing extends CommonObject if ($resql) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -511,8 +500,7 @@ class Mailing extends CommonObject { $obj = $this->db->fetch_object($resql); if ($obj) return $obj->nb; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -572,8 +560,7 @@ class Mailing extends CommonObject $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; */ - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index edcb12d1bb2..cf439e4314b 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -129,8 +129,7 @@ if (is_resource($handle)) } $db->free($result); - } - else { + } else { dol_print_error($db); } print ''; @@ -190,14 +189,12 @@ if ($result) { print ''; $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } print "
"; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index dcba1333b11..d22dd130507 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -130,8 +130,7 @@ if ($filteremail) if ($search_all) $sql .= " AND (m.titre like '%".$db->escape($search_all)."%' OR m.sujet like '%".$db->escape($search_all)."%' OR m.body like '%".$db->escape($search_all)."%')"; if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "m.rowid"; -} -else { +} else { $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec, m.date_envoi as date_envoi"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql .= " WHERE m.entity = ".$conf->entity; @@ -273,8 +272,7 @@ if ($resql) if ($filteremail) { print $email::libStatutDest($obj->sendstatut, 2); - } - else { + } else { print $email->LibStatut($obj->statut, 5); } print ''; @@ -295,8 +293,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 964663a976b..cd5d5c9ace9 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -152,8 +152,7 @@ if ($_socid > 0) } $db->free($resql); print ""; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6b9ed10f18a..a2d27943c89 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -161,8 +161,7 @@ if (empty($reshook)) if (!GETPOST('socid', 3)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); - } - else { + } else { if ($object->id > 0) { if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY)) { //Get difference between old and new delivery date and change lines according to difference @@ -268,9 +267,7 @@ if (empty($reshook)) if (count($object->errors) > 0) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors'); } - } - - elseif ($action == 'setdate' && $usercancreate) + } elseif ($action == 'setdate' && $usercancreate) { $datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); @@ -284,14 +281,12 @@ if (empty($reshook)) if ($result < 0) dol_print_error($db, $object->error); } - } - elseif ($action == 'setecheance' && $usercancreate) + } elseif ($action == 'setecheance' && $usercancreate) { $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); if ($result < 0) dol_print_error($db, $object->error); - } - elseif ($action == 'setdate_livraison' && $usercancreate) + } elseif ($action == 'setdate_livraison' && $usercancreate) { $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear'])); if ($result < 0) @@ -600,13 +595,11 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit(); - } - else { + } else { $db->rollback(); $action = 'create'; } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $action = 'create'; @@ -630,8 +623,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -657,8 +649,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -682,8 +673,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -705,8 +695,7 @@ if (empty($reshook)) { dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'OrderLine'; - } - elseif ($fromElement == 'propal') + } elseif ($fromElement == 'propal') { dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'PropaleLigne'; @@ -758,8 +747,7 @@ if (empty($reshook)) } else { $error++; } - } - else { + } else { $error++; } } @@ -798,9 +786,7 @@ if (empty($reshook)) $ret = $object->fetch($id); // Reload to get new records $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - - elseif ($action == "setabsolutediscount" && $usercancreate) { + } elseif ($action == "setabsolutediscount" && $usercancreate) { if ($_POST["remise_id"]) { if ($object->id > 0) { $result = $object->insert_discount($_POST["remise_id"]); @@ -823,8 +809,7 @@ if (empty($reshook)) { $idprod = 0; $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - } - else { + } else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -956,8 +941,7 @@ if (empty($reshook)) if ($priceforthequantityarray['price_base_type'] == 'HT') { $pu_ht = $priceforthequantityarray['unitprice']; - } - else { + } else { $pu_ttc = $priceforthequantityarray['unitprice']; } // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. @@ -981,8 +965,7 @@ if (empty($reshook)) if ($priceforthequantityarray['price_base_type'] == 'HT') { $pu_ht = $priceforthequantityarray['unitprice']; - } - else { + } else { $pu_ttc = $priceforthequantityarray['unitprice']; } // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. @@ -1309,9 +1292,7 @@ if (empty($reshook)) } elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit(); - } - - elseif ($action == 'classin' && $usercancreate) { + } elseif ($action == 'classin' && $usercancreate) { // Set project $object->setProject(GETPOST('projectid', 'int')); } @@ -1329,13 +1310,9 @@ if (empty($reshook)) // Terms of payment elseif ($action == 'setconditions' && $usercancreate) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); - } - - elseif ($action == 'setremisepercent' && $usercancreate) { + } elseif ($action == 'setremisepercent' && $usercancreate) { $result = $object->set_remise_percent($user, $_POST['remise_percent']); - } - - elseif ($action == 'setremiseabsolue' && $usercancreate) { + } elseif ($action == 'setremiseabsolue' && $usercancreate) { $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); } @@ -1362,9 +1339,7 @@ if (empty($reshook)) // shipping method elseif ($action == 'setshippingmethod' && $usercancreate) { $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); - } - - elseif ($action == 'update_extras') { + } elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); // Fill array 'array_options' with data from update form @@ -1523,8 +1498,7 @@ if ($action == 'create') if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } } - } - else { + } else { if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; } @@ -2298,8 +2272,7 @@ if ($action == 'create') if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -2466,8 +2439,7 @@ if ($action == 'create') if ($usercanvalidate) { print '
'.$langs->trans('Validate').''; - } - else print ''.$langs->trans('Validate').''; + } else print ''.$langs->trans('Validate').''; } // Create event /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. @@ -2542,8 +2514,7 @@ if ($action == 'create') if ($usercanclose) { print 'socid.'">'.$langs->trans("ClassifyBilled").''; - } - else { + } else { print ''.$langs->trans("ClassifyBilled").''; } } diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 563e71d79d3..8efc4aa5c19 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -220,8 +220,7 @@ class Proposals extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve propal list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -456,8 +455,7 @@ class Proposals extends DolibarrApi $updateRes = $this->propal->deleteline($lineid); if ($updateRes > 0) { return $this->get($id); - } - else { + } else { throw new RestException(405, $this->propal->error); } } @@ -587,8 +585,7 @@ class Proposals extends DolibarrApi if ($this->propal->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); - } - else { + } else { throw new RestException(500, $this->propal->error); } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 0827ddd64c7..5a8ddc31982 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -390,8 +390,7 @@ class Propal extends CommonObject if ($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) { $price = $prod->multiprices[$this->thirdparty->price_level]; - } - else { + } else { $price = $prod->price; } @@ -472,19 +471,16 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $line->error; $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -2; } @@ -557,8 +553,7 @@ class Propal extends CommonObject if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } @@ -710,20 +705,17 @@ class Propal extends CommonObject { $this->db->commit(); return $this->line->id; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->line->error; $this->db->rollback(); return -2; } - } - else { + } else { dol_syslog(get_class($this)."::addline status of proposal must be Draft to allow use of ->addline()", LOG_ERR); return -3; } @@ -909,15 +901,13 @@ class Propal extends CommonObject $this->db->commit(); return $result; - } - else { + } else { $this->error = $this->line->error; $this->db->rollback(); return -1; } - } - else { + } else { dol_syslog(get_class($this)."::updateline Erreur -2 Propal en mode incompatible pour cette action"); return -2; } @@ -949,13 +939,11 @@ class Propal extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } @@ -1129,8 +1117,7 @@ class Propal extends CommonObject $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); @@ -1157,8 +1144,7 @@ class Propal extends CommonObject if (!is_object($this->lines[$i])) // If this->lines is not array of objects, coming from REST API { // Convert into object this->lines[$i]. $line = (object) $this->lines[$i]; - } - else { + } else { $line = $this->lines[$i]; } // Reset fk_parent_line for line that are not child lines or special product @@ -1254,14 +1240,12 @@ class Propal extends CommonObject if ($result < 0) { $error++; } // End call triggers } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -1271,13 +1255,11 @@ class Propal extends CommonObject $this->db->commit(); dol_syslog(get_class($this)."::create done id=".$this->id); return $this->id; - } - else { + } else { $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1357,8 +1339,7 @@ class Propal extends CommonObject $object->ref_client = ''; // TODO Change product price if multi-prices - } - else { + } else { $objsoc->fetch($object->socid); } @@ -1426,8 +1407,7 @@ class Propal extends CommonObject { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1481,8 +1461,7 @@ class Propal extends CommonObject if ($ref) { $sql .= " WHERE p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid $sql .= " AND p.ref='".$this->db->escape($ref)."'"; - } - else $sql .= " WHERE p.rowid=".$rowid; + } else $sql .= " WHERE p.rowid=".$rowid; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1592,8 +1571,7 @@ class Propal extends CommonObject $this->error = "Record Not Found"; return 0; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -1687,8 +1665,7 @@ class Propal extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -1816,8 +1793,7 @@ class Propal extends CommonObject $this->db->free($result); return $num; - } - else { + } else { $this->error = $this->db->lasterror(); return -3; } @@ -1865,8 +1841,7 @@ class Propal extends CommonObject if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); - } - else { + } else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -1939,8 +1914,7 @@ class Propal extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -2002,8 +1976,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2063,8 +2036,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2124,8 +2096,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2186,8 +2157,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2196,8 +2166,7 @@ class Propal extends CommonObject $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error_str = 'Propal status do not meet requirement '.$this->statut; dol_syslog(__METHOD__.$error_str, LOG_ERR); $this->error = $error_str; @@ -2257,8 +2226,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2267,8 +2235,7 @@ class Propal extends CommonObject $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error_str = 'Propal status do not meet requirement '.$this->statut; dol_syslog(__METHOD__.$error_str, LOG_ERR); $this->error = $error_str; @@ -2324,8 +2291,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2334,8 +2300,7 @@ class Propal extends CommonObject $this->db->rollback(); return -1 * $error; } - } - else { + } else { return -1; } } @@ -2392,8 +2357,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2459,8 +2423,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2526,8 +2489,7 @@ class Propal extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -2620,8 +2582,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->statut = $this->oldcopy->statut; $this->date_cloture = $this->oldcopy->date_cloture; $this->note_private = $this->oldcopy->note_private; @@ -2629,8 +2590,7 @@ class Propal extends CommonObject $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -2679,8 +2639,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2745,8 +2704,7 @@ class Propal extends CommonObject $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2812,12 +2770,10 @@ class Propal extends CommonObject if ($shortlist == 1) { $ga[$obj->propalid] = $obj->ref; - } - elseif ($shortlist == 2) + } elseif ($shortlist == 2) { $ga[$obj->propalid] = $obj->ref.' ('.$obj->name.')'; - } - else { + } else { $ga[$i]['id'] = $obj->propalid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -2827,8 +2783,7 @@ class Propal extends CommonObject } } return $ga; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2921,12 +2876,10 @@ class Propal extends CommonObject } } return $ga; - } - else { + } else { return -1; } - } - else return $ga; + } else return $ga; } /** @@ -3023,26 +2976,22 @@ class Propal extends CommonObject dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG); $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -3; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -1; } @@ -3096,8 +3045,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3106,8 +3054,7 @@ class Propal extends CommonObject $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error_str = 'Propal status do not meet requirement '.$this->statut; dol_syslog(__METHOD__.$error_str, LOG_ERR); $this->error = $error_str; @@ -3166,8 +3113,7 @@ class Propal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3176,8 +3122,7 @@ class Propal extends CommonObject $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error_str = 'Propal status do not meet requirement '.$this->statut; dol_syslog(__METHOD__.$error_str, LOG_ERR); $this->error = $error_str; @@ -3234,8 +3179,7 @@ class Propal extends CommonObject } } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -3370,8 +3314,7 @@ class Propal extends CommonObject } return $response; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -3449,8 +3392,7 @@ class Propal extends CommonObject $line->total_ttc = 60; $line->total_tva = 10; $line->remise_percent = 50; - } - else { + } else { $line->total_ht = 100; $line->total_ttc = 120; $line->total_tva = 20; @@ -3509,8 +3451,7 @@ class Propal extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -3560,14 +3501,12 @@ class Propal extends CommonObject if ($numref != "") { return $numref; - } - else { + } else { $this->error = $obj->error; //dol_print_error($db,"Propale::getNextNumRef ".$obj->error); return ""; } - } - else { + } else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Proposal")); return ""; @@ -3615,14 +3554,11 @@ class Propal extends CommonObject if ($option == '') { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; - } - elseif ($option == 'compta') { // deprecated + } elseif ($option == 'compta') { // deprecated $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; - } - elseif ($option == 'expedition') { + } elseif ($option == 'expedition') { $url = DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id.$get_params; - } - elseif ($option == 'document') { + } elseif ($option == 'document') { $url = DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id.$get_params; } @@ -3970,12 +3906,10 @@ class PropaleLigne extends CommonObjectLine $this->db->free($result); return 1; - } - else { + } else { return 0; } - } - else { + } else { return -1; } } @@ -4024,8 +3958,7 @@ class PropaleLigne extends CommonObjectLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -4112,8 +4045,7 @@ class PropaleLigne extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -4165,8 +4097,7 @@ class PropaleLigne extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -4213,8 +4144,7 @@ class PropaleLigne extends CommonObjectLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -4291,8 +4221,7 @@ class PropaleLigne extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -4325,8 +4254,7 @@ class PropaleLigne extends CommonObjectLine { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index ac6f500cce2..da23b4fc2bc 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -55,8 +55,7 @@ if ($id > 0 || !empty($ref)) $langs->load("errors"); setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors'); $error++; - } - elseif ($ret < 0) + } elseif ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -65,8 +64,7 @@ if ($id > 0 || !empty($ref)) if (!$error) { $object->fetch_thirdparty(); -} -else { +} else { header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); exit; } @@ -88,14 +86,12 @@ if ($action == 'addcontact' && $user->rights->propale->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -119,8 +115,7 @@ elseif ($action == 'deletecontact' && $user->rights->propale->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index f9d89ca981d..70c67566091 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -179,8 +179,7 @@ if ($object->id > 0) $permtoedit = $user->rights->propal->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index d456a507f19..9e138c52cbe 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -163,8 +163,7 @@ if ($resql) //print ''.$langs->trans("Total").' ('.$langs->trans("CustomersOrdersRunning").')'.$totalinprocess.''; print ''.$langs->trans("Total").''.$total.''; print "
"; -} -else { +} else { dol_print_error($db); } @@ -219,8 +218,7 @@ if (!empty($conf->propal->enabled)) if ($num > $nbofloop) { print ''.$langs->trans("XMoreLines", ($num - $nbofloop)).""; - } - elseif ($total > 0) + } elseif ($total > 0) { print ''.$langs->trans("Total").''.price($total).""; } @@ -309,8 +307,7 @@ if ($resql) } print ""; print "
"; -} -else dol_print_error($db); +} else dol_print_error($db); /* @@ -393,16 +390,14 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) if ($num > $nbofloop) { print ''.$langs->trans("XMoreLines", ($num - $nbofloop)).""; - } - elseif ($total > 0) + } elseif ($total > 0) { print ''.$langs->trans("Total")."".price($total)." "; } print ""; print "
"; } - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 9c31bd72bf7..6710ac56b58 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -414,8 +414,7 @@ if ($resql) $soc->fetch($socid); $title = $langs->trans('ListOfProposals').' - '.$soc->name; if (empty($search_societe)) $search_societe = $soc->name; - } - else { + } else { $title = $langs->trans('ListOfProposals'); } @@ -1027,8 +1026,7 @@ if ($resql) { print ''.dol_print_date($db->jdate($obj->dfv), 'day'); print ''; - } - else { + } else { print ' '; } if (!$i) $totalarray['nbfield']++; @@ -1040,8 +1038,7 @@ if ($resql) { print ''.dol_print_date($db->jdate($obj->ddelivery), 'day'); print ''; - } - else { + } else { print ' '; } if (!$i) $totalarray['nbfield']++; @@ -1166,8 +1163,7 @@ if ($resql) if ($nbofsalesrepresentative > 3) // We print only number { print $nbofsalesrepresentative; - } - elseif ($nbofsalesrepresentative > 0) + } elseif ($nbofsalesrepresentative > 0) { $userstatic = new User($db); $j = 0; @@ -1189,8 +1185,7 @@ if ($resql) } } //else print $langs->trans("NoSalesRepresentativeAffected"); - } - else { + } else { print ' '; } print ''; @@ -1275,8 +1270,7 @@ if ($resql) $delallowed = $user->rights->propal->creer; print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index c4f92d36b6a..00a79f3c1be 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -112,8 +112,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filenamenb = $dir.'/proposalsnbinyear-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$year.'.png'; } @@ -151,8 +150,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenameamount = $dir.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filenameamount = $dir.'/proposalsamountinyear-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$year.'.png'; } @@ -190,8 +188,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; @@ -344,8 +341,7 @@ print '
'; // Show graphs print '
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { print $px1->show(); print "
\n"; print $px2->show(); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 386e27f0ec3..b49f334dadd 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -223,8 +223,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) } print "

"; } - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 2edc331d71e..e393f5fce56 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -83,8 +83,7 @@ if ($socid > 0) print $langs->trans("FeatureNotYetAvailable"); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 170eb5b247a..284c248f1f0 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -83,8 +83,7 @@ if ($socid > 0) print $langs->trans("FeatureNotYetAvailable"); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index a735cd07028..a7517c9cb60 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -70,13 +70,11 @@ if (GETPOST('action', 'aZ09') == 'setremise') { header("Location: ".$backtopage); exit; - } - else { + } else { header("Location: remise.php?id=".$_GET["id"]); exit; } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -250,14 +248,12 @@ if ($socid > 0) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } $db->free($resql); print ""; - } - else { + } else { dol_print_error($db); } } @@ -307,14 +303,12 @@ if ($socid > 0) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } $db->free($resql); print ""; - } - else { + } else { dol_print_error($db); } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 62b38f9e390..ffd4c1738c0 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -105,8 +105,7 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes') { $newdiscount1->description = $discount->description; $newdiscount2->description = $discount->description; - } - else { + } else { $newdiscount1->description = $discount->description.' (1)'; $newdiscount2->description = $discount->description.' (2)'; } @@ -149,8 +148,7 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes') $db->commit(); header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage ? '&backtopage='.urlencode($backtopage) : '')); // To avoid pb whith back exit; - } - else { + } else { $db->rollback(); } } @@ -187,19 +185,16 @@ if ($action == 'setremise' && $user->rights->societe->creer) { header("Location: ".$backtopage.'&discountid='.$discountid); exit; - } - else { + } else { header("Location: remx.php?id=".$id); exit; } - } - else { + } else { $error++; setEventMessages($soc->error, $soc->errors, 'errors'); } } - } - else { + } else { setEventMessages($langs->trans("ErrorFieldFormat", $langs->transnoentitiesnoconv("AmountHT")), null, 'errors'); } } @@ -219,8 +214,7 @@ if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' $db->commit(); header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb whith back exit; - } - else { + } else { setEventMessages($discount->error, $discount->errors, 'errors'); $db->rollback(); } @@ -294,8 +288,7 @@ if ($socid > 0) $obj = $db->fetch_object($resql); $remise_all += $obj->amount; if ($obj->fk_user == $user->id) $remise_user += $obj->amount; - } - else { + } else { dol_print_error($db); } @@ -325,8 +318,7 @@ if ($socid > 0) $obj = $db->fetch_object($resql); $remise_all += $obj->amount; if ($obj->fk_user == $user->id) $remise_user += $obj->amount; - } - else { + } else { dol_print_error($db); } @@ -481,8 +473,7 @@ if ($socid > 0) $facturestatic->type = $obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) + } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { print ''; $facturestatic->id = $obj->fk_facture_source; @@ -490,8 +481,7 @@ if ($socid > 0) $facturestatic->type = $obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) + } elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) { print ''; $facturestatic->id = $obj->fk_facture_source; @@ -499,8 +489,7 @@ if ($socid > 0) $facturestatic->type = $obj->type; print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("ExcessReceived"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; - } - else { + } else { print ''; print $obj->description; print ''; @@ -526,8 +515,7 @@ if ($socid > 0) print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ''; - } - else print ' '; + } else print ' '; print ''; if ($_GET["action"] == 'split' && GETPOST('remid') == $obj->rowid) @@ -537,8 +525,7 @@ if ($socid > 0) } $i++; } - } - else { + } else { $colspan = 8; if (!empty($conf->multicurrency->enabled)) $colspan += 2; print ''.$langs->trans("None").''; @@ -559,8 +546,7 @@ if ($socid > 0) $langs->load("dict"); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, '', 0); } - } - else { + } else { dol_print_error($db); } } @@ -635,8 +621,7 @@ if ($socid > 0) $facturefournstatic->type = $obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) + } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; @@ -644,8 +629,7 @@ if ($socid > 0) $facturefournstatic->type = $obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) + } elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; @@ -653,8 +637,7 @@ if ($socid > 0) $facturefournstatic->type = $obj->type; print preg_replace('/\(EXCESS PAID\)/', $langs->trans("ExcessPaid"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; - } - else { + } else { print ''; print $obj->description; print ''; @@ -680,8 +663,7 @@ if ($socid > 0) print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ''; - } - else print ' '; + } else print ' '; print ''; if ($_GET["action"] == 'split' && GETPOST('remid') == $obj->rowid) @@ -691,8 +673,7 @@ if ($socid > 0) } $i++; } - } - else { + } else { $colspan = 8; if (!empty($conf->multicurrency->enabled)) $colspan += 2; print ''.$langs->trans("None").''; @@ -713,8 +694,7 @@ if ($socid > 0) $langs->load("dict"); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); } - } - else { + } else { dol_print_error($db); } @@ -843,8 +823,7 @@ if ($socid > 0) $facturestatic->type = $obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) + } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { print ''; $facturestatic->id = $obj->fk_facture_source; @@ -852,8 +831,7 @@ if ($socid > 0) $facturestatic->type = $obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) + } elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) { print ''; $facturestatic->id = $obj->fk_facture_source; @@ -861,8 +839,7 @@ if ($socid > 0) $facturestatic->type = $obj->type; print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; - } - else { + } else { print ''; print $obj->description; print ''; @@ -891,8 +868,7 @@ if ($socid > 0) print ''; $i++; } - } - else { + } else { $colspan = 8; if (!empty($conf->multicurrency->enabled)) $colspan += 2; print ''.$langs->trans("None").''; @@ -900,8 +876,7 @@ if ($socid > 0) print ""; print '
'; - } - else { + } else { dol_print_error($db); } } @@ -1018,8 +993,7 @@ if ($socid > 0) $facturefournstatic->type = $obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) + } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; @@ -1027,8 +1001,7 @@ if ($socid > 0) $facturefournstatic->type = $obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; - } - elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) + } elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) { print ''; $facturefournstatic->id = $obj->fk_invoice_supplier_source; @@ -1036,8 +1009,7 @@ if ($socid > 0) $facturefournstatic->type = $obj->type; print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; - } - else { + } else { print ''; print $obj->description; print ''; @@ -1065,8 +1037,7 @@ if ($socid > 0) print ''; $i++; } - } - else { + } else { $colspan = 8; if (!empty($conf->multicurrency->enabled)) $colspan += 2; print ''.$langs->trans("None").''; @@ -1074,8 +1045,7 @@ if ($socid > 0) print ""; print '
'; - } - else { + } else { dol_print_error($db); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2dfb0b67c6e..a8544c94b70 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -154,8 +154,7 @@ if (empty($reshook)) if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); - } - else { + } else { if ($object->id > 0) { // Because createFromClone modifies the object, we must clone it so that we can restore it later @@ -166,8 +165,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $object = $orig; $action = ''; @@ -185,8 +183,7 @@ if (empty($reshook)) if ($result > 0) { setEventMessages($langs->trans('OrderReopened', $object->ref), null); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -200,8 +197,7 @@ if (empty($reshook)) { header('Location: list.php?restore_lastsearch_values=1'); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -230,8 +226,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -497,17 +492,14 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - } - - elseif ($action == 'classifybilled' && $usercancreate) + } elseif ($action == 'classifybilled' && $usercancreate) { $ret = $object->classifyBilled($user); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - } - elseif ($action == 'classifyunbilled' && $usercancreate) + } elseif ($action == 'classifyunbilled' && $usercancreate) { $ret = $object->classifyUnBilled(); if ($ret < 0) { @@ -522,17 +514,13 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'setremise' && $usercancreate) { + } elseif ($action == 'setremise' && $usercancreate) { $result = $object->set_remise($user, GETPOST('remise')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'setabsolutediscount' && $usercancreate) { + } elseif ($action == 'setabsolutediscount' && $usercancreate) { if (GETPOST('remise_id')) { if ($object->id > 0) { $object->insert_discount(GETPOST('remise_id')); @@ -540,9 +528,7 @@ if (empty($reshook)) dol_print_error($db, $object->error); } } - } - - elseif ($action == 'setdate' && $usercancreate) { + } elseif ($action == 'setdate' && $usercancreate) { // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; $date = dol_mktime(0, 0, 0, GETPOST('order_month'), GETPOST('order_day'), GETPOST('order_year')); @@ -550,9 +536,7 @@ if (empty($reshook)) if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'setdate_livraison' && $usercancreate) { + } elseif ($action == 'setdate_livraison' && $usercancreate) { // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); @@ -560,9 +544,7 @@ if (empty($reshook)) if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'setmode' && $usercancreate) { + } elseif ($action == 'setmode' && $usercancreate) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); @@ -576,21 +558,15 @@ if (empty($reshook)) // Multicurrency rate elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); - } - - elseif ($action == 'setavailability' && $usercancreate) { + } elseif ($action == 'setavailability' && $usercancreate) { $result = $object->availability(GETPOST('availability_id')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); - } - - elseif ($action == 'setdemandreason' && $usercancreate) { + } elseif ($action == 'setdemandreason' && $usercancreate) { $result = $object->demand_reason(GETPOST('demand_reason_id')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); - } - - elseif ($action == 'setconditions' && $usercancreate) { + } elseif ($action == 'setconditions' && $usercancreate) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); if ($result < 0) { dol_print_error($db, $object->error); @@ -643,13 +619,9 @@ if (empty($reshook)) if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'setremisepercent' && $usercancreate) { + } elseif ($action == 'setremisepercent' && $usercancreate) { $result = $object->set_remise($user, GETPOST('remise_percent')); - } - - elseif ($action == 'setremiseabsolue' && $usercancreate) { + } elseif ($action == 'setremiseabsolue' && $usercancreate) { $result = $object->set_remise_absolue($user, GETPOST('remise_absolue')); } @@ -669,8 +641,7 @@ if (empty($reshook)) { $idprod = 0; $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - } - else { + } else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -718,8 +689,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } - else { + } else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error++; } @@ -787,8 +757,7 @@ if (empty($reshook)) $tva_npr = $prodcustprice->lines[0]->recuperableonly; if (empty($tva_tx)) $tva_npr = 0; } - } - else { + } else { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } } @@ -808,8 +777,7 @@ if (empty($reshook)) if ($priceforthequantityarray['price_base_type'] == 'HT') { $pu_ht = $priceforthequantityarray['unitprice']; - } - else { + } else { $pu_ttc = $priceforthequantityarray['unitprice']; } // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. @@ -832,8 +800,7 @@ if (empty($reshook)) if ($priceforthequantityarray['price_base_type'] == 'HT') { $pu_ht = $priceforthequantityarray['unitprice']; - } - else { + } else { $pu_ttc = $priceforthequantityarray['unitprice']; } // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. @@ -1146,9 +1113,7 @@ if (empty($reshook)) } elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit(); - } - - elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) + } elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { $idwarehouse = GETPOST('idwarehouse'); @@ -1156,8 +1121,7 @@ if (empty($reshook)) if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); - } - else { + } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } @@ -1192,8 +1156,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1207,8 +1170,7 @@ if (empty($reshook)) if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); - } - else { + } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } @@ -1245,16 +1207,12 @@ if (empty($reshook)) } } } - } - - elseif ($action == 'confirm_shipped' && $confirm == 'yes' && $usercanclose) { + } elseif ($action == 'confirm_shipped' && $confirm == 'yes' && $usercanclose) { $result = $object->cloture($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanvalidate) + } elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanvalidate) { $idwarehouse = GETPOST('idwarehouse'); @@ -1262,8 +1220,7 @@ if (empty($reshook)) if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); - } - else { + } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } @@ -1334,8 +1291,7 @@ if (empty($reshook)) { dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'OrderLine'; - } - elseif ($fromElement == 'propal') + } elseif ($fromElement == 'propal') { dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'PropaleLigne'; @@ -1387,8 +1343,7 @@ if (empty($reshook)) } else { $error++; } - } - else { + } else { $error++; } } @@ -1518,12 +1473,10 @@ if ($action == 'create' && $usercancreate) // For compatibility if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; - } - elseif ($element == 'propal') { + } elseif ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; - } - elseif ($element == 'contract') { + } elseif ($element == 'contract') { $element = $subelement = 'contrat'; } @@ -1569,8 +1522,7 @@ if ($action == 'create' && $usercancreate) // Object source contacts list $srccontactslist = $objectsrc->liste_contact(-1, 'external', 1); } - } - else { + } else { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; $fk_account = $soc->fk_account; @@ -1941,8 +1893,7 @@ if ($action == 'create' && $usercancreate) if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); - } - else { + } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } @@ -1972,8 +1923,7 @@ if ($action == 'create' && $usercancreate) if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); - } - else { + } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } @@ -2013,8 +1963,7 @@ if ($action == 'create' && $usercancreate) if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change = $object->hasProductsOrServices(2); - } - else { + } else { $qualified_for_stock_change = $object->hasProductsOrServices(1); } @@ -2368,8 +2317,7 @@ if ($action == 'create' && $usercancreate) if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 2ba223b3866..cc7db3db852 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -223,8 +223,7 @@ class Orders extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve commande list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -569,8 +568,7 @@ class Orders extends DolibarrApi if ($this->commande->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); - } - else { + } else { throw new RestException(500, $this->commande->error); } } @@ -698,7 +696,7 @@ class Orders extends DolibarrApi $result = $this->commande->set_reopen(DolibarrApiAccess::$user); if ($result < 0) { throw new RestException(405, $this->commande->error); - }elseif ($result == 0) { + } elseif ($result == 0) { throw new RestException(304); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3f86ce9de5b..b4abfee0c03 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -406,14 +406,12 @@ class Commande extends CommonOrder if ($numref != "") { return $numref; - } - else { + } else { $this->error = $obj->error; //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); return ""; } - } - else { + } else { print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_NotDefined"); return ""; } @@ -466,8 +464,7 @@ class Commande extends CommonOrder if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); - } - else { + } else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -578,8 +575,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -664,8 +660,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -706,8 +701,7 @@ class Commande extends CommonOrder $result = $this->call_trigger('ORDER_REOPEN', $user); if ($result < 0) $error++; // End call triggers - } - else { + } else { $error++; $this->error = $this->db->lasterror(); dol_print_error($this->db); @@ -720,8 +714,7 @@ class Commande extends CommonOrder $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::set_reopen ".$errmsg, LOG_ERR); @@ -776,13 +769,11 @@ class Commande extends CommonOrder $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -852,8 +843,7 @@ class Commande extends CommonOrder $this->statut = self::STATUS_CANCELED; $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::cancel ".$errmsg, LOG_ERR); @@ -862,8 +852,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -1089,8 +1078,7 @@ class Commande extends CommonOrder $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); @@ -1136,8 +1124,7 @@ class Commande extends CommonOrder //print $objcontact->code.'-'.$objcontact->source.'-'.$objcontact->fk_socpeople."\n"; $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } - } - else dol_print_error($resqlcontact); + } else dol_print_error($resqlcontact); } if (!$error) @@ -1158,20 +1145,17 @@ class Commande extends CommonOrder { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1 * $error; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } } - } - else { + } else { dol_print_error($this->db); $this->db->rollback(); return -1; @@ -1274,8 +1258,7 @@ class Commande extends CommonOrder { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1406,10 +1389,8 @@ class Commande extends CommonOrder $this->valid($user); } return $ret; - } - else return -1; - } - else return -1; + } else return -1; + } else return -1; } @@ -1489,8 +1470,7 @@ class Commande extends CommonOrder if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } $label = trim($label); @@ -1649,20 +1629,17 @@ class Commande extends CommonOrder { $this->db->commit(); return $this->line->id; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->line->error; dol_syslog(get_class($this)."::addline error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; } - } - else { + } else { dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR); return -3; } @@ -1901,13 +1878,11 @@ class Commande extends CommonOrder return -3; } return 1; - } - else { + } else { $this->error = 'Order with id '.$id.' not found sql='.$sql; return 0; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1971,19 +1946,16 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $line->error; $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -2; } @@ -2108,8 +2080,7 @@ class Commande extends CommonOrder $this->db->free($result); return 1; - } - else { + } else { $this->error = $this->db->error(); return -3; } @@ -2172,8 +2143,7 @@ class Commande extends CommonOrder $this->db->free($resql); return $nb; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -2218,8 +2188,7 @@ class Commande extends CommonOrder } $this->db->free($resql); return $num; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -2248,8 +2217,7 @@ class Commande extends CommonOrder { $row = $this->db->fetch_row($resql); return $row[0]; - } - else dol_print_error($this->db); + } else dol_print_error($this->db); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -2335,31 +2303,26 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } - } - else { + } else { $this->db->rollback(); $this->error = $line->error; return -1; } - } - else { + } else { $this->db->rollback(); return 0; } - } - else { + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } - } - else { + } else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -1; } @@ -2418,8 +2381,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2485,8 +2447,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2547,8 +2508,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2557,8 +2517,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { return -2; } } @@ -2611,8 +2570,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2621,8 +2579,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { return -2; } } @@ -2679,12 +2636,10 @@ class Commande extends CommonOrder if ($shortlist == 1) { $ga[$obj->cid] = $obj->ref; - } - elseif ($shortlist == 2) + } elseif ($shortlist == 2) { $ga[$obj->cid] = $obj->ref.' ('.$obj->name.')'; - } - else { + } else { $ga[$i]['id'] = $obj->cid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -2693,8 +2648,7 @@ class Commande extends CommonOrder } } return $ga; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2748,8 +2702,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2758,8 +2711,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error_str = 'Command status do not meet requirement '.$this->statut; dol_syslog(__METHOD__.$error_str, LOG_ERR); $this->error = $error_str; @@ -2818,8 +2770,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2828,8 +2779,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error_str = 'order status do not meet requirement '.$this->statut; dol_syslog(__METHOD__.$error_str, LOG_ERR); $this->error = $error_str; @@ -2885,8 +2835,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2895,8 +2844,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { return -1; } } @@ -2938,8 +2886,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::classifyBilled ".$errmsg, LOG_ERR); @@ -2948,8 +2895,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -2991,8 +2937,7 @@ class Commande extends CommonOrder $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::classifyUnBilled ".$errmsg, LOG_ERR); @@ -3001,8 +2946,7 @@ class Commande extends CommonOrder $this->db->rollback(); return -1 * $error; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -3110,8 +3054,7 @@ class Commande extends CommonOrder if ($price_base_type == 'TTC') { $subprice = $pu_ttc; - } - else { + } else { $subprice = $pu_ht; } $remise = 0; @@ -3214,15 +3157,13 @@ class Commande extends CommonOrder $this->db->commit(); return $result; - } - else { + } else { $this->error = $this->line->error; $this->db->rollback(); return -1; } - } - else { + } else { $this->error = get_class($this)."::updateline Order status makes operation forbidden"; $this->errors = array('OrderStatusMakeOperationForbidden'); return -2; @@ -3316,8 +3257,7 @@ class Commande extends CommonOrder } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -3449,8 +3389,7 @@ class Commande extends CommonOrder { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { $this->error .= ($this->error ? ', '.$errmsg : $errmsg); @@ -3515,8 +3454,7 @@ class Commande extends CommonOrder } return $response; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -3570,38 +3508,31 @@ class Commande extends CommonOrder $labelStatus = $langs->trans('StatusOrderCanceled'); $labelStatusShort = $langs->trans('StatusOrderCanceledShort'); $statusType = 'status9'; - } - elseif ($status == self::STATUS_DRAFT) { + } elseif ($status == self::STATUS_DRAFT) { $labelStatus = $langs->trans('StatusOrderDraft'); $labelStatusShort = $langs->trans('StatusOrderDraftShort'); $statusType = 'status0'; - } - elseif ($status == self::STATUS_VALIDATED) { + } elseif ($status == self::STATUS_VALIDATED) { $labelStatus = $langs->trans('StatusOrderValidated').$billedtext; $labelStatusShort = $langs->trans('StatusOrderValidatedShort').$billedtext; $statusType = 'status1'; - } - elseif ($status == self::STATUS_SHIPMENTONPROCESS) { + } elseif ($status == self::STATUS_SHIPMENTONPROCESS) { $labelStatus = $langs->trans('StatusOrderSentShort').$billedtext; $labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext; $statusType = 'status4'; - } - elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { + } elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderToBill'); $labelStatusShort = $langs->trans('StatusOrderToBillShort'); $statusType = 'status4'; - } - elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { + } elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderProcessed').$billedtext; $labelStatusShort = $langs->trans('StatusOrderProcessed').$billedtext; $statusType = 'status6'; - } - elseif ($status == self::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { + } elseif ($status == self::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->trans('StatusOrderDelivered'); $labelStatusShort = $langs->trans('StatusOrderDelivered'); $statusType = 'status6'; - } - else { + } else { $labelStatus = $langs->trans('Unknown'); $labelStatusShort = ''; $statusType = ''; @@ -3763,8 +3694,7 @@ class Commande extends CommonOrder } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -3838,8 +3768,7 @@ class Commande extends CommonOrder $line->total_ttc = 60; $line->total_tva = 10; $line->remise_percent = 50; - } - else { + } else { $line->total_ht = 100; $line->total_ttc = 120; $line->total_tva = 20; @@ -3897,8 +3826,7 @@ class Commande extends CommonOrder } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4149,8 +4077,7 @@ class OrderLine extends CommonOrderLine $this->db->free($result); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -4236,8 +4163,7 @@ class OrderLine extends CommonOrderLine } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -4282,8 +4208,7 @@ class OrderLine extends CommonOrderLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -4378,8 +4303,7 @@ class OrderLine extends CommonOrderLine } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -4426,8 +4350,7 @@ class OrderLine extends CommonOrderLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -4510,8 +4433,7 @@ class OrderLine extends CommonOrderLine } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -4550,8 +4472,7 @@ class OrderLine extends CommonOrderLine { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index cbb93b940de..5af5fb23060 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -78,8 +78,7 @@ class CommandeStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled - } - elseif ($mode == 'supplier') + } elseif ($mode == 'supplier') { $object = new CommandeFournisseur($this->db); $this->from = MAIN_DB_PREFIX.$object->table_element." as c"; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 4fd050799dc..2d11feeeee2 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -63,14 +63,12 @@ if ($action == 'addcontact' && $user->rights->commande->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -82,8 +80,7 @@ elseif ($action == 'swapstatut' && $user->rights->commande->creer) if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne')); - } - else { + } else { dol_print_error($db); } } @@ -98,8 +95,7 @@ elseif ($action == 'deletecontact' && $user->rights->commande->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } @@ -203,8 +199,7 @@ if ($id > 0 || !empty($ref)) $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); if ($res) break; } - } - else { + } else { // Contact not found print "ErrorRecordNotFound"; } diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 020b1654ac9..f78d6ce2e84 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -184,8 +184,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 516dcd56fc0..27d38378bcb 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -182,12 +182,10 @@ if ($id > 0 || !empty($ref)) $permtoedit = $user->rights->commande->creer; $param = '&id='.$object->id.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity); include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; - } - else { + } else { dol_print_error($db); } -} -else { +} else { header('Location: index.php'); exit; } diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 53f6b20b4f6..96476caeeed 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -173,8 +173,7 @@ if ($resql) //if ($totalinprocess != $total) print ''.$langs->trans("Total").''.$total.''; print "
"; -} -else { +} else { dol_print_error($db); } @@ -231,8 +230,7 @@ if (!empty($conf->commande->enabled)) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("NoOrder").''; } print "
"; @@ -321,8 +319,7 @@ if ($resql) } } print "
"; -} -else dol_print_error($db); +} else dol_print_error($db); $max = 10; @@ -408,8 +405,7 @@ if (!empty($conf->commande->enabled)) } print "
"; - } - else dol_print_error($db); + } else dol_print_error($db); } /* @@ -493,8 +489,7 @@ if (!empty($conf->commande->enabled)) } } print "
"; - } - else dol_print_error($db); + } else dol_print_error($db); } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 088512d6fa2..63c82775ff1 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -395,8 +395,7 @@ if ($resql) $soc->fetch($socid); $title = $langs->trans('ListOfOrders').' - '.$soc->name; if (empty($search_company)) $search_company = $soc->name; - } - else { + } else { $title = $langs->trans('ListOfOrders'); } if (strval($search_status) == '0') @@ -540,8 +539,7 @@ if ($resql) { print $form->selectyesno('validate_invoices', 0, 1, 1); print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; - } - else { + } else { print $form->selectyesno('validate_invoices', 0, 1); } if (!empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) print '     '.$langs->trans("IfValidateInvoiceIsNoOrderStayUnbilled").''; @@ -960,8 +958,7 @@ if ($resql) { $notshippable++; } - } - else { // Detailed code, looks bugged + } else { // Detailed code, looks bugged // stock order and stock order_supplier $stock_order = 0; $stock_order_supplier = 0; @@ -1308,8 +1305,7 @@ if ($resql) $delallowed = $user->rights->commande->creer; print $formfile->showdocuments('massfilesarea_orders', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index cae54d69bbd..c3d82821249 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -83,8 +83,7 @@ if ($action == 'create') { $error++; setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors'); - } - else { + } else { $origin = GETPOST('origin'); $originid = GETPOST('originid'); } @@ -208,8 +207,7 @@ if (($action == 'create' || $action == 'add') && !$error) if ($db->query($sql)) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -254,14 +252,12 @@ if (($action == 'create' || $action == 'add') && !$error) { $result = $object->insert_discount($discountid); //$result=$discount->link_to_invoice($lineid,$id); - } - else { + } else { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; break; } - } - else { + } else { // Positive line $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Date start @@ -316,8 +312,7 @@ if (($action == 'create' || $action == 'add') && !$error) if ($result > 0) { $lineid = $result; - } - else { + } else { $lineid = 0; $error++; break; @@ -329,15 +324,13 @@ if (($action == 'create' || $action == 'add') && !$error) } } } - } - else { + } else { setEventMessages($objectsrc->error, $objectsrc->errors, 'errors'); $error++; } $ii++; } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } @@ -351,8 +344,7 @@ if (($action == 'create' || $action == 'add') && !$error) $db->commit(); header('Location: '.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$id); exit; - } - else { + } else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -721,8 +713,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print ''; $db->free($resql); - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 35f9f60020c..0910e4ee7ad 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -114,8 +114,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filenamenb = $dir.'/ordersnbinyear-'.$year.'.png'; if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$year.'.png'; @@ -156,8 +155,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filenameamount = $dir.'/ordersamountinyear-'.$year.'.png'; if ($mode == 'customer') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png'; @@ -196,8 +194,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; @@ -378,8 +375,7 @@ print '
'; // Show graphs print ''; - } - else { + } else { // Sort array by date ASC to calculate balance $totalET_debit = 0; diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index 05f89e1bc6f..767c8f8709b 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -138,12 +138,10 @@ if ($id > 0 || !empty($ref)) { $moreparam = '&num='.urlencode($num); ; $relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($num)."/"; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; - } - else { + } else { dol_print_error($db); } -} -else { +} else { Header('Location: index.php'); exit; } diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 51d838878b8..72a7e33d3f2 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -50,8 +50,7 @@ if (!$year_start) { $year_start = $year_current - 2; $year_end = $year_current; -} -else { +} else { $year_end = $year_start + 2; } @@ -106,8 +105,7 @@ if ($resql) $encaiss[$row[1]] = $row[0]; $i++; } -} -else { +} else { dol_print_error($db); } @@ -133,8 +131,7 @@ if ($resql) $decaiss[$row[1]] = -$row[0]; $i++; } -} -else { +} else { dol_print_error($db); } @@ -154,8 +151,7 @@ if (!empty($id)) if (!preg_match('/,/', $id)) { dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - } - else { + } else { $bankaccount = new Account($db); $listid = explode(',', $id); foreach ($listid as $key => $aId) @@ -166,8 +162,7 @@ if (!empty($id)) if ($key < (count($listid) - 1)) print ', '; } } -} -else { +} else { print $langs->trans("AllAccounts"); } @@ -252,8 +247,7 @@ if ($resql) { $obj = $db->fetch_object($resql); if ($obj) $balance = $obj->total; -} -else { +} else { dol_print_error($db); } @@ -275,8 +269,7 @@ if ($result < 0) $langs->load("errors"); $error++; setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); -} -else { +} else { // Calcul de $min et $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -292,8 +285,7 @@ else { $obj = $db->fetch_object($resql); $min = $db->jdate($obj->min); $max = $db->jdate($obj->max); - } - else { + } else { dol_print_error($db); } $log = "graph.php: min=".$min." max=".$max; @@ -331,8 +323,7 @@ else { $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -417,8 +408,7 @@ else { $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index d5fb533016e..c5ded35cb51 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -68,8 +68,7 @@ if ($fielvalue) { if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype); -} -else { +} else { if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque'); } @@ -240,14 +239,12 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' } } } - } - else { + } else { $error++; $langs->load("errors"); setEventMessages($langs->trans("NoRecordSelected"), null, 'errors'); } - } - else { + } else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors'); @@ -283,8 +280,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) if (price2num($_POST["addcredit"]) > 0) { $amount = price2num($_POST["addcredit"]); - } - else { + } else { $amount = - price2num($_POST["adddebit"]); } @@ -333,12 +329,10 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : '')); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $action = 'addline'; } } @@ -462,8 +456,7 @@ if ($id > 0 || !empty($ref)) } } } -} -else { +} else { llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); } @@ -667,8 +660,7 @@ if ($resql) if ($numr >= $nbmax) $liste = "...   ".$liste; print $liste; if ($numr <= 0) print ''.$langs->trans("None").''; - } - else { + } else { dol_print_error($db); } @@ -784,13 +776,11 @@ if ($resql) if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); - } - else // If direct entries is not done using miscellaneous payments + } else // If direct entries is not done using miscellaneous payments { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier); } - } - else { + } else { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1); } } @@ -1036,8 +1026,7 @@ if ($resql) $balance = $objforbalance->previoustotal; } } - } - else dol_print_error($db); + } else dol_print_error($db); $balancecalculated = true; @@ -1118,8 +1107,7 @@ if ($resql) { $balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc) $balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT'); - } - else { + } else { $balancebefore = price2num($balance, 'MT'); // balancebefore = balance of previous line (sort is asc) $balance = price2num($balance + ($sign * $objp->amount), 'MT'); } @@ -1130,8 +1118,7 @@ if ($resql) $bankaccounttmp->fetch($objp->bankid); $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; - } - else { + } else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -1195,63 +1182,53 @@ if ($resql) $banktransferstatic->id = $links[$key]['url_id']; $banktransferstatic->ref = $links[$key]['label']; print ' '.$banktransferstatic->getNomUrl(0); - } - elseif ($links[$key]['type'] == 'payment') + } elseif ($links[$key]['type'] == 'payment') { $paymentstatic->id = $links[$key]['url_id']; $paymentstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment print ' '.$paymentstatic->getNomUrl(2); - } - elseif ($links[$key]['type'] == 'payment_supplier') + } elseif ($links[$key]['type'] == 'payment_supplier') { $paymentsupplierstatic->id = $links[$key]['url_id']; $paymentsupplierstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment print ' '.$paymentsupplierstatic->getNomUrl(2); - } - elseif ($links[$key]['type'] == 'payment_sc') + } elseif ($links[$key]['type'] == 'payment_sc') { print ''; print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; //print $langs->trans("SocialContributionPayment"); print ''; - } - elseif ($links[$key]['type'] == 'payment_vat') + } elseif ($links[$key]['type'] == 'payment_vat') { $paymentvatstatic->id = $links[$key]['url_id']; $paymentvatstatic->ref = $links[$key]['url_id']; print ' '.$paymentvatstatic->getNomUrl(2); - } - elseif ($links[$key]['type'] == 'payment_salary') + } elseif ($links[$key]['type'] == 'payment_salary') { $paymentsalstatic->id = $links[$key]['url_id']; $paymentsalstatic->ref = $links[$key]['url_id']; print ' '.$paymentsalstatic->getNomUrl(2); - } - elseif ($links[$key]['type'] == 'payment_loan') + } elseif ($links[$key]['type'] == 'payment_loan') { print ''; print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; print ''; - } - elseif ($links[$key]['type'] == 'payment_donation') + } elseif ($links[$key]['type'] == 'payment_donation') { print ''; print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; print ''; - } - elseif ($links[$key]['type'] == 'payment_expensereport') + } elseif ($links[$key]['type'] == 'payment_expensereport') { $paymentexpensereportstatic->id = $links[$key]['url_id']; $paymentexpensereportstatic->ref = $links[$key]['url_id']; print ' '.$paymentexpensereportstatic->getNomUrl(2); - } - elseif ($links[$key]['type'] == 'payment_various') + } elseif ($links[$key]['type'] == 'payment_various') { $paymentvariousstatic->id = $links[$key]['url_id']; $paymentvariousstatic->ref = $links[$key]['url_id']; print ' '.$paymentvariousstatic->getNomUrl(2); - } - elseif ($links[$key]['type'] == 'banktransfert') + } elseif ($links[$key]['type'] == 'banktransfert') { // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. if ($objp->amount > 0) @@ -1266,8 +1243,7 @@ if ($resql) $bankstatic->label = $objp->bankref; print $bankstatic->getNomUrl(1, ''); print ')'; - } - else { + } else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("TransferFrom").' '; @@ -1280,20 +1256,15 @@ if ($resql) print ')'; } //var_dump($links); - } - elseif ($links[$key]['type'] == 'company') + } elseif ($links[$key]['type'] == 'company') { - } - elseif ($links[$key]['type'] == 'user') + } elseif ($links[$key]['type'] == 'user') { - } - elseif ($links[$key]['type'] == 'member') + } elseif ($links[$key]['type'] == 'member') { - } - elseif ($links[$key]['type'] == 'sc') + } elseif ($links[$key]['type'] == 'sc') { - } - else { + } else { // Show link with label $links[$key]['label'] if (!empty($objp->label) && !empty($links[$key]['label'])) print ' - '; print ''; @@ -1302,8 +1273,7 @@ if ($resql) // Label generique car entre parentheses. On l'affiche en le traduisant if ($reg[1] == 'paiement') $reg[1] = 'Payment'; print ' '.$langs->trans($reg[1]); - } - else { + } else { print ' '.$links[$key]['label']; } print ''; @@ -1380,8 +1350,7 @@ if ($resql) $companystatic->code_compta = $objp->code_compta; $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; print $companystatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -1433,12 +1402,10 @@ if ($resql) if ($balancebefore >= 0) { print ''; - } - else { + } else { print ''; } - } - else { + } else { print ''; } if (!$i) $totalarray['nbfield']++; @@ -1451,12 +1418,10 @@ if ($resql) if ($balance >= 0) { print ''; - } - else { + } else { print ''; } - } - else { + } else { print ''; } if (!$i) $totalarray['nbfield']++; @@ -1502,15 +1467,13 @@ if ($resql) print ''; print img_edit(); print ''; - } - else { + } else { if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { print ''; print img_edit(); print ''; - } - else { + } else { print ''; print img_view(); print ''; @@ -1560,16 +1523,14 @@ if ($resql) { if ($num < $limit && empty($offset)) print ''; else print ''; - } - elseif ($totalarray['totaldebfield'] == $i) print ''; + } elseif ($totalarray['totaldebfield'] == $i) print ''; elseif ($totalarray['totalcredfield'] == $i) print ''; elseif ($i == $posconciliatecol) { print ''; - } - else print ''; + } else print ''; } print ''; } @@ -1587,8 +1548,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 3a15ddf72e1..8559096477d 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -89,8 +89,7 @@ if ($result) print ''; print ''; print ''; -} -else { +} else { dol_print_error($db); } print "
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { print $px1->show(); print "
\n"; print $px2->show(); diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index b14e3adafad..0c20e46e316 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -334,8 +334,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $nofile['sens'] = $objd->sens; $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; - } - else { + } else { foreach ($files as $key => $file) { $file['id'] = $objd->id; @@ -382,14 +381,12 @@ if (($action == 'searchfiles' || $action == 'dl')) { $i++; } - } - else { + } else { dol_print_error($db); } $db->free($resd); - } - else { + } else { setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'errors'); $error++; } @@ -489,8 +486,7 @@ if ($result && $action == "dl" && !$error) dol_delete_file($zipname); exit(); - } - else { + } else { setEventMessages($langs->trans("FailedToOpenFile", $zipname), null, 'errors'); } } @@ -622,8 +618,7 @@ if (!empty($date_start) && !empty($date_stop)) if (empty($TData)) { print '
'.$langs->trans("NoItem").'
 '.price($balancebefore).' '.price($balancebefore).'- '.price($balance).' '.price($balance).'-'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price(-1 * $totalarray['totaldeb']).''.price(-1 * $totalarray['totaldeb']).''.price($totalarray['totalcred']).''; if ($user->rights->banque->consolidate && $action == 'reconcile') print ''; print '
'.$langs->trans("Total").''.price($total).''.price($totalnb ?price2num($total / $totalnb, 'MT') : 0).'
"; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 3af40ffb2a0..3771d010f4f 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -99,8 +99,7 @@ if ($action == 'add') if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; - } - else { + } else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int'); @@ -154,8 +153,7 @@ if ($action == 'add') $_GET["id"] = $id; // Force chargement page en mode visu $action = ''; - } - else { + } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); @@ -166,8 +164,7 @@ if ($action == 'add') if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -203,8 +200,7 @@ if ($action == 'update') if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; - } - else { + } else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int'); @@ -256,8 +252,7 @@ if ($action == 'update') $object->setCategories($categories); $_GET["id"] = $_POST["id"]; // Force chargement page en mode visu - } - else { + } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; // Force chargement page edition @@ -267,8 +262,7 @@ if ($action == 'update') if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -285,8 +279,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights-> setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); header("Location: ".DOL_URL_ROOT."/compta/bank/list.php"); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -377,8 +370,7 @@ if ($action == 'create') if (isset($_POST["account_country_id"])) { $selectedcode = $_POST["account_country_id"] ? $_POST["account_country_id"] : $object->country_code; - } - elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code; + } elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code; $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''.$langs->trans("BankAccountCountry").''; @@ -392,8 +384,7 @@ if ($action == 'create') if ($selectedcode) { $formcompany->select_departement(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : '', $selectedcode, 'account_state_id'); - } - else { + } else { print $countrynotdefined; } print ''; @@ -537,8 +528,7 @@ if ($action == 'create') print ''; print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1); print ''; - } - else { + } else { print ''.$langs->trans("AccountancyCode").''; print 'account_number).'">'; } @@ -877,8 +867,7 @@ else { if ($selectedcode) { print $formcompany->select_state(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : $object->state_id, $selectedcode, 'account_state_id'); - } - else { + } else { print $countrynotdefined; } print ''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index b7bbb4d157e..0f71134d08a 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -132,8 +132,7 @@ if ($result) print ''; print ''; print ""; - } - else { + } else { print "".$objp->label.""; print ''; print ''.img_edit().''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index cae83563b42..adb170ee81d 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -343,9 +343,9 @@ class Account extends CommonObject $string .= $this->code_guichet.' '; } elseif ($val == 'BankAccountNumberKey') { $string .= $this->cle_rib.' '; - }elseif ($val == 'BIC') { + } elseif ($val == 'BIC') { $string .= $this->bic.' '; - }elseif ($val == 'IBAN') { + } elseif ($val == 'IBAN') { $string .= $this->iban.' '; } } @@ -403,8 +403,7 @@ class Account extends CommonObject { $rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_url"); return $rowid; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -436,8 +435,7 @@ class Account extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."bank_url"; if ($fk_bank > 0) { $sql .= " WHERE fk_bank = ".$fk_bank; - } - else { $sql .= " WHERE url_id = ".$url_id." AND type = '".$type."'"; + } else { $sql .= " WHERE url_id = ".$url_id." AND type = '".$type."'"; } $sql .= " ORDER BY type, label"; @@ -463,8 +461,7 @@ class Account extends CommonObject $lines[$i]['fk_bank'] = $obj->fk_bank; $i++; } - } - else dol_print_error($this->db); + } else dol_print_error($this->db); return $lines; } @@ -508,8 +505,7 @@ class Account extends CommonObject { $obj = $this->db->fetch_object($resql); $oper = $obj->code; - } - else { + } else { dol_print_error($this->db, 'Failed to get payment type code'); return -1; } @@ -718,18 +714,15 @@ class Account extends CommonObject if ($result < 0) $error++; // End call triggers } - } - else { + } else { $error++; } - } - else { + } else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $langs->trans("ErrorBankLabelAlreadyExists"); $error++; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $error++; } @@ -739,8 +732,7 @@ class Account extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1 * $error; } @@ -831,8 +823,7 @@ class Account extends CommonObject if ($result < 0) $error++; // End call triggers } - } - else { + } else { $error++; $this->error = $this->db->lasterror(); dol_print_error($this->db); @@ -842,8 +833,7 @@ class Account extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1 * $error; } @@ -900,8 +890,7 @@ class Account extends CommonObject if ($result) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); dol_print_error($this->db); return -1; @@ -998,12 +987,10 @@ class Account extends CommonObject $this->fetch_optionals(); return 1; - } - else { + } else { return 0; } - } - else { + } else { $this->error = $this->db->lasterror; $this->errors[] = $this->error; return -1; @@ -1103,8 +1090,7 @@ class Account extends CommonObject dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } } - } - else { + } else { $error++; $this->error = "Error ".$this->db->lasterror(); } @@ -1114,8 +1100,7 @@ class Account extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1180,8 +1165,7 @@ class Account extends CommonObject if ($resql) { $obj = $this->db->fetch_object($resql); if ($obj->nb <= 1) $can_be_deleted = true; // Juste le solde - } - else { + } else { dol_print_error($this->db); } return $can_be_deleted; @@ -1279,8 +1263,7 @@ class Account extends CommonObject } return $response; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -1317,8 +1300,7 @@ class Account extends CommonObject $this->nb["banklines"] = $obj->nb; } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -1352,8 +1334,7 @@ class Account extends CommonObject { $obj = $db->fetch_object($resql); $nb = $obj->nb; - } - else dol_print_error($db); + } else dol_print_error($db); return $nb; } @@ -1400,8 +1381,7 @@ class Account extends CommonObject if ($mode == 'transactions') { $url = DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$this->id; - } - elseif ($mode == 'receipts') + } elseif ($mode == 'receipts') { $url = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id; } @@ -1461,8 +1441,7 @@ class Account extends CommonObject if ($this->error_number == 0) { return 1; - } - else { + } else { return 0; } } @@ -1881,8 +1860,7 @@ class AccountLine extends CommonObject } $this->db->free($result); return $ret; - } - else { + } else { return -1; } } @@ -1969,8 +1947,7 @@ class AccountLine extends CommonObject $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1998,8 +1975,7 @@ class AccountLine extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -$nbko; } @@ -2036,8 +2012,7 @@ class AccountLine extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -$nbko; } @@ -2067,8 +2042,7 @@ class AccountLine extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); $this->error = $this->db->error(); return -1; @@ -2132,8 +2106,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -2169,13 +2142,11 @@ class AccountLine extends CommonObject { return 1; } - } - else { + } else { dol_print_error($this->db); return 0; } - } - else dol_print_error($this->db); + } else dol_print_error($this->db); return 0; } @@ -2235,13 +2206,11 @@ class AccountLine extends CommonObject { return 1; } - } - else { + } else { dol_print_error($this->db); return 0; } - } - else dol_print_error($this->db); + } else dol_print_error($this->db); return 0; } @@ -2311,8 +2280,7 @@ class AccountLine extends CommonObject //$this->date_rappro = $obj->daterappro; // Not yet managed } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -2453,8 +2421,7 @@ class AccountLine extends CommonObject { $alreadydispatched = $obj->nb; } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 6943d2bc5e1..3293f746033 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -225,8 +225,7 @@ class BankAccounts extends DolibarrApi if ($accountto->currency_code == $accountfrom->currency_code) { $amount_to = $amount; - } - else { + } else { if (!$amount_to || empty($amount_to)) { throw new RestException(422, 'You must provide amount_to value since bankaccount_from and bankaccount_to does not share the same currency.'); @@ -302,8 +301,7 @@ class BankAccounts extends DolibarrApi 'message' => 'Internal wire transfer created successfully.' ) ); - } - else { + } else { $this->db->rollback(); throw new RestException(500, $accountfrom->error.' '.$accountto->error); } @@ -336,8 +334,7 @@ class BankAccounts extends DolibarrApi if ($account->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); - } - else { + } else { throw new RestException(500, $account->error); } } diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index ec88fea3f84..65c7e7ce2ea 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -169,8 +169,7 @@ class PaymentVarious extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -243,8 +242,7 @@ class PaymentVarious extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -428,8 +426,7 @@ class PaymentVarious extends CommonObject if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); - } - else { + } else { $this->error = $acc->error; $error++; } @@ -458,20 +455,17 @@ class PaymentVarious extends CommonObject $result = $this->call_trigger('PAYMENT_VARIOUS_CREATE', $user); if ($result < 0) $error++; // End call triggers - } - else $error++; + } else $error++; if (!$error) { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -494,8 +488,7 @@ class PaymentVarious extends CommonObject if ($result) { return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -529,30 +522,25 @@ class PaymentVarious extends CommonObject 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'); @@ -610,8 +598,7 @@ class PaymentVarious extends CommonObject $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; */ - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -670,8 +657,7 @@ class PaymentVarious extends CommonObject $this->date_modif = $this->db->jdate($obj->tms); } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -698,8 +684,7 @@ class PaymentVarious extends CommonObject { $alreadydispatched = $obj->nb; } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index d003463e5af..09cd81d4198 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -137,12 +137,10 @@ if ($id > 0 || !empty($ref)) { $permtoedit = $user->rights->banque->modifier; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; - } - else { + } else { dol_print_error($db); } -} -else { +} else { Header('Location: index.php'); exit; } diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 796529a24d9..296211bf35c 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -84,8 +84,7 @@ if ($result < 0) $langs->load("errors"); $error++; setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); -} -else { +} else { // Calcul $min and $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -101,8 +100,7 @@ else { $obj = $db->fetch_object($resql); $min = $db->jdate($obj->min); $max = $db->jdate($obj->max); - } - else { + } else { dol_print_error($db); } if (empty($min)) $min = dol_now() - 3600 * 24; @@ -149,8 +147,7 @@ else { $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -171,8 +168,7 @@ else { $row = $db->fetch_row($resql); $solde = $row[0]; $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -195,8 +191,7 @@ else { if ($day > time()) { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph - } - else { + } else { $datas[$i] = $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -289,8 +284,7 @@ else { $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -311,8 +305,7 @@ else { $row = $db->fetch_row($resql); $solde = $row[0]; $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -336,8 +329,7 @@ else { if ($day > $now) { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph - } - else { + } else { $datas[$i] = $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -423,8 +415,7 @@ else { $amounts[$row[0]] = $row[1]; $i++; } - } - else { + } else { dol_print_error($db); } @@ -450,8 +441,7 @@ else { if ($day > ($max + 86400)) { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph - } - else { + } else { $datas[$i] = 0 + $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -547,8 +537,7 @@ else { $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -580,8 +569,7 @@ else { $debits[$row[0]] = abs($row[1]); } $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -662,8 +650,7 @@ else { $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } $sql = "SELECT date_format(b.datev,'%m')"; @@ -686,8 +673,7 @@ else { $debits[$row[0]] = abs($row[1]); } $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -756,14 +742,12 @@ if ($account) { $morehtml = ''.$langs->trans("ShowAllAccounts").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam, 0, '', '', 1); - } - else { + } else { $morehtml = ''.$langs->trans("BackToAccount").''; print $langs->trans("AllAccounts"); //print $morehtml; } - } - else { + } else { $bankaccount = new Account($db); $listid = explode(',', $account); foreach ($listid as $key => $id) @@ -774,8 +758,7 @@ if ($account) if ($key < (count($listid) - 1)) print ', '; } } -} -else { +} else { print $langs->trans("AllAccounts"); } @@ -791,8 +774,7 @@ if ($mode == 'showalltime') print ''; print $langs->trans("GoBack"); print ''; -} -else { +} else { print ''; print $langs->trans("ShowAllTimeBalance"); print ''; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index a1c37d59050..d2b3e6099dd 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -76,15 +76,15 @@ if ($user->rights->banque->consolidate && $action == 'donext') { $al = new AccountLine($db); $al->dateo_next($_GET["rowid"]); -}elseif ($user->rights->banque->consolidate && $action == 'doprev') +} elseif ($user->rights->banque->consolidate && $action == 'doprev') { $al = new AccountLine($db); $al->dateo_previous($_GET["rowid"]); -}elseif ($user->rights->banque->consolidate && $action == 'dvnext') +} elseif ($user->rights->banque->consolidate && $action == 'dvnext') { $al = new AccountLine($db); $al->datev_next($_GET["rowid"]); -}elseif ($user->rights->banque->consolidate && $action == 'dvprev') +} elseif ($user->rights->banque->consolidate && $action == 'dvprev') { $al = new AccountLine($db); $al->datev_previous($_GET["rowid"]); @@ -99,8 +99,7 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->ban { dol_print_error($db); } - } - else { + } else { setEventMessages($langs->trans("MissingIds"), null, 'errors'); } } @@ -119,8 +118,7 @@ if ($user->rights->banque->modifier && $action == "update") if (GETPOST('accountid', 'int') > 0 && !$acline->rappro && !$acline->getVentilExportCompta()) // We ask to change bank account { $actarget->fetch(GETPOST('accountid', 'int')); - } - else { + } else { $actarget->fetch($id); } @@ -189,8 +187,7 @@ if ($user->rights->banque->modifier && $action == "update") { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -226,8 +223,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -320,8 +316,7 @@ if ($result) if (!$objp->rappro && !$bankline->getVentilExportCompta()) { $form->select_comptes($acct->id, 'accountid', 0, '', 0); - } - else { + } else { print $acct->getNomUrl(1, 'transactions', 'reflabel'); } print ''; @@ -345,8 +340,7 @@ if ($result) print $langs->trans("Payment"); print '';*/ print $paymenttmp->getNomUrl(1); - } - elseif ($links[$key]['type'] == 'payment_supplier') { + } elseif ($links[$key]['type'] == 'payment_supplier') { require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; $paymenttmp = new PaiementFourn($db); $paymenttmp->fetch($links[$key]['url_id']); @@ -356,79 +350,66 @@ if ($result) print $langs->trans("Payment"); print '';*/ print $paymenttmp->getNomUrl(1); - } - elseif ($links[$key]['type'] == 'company') { + } elseif ($links[$key]['type'] == 'company') { $societe = new Societe($db); $societe->fetch($links[$key]['url_id']); print $societe->getNomUrl(1); - } - elseif ($links[$key]['type'] == 'sc') { + } elseif ($links[$key]['type'] == 'sc') { print ''; print img_object($langs->trans('SocialContribution'), 'bill').' '; print $langs->trans("SocialContribution").($links[$key]['label'] ? ' - '.$links[$key]['label'] : ''); print ''; - } - elseif ($links[$key]['type'] == 'payment_sc') { + } elseif ($links[$key]['type'] == 'payment_sc') { print ''; print img_object($langs->trans('Payment'), 'payment').' '; print $langs->trans("SocialContributionPayment"); print ''; - } - elseif ($links[$key]['type'] == 'payment_vat') { + } elseif ($links[$key]['type'] == 'payment_vat') { print ''; print img_object($langs->trans('VAT'), 'payment').' '; print $langs->trans("VATPayment"); print ''; - } - elseif ($links[$key]['type'] == 'payment_salary') { + } elseif ($links[$key]['type'] == 'payment_salary') { print ''; print img_object($langs->trans('PaymentSalary'), 'payment').' '; print $langs->trans("SalaryPayment"); print ''; - } - elseif ($links[$key]['type'] == 'payment_loan') { + } elseif ($links[$key]['type'] == 'payment_loan') { print ''; print img_object($langs->trans('LoanPayment'), 'payment').' '; print $langs->trans("PaymentLoan"); print ''; - } - elseif ($links[$key]['type'] == 'loan') { + } elseif ($links[$key]['type'] == 'loan') { print ''; print img_object($langs->trans('Loan'), 'bill').' '; print $langs->trans("Loan"); print ''; - } - elseif ($links[$key]['type'] == 'member') { + } elseif ($links[$key]['type'] == 'member') { print ''; print img_object($langs->trans('Member'), 'user').' '; print $links[$key]['label']; print ''; - } - elseif ($links[$key]['type'] == 'payment_donation') { + } elseif ($links[$key]['type'] == 'payment_donation') { print ''; print img_object($langs->trans('Donation'), 'payment').' '; print $langs->trans("DonationPayment"); print ''; - } - elseif ($links[$key]['type'] == 'banktransfert') { + } elseif ($links[$key]['type'] == 'banktransfert') { print ''; print img_object($langs->trans('Transaction'), 'payment').' '; print $langs->trans("TransactionOnTheOtherAccount"); print ''; - } - elseif ($links[$key]['type'] == 'user') { + } elseif ($links[$key]['type'] == 'user') { print ''; print img_object($langs->trans('User'), 'user').' '; print $langs->trans("User"); print ''; - } - elseif ($links[$key]['type'] == 'payment_various') { + } elseif ($links[$key]['type'] == 'payment_various') { print ''; print img_object($langs->trans('VariousPayment'), 'payment').' '; print $langs->trans("VariousPayment"); print ''; - } - else { + } else { print ''; print img_object('', 'generic').' '; print $links[$key]['label']; @@ -458,8 +439,7 @@ if ($result) print '     '.$langs->trans("CheckReceipt").': '.$receipt->getNomUrl(2); } print ''; - } - else { + } else { print ''.$objp->fk_type.' '.$objp->num_chq.''; } print ""; @@ -473,8 +453,7 @@ if ($result) print ''; print ''; print ''; - } - else { + } else { print ''.$objp->emetteur.''; } print ""; @@ -488,8 +467,7 @@ if ($result) print ''; print ''; print ''; - } - else { + } else { print ''.$objp->banque.''; } print ""; @@ -509,8 +487,7 @@ if ($result) print img_edit_add().""; } print ''; - } - else { + } else { print ''; print dol_print_date($db->jdate($objp->do), "day"); print ''; @@ -532,8 +509,7 @@ if ($result) print img_edit_add().""; } print ''; - } - else { + } else { print ''; print dol_print_date($db->jdate($objp->dv), "day"); print ''; @@ -550,21 +526,18 @@ if ($result) { // Label generique car entre parentheses. On l'affiche en le traduisant print $langs->trans($reg[1]); - } - else { + } else { print $objp->label; } print '">'; print ''; - } - else { + } else { print ''; if (preg_match('/^\((.*)\)$/i', $objp->label, $reg)) { // Label generique car entre parentheses. On l'affiche en le traduisant print $langs->trans($reg[1]); - } - else { + } else { print $objp->label; } print ''; @@ -578,8 +551,7 @@ if ($result) print ''; print 'rappro ? ' disabled' : '').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$acct->currency_code); print ''; - } - else { + } else { print ''; print price($objp->amount); print ''; @@ -635,14 +607,12 @@ if ($result) { print $langs->trans("AccountStatement").' rappro ? ' disabled' : '').'>'; print ''; - } - else { + } else { print $langs->trans("AccountStatement").' rappro ? ' disabled' : '').'>'; } if ($objp->num_releve) print '   ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; print ''; - } - else { + } else { print ''.$objp->num_releve.' '; } print ''; @@ -653,8 +623,7 @@ if ($result) print ''; print 'rappro ? ' checked="checked"' : '')).'">'; print ''; - } - else { + } else { print ''.yn($objp->rappro).''; } print ''; @@ -677,8 +646,7 @@ if ($result) } $db->free($result); -} -else dol_print_error($db); +} else dol_print_error($db); // End of page llxFooter(); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index bc45c708f33..882244518f7 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -212,8 +212,7 @@ if ($resql) $i++; } $db->free($resql); -} -else dol_print_error($db); +} else dol_print_error($db); @@ -487,8 +486,7 @@ foreach ($accounts as $key=>$type) $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $objecttmp->account_number, 1); print $accountingaccount->getNomUrl(0, 1, 1, '', 1); - } - else { + } else { print $objecttmp->account_number; } print ''; @@ -504,8 +502,7 @@ foreach ($accounts as $key=>$type) $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objecttmp->fk_accountancy_journal); print $accountingjournal->getNomUrl(0, 1, 1, '', 1); - } - else { + } else { print ''; } print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 65476665963..4244856c9ab 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -125,8 +125,7 @@ if ($_GET["rel"] == 'prev') $found = true; } } -} -elseif ($_GET["rel"] == 'next') +} elseif ($_GET["rel"] == 'next') { // Recherche valeur pour num = numero releve precedent $sql = "SELECT DISTINCT(b.num_releve) as num"; @@ -147,8 +146,7 @@ elseif ($_GET["rel"] == 'next') $found = true; } } -} -else { +} else { // On veut le releve num $found = true; } @@ -295,15 +293,13 @@ if (empty($numref)) if (!isset($objp->numr)) { // - } - else { + } else { print ''; print ''; if ($action != 'editbankreceipt' || $objp->numr != $brref) { print ''.$objp->numr.''; - } - else { + } else { print ''; print ''; print ''; @@ -353,12 +349,10 @@ if (empty($numref)) print ''; print "\n
\n"; - } - else { + } else { dol_print_error($db); } -} -else { +} else { /** * Show list of record into a bank statement */ @@ -484,58 +478,50 @@ else { $paymentstatic->ref = $langs->trans("Payment"); print ' '.$paymentstatic->getNomUrl(1); $newline = 0; - } - elseif ($links[$key]['type'] == 'payment_supplier') + } elseif ($links[$key]['type'] == 'payment_supplier') { $paymentsupplierstatic->id = $links[$key]['url_id']; $paymentsupplierstatic->ref = $langs->trans("Payment"); print ' '.$paymentsupplierstatic->getNomUrl(1); $newline = 0; - } - elseif ($links[$key]['type'] == 'payment_sc') + } elseif ($links[$key]['type'] == 'payment_sc') { print ''; print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; print $langs->trans("SocialContributionPayment"); print ''; $newline = 0; - } - elseif ($links[$key]['type'] == 'payment_vat') + } elseif ($links[$key]['type'] == 'payment_vat') { $paymentvatstatic->id = $links[$key]['url_id']; $paymentvatstatic->ref = $langs->trans("Payment"); print ' '.$paymentvatstatic->getNomUrl(1); - } - elseif ($links[$key]['type'] == 'payment_salary') + } elseif ($links[$key]['type'] == 'payment_salary') { print ''; print ' '.img_object($langs->trans('ShowPayment'), 'payment').' '; print $langs->trans("Payment"); print ''; $newline = 0; - } - elseif ($links[$key]['type'] == 'payment_donation') + } elseif ($links[$key]['type'] == 'payment_donation') { $paymentdonationstatic->id = $links[$key]['url_id']; $paymentdonationstatic->ref = $langs->trans("Payment"); print ' '.$paymentdonationstatic->getNomUrl(1); $newline = 0; - } - elseif ($links[$key]['type'] == 'payment_loan') + } elseif ($links[$key]['type'] == 'payment_loan') { $paymentloanstatic->id = $links[$key]['url_id']; $paymentloanstatic->ref = $langs->trans("Payment"); print ' '.$paymentloanstatic->getNomUrl(1); $newline = 0; - } - elseif ($links[$key]['type'] == 'payment_various') + } elseif ($links[$key]['type'] == 'payment_various') { $paymentvariousstatic->id = $links[$key]['url_id']; $paymentvariousstatic->ref = $langs->trans("Payment"); print ' '.$paymentvariousstatic->getNomUrl(1); $newline = 0; - } - elseif ($links[$key]['type'] == 'banktransfert') { + } elseif ($links[$key]['type'] == 'banktransfert') { // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. if ($objp->amount > 0) { @@ -549,8 +535,7 @@ else { $bankstatic->label = $objp->bankref; print $bankstatic->getNomUrl(1, ''); print ')'; - } - else { + } else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("from").' '; @@ -562,35 +547,30 @@ else { print $bankstatic->getNomUrl(1, 'transactions'); print ')'; } - } - elseif ($links[$key]['type'] == 'company') { + } elseif ($links[$key]['type'] == 'company') { $societestatic->id = $links[$key]['url_id']; $societestatic->name = $links[$key]['label']; print $societestatic->getNomUrl(1, 'company', 24); $newline = 0; - } - elseif ($links[$key]['type'] == 'member') { + } elseif ($links[$key]['type'] == 'member') { print ''; print img_object($langs->trans('ShowMember'), 'user').' '; print $links[$key]['label']; print ''; $newline = 0; - } - elseif ($links[$key]['type'] == 'user') { + } elseif ($links[$key]['type'] == 'user') { print ''; print img_object($langs->trans('ShowUser'), 'user').' '; print $links[$key]['label']; print ''; $newline = 0; - } - elseif ($links[$key]['type'] == 'sc') { + } elseif ($links[$key]['type'] == 'sc') { print ''; print img_object($langs->trans('ShowBill'), 'bill').' '; print $langs->trans("SocialContribution"); print ''; $newline = 0; - } - else { + } else { print ''; print $links[$key]['label']; print ''; @@ -620,8 +600,7 @@ else { print "
".$objc->label.""; $ii++; } - } - else { + } else { dol_print_error($db); } } @@ -632,8 +611,7 @@ else { { $totald = $totald + abs($objp->amount); print ''.price($objp->amount * -1)." \n"; - } - else { + } else { $totalc = $totalc + abs($objp->amount); print ' '.price($objp->amount)."\n"; } @@ -645,8 +623,7 @@ else { print ''; print img_edit(); print ""; - } - else { + } else { print " "; } print ""; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 99a66321648..7228c38fe50 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -87,8 +87,7 @@ if ($action == 'add') if ($accountto->currency_code == $accountfrom->currency_code) { $amountto = $amount; - } - else { + } else { if (!$amountto) { $error++; @@ -129,13 +128,11 @@ if ($action == 'add') $mesgs = $langs->trans("TransferFromToDone", ''.$accountfrom->label."", ''.$accountto->label."", $amount, $langs->transnoentities("Currency".$conf->currency)); setEventMessages($mesgs, null, 'mesgs'); $db->commit(); - } - else { + } else { setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors'); $db->rollback(); } - } - else { + } else { $error++; setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); } diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 929a1611775..cf494b77a90 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -72,8 +72,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) if ($vline) { $viewline = $vline; - } - else { + } else { $viewline = 20; } @@ -289,8 +288,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) if ($obj->family == 'invoice') { $mc->getInfo($obj->entity); print "".$mc->label.""; - } - else { + } else { print ""; } } @@ -303,8 +301,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $i++; } - } - else { + } else { dol_print_error($db); } @@ -324,8 +321,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) print ""; print "
"; -} -else { +} else { print $langs->trans("ErrorBankAccountNotFound"); } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index ffabd082bfa..071a5abf0a9 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -163,8 +163,7 @@ if (empty($reshook)) $urltogo = ($backtopage ? $backtopage : DOL_URL_ROOT.'/compta/bank/various_payment/list.php'); header("Location: ".$urltogo); exit; - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -197,19 +196,16 @@ if (empty($reshook)) $db->commit(); header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/list.php'); exit; - } - else { + } else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); } } @@ -371,8 +367,7 @@ if ($action == 'create') print ''; print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1); print ''; - } - else // For external software + } else // For external software { print ''.$langs->trans("AccountAccounting").''; print ''; @@ -387,13 +382,11 @@ if ($action == 'create') if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1, ''); - } - else { + } else { print ''; } print ''; - } - else // For external software + } else // For external software { print ''.$langs->trans("SubledgerAccount").''; print ''; @@ -559,12 +552,10 @@ if ($id) } else { print ''; } - } - else { + } else { print ''; } - } - else { + } else { print ''; } diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 624ead86073..7a89fd77986 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -149,8 +149,7 @@ if ($object->id) $permission = $user->rights->banque->modifier; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 5fa44ba8555..d02f75819e4 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -75,8 +75,7 @@ if (!GETPOST('typeid')) $part = explode(':', $val); if ($part[0] == 'v.fk_typepayment') $typeid = $part[1]; } -} -else { +} else { $typeid = GETPOST('typeid'); } @@ -312,8 +311,7 @@ if ($result) $accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; if (!$i) $totalarray['nbfield']++; } @@ -372,8 +370,7 @@ if ($result) print ''; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index fce50a977e4..b14b77d5264 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -107,8 +107,7 @@ if (GETPOST('cancel', 'alpha')) { if ($action == 'valid') { $action = 'view'; - } - else { + } else { $action = 'create'; } } @@ -144,8 +143,7 @@ if ($action == "start") $action = 'create'; $error++; } -} -elseif ($action == "add") +} elseif ($action == "add") { if (GETPOST('opening', 'alpha') == '') { @@ -177,8 +175,7 @@ elseif ($action == "add") { $db->commit(); $action = "view"; - } - else { + } else { $db->rollback; $action = "view"; } @@ -216,8 +213,7 @@ if ($action == "valid") // validate = close { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); - } - else { + } else { setEventMessages($langs->trans("CashFenceDone"), null); $db->commit(); } @@ -251,8 +247,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) setEventMessages("RecordDeleted", null, 'mesgs'); header("Location: ".$backurlforlist); exit; - } - else { + } else { if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, null, 'errors'); } @@ -279,8 +274,7 @@ if ($action == "create" || $action == "start" || $action == 'close') $syear = $object->year_close; $smonth = $object->month_close; $sday = $object->day_close; - } - elseif (GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '-1') + } elseif (GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '' && GETPOST('posnumber', 'alpha') != '-1') { $posmodule = GETPOST('posmodule', 'alpha'); $terminalid = GETPOST('posnumber', 'alpha'); @@ -324,10 +318,8 @@ if ($action == "create" || $action == "start" || $action == 'close') { $obj = $db->fetch_object($resql); if ($obj) $initialbalanceforterminal[$terminalid][$key] = $obj->total; - } - else dol_print_error($db); - } - else { + } else dol_print_error($db); + } else { setEventMessages($langs->trans("SetupOfTerminalNotComplete", $terminaltouse), null, 'errors'); $error++; } @@ -366,8 +358,7 @@ if ($action == "create" || $action == "start" || $action == 'close') $theoricalamountforterminal[$terminalid][$key] = price2num($theoricalamountforterminal[$terminalid][$key] + $obj->total); $theoricalnbofinvoiceforterminal[$terminalid][$key] = $obj->nb; } - } - else dol_print_error($db); + } else dol_print_error($db); } } @@ -383,13 +374,11 @@ if ($action == "create" || $action == "start" || $action == 'close') if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; - } - elseif ($action == 'close') + } elseif ($action == 'close') { print ''; print ''; - } - else { + } else { print ''; } @@ -463,8 +452,7 @@ if ($action == "create" || $action == "start" || $action == 'close') if ($action == 'start' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '' && GETPOST('posnumber') != '-1') { print ''; - } - else { + } else { print ''; } print ''; @@ -562,8 +550,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { $object->fetch($id); print $object->opening; - } - else print (GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash'])); + } else print (GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash'])); print '">'; print ''; // Amount per payment type @@ -601,8 +588,7 @@ if (empty($action) || $action == "view" || $action == "close") if ($result <= 0) { print $langs->trans("ErrorRecordNotFound"); - } - else { + } else { $head = array(); $head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id; $head[0][1] = $langs->trans("CashControl"); @@ -699,13 +685,11 @@ if (empty($action) || $action == "view" || $action == "close") if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; - } - elseif ($action == 'close') + } elseif ($action == 'close') { print ''; print ''; - } - else { + } else { print ''; } @@ -852,8 +836,7 @@ if (empty($action) || $action == "view" || $action == "close") { $object->fetch($id); print $object->opening; - } - else print (GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash'])); + } else print (GETPOSTISSET('opening') ?price2num(GETPOST('opening', 'alpha')) : price($initialbalanceforterminal[$terminalid]['cash'])); print '">'; print ''; // Amount per payment type diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 5269c07bab2..0279ad5143c 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -259,8 +259,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; -} -else { +} else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 81a19389244..0f60be3c3a8 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -404,8 +404,7 @@ class CashControl extends CommonObject $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; */ - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 5b9079f9d72..f2d8e38fb15 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -172,8 +172,7 @@ if ($resql) $bankaccounttmp->fetch($objp->bankid); $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; - } - else { + } else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -207,8 +206,7 @@ if ($resql) print $bankaccount->getNomUrl(1); if ($cashcontrol->posmodule == "takepos") { $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$cashcontrol->posnumber; - } - else { + } else { $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'; } if ($objp->code == 'CHQ') { @@ -310,8 +308,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 991d039d1fb..def4fda9b10 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -103,8 +103,7 @@ if ($mode != 'sconly') { $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1); -} -else { +} else { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0); } @@ -216,8 +215,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $accountstatic->accountancy_journal = $obj->accountancy_journal; $accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; } // Paid @@ -239,8 +237,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if (!empty($conf->banque->enabled)) print ''; print ''.price($totalpaye).""; print ""; - } - else { + } else { dol_print_error($db); } print ''; @@ -332,8 +329,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $accountstatic->accountancy_journal = $obj->accountancy_journal; $accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; } @@ -354,8 +350,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } @@ -366,18 +361,15 @@ if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { $j = 1; $numlt = 3; -} -elseif ($mysoc->localtax1_assuj == "1") +} elseif ($mysoc->localtax1_assuj == "1") { $j = 1; $numlt = 2; -} -elseif ($mysoc->localtax2_assuj == "1") +} elseif ($mysoc->localtax2_assuj == "1") { $j = 2; $numlt = 3; -} -else { +} else { $j = 0; $numlt = 0; } @@ -447,8 +439,7 @@ while ($j < $numlt) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } @@ -541,8 +532,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) $accountstatic->accountancy_journal = $obj->accountancy_journal; $accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; } @@ -560,8 +550,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) $db->free($result); print "
"; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 74cc0d594e5..5632e8ebc1a 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -196,8 +196,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index b688bd17907..d2fd1c54cce 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -70,14 +70,11 @@ if ($action == 'validate' && $user->rights->deplacement->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } -} - -elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer) +} elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer) { $object->fetch($id); if ($object->statut == Deplacement::STATUS_VALIDATED) @@ -87,27 +84,21 @@ elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } -} - -elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) +} elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) { $result = $object->delete($id); if ($result >= 0) { header("Location: index.php"); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } -} - -elseif ($action == 'add' && $user->rights->deplacement->creer) +} elseif ($action == 'add' && $user->rights->deplacement->creer) { if (!GETPOST('cancel', 'alpha')) { @@ -146,17 +137,14 @@ elseif ($action == 'add' && $user->rights->deplacement->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } - } - else { + } else { $action = 'create'; } - } - else { + } else { header("Location: index.php"); exit; } @@ -183,12 +171,10 @@ elseif ($action == 'update' && $user->rights->deplacement->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -209,8 +195,7 @@ elseif ($action == 'setdated' && $user->rights->deplacement->creer) $object->fetch($id); $result = $object->setValueFrom('dated', $dated, '', '', 'date', '', $user, 'DEPLACEMENT_MODIFY'); if ($result < 0) dol_print_error($db, $object->error); -} -elseif ($action == 'setkm' && $user->rights->deplacement->creer) +} elseif ($action == 'setkm' && $user->rights->deplacement->creer) { $object->fetch($id); $result = $object->setValueFrom('km', GETPOST('km', 'int'), '', null, 'text', '', $user, 'DEPLACEMENT_MODIFY'); @@ -305,8 +290,7 @@ if ($action == 'create') print ''; print ''; -} -elseif ($id) +} elseif ($id) { $result = $object->fetch($id); if ($result > 0) @@ -404,8 +388,7 @@ elseif ($id) print ''; print ''; - } - else { + } else { /* * Confirm delete trip */ @@ -483,8 +466,7 @@ elseif ($id) if ($action == 'classify') { $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); - } - else { + } else { $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0); } print ''; @@ -518,8 +500,7 @@ elseif ($id) if ($user->rights->deplacement->creer) { print ''.$langs->trans('Modify').''; - } - else { + } else { print ''.$langs->trans('Modify').''; } } @@ -529,8 +510,7 @@ elseif ($id) if ($user->rights->deplacement->creer) { print ''.$langs->trans('Validate').''; - } - else { + } else { print ''.$langs->trans('Validate').''; } } @@ -540,8 +520,7 @@ elseif ($id) if ($user->rights->deplacement->creer) { print ''.$langs->trans('ClassifyRefunded').''; - } - else { + } else { print ''.$langs->trans('ClassifyRefunded').''; } } @@ -549,15 +528,13 @@ elseif ($id) if ($user->rights->deplacement->supprimer) { print ''.$langs->trans('Delete').''; - } - else { + } else { print ''.$langs->trans('Delete').''; } print ''; } - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 8051d074db5..69baf710b95 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -199,14 +199,12 @@ class Deplacement extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return $result; } - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -265,8 +263,7 @@ class Deplacement extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -309,8 +306,7 @@ class Deplacement extends CommonObject $this->extraparams = (array) json_decode($obj->extraparams, true); return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -334,8 +330,7 @@ class Deplacement extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -370,30 +365,25 @@ class Deplacement extends CommonObject 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'); @@ -455,8 +445,7 @@ class Deplacement extends CommonObject $ret[$obj->code] = (($langs->trans($obj->code) != $obj->code) ? $langs->trans($obj->code) : $obj->label); $i++; } - } - else { + } else { dol_print_error($this->db); } @@ -501,8 +490,7 @@ class Deplacement extends CommonObject $this->date_modification = $this->db->jdate($obj->tms); } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 4ad2044c0f1..889eb390ca2 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -123,8 +123,7 @@ if ($object->id) $permission = $user->rights->deplacement->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 9ed6e430c4c..0cea847f9ce 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -192,13 +192,11 @@ if ($result) $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } print '
'; -} -else dol_print_error($db); +} else dol_print_error($db); print ''; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 1ebaeb5c6fa..78c1f32556d 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -196,8 +196,7 @@ if ($resql) print ""; print "\n"; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 91c6546a83c..7707cb40786 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -167,8 +167,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; @@ -293,8 +292,7 @@ print '
'; // Show graphs print '"; - } - else { + } else { print ''; } @@ -1184,12 +1166,10 @@ if ($action == 'create') print ''; print ''; print "\n"; - } - else { + } else { dol_print_error('', "Error, no invoice ".$object->id); } -} -else { +} else { /* * View mode */ @@ -1312,8 +1292,7 @@ else { if ($action == 'editconditions') { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); - } - else { + } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); } } else { @@ -1333,8 +1312,7 @@ else { if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); - } - else { + } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none'); } print ''; @@ -1441,8 +1419,7 @@ else { if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } - else { + } else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -1467,8 +1444,7 @@ else { } $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); - } - else { + } else { print $object->modelpdf; } print ""; @@ -1516,13 +1492,11 @@ else { print ''; print ''; print '
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { print $px1->show(); print "
\n"; print $px2->show(); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 8256aeacc5a..a0d09a11980 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -238,8 +238,7 @@ if (empty($reshook)) setEventMessages($oldinvoice->error, $oldinvoice->errors, 'errors'); $action = "create"; } - } - else { + } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -251,8 +250,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); exit; - } - else { + } else { $db->rollback(); $error++; @@ -298,8 +296,7 @@ if (empty($reshook)) $object->titre = GETPOST('ref', 'alpha'); // deprecated $object->title = GETPOST('ref', 'alpha'); $object->ref = $object->title; - } - else dol_print_error($db, $object->error, $object->errors); + } else dol_print_error($db, $object->error, $object->errors); } // Set bank account elseif ($action == 'setbankaccount' && $user->rights->facture->creer) @@ -354,8 +351,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -377,8 +373,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -414,18 +409,15 @@ if (empty($reshook)) { $db->commit(); $object->fetch($object->id); // Reload lines - } - else { + } else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); } - } - else { + } else { $db->rollback(); setEventMessages($line->error, $line->errors, 'errors'); } - } - elseif ($action == 'update_extras') + } elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); @@ -460,8 +452,7 @@ if (empty($reshook)) { $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); - } - else { + } else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -571,8 +562,7 @@ if (empty($reshook)) if ($price_base_type != 'HT') { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); - } - else { + } else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -595,8 +585,7 @@ if (empty($reshook)) } $desc = (!empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; - } - else { + } else { $desc = $prod->description; } @@ -631,8 +620,7 @@ if (empty($reshook)) $type = $prod->type; $fk_unit = $prod->fk_unit; - } - else { + } else { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); @@ -662,8 +650,7 @@ if (empty($reshook)) if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); - } - else { + } else { // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice); @@ -727,17 +714,14 @@ if (empty($reshook)) unset($_POST['situations']); unset($_POST['progress']); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } $action = ''; } } - } - - elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) + } elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { if (!$object->fetch($id) > 0) dol_print_error($db); $object->fetch_thirdparty(); @@ -935,8 +919,7 @@ if (empty($reshook)) unset($_POST['situations']); unset($_POST['progress']); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1131,8 +1114,7 @@ if ($action == 'create') $select = array('0'=>$langs->trans('DoNotGenerateDoc'), '1'=>$langs->trans('AutoGenerateDoc')); print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); print "
'; - } - else { + } else { if ($object->frequency > 0) { print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); - } - else { + } else { print $langs->trans("NotARecurringInvoiceTemplate"); } } @@ -1533,8 +1507,7 @@ else { if ($action == 'date_when' || $object->frequency > 0) { print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); - } - else { + } else { print $langs->trans("NextDateToExecution"); } print ''; @@ -1546,8 +1519,7 @@ else { if (!$object->isMaxNbGenReached()) { if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late")); - } - else { + } else { print img_info($langs->trans("MaxNumberOfGenerationReached")); } print ''; @@ -1558,16 +1530,14 @@ else { if ($action == 'nb_gen_max' || $object->frequency > 0) { print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer); - } - else { + } else { print $langs->trans("MaxPeriodNumber"); } print ''; if ($action == 'nb_gen_max' || $object->frequency > 0) { print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max ? $object->nb_gen_max : '', $object, $user->rights->facture->creer); - } - else { + } else { print ''; } print ''; @@ -1602,8 +1572,7 @@ else { } print ''; print ''; - } - else { + } else { print ''; } @@ -1704,18 +1673,15 @@ else { if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { print ''; - } - else { + } else { if (empty($object->frequency) || $object->date_when <= $today) { print ''; - } - else { + } else { print ''; } } - } - else { + } else { print ''; } } @@ -1725,8 +1691,7 @@ else { if (empty($object->suspended)) { print ''; - } - else { + } else { print ''; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 68b1a6e91df..677701b9970 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -335,32 +335,24 @@ if (empty($reshook)) } } } - } - - elseif ($action == 'set_thirdparty' && $usercancreate) + } elseif ($action == 'set_thirdparty' && $usercancreate) { $object->fetch($id); $object->setValueFrom('fk_soc', $socid, '', null, 'int', '', $user, 'BILL_MODIFY'); header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit(); - } - - elseif ($action == 'classin' && $usercancreate) + } elseif ($action == 'classin' && $usercancreate) { $object->fetch($id); $object->setProject($_POST['projectid']); - } - - elseif ($action == 'setmode' && $usercancreate) + } elseif ($action == 'setmode' && $usercancreate) { $object->fetch($id); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) dol_print_error($db, $object->error); - } - - elseif ($action == 'setretainedwarrantyconditions' && $user->rights->facture->creer) + } elseif ($action == 'setretainedwarrantyconditions' && $user->rights->facture->creer) { $object->fetch($id); $object->retained_warranty_fk_cond_reglement = 0; // To clean property @@ -373,17 +365,13 @@ if (empty($reshook)) if ($object->retained_warranty_date_limit < $object->date) $object->retained_warranty_date_limit = $object->date; $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); - } - - elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer) + } elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer) { $object->fetch($id); $result = $object->setRetainedWarranty(GETPOST('retained_warranty', 'float')); if ($result < 0) dol_print_error($db, $object->error); - } - - elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer) + } elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer) { $object->fetch($id); $result = $object->setRetainedWarrantyDateLimit(GETPOST('retained_warranty_date_limit', 'float')); @@ -400,9 +388,7 @@ if (empty($reshook)) // Multicurrency rate elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int')); - } - - elseif ($action == 'setinvoicedate' && $usercancreate) + } elseif ($action == 'setinvoicedate' && $usercancreate) { $object->fetch($id); $old_date_lim_reglement = $object->date_lim_reglement; @@ -421,9 +407,7 @@ if (empty($reshook)) if ($result < 0) { dol_print_error($db, $object->error); } - } - - elseif ($action == 'setdate_pointoftax' && $usercancreate) + } elseif ($action == 'setdate_pointoftax' && $usercancreate) { $object->fetch($id); $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); @@ -432,9 +416,7 @@ if (empty($reshook)) if ($result < 0) { dol_print_error($db, $object->error); } - } - - elseif ($action == 'setconditions' && $usercancreate) + } elseif ($action == 'setconditions' && $usercancreate) { $object->fetch($id); $object->cond_reglement_code = 0; // To clean property @@ -450,9 +432,7 @@ if (empty($reshook)) if ($result < 0) { dol_print_error($db, $object->error); } - } - - elseif ($action == 'setpaymentterm' && $usercancreate) + } elseif ($action == 'setpaymentterm' && $usercancreate) { $object->fetch($id); $object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']); @@ -464,9 +444,7 @@ if (empty($reshook)) if ($result < 0) { dol_print_error($db, $object->error); } - } - - elseif ($action == 'setrevenuestamp' && $usercancreate) + } elseif ($action == 'setrevenuestamp' && $usercancreate) { $object->fetch($id); $object->revenuestamp = GETPOST('revenuestamp'); @@ -506,15 +484,11 @@ if (empty($reshook)) elseif ($action == 'setbankaccount' && $usercancreate) { $result = $object->setBankAccount(GETPOST('fk_account', 'int')); - } - - elseif ($action == 'setremisepercent' && $usercancreate) + } elseif ($action == 'setremisepercent' && $usercancreate) { $object->fetch($id); $result = $object->set_remise($user, $_POST['remise_percent']); - } - - elseif ($action == "setabsolutediscount" && $usercancreate) + } elseif ($action == "setabsolutediscount" && $usercancreate) { // POST[remise_id] or POST[remise_id_for_payment] @@ -570,15 +544,11 @@ if (empty($reshook)) $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'setref' && $usercancreate) + } elseif ($action == 'setref' && $usercancreate) { $object->fetch($id); $object->setValueFrom('ref', GETPOST('ref'), '', null, '', '', $user, 'BILL_MODIFY'); - } - - elseif ($action == 'setref_client' && $usercancreate) + } elseif ($action == 'setref_client' && $usercancreate) { $object->fetch($id); $object->set_ref_client(GETPOST('ref_client')); @@ -618,8 +588,7 @@ if (empty($reshook)) } } } - } - else { + } else { //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') { @@ -694,8 +663,7 @@ if (empty($reshook)) $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { if (count($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, $object->errors, 'errors'); } @@ -969,16 +937,14 @@ if (empty($reshook)) if ($result >= 0) { $db->commit(); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } else { $db->commit(); } - } - else { + } else { setEventMessages($discount->error, $discount->errors, 'errors'); $db->rollback(); } @@ -1171,8 +1137,7 @@ if (empty($reshook)) { $searchPreviousInvoice = false; // find, exit; break; - } - else { + } else { $lineIndex--; // go to previous invoice in cycle } } @@ -1360,8 +1325,7 @@ if (empty($reshook)) if (in_array($object->type, $retainedWarrantyInvoiceAvailableType)) { $object->retained_warranty = GETPOST('retained_warranty', 'int'); $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - } - else { + } else { $object->retained_warranty = 0; $object->retained_warranty_fk_cond_reglement = 0; } @@ -1464,13 +1428,11 @@ if (empty($reshook)) $amount_ttc_diff += $am; $amountdeposit[$tva] += $am / (1 + $tva / 100); // Convert into HT for the addline } - } - else { + } else { if ($typeamount == 'amount') { $amountdeposit[0] = $valuedeposit; - } - elseif ($typeamount == 'variable') + } elseif ($typeamount == 'variable') { if ($result > 0) { @@ -1718,8 +1680,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); $error++; } - } - else { // If some invoice's lines coming from page + } else { // If some invoice's lines coming from page $id = $object->create($user); for ($i = 1; $i <= $NBLINES; $i++) { @@ -1845,8 +1806,7 @@ if (empty($reshook)) if ($id <= 0) { $mesg = $object->error; - } - else { + } else { $nextSituationInvoice = new Facture($db); $nextSituationInvoice->fetch($id); @@ -1886,8 +1846,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit(); - } - else { + } else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -1912,8 +1871,7 @@ if (empty($reshook)) { $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); - } - else { + } else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -1960,8 +1918,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT"), $langs->transnoentitiesnoconv("CustomerAbsoluteDiscountShort")), null, 'errors'); } $error++; - } - else { + } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -1987,8 +1944,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } - else { + } else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error++; } @@ -2052,8 +2008,7 @@ if (empty($reshook)) if ($price_base_type != 'HT') { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); - } - else { + } else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -2220,9 +2175,7 @@ if (empty($reshook)) $action = ''; } } - } - - elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) + } elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { if (!$object->fetch($id) > 0) dol_print_error($db); $object->fetch_thirdparty(); @@ -2279,16 +2232,14 @@ if (empty($reshook)) setEventMessages($mesg, null, 'warnings'); $error++; $result = -1; - } - elseif (GETPOST('progress') < $line->situation_percent) // TODO : use a modified $line->get_prev_progress($object->id) result + } elseif (GETPOST('progress') < $line->situation_percent) // TODO : use a modified $line->get_prev_progress($object->id) result { $mesg = $langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $error++; $result = -1; } - } - elseif (GETPOST('progress') < $percent) + } elseif (GETPOST('progress') < $percent) { $mesg = '
'.$langs->trans("CantBeLessThanMinPercent").'
'; setEventMessages($mesg, null, 'warnings'); @@ -2343,8 +2294,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT"), $langs->transnoentitiesnoconv("CustomerAbsoluteDiscountShort")), null, 'errors'); } $error++; - } - else { + } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -2429,9 +2379,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - } - - elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) // Update all lines of situation invoice + } elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) // Update all lines of situation invoice { if (!$object->fetch($id) > 0) dol_print_error($db); if (GETPOST('all_progress') != "") @@ -2447,9 +2395,7 @@ if (empty($reshook)) } else $object->update_percent($line, $_POST['all_progress']); } } - } - - elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) { + } elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) { header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // To show again edited page exit(); } @@ -2524,8 +2470,7 @@ if (empty($reshook)) { $searchPreviousInvoice = false; // find, exit; break; - } - else { + } else { $lineIndex--; // go to previous invoice in cycle } } @@ -2552,16 +2497,13 @@ if (empty($reshook)) { setEventMessages($langs->trans('Updated'), '', 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); - } - else { + } else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceCreditNote'), array(), 'errors'); } - } - else { + } else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceOnUpdate'), array(), 'errors'); } - } - else { + } else { setEventMessages($langs->trans('ErrorFindNextSituationInvoice'), array(), 'errors'); } } @@ -2583,8 +2525,7 @@ if (empty($reshook)) { dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'OrderLine'; - } - elseif ($fromElement == 'propal') + } elseif ($fromElement == 'propal') { dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php'); $lineClassName = 'PropaleLigne'; @@ -2626,8 +2567,7 @@ if (empty($reshook)) $array_options = $originLine->array_options; if ($object->type == Facture::TYPE_SITUATION) { $situation_percent = 0; - } - else { + } else { $situation_percent = 100; } $fk_prev_id = ''; @@ -2641,8 +2581,7 @@ if (empty($reshook)) } else { $error++; } - } - else { + } else { $error++; } } @@ -2855,8 +2794,7 @@ if ($action == 'create') //Replicate extrafields $expesrc->fetch_optionals(); $object->array_options = $expesrc->array_options; - } - else { + } else { $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); @@ -2874,8 +2812,7 @@ if ($action == 'create') $object->array_options = $objectsrc->array_options; } } - } - else { + } else { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; $fk_account = $soc->fk_account; @@ -2957,8 +2894,7 @@ if ($action == 'create') print ')'; print ''; print ''."\n"; - } - else { + } else { print ''.$langs->trans('Customer').''; print ''; print $form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); @@ -3181,8 +3117,7 @@ if ($action == 'create') print $desc; print '
'; } - } - else { + } else { if (!empty($conf->global->INVOICE_USE_SITUATION)) { print '
'; @@ -3287,8 +3222,7 @@ if ($action == 'create') print '
'; } - } - else { + } else { print '
'; if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp = ' '; else $tmp = ' '; @@ -3655,8 +3589,7 @@ if ($action == 'create') } print '
'; -} -elseif ($id > 0 || !empty($ref)) +} elseif ($id > 0 || !empty($ref)) { /* * Show object in view mode @@ -3765,8 +3698,7 @@ elseif ($id > 0 || !empty($ref)) array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse') ?GETPOST('idwarehouse') : 'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"), 0, $forcecombo)) ); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1); - } - else { + } else { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', 'no', 1); } } else { @@ -4247,8 +4179,7 @@ elseif ($id > 0 || !empty($ref)) if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); - } - else { + } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none', 'CRDT'); } print ''; @@ -4311,8 +4242,7 @@ elseif ($id > 0 || !empty($ref)) if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } - else { + } else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -4333,8 +4263,7 @@ elseif ($id > 0 || !empty($ref)) if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -4368,8 +4297,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; print ''; - } - else { + } else { print price($object->retained_warranty).'%'; } print ''; @@ -4402,8 +4330,7 @@ elseif ($id > 0 || !empty($ref)) $form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1); print ''; print ''; - } - else { + } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); if (!$displayWarranty) { print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" '); @@ -4436,8 +4363,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; print ''; - } - else { + } else { print dol_print_date($object->retained_warranty_date_limit, 'day'); } print ''; @@ -4894,8 +4820,7 @@ elseif ($id > 0 || !empty($ref)) if ($object->type == Facture::TYPE_SITUATION) { $retainedWarranty = $total_global_ttc * $object->retained_warranty / 100; - } - else { + } else { // Because one day retained warranty could be used on standard invoices $retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; } @@ -4910,8 +4835,7 @@ elseif ($id > 0 || !empty($ref)) print !empty($object->retained_warranty_date_limit) ? ' '.$langs->trans("ToPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; print ' :'.price($retainedWarranty).' '; } - } - else // Credit note + } else // Credit note { $cssforamountpaymentcomplete = 'amountpaymentneutral'; @@ -5084,8 +5008,7 @@ elseif ($id > 0 || !empty($ref)) print ''.$langs->trans('Modify').''; } } - } - else { + } else { print ''.$langs->trans('Modify').''; } } @@ -5142,12 +5065,10 @@ elseif ($id > 0 || !empty($ref)) } else { print ''.$langs->trans('MakeWithdrawRequest').''; } - } - else { + } else { //print ''.$langs->trans("MakeWithdrawRequest").''; } - } - else { + } else { //print ''.$langs->trans("MakeWithdrawRequest").''; } } @@ -5181,8 +5102,7 @@ elseif ($id > 0 || !empty($ref)) if ($resteapayer == 0) { print ''.$langs->trans('DoPaymentBack').''; - } - else { + } else { print ''.$langs->trans('DoPaymentBack').''; } } @@ -5221,15 +5141,13 @@ elseif ($id > 0 || !empty($ref)) { // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; - } - else { + } else { if (empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) { if ($objectidnext) { print ''.$langs->trans('ClassifyCanceled').''; - } - else { + } else { print ''.$langs->trans('ClassifyCanceled').''; } } @@ -5291,8 +5209,7 @@ elseif ($id > 0 || !empty($ref)) if (($object->total_ttc - $totalcreditnotes) == 0) { print ''.$langs->trans("RemoveSituationFromCycle").''; - } - else { + } else { print ''.$langs->trans("RemoveSituationFromCycle").''; } } @@ -5315,25 +5232,19 @@ elseif ($id > 0 || !empty($ref)) //var_dump($isErasable); if ($isErasable == -4) { print ''.$langs->trans('Delete').''; - } - elseif ($isErasable == -3) { + } elseif ($isErasable == -3) { print ''.$langs->trans('Delete').''; - } - elseif ($isErasable == -2) { + } elseif ($isErasable == -2) { print ''.$langs->trans('Delete').''; - } - elseif ($isErasable == -1) { + } elseif ($isErasable == -1) { print ''.$langs->trans('Delete').''; - } - elseif ($isErasable <= 0) // Any other cases + } elseif ($isErasable <= 0) // Any other cases { print ''.$langs->trans('Delete').''; - } - elseif ($objectidnext) + } elseif ($objectidnext) { print ''.$langs->trans('Delete').''; - } - else { + } else { print ''.$langs->trans('Delete').''; } } else { diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index d56d1b5cfef..c1ed5b809da 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -244,8 +244,7 @@ class Invoices extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve invoice list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -548,8 +547,7 @@ class Invoices extends DolibarrApi $updateRes = $this->invoice->deleteline($lineid); if ($updateRes > 0) { return $this->get($id); - } - else { + } else { throw new RestException(405, $this->invoice->error); } } @@ -1040,14 +1038,11 @@ class Invoices extends DolibarrApi $discount = new DiscountAbsolute($this->db); if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) { $discount->description = '(CREDIT_NOTE)'; - } - elseif ($this->invoice->type == Facture::TYPE_DEPOSIT) { + } elseif ($this->invoice->type == Facture::TYPE_DEPOSIT) { $discount->description = '(DEPOSIT)'; - } - elseif ($this->invoice->type == Facture::TYPE_STANDARD || $this->invoice->type == Facture::TYPE_REPLACEMENT || $this->invoice->type == Facture::TYPE_SITUATION) { + } elseif ($this->invoice->type == Facture::TYPE_STANDARD || $this->invoice->type == Facture::TYPE_REPLACEMENT || $this->invoice->type == Facture::TYPE_SITUATION) { $discount->description = '(EXCESS RECEIVED)'; - } - else { + } else { throw new RestException(500, 'Cant convert to reduc an Invoice of this type'); } @@ -1123,16 +1118,14 @@ class Invoices extends DolibarrApi if ($result >= 0) { $this->db->commit(); - } - else { + } else { $this->db->rollback(); throw new RestException(500, 'Could not set paid'); } } else { $this->db->commit(); } - } - else { + } else { $this->db->rollback(); throw new RestException(500, 'Discount creation error'); } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 904f59ea432..581e63be08a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -336,8 +336,7 @@ class FactureRec extends CommonInvoice if ($result_insert < 0) { $error++; - } - else { + } else { $objectline = new FactureLigneRec($this->db); if ($objectline->fetch($result_insert)) { @@ -377,8 +376,7 @@ 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); @@ -394,19 +392,16 @@ class FactureRec extends CommonInvoice if ($error) { $this->db->rollback(); - } - else { + } else { $this->db->commit(); return $this->id; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -1; } @@ -457,8 +452,7 @@ class FactureRec extends CommonInvoice } $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -580,14 +574,12 @@ class FactureRec extends CommonInvoice return -3; } return 1; - } - else { + } else { $this->error = 'Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -2; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -716,8 +708,7 @@ class FactureRec extends CommonInvoice $this->db->free($result); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -3; } @@ -759,13 +750,11 @@ class FactureRec extends CommonInvoice // Delete extrafields $res = $this->deleteExtraFields(); if ($res < 0) $error = -4; - } - else { + } else { $this->error = $this->db->lasterror(); $error = -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $error = -2; } @@ -774,8 +763,7 @@ class FactureRec extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return $error; } @@ -850,8 +838,7 @@ class FactureRec extends CommonInvoice if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } @@ -958,8 +945,7 @@ class FactureRec extends CommonInvoice $this->id = $facid; $this->update_price(); return $lineId; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -1033,8 +1019,7 @@ class FactureRec extends CommonInvoice if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } @@ -1118,8 +1103,7 @@ class FactureRec extends CommonInvoice $this->id = $facid; $this->update_price(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -1273,8 +1257,7 @@ class FactureRec extends CommonInvoice $error++; } } - } - else { + } else { $error++; $this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n"; $this->errors[] = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity; @@ -1287,8 +1270,7 @@ class FactureRec extends CommonInvoice dol_syslog("createRecurringInvoices Process invoice template ".$facturerec->ref." is finished with a success generation"); $nb_create++; $this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n"; - } - else { + } else { $db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref); } @@ -1306,8 +1288,7 @@ class FactureRec extends CommonInvoice } $conf->entity = $saventity; // Restore entity context - } - else dol_print_error($db); + } else dol_print_error($db); $this->output = trim($this->output); @@ -1413,66 +1394,54 @@ class FactureRec extends CommonInvoice { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $labelStatus = $langs->trans('Active'); } - } - else { + } else { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $labelStatus = $langs->trans("Draft"); } } - } - elseif ($mode == 1) + } elseif ($mode == 1) { $prefix = 'Short'; if ($recur) { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $labelStatus = $langs->trans('Active'); } - } - else { + } else { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $labelStatus = $langs->trans("Draft"); } } - } - elseif ($mode == 2) + } elseif ($mode == 2) { if ($recur) { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status4'; $labelStatus = $langs->trans('Active'); } - } - else { + } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status0'; $labelStatus = $langs->trans('Draft'); } } - } - elseif ($mode == 3) + } elseif ($mode == 3) { if ($recur) { @@ -1480,24 +1449,20 @@ class FactureRec extends CommonInvoice if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status4'; $labelStatus = $langs->trans('Active'); } - } - else { + } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status0'; $labelStatus = $langs->trans('Draft'); } } - } - elseif ($mode == 4) + } elseif ($mode == 4) { $prefix = ''; if ($recur) @@ -1505,24 +1470,20 @@ class FactureRec extends CommonInvoice if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status4'; $labelStatus = $langs->trans('Active'); } - } - else { + } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status0'; $labelStatus = $langs->trans('Draft'); } } - } - elseif ($mode == 5 || $mode == 6) + } elseif ($mode == 5 || $mode == 6) { $prefix = ''; if ($mode == 5) $prefix = 'Short'; @@ -1531,18 +1492,15 @@ class FactureRec extends CommonInvoice if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status4'; $labelStatus = $langs->trans('Active'); } - } - else { + } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); - } - else { + } else { $statusType = 'status0'; $labelStatus = $langs->trans('Draft'); } @@ -1631,16 +1589,14 @@ class FactureRec extends CommonInvoice $line->total_ht = -100; $line->total_ttc = -119.6; $line->total_tva = -19.6; - } - elseif ($xnbp == 2) // UP is negative (free line) + } elseif ($xnbp == 2) // UP is negative (free line) { $line->subprice = -100; $line->total_ht = -100; $line->total_ttc = -119.6; $line->total_tva = -19.6; $line->remise_percent = 0; - } - elseif ($xnbp == 3) // Discount is 50% (product line) + } elseif ($xnbp == 3) // Discount is 50% (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -1648,8 +1604,7 @@ class FactureRec extends CommonInvoice $line->total_ttc = 59.8; $line->total_tva = 9.8; $line->remise_percent = 50; - } - else // (product line) + } else // (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -1738,8 +1693,7 @@ class FactureRec extends CommonInvoice $this->frequency = $frequency; if (!empty($unit)) $this->unit_frequency = $unit; return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1770,8 +1724,7 @@ class FactureRec extends CommonInvoice $this->date_when = $date; if ($increment_nb_gen_done > 0) $this->nb_gen_done++; return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1802,8 +1755,7 @@ class FactureRec extends CommonInvoice { $this->nb_gen_max = $nb; return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1832,8 +1784,7 @@ class FactureRec extends CommonInvoice { $this->auto_validate = $validate; return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1862,8 +1813,7 @@ class FactureRec extends CommonInvoice { $this->generate_pdf = $validate; return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1892,8 +1842,7 @@ class FactureRec extends CommonInvoice { $this->modelpdf = $model; return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2038,8 +1987,7 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->free($result); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -3; } @@ -2119,8 +2067,7 @@ class FactureLigneRec extends CommonInvoiceLine } $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 55adb5eb138..28f0883bb90 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -678,8 +678,7 @@ class Facture 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); @@ -726,8 +725,7 @@ class Facture extends CommonInvoice //print $objcontact->code.'-'.$objcontact->source.'-'.$objcontact->fk_socpeople."\n"; $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } - } - else dol_print_error($resqlcontact); + } else dol_print_error($resqlcontact); } /* @@ -787,8 +785,7 @@ class Facture extends CommonInvoice break; } } - } - elseif (!$error && empty($this->fac_rec)) // If this->lines is an array of invoice line arrays + } elseif (!$error && empty($this->fac_rec)) // If this->lines is an array of invoice line arrays { $fk_parent_line = 0; @@ -987,25 +984,21 @@ class Facture extends CommonInvoice { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -4; } - } - else { + } else { $this->error = $langs->trans('FailedToUpdatePrice'); $this->db->rollback(); return -3; } - } - else { + } else { dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -1090,8 +1083,7 @@ class Facture extends CommonInvoice { $this->error = $facture->error; $this->errors = $facture->errors; - } - elseif ($this->type == self::TYPE_SITUATION && !empty($conf->global->INVOICE_USE_SITUATION)) + } elseif ($this->type == self::TYPE_SITUATION && !empty($conf->global->INVOICE_USE_SITUATION)) { $this->fetchObjectLinked('', '', $this->id, 'facture'); @@ -1236,8 +1228,7 @@ class Facture extends CommonInvoice { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1362,10 +1353,8 @@ class Facture extends CommonInvoice if (!$error) { return 1; - } - else return -1; - } - else return -1; + } else return -1; + } else return -1; } /** @@ -1640,14 +1629,12 @@ class Facture extends CommonInvoice return -3; } return 1; - } - else { + } else { $this->error = 'Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found'; dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); return 0; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1768,8 +1755,7 @@ class Facture extends CommonInvoice } $this->db->free($result); return 1; - } - else { + } else { $this->error = $this->db->error(); return -3; } @@ -1807,8 +1793,7 @@ class Facture extends CommonInvoice ) { $this->tab_previous_situation_invoice[] = $invoice; - } - else { + } else { $this->tab_next_situation_invoice[] = $invoice; } } @@ -1924,8 +1909,7 @@ class Facture extends CommonInvoice } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -2011,20 +1995,17 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; - } - else { + } else { $this->error = $facligne->error; $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $facligne->error; $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -3; } @@ -2080,8 +2061,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2245,20 +2225,17 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -6; } - } - else { + } else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -4; } - } - else { + } else { $this->db->rollback(); return -2; } @@ -2303,8 +2280,7 @@ class Facture extends CommonInvoice $result = $this->call_trigger('BILL_PAYED', $user); if ($result < 0) $error++; // End call triggers - } - else { + } else { $error++; $this->error = $this->db->lasterror(); } @@ -2313,13 +2289,11 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { return 0; } } @@ -2355,8 +2329,7 @@ class Facture extends CommonInvoice $result = $this->call_trigger('BILL_UNPAYED', $user); if ($result < 0) $error++; // End call triggers - } - else { + } else { $error++; $this->error = $this->db->error(); dol_print_error($this->db); @@ -2366,8 +2339,7 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -2422,14 +2394,12 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -2; @@ -2538,8 +2508,7 @@ class Facture extends CommonInvoice if ($force_number) { $num = $force_number; - } - elseif (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life + } elseif (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { if (!empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date { @@ -2547,8 +2516,7 @@ class Facture extends CommonInvoice $this->date_lim_reglement = $this->calculate_date_lim_reglement(); } $num = $this->getNextNumRef($this->thirdparty); - } - else { + } else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -2777,8 +2745,7 @@ class Facture extends CommonInvoice $this->setFinal($user); } } - } - else { + } else { $error++; } @@ -2786,8 +2753,7 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -2914,13 +2880,11 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -3039,8 +3003,7 @@ class Facture extends CommonInvoice if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } @@ -3181,20 +3144,17 @@ class Facture extends CommonInvoice { $this->db->commit(); return $this->line->id; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->line->error; $this->db->rollback(); return -2; } - } - else { + } else { dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR); return -3; } @@ -3409,14 +3369,12 @@ class Facture extends CommonInvoice $this->update_price(1); $this->db->commit(); return $result; - } - else { + } else { $this->error = $this->line->error; $this->db->rollback(); return -1; } - } - else { + } else { $this->error = "Invoice statut makes operation forbidden"; return -2; } @@ -3536,14 +3494,12 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } - } - else { + } else { $this->db->rollback(); $this->error = $line->error; return -1; @@ -3601,8 +3557,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3669,8 +3624,7 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3828,8 +3782,7 @@ class Facture extends CommonInvoice $this->date_closing = $this->db->jdate($obj->dateclosing); } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -3887,12 +3840,10 @@ class Facture extends CommonInvoice if ($shortlist == 1) { $ga[$obj->fid] = $obj->ref; - } - elseif ($shortlist == 2) + } elseif ($shortlist == 2) { $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; - } - else { + } else { $ga[$i]['id'] = $obj->fid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -3901,8 +3852,7 @@ class Facture extends CommonInvoice } } return $ga; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -3950,8 +3900,7 @@ class Facture extends CommonInvoice } //print_r($return); return $return; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -3997,8 +3946,7 @@ class Facture extends CommonInvoice $sqlSit .= " GROUP BY fs.situation_cycle_ref"; $sqlSit .= " ORDER BY fs.situation_counter"; $sql .= " AND ( f.type != ".self::TYPE_SITUATION." OR f.rowid IN (".$sqlSit.") )"; // Type non 5 si facture non avoir - } - else { + } else { $sql .= " AND f.type != ".self::TYPE_SITUATION; // Type non 5 si facture non avoir } @@ -4023,8 +3971,7 @@ class Facture extends CommonInvoice } return $return; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -4100,8 +4047,7 @@ class Facture extends CommonInvoice dol_syslog(get_class($this).'::demandeprelevement Erreur'); $error++; } - } - else { + } else { $this->error = 'WithdrawRequestErrorNilAmount'; dol_syslog(get_class($this).'::demandeprelevement WithdrawRequestErrorNilAmount'); $error++; @@ -4119,20 +4065,17 @@ class Facture extends CommonInvoice if ($error) return -1; return 1; - } - else { + } else { $this->error = "A request already exists"; dol_syslog(get_class($this).'::demandeprelevement Impossible de creer une demande, demande deja en cours'); return 0; } - } - else { + } else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::demandeprelevement Erreur -2'); return -2; } - } - else { + } else { $this->error = "Status of invoice does not allow this"; dol_syslog(get_class($this)."::demandeprelevement ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); return -3; @@ -4156,8 +4099,7 @@ class Facture extends CommonInvoice if ($this->db->query($sql)) { return 0; - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); return -1; @@ -4222,8 +4164,7 @@ class Facture extends CommonInvoice } return $response; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4343,8 +4284,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_ht = -200; $line->multicurrency_total_ttc = -239.2; $line->multicurrency_total_tva = -39.2; - } - elseif ($xnbp == 2) // UP is negative (free line) + } elseif ($xnbp == 2) // UP is negative (free line) { $line->subprice = -100; $line->total_ht = -100; @@ -4354,8 +4294,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_ht = -200; $line->multicurrency_total_ttc = -239.2; $line->multicurrency_total_tva = -39.2; - } - elseif ($xnbp == 3) // Discount is 50% (product line) + } elseif ($xnbp == 3) // Discount is 50% (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -4366,8 +4305,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_ttc = 119.6; $line->multicurrency_total_tva = 19.6; $line->remise_percent = 50; - } - else // (product line) + } else // (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -4453,8 +4391,7 @@ class Facture extends CommonInvoice } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4615,8 +4552,7 @@ class Facture extends CommonInvoice { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -4701,12 +4637,10 @@ class Facture extends CommonInvoice if (($totalpaye < $this->total_ttc - $RetainedWarrantyAmount) && $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay)) { $hasDelay = 1; - } - elseif ($totalpaye < $this->total_ttc && $this->retained_warranty_date_limit < ($now - $conf->facture->client->warning_delay)) + } elseif ($totalpaye < $this->total_ttc && $this->retained_warranty_date_limit < ($now - $conf->facture->client->warning_delay)) { $hasDelay = 1; - } - else { + } else { $hasDelay = 0; } } @@ -4792,12 +4726,10 @@ class Facture extends CommonInvoice $total2BillWT += $this->total_ttc; $retainedWarrantyAmount = $total2BillWT * $this->retained_warranty / 100; - } - else { + } else { return -1; } - } - else { + } else { // Because one day retained warranty could be used on standard invoices $retainedWarrantyAmount = $this->total_ttc * $this->retained_warranty / 100; } @@ -4833,14 +4765,12 @@ class Facture extends CommonInvoice { $this->retained_warranty = floatval($value); return 1; - } - else { + } else { dol_syslog(get_class($this).'::setRetainedWarranty Erreur '.$sql.' - '.$this->db->error()); $this->error = $this->db->error(); return -1; } - } - else { + } else { dol_syslog(get_class($this).'::setRetainedWarranty, status of the object is incompatible'); $this->error = 'Status of the object is incompatible '.$this->statut; return -2; @@ -4874,14 +4804,12 @@ class Facture extends CommonInvoice { $this->retained_warranty_date_limit = $timestamp; return 1; - } - else { + } else { dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit Erreur '.$sql.' - '.$this->db->error()); $this->error = $this->db->error(); return -1; } - } - else { + } else { dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit, status of the object is incompatible'); $this->error = 'Status of the object is incompatible '.$this->statut; return -2; @@ -5062,8 +4990,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->free($result); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -5116,8 +5043,7 @@ class FactureLigne extends CommonInvoiceLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -5233,8 +5159,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->rollback(); return -3; } - } - else { + } else { $result = $discount->link_to_invoice($this->rowid, 0); if ($result < 0) { @@ -5244,15 +5169,13 @@ class FactureLigne extends CommonInvoiceLine return -3; } } - } - else { + } else { $this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } - } - else { + } else { $this->error = $discount->error; dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -5274,8 +5197,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -5328,8 +5250,7 @@ class FactureLigne extends CommonInvoiceLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -5407,8 +5328,7 @@ class FactureLigne extends CommonInvoiceLine } $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -5450,8 +5370,7 @@ class FactureLigne extends CommonInvoiceLine { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -5491,8 +5410,7 @@ class FactureLigne extends CommonInvoiceLine { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 1fddf20b023..9888bd23d13 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -145,8 +145,7 @@ class PaymentTerm // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -201,8 +200,7 @@ class PaymentTerm // extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -237,8 +235,7 @@ class PaymentTerm // extends CommonObject } $this->db->free($resql); return $ret; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -302,8 +299,7 @@ class PaymentTerm // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -341,8 +337,7 @@ class PaymentTerm // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -391,8 +386,7 @@ class PaymentTerm // extends CommonObject { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 77ff0f813c3..44954d863e5 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -69,14 +69,12 @@ if ($action == 'addcontact' && $user->rights->facture->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -88,8 +86,7 @@ elseif ($action == 'swapstatut' && $user->rights->facture->creer) if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne')); - } - else { + } else { dol_print_error($db); } } @@ -104,8 +101,7 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } @@ -204,8 +200,7 @@ if ($id > 0 || !empty($ref)) $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); if ($res) break; } - } - else { + } else { // Record not found print "ErrorRecordNotFound"; } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 7e95b92cc3d..ed9b032ae90 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -181,12 +181,10 @@ if ($id > 0 || !empty($ref)) $permtoedit = $user->rights->facture->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; - } - else { + } else { dol_print_error($db); } -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 8275dbcf450..dfda4a5b16d 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -609,8 +609,7 @@ if ($resql) if (!$invoicerectmp->isMaxNbGenReached()) { if (!$objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late")); - } - else { + } else { print img_info($langs->trans("MaxNumberOfGenerationReached")); } print '
'; @@ -653,17 +652,14 @@ if ($resql) if ($invoicerectmp->isMaxNbGenReached()) { print $langs->trans("MaxNumberOfGenerationReached"); - } - elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) + } elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print ''; print $langs->trans("CreateBill").''; - } - else { + } else { print $form->textwithpicto('', $langs->trans("DateIsNotEnough")); } - } - else { + } else { print " "; } if (!$i) $totalarray['nbfield']++; @@ -673,8 +669,7 @@ if ($resql) $i++; } - } - else { + } else { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } print ''.$langs->trans("NoRecordFound").''; @@ -689,8 +684,7 @@ if ($resql) print ""; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 7b3025db810..c21d19ad538 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -304,8 +304,7 @@ if ($massaction == 'makepayment'){ header('Location: '.$loc); exit; -} -elseif ($massaction == 'withdrawrequest') +} elseif ($massaction == 'withdrawrequest') { $langs->load("withdrawals"); @@ -313,8 +312,7 @@ elseif ($massaction == 'withdrawrequest') { $error++; setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); - } - else { + } else { //Checking error $error = 0; @@ -362,12 +360,10 @@ elseif ($massaction == 'withdrawrequest') if ($numprlv > 0) { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings'); - } - elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code != 'PRE') { + } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code != 'PRE') { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); - } - else { + } else { $listofbills[] = $objecttmp; // $listofbills will only contains invoices with good payment method and no request already done } } @@ -385,8 +381,7 @@ elseif ($massaction == 'withdrawrequest') { $db->commit(); $nbwithdrawrequestok++; - } - else { + } else { $db->rollback(); setEventMessages($aBill->error, $aBill->errors, 'errors'); } @@ -513,8 +508,7 @@ if ($search_status != '-1' && $search_status != '') if ($search_status == '1') $sql .= " AND f.fk_statut = 1"; // unpayed if ($search_status == '2') $sql .= " AND f.fk_statut = 2"; // payed Not that some corrupted data may contains f.fk_statut = 1 AND f.paye = 1 (it means payed too but should not happend. If yes, reopen and reclassify billed) if ($search_status == '3') $sql .= " AND f.fk_statut = 3"; // abandonned - } - else { + } else { $sql .= " AND f.fk_statut IN (".$db->escape($search_status).")"; // When search_status is '1,2' for example } } @@ -560,8 +554,7 @@ if (!$sall) if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : ''); } -} -else { +} else { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } @@ -670,8 +663,7 @@ if ($resql) if ($user->rights->facture->supprimer) { if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) { $arrayofmassactions['predeletedraft'] = $langs->trans("Deletedraft"); - } - elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation + } elseif (!empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) { // mass deletion never possible on invoices on such situation $arrayofmassactions['predelete'] = $langs->trans("Delete"); } } @@ -1215,8 +1207,7 @@ if ($resql) if ($contextpage == 'poslist') { print $obj->ref; - } - else { + } else { print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1); } @@ -1311,8 +1302,7 @@ if ($resql) if ($contextpage == 'poslist') { print $thirdpartystatic->name; - } - else { + } else { print $thirdpartystatic->getNomUrl(1, 'customer'); } print ''; @@ -1613,8 +1603,7 @@ if ($resql) $title = ''; print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 109231a240d..7cbe336e126 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -86,8 +86,7 @@ if (empty($reshook)) $db->commit(); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -291,12 +290,10 @@ if ($object->id > 0) if ($action == 'editinvoicedate') { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate'); - } - else { + } else { print dol_print_date($object->date, 'daytext'); } - } - else { + } else { print dol_print_date($object->date, 'daytext'); } print ''; @@ -315,12 +312,10 @@ if ($object->id > 0) if ($action == 'editconditions') { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); - } - else { + } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); } - } - else { + } else { print ' '; } print ''; @@ -338,15 +333,13 @@ if ($object->id > 0) if ($action == 'editpaymentterm') { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date_lim_reglement, 'paymentterm'); - } - else { + } else { print dol_print_date($object->date_lim_reglement, 'daytext'); if ($object->hasDelay()) { print img_warning($langs->trans('Late')); } } - } - else { + } else { print ' '; } print ''; @@ -362,8 +355,7 @@ if ($object->id > 0) if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id'); - } - else { + } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); } print ''; @@ -380,8 +372,7 @@ if ($object->id > 0) if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } - else { + } else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -493,8 +484,7 @@ if ($object->id > 0) { $num = $db->num_rows($result_sql); $numopen = $num; - } - else { + } else { dol_print_error($db); } @@ -510,8 +500,7 @@ if ($object->id > 0) { $obj = $db->fetch_object($result_sql); if ($obj) $pending = $obj->amount; - } - else { + } else { dol_print_error($db); } @@ -538,22 +527,18 @@ if ($object->id > 0) print ''; print ''; print ''; - } - else { + } else { print ''.$langs->trans("MakeWithdrawRequest").''; } - } - else { + } else { print ''.$langs->trans("MakeWithdrawRequest").''; } - } - else { + } else { if ($num == 0) { if ($object->statut > Facture::STATUS_DRAFT) print ''.$langs->trans("MakeWithdrawRequest").''; else print ''.$langs->trans("MakeWithdrawRequest").''; - } - else print ''.$langs->trans("MakeWithdrawRequest").''; + } else print ''.$langs->trans("MakeWithdrawRequest").''; } print "

\n"; @@ -620,8 +605,7 @@ if ($object->id > 0) } $db->free($result_sql); - } - else { + } else { dol_print_error($db); } @@ -681,8 +665,7 @@ if ($object->id > 0) print ''.$langs->trans("None").''; $db->free($result); - } - else { + } else { dol_print_error($db); } diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index d0c7eacffc6..82ba8a33467 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -180,8 +180,7 @@ if (!$user->rights->societe->client->voir || $user->socid) $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; @@ -368,8 +367,7 @@ print '
'; // Show graphs print ''; print ''; print ''; - } - else { + } else { print ''; } print "
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { print $px1->show(); print "
\n"; print $px2->show(); diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 571a00d6b47..ef35c03eb54 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -78,8 +78,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) // If not abandonned $total = $total + $sign * $objectlink->total_ht; echo price($objectlink->total_ht); - } - else { + } else { echo ''.price($objectlink->total_ht).''; } } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 2efe20a2fc5..d5daadcb557 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -214,14 +214,12 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'.$langs->trans("Total").''.price($tot_ttc).'
'.$langs->trans("NoInvoice").'

"; $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -300,14 +298,12 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''.$langs->trans("Total").''; print ''.price($tot_ttc).''; print ''; - } - else { + } else { print ''.$langs->trans("NoInvoice").''; } print "

"; $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -424,16 +420,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $i++; } - } - else { + } else { $colspan = 5; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -523,15 +517,13 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $totalam += $obj->am; $i++; } - } - else { + } else { $colspan = 5; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; - } - else { + } else { dol_print_error($db); } } @@ -600,13 +592,11 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire) $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } print '
'; - } - else dol_print_error($db); + } else dol_print_error($db); } /** @@ -677,14 +667,12 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ' '; print ''; - } - else { + } else { print ''.$langs->trans("None").''; } print "
"; $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -804,8 +792,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user print '
'; } $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -927,16 +914,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print ''.price($totalam).''; print ' '; print ''; - } - else { + } else { $colspan = 6; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -1035,15 +1020,13 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''.price($totalam).''; print ' '; print ''; - } - else { + } else { $colspan = 6; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 91d855d4454..78ef32072d6 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -168,8 +168,7 @@ if ($result) $i++; } -} -else { +} else { dol_print_error($db); } @@ -238,8 +237,7 @@ foreach ($tabfac as $key => $val) { print ''.($mt < 0 ?price(-$mt) : '').""; print ''.($mt >= 0 ?price($mt) : '').""; - } - else { + } else { print ''.($mt >= 0 ?price($mt) : '').""; print ''.($mt < 0 ?price(-$mt) : '').""; } diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index a7eb09de31a..bd44f6c47cc 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -114,8 +114,7 @@ $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.fk_statut > 0"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")"; -} -else { +} else { $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_STANDARD.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")"; } @@ -195,8 +194,7 @@ if ($result) $tabcompany[$obj->rowid] = array('id'=>$obj->socid, 'name'=>$obj->name, 'client'=>$obj->client); $i++; } -} -else { +} else { dol_print_error($db); } @@ -268,8 +266,7 @@ foreach ($tabfac as $key => $val) { print ''.($mt >= 0 ?price($mt) : '').""; print ''.($mt < 0 ?price(-$mt) : '').""; - } - else { + } else { print ''.($mt < 0 ?price(-$mt) : '').""; print ''.($mt >= 0 ?price($mt) : '').""; } diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index e5a20b5486b..cd7bbfd11c2 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -80,8 +80,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $db->commit(); header("Location: list.php?localTaxType=".$lttype); exit; - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $_GET["action"] = "create"; @@ -112,19 +111,16 @@ if ($action == 'delete') $db->commit(); header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$object->ltt); exit; - } - else { + } else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; setEventMessages($mesg, null, 'errors'); } @@ -285,8 +281,7 @@ if ($id) if ($object->rappro == 0) { print ''.$langs->trans("Delete").''; - } - else { + } else { print ''.$langs->trans("Delete").''; } print ""; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 59adc220c8f..1dfeb0b8930 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -137,13 +137,11 @@ class Localtax extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -204,8 +202,7 @@ class Localtax extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -267,8 +264,7 @@ class Localtax extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -373,13 +369,11 @@ class Localtax extends CommonObject $ret = $obj->amount; $this->db->free($result); return $ret; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { print $this->db->lasterror(); return -1; } @@ -412,13 +406,11 @@ class Localtax extends CommonObject $ret = $obj->total_localtax; $this->db->free($result); return $ret; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { print $this->db->lasterror(); return -1; } @@ -453,13 +445,11 @@ class Localtax extends CommonObject $ret = $obj->amount; $this->db->free($result); return $ret; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { print $this->db->lasterror(); return -1; } @@ -537,8 +527,7 @@ class Localtax extends CommonObject if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); - } - else { + } else { $this->error = $acc->error; $ok = 0; } @@ -556,19 +545,16 @@ class Localtax extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -3; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -590,8 +576,7 @@ class Localtax extends CommonObject $result = $this->db->query($sql); if ($result) { return 1; - } - else { + } else { dol_print_error($this->db); return -1; } diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 12112766c24..10111dd7faa 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -53,15 +53,13 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $q = GETPOST("q"); if (empty($q)) { - if (GETPOST("month")) { $date_start = dol_get_first_day($year_start, GETPOST("month"), false); $date_end = dol_get_last_day($year_start, GETPOST("month"), false); } - else { + if (GETPOST("month")) { $date_start = dol_get_first_day($year_start, GETPOST("month"), false); $date_end = dol_get_last_day($year_start, GETPOST("month"), false); } else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -199,8 +197,7 @@ if ($calc == 0 || $calc == 2) if ($coll->assuj == '1') { $intra = $langs->trans('Unknown'); - } - else { + } else { $intra = ''; } } @@ -226,8 +223,7 @@ if ($calc == 0 || $calc == 2) print ''.price($totalamount).''; print ''.price($total).''; print ''; - } - else { + } else { $langs->load("errors"); if ($coll_list == -1) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; @@ -269,8 +265,7 @@ if ($calc == 0 || $calc == 1) { if ($coll->assuj == '1') { $intra = $langs->trans('Unknown'); - } - else { + } else { $intra = ''; } } @@ -298,8 +293,7 @@ if ($calc == 0 || $calc == 1) { print ''; print ''; - } - else { + } else { $langs->load("errors"); if ($coll_list == -1) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index b8a906ac818..8e810495ff4 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -52,13 +52,11 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $q = GETPOST("q", "int"); if (empty($q)) { - if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else { + if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; } - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -150,8 +148,7 @@ function pt($db, $sql, $date) $amountpaid = 0; $previousmode = ''; $previousmonth = ''; - } - else { + } else { $previousmode = $obj->mode; $previousmonth = $obj->dm; } @@ -179,8 +176,7 @@ function pt($db, $sql, $date) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } @@ -385,8 +381,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc 'localtax2' =>$x_paye[$my_paye_rate]['localtax2_list'][$id], //'link' =>$expensereport->getNomUrl(1) ); - } - else { + } else { //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 58ec8cb090e..a8b37c3ef93 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -95,8 +95,7 @@ if ($result) print ""; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 45d34f10cce..058f6871c7d 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -63,15 +63,13 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $q = GETPOST("q", "int"); if (empty($q)) { - if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else { + if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -221,8 +219,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) elseif ($x_coll == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; else print ''.$langs->trans("Error").''; -} -else { +} else { $x_both = array(); //now, from these two arrays, get another array with one rate per line @@ -368,8 +365,7 @@ else { $product_static->type = $fields['ptype']; print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); - } - else { + } else { if ($type) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) @@ -411,8 +407,7 @@ else { if ($type == 0) { print $langs->trans("NotUsedForGoods"); - } - else { + } else { print price($fields['payment_amount']); if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; } @@ -527,8 +522,7 @@ else { $product_static->type = $fields['ptype']; print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); - } - else { + } else { if ($type) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); @@ -566,8 +560,7 @@ else { if ($type == 0) { print $langs->trans("NA"); - } - else { + } else { print price(price2num($fields['payment_amount'], 'MT')); if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 5c0f258a091..4eea16f706b 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -131,8 +131,7 @@ if (empty($reshook)) } $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => $_POST[$key]); - } - elseif (substr($key, 0, 21) == 'multicurrency_amount_') + } elseif (substr($key, 0, 21) == 'multicurrency_amount_') { $cursorfacid = substr($key, 21); $multicurrency_amounts[$cursorfacid] = price2num(trim(GETPOST($key))); @@ -312,8 +311,7 @@ if (empty($reshook)) else $loc = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id; header('Location: '.$loc); exit; - } - else { + } else { $db->rollback(); } } @@ -502,8 +500,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; $form->select_comptes($accountid, 'accountid', 0, '', 2); print ''; - } - else { + } else { print ' '; } print "\n"; @@ -558,8 +555,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if ($facture->type != Facture::TYPE_CREDIT_NOTE) { $sql .= ' AND type IN (0,1,3,5)'; // Standard invoice, replacement, deposit, situation - } - else { + } else { $sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes } // Sort invoices by date and serial number: the older one comes first @@ -662,8 +658,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ''; - } - else { + } else { print ''; } @@ -706,8 +701,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); print ''; print ''; - } - else { + } else { print ''; print ''; } @@ -741,8 +735,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'"); print ''; print ''; - } - else { + } else { print ''; print ''; } @@ -797,8 +790,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie //print "\n"; } $db->free($resql); - } - else { + } else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index f67a2e2c12a..4acfd34a53a 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -65,8 +65,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement) { $db->commit(); $action = ''; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -86,13 +85,11 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture-> { header("Location: ".$backtopage); exit; - } - else { + } else { header("Location: list.php"); exit; } - } - else { + } else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -128,8 +125,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture-> header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); exit; - } - else { + } else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -143,8 +139,7 @@ if ($action == 'setnum_paiement' && !empty($_POST['num_paiement'])) if ($res === 0) { setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors'); } } @@ -157,8 +152,7 @@ if ($action == 'setdatep' && !empty($_POST['datepday'])) if ($res === 0) { setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors'); } } @@ -407,8 +401,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } @@ -438,8 +431,7 @@ if ($user->socid == 0 && $action == '') if (!$disable_delete) { print ''.$langs->trans('Delete').''; - } - else { + } else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 44a160b35e0..5c490ce3128 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -79,8 +79,7 @@ if ($action == 'setdate' && $user->rights->banque->cheque) { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -97,8 +96,7 @@ if ($action == 'setrefext' && $user->rights->banque->cheque) { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -115,8 +113,7 @@ if ($action == 'setref' && $user->rights->banque->cheque) { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -146,12 +143,10 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs'); $action = 'new'; } @@ -165,8 +160,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -179,8 +173,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c { header("Location: index.php"); exit; - } - else { + } else { setEventMessages($paiement->error, $paiement->errors, 'errors'); } } @@ -205,8 +198,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -224,8 +216,7 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban //header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id); //exit; $action = ''; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -252,8 +243,7 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) { dol_print_error($db, $object->error); exit; - } - else { + } else { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc')); exit; } @@ -304,8 +294,7 @@ if ($action == 'new') $h++; print load_fiche_titre($langs->trans("Cheques"), '', 'bank_account'); -} -else { +} else { $result = $object->fetch($id, $ref); if ($result < 0) { @@ -498,8 +487,7 @@ if ($action == 'new') if ($paymentstatic->id) { print $paymentstatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -509,8 +497,7 @@ if ($action == 'new') if ($accountlinestatic->rowid) { print $accountlinestatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -530,15 +517,13 @@ if ($action == 'new') if ($user->rights->banque->cheque) { print ''; - } - else { + } else { print ''.$langs->trans('NewCheckDepositOn', $account_label).''; } print '
'; print ''; } -} -else { +} else { $paymentstatic = new Paiement($db); $accountlinestatic = new AccountLine($db); $accountstatic = new Account($db); @@ -572,8 +557,7 @@ else { print $form->selectDate($object->date_bordereau, 'datecreate_', '', '', '', "setdate"); print ''; print ''; - } - else { + } else { print $object->date_bordereau ? dol_print_date($object->date_bordereau, 'day') : ' '; } @@ -683,8 +667,7 @@ else { if ($paymentstatic->id) { print $paymentstatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -694,8 +677,7 @@ else { if ($accountlinestatic->rowid) { print $accountlinestatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -718,8 +700,7 @@ else { $i++; } - } - else { + } else { print ''; print $langs->trans("None"); print ''; @@ -736,8 +717,7 @@ else { } print ""; - } - else { + } else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 9d252a7456e..48c58dc7219 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -120,16 +120,14 @@ class RemiseCheque extends CommonObject if ($this->statut == 0) { $this->ref = "(PROV".$this->id.")"; - } - else { + } else { $this->ref = $obj->ref; } } $this->db->free($resql); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -225,8 +223,7 @@ class RemiseCheque extends CommonObject array_push($lines, $row[0]); } $this->db->free($resql); - } - else { + } else { $this->errno = -1026; dol_syslog("RemiseCheque::Create Error ".$this->errno, LOG_ERR); } @@ -266,8 +263,7 @@ class RemiseCheque extends CommonObject dol_syslog("RemiseCheque::Create Error update amount ".$this->errno, LOG_ERR); } } - } - else { + } else { $this->errno = -1; $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); @@ -284,8 +280,7 @@ class RemiseCheque extends CommonObject $this->db->commit(); dol_syslog("RemiseCheque::Create end", LOG_DEBUG); return $this->id; - } - else { + } else { $this->db->rollback(); dol_syslog("RemiseCheque::Create end", LOG_DEBUG); return $this->errno; @@ -336,8 +331,7 @@ class RemiseCheque extends CommonObject if ($this->errno === 0) { $this->db->commit(); - } - else { + } else { $this->db->rollback(); dol_syslog("RemiseCheque::Delete ROLLBACK ($this->errno)"); } @@ -379,13 +373,11 @@ class RemiseCheque extends CommonObject { $this->ref = $numref; $this->statut = 1; - } - else { + } else { $this->errno = -1029; dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR); } - } - else { + } else { $this->errno = -1033; dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR); } @@ -396,8 +388,7 @@ class RemiseCheque extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); dol_syslog("RemiseCheque::Validate ".$this->errno, LOG_ERR); return $this->errno; @@ -479,8 +470,7 @@ class RemiseCheque extends CommonObject } return $numref; - } - else { + } else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Bank")); return ""; @@ -534,8 +524,7 @@ class RemiseCheque extends CommonObject } return $response; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -573,8 +562,7 @@ class RemiseCheque extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -652,15 +640,13 @@ class RemiseCheque extends CommonObject { //$outputlangs->charset_output=$sav_charset_output; return 1; - } - else { + } else { //$outputlangs->charset_output=$sav_charset_output; dol_syslog("Error"); dol_print_error($this->db, $docmodel->error); return 0; } - } - else { + } else { $this->error = $langs->trans("ErrorFileDoesNotExists", $dir.$file); return -1; } @@ -706,8 +692,7 @@ class RemiseCheque extends CommonObject $this->errno = -1030; dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); } - } - else { + } else { $this->errno = -1031; dol_syslog("RemiseCheque::updateAmount ERREUR SELECT ($this->errno)"); } @@ -715,8 +700,7 @@ class RemiseCheque extends CommonObject if ($this->errno === 0) { $this->db->commit(); - } - else { + } else { $this->db->rollback(); dol_syslog("RemiseCheque::updateAmount ROLLBACK ($this->errno)"); } @@ -745,8 +729,7 @@ class RemiseCheque extends CommonObject if ($resql) { $this->updateAmount(); - } - else { + } else { $this->errno = -1032; dol_syslog("RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)"); } @@ -821,27 +804,23 @@ class RemiseCheque extends CommonObject { $this->db->commit(); return $rejectedPayment->id; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $rejectedPayment->error; $this->errors = $rejectedPayment->errors; $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $rejectedPayment->error; $this->errors = $rejectedPayment->errors; $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -914,13 +893,11 @@ class RemiseCheque extends CommonObject { $this->date_bordereau = $date; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } - } - else { + } else { return -2; } } @@ -947,13 +924,11 @@ class RemiseCheque extends CommonObject if ($resql) { return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } - } - else { + } else { return -2; } } @@ -1021,8 +996,7 @@ class RemiseCheque extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 7971a34db0d..1ee79aeafd9 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -76,8 +76,7 @@ if ($resql) { print ''.$num.''; print ''; print "\n"; -} -else { +} else { dol_print_error($db); } @@ -139,8 +138,7 @@ if ($resql) print ""; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index cda8c2a679d..e76936c71fd 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -221,8 +221,7 @@ if ($resql) print "\n"; $i++; } - } - else { + } else { print ''; print ''.$langs->trans("None").""; print ''; @@ -230,8 +229,7 @@ if ($resql) print ""; print ""; print "\n"; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 99250bd9373..f57e4408a6f 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -200,13 +200,11 @@ class Paiement extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->db->free($resql); return 0; } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -240,8 +238,7 @@ class Paiement extends CommonObject { $amounts = &$this->amounts; $amounts_to_update = &$this->multicurrency_amounts; - } - else { + } else { $amounts = &$this->multicurrency_amounts; $amounts_to_update = &$this->amounts; } @@ -279,8 +276,7 @@ class Paiement extends CommonObject { $total = $totalamount; $mtotal = $totalamount_converted; // Maybe use price2num with MT for the converted value - } - else { + } else { $total = $totalamount_converted; // Maybe use price2num with MT for the converted value $mtotal = $totalamount; } @@ -424,13 +420,11 @@ class Paiement extends CommonObject $error++; } } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } - } - else { + } else { dol_syslog(get_class($this).'::Create Amount line '.$key.' not a number. We discard it.'); } } @@ -442,8 +436,7 @@ class Paiement extends CommonObject if ($result < 0) { $error++; } // Fin appel triggers } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -455,8 +448,7 @@ class Paiement extends CommonObject $this->multicurrency_amount = $mtotal; $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -492,8 +484,7 @@ class Paiement extends CommonObject $this->db->rollback(); return -1; } - } - else { + } else { $this->db->rollback(); return -2; } @@ -557,8 +548,7 @@ class Paiement extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error; $this->db->rollback(); return -5; @@ -719,8 +709,7 @@ class Paiement extends CommonObject if ($result < 0) { $error++; } // Fin appel triggers } - } - else { + } else { $this->error = $acc->error; $error++; } @@ -728,8 +717,7 @@ class Paiement extends CommonObject if (!$error) { $this->db->commit(); - } - else { + } else { $this->db->rollback(); } } @@ -737,8 +725,7 @@ class Paiement extends CommonObject if (!$error) { return $bank_line_id; - } - else { + } else { return -1; } } @@ -762,8 +749,7 @@ class Paiement extends CommonObject if ($result) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::update_fk_bank '.$this->error); return -1; @@ -824,8 +810,7 @@ class Paiement extends CommonObject $this->db->commit(); return 0; - } - else { + } else { $this->db->rollback(); return -2; } @@ -854,8 +839,7 @@ class Paiement extends CommonObject { $this->num_payment = $this->db->escape($num); return 0; - } - else { + } else { $this->error = 'Error -1 '.$this->db->error(); return -2; } @@ -878,8 +862,7 @@ class Paiement extends CommonObject if ($result) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::valide '.$this->error); return -1; @@ -901,8 +884,7 @@ class Paiement extends CommonObject if ($result) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::reject '.$this->error); return -1; @@ -946,8 +928,7 @@ class Paiement extends CommonObject $this->date_modification = $this->db->jdate($obj->tms); } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -979,8 +960,7 @@ class Paiement extends CommonObject } return $billsarray; - } - else { + } else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' -', LOG_DEBUG); return -1; @@ -1012,8 +992,7 @@ class Paiement extends CommonObject } return $amounts; - } - else { + } else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::getAmountsArray Error '.$this->error.' -', LOG_DEBUG); return -1; @@ -1096,8 +1075,7 @@ class Paiement extends CommonObject } return $numref; - } - else { + } else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice")); return ""; @@ -1198,8 +1176,7 @@ class Paiement extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $url = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index dbdf4f4675e..eb2523960f3 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -129,8 +129,7 @@ if (GETPOST("orphelins", "alpha")) $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -} -else { +} else { $sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives $sql .= " p.statut, p.num_paiement as num_payment,"; $sql .= " c.code as paiement_code,"; @@ -377,8 +376,7 @@ if ($resql) print "\n"; print ""; print "\n"; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 66f239fdf96..9d3bae3140d 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -70,8 +70,7 @@ if ($action == 'builddoc') if ($rap->write_file($dir, $_POST["remonth"], $_POST["reyear"], $outputlangs) > 0) { $outputlangs->charset_output = $sav_charset_output; - } - else { + } else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, $obj->error); } diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index b978fc8e218..349c483a5db 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -126,8 +126,7 @@ if ($resql) if ($objp->statut == 0) { print ''.$langs->trans("PaymentStatusToValidShort").''; - } - else { + } else { print "-"; } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index d1b448c5932..9c5ceea22bf 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -141,8 +141,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $loc = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid; header('Location: '.$loc); exit; - } - else { + } else { $db->rollback(); } } @@ -282,8 +281,7 @@ if ($action == 'create') if ($objp->date_ech > 0) { print ''.dol_print_date($objp->date_ech, 'day').''."\n"; - } - else { + } else { print "!!!\n"; } @@ -303,8 +301,7 @@ if ($action == 'create') $remaintopay = $objp->amount - $sumpaid; print ''; print ''; - } - else { + } else { print '-'; } print ""; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 69b425356d1..fbe5d926d33 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -66,8 +66,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char $db->commit(); header("Location: ".DOL_URL_ROOT."/compta/sociales/payments.php?mode=sconly"); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -282,8 +281,7 @@ if ($resql) print "\n"; $db->free($resql); -} -else { +} else { dol_print_error($db); } @@ -314,8 +312,7 @@ if ($action == '') if (!$disable_delete) { print ''.$langs->trans('Delete').''; - } - else { + } else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index d2611e8a354..63769e2bd9e 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -158,13 +158,11 @@ if ($resql) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).''; } print "
"; -} -else { +} else { dol_print_error($db); } @@ -218,8 +216,7 @@ if ($result) } print "
"; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 106f848f732..347b3ebb37f 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -190,8 +190,7 @@ if ($result) print ''; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index d5051e06bfa..7d56cec823e 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -408,8 +408,7 @@ if ($id > 0 || $ref) if ($obj->statut == 3) { print ''.$langs->trans("StatusRefused").''; - } - else { + } else { print " "; } @@ -441,8 +440,7 @@ if ($id > 0 || $ref) print ''; $db->free($result); - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 91a165ee454..6192d97d92f 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -151,18 +151,15 @@ class BonPrelevement extends CommonObject if ($this->db->query($sql)) { $result = 0; - } - else { + } else { $result = -1; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } - } - else { + } else { $result = -2; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } - } - else { + } else { $result = -3; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } @@ -205,12 +202,10 @@ class BonPrelevement extends CommonObject if ($resql) { $num = $this->db->num_rows($resql); - } - else { + } else { $result = -1; } - } - else { + } else { /* * No aggregate */ @@ -238,8 +233,7 @@ class BonPrelevement extends CommonObject { $line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes"); $result = 0; - } - else { + } else { dol_syslog(get_class($this)."::addline Error -2"); $result = -2; } @@ -314,13 +308,11 @@ class BonPrelevement extends CommonObject $this->fetched = 1; return 1; - } - else { + } else { dol_syslog(get_class($this)."::Fetch Erreur aucune ligne retournee"); return -1; } - } - else { + } else { return -2; } } @@ -388,15 +380,13 @@ class BonPrelevement extends CommonObject { $this->db->commit(); return 0; - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::set_credite ROLLBACK "); return -1; } - } - else { + } else { dol_syslog(get_class($this)."::set_credite Ouverture transaction SQL impossible "); return -2; } @@ -480,8 +470,7 @@ class BonPrelevement extends CommonObject { dol_syslog(get_class($this)."::set_infocredit AddPayment Error"); $error++; - } - else { + } else { $result = $paiement->addPaymentToBank($user, 'payment', '(WithdrawalPayment)', $bankaccount, '', ''); if ($result < 0) { @@ -505,8 +494,7 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::set_infocredit Update lines Error"); $error++; } - } - else { + } else { dol_syslog(get_class($this)."::set_infocredit Update Bons Error"); $error++; } @@ -521,24 +509,20 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 0; - } - else { + } else { $this->db->rollback(); dol_syslog("bon-prelevment::set_infocredit ROLLBACK "); return -1; } - } - else { + } else { dol_syslog(get_class($this)."::set_infocredit 1025 Open SQL transaction impossible "); return -1025; } - } - else { + } else { dol_syslog("bon-prelevment::set_infocredit 1027 Date de credit < Date de trans "); return -1027; } - } - else { + } else { return -1026; } } @@ -580,8 +564,7 @@ class BonPrelevement extends CommonObject $message .= $langs->trans("InfoTransData", price($this->amount), $this->methodes_trans[$this->method_trans], dol_print_date($date, 'day')); // TODO Call trigger to create a notification using notification module - } - else { + } else { $error++; } @@ -592,15 +575,13 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 0; - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::set_infotrans ROLLBACK", LOG_ERR); return -1; } - } - else { + } else { dol_syslog(get_class($this)."::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT); return -2; } @@ -655,8 +636,7 @@ class BonPrelevement extends CommonObject } } $this->db->free($resql); - } - else { + } else { dol_syslog(get_class($this)."::getListInvoices Erreur"); } @@ -693,8 +673,7 @@ class BonPrelevement extends CommonObject $this->db->free($resql); return $obj->nb; - } - else { + } else { $error = 1; dol_syslog(get_class($this)."::SommeAPrelever Erreur -1"); dol_syslog($this->db->error()); @@ -737,8 +716,7 @@ class BonPrelevement extends CommonObject $this->db->free($resql); return $obj->nb; - } - else { + } else { $this->error = get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error(); return -1; } @@ -825,8 +803,7 @@ class BonPrelevement extends CommonObject } $this->db->free($resql); dol_syslog(__METHOD__."::Read invoices, ".$i." invoices to withdraw", LOG_DEBUG); - } - else { + } else { $error++; dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR); } @@ -870,23 +847,19 @@ class BonPrelevement extends CommonObject $factures_prev_id[$i] = $fac[0]; $i++; //dol_syslog(__METHOD__."::RIB is ok", LOG_DEBUG); - } - else { + } else { dol_syslog(__METHOD__."::Check RIB Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_WARNING); $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } - } - else { + } else { dol_syslog(__METHOD__."::Check RIB Failed to read company", LOG_WARNING); } - } - else { + } else { dol_syslog(__METHOD__."::Check RIB Failed to read invoice", LOG_WARNING); } } - } - else { + } else { dol_syslog(__METHOD__."::Check RIB No invoice to process", LOG_WARNING); } } @@ -912,8 +885,7 @@ class BonPrelevement extends CommonObject if ($mode == 'real') { $ok = 1; - } - else { + } else { print $langs->trans("ModeWarning"); //"Option for real mode was not set, we stop after this simulation\n"; } } @@ -970,13 +942,11 @@ class BonPrelevement extends CommonObject $prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons"); $this->id = $prev_id; $this->ref = $ref; - } - else { + } else { $error++; dol_syslog(__METHOD__."::Create withdraw receipt ".$this->db->lasterror(), LOG_ERR); } - } - else { + } else { $error++; dol_syslog(__METHOD__."::Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR); } @@ -1097,14 +1067,12 @@ class BonPrelevement extends CommonObject if (!$error) { $this->db->commit(); - } - else { + } else { $this->db->rollback(); } return count($factures_prev); - } - else { + } else { return 0; } } @@ -1164,8 +1132,7 @@ class BonPrelevement extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1224,8 +1191,7 @@ class BonPrelevement extends CommonObject $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; */ - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -1266,8 +1232,7 @@ class BonPrelevement extends CommonObject if ($this->db->query($sql)) { return 0; - } - else { + } else { return -1; } } @@ -1291,8 +1256,7 @@ class BonPrelevement extends CommonObject if ($this->db->query($sql)) { return 0; - } - else { + } else { return -1; } } @@ -1322,8 +1286,7 @@ class BonPrelevement extends CommonObject if ($this->db->query($sql)) { $result = 0; - } - else { + } else { $result = -1; dol_syslog(get_class($this)."::AddNotification Error $result"); } @@ -1426,8 +1389,7 @@ class BonPrelevement extends CommonObject $i++; } $nbtotalDrctDbtTxInf = $i; - } - else { + } else { fputs($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers $result = -2; } @@ -1436,8 +1398,7 @@ class BonPrelevement extends CommonObject if ($result != -2) { $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); - } - else { + } else { fputs($this->file, 'ERROR CREDITOR'.$CrLf); // CREDITOR = My company } @@ -1503,8 +1464,7 @@ class BonPrelevement extends CommonObject $this->total = $this->total + $obj->amount; $i++; } - } - else { + } else { $result = -2; } @@ -1874,8 +1834,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - } - else { + } else { fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf); $result = -2; } diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index accd64e2694..1e731b24524 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -96,15 +96,13 @@ class LignePrelevement $this->statut = $obj->statut; $this->bon_ref = $obj->ref; $this->bon_rowid = $obj->bon_rowid; - } - else { + } else { $result++; dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0"); } $this->db->free($resql); - } - else { + } else { $result++; dol_syslog("LignePrelevement::Fetch rowid=$rowid"); dol_syslog($this->db->error()); @@ -140,20 +138,17 @@ class LignePrelevement if ($mode == 0) { return $langs->trans($this->statuts[$status]); - } - elseif ($mode == 1) + } elseif ($mode == 1) { if ($status == 0) return img_picto($langs->trans($this->statuts[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]); // Waiting elseif ($status == 2) return img_picto($langs->trans($this->statuts[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); // Credited elseif ($status == 3) return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]); // Refused - } - elseif ($mode == 2) + } elseif ($mode == 2) { if ($status == 0) return img_picto($langs->trans($this->statuts[$status]), 'statut1'); elseif ($status == 2) return img_picto($langs->trans($this->statuts[$status]), 'statut6'); elseif ($status == 3) return img_picto($langs->trans($this->statuts[$status]), 'statut8'); - } - elseif ($mode == 3) + } elseif ($mode == 3) { if ($status == 0) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut1'); elseif ($status == 2) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6'); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 1edd942fc42..8599987fb23 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -160,8 +160,7 @@ class RejetPrelevement { $error++; dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]); - } - else { + } else { $result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', ''); if ($result < 0) { @@ -190,8 +189,7 @@ class RejetPrelevement { dol_syslog("RejetPrelevement::Create Commit"); $this->db->commit(); - } - else { + } else { dol_syslog("RejetPrelevement::Create Rollback"); $this->db->rollback(); } @@ -225,8 +223,7 @@ class RejetPrelevement $row = $this->db->fetch_row($resql); $userid = $row[0]; } - } - else { + } else { dol_syslog("RejetPrelevement::_send_email Erreur lecture user"); } @@ -262,12 +259,10 @@ class RejetPrelevement if ($result) { dol_syslog("RejetPrelevement::_send_email email envoye"); - } - else { + } else { dol_syslog("RejetPrelevement::_send_email Erreur envoi email"); } - } - else { + } else { dol_syslog("RejetPrelevement::_send_email Userid invalide"); } } @@ -315,8 +310,7 @@ class RejetPrelevement } } $this->db->free($resql); - } - else { + } else { dol_syslog("getListInvoices", LOG_ERR); } @@ -351,13 +345,11 @@ class RejetPrelevement $this->db->free($resql); return 0; - } - else { + } else { dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid numrows=0"); return -1; } - } - else { + } else { dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid"); return -2; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 505ad070645..015380a669d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -83,8 +83,7 @@ if (empty($reshook)) if ($result < 0) { setEventMessages($bprev->error, $bprev->errors, 'errors'); - } - elseif ($result == 0) + } elseif ($result == 0) { $mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format); setEventMessages($mesg, null, 'errors'); @@ -93,8 +92,7 @@ if (empty($reshook)) { $mesg .= ''.$val."
\n"; } - } - else { + } else { setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); } } @@ -173,19 +171,16 @@ if ($nb) { } else { print '
'.$langs->trans("CreateAll")."\n"; } - } - else { + } else { if ($mysoc->isInEEC()) { print ''.$langs->trans("CreateForSepaFRST")."\n"; print ''.$langs->trans("CreateForSepaRCUR")."\n"; - } - else { + } else { print ''.$langs->trans("CreateAll")."\n"; } } -} -else { +} else { print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; } @@ -303,15 +298,13 @@ if ($resql) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } print ""; print ""; print "
\n"; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 64ac904db6c..30618de8c24 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -88,8 +88,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (!$status) { $title = $langs->trans("RequestStandingOrderToTreat"); -} -else { +} else { $title = $langs->trans("RequestStandingOrderTreated"); } @@ -141,8 +140,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; -} -else { +} else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index bb3cced3eb4..c0fa4f55e68 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -134,8 +134,7 @@ if ($prev_id > 0 || $ref) print ''; dol_fiche_end(); - } - else { + } else { dol_print_error($db); } } @@ -245,12 +244,10 @@ if ($result) if ($obj->statut == 0) { print '-'; - } - elseif ($obj->statut == 2) + } elseif ($obj->statut == 2) { print $langs->trans("StatusCredited"); - } - elseif ($obj->statut == 3) + } elseif ($obj->statut == 3) { print ''.$langs->trans("StatusRefused").''; } @@ -288,8 +285,7 @@ if ($result) print ''; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 4bfc07b0292..65116878bb9 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -135,8 +135,7 @@ if ($prev_id > 0 || $ref) print ''; dol_fiche_end(); - } - else { + } else { dol_print_error($db); } } @@ -219,8 +218,7 @@ if ($resql) $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } @@ -236,8 +234,7 @@ if ($resql) print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 5dd01bad41d..0ada15853d9 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -132,8 +132,7 @@ if ($prev_id > 0 || $ref) print ''; dol_fiche_end(); - } - else { + } else { $langs->load("errors"); print $langs->trans("Error"); } @@ -184,8 +183,7 @@ if ($prev_id > 0 || $ref) print ""; $db->free($resql); - } - else { + } else { print $db->error().' '.$sql; } } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index faa56184891..d182176f0fa 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -158,13 +158,11 @@ if ($resql) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders")).''; } print "
"; -} -else { +} else { dol_print_error($db); } @@ -218,8 +216,7 @@ if ($result) } print "
"; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 89d6ad93636..fd77d6d90f6 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -73,9 +73,7 @@ if ($action == 'confirm_rejet') { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); - } - - elseif ($daterej > dol_now()) + } elseif ($daterej > dol_now()) { $error++; $langs->load("error"); @@ -102,12 +100,10 @@ if ($action == 'confirm_rejet') header("Location: line.php?id=".$id); exit; } - } - else { + } else { $action = "rejet"; } - } - else { + } else { header("Location: line.php?id=".$id); exit; } @@ -159,22 +155,19 @@ if ($id) { /* Historique pour certaines install */ print $langs->trans("Unknown"); - } - else { + } else { print dol_print_date($rej->date_rejet, 'day'); } print ''; print ''.$langs->trans("RefusedInvoicing").''.$rej->invoicing.''; - } - else { + } else { print ''.$resf.''; } } print ''; dol_fiche_end(); - } - else { + } else { dol_print_error($db); } @@ -240,12 +233,10 @@ if ($id) if ($user->rights->prelevement->bons->credit) { print "id\">".$langs->trans("StandingOrderReject").""; - } - else { + } else { print "trans("NotAllowed")."\">".$langs->trans("StandingOrderReject").""; } - } - else { + } else { print "trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject").""; } } @@ -322,8 +313,7 @@ if ($id) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index b93042df8e6..3130aa475f6 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -235,8 +235,7 @@ if ($result) print ''; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index a7e7a6f3a53..61417a2cd5f 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -117,8 +117,7 @@ if ($result) print ""; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 609c75e065d..b12a6a2bb35 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -125,8 +125,7 @@ if ($resql) print ' '; print ""; $db->free(); -} -else { +} else { dol_print_error($db); } @@ -218,8 +217,7 @@ if ($resql) print ' '; print ""; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 83388f21e49..8b75ec38fce 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -211,13 +211,11 @@ if ($id > 0) } $db->free($resqlp); - } - else { + } else { dol_print_error($db); } } - } - else { + } else { dol_print_error($db); } @@ -286,8 +284,7 @@ if ($id > 0) print ""; } -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 8d7c0343b30..671921506d5 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -99,8 +99,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $month_end = $month_start - 1; if ($month_end < 1) $month_end = 12; else $year_end++; - } - else $month_end = $month_start; + } else $month_end = $month_start; $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } @@ -154,8 +153,7 @@ if ($modecompta == "CREANCES-DETTES") else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -166,8 +164,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description = $langs->trans("RulesResultInOut"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups"); $calcmode = $langs->trans("CalcModeBookkeeping"); @@ -212,8 +209,7 @@ print_liste_field_titre(''); if ($modecompta == 'BOOKKEEPING') { print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'amount', '', $param, 'class="right"', $sortfield, $sortorder); -} -else { +} else { if ($modecompta == 'CREANCES-DETTES') { print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], 'amount_ht', '', $param, 'class="right"', $sortfield, $sortorder); @@ -311,14 +307,11 @@ if ($modecompta == 'BOOKKEEPING') $i++; } - } - else { + } else { print ''.$langs->trans("NoRecordFound").''; } - } - else dol_print_error($db); -} -else { + } else dol_print_error($db); +} else { /* * Factures clients */ @@ -336,8 +329,7 @@ else { else $sql .= " AND f.type IN (0,1,2,3,5)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == 'RECETTES-DEPENSES') + } elseif ($modecompta == 'RECETTES-DEPENSES') { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -462,8 +454,7 @@ else { else $sql .= " AND f.type IN (0,1,2,3)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == 'RECETTES-DEPENSES') + } elseif ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; @@ -512,8 +503,7 @@ else { print "\n"; $i++; } - } - else { + } else { print ' '; print ''.$langs->trans("None").''; print ''; @@ -546,8 +536,7 @@ else { $sql .= " AND c.deductible = 0"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == 'RECETTES-DEPENSES') + } elseif ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; @@ -591,8 +580,7 @@ else { print ''; $i++; } - } - else { + } else { print ' '; print ''.$langs->trans("None").''; print ''; @@ -623,8 +611,7 @@ else { if (!empty($date_start) && !empty($date_end)) $sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; $sql .= " AND cs.entity = ".$conf->entity; - } - elseif ($modecompta == 'RECETTES-DEPENSES') + } elseif ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; @@ -668,8 +655,7 @@ else { print ''; $i++; } - } - else { + } else { print ' '; print ''.$langs->trans("None").''; print ''; @@ -761,14 +747,12 @@ else { print ''; $i++; } - } - else { + } else { print ' '; print ''.$langs->trans("None").''; print ''; } - } - else { + } else { dol_print_error($db); } print ''; @@ -845,14 +829,12 @@ else { print ''.price(-$obj->amount_ttc).''; print ''; } - } - else { + } else { print ' '; print ''.$langs->trans("None").''; print ''; } - } - else { + } else { dol_print_error($db); } print ''; @@ -877,8 +859,7 @@ else { $sql .= " FROM ".MAIN_DB_PREFIX."don as p"; $sql .= " WHERE p.entity IN (".getEntity('donation').")"; $sql .= " AND fk_statut in (1,2)"; - } - else { + } else { $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."don as p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; @@ -924,14 +905,12 @@ else { print ''; $i++; } - } - else { + } else { print ' '; print ''.$langs->trans("None").''; print ''; } - } - else { + } else { dol_print_error($db); } print ''; @@ -998,8 +977,7 @@ else { print ''.price($subtotal_ht).''; print ''.price($subtotal_ttc).''; print ''; - } - else dol_print_error($db); + } else dol_print_error($db); } /* @@ -1047,8 +1025,7 @@ else { print ''.price($subtotal_ht).''; print ''.price($subtotal_ttc).''; print ''; - } - else dol_print_error($db); + } else dol_print_error($db); } /* @@ -1157,8 +1134,7 @@ else { print ' '."\n"; print ''.price($amount)."\n"; print "\n"; - } - else { + } else { // VAT really already paid $amount = 0; $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; @@ -1237,8 +1213,7 @@ else { } } $db->free($result); - } - else { + } else { dol_print_error($db); } print ' '; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 04bed25d6b2..7221e932ca6 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -78,8 +78,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $month_end = $month_start - 1; if ($month_end < 1) $month_end = 12; else $year_end++; - } - else $month_end = $month_start; + } else $month_end = $month_start; $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } @@ -134,8 +133,7 @@ if ($modecompta == 'CREANCES-DETTES') else $description .= "
".$langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") { +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); $calcmode = $langs->trans("CalcModeEngagement"); $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')'; @@ -146,8 +144,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") { $description .= '
'.$langs->trans("RulesResultInOut"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); $calcmode = $langs->trans("CalcModeBookkeeping"); @@ -191,8 +188,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod else $sql .= " AND f.type IN (0,1,2,3,5)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == "RECETTES-DEPENSES") + } elseif ($modecompta == "RECETTES-DEPENSES") { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -228,12 +224,10 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod $i++; } $db->free($result); - } - else { + } else { dol_print_error($db); } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -274,17 +268,14 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod $i++; } - } - else { + } else { dol_print_error($db); } - } - elseif ($modecompta == "RECETTES-DEPENSES") + } elseif ($modecompta == "RECETTES-DEPENSES") { // Nothing from this table } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -307,8 +298,7 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod else $sql .= " AND f.type IN (0,1,2,3)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == "RECETTES-DEPENSES") + } elseif ($modecompta == "RECETTES-DEPENSES") { $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; @@ -343,12 +333,10 @@ if (!empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mod $i++; } $db->free($result); - } - else { + } else { dol_print_error($db); } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -429,8 +417,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } else { dol_print_error($db); } - } - elseif ($modecompta == "RECETTES-DEPENSES") + } elseif ($modecompta == "RECETTES-DEPENSES") { // TVA really already paid $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; @@ -493,8 +480,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom dol_print_error($db); } } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -516,8 +502,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom $sql .= " AND c.deductible = 0"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == "RECETTES-DEPENSES") + } elseif ($modecompta == "RECETTES-DEPENSES") { $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; @@ -554,8 +539,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } else { dol_print_error($db); } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -578,8 +562,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom $sql .= " AND c.deductible = 1"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta == "RECETTES-DEPENSES") + } elseif ($modecompta == "RECETTES-DEPENSES") { $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; @@ -616,8 +599,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } else { dol_print_error($db); } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -664,8 +646,7 @@ if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo } else { dol_print_error($db); } -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Nothing from this table } @@ -723,12 +704,10 @@ if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' | $decaiss_ttc[$obj->dm] += $obj->amount_ttc; } } - } - else { + } else { dol_print_error($db); } -} -elseif ($modecompta == 'BOOKKEEPING') { +} elseif ($modecompta == 'BOOKKEEPING') { // Nothing from this table } @@ -784,12 +763,10 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom $i++; } } - } - else { + } else { dol_print_error($db); } -} -elseif ($modecompta == 'BOOKKEEPING') { +} elseif ($modecompta == 'BOOKKEEPING') { // Nothing from this table } @@ -823,8 +800,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba $i++; } } - } - else { + } else { dol_print_error($db); } @@ -852,8 +828,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba $i++; } } - } - else { + } else { dol_print_error($db); } } @@ -889,8 +864,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan $i++; } } - } - else { + } else { dol_print_error($db); } } @@ -955,8 +929,7 @@ if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) $i++; } } - } - else { + } else { dol_print_error($db); } } @@ -1035,8 +1008,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) if (!isset($totsorties[$annee])) $totsorties[$annee] = 0; $totsorties[$annee] += $decaiss[$case]; } - } - else { + } else { if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0) { print ''.price(price2num($decaiss_ttc[$case], 'MT')).''; @@ -1055,8 +1027,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) if (!isset($totentrees[$annee])) $totentrees[$annee] = 0; $totentrees[$annee] += $encaiss[$case]; } - } - else { + } else { if (isset($encaiss_ttc[$case])) { print ''.price(price2num($encaiss_ttc[$case], 'MT')).''; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 172929aabff..48cb8b1154e 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -90,8 +90,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $month_end = $month_start - 1; if ($month_end < 1) $month_end = 12; else $year_end++; - } - else $month_end = $month_start; + } else $month_end = $month_start; $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } @@ -181,8 +180,7 @@ if ($modecompta == "CREANCES-DETTES") else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") { +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("AnnualByAccountInputOutputMode"); $calcmode = $langs->trans("CalcModeEngagement"); $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')'; @@ -192,8 +190,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") { $description = $langs->trans("RulesResultInOut"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups"); $calcmode = $langs->trans("CalcModeBookkeeping"); @@ -248,13 +245,11 @@ if ($modecompta == 'CREANCES-DETTES') { //if (! empty($date_start) && ! empty($date_end)) // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { //if (! empty($date_start) && ! empty($date_end)) // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // Get array of all report groups that are active $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 0cb706d3177..f9d5a90d543 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -128,8 +128,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { header("Location: list.php"); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -144,28 +143,23 @@ if ($action == 'add' && $user->rights->tax->charges->creer) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $action = 'create'; - } - elseif (!$dateperiod) + } elseif (!$dateperiod) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors'); $action = 'create'; - } - elseif (!$actioncode > 0) + } elseif (!$actioncode > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); $action = 'create'; - } - elseif (empty($amount)) + } elseif (empty($amount)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; - } - elseif (!is_numeric($amount)) + } elseif (!is_numeric($amount)) { setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; - } - else { + } else { $object->type = $actioncode; $object->label = GETPOST('label', 'alpha'); $object->date_ech = $dateech; @@ -193,23 +187,19 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->cre { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $action = 'edit'; - } - elseif (!$dateperiod) + } elseif (!$dateperiod) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors'); $action = 'edit'; - } - elseif (empty($amount)) + } elseif (empty($amount)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'edit'; - } - elseif (!is_numeric($amount)) + } elseif (!is_numeric($amount)) { setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; - } - else { + } else { $result = $object->fetch($id); $object->date_ech = $dateech; @@ -242,16 +232,14 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char if (GETPOST('clone_label', 'alphanohtml')) { $object->label = GETPOST('clone_label', 'alphanohtml'); - } - else { + } else { $object->label = $langs->trans("CopyOf").' '.$object->label; } if (GETPOST('clone_for_next_month', 'int')) { $object->periode = dol_time_plus_duree($object->periode, 1, 'm'); $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); - } - else { + } else { $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); $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; @@ -268,16 +256,14 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { $id = $originalId; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - } - else { + } else { $db->rollback(); dol_print_error($db, $object->error); } @@ -426,8 +412,7 @@ if ($id > 0) if (!empty($conf->global->TAX_ADD_CLON_FOR_NEXT_MONTH_CHECKBOX)) { $formquestion[] = array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1); - } - else { + } else { $formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1); } @@ -529,8 +514,7 @@ if ($id > 0) if ($action == 'edit') { print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1); - } - else { + } else { print dol_print_date($object->periode, "day"); } print ""; @@ -541,8 +525,7 @@ if ($id > 0) print ''.$langs->trans("AmountTTC").""; print ''; print ""; - } - else { + } else { print ''.$langs->trans("AmountTTC").''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; } @@ -667,8 +650,7 @@ if ($id > 0) $totalpaye += $objp->amount; $i++; } - } - else { + } else { print ''.$langs->trans("None").''; print ''; print ''; @@ -687,8 +669,7 @@ if ($id > 0) print ''; $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -758,8 +739,7 @@ if ($id > 0) print ""; } - } - else { + } else { /* Social contribution not found */ dol_print_error('', $object->error); } diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index b91d9ca31ee..cc66b56aabd 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -459,28 +459,23 @@ class Cchargesociales { if ($status == 1) return $langs->trans('Enabled'); elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 1) + } elseif ($mode == 1) { if ($status == 1) return $langs->trans('Enabled'); elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 2) + } elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 3) + } elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 4) + } elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 5) + } elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 0c709c031d5..81ae1e28f20 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -171,12 +171,10 @@ class ChargeSociales extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -250,13 +248,11 @@ class ChargeSociales extends CommonObject if (empty($error)) { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1 * $error; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -325,8 +321,7 @@ class ChargeSociales extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -382,8 +377,7 @@ class ChargeSociales extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -416,12 +410,10 @@ class ChargeSociales extends CommonObject $obj = $this->db->fetch_object($result); $this->db->free($result); return $obj->amount; - } - else { + } else { return 0; } - } - else { + } else { print $this->db->error(); return -1; } @@ -605,8 +597,7 @@ class ChargeSociales extends CommonObject $this->db->free($resql); return $amount; - } - else { + } else { return -1; } } @@ -659,8 +650,7 @@ class ChargeSociales extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 9164ab39f1e..4cb81422284 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -194,13 +194,11 @@ class PaymentSocialContribution extends CommonObject if ($remaintopay == 0) { $result = $contrib->set_paid($user); - } - else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); + } else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); } } } - } - else { + } else { $error++; } } @@ -214,8 +212,7 @@ class PaymentSocialContribution extends CommonObject $this->total = $totalamount; // deprecated $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -284,8 +281,7 @@ class PaymentSocialContribution extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -355,8 +351,7 @@ class PaymentSocialContribution extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -410,8 +405,7 @@ class PaymentSocialContribution extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -460,8 +454,7 @@ class PaymentSocialContribution extends CommonObject { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -571,8 +564,7 @@ class PaymentSocialContribution extends CommonObject if ($result <= 0) dol_print_error($this->db); } } - } - else { + } else { $this->error = $acc->error; $error++; } @@ -581,8 +573,7 @@ class PaymentSocialContribution extends CommonObject if (!$error) { return 1; - } - else { + } else { return -1; } } @@ -605,8 +596,7 @@ class PaymentSocialContribution extends CommonObject if ($result) { return 1; - } - else { + } else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index e63c5f354d0..e7d76b94a76 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -163,8 +163,7 @@ if ($object->id) $permtoedit = $user->rights->fournisseur->facture->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index be5f7e6f973..43823490ed9 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -80,8 +80,7 @@ if (!GETPOSTISSET('search_typeid')) $part = explode(':', $val); if ($part[0] == 'cs.fk_type') $search_typeid = $part[1]; } -} -else { +} else { $search_typeid = GETPOST('search_typeid', 'int'); } @@ -207,8 +206,7 @@ if ($resql) $countrynotdefined = $langs->trans("ErrorSetACountryFirst"); print $countrynotdefined; print ''; - } - else { + } else { print '
'; print ''."\n"; @@ -311,8 +309,7 @@ if ($resql) if ($obj->periode) { print 'jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode), 'day').''; - } - else { + } else { print ' '; } print "\n"; @@ -342,8 +339,7 @@ if ($resql) print ''; } print ''; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 05808877df9..fc1f66d5e2c 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -92,8 +92,7 @@ if ($mode != 'sconly') { $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); -} -else { +} else { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit); } @@ -207,8 +206,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print '"; print ""; - } - else { + } else { dol_print_error($db); } print '
 '.price($totalpaye)."
'; @@ -285,8 +283,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } @@ -297,18 +294,15 @@ if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { $j = 1; $numlt = 3; -} -elseif ($mysoc->localtax1_assuj == "1") +} elseif ($mysoc->localtax1_assuj == "1") { $j = 1; $numlt = 2; -} -elseif ($mysoc->localtax2_assuj == "1") +} elseif ($mysoc->localtax2_assuj == "1") { $j = 2; $numlt = 3; -} -else { +} else { $j = 0; $numlt = 0; } @@ -384,8 +378,7 @@ while ($j < $numlt) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } @@ -467,8 +460,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) $db->free($result); print "
"; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 3859b19df91..dc5ebd1731d 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -77,8 +77,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end else $year_end++; } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -208,8 +207,7 @@ if ($modecompta == "CREANCES-DETTES") { } $builddate = dol_now(); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -219,11 +217,9 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { -} -elseif ($modecompta == "BOOKKEEPINGCOLLECTED") +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 513b0ffa350..ab2c1dcadb1 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -103,8 +103,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end else $year_end++; } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -180,8 +179,7 @@ if ($modecompta == "CREANCES-DETTES") { } $builddate = dol_now(); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -191,11 +189,9 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { -} -elseif ($modecompta == "BOOKKEEPINGCOLLECTED") +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { } @@ -231,8 +227,7 @@ if ($modecompta == 'CREANCES-DETTES') if ($selected_cat === -2) // Without any category { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; - } - elseif ($selected_cat) // Into a specific category + } elseif ($selected_cat) // Into a specific category { $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp"; } @@ -254,8 +249,7 @@ if ($modecompta == 'CREANCES-DETTES') if ($selected_cat === -2) // Without any category { $sql .= " AND cp.fk_product is null"; - } - elseif ($selected_cat) { // Into a specific category + } elseif ($selected_cat) { // Into a specific category $sql .= " AND (c.rowid = ".$selected_cat; if ($subcat) $sql .= " OR c.fk_parent = ".$selected_cat; $sql .= ")"; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 6d720b4f96d..8b6caa89a8f 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -96,8 +96,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } -} -else { +} else { // TODO We define q } // $date_start and $date_end are defined. We force $year_start and $nbofyear @@ -156,8 +155,7 @@ if ($modecompta == "CREANCES-DETTES") { else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -166,12 +164,10 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { // TODO -} -elseif ($modecompta == "BOOKKEEPINGCOLLECTED") +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { // TODO } @@ -395,8 +391,7 @@ if (count($amount)) { } else { //print ''; } - } - elseif ($modecompta == 'CREANCES-DETTES') { + } elseif ($modecompta == 'CREANCES-DETTES') { if ($key > 0) { print ''; } else { @@ -415,8 +410,7 @@ if (count($amount)) { } else { //print ''; } - } - elseif ($modecompta == 'CREANCES-DETTES') { + } elseif ($modecompta == 'CREANCES-DETTES') { if ($key > 0) { print ''; } else { @@ -430,8 +424,7 @@ if (count($amount)) { } else { //print ''; } - } - elseif ($modecompta == 'CREANCES-DETTES') { + } elseif ($modecompta == 'CREANCES-DETTES') { if ($key > 0) { print ''; } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 85a27c7574a..ab71b147b50 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -113,8 +113,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } -} -else { +} else { // TODO We define q } @@ -182,8 +181,7 @@ if ($modecompta == "CREANCES-DETTES") else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByThirdParties"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -192,11 +190,9 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { -} -elseif ($modecompta == "BOOKKEEPINGCOLLECTED") +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); @@ -222,8 +218,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; - } - elseif ($selected_cat) // Into a specific category + } elseif ($selected_cat) // Into a specific category { $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } @@ -240,8 +235,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " AND cs.fk_soc is null"; - } - elseif ($selected_cat) { // Into a specific category + } elseif ($selected_cat) { // Into a specific category $sql .= " AND (c.rowid = ".$db->escape($selected_cat); if ($subcat) $sql .= " OR c.fk_parent = ".$db->escape($selected_cat); $sql .= ")"; @@ -260,8 +254,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; - } - elseif ($selected_cat) // Into a specific category + } elseif ($selected_cat) // Into a specific category { $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } @@ -274,8 +267,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " AND cs.fk_soc is null"; - } - elseif ($selected_cat) { // Into a specific category + } elseif ($selected_cat) { // Into a specific category $sql .= " AND (c.rowid = ".$selected_cat; if ($subcat) $sql .= " OR c.fk_parent = ".$selected_cat; $sql .= ")"; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index cfc521c7c13..796ce2cc6a6 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -73,8 +73,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $month_end = $month_start - 1; if ($month_end < 1) $month_end = 12; - } - else $month_end = $month_start; + } else $month_end = $month_start; $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } @@ -127,8 +126,7 @@ if ($modecompta == "CREANCES-DETTES") else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -140,8 +138,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("Turnover"); $calcmode = $langs->trans("CalcModeBookkeeping"); @@ -173,8 +170,7 @@ if ($modecompta == 'CREANCES-DETTES') else $sql .= " AND f.type IN (0,1,2,3,5)"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -188,8 +184,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") $sql .= " AND pf.fk_facture = f.rowid"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; @@ -223,8 +218,7 @@ if ($result) $i++; } $db->free($result); -} -else { +} else { dol_print_error($db); } @@ -259,8 +253,7 @@ if ($modecompta == 'RECETTES-DEPENSES') } $i++; } - } - else { + } else { dol_print_error($db); } } @@ -338,10 +331,8 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre. print ''.price($cum_ht[$case], 1).''; - } - else { - if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } - else { print ' '; } + } else { + if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } print ""; } @@ -354,10 +345,8 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) if ($modecompta != 'BOOKKEEPING') print ''; print price($cum[$case], 1); if ($modecompta != 'BOOKKEEPING') print ''; - } - else { - if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } - else { print ' '; } + } else { + if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } print ""; @@ -387,11 +376,9 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { print '-'; } - } - else { + } else { print ''; - if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } - else { print ' '; } + if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } print ''; } @@ -479,8 +466,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''.($total_ht[$annee] ?price($total_ht[$annee]) : "0").""; - } - else { + } else { print ' '; } } @@ -489,8 +475,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''.($total[$annee] ?price($total[$annee]) : "0").""; - } - else { + } else { print ' '; } @@ -513,11 +498,9 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print '+0%'; } - } - else { + } else { print ''; - if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } - else { print ' '; } + if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; } print ''; } diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index e9e0ec5926c..c257d5d1f73 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -69,8 +69,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $month_end = $month_start - 1; if ($month_end < 1) $month_end = 12; - } - else $month_end = $month_start; + } else $month_end = $month_start; $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } @@ -121,8 +120,7 @@ if ($modecompta == "CREANCES-DETTES") $description = $langs->trans("RulesPurchaseTurnoverDue"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("PurchaseTurnoverCollected"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -133,8 +131,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description = $langs->trans("RulesPurchaseTurnoverIn"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("PurchaseTurnover"); $calcmode = $langs->trans("CalcModeBookkeeping"); @@ -165,8 +162,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql .= " AND f.type IN (0,2)"; $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $sql = "SELECT date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -176,8 +172,7 @@ elseif ($modecompta == "RECETTES-DEPENSES") $sql .= " AND pf.fk_facturefourn = f.rowid"; $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; @@ -211,8 +206,7 @@ if ($result) $i++; } $db->free($result); -} -else { +} else { dol_print_error($db); } @@ -289,10 +283,8 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre. print ''.price($cum_ht[$case], 1).''; - } - else { - if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } - else { print ' '; } + } else { + if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } print ""; } @@ -305,10 +297,8 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) if ($modecompta != 'BOOKKEEPING') print ''; print price($cum[$case], 1); if ($modecompta != 'BOOKKEEPING') print ''; - } - else { - if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } - else { print ' '; } + } else { + if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } print ""; @@ -338,11 +328,9 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { print '-'; } - } - else { + } else { print ''; - if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } - else { print ' '; } + if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } print ''; } @@ -365,8 +353,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''.($total_ht[$annee] ?price($total_ht[$annee]) : "0").""; - } - else { + } else { print ' '; } } @@ -375,8 +362,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''.($total[$annee] ?price($total[$annee]) : "0").""; - } - else { + } else { print ' '; } @@ -399,11 +385,9 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print '+0%'; } - } - else { + } else { print ''; - if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } - else { print ' '; } + if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; } print ''; } diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index 9b25488c280..5911daaba45 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -100,8 +100,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end else $year_end++; } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -171,8 +170,7 @@ if ($modecompta == "CREANCES-DETTES") { $description = $langs->trans("RulesPurchaseTurnoverDue"); $builddate = dol_now(); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByProductsAndServices"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -180,11 +178,9 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description = $langs->trans("RulesPurchaseTurnoverIn"); $builddate = dol_now(); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { -} -elseif ($modecompta == "BOOKKEEPINGCOLLECTED") +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { } @@ -220,8 +216,7 @@ if ($modecompta == 'CREANCES-DETTES') if ($selected_cat === -2) // Without any category { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; - } - elseif ($selected_cat) // Into a specific category + } elseif ($selected_cat) // Into a specific category { $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp"; } @@ -239,8 +234,7 @@ if ($modecompta == 'CREANCES-DETTES') if ($selected_cat === -2) // Without any category { $sql .= " AND cp.fk_product is null"; - } - elseif ($selected_cat) { // Into a specific category + } elseif ($selected_cat) { // Into a specific category $sql .= " AND (c.rowid = ".$selected_cat; if ($subcat) $sql .= " OR c.fk_parent = ".$selected_cat; $sql .= ")"; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 76f9c246e87..60d65049800 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -107,8 +107,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } -} -else { +} else { // TODO We define q } @@ -174,8 +173,7 @@ if ($modecompta == "CREANCES-DETTES") $description = $langs->trans("RulesPurchaseTurnoverDue"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "RECETTES-DEPENSES") +} elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByThirdParties"); $calcmode = $langs->trans("CalcModeEngagement"); @@ -183,11 +181,9 @@ elseif ($modecompta == "RECETTES-DEPENSES") $description = $langs->trans("RulesPurchaseTurnoverIn"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); -} -elseif ($modecompta == "BOOKKEEPING") +} elseif ($modecompta == "BOOKKEEPING") { -} -elseif ($modecompta == "BOOKKEEPINGCOLLECTED") +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); @@ -214,8 +210,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; - } - elseif ($selected_cat) // Into a specific category + } elseif ($selected_cat) // Into a specific category { $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } @@ -228,8 +223,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " AND cs.fk_soc is null"; - } - elseif ($selected_cat) { // Into a specific category + } elseif ($selected_cat) { // Into a specific category $sql .= " AND (c.rowid = ".$db->escape($selected_cat); if ($subcat) $sql .= " OR c.fk_parent = ".$db->escape($selected_cat); $sql .= ")"; @@ -244,8 +238,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; - } - elseif ($selected_cat) // Into a specific category + } elseif ($selected_cat) // Into a specific category { $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } @@ -258,8 +251,7 @@ if ($modecompta == 'CREANCES-DETTES') { if ($selected_cat === -2) // Without any category { $sql .= " AND cs.fk_soc is null"; - } - elseif ($selected_cat) { // Into a specific category + } elseif ($selected_cat) { // Into a specific category $sql .= " AND (c.rowid = ".$selected_cat; if ($subcat) $sql .= " OR c.fk_parent = ".$selected_cat; $sql .= ")"; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 3df7419019a..6fa22885dee 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -131,8 +131,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $db->commit(); header("Location: list.php"); exit; - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -165,19 +164,16 @@ if ($action == 'delete') $db->commit(); header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php'); exit; - } - else { + } else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; setEventMessages($mesg, null, 'errors'); } @@ -384,12 +380,10 @@ if ($id) if (!empty($user->rights->tax->charges->supprimer)) { print ''; - } - else { + } else { print ''; } - } - else { + } else { print ''; } print "
"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index baeaff7a5d6..3274a3eaebd 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -150,13 +150,11 @@ class Tva extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -222,8 +220,7 @@ class Tva extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -290,8 +287,7 @@ class Tva extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -400,13 +396,11 @@ class Tva extends CommonObject $ret = $obj->amount; $this->db->free($result); return $ret; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { print $this->db->lasterror(); return -1; } @@ -439,13 +433,11 @@ class Tva extends CommonObject $ret = $obj->total_tva; $this->db->free($result); return $ret; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { print $this->db->lasterror(); return -1; } @@ -480,13 +472,11 @@ class Tva extends CommonObject $ret = $obj->amount; $this->db->free($result); return $ret; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { print $this->db->lasterror(); return -1; } @@ -602,8 +592,7 @@ class Tva extends CommonObject if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); - } - else { + } else { $this->error = $acc->error; $ok = 0; } @@ -621,18 +610,15 @@ class Tva extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -3; } - } - else { + } else { $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -655,8 +641,7 @@ class Tva extends CommonObject if ($result) { return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -695,8 +680,7 @@ class Tva extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -737,8 +721,7 @@ class Tva extends CommonObject $this->db->free($resql); return $amount; - } - else { + } else { return -1; } } @@ -783,8 +766,7 @@ class Tva extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 158c974114d..52466e33d84 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -66,13 +66,11 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $q = GETPOST("q", "int"); if (empty($q)) { - if (GETPOST("month", 'int')) { $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), false); } - else { + if (GETPOST("month", 'int')) { $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), false); } else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - } - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year $year_start--; @@ -84,14 +82,12 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - } - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -319,8 +315,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], 'link' =>$expensereport->getNomUrl(1) ); - } - else { + } else { $invoice_supplier->id = $x_paye[$my_paye_thirdpartyid]['facid'][$id]; $invoice_supplier->ref = $x_paye[$my_paye_thirdpartyid]['facnum'][$id]; $invoice_supplier->type = $x_paye[$my_paye_thirdpartyid]['type'][$id]; @@ -690,8 +685,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) { print $langs->trans("NA"); - } - else { + } else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 45efc9681d8..cb26304cde5 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -148,8 +148,7 @@ if ($object->id) $permtoedit = $user->rights->fournisseur->facture->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index c85f2bbdb8f..43db8353c4c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -57,13 +57,11 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $q = GETPOST("q", "int"); if (empty($q)) { - if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else { + if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - } - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year $year_start--; @@ -75,14 +73,12 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - } - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -174,8 +170,7 @@ function pt($db, $sql, $date) $amountpaid = 0; $previousmode = ''; $previousmonth = ''; - } - else { + } else { $previousmode = $obj->mode; $previousmonth = $obj->dm; } @@ -204,8 +199,7 @@ function pt($db, $sql, $date) print ""; $db->free($result); - } - else { + } else { dol_print_error($db); } } @@ -368,8 +362,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], //'link' =>$expensereport->getNomUrl(1) ); - } - else { + } else { //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 98eede887c8..5b09da5305c 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -72,8 +72,7 @@ if (empty($_REQUEST['typeid'])) $part = explode(':', $val); if ($part[0] == 't.fk_typepayment') $typeid = $part[1]; } -} -else { +} else { $typeid = $_REQUEST['typeid']; } @@ -227,8 +226,7 @@ if ($result) if ($obj->payment_code <> '') { $type = ''.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; - } - else { + } else { $type = ' '; } @@ -264,8 +262,7 @@ if ($result) $bankstatic->label = $obj->blabel; print $bankstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; } // Amount @@ -289,8 +286,7 @@ if ($result) print ''; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 6e16165ab6c..abd5fb6841c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -66,13 +66,11 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $q = GETPOST("q", "int"); if (empty($q)) { - if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else { + if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - } - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year $year_start--; @@ -84,14 +82,12 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - } - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - } - else { + } else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -313,8 +309,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) 'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id], 'link' =>$expensereport->getNomUrl(1) ); - } - else { + } else { $invoice_supplier->id = $x_paye[$my_paye_rate]['facid'][$id]; $invoice_supplier->ref = $x_paye[$my_paye_rate]['facnum'][$id]; $invoice_supplier->type = $x_paye[$my_paye_rate]['type'][$id]; @@ -436,8 +431,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) if (dol_string_nohtmltag($fields['descr'])) { print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); } - } - else { + } else { if ($type) { $text = img_object($langs->trans('Service'), 'service'); } else { @@ -616,8 +610,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) if (dol_string_nohtmltag($fields['descr'])) { print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); } - } - else { + } else { if ($type) { $text = img_object($langs->trans('Service'), 'service'); } else { @@ -668,8 +661,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) { print $langs->trans("NA"); - } - else { + } else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 874a964a965..0ea0018632b 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -76,8 +76,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); @@ -158,8 +157,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template -} -else { +} else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index e005d3dca7b..415d9e47790 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -119,8 +119,7 @@ abstract class ActionsContactCardCommon { $this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company_id'] = $objsoc->id; - } - else { + } else { $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); } @@ -207,8 +206,7 @@ abstract class ActionsContactCardCommon $dolibarr_user = new User($this->db); $result = $dolibarr_user->fetch($this->object->user_id); $this->tpl['dolibarr_user'] = $dolibarr_user->getLoginUrl(1); - } - else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess"); + } else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess"); } if ($action == 'view' || $action == 'delete') @@ -221,8 +219,7 @@ abstract class ActionsContactCardCommon $objsoc->fetch($this->object->socid); $this->tpl['company'] = $objsoc->getNomUrl(1); - } - else { + } else { $this->tpl['company'] = $langs->trans("ContactNotLinkedToCompany"); } @@ -307,8 +304,7 @@ abstract class ActionsContactCardCommon if ($resql) { $obj = $this->db->fetch_object($resql); - } - else { + } else { dol_print_error($this->db); } $this->object->country_id = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label; diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 6ac81ac8bd4..099c973b0a4 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -104,8 +104,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon $this->tpl['actionstodo'] = show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1); $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); - } - else { + } else { // Confirm delete contact if ($action == 'delete' && $user->rights->societe->contact->supprimer) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 885878138ba..6b73172decc 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -128,18 +128,15 @@ if (empty($reshook)) if ($result2) { $db->commit(); - } - else { + } else { $error = $nuser->error; $errors = $nuser->errors; $db->rollback(); } - } - else { + } else { $error = $nuser->error; $errors = $nuser->errors; $db->rollback(); } - } - else { + } else { $error = $object->error; $errors = $object->errors; } } @@ -152,8 +149,7 @@ if (empty($reshook)) if ($object->setstatus(0) < 0) { setEventMessages($object->error, $object->errors, 'errors'); - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -166,8 +162,7 @@ if (empty($reshook)) if ($object->setstatus(1) < 0) { setEventMessages($object->error, $object->errors, 'errors'); - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -272,8 +267,7 @@ if (empty($reshook)) else $url = 'card.php?id='.$id; header("Location: ".$url); exit; - } - else { + } else { $db->rollback(); } } @@ -293,13 +287,11 @@ if (empty($reshook)) { header("Location: ".$backtopage); exit; - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -342,20 +334,17 @@ if (empty($reshook)) if (!$result > 0) { $errors[] = "ErrorFailedToSaveFile"; - } - else { + } else { $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); // Create thumbs $object->addThumbs($newfile); } } - } - else { + } else { $errors[] = "ErrorBadImageFormat"; } - } - else { + } else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -440,8 +429,7 @@ if (empty($reshook)) $resql = $db->query($sql); } } - } - else { + } else { $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = '".$db->escape($object->email)."' AND entity = ".$db->escape(getEntity('mailing', 0)); $resql = $db->query($sql); } @@ -452,8 +440,7 @@ if (empty($reshook)) $object->old_lastname = ''; $object->old_firstname = ''; $action = 'view'; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } @@ -512,8 +499,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template -} -else { +} else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -632,8 +618,7 @@ else { print ''; print ''; print ''; - } - else { + } else { print ''; print $form->select_company($socid, 'socid', '', 'SelectThirdParty'); print ''; @@ -688,16 +673,14 @@ else { if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { print ''; - } - else { + } else { print ''; } if ($object->country_id) { print $formcompany->select_state(GETPOST("state_id", 'alpha') ? GETPOST("state_id", 'alpha') : $object->state_id, $object->country_code, 'state_id'); - } - else { + } else { print $countrynotdefined; } print ''; @@ -854,8 +837,7 @@ else { if ($object->birthday) { print $form->selectDate($object->birthday, 'birthday', 0, 0, 0, "perso", 1, 0); - } - else { + } else { print $form->selectDate('', 'birthday', 0, 0, 1, "perso", 1, 0); } print ''; @@ -864,8 +846,7 @@ else { if ($object->birthday_alert) { print ''; - } - else { + } else { print ''; } print ''; @@ -881,16 +862,14 @@ else { { print '     '; print ''; - } - else { + } else { print '     '; print ''; } print ''; print ""; - } - elseif ($action == 'edit' && !empty($id)) + } elseif ($action == 'edit' && !empty($id)) { /* * Fiche en mode edition @@ -1011,8 +990,7 @@ else { if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { print ''; - } - else { + } else { print ''; } @@ -1049,8 +1027,7 @@ else { $langs->load("mails"); print ''.$langs->trans("NbOfEMailingsSend").''; print ''.$object->getNbOfEMailings().''; - } - else { + } else { print ''; } print ''; @@ -1074,8 +1051,7 @@ else { print ''; print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ?GETPOST("no_email", 'alpha') : $noemail), 1).''; - } - else { + } else { print ''; } print ''; @@ -1220,8 +1196,7 @@ else { $dolibarr_user = new User($db); $result = $dolibarr_user->fetch($object->user_id); print $dolibarr_user->getLoginUrl(1); - } - else print $langs->trans("NoDolibarrAccess"); + } else print $langs->trans("NoDolibarrAccess"); print ''; // Photo @@ -1396,8 +1371,7 @@ else { if (!empty($conf->commande->enabled) || !empty($conf->expedition->enabled)) { print ''; - if (!empty($conf->expedition->enabled)) { print $langs->trans("ContactForOrdersOrShipments"); } - else print $langs->trans("ContactForOrders"); + if (!empty($conf->expedition->enabled)) { print $langs->trans("ContactForOrdersOrShipments"); } else print $langs->trans("ContactForOrders"); print ''; $none = $langs->trans("NoContactForAnyOrder"); if (!empty($conf->expedition->enabled)) { $none = $langs->trans("NoContactForAnyOrderOrShipments"); } @@ -1425,8 +1399,7 @@ else { $dolibarr_user = new User($db); $result = $dolibarr_user->fetch($object->user_id); print $dolibarr_user->getLoginUrl(1); - } - else print $langs->trans("NoDolibarrAccess"); + } else print $langs->trans("NoDolibarrAccess"); print ''; print ''; @@ -1456,8 +1429,7 @@ else { { $langs->load("mails"); print ''; - } - else { + } else { $langs->load("mails"); print ''; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index fc640e7e032..cfe41eafca2 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -287,8 +287,7 @@ class Contact extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; @@ -387,14 +386,12 @@ class Contact extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -2; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -593,14 +590,12 @@ class Contact extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -$error; } - } - else { + } else { $this->error = $this->db->lasterror().' sql='.$sql; $this->db->rollback(); return -1; @@ -756,12 +751,10 @@ class Contact extends CommonObject $error++; $this->error = $this->db->lasterror(); } - } - else { + } else { $result = true; } - } - else { + } else { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert "; $sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id; $result = $this->db->query($sql); @@ -784,8 +777,7 @@ class Contact extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -$error; @@ -858,8 +850,7 @@ class Contact extends CommonObject dol_syslog($this->error, LOG_ERR); return 2; - } - elseif ($num) // $num = 1 + } elseif ($num) // $num = 1 { $obj = $this->db->fetch_object($resql); @@ -933,8 +924,7 @@ class Contact extends CommonObject $this->user_id = $uobj->rowid; } $this->db->free($resql); - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -960,8 +950,7 @@ class Contact extends CommonObject $this->birthday_alert = 1; } $this->db->free($resql); - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -976,13 +965,11 @@ class Contact extends CommonObject } return 1; - } - else { + } else { $this->error = $langs->trans("RecordNotFound"); return 0; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1003,8 +990,7 @@ class Contact extends CommonObject if (in_array($this->civility_id, array('MR')) || in_array($this->civility_code, array('MR'))) { $this->gender = 'man'; - } - elseif (in_array($this->civility_id, array('MME', 'MLE')) || in_array($this->civility_code, array('MME', 'MLE'))) + } elseif (in_array($this->civility_id, array('MME', 'MLE')) || in_array($this->civility_code, array('MME', 'MLE'))) { $this->gender = 'woman'; } @@ -1048,8 +1034,7 @@ class Contact extends CommonObject } $this->db->free($resql); return 0; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -1104,8 +1089,7 @@ class Contact extends CommonObject $i++; } - } - else { + } else { $error++; $this->error = $this->db->error().' sql='.$sql; } @@ -1171,8 +1155,7 @@ class Contact extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); dol_syslog("Error ".$this->error, LOG_ERR); return -1; @@ -1219,8 +1202,7 @@ class Contact extends CommonObject } $this->db->free($resql); - } - else { + } else { print $this->db->error(); } } @@ -1245,8 +1227,7 @@ class Contact extends CommonObject $this->db->free($resql); return $nb; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1507,8 +1488,7 @@ class Contact extends CommonObject { $this->db->rollback(); return -$error; - } - else { + } else { $this->db->commit(); return 1; } @@ -1661,8 +1641,7 @@ class Contact extends CommonObject } return $tab; - } - else { + } else { $this->error = $this->db->error(); dol_print_error($this->db); return -1; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index ff3570e7e82..7655e00ea3f 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -178,8 +178,7 @@ if ($type_element == 'fichinter') $where = ' WHERE f.entity IN ('.getEntity('ficheinter').')'; $dateprint = 'f.datec'; $doc_number = 'f.ref'; -} -elseif ($type_element == 'invoice') +} elseif ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic = new Facture($db); @@ -193,8 +192,7 @@ elseif ($type_element == 'invoice') $dateprint = 'f.datef'; $doc_number = 'f.ref'; $thirdTypeSelect = 'customer'; -} -elseif ($type_element == 'propal') +} elseif ($type_element == 'propal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $documentstatic = new Propal($db); @@ -208,8 +206,7 @@ elseif ($type_element == 'propal') $datePrint = 'c.datep'; $doc_number = 'c.ref'; $thirdTypeSelect = 'customer'; -} -elseif ($type_element == 'order') +} elseif ($type_element == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $documentstatic = new Commande($db); @@ -223,8 +220,7 @@ elseif ($type_element == 'order') $dateprint = 'c.date_commande'; $doc_number = 'c.ref'; $thirdTypeSelect = 'customer'; -} -elseif ($type_element == 'supplier_invoice') +} elseif ($type_element == 'supplier_invoice') { // Supplier : Show products from invoices. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $documentstatic = new FactureFournisseur($db); @@ -266,8 +262,7 @@ elseif ($type_element == 'supplier_order') $dateprint = 'c.date_valid'; $doc_number = 'c.ref'; $thirdTypeSelect = 'supplier'; -} -elseif ($type_element == 'contract') +} elseif ($type_element == 'contract') { // Order require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $documentstatic = new Contrat($db); @@ -423,8 +418,7 @@ if ($sql_select) if ($type_element == 'contract') { print $documentstaticline->getLibStatut(2); - } - else { + } else { print $documentstatic->getLibStatut(2); } print ''; @@ -466,8 +460,7 @@ if ($sql_select) } $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; - } - else { + } else { $label = $objp->product_label; } @@ -499,27 +492,23 @@ if ($sql_select) $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); - } - elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) + } elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); - } - elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + } elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; - } - else { + } else { echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } - } - else { + } else { if ($objp->fk_product > 0) { echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 7934bbd5996..f601086ad05 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -67,8 +67,7 @@ if ($action == 'dolibarr2ldap') { setEventMessages($langs->trans("ContactSynchronized"), null, 'mesgs'); $db->commit(); - } - else { + } else { setEventMessages($ldap->error, $ldap->errors, 'errors'); $db->rollback(); } @@ -105,8 +104,7 @@ if ($object->socid > 0) $thirdparty->fetch($object->socid); print ''.$langs->trans("ThirdParty").''.$thirdparty->getNomUrl(1).''; -} -else { +} else { print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; @@ -181,19 +179,16 @@ if ($result > 0) if (!is_array($records)) { print ''.$langs->trans("ErrorFailedToReadLDAP").''; - } - else { + } else { $result = show_ldap_content($records, 0, $records['count'], true); } - } - else { + } else { print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')'; } $ldap->unbind(); $ldap->close(); -} -else { +} else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a6add5c7d75..fe80e709b28 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -123,14 +123,12 @@ if ($type == "c") if (empty($contextpage) || $contextpage == 'contactlist') $contextpage = 'contactcustomerlist'; $titre .= ' ('.$langs->trans("ThirdPartyCustomers").')'; $urlfiche = "card.php"; -} -elseif ($type == "f") +} elseif ($type == "f") { if (empty($contextpage) || $contextpage == 'contactlist') $contextpage = 'contactsupplierlist'; $titre .= ' ('.$langs->trans("ThirdPartySuppliers").')'; $urlfiche = "card.php"; -} -elseif ($type == "o") +} elseif ($type == "o") { if (empty($contextpage) || $contextpage == 'contactlist') $contextpage = 'contactotherlist'; $titre .= ' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; @@ -326,8 +324,7 @@ if (!empty($userid)) // propre au commercial if ($search_priv != '0' && $search_priv != '1') { $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id."))"; -} -else { +} else { if ($search_priv == '0') $sql .= " AND p.priv='0'"; if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; } @@ -375,16 +372,13 @@ if ($search_import_key) $sql .= natural_search("p.import_key", $sear if ($type == "o") // filtre sur type { $sql .= " AND p.fk_soc IS NULL"; -} -elseif ($type == "f") // filtre sur type +} elseif ($type == "f") // filtre sur type { $sql .= " AND s.fournisseur = 1"; -} -elseif ($type == "c") // filtre sur type +} elseif ($type == "c") // filtre sur type { $sql .= " AND s.client IN (1, 3)"; -} -elseif ($type == "p") // filtre sur type +} elseif ($type == "p") // filtre sur type { $sql .= " AND s.client IN (2, 3)"; } @@ -402,8 +396,7 @@ $sql .= $hookmanager->resPrint; if ($view == "recent") { $sql .= $db->order("p.datec", "DESC"); -} -else { +} else { $sql .= $db->order($sortfield, $sortorder); } @@ -920,8 +913,7 @@ while ($i < min($num, $limit)) $objsoc = new Societe($db); $objsoc->fetch($obj->socid); print $objsoc->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 5665030b6d5..a5a1714b6e5 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -85,18 +85,15 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0) { setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); - } - else { + } else { // Create thumbs $object->addThumbs($newfile); } } - } - else { + } else { setEventMessages("ErrorBadImageFormat", null, 'errors'); } - } - else { + } else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -108,8 +105,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- break; } } - } - else { + } else { $error = $object->error; } } @@ -179,8 +175,7 @@ if ($action == 'edit') $objsoc->fetch($object->socid); print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; - } - else { + } else { print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; @@ -202,8 +197,7 @@ if ($action == 'edit') if (!empty($object->birthday_alert)) { print ''; - } - else { + } else { print ''; } print ''; @@ -219,8 +213,7 @@ if ($action == 'edit') print ''; print ""; -} -else { +} else { // View mode dol_fiche_head($head, 'perso', $title, -1, 'contact'); @@ -294,8 +287,7 @@ else { if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn"); else print $langs->trans("BirthdayAlertOff"); print ''; - } - else { + } else { print ''.$langs->trans("DateToBirth").''; } print ""; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 36a9c950069..d016cb23d75 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -39,8 +39,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7a2f8cf311f..c4f923a7372 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -112,13 +112,10 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) + } elseif ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) { if (!GETPOST('dateend')) { @@ -132,8 +129,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -301,13 +297,11 @@ if (empty($reshook)) } $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; - } - else { + } else { $label = $lines[$i]->product_label; } $desc = ($lines[$i]->desc && $lines[$i]->desc != $lines[$i]->libelle) ?dol_htmlentitiesbr($lines[$i]->desc) : ''; - } - else { + } else { $desc = dol_htmlentitiesbr($lines[$i]->desc); } @@ -352,8 +346,7 @@ if (empty($reshook)) } } } - } - else { + } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); $error++; } @@ -364,28 +357,23 @@ if (empty($reshook)) // modified by hook if ($reshook < 0) $error++; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } - } - else { + } else { $result = $object->create($user); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } $action = 'create'; } } - } - - elseif ($action == 'classin' && $user->rights->contrat->creer) + } elseif ($action == 'classin' && $user->rights->contrat->creer) { $object->setProject(GETPOST('projectid')); } @@ -402,8 +390,7 @@ if (empty($reshook)) { $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); - } - else { + } else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -474,8 +461,7 @@ if (empty($reshook)) $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - } - elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; @@ -507,8 +493,7 @@ if (empty($reshook)) if ($price_base_type != 'HT') { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); - } - else { + } else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -518,8 +503,7 @@ if (empty($reshook)) else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); $fk_unit = $prod->fk_unit; - } - else { + } else { $pu_ht = GETPOST('price_ht'); $price_base_type = 'HT'; $tva_tx = GETPOST('tva_tx') ?str_replace('*', '', GETPOST('tva_tx')) : 0; // tva_tx field may be disabled, so we use vat rate 0 @@ -545,8 +529,7 @@ if (empty($reshook)) { $object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); $result = -1; - } - else { + } else { // Insert line $result = $object->addline( $desc, @@ -619,14 +602,11 @@ if (empty($reshook)) unset($_POST['date_endday']); unset($_POST['date_endmonth']); unset($_POST['date_endyear']); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } - } - - elseif ($action == 'updateline' && $user->rights->contrat->creer && !GETPOST('cancel', 'alpha')) { + } elseif ($action == 'updateline' && $user->rights->contrat->creer && !GETPOST('cancel', 'alpha')) { $error = 0; if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) @@ -732,13 +712,10 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - - elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) + } elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->deleteline(GETPOST('lineid'), $user); @@ -746,13 +723,10 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) + } elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->validate($user); @@ -774,13 +748,10 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'reopen' && $user->rights->contrat->creer) + } elseif ($action == 'reopen' && $user->rights->contrat->creer) { $result = $object->reopen($user); if ($result < 0) @@ -807,22 +778,17 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) + } elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) { $result = $object->delete($user); if ($result >= 0) { header("Location: list.php?restore_lastsearch_values=1"); return; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - - elseif ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) + } elseif ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) { if (GETPOST('newcid') > 0) { @@ -834,16 +800,13 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); return; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } - } - elseif ($action == 'update_extras') + } elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); @@ -863,8 +826,7 @@ if (empty($reshook)) if ($error) { $action = 'edit_extras'; } - } - elseif ($action == 'setref_supplier') + } elseif ($action == 'setref_supplier') { $cancelbutton = GETPOST('cancel', 'alpha'); if (!$cancelbutton) { @@ -878,13 +840,11 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } - elseif ($action == 'setref_customer') + } elseif ($action == 'setref_customer') { $cancelbutton = GETPOST('cancel', 'alpha'); @@ -900,13 +860,11 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } - elseif ($action == 'setref') + } elseif ($action == 'setref') { $cancelbutton = GETPOST('cancel', 'alpha'); @@ -940,13 +898,11 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } - elseif ($action == 'setdate_contrat') + } elseif ($action == 'setdate_contrat') { $cancelbutton = GETPOST('cancel', 'alpha'); @@ -964,8 +920,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } @@ -996,14 +951,12 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1024,8 +977,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1037,8 +989,7 @@ if (empty($reshook)) if (!GETPOST('socid', 3)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); - } - else { + } else { if ($object->id > 0) { $result = $object->createFromClone($user, $socid); if ($result > 0) { @@ -1098,8 +1049,7 @@ if ($action == 'create') if ($element == 'project') { $projectid = GETPOST('originid'); - } - else { + } else { // For compatibility if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } @@ -1126,8 +1076,7 @@ if ($action == 'create') // Object source contacts list $srccontactslist = $objectsrc->liste_contact(-1, 'external', 1); } - } - else { + } else { $projectid = GETPOST('projectid', 'int'); $note_private = GETPOST("note_private"); $note_public = GETPOST("note_public"); @@ -1173,8 +1122,7 @@ if ($action == 'create') print $soc->getNomUrl(1); print ''; print ''; - } - else { + } else { print ''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); print ' '.$langs->trans("AddThirdParty").''; @@ -1268,8 +1216,7 @@ if ($action == 'create') } print "\n"; -} -else /* *************************************************************************** */ +} else /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ @@ -1575,8 +1522,7 @@ else /* ************************************************************************ echo $form->textwithtooltip($text, $description, 3, '', '', $cursorline, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); print ''; - } - else { + } else { print ''.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."\n"; } // VAT @@ -1597,8 +1543,7 @@ else /* ************************************************************************ if ($objp->remise_percent > 0) { print ''.$objp->remise_percent."%\n"; - } - else { + } else { print ' '; } @@ -1655,8 +1600,7 @@ else /* ************************************************************************ $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); print " ".img_warning($textlate); } - } - else print $langs->trans("Unknown"); + } else print $langs->trans("Unknown"); print '  -  '; print $langs->trans("DateEndPlanned").': '; if ($objp->date_fin) @@ -1667,8 +1611,7 @@ else /* ************************************************************************ $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); print " ".img_warning($textlate); } - } - else print $langs->trans("Unknown"); + } else print $langs->trans("Unknown"); print ''; print ''; @@ -1696,8 +1639,7 @@ else /* ************************************************************************ print $productstatic->getNomUrl(1, '', 32); print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; print '
'; - } - else { + } else { print $objp->label ? $objp->label.'
' : ''; } @@ -1773,8 +1715,7 @@ else /* ************************************************************************ } $db->free($result); - } - else { + } else { dol_print_error($db); } @@ -1844,8 +1785,7 @@ else /* ************************************************************************ if (empty($dateactend)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEndReal")), null, 'errors'); - } - else { + } else { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne', 'int')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService", dol_print_date($dateactend, "%A %d %B %Y")), "confirm_closeline", '', 0, 1); } print '
'; @@ -2121,8 +2061,7 @@ else /* ************************************************************************ if ($user->rights->contrat->activer) { print ''; - } - else { + } else { print ''; } } @@ -2131,8 +2070,7 @@ else /* ************************************************************************ if ($user->rights->contrat->desactiver) { print ''; - } - else { + } else { print ''; } @@ -2151,8 +2089,7 @@ else /* ************************************************************************ if (($user->rights->contrat->creer && $object->statut == 0) || $user->rights->contrat->supprimer) { print ''; - } - else { + } else { print ''; } } diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 9caa33fca2d..ffe66208afe 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -169,8 +169,7 @@ class Contracts extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve contrat list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -464,8 +463,7 @@ class Contracts extends DolibarrApi $updateRes = $this->contract->deleteline($lineid, DolibarrApiAccess::$user); if ($updateRes > 0) { return $this->get($id); - } - else { + } else { throw new RestException(405, $this->contract->error); } } @@ -500,8 +498,7 @@ class Contracts extends DolibarrApi if ($this->contract->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); - } - else { + } else { throw new RestException(500, $this->contract->error); } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 304628d97cc..a702847e23b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -298,14 +298,12 @@ class Contrat extends CommonObject if ($numref != "") { return $numref; - } - else { + } else { $this->error = $obj->error; dol_print_error($db, get_class($this)."::getNextValue ".$obj->error); return ""; } - } - else { + } else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Contract")); return ""; @@ -408,8 +406,7 @@ class Contrat extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -464,8 +461,7 @@ class Contrat extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -504,12 +500,10 @@ class Contrat extends CommonObject if ($force_number) { $num = $force_number; - } - elseif (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life + } elseif (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($this->thirdparty); - } - else { + } else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -586,8 +580,7 @@ class Contrat extends CommonObject $this->brouillon = 0; $this->date_validation = $now; } - } - else { + } else { $error++; } @@ -595,8 +588,7 @@ class Contrat extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -659,8 +651,7 @@ class Contrat extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -712,8 +703,7 @@ class Contrat extends CommonObject $this->error = 'Fetch found several records.'; dol_syslog($this->error, LOG_ERR); $result = -2; - } - elseif ($num) // $num = 1 + } elseif ($num) // $num = 1 { $obj = $this->db->fetch_object($resql); if ($obj) @@ -762,14 +752,12 @@ class Contrat extends CommonObject return $this->id; } - } - else { + } else { dol_syslog(get_class($this)."::fetch Contract not found"); $this->error = "Contract not found"; return 0; } - } - else { + } else { dol_syslog(get_class($this)."::fetch Error searching contract"); $this->error = $this->db->error(); return -1; @@ -929,8 +917,7 @@ class Contrat extends CommonObject $pos++; } $this->db->free($result); - } - else { + } else { dol_syslog(get_class($this)."::Fetch Error when reading lines of contracts linked to products"); return -3; } @@ -1070,8 +1057,7 @@ class Contrat extends CommonObject $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); @@ -1118,8 +1104,7 @@ class Contrat extends CommonObject //print $objcontact->code.'-'.$objcontact->source.'-'.$objcontact->fk_socpeople."\n"; $this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object } - } - else dol_print_error($resqlcontact); + } else dol_print_error($resqlcontact); } } @@ -1134,21 +1119,18 @@ class Contrat extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { dol_syslog(get_class($this)."::create - 30 - ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } - } - else { + } else { $this->error = "Failed to add contract"; dol_syslog(get_class($this)."::create - 20 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $langs->trans("UnknownError: ".$this->db->error()." -", LOG_DEBUG); $this->db->rollback(); @@ -1317,8 +1299,7 @@ class Contrat extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1411,8 +1392,7 @@ class Contrat extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -1489,8 +1469,7 @@ class Contrat extends CommonObject if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } @@ -1541,8 +1520,7 @@ class Contrat extends CommonObject if (($result = $this->defineBuyPrice($pu_ht, $remise_percent, $fk_product)) < 0) { return $result; - } - else { + } else { $pa_ht = $result; } } @@ -1613,19 +1591,16 @@ class Contrat extends CommonObject { $this->db->rollback(); return -1; - } - else { + } else { $this->db->commit(); return $contractlineid; } - } - else { + } else { $this->db->rollback(); $this->error = $this->db->error()." sql=".$sql; return -1; } - } - else { + } else { dol_syslog(get_class($this)."::addline ErrorTryToAddLineOnValidatedContract", LOG_ERR); return -2; } @@ -1677,8 +1652,7 @@ class Contrat extends CommonObject { $remise = round(($pu * $remise_percent / 100), 2); $price = $pu - $remise; - } - else { + } else { $remise_percent = 0; } @@ -1728,8 +1702,7 @@ class Contrat extends CommonObject if (($result = $this->defineBuyPrice($pu, $remise_percent)) < 0) { return $result; - } - else { + } else { $pa_ht = $result; } } @@ -1752,14 +1725,10 @@ class Contrat extends CommonObject $sql .= ", total_ttc='".price2num($total_ttc)."'"; $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null"); $sql .= ", buy_price_ht='".price2num($pa_ht)."'"; - if ($date_start > 0) { $sql .= ",date_ouverture_prevue='".$this->db->idate($date_start)."'"; } - else { $sql .= ",date_ouverture_prevue=null"; } - if ($date_end > 0) { $sql .= ",date_fin_validite='".$this->db->idate($date_end)."'"; } - else { $sql .= ",date_fin_validite=null"; } - if ($date_debut_reel > 0) { $sql .= ",date_ouverture='".$this->db->idate($date_debut_reel)."'"; } - else { $sql .= ",date_ouverture=null"; } - if ($date_fin_reel > 0) { $sql .= ",date_cloture='".$this->db->idate($date_fin_reel)."'"; } - else { $sql .= ",date_cloture=null"; } + if ($date_start > 0) { $sql .= ",date_ouverture_prevue='".$this->db->idate($date_start)."'"; } else { $sql .= ",date_ouverture_prevue=null"; } + if ($date_end > 0) { $sql .= ",date_fin_validite='".$this->db->idate($date_end)."'"; } else { $sql .= ",date_fin_validite=null"; } + if ($date_debut_reel > 0) { $sql .= ",date_ouverture='".$this->db->idate($date_debut_reel)."'"; } else { $sql .= ",date_ouverture=null"; } + if ($date_fin_reel > 0) { $sql .= ",date_cloture='".$this->db->idate($date_fin_reel)."'"; } else { $sql .= ",date_cloture=null"; } $sql .= ", fk_unit=".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null"); $sql .= " WHERE rowid = ".$rowid; @@ -1802,14 +1771,12 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::updateline Erreur -2"); return -2; } - } - else { + } else { $this->db->rollback(); $this->error = $this->db->error(); dol_syslog(get_class($this)."::updateline Erreur -1"); @@ -1870,8 +1837,7 @@ class Contrat extends CommonObject $this->db->rollback(); return -1; } - } - else { + } else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } @@ -1967,8 +1933,7 @@ class Contrat extends CommonObject $text .= ($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.ContratLigne::LibStatut(5, 3, -1, 'class="marginleft2"')) : ''; $text .= ($mode == 7 ? '' : ''); return $text; - } - else { + } else { return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } } @@ -2086,8 +2051,7 @@ class Contrat extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -2122,8 +2086,7 @@ class Contrat extends CommonObject $i++; } return $tab; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2159,8 +2122,7 @@ class Contrat extends CommonObject $i++; } return $tab; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2192,8 +2154,7 @@ class Contrat extends CommonObject $sql .= " WHERE c.statut = 1"; $sql .= " AND c.rowid = cd.fk_contrat"; $sql .= " AND cd.statut = 0"; - } - elseif ($mode == 'expired') + } elseif ($mode == 'expired') { $sql = "SELECT cd.rowid, cd.date_fin_validite as datefin"; $sql .= $this->from; @@ -2201,8 +2162,7 @@ class Contrat extends CommonObject $sql .= " AND c.rowid = cd.fk_contrat"; $sql .= " AND cd.statut = 4"; $sql .= " AND cd.date_fin_validite < '".$this->db->idate(dol_now())."'"; - } - elseif ($mode == 'active') + } elseif ($mode == 'active') { $sql = "SELECT cd.rowid, cd.date_fin_validite as datefin"; $sql .= $this->from; @@ -2228,8 +2188,7 @@ class Contrat extends CommonObject $label = $langs->trans("BoardNotActivatedServices"); $labelShort = $langs->trans("BoardNotActivatedServicesShort"); $url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=0&sortfield=cd.date_fin_validite&sortorder=asc'; - } - elseif ($mode == 'expired') { + } elseif ($mode == 'expired') { $warning_delay = $conf->contrat->services->expires->warning_delay; $url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired&sortfield=cd.date_fin_validite&sortorder=asc'; $label = $langs->trans("BoardExpiredServices"); @@ -2260,8 +2219,7 @@ class Contrat extends CommonObject } return $response; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2302,8 +2260,7 @@ class Contrat extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2759,11 +2716,7 @@ class ContratLigne extends CommonObjectLine global $langs; $langs->load("contracts"); - if ($status == self::STATUS_INITIAL) { $labelStatus = $langs->trans("ServiceStatusInitial"); $labelStatusShort = $langs->trans("ServiceStatusInitial"); } - elseif ($status == self::STATUS_OPEN && $expired == -1) { $labelStatus = $langs->trans("ServiceStatusRunning"); $labelStatusShort = $langs->trans("ServiceStatusRunning"); } - elseif ($status == self::STATUS_OPEN && $expired == 0) { $labelStatus = $langs->trans("ServiceStatusNotLate"); $labelStatusShort = $langs->trans("ServiceStatusNotLateShort"); } - elseif ($status == self::STATUS_OPEN && $expired == 1) { $labelStatus = $langs->trans("ServiceStatusLate"); $labelStatusShort = $langs->trans("ServiceStatusLateShort"); } - elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); } + if ($status == self::STATUS_INITIAL) { $labelStatus = $langs->trans("ServiceStatusInitial"); $labelStatusShort = $langs->trans("ServiceStatusInitial"); } elseif ($status == self::STATUS_OPEN && $expired == -1) { $labelStatus = $langs->trans("ServiceStatusRunning"); $labelStatusShort = $langs->trans("ServiceStatusRunning"); } elseif ($status == self::STATUS_OPEN && $expired == 0) { $labelStatus = $langs->trans("ServiceStatusNotLate"); $labelStatusShort = $langs->trans("ServiceStatusNotLateShort"); } elseif ($status == self::STATUS_OPEN && $expired == 1) { $labelStatus = $langs->trans("ServiceStatusLate"); $labelStatusShort = $langs->trans("ServiceStatusLateShort"); } elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); } $statusType = 'status'.$status; if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status1'; @@ -2927,8 +2880,7 @@ class ContratLigne extends CommonObjectLine $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -3013,8 +2965,7 @@ class ContratLigne extends CommonObjectLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -3161,8 +3112,7 @@ class ContratLigne extends CommonObjectLine { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -3243,8 +3193,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); $this->error = $this->db->error()." sql=".$sql; return -1; @@ -3297,8 +3246,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 250d89e3e88..02d9c71776d 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -70,8 +70,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $msg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); @@ -89,8 +88,7 @@ if ($action == 'swapstatut' && $user->rights->contrat->creer) if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne')); - } - else { + } else { dol_print_error($db, $object->error); } } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index e43db63826f..d60d54258bb 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -193,8 +193,7 @@ if ($object->id) $permtoedit = $user->rights->contrat->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 4530d01a6af..40a9a4100da 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -140,8 +140,7 @@ if ($resql) $i++; } $db->free($resql); -} -else { +} else { dol_print_error($db); } // Search by status (only expired) @@ -178,8 +177,7 @@ if ($resql) $i++; } $db->free($resql); -} -else { +} else { dol_print_error($db); } @@ -296,14 +294,12 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) //$tot_ttc+=$obj->total_ttc; $i++; } - } - else { + } else { print ''.$langs->trans("NoContracts").''; } print "
"; $db->free($resql); - } - else { + } else { dol_print_error($db); } } @@ -379,8 +375,7 @@ if ($result) $db->free($result); print ""; -} -else { +} else { dol_print_error($db); } @@ -434,8 +429,7 @@ if ($resql) $productstatic->ref = $obj->pref; $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); - } - else { + } else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -456,8 +450,7 @@ if ($resql) $db->free(); print ""; -} -else { +} else { dol_print_error($db); } @@ -512,8 +505,7 @@ if ($resql) $productstatic->ref = $obj->pref; $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); - } - else { + } else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -533,8 +525,7 @@ if ($resql) $db->free(); print ""; -} -else { +} else { dol_print_error($db); } @@ -590,8 +581,7 @@ if ($resql) $productstatic->ref = $obj->pref; $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); - } - else { + } else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -611,8 +601,7 @@ if ($resql) $db->free(); print ""; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 5053b703966..3627661c727 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -708,8 +708,7 @@ while ($i < min($num, $limit)) if ($nbofsalesrepresentative > 3) { // We print only number print $nbofsalesrepresentative; - } - elseif ($nbofsalesrepresentative > 0) + } elseif ($nbofsalesrepresentative > 0) { $userstatic = new User($db); $j = 0; @@ -731,8 +730,7 @@ while ($i < min($num, $limit)) } } //else print $langs->trans("NoSalesRepresentativeAffected"); - } - else { + } else { print ' '; } print ''; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 62a853270e1..fd46b8eba98 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -102,8 +102,7 @@ if ($search_status != '') if ($tmp[1] == 'filter=notexpired') $filter = 'notexpired'; if ($tmp[1] == 'filter=expired') $filter = 'expired'; } -} -else { +} else { $search_status = $mode; if ($filter == 'expired') $search_status .= '&filter=expired'; if ($filter == 'notexpired') $search_status .= '&filter=notexpired'; @@ -595,8 +594,7 @@ while ($i < min($num, $limit)) print $productstatic->getNomUrl(1, '', 24); print $obj->label ? ' - '.dol_trunc($obj->label, 16) : ''; if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) print '
'.dol_nl2br($obj->description); - } - else { + } else { if ($obj->type == 0) print img_object($obj->description, 'product').' '.dol_trunc($obj->description, 24); if ($obj->type == 1) print img_object($obj->description, 'service').' '.dol_trunc($obj->description, 24); } @@ -679,8 +677,7 @@ while ($i < min($num, $limit)) $warning_delay = $conf->contrat->services->expires->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); print img_warning($textlate); - } - else print '    '; + } else print '    '; print ''; if (!$i) $totalarray['nbfield']++; } @@ -721,8 +718,7 @@ while ($i < min($num, $limit)) { // If contract is draft, we say line is also draft print $contractstatic->LibStatut(0, 5); - } - else { + } else { print $staticcontratligne->LibStatut($obj->statut, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now) ? 1 : 0); } print ''; diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 2d6695ff6cb..f9f10f636ca 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -40,8 +40,7 @@ if ($cancel) { header("Location: ".$backtopageforcancel); exit; - } - elseif (!empty($backtopage)) + } elseif (!empty($backtopage)) { header("Location: ".$backtopage); exit; @@ -57,8 +56,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { if ($object->fields[$key]['type'] == 'duration') { if (GETPOST($key.'hour') == '' && GETPOST($key.'min') == '') continue; // The field was not submited to be edited - } - else { + } else { if (!GETPOSTISSET($key)) continue; // The field was not submited to be edited } // Ignore special fields @@ -106,15 +104,13 @@ if ($action == 'add' && !empty($permissiontoadd)) $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation header("Location: ".$urltogo); exit; - } - else { + } else { // Creation KO if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, null, 'errors'); $action = 'create'; } - } - else { + } else { $action = 'create'; } } @@ -127,15 +123,12 @@ if ($action == 'update' && !empty($permissiontoadd)) // Check if field was submited to be edited if ($object->fields[$key]['type'] == 'duration') { if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) continue; // The field was not submited to be edited - } - elseif ($object->fields[$key]['type'] == 'boolean') { + } elseif ($object->fields[$key]['type'] == 'boolean') { if (!GETPOSTISSET($key)) { $object->$key = 0; // use 0 instead null if the field is defined as not null continue; } - } - - else { + } else { if (!GETPOSTISSET($key)) continue; // The field was not submited to be edited } // Ignore special fields @@ -178,14 +171,12 @@ if ($action == 'update' && !empty($permissiontoadd)) if ($result > 0) { $action = 'view'; - } - else { + } else { // Creation KO setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } - } - else { + } else { $action = 'edit'; } } @@ -204,8 +195,7 @@ if ($action == "update_extras" && !empty($permissiontoadd)) { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = 'view'; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit_extras'; } @@ -227,8 +217,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) setEventMessages("RecordDeleted", null, 'mesgs'); header("Location: ".$backurlforlist); exit; - } - else { + } else { if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, null, 'errors'); } @@ -263,8 +252,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -291,8 +279,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -319,8 +306,7 @@ if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -332,8 +318,7 @@ if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) if ($result >= 0) { // Nothing else done - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -360,8 +345,7 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -372,8 +356,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); - } - else { + } else { $objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone or if createFromClone modifies the object. We use native clone to keep this->db valid. //$objectutil->date = dol_mktime(12, 0, 0, GETPOST('newdatemonth', 'int'), GETPOST('newdateday', 'int'), GETPOST('newdateyear', 'int')); // ... @@ -385,8 +368,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) else $newid = $result; header("Location: ".$_SERVER['PHP_SELF'].'?id='.$newid); // Open record of new object exit; - } - else { + } else { setEventMessages($objectutil->error, $objectutil->errors, 'errors'); $action = ''; } diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index f4b5f1fbb4c..eb51796eccd 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -37,8 +37,7 @@ if ($action == 'builddoc' && $permissiontoadd) if (is_numeric(GETPOST('model', 'alpha'))) { $error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model")); - } - else { + } else { // Reload to get all modified line records and be ready for hooks $ret = $object->fetch($id); $ret = $object->fetch_thirdparty(); @@ -88,8 +87,7 @@ if ($action == 'builddoc' && $permissiontoadd) { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; - } - else { + } else { if (empty($donotredirect)) // This is set when include is done by bulk action "Bill Orders" { setEventMessages($langs->trans("FileGenerated"), null); @@ -132,8 +130,7 @@ if ($action == 'remove_file' && $permissiontoadd) header('Location: '.$urltoredirect); exit; - } - else { + } else { setEventMessages('BugFoundVarUploaddirnotDefined', null, 'errors'); } } diff --git a/htdocs/core/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index 3d18c2d7c24..c352f07f9f7 100644 --- a/htdocs/core/actions_comments.inc.php +++ b/htdocs/core/actions_comments.inc.php @@ -49,8 +49,7 @@ if ($action == 'addcomment') setEventMessages($langs->trans("CommentAdded"), null, 'mesgs'); header('Location: '.$varpage.'?id='.$id.($withproject ? '&withproject=1' : '')); exit; - } - else { + } else { setEventMessages($comment->error, $comment->errors, 'errors'); $action = ''; } @@ -66,8 +65,7 @@ if ($action === 'updatecomment') setEventMessages($langs->trans("CommentAdded"), null, 'mesgs'); header('Location: '.$varpage.'?id='.$id.($withproject ? '&withproject=1#comment' : '')); exit; - } - else { + } else { setEventMessages($comment->error, $comment->errors, 'errors'); $action = ''; } @@ -82,8 +80,7 @@ if ($action == 'deletecomment') setEventMessages($langs->trans("CommentDeleted"), null, 'mesgs'); header('Location: '.$varpage.'?id='.$id.($withproject ? '&withproject=1' : '')); exit; - } - else { + } else { setEventMessages($comment->error, $comment->errors, 'errors'); $action = ''; } diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 5a044d7a464..46a6a31c202 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -122,8 +122,7 @@ if ($action == 'add') $mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne); $action = 'create'; } - } - else { + } else { $error++; $langs->load("errors"); $mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne); @@ -148,8 +147,7 @@ if ($action == 'add') { $params['options'] = array($parameters=>null); } - } - else { + } else { //Esle it's separated key/value and coma list foreach ($parameters_array as $param_ligne) { @@ -189,22 +187,19 @@ if ($action == 'add') setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { $error++; $mesg = $extrafields->error; setEventMessages($mesg, null, 'errors'); } - } - else { + } else { $error++; $langs->load("errors"); $mesg = $langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters", $langs->transnoentities("AttributeCode")); setEventMessages($mesg, null, 'errors'); $action = 'create'; } - } - else { + } else { setEventMessages($mesg, null, 'errors'); } } @@ -288,8 +283,7 @@ if ($action == 'update') $mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne); $action = 'edit'; } - } - else { + } else { $error++; $langs->load("errors"); $mesg[] = $langs->trans("ErrorBadFormatValueList", $param_ligne); @@ -313,8 +307,7 @@ if ($action == 'update') { $params['options'] = array($parameters=>null); } - } - else { + } else { //Esle it's separated key/value and coma list foreach ($parameters_array as $param_ligne) { @@ -354,21 +347,18 @@ if ($action == 'update') setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { $error++; $mesg = $extrafields->error; setEventMessages($mesg, null, 'errors'); } - } - else { + } else { $error++; $langs->load("errors"); $mesg = $langs->trans("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("AttributeCode")); setEventMessages($mesg, null, 'errors'); } - } - else { + } else { setEventMessages($mesg, null, 'errors'); } } @@ -384,10 +374,8 @@ if ($action == 'delete') { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else $mesg = $extrafields->error; - } - else { + } else $mesg = $extrafields->error; + } else { $error++; $langs->load("errors"); $mesg = $langs->trans("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("AttributeCode")); diff --git a/htdocs/core/actions_fetchobject.inc.php b/htdocs/core/actions_fetchobject.inc.php index 6da2b0e674e..a77fc6e5ff6 100644 --- a/htdocs/core/actions_fetchobject.inc.php +++ b/htdocs/core/actions_fetchobject.inc.php @@ -37,16 +37,14 @@ if (($id > 0 || (!empty($ref) && !in_array($action, array('create', 'createtask' { $object->fetch_thirdparty(); $id = $object->id; - } - else { + } else { if (empty($object->error) && !count($object->errors)) { if ($ret < 0) // if $ret == 0, it means not found. { setEventMessages('Fetch on object (type '.get_class($object).') return an error without filling $object->error nor $object->errors', null, 'errors'); } - } - else setEventMessages($object->error, $object->errors, 'errors'); + } else setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index aeb86f9c609..ea55052f880 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -41,8 +41,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) $error++; if ($_FILES['userfile']['error'][$key] == 1 || $_FILES['userfile']['error'][$key] == 2) { setEventMessages($langs->trans('ErrorFileSizeTooLarge'), null, 'errors'); - } - else { + } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); } } @@ -58,15 +57,13 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) if (!empty($upload_dirold) && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { $result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs); - } - elseif (!empty($upload_dir)) + } elseif (!empty($upload_dir)) { $result = dol_add_file_process($upload_dir, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs); } } } -} -elseif (GETPOST('linkit', 'none') && !empty($conf->global->MAIN_UPLOAD_DOC)) +} elseif (GETPOST('linkit', 'none') && !empty($conf->global->MAIN_UPLOAD_DOC)) { $link = GETPOST('link', 'alpha'); if ($link) @@ -86,8 +83,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') if (GETPOST('section', 'alpha')) { // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir $file = $upload_dir.(preg_match('/\/$/', $upload_dir) ? '' : '/').$urlfile; - } - else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. + } else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. { $urlfile = basename($urlfile); $file = $upload_dir.(preg_match('/\/$/', $upload_dir) ? '' : '/').$urlfile; @@ -124,8 +120,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') } else { setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors'); } - } - elseif ($linkid) // delete of external link + } elseif ($linkid) // delete of external link { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $link = new Link($db); @@ -148,15 +143,13 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($backtopage) { header('Location: '.$backtopage); exit; - } - else { + } else { $tmpurl = $_SERVER["PHP_SELF"].'?id='.$object->id.(GETPOST('section_dir', 'alpha') ? '§ion_dir='.urlencode(GETPOST('section_dir', 'alpha')) : '').(!empty($withproject) ? '&withproject=1' : ''); header('Location: '.$tmpurl); exit; } } -} -elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha')) +} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha')) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $langs->load('link'); @@ -175,12 +168,10 @@ elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST(' { setEventMessages($langs->trans("ErrorFailedToUpdateLink", $link->label), null, 'mesgs'); } - } - else { + } else { //error fetching } -} -elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) +} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) { // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. if (!empty($upload_dir)) @@ -233,13 +224,11 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) } setEventMessages($langs->trans("FileRenamed"), null); - } - else { + } else { $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); } - } - else { + } else { $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorDestinationAlreadyExists", $filenameto), null, 'errors'); } @@ -265,8 +254,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $ecmfile->share = getRandomPassword(true); } - } - else { + } else { $ecmfile->share = ''; } $result = $ecmfile->update($user); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 41660a47815..23c76ae81fb 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -180,8 +180,7 @@ if (!$error && $massaction == 'confirm_presend') if ($val == 'thirdparty') // Id of third party or user { $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; - } - elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact + } elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; @@ -210,8 +209,7 @@ if (!$error && $massaction == 'confirm_presend') if ($val == 'thirdparty') // Id of third party { $tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>'; - } - elseif ($val) // Id du contact + } elseif ($val) // Id du contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? @@ -256,20 +254,17 @@ if (!$error && $massaction == 'confirm_presend') if ($objectobj->element == 'societe') { $sendto = $objectobj->email; - } - elseif ($objectobj->element == 'expensereport') + } elseif ($objectobj->element == 'expensereport') { $fuser = new User($db); $fuser->fetch($objectobj->fk_user_author); $sendto = $fuser->email; - } - elseif ($objectobj->element == 'holiday') + } elseif ($objectobj->element == 'holiday') { $fuser = new User($db); $fuser->fetch($objectobj->fk_user); $sendto = $fuser->email; - } - elseif ($objectobj->element == 'facture' && !empty($listofobjectcontacts[$objectid])) + } elseif ($objectobj->element == 'facture' && !empty($listofobjectcontacts[$objectid])) { $emails_to_sends = array(); $objectobj->fetch_thirdparty(); @@ -283,8 +278,7 @@ if (!$error && $massaction == 'confirm_presend') if (count($emails_to_sends) > 0) { $sendto = implode(',', $emails_to_sends); } - } - else { + } else { $objectobj->fetch_thirdparty(); $sendto = $objectobj->thirdparty->email; } @@ -335,8 +329,7 @@ if (!$error && $massaction == 'confirm_presend') 'names'=>array($filename), 'mimes'=>array($mime) ); - } - else { + } else { $nbignored++; $langs->load("errors"); $resaction .= '
'.$langs->trans('ErrorCantReadFile', $file).'

'; @@ -362,19 +355,15 @@ if (!$error && $massaction == 'confirm_presend') $fromtype = GETPOST('fromtype'); if ($fromtype === 'user') { $from = $user->getFullName($langs).' <'.$user->email.'>'; - } - elseif ($fromtype === 'company') { + } elseif ($fromtype === 'company') { $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; - } - elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { + } elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { $tmp = explode(',', $user->email_aliases); $from = trim($tmp[($reg[1] - 1)]); - } - elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { + } elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { $tmp = explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); $from = trim($tmp[($reg[1] - 1)]); - } - elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { + } elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { $sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1]; $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -382,8 +371,7 @@ if (!$error && $massaction == 'confirm_presend') { $from = $obj->label.' <'.$obj->email.'>'; } - } - else { + } else { $from = $_POST['fromname'].' <'.$_POST['frommail'].'>'; } @@ -410,8 +398,7 @@ if (!$error && $massaction == 'confirm_presend') { $looparray[$key]->thirdparty = $thirdparty; // Force thirdparty on object } - } - else { + } else { $objectforloop = new $objectclass($db); $objectforloop->thirdparty = $thirdparty; // Force thirdparty on object (even if object was not loaded) $looparray[0] = $objectforloop; @@ -461,8 +448,7 @@ if (!$error && $massaction == 'confirm_presend') ); } } - } - elseif (!empty($attachedfilesThirdpartyObj[$thirdparty->id][$objectid])) { + } elseif (!empty($attachedfilesThirdpartyObj[$thirdparty->id][$objectid])) { // Create form object // if "one email per recipient" isn't check we must separate $attachedfiles by object $attachedfiles = $attachedfilesThirdpartyObj[$thirdparty->id][$objectid]; @@ -478,8 +464,7 @@ if (!$error && $massaction == 'confirm_presend') $trackid = 'thi'.$thirdparty->id; if ($objecttmp->element == 'expensereport') $trackid = 'use'.$thirdparty->id; if ($objecttmp->element == 'holiday') $trackid = 'use'.$thirdparty->id; - } - else { + } else { $trackid = strtolower(get_class($objecttmp)); if (get_class($objecttmp) == 'Contrat') $trackid = 'con'; if (get_class($objecttmp) == 'Propal') $trackid = 'pro'; @@ -503,8 +488,7 @@ if (!$error && $massaction == 'confirm_presend') if ($mailfile->error) { $resaction .= '
'.$mailfile->error.'
'; - } - else { + } else { $result = $mailfile->sendfile(); if ($result) { @@ -569,15 +553,13 @@ if (!$error && $massaction == 'confirm_presend') $nbsent++; // Nb of object sent } - } - else { + } else { $langs->load("other"); if ($mailfile->error) { $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); $resaction .= '
'.$mailfile->error.'
'; - } - else { + } else { $resaction .= '
No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS
'; } } @@ -598,8 +580,7 @@ if (!$error && $massaction == 'confirm_presend') //setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs'); setEventMessages($langs->trans("EMailSentForNElements", $nbsent.'/'.count($toselect)), null, 'mesgs'); setEventMessages($resaction, null, 'mesgs'); - } - else { + } else { //setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file setEventMessages($resaction, null, 'warnings'); } @@ -714,14 +695,12 @@ if ($massaction == 'confirm_createbills') // Create bills from orders { $result = $objecttmp->insert_discount($discountid); //$result=$discount->link_to_invoice($lineid,$id); - } - else { + } else { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; break; } - } - else { + } else { // Positive line $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Date start @@ -779,8 +758,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders if ($result > 0) { $lineid = $result; - } - else { + } else { $lineid = 0; $error++; break; @@ -870,8 +848,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders header("Location: ".$_SERVER['PHP_SELF'].'?'.$param); exit; - } - else { + } else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -901,16 +878,14 @@ if (!$error && $massaction == 'cancelorders') setEventMessages($langs->trans("ErrorObjectMustHaveStatusValidToBeCanceled", $cmd->ref), null, 'errors'); $error++; break; - } - else $result = $cmd->cancel(); + } else $result = $cmd->cancel(); if ($result < 0) { setEventMessages($cmd->error, $cmd->errors, 'errors'); $error++; break; - } - else $nbok++; + } else $nbok++; } if (!$error) { @@ -918,8 +893,7 @@ if (!$error && $massaction == 'cancelorders') setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -1020,12 +994,10 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $langs->load("exports"); setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); } - } - else { + } else { // Create empty PDF $formatarray = pdf_getFormat(); $page_largeur = $formatarray['width']; @@ -1082,8 +1054,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $langs->load("exports"); setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); } } @@ -1139,16 +1110,13 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftToBeValidated", $objecttmp->ref), null, 'errors'); $error++; break; - } - elseif ($result < 0) + } elseif ($result < 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; - } - else $nbok++; - } - else { + } else $nbok++; + } else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -1160,8 +1128,7 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); } //var_dump($listofobjectthirdparties);exit; @@ -1183,8 +1150,7 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissio $error++; break; } else $nbok++; - } - else { + } else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -1196,8 +1162,7 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissio setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -1244,10 +1209,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; - } - else $nbok++; - } - else { + } else $nbok++; + } else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -1259,8 +1222,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' if ($nbok > 1) setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); } //var_dump($listofobjectthirdparties);exit; @@ -1304,10 +1266,8 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; - } - else $nbok++; - } - else { + } else $nbok++; + } else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -1319,8 +1279,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) if ($nbok > 1) setEventMessages($langs->trans("RecordsGenerated", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordGenerated", $nbok), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); } } diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index e2da8a4170c..e88fc937e38 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -75,8 +75,7 @@ if ($action == 'print_file' && $user->rights->printing->read) { setEventMessages($printer->error, $printer->errors); setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); } - } - catch (Exception $e) + } catch (Exception $e) { $ret = 1; setEventMessages($e->getMessage(), null, 'errors'); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index df461e47a95..bc38d9839af 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -120,38 +120,32 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST if ($object->element == 'user' && $result == 0) $result = 1; // Even if not found, we consider ok $thirdparty = $object->thirdparty; $sendtosocid = $thirdparty->id; - } - elseif ($object->element == 'member' || $object->element == 'user') + } elseif ($object->element == 'member' || $object->element == 'user') { $thirdparty = $object; if ($object->socid > 0) $sendtosocid = $object->socid; - } - elseif ($object->element == 'expensereport') + } elseif ($object->element == 'expensereport') { $tmpuser = new User($db); $tmpuser->fetch($object->fk_user_author); $thirdparty = $tmpuser; if ($object->socid > 0) $sendtosocid = $object->socid; - } - elseif ($object->element == 'societe') + } elseif ($object->element == 'societe') { $thirdparty = $object; if ($thirdparty->id > 0) $sendtosocid = $thirdparty->id; - } - elseif ($object->element == 'contact') + } elseif ($object->element == 'contact') { $contact = $object; if ($contact->id > 0) $sendtosocid = $contact->fetch_thirdparty()->id; - } - else dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported"); + } else dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported"); if (is_object($hookmanager)) { $parameters = array(); $reshook = $hookmanager->executeHooks('initSendToSocid', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks } - } - else $thirdparty = $mysoc; + } else $thirdparty = $mysoc; if ($result > 0) { @@ -189,8 +183,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST elseif ($val == 'contact') // Key selected means current contact { $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; - } - elseif ($val) // $val is the Id of a contact + } elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; @@ -239,8 +232,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST elseif ($val == 'contact') // Key selected means current contact { $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; - } - elseif ($val) // $val is the Id of a contact + } elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? @@ -277,22 +269,17 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST $fromtype = GETPOST('fromtype', 'alpha'); if ($fromtype === 'robot') { $from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>'; - } - elseif ($fromtype === 'user') { + } elseif ($fromtype === 'user') { $from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>'; - } - elseif ($fromtype === 'company') { + } elseif ($fromtype === 'company') { $from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; - } - elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { + } elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { $tmp = explode(',', $user->email_aliases); $from = trim($tmp[($reg[1] - 1)]); - } - elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { + } elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { $tmp = explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); $from = trim($tmp[($reg[1] - 1)]); - } - elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { + } elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { $sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile'; $sql .= ' WHERE rowid = '.(int) $reg[1]; $resql = $db->query($sql); @@ -301,8 +288,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $from = dol_string_nospecial($obj->label, ' ', array(",")).' <'.$obj->email.'>'; } - } - else { + } else { $from = dol_string_nospecial($_POST['fromname'], ' ', array(",")).' <'.$_POST['frommail'].'>'; } @@ -419,8 +405,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = 'presend'; - } - else { + } else { $result = $mailfile->sendfile(); if ($result) { @@ -478,16 +463,14 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST if (isset($paramname2) || isset($paramval2)) $moreparam .= '&'.($paramname2 ? $paramname2 : 'mid').'='.$paramval2; header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ? $paramname : 'id').'='.(is_object($object) ? $object->id : '').$moreparam); exit; - } - else { + } else { $langs->load("other"); $mesg = '
'; if ($mailfile->error) { $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($from), dol_escape_htmltag($sendto)); $mesg .= '
'.$mailfile->error; - } - else { + } else { $mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; } $mesg .= '
'; @@ -496,15 +479,13 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST $action = 'presend'; } } - } - else { + } else { $langs->load("errors"); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("MailTo")), null, 'warnings'); dol_syslog('Try to send email with no recipient defined', LOG_WARNING); $action = 'presend'; } - } - else { + } else { $langs->load("other"); setEventMessages($langs->trans('ErrorFailedToReadObject', $object->element), null, 'errors'); dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element); diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index ea407375e12..05be4a31d18 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -50,8 +50,7 @@ if ($action == 'update' && is_array($arrayofparameters)) { $db->commit(); if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); } @@ -110,8 +109,7 @@ if ($action == 'setModuleOptions') { $db->commit(); if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); } diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index d5cf3ae1b48..9fb743f1208 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -68,8 +68,7 @@ if (!isset($mode) || $mode != 'noajax') // For ajax call //dol_print_error($db,$ecmdir->error); //exit; } -} -else // For no ajax call +} else // For no ajax call { $rootdirfordoc = $conf->ecm->dir_output; @@ -85,8 +84,7 @@ else // For no ajax call } $relativepath = $ecmdir->getRelativePath(); // Example 'mydir/' - } - elseif (GETPOST('section_dir')) + } elseif (GETPOST('section_dir')) { $relativepath = GETPOST('section_dir'); } @@ -258,8 +256,7 @@ if ($type == 'directory') if (!preg_match('/pageid=/', $param)) $param .= '&pageid='.urlencode(GETPOST('pageid', 'int')); //if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid); } - } - else { + } else { $relativepath = $ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; } @@ -268,8 +265,7 @@ if ($type == 'directory') if (($section === '0' || empty($section)) && ($module != 'medias')) { $filearray = array(); - } - else { + } else { $filearray = dol_dir_list($upload_dir, "files", 0, '', array('^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^CVS$'), $sortfield, $sorting, 1); } @@ -279,13 +275,11 @@ if ($type == 'directory') if (isset($search_doc_ref) && $search_doc_ref != '') $param .= '&search_doc_ref='.$search_doc_ref; $textifempty = $langs->trans('NoFileFound'); - } - elseif ($section === '0') + } elseif ($section === '0') { if ($module == 'ecm') $textifempty = '
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; else $textifempty = $langs->trans('NoFileFound'); - } - else $textifempty = ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("ECMSelectASection")); + } else $textifempty = ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("ECMSelectASection")); if ($module == 'medias') { @@ -293,8 +287,7 @@ if ($type == 'directory') $modulepart = 'medias'; $perm = ($user->rights->website->write || $user->rights->emailing->creer); $title = 'none'; - } - elseif ($module == 'ecm') // DMS/ECM -> manual structure + } elseif ($module == 'ecm') // DMS/ECM -> manual structure { if ($user->rights->ecm->read) { @@ -317,8 +310,7 @@ if ($type == 'directory') $perm = $user->rights->ecm->upload; $modulepart = 'ecm'; $title = ''; // Use default - } - else { + } else { $useinecm = 5; $modulepart = 'ecm'; $perm = $user->rights->ecm->upload; diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index f5ac3e2e422..620643da8f2 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -49,8 +49,7 @@ if (!isset($mode) || $mode != 'noajax') // For ajax call $preopened = GETPOST('preopened'); if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/' -} -else // For no ajax call +} else // For no ajax call { //if (GETPOST('preopened')) { $_GET['dir'] = $_POST['dir'] = GETPOST('preopened'); } @@ -73,8 +72,7 @@ if ($modulepart == 'ecm') { $fullpathselecteddir = $conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : ''); $fullpathpreopened = $conf->ecm->dir_output.'/'.($preopened != '/' ? $preopened : ''); -} -elseif ($modulepart == 'medias') +} elseif ($modulepart == 'medias') { $fullpathselecteddir = $dolibarr_main_data_root.'/medias/'.($selecteddir != '/' ? $selecteddir : ''); $fullpathpreopened = $dolibarr_main_data_root.'/medias/'.($preopened != '/' ? $preopened : ''); @@ -95,8 +93,7 @@ if (preg_match('/\.\./', $fullpathselecteddir) || preg_match('/[<>|]/', $fullpat if ($modulepart == 'ecm') { if (!$user->rights->ecm->read) accessforbidden(); -} -elseif ($modulepart == 'medias') +} elseif ($modulepart == 'medias') { // Always allowed } @@ -471,8 +468,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, if ($modulepart == 'ecm') { $newfullpathselecteddir = $conf->ecm->dir_output.'/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : ''); - } - elseif ($modulepart == 'medias') + } elseif ($modulepart == 'medias') { $newfullpathselecteddir = $dolibarr_main_data_root.'/medias/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : ''); } @@ -486,7 +482,6 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, echo "\n"; } - } - else print "PermissionDenied"; + } else print "PermissionDenied"; } } diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 674dab95842..98d7d00a8dc 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -60,8 +60,7 @@ if ($time >= $_SESSION['auto_check_events_not_before']) dol_syslog("We ask to check browser notification on a too large period. We fix this with current date."); $starttime = $time; } - } - else { + } else { $starttime = $time; } @@ -108,8 +107,7 @@ if ($time >= $_SESSION['auto_check_events_not_before']) $eventfound[] = $event; } - } - else { + } else { dol_syslog("Error sql = ".$db->lasterror(), LOG_ERR); } } diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index c7e5bbd8991..1ed8ca34076 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -57,8 +57,7 @@ if (!empty($action) && !empty($name)) if ($action == 'set') { dolibarr_set_const($db, $name, $value, 'chaine', 0, '', $entity); - } - elseif ($action == 'del') + } elseif ($action == 'del') { dolibarr_del_const($db, $name, $entity); } diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index a3db4505f70..803155ce784 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.php @@ -51,20 +51,11 @@ if (!empty($id) && !empty($element) && !empty($htmlelement) && !empty($type)) $classpath = $subelement = $element; // For compatibility - if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; } - elseif ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; } - elseif ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; } - elseif ($element == 'contract') { $classpath = $subelement = 'contrat'; } - elseif ($element == 'shipping') { $classpath = $subelement = 'expedition'; } - elseif ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; } - elseif ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; } - elseif ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; } + if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; } elseif ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; } elseif ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; } elseif ($element == 'contract') { $classpath = $subelement = 'contrat'; } elseif ($element == 'shipping') { $classpath = $subelement = 'expedition'; } elseif ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; } elseif ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; } elseif ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; } dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php'); - if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; } - elseif ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; } - else $classname = ucfirst($subelement); + if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; } elseif ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; } else $classname = ucfirst($subelement); $object = new $classname($db); $object->fetch($id); diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 742e22a5a9f..b1a72868312 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -62,8 +62,7 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e elseif ($element == 'order_supplier') { $element = 'fournisseur'; $subelement = 'commande'; - } - elseif ($element == 'invoice_supplier') { + } elseif ($element == 'invoice_supplier') { $element = 'fournisseur'; $subelement = 'facture'; } @@ -83,8 +82,7 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e { $ret = $form->$methodname(); if ($ret > 0) echo json_encode($form->$cachename); - } - elseif (!empty($ext_element)) + } elseif (!empty($ext_element)) { $module = $subelement = $ext_element; if (preg_match('/^([^_]+)_([^_]+)/i', $ext_element, $regs)) @@ -99,14 +97,12 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e $ret = $object->$methodname($fk_element); if ($ret > 0) echo json_encode($object->$cachename); } - } - else { + } else { $object = new GenericObject($db); $value = $object->$loadmethod($table_element, $fk_element, $field); echo $value; } - } - else { + } else { echo $langs->transnoentities('NotEnoughPermissions'); } } diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 6466df89a07..6c9f97bfbb0 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -58,11 +58,9 @@ print ''; $return .= ''; - } - else { + } else { $return .= ''; $return .= ''; } - } - else { + } else { $return .= ''; $return .= ''; } - } - else { + } else { if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) { $return .= ''; $return .= ''; - } - else { + } else { $return .= ''; $return .= ''; } @@ -7443,8 +7218,7 @@ abstract class CommonObject { $return .= ''; if (($nbphoto % $nbbyrow) == 0) $return .= ''; - } - elseif ($nbbyrow < 0) $return .= ''; + } elseif ($nbbyrow < 0) $return .= ''; } if (empty($size)) { // Format origine @@ -7533,8 +7307,7 @@ abstract class CommonObject { if (isset($info['type']) && ($info['type'] == 'duration')) return true; else return false; - } - else return false; + } else return false; } /** @@ -7549,8 +7322,7 @@ abstract class CommonObject { if (isset($info['type']) && ($info['type'] == 'int' || preg_match('/^integer/i', $info['type']))) return true; else return false; - } - else return false; + } else return false; } /** @@ -7654,12 +7426,10 @@ abstract class CommonObject if (empty($this->{$field})) { $queryarray[$field] = null; - } - else { + } else { $queryarray[$field] = $this->db->idate($this->{$field}); } - } - elseif ($this->isArray($info)) + } elseif ($this->isArray($info)) { if (!empty($this->{$field})) { if (!is_array($this->{$field})) { @@ -7669,14 +7439,12 @@ abstract class CommonObject } else { $queryarray[$field] = null; } - } - elseif ($this->isDuration($info)) + } elseif ($this->isDuration($info)) { // $this->{$field} may be null, '', 0, '0', 123, '123' if ($this->{$field} != '' || !empty($info['notnull'])) $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1 else $queryarray[$field] = null; - } - elseif ($this->isInt($info) || $this->isFloat($info)) + } elseif ($this->isInt($info) || $this->isFloat($info)) { if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field] = $conf->entity; else { @@ -7684,11 +7452,9 @@ abstract class CommonObject if ($this->{$field} != '' || !empty($info['notnull'])) { if ($this->isInt($info)) $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1 if ($this->isFloat($info)) $queryarray[$field] = (double) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1 - } - else $queryarray[$field] = null; + } else $queryarray[$field] = null; } - } - else { + } else { $queryarray[$field] = $this->{$field}; } @@ -7713,8 +7479,7 @@ abstract class CommonObject { if (empty($obj->{$field}) || $obj->{$field} === '0000-00-00 00:00:00' || $obj->{$field} === '1000-01-01 00:00:00') $this->{$field} = 0; else $this->{$field} = strtotime($obj->{$field}); - } - elseif ($this->isArray($info)) + } elseif ($this->isArray($info)) { if (!empty($obj->{$field})) { $this->{$field} = @unserialize($obj->{$field}); @@ -7723,8 +7488,7 @@ abstract class CommonObject } else { $this->{$field} = array(); } - } - elseif ($this->isInt($info)) + } elseif ($this->isInt($info)) { if ($field == 'rowid') $this->id = (int) $obj->{$field}; else { @@ -7732,8 +7496,7 @@ abstract class CommonObject { if (empty($obj->{$field})) $this->{$field} = null; else $this->{$field} = (double) $obj->{$field}; - } - else { + } else { if (!is_null($obj->{$field}) || (isset($info['notnull']) && $info['notnull'] == 1)) { $this->{$field} = (int) $obj->{$field}; } else { @@ -7741,23 +7504,20 @@ abstract class CommonObject } } } - } - elseif ($this->isFloat($info)) + } elseif ($this->isFloat($info)) { if ($this->isForcedToNullIfZero($info)) { if (empty($obj->{$field})) $this->{$field} = null; else $this->{$field} = (double) $obj->{$field}; - } - else { + } else { if (!is_null($obj->{$field}) || (isset($info['notnull']) && $info['notnull'] == 1)) { $this->{$field} = (double) $obj->{$field}; } else { $this->{$field} = null; } } - } - else { + } else { $this->{$field} = $obj->{$field}; } } @@ -7970,12 +7730,10 @@ abstract class CommonObject { $this->setVarsFromFetchObj($obj); return $this->id; - } - else { + } else { return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; return -1; @@ -8023,8 +7781,7 @@ abstract class CommonObject } return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; return -1; @@ -8151,8 +7908,7 @@ abstract class CommonObject return -1; } } - } - elseif (!empty($this->fk_element) && !empty($this->childtables)) // If object has childs linked with a foreign key field, we check all child tables. + } elseif (!empty($this->fk_element) && !empty($this->childtables)) // If object has childs linked with a foreign key field, we check all child tables. { $objectisused = $this->isObjectUsed($this->id); if (!empty($objectisused)) @@ -8318,8 +8074,7 @@ abstract class CommonObject $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 9edbe27aae0..f92004120ff 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -82,8 +82,7 @@ abstract class CommonObjectLine extends CommonObject $label = $res[$label_type]; $this->db->free($resql); return $label; - } - else { + } else { $this->error = $this->db->error().' sql='.$sql; dol_syslog(get_class($this)."::getLabelOfUnit Error ".$this->error, LOG_ERR); return -1; diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 50330f26b17..6c832c4788d 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -175,8 +175,7 @@ abstract class CommonStickerGenerator $hauteur = abs($y1 - $y2); if ($length > $hauteur) { $Pointilles = ($length / $nbPointilles) / 2; // taille des pointilles - } - else { + } else { $Pointilles = ($hauteur / $nbPointilles) / 2; } for ($i = $x1; $i <= $x2; $i += $Pointilles + $Pointilles) { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e535a4f0ca4..4bcbf3e2e99 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -251,8 +251,7 @@ class Conf { try { date_default_timezone_set($this->global->MAIN_SERVER_TZ); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog("Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR); } @@ -334,8 +333,7 @@ class Conf // For backward compatibility $this->$module->$dirname = $rootfordata."/".$name; - } - else { + } else { // For multicompany sharings $this->$module->$multidirname = array($this->entity => $rootfortemp."/".$name."/temp"); diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php index 0b017022e41..caaeb706c32 100644 --- a/htdocs/core/class/coreobject.class.php +++ b/htdocs/core/class/coreobject.class.php @@ -74,8 +74,7 @@ class CoreObject extends CommonObject $this->is_clone = false; return true; - } - else { + } else { return false; } } @@ -92,8 +91,7 @@ class CoreObject extends CommonObject if (isset($this->fields[$field]) && method_exists($this, 'is_'.$type)) { return $this->{'is_'.$type}($this->fields[$field]); - } - else { + } else { return false; } } @@ -197,8 +195,7 @@ class CoreObject extends CommonObject $this->{$className}[] = $o; } - } - else { + } else { $this->errors[] = $this->db->lasterror(); } } @@ -253,8 +250,7 @@ class CoreObject extends CommonObject $result = $this->call_trigger(strtoupper($this->element).'_UPDATE', $user); if ($result < 0) $error++; else $this->saveChild($user); - } - else { + } else { $error++; $this->error = $this->db->lasterror(); $this->errors[] = $this->error; @@ -264,8 +260,7 @@ class CoreObject extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -292,8 +287,7 @@ class CoreObject extends CommonObject $result = $this->call_trigger(strtoupper($this->element).'_CREATE', $user); if ($result < 0) $error++; else $this->saveChild($user); - } - else { + } else { $error++; $this->error = $this->db->lasterror(); $this->errors[] = $this->error; @@ -303,8 +297,7 @@ class CoreObject extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -349,8 +342,7 @@ class CoreObject extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; $this->db->rollback(); @@ -386,8 +378,7 @@ class CoreObject extends CommonObject if (empty($date)) { $this->{$field} = 0; - } - else { + } else { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $this->{$field} = dol_stringtotime($date); } @@ -409,15 +400,12 @@ class CoreObject extends CommonObject if ($this->checkFieldType($key, 'date')) { $this->setDate($key, $value); - } - elseif ($this->checkFieldType($key, 'float')) + } elseif ($this->checkFieldType($key, 'float')) { $this->{$key} = (double) price2num($value); - } - elseif ($this->checkFieldType($key, 'int')) { + } elseif ($this->checkFieldType($key, 'int')) { $this->{$key} = (int) price2num($value); - } - else { + } else { $this->{$key} = dol_string_nohtmltag($value); } } diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 9f49e77f35a..34ef707b674 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -132,8 +132,7 @@ class Cstate // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -175,8 +174,7 @@ class Cstate // extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -262,8 +260,7 @@ class Cstate // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 8e567a552b2..07d3563088e 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -136,8 +136,7 @@ class Ctypent // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -184,8 +183,7 @@ class Ctypent // extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -238,8 +236,7 @@ class Ctypent // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -277,8 +274,7 @@ class Ctypent // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 80ea8e2f0cc..ac7b07ea5a9 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -135,8 +135,7 @@ class CUnits // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -194,8 +193,7 @@ class CUnits // extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -234,14 +232,11 @@ class CUnits // extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.active' || $key == 't.scale') { $sqlwhere[] = $key.'='.(int) $value; - } - elseif (strpos($key, 'date') !== false) { + } elseif (strpos($key, 'date') !== false) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; - } - elseif ($key == 't.unit_type' || $key == 't.code' || $key == 't.short_label') { + } elseif ($key == 't.unit_type' || $key == 't.code' || $key == 't.short_label') { $sqlwhere[] = $key.' = \''.$this->db->escape($value).'\''; - } - else { + } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } } @@ -337,8 +332,7 @@ class CUnits // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -376,8 +370,7 @@ class CUnits // extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -395,8 +388,7 @@ class CUnits // extends CommonObject if ($mode == 'short_label'){ return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid'); - } - elseif ($mode == 'code'){ + } elseif ($mode == 'code'){ return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid'); } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 8cf13771d35..4cddc65d636 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -187,13 +187,11 @@ class DiscountAbsolute $this->db->free($resql); return 1; - } - else { + } else { $this->db->free($resql); return 0; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -262,8 +260,7 @@ class DiscountAbsolute { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_remise_except"); return $this->id; - } - else { + } else { $this->error = $this->db->lasterror().' - sql='.$sql; return -1; } @@ -300,8 +297,7 @@ class DiscountAbsolute $this->error = 'ErrorThisPartOrAnotherIsAlreadyUsedSoDiscountSerieCantBeRemoved'; return -2; } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -327,8 +323,7 @@ class DiscountAbsolute $this->error = 'ErrorThisPartOrAnotherIsAlreadyUsedSoDiscountSerieCantBeRemoved'; return -2; } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -363,14 +358,12 @@ class DiscountAbsolute { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } - } - elseif ($this->fk_invoice_supplier_source) { + } elseif ($this->fk_invoice_supplier_source) { $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn"; $sql .= " set paye=0, fk_statut=1"; $sql .= " WHERE (type = 2 or type = 3) AND rowid=".$this->fk_invoice_supplier_source; @@ -381,19 +374,16 @@ class DiscountAbsolute { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } - } - else { + } else { $this->db->commit(); return 1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -449,8 +439,7 @@ class DiscountAbsolute $this->fk_facture = $rowidinvoice; } return 1; - } - else { + } else { $this->error = $this->db->error(); return -3; } @@ -480,8 +469,7 @@ class DiscountAbsolute if ($resql) { return 1; - } - else { + } else { $this->error = $this->db->error(); return -3; } @@ -557,15 +545,13 @@ class DiscountAbsolute $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f'; $sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; $sql .= ' AND f.type = 3'; - } - elseif ($invoice->element == 'invoice_supplier') + } elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id; $sql .= ' AND f.type = 3'; - } - else { + } else { $this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter"; dol_print_error($this->error); return -1; @@ -577,8 +563,7 @@ class DiscountAbsolute $obj = $this->db->fetch_object($resql); if ($multicurrency == 1) return $obj->multicurrency_amount; else return $obj->amount; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -601,15 +586,13 @@ class DiscountAbsolute $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f'; $sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; $sql .= ' AND f.type IN ('.$invoice::TYPE_STANDARD.', '.$invoice::TYPE_CREDIT_NOTE.', '.$invoice::TYPE_SITUATION.')'; // Find discount coming from credit note or excess received - } - elseif ($invoice->element == 'invoice_supplier') + } elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id; $sql .= ' AND f.type IN ('.$invoice::TYPE_STANDARD.', '.$invoice::TYPE_CREDIT_NOTE.')'; // Find discount coming from credit note or excess paid - } - else { + } else { $this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter"; dol_print_error($this->error); return -1; @@ -621,8 +604,7 @@ class DiscountAbsolute $obj = $this->db->fetch_object($resql); if ($multicurrency == 1) return $obj->multicurrency_amount; else return $obj->amount; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -643,14 +625,12 @@ class DiscountAbsolute $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc'; $sql .= ' WHERE rc.fk_facture IS NULL AND rc.fk_facture_source = '.$invoice->id; - } - elseif ($invoice->element == 'invoice_supplier') + } elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc'; $sql .= ' WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = '.$invoice->id; - } - else { + } else { $this->error = get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter"; dol_print_error($this->error); return -1; @@ -662,8 +642,7 @@ class DiscountAbsolute $obj = $this->db->fetch_object($resql); if ($multicurrency) return $obj->multicurrency_amount; else return $obj->amount; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 743f2968289..2b148a96e8a 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -55,16 +55,14 @@ class DolGeoIP { require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar'; } - } - elseif ($type == 'city') + } elseif ($type == 'city') { // geoip may have been already included with PEAR if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) { require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar'; } - } - else { print 'ErrorBadParameterInConstructor'; return 0; } + } else { print 'ErrorBadParameterInConstructor'; return 0; } // Here, function exists (embedded into PHP or exists because we made include) if (empty($type) || empty($datfile)) @@ -85,19 +83,16 @@ class DolGeoIP { try { $this->gi = new GeoIp2\Database\Reader($datfile); // '/usr/local/share/GeoIP/GeoIP2-City.mmdb' - } - catch (Exception $e) + } catch (Exception $e) { $this->error = $e->getMessage(); dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); return 0; } - } - elseif (function_exists('geoip_open')) + } elseif (function_exists('geoip_open')) { $this->gi = geoip_open($datfile, GEOIP_STANDARD); - } - else { + } else { $this->gi = 'NOGI'; // We are using embedded php geoip functions //print 'function_exists(geoip_country_code_by_name))='.function_exists('geoip_country_code_by_name'); //print geoip_database_info(); @@ -125,8 +120,7 @@ class DolGeoIP { // geoip_country_code_by_addr does not exists return strtolower(geoip_country_code_by_name($ip)); - } - else { + } else { if (preg_match('/^[0-9]+.[0-9]+\.[0-9]+\.[0-9]+/', $ip)) { if ($geoipversion == '2') @@ -134,30 +128,25 @@ class DolGeoIP try { $record = $this->gi->country($ip); return strtolower($record->country->isoCode); - } - catch (Exception $e) { + } catch (Exception $e) { //return $e->getMessage(); return ''; } - } - else { + } else { if (!function_exists('geoip_country_code_by_addr')) return strtolower(geoip_country_code_by_name($this->gi, $ip)); return strtolower(geoip_country_code_by_addr($this->gi, $ip)); } - } - else { + } else { if ($geoipversion == '2') { try { $record = $this->gi->country($ip); return strtolower($record->country->isoCode); - } - catch (Exception $e) { + } catch (Exception $e) { //return $e->getMessage(); return ''; } - } - else { + } else { if (!function_exists('geoip_country_code_by_addr_v6')) return strtolower(geoip_country_code_by_name_v6($this->gi, $ip)); return strtolower(geoip_country_code_by_addr_v6($this->gi, $ip)); } @@ -188,13 +177,11 @@ class DolGeoIP try { $record = $this->gi->country($name); return $record->country->isoCode; - } - catch (Exception $e) { + } catch (Exception $e) { //return $e->getMessage(); return ''; } - } - else { + } else { return geoip_country_code_by_name($this->gi, $name); } } diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index b840f767a97..4ca072897bb 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -472,12 +472,10 @@ class DolGraph { //print 'ee'.join(',',$theme_bgcoloronglet); $this->bgcolor = $theme_bgcoloronglet; - } - else { + } else { $this->bgcolor = $theme_bgcolor; } - } - else { + } else { $this->bgcolor = $bg_color; } } @@ -500,12 +498,10 @@ class DolGraph { //print 'ee'.join(',',$theme_bgcoloronglet); $this->bgcolorgrid = $theme_bgcoloronglet; - } - else { + } else { $this->bgcolorgrid = $theme_bgcolor; } - } - else { + } else { $this->bgcolorgrid = $bg_colorgrid; } } @@ -721,8 +717,7 @@ class DolGraph foreach ($values as $x => $y) { if (isset($y)) $serie[$i] .= 'd'.$i.'.push({"label":"'.dol_escape_js($legends[$x]).'", "data":'.$y.'});'."\n"; } - } - else { + } else { foreach ($values as $x => $y) { if (isset($y)) $serie[$i] .= 'd'.$i.'.push(['.$x.', '.$y.']);'."\n"; } @@ -753,8 +748,7 @@ class DolGraph if ($nblot < 0) { $this->stringtoshow .= ''."\n"; - } - else { + } else { while ($i < $nblot) { $this->stringtoshow .= ''."\n"; @@ -893,8 +887,7 @@ class DolGraph elseif ($i == $firstlot + 1) $align = 'center'; else $align = 'left'; $this->stringtoshow .= 'bars: { lineWidth: 1, show: true, align: "'.$align.'", barWidth: 0.45 }, '; - } - else $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; + } else $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; } if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) $this->stringtoshow .= 'lines: { show: true, fill: false }, points: { show: '.($this->type[$i] == 'linesnopoint' ? 'false' : 'true').' }, '; $this->stringtoshow .= 'color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }'; @@ -1051,8 +1044,7 @@ class DolGraph if ($nblot < 0) { $this->stringtoshow .= ''; - } - else { + } else { while ($i < $nblot) { //$this->stringtoshow .= ''."\n"; @@ -1095,8 +1087,7 @@ class DolGraph if (strpos($tmp, '-') !== false) { $foundnegativecolor++; $color = '#FFFFFF'; // If $val is '-123' - } - else $color = "#".$tmp; // If $val is '123' or '#123' + } else $color = "#".$tmp; // If $val is '123' or '#123' } $this->stringtoshow .= "'".$color."'"; $i++; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index e390565748a..25a0d2a25c5 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -350,28 +350,23 @@ class EmailSenderProfile extends CommonObject { if ($status == 1) return $langs->trans('Enabled'); elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 2) + } elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 3) + } elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 4) + } elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 5) + } elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 6) + } elseif ($mode == 6) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); @@ -424,8 +419,7 @@ class EmailSenderProfile extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index cd6e3b42e0a..bffd23f05d2 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -173,8 +173,7 @@ class Events // extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."events"); return $this->id; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -259,8 +258,7 @@ class Events // extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4157870972d..c82e877fa80 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -253,10 +253,8 @@ class ExtraFields $this->error = ''; $this->errno = 0; return 1; - } - else return -2; - } - else { + } else return -2; + } else { return -1; } } @@ -337,14 +335,12 @@ class ExtraFields $resql = $this->db->query($sql, 1, 'dml'); } return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); return -1; } - } - else { + } else { return 0; } } @@ -398,12 +394,10 @@ class ExtraFields if (is_array($param) && count($param) > 0) { $params = serialize($param); - } - elseif (strlen($param) > 0) + } elseif (strlen($param) > 0) { $params = trim($param); - } - else { + } else { $params = ''; } @@ -461,8 +455,7 @@ class ExtraFields if ($this->db->query($sql)) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); return -1; @@ -522,8 +515,7 @@ class ExtraFields } return $result; - } - else { + } else { return 0; } } @@ -556,13 +548,11 @@ class ExtraFields if ($resql) { return 1; - } - else { + } else { dol_print_error($this->db); return -1; } - } - else { + } else { return 0; } } @@ -651,25 +641,21 @@ class ExtraFields if ($unique) { $sql = "ALTER TABLE ".MAIN_DB_PREFIX.$table." ADD UNIQUE INDEX uk_".$table."_".$attrname." (".$attrname.")"; - } - else { + } else { $sql = "ALTER TABLE ".MAIN_DB_PREFIX.$table." DROP INDEX uk_".$table."_".$attrname; } dol_syslog(get_class($this).'::update', LOG_DEBUG); $resql = $this->db->query($sql, 1, 'dml'); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } - } - else { + } else { return 0; } } @@ -727,12 +713,10 @@ class ExtraFields if (is_array($param) && count($param) > 0) { $params = serialize($param); - } - elseif (strlen($param) > 0) + } elseif (strlen($param) > 0) { $params = trim($param); - } - else { + } else { $params = ''; } @@ -743,8 +727,7 @@ class ExtraFields $sql_del .= " WHERE name = '".$attrname."'"; $sql_del .= " AND entity IN (0, ".($entity === '' ? $conf->entity : $entity).")"; $sql_del .= " AND elementtype = '".$elementtype."'"; - } - else { + } else { // We want on all entities ($entities = '0'), we delete on all only (we keep setup specific to each entity) $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields"; $sql_del .= " WHERE name = '".$attrname."'"; @@ -809,14 +792,12 @@ class ExtraFields { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); dol_print_error($this->db); return -1; } - } - else { + } else { return 0; } } @@ -916,8 +897,7 @@ class ExtraFields } } if ($elementtype) $this->attributes[$elementtype]['loaded'] = 1; // If nothing found, we also save tag 'loaded' - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::fetch_name_optionals_label ".$this->error, LOG_ERR); } @@ -974,8 +954,7 @@ class ExtraFields $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) - } - else // Old usage + } else // Old usage { $label = $this->attribute_label[$key]; $type = $this->attribute_type[$key]; @@ -1003,37 +982,29 @@ class ExtraFields if ($type == 'date') { $morecss = 'minwidth100imp'; - } - elseif ($type == 'datetime' || $type == 'link') + } elseif ($type == 'datetime' || $type == 'link') { $morecss = 'minwidth200imp'; - } - elseif (in_array($type, array('int', 'integer', 'double', 'price'))) + } elseif (in_array($type, array('int', 'integer', 'double', 'price'))) { $morecss = 'maxwidth75'; - } - elseif ($type == 'password') + } elseif ($type == 'password') { $morecss = 'maxwidth100'; - } - elseif ($type == 'url') + } elseif ($type == 'url') { $morecss = 'minwidth400'; - } - elseif ($type == 'boolean') + } elseif ($type == 'boolean') { $morecss = ''; - } - else { + } else { if (round($size) < 12) { $morecss = 'minwidth100'; - } - elseif (round($size) <= 48) + } elseif (round($size) <= 48) { $morecss = 'minwidth200'; - } - else { + } else { $morecss = 'minwidth400'; } } @@ -1051,46 +1022,38 @@ class ExtraFields // TODO Must also support $moreparam $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1); - } - elseif (in_array($type, array('int', 'integer'))) + } elseif (in_array($type, array('int', 'integer'))) { $tmp = explode(',', $size); $newsize = $tmp[0]; $out = ''; - } - elseif (preg_match('/varchar/', $type)) + } elseif (preg_match('/varchar/', $type)) { $out = ''; - } - elseif (in_array($type, array('mail', 'phone', 'url'))) + } elseif (in_array($type, array('mail', 'phone', 'url'))) { $out = ''; - } - elseif ($type == 'text') + } elseif ($type == 'text') { if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, false, ROWS_5, '90%'); $out = $doleditor->Create(1); - } - else { + } else { $out = ''; } - } - elseif ($type == 'html') + } elseif ($type == 'html') { if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $out = $doleditor->Create(1); - } - else { + } else { $out = ''; } - } - elseif ($type == 'boolean') + } elseif ($type == 'boolean') { if (empty($mode)) { @@ -1101,26 +1064,22 @@ class ExtraFields $checked = ' value="1" '; } $out = ''; - } - else { + } else { $out .= $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1); } - } - elseif ($type == 'price') + } elseif ($type == 'price') { if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value = price($value); } $out = ' '.$langs->getCurrencySymbol($conf->currency); - } - elseif ($type == 'double') + } elseif ($type == 'double') { if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value = price($value); } $out = ' '; - } - elseif ($type == 'select') + } elseif ($type == 'select') { $out = ''; if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) @@ -1144,8 +1103,7 @@ class ExtraFields $out .= ''; } $out .= ''; - } - elseif ($type == 'sellist') + } elseif ($type == 'sellist') { $out = ''; if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) @@ -1304,13 +1262,11 @@ class ExtraFields } } $out .= ''; - } - elseif ($type == 'checkbox') + } elseif ($type == 'checkbox') { $value_arr = explode(',', $value); $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%'); - } - elseif ($type == 'radio') + } elseif ($type == 'radio') { $out = ''; foreach ($param['options'] as $keyopt => $val) @@ -1321,13 +1277,11 @@ class ExtraFields $out .= ($value == $keyopt ? 'checked' : ''); $out .= '/>
'; } - } - elseif ($type == 'chkbxlst') + } elseif ($type == 'chkbxlst') { if (is_array($value)) { $value_arr = $value; - } - else { + } else { $value_arr = explode(',', $value); } @@ -1525,14 +1479,12 @@ class ExtraFields $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); } } - } - elseif ($type == 'link') + } elseif ($type == 'link') { $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath' $showempty = (($required && $default != '') ? 0 : 1); $out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss); - } - elseif ($type == 'password') + } elseif ($type == 'password') { // If prefix is 'search_', field is used as a filter, we use a common text field. $out = ''; // Hidden field to reduce impact of evil Google Chrome autopopulate bug. @@ -1580,8 +1532,7 @@ class ExtraFields $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1); $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) - } - else // Old usage + } else // Old usage { //dol_syslog("Warning: parameter 'extrafieldsobjectkey' is missing", LOG_WARNING); $label = $this->attribute_label[$key]; @@ -1608,17 +1559,14 @@ class ExtraFields { $showsize = 10; $value = dol_print_date($value, 'day'); - } - elseif ($type == 'datetime') + } elseif ($type == 'datetime') { $showsize = 19; $value = dol_print_date($value, 'dayhour'); - } - elseif ($type == 'int') + } elseif ($type == 'int') { $showsize = 10; - } - elseif ($type == 'double') + } elseif ($type == 'double') { if (!empty($value)) { //$value=price($value); @@ -1626,38 +1574,31 @@ class ExtraFields $number_decimals = $sizeparts[1]; $value = price($value, 0, $langs, 0, 0, $number_decimals, ''); } - } - elseif ($type == 'boolean') + } elseif ($type == 'boolean') { $checked = ''; if (!empty($value)) { $checked = ' checked '; } $value = ''; - } - elseif ($type == 'mail') + } elseif ($type == 'mail') { $value = dol_print_email($value, 0, 0, 0, 64, 1, 1); - } - elseif ($type == 'url') + } elseif ($type == 'url') { $value = dol_print_url($value, '_blank', 32, 1); - } - elseif ($type == 'phone') + } elseif ($type == 'phone') { $value = dol_print_phone($value, '', 0, 0, '', ' ', 'phone'); - } - elseif ($type == 'price') + } elseif ($type == 'price') { //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); if ($value || $value == '0') $value = price($value, 0, $langs, 0, 0, -1); - } - elseif ($type == 'select') + } elseif ($type == 'select') { if ($langfile && $param['options'][$value]) $value = $langs->trans($param['options'][$value]); else $value = $param['options'][$value]; - } - elseif ($type == 'sellist') + } elseif ($type == 'sellist') { $param_list = array_keys($param['options']); $InfoFieldList = explode(":", $param_list[0]); @@ -1718,8 +1659,7 @@ class ExtraFields $value .= $obj->$field_toshow.' '; } } - } - else { + } else { $translabel = ''; if (!empty($obj->{$InfoFieldList[1]})) { $translabel = $langs->trans($obj->{$InfoFieldList[1]}); @@ -1730,14 +1670,11 @@ class ExtraFields $value = $obj->{$InfoFieldList[1]}; } } - } - else dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); - } - elseif ($type == 'radio') + } else dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); + } elseif ($type == 'radio') { $value = $param['options'][$value]; - } - elseif ($type == 'checkbox') + } elseif ($type == 'checkbox') { $value_arr = explode(',', $value); $value = ''; @@ -1749,8 +1686,7 @@ class ExtraFields } } $value = '
    '.implode(' ', $toprint).'
'; - } - elseif ($type == 'chkbxlst') + } elseif ($type == 'chkbxlst') { $value_arr = explode(',', $value); @@ -1817,8 +1753,7 @@ class ExtraFields } else { dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); } - } - elseif ($type == 'link') + } elseif ($type == 'link') { $out = ''; @@ -1839,26 +1774,21 @@ class ExtraFields $object->fetch($value); $value = $object->getNomUrl(3); } - } - else { + } else { dol_syslog('Error bad setup of extrafield', LOG_WARNING); return 'Error bad setup of extrafield'; } } - } - elseif ($type == 'text') + } elseif ($type == 'text') { $value = dol_htmlentitiesbr($value); - } - elseif ($type == 'html') + } elseif ($type == 'html') { $value = dol_htmlentitiesbr($value); - } - elseif ($type == 'password') + } elseif ($type == 'password') { $value = dol_trunc(preg_replace('/./i', '*', $value), 8, 'right', 'UTF-8', 1); - } - else { + } else { $showsize = round($size); if ($showsize > 48) $showsize = 48; } @@ -1888,36 +1818,28 @@ class ExtraFields if ($type == 'date') { $align = "center"; - } - elseif ($type == 'datetime') + } elseif ($type == 'datetime') { $align = "center"; - } - elseif ($type == 'int') + } elseif ($type == 'int') { $align = "right"; - } - elseif ($type == 'price') + } elseif ($type == 'price') { $align = "right"; - } - elseif ($type == 'double') + } elseif ($type == 'double') { $align = "right"; - } - elseif ($type == 'boolean') + } elseif ($type == 'boolean') { $align = "center"; - } - elseif ($type == 'radio') + } elseif ($type == 'radio') { $align = "center"; - } - elseif ($type == 'checkbox') + } elseif ($type == 'checkbox') { $align = "center"; - } - elseif ($type == 'price') + } elseif ($type == 'price') { $align = "right"; } @@ -2040,14 +1962,12 @@ class ExtraFields // Clean parameters // TODO GMT date in memory must be GMT so we should add gm=true in parameters $value_key = dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - elseif (in_array($key_type, array('datetime'))) + } elseif (in_array($key_type, array('datetime'))) { // Clean parameters // TODO GMT date in memory must be GMT so we should add gm=true in parameters $value_key = dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) + } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { @@ -2055,13 +1975,11 @@ class ExtraFields } else { $value_key = ''; } - } - elseif (in_array($key_type, array('price', 'double'))) + } elseif (in_array($key_type, array('price', 'double'))) { $value_arr = GETPOST("options_".$key, 'alpha'); $value_key = price2num($value_arr); - } - else { + } else { $value_key = GETPOST("options_".$key); if (in_array($key_type, array('link')) && $value_key == '-1') $value_key = ''; } @@ -2073,12 +1991,10 @@ class ExtraFields $langs->load('errors'); setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ', $error_field_required), null, 'errors'); return -1; - } - else { + } else { return 1; } - } - else { + } else { return 0; } } @@ -2098,8 +2014,7 @@ class ExtraFields if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label'])) { $extralabels = $this->attributes[$extrafieldsobjectkey]['label']; - } - else { + } else { $extralabels = $extrafieldsobjectkey; } @@ -2121,22 +2036,19 @@ class ExtraFields if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. // Clean parameters $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); - } - elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) + } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); // Make sure we get an array even if there's only one checkbox $value_arr = (array) $value_arr; $value_key = implode(',', $value_arr); - } - elseif (in_array($key_type, array('price', 'double', 'int'))) + } elseif (in_array($key_type, array('price', 'double', 'int'))) { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); $value_key = price2num($value_arr); - } - else { + } else { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. $value_key = GETPOST($keysuffix."options_".$key.$keyprefix); } diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index f549c7520f7..c941a3a0745 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -64,46 +64,36 @@ class FileUpload if ($element == 'propal') { $pathname = 'comm/propal'; $dir_output = $conf->$element->dir_output; - } - elseif ($element == 'facture') { + } elseif ($element == 'facture') { $pathname = 'compta/facture'; $dir_output = $conf->$element->dir_output; - } - elseif ($element == 'project') { + } elseif ($element == 'project') { $element = $pathname = 'projet'; $dir_output = $conf->$element->dir_output; - } - elseif ($element == 'project_task') { + } elseif ($element == 'project_task') { $pathname = 'projet'; $filename = 'task'; $dir_output = $conf->projet->dir_output; $parentForeignKey = 'fk_project'; $parentClass = 'Project'; $parentElement = 'projet'; $parentObject = 'project'; - } - elseif ($element == 'fichinter') { + } elseif ($element == 'fichinter') { $element = 'ficheinter'; $dir_output = $conf->$element->dir_output; - } - elseif ($element == 'order_supplier') { + } elseif ($element == 'order_supplier') { $pathname = 'fourn'; $filename = 'fournisseur.commande'; $dir_output = $conf->fournisseur->commande->dir_output; - } - elseif ($element == 'invoice_supplier') { + } elseif ($element == 'invoice_supplier') { $pathname = 'fourn'; $filename = 'fournisseur.facture'; $dir_output = $conf->fournisseur->facture->dir_output; - } - elseif ($element == 'product') { + } elseif ($element == 'product') { $dir_output = $conf->product->multidir_output[$conf->entity]; - } - elseif ($element == 'productbatch') { + } elseif ($element == 'productbatch') { $dir_output = $conf->productbatch->multidir_output[$conf->entity]; - } - elseif ($element == 'action') { + } elseif ($element == 'action') { $pathname = 'comm/action'; $filename = 'actioncomm'; $dir_output = $conf->agenda->dir_output; - } - elseif ($element == 'chargesociales') { + } elseif ($element == 'chargesociales') { $pathname = 'compta/sociales'; $filename = 'chargesociales'; $dir_output = $conf->tax->dir_output; } else { @@ -298,8 +288,7 @@ class FileUpload if (preg_match('/error/i', $res)) return false; return true; - } - else { + } else { return false; } } @@ -450,8 +439,7 @@ class FileUpload } else { dol_move_uploaded_file($uploaded_file, $file_path, 1, 0, 0, 0, 'userfile'); } - } - else { + } else { // Non-multipart uploads (PUT method support) file_put_contents($file_path, fopen('php://input', 'r'), $append_file ? FILE_APPEND : 0); } @@ -467,8 +455,7 @@ class FileUpload $file->{$version.'_url'} = $options['upload_url'].rawurlencode($tmp[0].'_mini.'.$tmp[1]); } } - } - elseif ($this->options['discard_aborted_uploads']) + } elseif ($this->options['discard_aborted_uploads']) { unlink($file_path); $file->error = 'abort'; @@ -491,8 +478,7 @@ class FileUpload if ($file_name) { $info = $this->getFileObject($file_name); - } - else { + } else { $info = $this->getFileObjects(); } header('Content-type: application/json'); diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index a09d0bc3e30..0686b68115a 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -157,14 +157,12 @@ class Fiscalyear extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return $result; } - } - else { + } else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -1; @@ -204,8 +202,7 @@ class Fiscalyear extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog($this->error, LOG_ERR); $this->db->rollback(); @@ -239,8 +236,7 @@ class Fiscalyear extends CommonObject $this->statut = $obj->statut; return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -264,8 +260,7 @@ class Fiscalyear extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -299,27 +294,22 @@ class Fiscalyear extends CommonObject 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]), 'statut4').' '.$langs->trans($this->statuts_short[$status]); elseif ($status == 1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut8').' '.$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]), 'statut4'); elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut8'); - } - elseif ($mode == 4) + } elseif ($mode == 4) { if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]); elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut8').' '.$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]), 'statut4'); elseif ($status == 1 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); @@ -364,8 +354,7 @@ class Fiscalyear extends CommonObject $this->date_modification = $this->db->jdate($obj->tms); } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -396,8 +385,7 @@ class Fiscalyear extends CommonObject { $obj = $this->db->fetch_object($resql); $nb = $obj->nb; - } - else dol_print_error($this->db); + } else dol_print_error($this->db); return $nb; } @@ -428,8 +416,7 @@ class Fiscalyear extends CommonObject { $obj = $this->db->fetch_object($resql); $nb = $obj->nb; - } - else dol_print_error($this->db); + } else dol_print_error($this->db); return $nb; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 353102b6189..bfccd8e9b03 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -124,8 +124,7 @@ class Form } if ($fieldrequired) $ret .= ''; $ret .= ''."\n"; - } - else { + } else { if ($fieldrequired) $ret .= ''; if ($help) { $ret .= $this->textwithpicto($langs->trans($text), $help); @@ -134,8 +133,7 @@ class Form } if ($fieldrequired) $ret .= ''; } - } - else { + } else { if (empty($notabletag) && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) $ret .= '
'; if ($fieldrequired) $ret .= ''; if ($help) { @@ -188,8 +186,7 @@ class Form if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker and support select { $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); - } - else { + } else { if (GETPOST('action', 'aZ09') == 'edit'.$htmlname) { $ret .= "\n"; @@ -203,14 +200,12 @@ class Form { $tmp = explode(':', $typeofdata); $ret .= ''; - } - elseif (preg_match('/^(numeric|amount)/', $typeofdata)) + } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { $tmp = explode(':', $typeofdata); $valuetoshow = price2num($editvalue ? $editvalue : $value); $ret .= ''; - } - elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) // if wysiwyg is enabled $typeofdata = 'ckeditor' + } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) // if wysiwyg is enabled $typeofdata = 'ckeditor' { $tmp = explode(':', $typeofdata); $cols = $tmp[2]; @@ -228,16 +223,13 @@ class Form $valuetoshow = str_replace('&', '&', $valuetoshow); $ret .= dol_string_neverthesehtmltags($valuetoshow, array('textarea')); $ret .= ''; - } - elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') + } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, 0); - } - elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') + } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, 0); - } - elseif (preg_match('/^select;/', $typeofdata)) + } elseif (preg_match('/^select;/', $typeofdata)) { $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); $arraylist = array(); @@ -248,8 +240,7 @@ class Form $arraylist[$tmpkey] = $tmp[1]; } $ret .= $this->selectarray($htmlname, $arraylist, $value); - } - elseif (preg_match('/^ckeditor/', $typeofdata)) + } elseif (preg_match('/^ckeditor/', $typeofdata)) { $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -267,8 +258,7 @@ class Form if (empty($notabletag)) $ret .= '
'."\n"; $ret .= ''."\n"; - } - else { + } else { if (preg_match('/^(email)/', $typeofdata)) $ret .= dol_print_email($value, 0, 0, 0, 0, 1); elseif (preg_match('/^(amount|numeric)/', $typeofdata)) $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) $ret .= dol_htmlentitiesbr($value); @@ -285,8 +275,7 @@ class Form $arraylist[$tmp[0]] = $tmp[1]; } $ret .= $arraylist[$value]; - } - elseif (preg_match('/^ckeditor/', $typeofdata)) + } elseif (preg_match('/^ckeditor/', $typeofdata)) { $tmpcontent = dol_htmlentitiesbr($value); if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) @@ -298,8 +287,7 @@ class Form // We dont use dol_escape_htmltag to get the html formating active, but this need we must also // clean data from some dangerous html $ret .= dol_string_onlythesehtmltags(dol_htmlentitiesbr($tmpcontent)); - } - else { + } else { $ret .= dol_escape_htmltag($value); } @@ -437,8 +425,7 @@ class Form if (!empty($tmp[1])) $inputOption = $tmp[1]; if (!empty($tmp[2])) $savemethod = $tmp[2]; $out .= ''."\n"; - } - elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) + } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { $tmp = explode(':', $inputType); $inputType = $tmp[0]; @@ -446,22 +433,19 @@ class Form if (!empty($tmp[2])) $savemethod = $tmp[2]; $out .= ''."\n"; // Use for timestamp format - } - elseif (preg_match('/^(select|autocomplete)/', $inputType)) + } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { $tmp = explode(':', $inputType); $inputType = $tmp[0]; $loadmethod = $tmp[1]; if (!empty($tmp[2])) $savemethod = $tmp[2]; if (!empty($tmp[3])) $button_only = true; - } - elseif (preg_match('/^textarea/', $inputType)) + } elseif (preg_match('/^textarea/', $inputType)) { $tmp = explode(':', $inputType); $inputType = $tmp[0]; $rows = (empty($tmp[1]) ? '8' : $tmp[1]); $cols = (empty($tmp[2]) ? '80' : $tmp[2]); - } - elseif (preg_match('/^ckeditor/', $inputType)) + } elseif (preg_match('/^ckeditor/', $inputType)) { $tmp = explode(':', $inputType); $inputType = $tmp[0]; $toolbar = $tmp[1]; @@ -472,8 +456,7 @@ class Form if (!empty($conf->fckeditor->enabled)) { $out .= ''."\n"; - } - else { + } else { $inputType = 'textarea'; } } @@ -492,8 +475,7 @@ class Form $out .= ''."\n"; if (!empty($custommsg['error'])) $out .= ''."\n"; - } - else $out .= ''."\n"; + } else $out .= ''."\n"; } if ($inputType == 'textarea') { $out .= ''."\n"; @@ -501,8 +483,7 @@ class Form } $out .= ''.$value.''."\n"; $out .= ''.(!empty($editvalue) ? $editvalue : $value).''."\n"; - } - else { + } else { $out = $value; } @@ -550,8 +531,7 @@ class Form if ($tooltiptrigger == '') { $htmltext = str_replace('"', '"', $htmltext); - } - else { + } else { $classfortooltip = 'classfortooltiponclick'; $textfordialog .= ''; } @@ -560,15 +540,13 @@ class Form $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; if ($tooltiptrigger == '') $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on img tag to store tooltip else $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; - } - else $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag + } else $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag if ($tooltipon == 1 || $tooltipon == 3) { $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; if ($tooltiptrigger == '') $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribut to put on td tag to store tooltip else $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; - } - else $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag + } else $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribut to put on td text tag if (empty($notabs)) $s .= ''; elseif ($notabs == 2) $s .= '
'; // Define value if value is before @@ -849,8 +827,7 @@ class Form { $foundselected = true; $out .= ''; - } - else { + } else { $out .= ''; } - } - else { + } else { array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label)); } @@ -1357,8 +1326,7 @@ class Form } } $out .= ''."\n"; - } - else { + } else { dol_print_error($this->db); } @@ -1438,8 +1406,7 @@ class Form } print ''; return $qualifiedlines; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1569,8 +1536,7 @@ class Form if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')'; if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')'; $out .= ''; - } - else { + } else { $out .= ''; } - } - else { + } else { if (in_array($obj->rowid, $selected)) { $out .= $contactstatic->getFullName($langs); @@ -1591,8 +1556,7 @@ class Form } $i++; } - } - else { + } else { $out .= ''; @@ -1616,8 +1580,7 @@ class Form $this->num = $num; return $out; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -1691,8 +1654,7 @@ class Form { // Build list includeUsers to have only hierarchy $includeUsers = implode(",", $user->getAllChildIds(0)); - } - elseif ($include == 'hierarchyme') + } elseif ($include == 'hierarchyme') { // Build list includeUsers to have only hierarchy and current user $includeUsers = implode(",", $user->getAllChildIds(1)); @@ -1713,15 +1675,13 @@ class Form $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entity as e ON e.rowid=u.entity"; if ($force_entity) $sql .= " WHERE u.entity IN (0,".$force_entity.")"; else $sql .= " WHERE u.entity IS NOT NULL"; - } - else { + } else { if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " ON ug.fk_user = u.rowid"; $sql .= " WHERE ug.entity = ".$conf->entity; - } - else { + } else { $sql .= " WHERE u.entity IN (0,".$conf->entity.")"; } } @@ -1738,8 +1698,7 @@ class Form if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) // MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname { $sql .= " ORDER BY u.firstname ASC"; - } - else { + } else { $sql .= " ORDER BY u.lastname ASC"; } @@ -1778,8 +1737,7 @@ class Form $out .= ''; @@ -2397,8 +2342,7 @@ class Form array_push($outarray, $optJson); } } - } - else { + } else { if (!empty($conf->dynamicprices->enabled) && !empty($objp->fk_price_expression)) { $price_product = new Product($this->db); $price_product->fetch($objp->rowid, '', '', 1); @@ -2430,8 +2374,7 @@ class Form if (empty($outputmode)) return $out; return $outarray; - } - else { + } else { dol_print_error($db); } } @@ -2581,8 +2524,7 @@ class Form { $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); - } - else { + } else { $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); } @@ -2591,8 +2533,7 @@ class Form $outpricebasetype = $objp2->price_base_type; $outtva_tx = $objp2->tva_tx; } - } - else { + } else { dol_print_error($this->db); } } @@ -2609,8 +2550,7 @@ class Form $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding $outval .= $langs->transnoentities("Unit"); - } - else { + } else { $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding @@ -2644,8 +2584,7 @@ class Form { $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); - } - else { + } else { $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); } @@ -2664,8 +2603,7 @@ class Form { $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); - } - else { + } else { $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); } @@ -2682,7 +2620,7 @@ class Form if ($objp->stock > 0) { $outval .= ' - '; - }elseif ($objp->stock <= 0) { + } elseif ($objp->stock <= 0) { $outval .= ' - '; } $outval .= $langs->transnoentities("Stock").':'.$objp->stock; @@ -2701,7 +2639,7 @@ class Form $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; if ($virtualstock > 0) { $outval .= ' - '; - }elseif ($virtualstock <= 0) { + } elseif ($virtualstock <= 0) { $outval .= ' - '; } $outval .= $virtualstock; @@ -2753,8 +2691,7 @@ class Form $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').''; - } - else { + } else { print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss); } } @@ -2963,8 +2900,7 @@ class Form $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding $outvallabel .= $langs->transnoentities("Unit"); - } - else { + } else { $optlabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; $outvallabel .= ' - '.price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding @@ -2999,14 +2935,12 @@ class Form $optlabel .= " - ".$reputations[$objp->supplier_reputation]; $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; } - } - else { + } else { if (empty($alsoproductwithnosupplierprice)) // No supplier price defined for couple product/supplier { $optlabel .= " - ".$langs->trans("NoPriceDefinedForThisSupplier").''; $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); - } - else // No supplier price defined for product, even on other suppliers + } else // No supplier price defined for product, even on other suppliers { $optlabel .= " - ".$langs->trans("NoPriceDefinedForThisSupplier").''; $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); @@ -3054,8 +2988,7 @@ class Form if (empty($outputmode)) return $out; return $outarray; - } - else { + } else { dol_print_error($this->db); } } @@ -3100,8 +3033,7 @@ class Form if (!$num) { $form .= ''; - } - else { + } else { require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $form .= ''; @@ -3144,8 +3076,7 @@ class Form if ($objp->quantity == 1) { $opt .= $langs->trans("Unit"); - } - else { + } else { $opt .= $langs->trans("Units"); } if ($objp->quantity > 1) @@ -3164,8 +3095,7 @@ class Form $form .= ''; $this->db->free($result); return $form; - } - else { + } else { dol_print_error($this->db); } } @@ -3206,8 +3136,7 @@ class Form if ($selected && $selected == $obj->rowid) { print ''; - } - else { + } else { print ''; } $i++; @@ -3215,8 +3144,7 @@ class Form } print ''; return $num; - } - else { + } else { dol_print_error($this->db); } } @@ -3263,8 +3191,7 @@ class Form //$this->cache_conditions_paiements=dol_sort_array($this->cache_conditions_paiements, 'label', 'asc', 0, 0, 1); // We use the field sortorder of table return $num; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -3311,8 +3238,7 @@ class Form $this->cache_availability = dol_sort_array($this->cache_availability, 'label', 'asc', 0, 0, 1); return $num; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -3342,8 +3268,7 @@ class Form if ($selected == $id) { print ''; @@ -3770,8 +3690,7 @@ class Form } } } - } - else { + } else { dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); } if ($opt == '') @@ -3816,8 +3735,7 @@ class Form if ($selected == $res->rowid) { $return .= ''; - } - else { + } else { $return .= ''; } } @@ -3875,8 +3793,7 @@ class Form if ($selected == $obj->rowid) { print ''; @@ -4187,19 +4096,16 @@ class Form if ($input['type'] == 'text') { $more .= '
'.$input['label'].'
'."\n"; - } - elseif ($input['type'] == 'password') + } elseif ($input['type'] == 'password') { $more .= '
'.$input['label'].'
'."\n"; - } - elseif ($input['type'] == 'select') + } elseif ($input['type'] == 'select') { $more .= '
'; if (!empty($input['label'])) $more .= $input['label'].'
'; $more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss); $more .= '
'."\n"; - } - elseif ($input['type'] == 'checkbox') + } elseif ($input['type'] == 'checkbox') { $more .= '
'; $more .= '
'.$input['label'].'
'; @@ -4209,8 +4115,7 @@ class Form if (isset($input['disabled'])) $more .= ' disabled'; $more .= ' />
'; $more .= '
'."\n"; - } - elseif ($input['type'] == 'radio') + } elseif ($input['type'] == 'radio') { $i = 0; foreach ($input['values'] as $selkey => $selval) @@ -4225,8 +4130,7 @@ class Form $more .= '
'."\n"; $i++; } - } - elseif ($input['type'] == 'date') + } elseif ($input['type'] == 'date') { $more .= '
'.$input['label'].'
'; $more .= '
'; @@ -4237,16 +4141,13 @@ class Form $formquestion[] = array('name'=>$input['name'].'year'); $formquestion[] = array('name'=>$input['name'].'hour'); $formquestion[] = array('name'=>$input['name'].'min'); - } - elseif ($input['type'] == 'other') + } elseif ($input['type'] == 'other') { $more .= '
'; if (!empty($input['label'])) $more .= $input['label'].'
'; $more .= $input['value']; $more .= '
'."\n"; - } - - elseif ($input['type'] == 'onecolumn') + } elseif ($input['type'] == 'onecolumn') { $moreonecolumn .= '
'; $moreonecolumn .= $input['value']; @@ -4371,8 +4272,7 @@ class Form }); '; $formconfirm .= "\n"; - } - else { + } else { $formconfirm .= "\n\n"; if (empty($disableformtag)) $formconfirm .= '
'."\n"; @@ -4455,16 +4355,14 @@ class Form $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1); $out .= ''; $out .= ''; - } - else { + } else { if ($selected) { $projet = new Project($this->db); $projet->fetch($selected); //print ''.$projet->title.''; $out .= $projet->getNomUrl(0, '', 1); - } - else { + } else { $out .= " "; } } @@ -4499,8 +4397,7 @@ class Form $this->select_conditions_paiements($selected, $htmlname, -1, $addempty); print ''; print ''; - } - else { + } else { if ($selected) { $this->load_cache_conditions_paiements(); @@ -4533,8 +4430,7 @@ class Form $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); print ''; print ''; - } - else { + } else { if ($selected) { $this->load_cache_availability(); @@ -4566,8 +4462,7 @@ class Form $this->selectInputReason($selected, $htmlname, -1, $addempty); print ''; print ''; - } - else { + } else { if ($selected) { $this->loadCacheInputReason(); @@ -4616,8 +4511,7 @@ class Form $ret .= ''; $ret .= '
'; $ret .= '
'; - } - else { + } else { if ($displayhour) $ret .= dol_print_date($selected, 'dayhour'); else $ret .= dol_print_date($selected, 'day'); } @@ -4651,8 +4545,7 @@ class Form print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); print ''; print ''; - } - else { + } else { if ($selected) { require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; @@ -4690,8 +4583,7 @@ class Form $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active); print ''; print ''; - } - else { + } else { if ($selected) { $this->load_cache_types_paiements(); @@ -4723,8 +4615,7 @@ class Form print $this->selectMultiCurrency($selected, $htmlname, 0); print ''; print ''; - } - else { + } else { dol_include_once('/core/lib/company.lib.php'); print !empty($selected) ? currency_name($selected, 1) : ' '; } @@ -4757,14 +4648,12 @@ class Form print ' '; print ''; print ''; - } - else { + } else { if (!empty($rate)) { print price($rate, 1, $langs, 1, 0); if ($currency && $rate != 1) print '   ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; - } - else { + } else { print 1; } } @@ -4802,8 +4691,7 @@ class Form { if (!$filter || $filter == "fk_invoice_supplier_source IS NULL") $translationKey = 'HasAbsoluteDiscountFromSupplier'; // If we want deposit to be substracted to payments only and not to total of final invoice else $translationKey = 'HasCreditNoteFromSupplier'; - } - else { + } else { if (!$filter || $filter == "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") $translationKey = 'HasAbsoluteDiscountFromSupplier'; else $translationKey = 'HasCreditNoteFromSupplier'; } @@ -4812,8 +4700,7 @@ class Form { if (!$filter || $filter == "fk_facture_source IS NULL") $translationKey = 'CompanyHasAbsoluteDiscount'; // If we want deposit to be substracted to payments only and not to total of final invoice else $translationKey = 'CompanyHasCreditNote'; - } - else { + } else { if (!$filter || $filter == "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") $translationKey = 'CompanyHasAbsoluteDiscount'; else $translationKey = 'CompanyHasCreditNote'; } @@ -4851,13 +4738,11 @@ class Form print ''; } print ''; - } - else { + } else { if ($selected) { print $selected; - } - else { + } else { print "0"; } } @@ -4895,8 +4780,7 @@ class Form print ''; print ''; print ''; - } - else { + } else { if ($selected) { require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -4938,16 +4822,14 @@ class Form $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events); $out .= ''; $out .= ''; - } - else { + } else { if ($selected) { require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $soc = new Societe($this->db); $soc->fetch($selected); $out .= $soc->getNomUrl($langs); - } - else { + } else { $out .= " "; } } @@ -4995,16 +4877,14 @@ class Form if ($selected && $selected == $code_iso) { $out .= ''; @@ -5128,13 +5008,11 @@ class Form } return $num; - } - else { + } else { $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).''; return -1; } - } - else { + } else { $this->error = ''.$this->db->error().''; return -2; } @@ -5189,8 +5067,7 @@ class Form if ($societe_vendeuse->id == $mysoc->id) { $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; - } - else { + } else { $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; } return $return; @@ -5205,8 +5082,7 @@ class Form if (is_object($societe_vendeuse)) { $code_country = "'".$societe_vendeuse->country_code."'"; - } - else { + } else { $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente } if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) // If option to have vat for end customer for services is on @@ -5221,12 +5097,10 @@ class Form { $code_country .= ",'".$societe_acheteuse->country_code."'"; } - } - elseif (!$idprod) // We don't know type of product + } elseif (!$idprod) // We don't know type of product { $code_country .= ",'".$societe_acheteuse->country_code."'"; - } - else { + } else { $prodstatic = new Product($this->db); $prodstatic->fetch($idprod); if ($prodstatic->type == Product::TYPE_SERVICE) // We know product is a service @@ -5300,8 +5174,7 @@ class Form $return .= ' selected'; $selectedfound = true; } - } - elseif ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr) + } elseif ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr) { $return .= ' selected'; $selectedfound = true; @@ -5312,8 +5185,7 @@ class Form if ($mysoc->country_code == 'IN' || !empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES)) { $return .= $rate['labelpositiverates']; - } - else { + } else { $return .= vatrate($rate['label']); } //$return.=($rate['code']?' '.$rate['code']:''); @@ -5323,8 +5195,7 @@ class Form } if (!$options_only) $return .= ''; - } - else { + } else { $return .= $this->error; } @@ -5425,8 +5296,7 @@ class Form $sday = (!empty($reg[3]) ? $reg[3] : ''); $shour = (!empty($reg[4]) ? $reg[4] : ''); $smin = (!empty($reg[5]) ? $reg[5] : ''); - } - elseif (strval($set_time) != '' && $set_time != -1) + } elseif (strval($set_time) != '' && $set_time != -1) { // set_time est un timestamps (0 possible) $syear = dol_print_date($set_time, "%Y"); @@ -5437,14 +5307,12 @@ class Form $shour = dol_print_date($set_time, "%H"); $smin = dol_print_date($set_time, "%M"); $ssec = dol_print_date($set_time, "%S"); - } - else { + } else { $shour = ''; $smin = ''; $ssec = ''; } - } - else { + } else { // Date est '' ou vaut -1 $syear = ''; $smonth = ''; @@ -5491,14 +5359,12 @@ class Form $base = DOL_URL_ROOT.'/core/'; $retstring .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; $retstring .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').''; - } - else $retstring .= ''; + } else $retstring .= ''; $retstring .= ''."\n"; $retstring .= ''."\n"; $retstring .= ''."\n"; - } - elseif ($usecalendar == 'jquery') + } elseif ($usecalendar == 'jquery') { if (!$disabled) { @@ -5551,8 +5417,7 @@ class Form $retstring.=' });'; $retstring.='});'; $retstring.="";*/ - } - else { + } else { $retstring .= ''; } @@ -5560,8 +5425,7 @@ class Form $retstring .= ''."\n"; $retstring .= ''."\n"; $retstring .= ''."\n"; - } - else { + } else { $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; } } @@ -5602,8 +5466,7 @@ class Form if ($emptydate || $set_time == -1) { $retstring .= ''; - } - else { + } else { $retstring .= ''; for ($year = $syear - 10; $year < $syear + 10; $year++) @@ -5678,8 +5541,7 @@ class Form $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date(dol_now(), '%d', 'tzuser').'\');'; $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date(dol_now(), '%m', 'tzuser').'\');'; $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date(dol_now(), '%Y', 'tzuser').'\');'; - } - elseif ($addnowlink == 2) + } elseif ($addnowlink == 2) { $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(d.toLocaleDateString(\''.str_replace('_', '-', $langs->defaultlang).'\'));'; $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(d.getDate().pad());'; @@ -5705,8 +5567,7 @@ class Form if ($addnowlink == 1) { $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date(dol_now(), '%H', 'tzuser').'\');'; - } - elseif ($addnowlink == 2) + } elseif ($addnowlink == 2) { $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; } @@ -5721,8 +5582,7 @@ class Form if ($addnowlink == 1) { $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date(dol_now(), '%M', 'tzuser').'\');'; - } - elseif ($addnowlink == 2) + } elseif ($addnowlink == 2) { $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; } @@ -5827,12 +5687,10 @@ class Form $retstring .= ">".$hour.""; } $retstring .= ""; - } - elseif ($typehour == 'text' || $typehour == 'textselect') + } elseif ($typehour == 'text' || $typehour == 'textselect') { $retstring .= ''; - } - else return 'BadValueForParameterTypeHour'; + } else return 'BadValueForParameterTypeHour'; if ($typehour != 'text') $retstring .= ' '.$langs->trans('HourShort'); else $retstring .= ':'; @@ -5851,8 +5709,7 @@ class Form $retstring .= '>'.$min.''; } $retstring .= ""; - } - elseif ($typehour == 'text') + } elseif ($typehour == 'text') { $retstring .= ''; } @@ -5947,8 +5804,7 @@ class Form $out .= ''; if ($placeholder) $placeholder = ' placeholder="'.$placeholder.'"'; $out .= ''; - } - else { + } else { // Immediate load of table record. Note: filter is inside $objecttmp->filter $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled); } @@ -5976,8 +5832,7 @@ class Form if (preg_match('/^\'(.*)\'$/', $tmpescaped, $regbis)) { $tmpescaped = "'".$db->escape($regbis[1])."'"; - } - else { + } else { $tmpescaped = $db->escape($tmpescaped); } return $db->escape($tmp[0]).' '.strtoupper($db->escape($tmp[1]))." ".$tmpescaped; @@ -6019,8 +5874,7 @@ class Form if ($val['showoncombobox']) $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; } if ($tmpfieldstoshow) $fieldstoshow = $tmpfieldstoshow; - } - else { + } else { // For backward compatibility $objecttmp->fields['ref'] = array('type'=>'varchar(30)', 'label'=>'Ref', 'showoncombobox'=>1); } @@ -6029,8 +5883,7 @@ class Form { if (isset($objecttmp->fields['ref'])) { $fieldstoshow = 't.ref'; - } - else { + } else { $langs->load("errors"); $this->error = $langs->trans("ErrorNoFieldWithAttributeShowoncombobox"); return $langs->trans('ErrorNoFieldWithAttributeShowoncombobox'); @@ -6118,12 +5971,10 @@ class Form if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { $out .= ''; - } - else { + } else { $out .= ''; } - } - else { + } else { array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label)); } @@ -6133,8 +5984,7 @@ class Form } $out .= ''."\n"; - } - else { + } else { dol_print_error($this->db); } @@ -6240,8 +6090,7 @@ class Form { if (empty($nohtmlescape)) $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ?dol_trunc($value, $maxlen) : $value)); else $selectOptionValue = $key.' - '.($maxlen ?dol_trunc($value, $maxlen) : $value); - } - else { + } else { if (empty($nohtmlescape)) $selectOptionValue = dol_escape_htmltag($maxlen ?dol_trunc($value, $maxlen) : $value); else $selectOptionValue = $maxlen ?dol_trunc($value, $maxlen) : $value; if ($value == '' || $value == '-') $selectOptionValue = ' '; @@ -6369,8 +6218,7 @@ class Form if ($acceptdelayedhtml) { $delayedhtmlcontent .= $outdelayed; - } - else { + } else { $out .= $outdelayed; } return $out; @@ -6486,8 +6334,7 @@ class Form if ($acceptdelayedhtml) { $delayedhtmlcontent .= $outdelayed; - } - else { + } else { $out .= $outdelayed; } return $out; @@ -6534,8 +6381,7 @@ class Form if ($elemtype == 'category') { $out .= 'return \' \'+record.text+\'\';'; - } - else { + } else { $out .= 'return record.text;'; } $out .= '};'."\n"; @@ -6543,8 +6389,7 @@ class Form if ($elemtype == 'category') { $out .= 'return \' \'+record.text+\'\';'; - } - else { + } else { $out .= 'return record.text;'; } $out .= '};'."\n"; @@ -6559,8 +6404,7 @@ class Form templateSelection: formatSelection /* For 4.0 */ }); });'."\n"; - } - elseif ($addjscombo == 2) + } elseif ($addjscombo == 2) { // Add other js lib // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin @@ -6817,41 +6661,31 @@ class Form if ($objecttype == 'facture') { $tplpath = 'compta/'.$element; if (empty($conf->facture->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'facturerec') { + } elseif ($objecttype == 'facturerec') { $tplpath = 'compta/facture'; $tplname = 'linkedobjectblockForRec'; if (empty($conf->facture->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'propal') { + } elseif ($objecttype == 'propal') { $tplpath = 'comm/'.$element; if (empty($conf->propal->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'supplier_proposal') { + } elseif ($objecttype == 'supplier_proposal') { if (empty($conf->supplier_proposal->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'shipping' || $objecttype == 'shipment') { + } elseif ($objecttype == 'shipping' || $objecttype == 'shipment') { $tplpath = 'expedition'; if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'reception') { + } elseif ($objecttype == 'reception') { $tplpath = 'reception'; if (empty($conf->reception->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'delivery') { + } elseif ($objecttype == 'delivery') { $tplpath = 'livraison'; if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled - } - elseif ($objecttype == 'invoice_supplier') { + } elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; - } - elseif ($objecttype == 'order_supplier') { + } elseif ($objecttype == 'order_supplier') { $tplpath = 'fourn/commande'; - } - elseif ($objecttype == 'expensereport') { + } elseif ($objecttype == 'expensereport') { $tplpath = 'expensereport'; - } - elseif ($objecttype == 'subscription') { + } elseif ($objecttype == 'subscription') { $tplpath = 'adherents'; } @@ -6959,8 +6793,7 @@ class Form { $possiblelinks = array_merge($possiblelinks, $hookmanager->resArray); } - } - elseif ($reshook > 0) + } elseif ($reshook > 0) { if (is_array($hookmanager->resArray) && count($hookmanager->resArray)) { @@ -7047,8 +6880,7 @@ class Form '; - } - else { + } else { $linktoelem = ''; } @@ -7098,8 +6930,7 @@ class Form { $resultyesno .= ''."\n"; $resultyesno .= ''."\n"; - } - else { + } else { $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); $resultyesno .= ''."\n"; $resultyesno .= ''."\n"; @@ -7142,8 +6973,7 @@ class Form if ($selected == $obj->rowid) { print ''; $i++; } - } - else { + } else { if ($show_empty) $out .= ''."\n"; $out .= ''; } $out .= ''; - } - else { + } else { dol_print_error($this->db); } @@ -7809,8 +7618,7 @@ class Form } } } - } - else { + } else { dol_print_error($db); } @@ -7844,8 +7652,7 @@ class Form $out .= ''; } $out .= ''; - } - else { + } else { dol_print_error($db); } @@ -7886,8 +7693,7 @@ class Form $out .= ''; } $out .= ''; - } - else { + } else { dol_print_error($db); } @@ -7983,8 +7789,7 @@ class Form if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire)) { // Do nothing - } - else { + } else { if ($discard_closed == 1 && $obj->fk_statut == Project::STATUS_CLOSED) { $i++; @@ -8003,13 +7808,11 @@ class Form { $disabled = 1; $labeltoshow .= ' - '.$langs->trans("Draft"); - } - elseif ($obj->fk_statut == Project::STATUS_CLOSED) + } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { if ($discard_closed == 2) $disabled = 1; $labeltoshow .= ' - '.$langs->trans("Closed"); - } - elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) + } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { $disabled = 1; $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); @@ -8021,13 +7824,11 @@ class Form $out .= ''; - } - else { + } else { $out .= ''; } } @@ -183,8 +182,7 @@ class FormAdmin if ($file == $selected) { $menuarray[$prefix.'_'.$file] = ''; - } - else { + } else { $menuarray[$prefix.'_'.$file] = ''; } } @@ -383,8 +381,7 @@ class FormAdmin $i++; } - } - else { + } else { dol_print_error($this->db); return ''; } @@ -402,8 +399,7 @@ class FormAdmin if ($selected == $key) { $out .= ''; - } - else { + } else { $out .= ''; } } diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 8c27666dfc4..104daf6de0e 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -176,8 +176,7 @@ class FormBarCode } $out .= ""; $out .= ajax_combobox("select_".$htmlname); - } - else { + } else { dol_print_error($this->db); } return $out; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a5e31916827..f4e551c6452 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -166,8 +166,7 @@ class FormCompany extends Form } print Form::selectarray($htmlname, $options, $selected); - } - else dol_print_error($this->db); + } else dol_print_error($this->db); if (!empty($htmlname) && $user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''; print ''; @@ -241,8 +240,7 @@ class FormCompany extends Form if ($obj->code == '0') // Le code peut etre une chaine { $out .= ''; - } - else { + } else { if (!$country || $country != $obj->country) { // Affiche la rupture si on est en mode liste multipays @@ -256,8 +254,7 @@ class FormCompany extends Form if (!empty($selected) && $selected == $obj->rowid) { $out .= ''; - } - else { + } else { if ($country == '' || $country != $obj->country) { // Show break @@ -354,8 +346,7 @@ class FormCompany extends Form if ($selected > 0 && $selected == $obj->code) { print ''; - } - else { + } else { print ''; } } @@ -363,8 +354,7 @@ class FormCompany extends Form } } print ''; - } - else { + } else { dol_print_error($this->db); } } @@ -405,8 +395,7 @@ class FormCompany extends Form if ($selected == $obj->code) { $out .= ''; $firstCompany = $obj->rowid; - } - else { + } else { print ''; @@ -695,8 +679,7 @@ class FormCompany extends Form print "\n"; print ajax_combobox($htmlname); return $firstCompany; - } - else { + } else { dol_print_error($this->db); return 0; } @@ -838,8 +821,7 @@ class FormCompany extends Form elseif ($idprof == 3) $formlength = 5; // 4 chiffres et 1 lettre depuis janvier elseif ($idprof == 4) $formlength = 32; // No maximum as we need to include a town name in this id } - } - elseif ($country_code == 'ES') + } elseif ($country_code == 'ES') { if ($idprof == 1) $formlength = 9; //CIF/NIF/NIE 9 digits if ($idprof == 2) $formlength = 12; //NASS 12 digits without / @@ -902,8 +884,7 @@ class FormCompany extends Form if ($selected == $valors[$i]) { print ''; - } - else { + } else { $disabled = 0; if ($obj->statut == 0) { @@ -128,8 +126,7 @@ class FormContract if ($hideunselectables && $disabled) { $resultat = ''; - } - else { + } else { $resultat = '
\n"; @@ -331,8 +327,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ if (preg_match('/\.sql$/i', $file)) $filesindir[] = $file; } sort($filesindir); - } - else { + } else { print '
'.$langs->trans("ErrorCanNotReadDir", $dir).'
'; } @@ -342,8 +337,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ if (preg_match('/'.$from.'/i', $file)) { $filelist[] = $file; - } - elseif (preg_match('/'.$to.'/i', $file)) // First test may be false if we migrate from x.y.* to x.y.* + } elseif (preg_match('/'.$to.'/i', $file)) // First test may be false if we migrate from x.y.* to x.y.* { $filelist[] = $file; } @@ -352,8 +346,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ if (count($filelist) == 0) { print '
'.$langs->trans("ErrorNoMigrationFilesFoundForParameters").'
'; - } - else { + } else { $listoffileprocessed = array(); // Protection to avoid to process twice the same file // Loop on each migrate files diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index b8e9ad30076..13e50732566 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -126,8 +126,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted - } - else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); + } else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); } // $conf is already instancied inside inc.php @@ -157,8 +156,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ if ($db->database_selected) { dolibarr_install_syslog('upgrade2: database connection successful :'.$dolibarr_main_db_name); - } - else { + } else { $error++; } } @@ -533,15 +531,13 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print $hookmanager->error; print ""; print ''; - } - else { + } else { print ''; print ''.$langs->trans('UpgradeExternalModule').': OK'; print ""; print ''; } - } - else { + } else { //if (! empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) // If there is at least one module with one hook, we show message to say nothing was done { @@ -580,8 +576,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ migrate_rename_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits'); print '

'.$langs->trans("MigrationFinished").'
'; -} -else { +} else { print '
'.$langs->trans('ErrorWrongParameters').'
'; $error++; } @@ -640,8 +635,7 @@ function migrate_paiements($db, $langs, $conf) $row[$i][2] = $obj->amount; $i++; } - } - else { + } else { dol_print_error($db); } @@ -671,17 +665,14 @@ function migrate_paiements($db, $langs, $conf) { $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; - } - else { + } else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } - } - else { + } else { print $langs->trans('MigrationPaymentsNothingToUpdate')."
\n"; } - } - else { + } else { print $langs->trans('MigrationPaymentsNothingToUpdate')."
\n"; } @@ -743,8 +734,7 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) } $i++; } - } - else { + } else { dol_print_error($db); } @@ -783,8 +773,7 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) print $langs->trans('MigrationProcessPaymentUpdate', 'facid='.$facid.'-paymentid='.$row[$i]['paymentid'].'-amount='.$row[$i]['pamount'])."
\n"; } - } - else { + } else { print 'ERROR'; } } @@ -792,18 +781,15 @@ function migrate_paiements_orphelins_1($db, $langs, $conf) if ($res > 0) { print $langs->trans('MigrationSuccessfullUpdate')."
"; - } - else { + } else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } $db->commit(); - } - else { + } else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } - } - else { + } else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -864,8 +850,7 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) } $i++; } - } - else { + } else { dol_print_error($db); } @@ -905,8 +890,7 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) print $langs->trans('MigrationProcessPaymentUpdate', 'facid='.$facid.'-paymentid='.$row[$i]['paymentid'].'-amount='.$row[$i]['pamount'])."
\n"; } - } - else { + } else { print 'ERROR'; $nberr++; } @@ -915,14 +899,12 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) if ($res > 0) { print $langs->trans('MigrationSuccessfullUpdate')."
"; - } - else { + } else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } $db->commit(); - } - else { + } else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -935,13 +917,11 @@ function migrate_paiements_orphelins_2($db, $langs, $conf) if (!$nberr) { $db->commit(); - } - else { + } else { print 'ERROR'; $db->rollback(); } - } - else { + } else { print $langs->trans('MigrationPaymentsNothingUpdatable')."
\n"; } @@ -1011,8 +991,7 @@ function migrate_contracts_det($db, $langs, $conf) if ($db->query($sql)) { print $langs->trans('MigrationContractsLineCreation', $obj->cref)."
\n"; - } - else { + } else { dol_print_error($db); $nberr++; } @@ -1025,17 +1004,14 @@ function migrate_contracts_det($db, $langs, $conf) // $db->rollback(); $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; - } - else { + } else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } - } - else { + } else { print $langs->trans('MigrationContractsNothingToUpdate')."
\n"; } - } - else { + } else { print $langs->trans('MigrationContractsFieldDontExist')."
\n"; // dol_print_error($db); } @@ -1108,17 +1084,14 @@ function migrate_links_transfert($db, $langs, $conf) // $db->rollback(); $db->commit(); print $langs->trans('MigrationSuccessfullUpdate')."
"; - } - else { + } else { $db->rollback(); print $langs->trans('MigrationUpdateFailed').'
'; } - } - else { + } else { print $langs->trans('MigrationBankTransfertsNothingToUpdate')."
\n"; } - } - else { + } else { dol_print_error($db); } @@ -1218,8 +1191,7 @@ function migrate_contracts_date2($db, $langs, $conf) print $langs->trans('MigrationContractsInvalidDatesNumber', $nbcontratsmodifie)."
\n"; else print $langs->trans('MigrationContractsInvalidDatesNothingToUpdate')."
\n"; } - } - else { + } else { dol_print_error($db); } @@ -1304,8 +1276,7 @@ function migrate_contracts_open($db, $langs, $conf) print $langs->trans('MigrationReopenedContractsNumber', $nbcontratsmodifie)."
\n"; else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; } - } - else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; + } else print $langs->trans('MigrationReopeningContractsNothingToUpdate')."
\n"; print ''; } @@ -1383,21 +1354,18 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) { $nb++; print ''.$langs->trans("OK").''; - } - else { + } else { print 'Error on insert'; $error++; } print ''; } - } - else { + } else { $error++; } $i++; } - } - else { + } else { $error++; } @@ -1411,13 +1379,11 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf) $sql = "ALTER TABLE ".MAIN_DB_PREFIX."paiementfourn DROP COLUMN fk_facture_fourn"; $db->query($sql); - } - else { + } else { print ''.$langs->trans("Error").''; $db->rollback(); } - } - else { + } else { print ''.$langs->trans("AlreadyDone").''; } } @@ -1502,13 +1468,11 @@ function migrate_price_facture($db, $langs, $conf) if ($facture->update_price() > 0) { //print $facture->id; - } - else { + } else { print "Error id=".$facture->id; $err++; } - } - else { + } else { print "Error #3"; $err++; } @@ -1517,15 +1481,13 @@ function migrate_price_facture($db, $langs, $conf) $i++; } - } - else { + } else { print $langs->trans("AlreadyDone"); } $db->free($resql); $db->commit(); - } - else { + } else { print "Error #1 ".$db->error(); $err++; @@ -1623,16 +1585,14 @@ function migrate_price_propal($db, $langs, $conf) */ $i++; } - } - else { + } else { print $langs->trans("AlreadyDone"); } $db->free($resql); $db->commit(); - } - else { + } else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1710,16 +1670,14 @@ function migrate_price_contrat($db, $langs, $conf) $i++; } - } - else { + } else { print $langs->trans("AlreadyDone"); } $db->free($resql); $db->commit(); - } - else { + } else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1815,8 +1773,7 @@ function migrate_price_commande($db, $langs, $conf) */ $i++; } - } - else { + } else { print $langs->trans("AlreadyDone"); } @@ -1833,8 +1790,7 @@ function migrate_price_commande($db, $langs, $conf) */ $db->commit(); - } - else { + } else { print "Error #1 ".$db->error(); $db->rollback(); @@ -1930,8 +1886,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) */ $i++; } - } - else { + } else { print $langs->trans("AlreadyDone"); } @@ -1948,8 +1903,7 @@ function migrate_price_commande_fournisseur($db, $langs, $conf) */ $db->commit(); - } - else { + } else { print "Error #1 ".$db->error(); $db->rollback(); @@ -2076,17 +2030,14 @@ function migrate_commande_expedition($db, $langs, $conf) $sql = "ALTER TABLE ".MAIN_DB_PREFIX."expedition DROP COLUMN fk_commande"; print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2149,8 +2100,7 @@ function migrate_commande_livraison($db, $langs, $conf) $error++; dol_print_error($db); } - } - else { + } else { $error++; dol_print_error($db); } @@ -2165,17 +2115,14 @@ function migrate_commande_livraison($db, $langs, $conf) $sql = "ALTER TABLE ".MAIN_DB_PREFIX."livraison DROP COLUMN fk_commande"; print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2253,13 +2200,11 @@ function migrate_detail_livraison($db, $langs, $conf) $error++; dol_print_error($db); } - } - else { + } else { $error++; dol_print_error($db); } - } - else { + } else { $error++; dol_print_error($db); } @@ -2274,17 +2219,14 @@ function migrate_detail_livraison($db, $langs, $conf) $sql = "ALTER TABLE ".MAIN_DB_PREFIX."livraisondet CHANGE fk_commande_ligne fk_origin_line integer"; print $langs->trans('FieldRenamed')."
\n"; $db->query($sql); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { $result = $db->DDLDescTable(MAIN_DB_PREFIX."livraisondet", "fk_origin_line"); $obj = $db->fetch_object($result); if (!$obj) @@ -2340,8 +2282,7 @@ function migrate_stocks($db, $langs, $conf) $resql2 = $db->query($sql); if ($resql2) { - } - else { + } else { $error++; dol_print_error($db); } @@ -2353,12 +2294,10 @@ function migrate_stocks($db, $langs, $conf) if ($error == 0) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -2413,8 +2352,7 @@ function migrate_menus($db, $langs, $conf) $resql2 = $db->query($sql); if ($resql2) { - } - else { + } else { $error++; dol_print_error($db); } @@ -2426,17 +2364,14 @@ function migrate_menus($db, $langs, $conf) if ($error == 0) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2498,25 +2433,21 @@ function migrate_commande_deliveryaddress($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if ($error == 0) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2591,18 +2522,15 @@ function migrate_restore_missing_links($db, $langs, $conf) //print ". "; $i++; } - } - else print $langs->trans('AlreadyDone')."
\n"; + } else print $langs->trans('AlreadyDone')."
\n"; if ($error == 0) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -2654,20 +2582,17 @@ function migrate_restore_missing_links($db, $langs, $conf) //print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if ($error == 0) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -2748,21 +2673,17 @@ function migrate_project_user_resp($db, $langs, $conf) if ($db->query($sqlDrop)) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2836,21 +2757,17 @@ function migrate_project_task_actors($db, $langs, $conf) if ($db->query($sqlDrop)) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } print ''; @@ -2920,8 +2837,7 @@ function migrate_relationship_tables($db, $langs, $conf, $table, $fk_source, $so print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -2931,21 +2847,17 @@ function migrate_relationship_tables($db, $langs, $conf, $table, $fk_source, $so if ($db->query($sqlDrop)) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3013,8 +2925,7 @@ function migrate_project_task_time($db, $langs, $conf) $oldtime++; if (!empty($totaltime[$obj->fk_task])) $totaltime[$obj->fk_task] += $newtime; else $totaltime[$obj->fk_task] = $newtime; - } - else { + } else { if (!empty($totaltime[$obj->fk_task])) $totaltime[$obj->fk_task] += $obj->task_duration; else $totaltime[$obj->fk_task] = $obj->task_duration; } @@ -3039,28 +2950,23 @@ function migrate_project_task_time($db, $langs, $conf) dol_print_error($db); } } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } - } - else { + } else { dol_print_error($db); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } - } - else { + } else { dol_print_error($db); } if ($error == 0) { $db->commit(); - } - else { + } else { $db->rollback(); } @@ -3132,31 +3038,26 @@ function migrate_customerorder_shipping($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if ($error == 0) { $db->commit(); - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3229,15 +3130,13 @@ function migrate_shipping_delivery($db, $langs, $conf) dol_print_error($db); } print ". "; - } - else { + } else { $error++; dol_print_error($db); } $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3251,18 +3150,15 @@ function migrate_shipping_delivery($db, $langs, $conf) // DDL commands must not be inside a transaction $sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."livraison DROP COLUMN fk_expedition"; $db->query($sqlDrop); - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3329,21 +3225,18 @@ function migrate_shipping_delivery2($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if ($error == 0) { $db->commit(); - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -3401,13 +3294,11 @@ function migrate_actioncomm_element($db, $langs, $conf) //$sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."actioncomm DROP COLUMN ".$field; //$db->query($sqlDrop); //print ". "; - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } } @@ -3491,13 +3382,11 @@ function migrate_mode_reglement($db, $langs, $conf) if (!$error) { $db->commit(); - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -3580,15 +3469,13 @@ function migrate_clean_association($db, $langs, $conf) print ''.$langs->trans("MigrationCategorieAssociation").''; print ''.$langs->trans("RemoveDuplicates").' '.$langs->trans("Success").' ('.$num.'=>'.count($couples).')'; $db->commit(); - } - else { + } else { print ''.$langs->trans("MigrationCategorieAssociation").''; print ''.$langs->trans("RemoveDuplicates").' '.$langs->trans("Failed").''; $db->rollback(); } } - } - else { + } else { print ''.$langs->trans("Error").''; print '
'.$db->lasterror().'
'; } @@ -3648,8 +3535,7 @@ function migrate_categorie_association($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3669,17 +3555,14 @@ function migrate_categorie_association($db, $langs, $conf) */ $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } @@ -3738,20 +3621,17 @@ function migrate_event_assignement($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -3812,20 +3692,17 @@ function migrate_event_assignement_contact($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -3896,8 +3773,7 @@ function migrate_reset_blocked_log($db, $langs, $conf) { $error++; dol_print_error($db); - } - else { + } else { // Add set line $object = new stdClass(); $object->id = 1; @@ -3914,31 +3790,26 @@ function migrate_reset_blocked_log($db, $langs, $conf) $error++; } } - } - else { + } else { print ' - '.$langs->trans('AlreadyInV7').'
'; } - } - else { + } else { dol_print_error($db); } $i++; } - } - else { + } else { print $langs->trans('NothingToDo')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -4000,20 +3871,17 @@ function migrate_remise_entity($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -4065,15 +3933,13 @@ function migrate_remise_except_entity($db, $langs, $conf) $sqlSelect2 = "SELECT f.entity"; $sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sqlSelect2 .= " WHERE f.rowid = ".$fk_facture; - } - elseif (!empty($obj->fk_facture_line)) + } elseif (!empty($obj->fk_facture_line)) { $sqlSelect2 = "SELECT f.entity"; $sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; $sqlSelect2 .= " WHERE fd.rowid = ".$obj->fk_facture_line; $sqlSelect2 .= " AND fd.fk_facture = f.rowid"; - } - else { + } else { $sqlSelect2 = "SELECT s.entity"; $sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sqlSelect2 .= " WHERE s.rowid = ".$obj->fk_soc; @@ -4097,8 +3963,7 @@ function migrate_remise_except_entity($db, $langs, $conf) dol_print_error($db); } } - } - else { + } else { $error++; dol_print_error($db); } @@ -4106,20 +3971,17 @@ function migrate_remise_except_entity($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -4179,20 +4041,17 @@ function migrate_user_rights_entity($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -4252,20 +4111,17 @@ function migrate_usergroup_rights_entity($db, $langs, $conf) print ". "; $i++; } - } - else { + } else { print $langs->trans('AlreadyDone')."
\n"; } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { dol_print_error($db); $db->rollback(); } @@ -4448,8 +4304,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_API') + } elseif ($moduletoreload == 'MAIN_MODULE_API') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php'; @@ -4458,8 +4313,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_BARCODE') + } elseif ($moduletoreload == 'MAIN_MODULE_BARCODE') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php'; @@ -4468,8 +4322,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_CRON') + } elseif ($moduletoreload == 'MAIN_MODULE_CRON') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php'; @@ -4478,8 +4331,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_SOCIETE') + } elseif ($moduletoreload == 'MAIN_MODULE_SOCIETE') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php'; @@ -4488,8 +4340,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7 + } elseif ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php'; @@ -4498,8 +4349,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 + } elseif ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; @@ -4508,8 +4358,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 + } elseif ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; @@ -4518,8 +4367,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 + } elseif ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; @@ -4528,8 +4376,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9 + } elseif ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; @@ -4538,8 +4385,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8 + } elseif ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php'; @@ -4548,8 +4394,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0 + } elseif ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php'; @@ -4558,8 +4403,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_EXPENSEREPORT') + } elseif ($moduletoreload == 'MAIN_MODULE_EXPENSEREPORT') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Expense Report module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modExpenseReport.class.php'; @@ -4568,8 +4412,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 + } elseif ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php'; @@ -4578,8 +4421,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo //$mod->remove('noboxes'); $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 + } elseif ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; @@ -4588,8 +4430,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); // We need to remove because a permission id has been removed $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0 + } elseif ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php'; @@ -4598,8 +4439,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); // We need to remove because id of module has changed $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_SUPPLIERPROPOSAL') // Module after 3.5 + } elseif ($moduletoreload == 'MAIN_MODULE_SUPPLIERPROPOSAL') // Module after 3.5 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Supplier Proposal module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modSupplierProposal.class.php'; @@ -4608,8 +4448,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); // We need to remove because id of module has changed $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0 + } elseif ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php'; @@ -4618,8 +4457,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); // We need to remove because menu entries has changed $mod->init($reloadmode); } - } - elseif ($moduletoreload == 'MAIN_MODULE_TAKEPOS') // Permission has changed into 10.0 + } elseif ($moduletoreload == 'MAIN_MODULE_TAKEPOS') // Permission has changed into 10.0 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Takepos module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modTakePos.class.php'; @@ -4628,8 +4466,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); // We need to remove because menu entries has changed $mod->init($reloadmode); } - } - else { + } else { $reg = array(); $tmp = preg_match('/MAIN_MODULE_([a-zA-Z0-9]+)/', $moduletoreload, $reg); if (!empty($reg[1])) @@ -4637,8 +4474,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo if (strtoupper($moduletoreload) == $moduletoreload) // If key is un uppercase { $moduletoreloadshort = ucfirst(strtolower($reg[1])); - } - else // If key is a mix of up and low case + } else // If key is a mix of up and low case { $moduletoreloadshort = $reg[1]; } @@ -4649,8 +4485,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod = new $classname($db); //$mod->remove('noboxes'); $mod->init($reloadmode); - } - else { + } else { dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'); $res = @dol_include_once(strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php'); @@ -4659,13 +4494,11 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod = new $classname($db); //$mod->remove('noboxes'); $mod->init($reloadmode); - } - else { + } else { dolibarr_install_syslog('Failed to include '.strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php'); } } - } - else { + } else { dolibarr_install_syslog("Error, can't find module with name ".$moduletoreload, LOG_WARNING); print "Error, can't find module with name ".$moduletoreload; } @@ -4799,8 +4632,7 @@ function migrate_user_photospath() } // dol_delete_dir($origin.'/'.$file); } - } - else // it is a file + } else // it is a file { if (!dol_is_file($destin.'/'.$file)) { diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 80f30552473..544593dc16c 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -118,17 +118,14 @@ if ($action == 'add') $db->commit(); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $_GET["commande_id"] = $_POST["commande_id"]; $action = 'create'; } -} - -elseif ($action == 'confirm_valid' && $confirm == 'yes' && +} elseif ($action == 'confirm_valid' && $confirm == 'yes' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate))) ) @@ -165,8 +162,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio if (!empty($backtopage)) header("Location: ".$backtopage); else header("Location: ".DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1'); exit; - } - else { + } else { $db->rollback(); } } @@ -259,8 +255,7 @@ $formfile = new FormFile($db); if ($action == 'create') // Create. Seems to no be used { -} -else // View +} else // View { if ($object->id > 0) { @@ -450,8 +445,7 @@ else // View print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 1); print ''; print ''; - } - else { + } else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -472,8 +466,7 @@ else // View if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -570,8 +563,7 @@ else // View } $label = (!empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $object->lines[$i]->product_label; - } - else { + } else { $label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : $object->lines[$i]->product_label); } @@ -591,8 +583,7 @@ else // View { print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '
'.dol_htmlentitiesbr($object->lines[$i]->description) : ''; } - } - else { + } else { print ""; if ($object->lines[$i]->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -668,8 +659,7 @@ else // View if ($conf->expedition_bon->enabled) { print ''.$langs->trans("Delete").''; - } - else { + } else { print ''.$langs->trans("Delete").''; } } @@ -712,13 +702,11 @@ else // View // Rien a droite print ''; - } - else { + } else { /* Expedition non trouvee */ print "Expedition inexistante ou acces refuse"; } - } - else { + } else { /* Expedition non trouvee */ print "Expedition inexistante ou acces refuse"; } diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 4d00c414cb1..6199bc4ec88 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -215,22 +215,19 @@ class Livraison extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $error++; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->db->rollback(); return -3; } - } - else { + } else { $error++; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->db->rollback(); return -2; } - } - else { + } else { $error++; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->db->rollback(); @@ -341,14 +338,12 @@ class Livraison extends CommonObject } return 1; - } - else { + } else { $this->error = 'Delivery with id '.$id.' not found sql='.$sql; dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR); return -2; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -394,8 +389,7 @@ class Livraison extends CommonObject if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { $numref = $objMod->livraison_get_num($soc, $this); - } - else { + } else { $numref = $this->ref; } $this->newref = dol_sanitizeFileName($numref); @@ -494,15 +488,13 @@ class Livraison extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } } } - } - else { + } else { $this->error = "Non autorise"; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; @@ -625,8 +617,7 @@ class Livraison extends CommonObject $this->update_price(); return 1; - } - else { + } else { return 0; } } @@ -695,20 +686,17 @@ class Livraison extends CommonObject // End call triggers return 1; - } - else { + } else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } - } - else { + } else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; @@ -978,15 +966,13 @@ class Livraison extends CommonObject if ($row[0] == $objSourceLine->rowid) { $array[$i]['qty'] = $objSourceLine->qty - $row[1]; - } - else { + } else { $array[$i]['qty'] = $objSourceLine->qty; } $array[$i]['ref'] = $objSourceLine->ref; $array[$i]['label'] = $objSourceLine->label ? $objSourceLine->label : $objSourceLine->description; - } - elseif ($objSourceLine->qty - $row[1] < 0) + } elseif ($objSourceLine->qty - $row[1] < 0) { $array[$i]['qty'] = $objSourceLine->qty - $row[1]." Erreur livraison !"; $array[$i]['ref'] = $objSourceLine->ref; @@ -996,8 +982,7 @@ class Livraison extends CommonObject $i++; } return $array; - } - else { + } else { $this->error = $this->db->error()." - sql=$sqlSourceLine"; return -1; } @@ -1026,13 +1011,11 @@ class Livraison extends CommonObject { $this->date_delivery = $date_livraison; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } - } - else { + } else { return -2; } } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 266b7d2bc09..8f82e94b8f9 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -68,8 +68,7 @@ if (empty($reshook)) if ($result > 0) { setEventMessages($langs->trans('LoanPaid'), null, 'mesgs'); - } - else { + } else { setEventMessages($loan->error, null, 'errors'); } } @@ -84,8 +83,7 @@ if (empty($reshook)) setEventMessages($langs->trans('LoanDeleted'), null, 'mesgs'); header("Location: index.php"); exit; - } - else { + } else { setEventMessages($loan->error, null, 'errors'); } } @@ -151,8 +149,7 @@ if (empty($reshook)) $action = 'create'; } } - } - else { + } else { header("Location: index.php"); exit(); } @@ -173,8 +170,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors'); $action = 'edit'; - } - else { + } else { $object->datestart = $datestart; $object->dateend = $dateend; $object->capital = $capital; @@ -197,13 +193,11 @@ if (empty($reshook)) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -268,8 +262,7 @@ if ($action == 'create') print ''.$langs->trans("Account").''; $form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant print ''; - } - else { + } else { print ''.$langs->trans("Account").''; print $langs->trans("NoBankAccountDefined"); print ''; @@ -352,8 +345,7 @@ if ($action == 'create') print ''; print $formaccounting->select_account(GETPOST('accountancy_account_interest') ?GETPOST('accountancy_account_interest') : $conf->global->LOAN_ACCOUNTING_ACCOUNT_INTEREST, 'accountancy_account_interest', 1, '', 1, 1); print ''; - } - else // For external software + } else // For external software { // Accountancy_account_capital print ''.$langs->trans("LoanAccountancyCapitalCode").''; @@ -476,8 +468,7 @@ if ($id > 0) print ''.$langs->trans("LoanCapital").''; print ''; print ''; - } - else { + } else { print ''.$langs->trans("LoanCapital").''.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).''; } @@ -487,8 +478,7 @@ if ($id > 0) print ''.$langs->trans("Insurance").''; print ''; print ''; - } - else { + } else { print ''.$langs->trans("Insurance").''.price($object->insurance_amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; } @@ -498,8 +488,7 @@ if ($id > 0) if ($action == 'edit') { print $form->selectDate($object->datestart, 'start', 0, 0, 0, 'update', 1, 0); - } - else { + } else { print dol_print_date($object->datestart, "day"); } print ""; @@ -510,8 +499,7 @@ if ($id > 0) if ($action == 'edit') { print $form->selectDate($object->dateend, 'end', 0, 0, 0, 'update', 1, 0); - } - else { + } else { print dol_print_date($object->dateend, "day"); } print ""; @@ -522,8 +510,7 @@ if ($id > 0) if ($action == 'edit') { print ''; - } - else { + } else { print $object->nbterm; } print ''; @@ -534,8 +521,7 @@ if ($id > 0) if ($action == 'edit') { print '%'; - } - else { + } else { print price($object->rate).'%'; } print ''; @@ -551,13 +537,11 @@ if ($id > 0) if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1); - } - else { + } else { print ''; } print ''; - } - else { + } else { print ''; print $langs->trans("LoanAccountancyCapitalCode"); print ''; @@ -587,13 +571,11 @@ if ($id > 0) if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1); - } - else { + } else { print ''; } print ''; - } - else { + } else { print ''; print $langs->trans("LoanAccountancyInsuranceCode"); print ''; @@ -623,13 +605,11 @@ if ($id > 0) if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1); - } - else { + } else { print ''; } print ''; - } - else { + } else { print ''; print $langs->trans("LoanAccountancyInterestCode"); print ''; @@ -723,8 +703,7 @@ if ($id > 0) print ''; $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -784,8 +763,7 @@ if ($id > 0) print ""; } } - } - else { + } else { // Loan not found dol_print_error('', $object->error); } diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index d38593c9710..a072199dc01 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -160,13 +160,11 @@ class Loan extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->db->free($resql); return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -256,8 +254,7 @@ class Loan extends CommonObject //dol_syslog("Loans::create this->id=".$this->id); $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -326,8 +323,7 @@ class Loan extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -371,8 +367,7 @@ class Loan extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -496,8 +491,7 @@ class Loan extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -566,8 +560,7 @@ class Loan extends CommonObject $this->db->free($resql); return $amount; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -612,13 +605,11 @@ class Loan extends CommonObject $this->db->free($result); return 1; - } - else { + } else { $this->db->free($result); return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index 8089dc3e176..7405a63e3b9 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -170,8 +170,7 @@ class LoanSchedule extends CommonObject if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan"); - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -182,8 +181,7 @@ class LoanSchedule extends CommonObject $this->amount_capital = $totalamount; $this->db->commit(); return $this->id; - } - else { + } else { $this->errors[] = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -255,8 +253,7 @@ class LoanSchedule extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -318,8 +315,7 @@ class LoanSchedule extends CommonObject { $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -359,8 +355,7 @@ class LoanSchedule extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -445,8 +440,7 @@ class LoanSchedule extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 5c50a1fea89..40479677fd0 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -165,8 +165,7 @@ class PaymentLoan extends CommonObject if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan"); - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -177,8 +176,7 @@ class PaymentLoan extends CommonObject $this->amount_capital = $totalamount; $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -252,8 +250,7 @@ class PaymentLoan extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -323,8 +320,7 @@ class PaymentLoan extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -375,8 +371,7 @@ class PaymentLoan extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -454,8 +449,7 @@ class PaymentLoan extends CommonObject $result = $acc->add_url_line($bank_line_id, $fk_loan, DOL_URL_ROOT.'/loan/card.php?id=', ($this->label ? $this->label : ''), 'loan'); if ($result <= 0) dol_print_error($this->db); } - } - else { + } else { $this->error = $acc->error; $error++; } @@ -464,8 +458,7 @@ class PaymentLoan extends CommonObject if (!$error) { return 1; - } - else { + } else { return -1; } } @@ -489,8 +482,7 @@ class PaymentLoan extends CommonObject { $this->fk_bank = $id_bank; return 1; - } - else { + } else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 93eca8cb7b4..442f8768390 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -158,8 +158,7 @@ if ($object->id) $permtoedit = $user->rights->loan->write; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 5a4b9364555..fc0e766ed9b 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -120,8 +120,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { $num = $nbtotalofrecords; -} -else { +} else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -260,8 +259,7 @@ if ($resql) print ''."\n"; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 6d912cc7149..31619be511b 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -63,8 +63,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del $db->commit(); header("Location: ".DOL_URL_ROOT."/loan/list.php"); exit; - } - else { + } else { setEventMessages($payment->error, $payment->errors, 'errors'); $db->rollback(); } @@ -100,8 +99,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->wri header('Location: card.php?id='.$payment->id); exit; - } - else { + } else { setEventMessages($payment->error, $payment->errors, 'errors'); $db->rollback(); } @@ -252,8 +250,7 @@ if ($resql) print "\n"; $db->free($resql); -} -else { +} else { dol_print_error($db); } @@ -283,8 +280,7 @@ if (empty($action) && !empty($user->rights->loan->delete)) if (!$disable_delete) { print ''.$langs->trans('Delete').''; - } - else { + } else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 3ccc6a77b3f..de5a43220ef 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -155,8 +155,7 @@ if ($action == 'add_payment') { setEventMessages($payment->error, $payment->errors, 'errors'); $error++; - } - elseif (isset($line)) + } elseif (isset($line)) { $line->fk_bank = $payment->fk_bank; $line->update($user); @@ -169,8 +168,7 @@ if ($action == 'add_payment') $loc = DOL_URL_ROOT.'/loan/card.php?id='.$chid; header('Location: '.$loc); exit; - } - else { + } else { $db->rollback(); } } @@ -289,8 +287,7 @@ if ($action == 'create') if ($loan->datestart > 0) { print ''.dol_print_date($loan->datestart, 'day').''; - } - else { + } else { print '!!!'; } @@ -304,24 +301,21 @@ if ($action == 'create') if ($sumpaid < $loan->capital) { print $langs->trans("LoanCapital").': '; - } - else { + } else { print '-'; } print '
'; if ($sumpaid < $loan->capital) { print $langs->trans("Insurance").': '; - } - else { + } else { print '-'; } print '
'; if ($sumpaid < $loan->capital) { print $langs->trans("Interest").': '; - } - else { + } else { print '-'; } print ""; diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index fb3cd86ebe3..adcdf4ca049 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -237,8 +237,7 @@ if ($object->nbterm > 0 && count($echeance->lines) == 0) $i++; $capital = $cap_rest; } -} -elseif (count($echeance->lines) > 0) +} elseif (count($echeance->lines) > 0) { $i = 1; $capital = $object->capital; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index dec81411a33..46e8d017eca 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -208,14 +208,10 @@ class MailmanSpip if ($result) { return 1; - } - else $this->error = $mydb->lasterror(); - } - else $this->error = 'Failed to connect to SPIP'; - } - else $this->error = 'BadSPIPConfiguration'; - } - else $this->error = 'SPIPNotEnabled'; + } else $this->error = $mydb->lasterror(); + } else $this->error = 'Failed to connect to SPIP'; + } else $this->error = 'BadSPIPConfiguration'; + } else $this->error = 'SPIPNotEnabled'; return 0; } @@ -249,14 +245,10 @@ class MailmanSpip if ($result) { return 1; - } - else $this->error = $mydb->lasterror(); - } - else $this->error = 'Failed to connect to SPIP'; - } - else $this->error = 'BadSPIPConfiguration'; - } - else $this->error = 'SPIPNotEnabled'; + } else $this->error = $mydb->lasterror(); + } else $this->error = 'Failed to connect to SPIP'; + } else $this->error = 'BadSPIPConfiguration'; + } else $this->error = 'SPIPNotEnabled'; return 0; } @@ -290,23 +282,18 @@ class MailmanSpip // nous avons au moins une reponse $mydb->close($result); return 1; - } - else { + } else { // nous n'avons pas de reponse => n'existe pas $mydb->close($result); return 0; } - } - else { + } else { $this->error = $mydb->lasterror(); $mydb->close(); } - } - else $this->error = 'Failed to connect to SPIP'; - } - else $this->error = 'BadSPIPConfiguration'; - } - else $this->error = 'SPIPNotEnabled'; + } else $this->error = 'Failed to connect to SPIP'; + } else $this->error = 'BadSPIPConfiguration'; + } else $this->error = 'SPIPNotEnabled'; return -1; } @@ -371,12 +358,10 @@ class MailmanSpip { $this->mladded_ko[$list] = $object->email; return -2; - } - else $this->mladded_ok[$list] = $object->email; + } else $this->mladded_ok[$list] = $object->email; } return count($lists); - } - else { + } else { $this->error = "ADHERENT_MAILMAN_URL not defined"; return -1; } @@ -444,12 +429,10 @@ class MailmanSpip { $this->mlremoved_ko[$list] = $object->email; return -2; - } - else $this->mlremoved_ok[$list] = $object->email; + } else $this->mlremoved_ok[$list] = $object->email; } return count($lists); - } - else { + } else { $this->error = "ADHERENT_MAILMAN_UNSUB_URL not defined"; return -1; } diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index e174e383993..9efea04e415 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -47,8 +47,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -60,8 +59,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -71,8 +69,7 @@ if ($action == 'remises') if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', $_POST['MARGIN_METHODE_FOR_DISCOUNT'], 'chaine', 0, '', $conf->entity) > 0) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } - else { + } else { dol_print_error($db); } } @@ -82,8 +79,7 @@ if ($action == 'typemarges') if (dolibarr_set_const($db, 'MARGIN_TYPE', $_POST['MARGIN_TYPE'], 'chaine', 0, '', $conf->entity) > 0) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } - else { + } else { dol_print_error($db); } } @@ -93,8 +89,7 @@ if ($action == 'contact') if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', $_POST['AGENT_CONTACT_TYPE'], 'chaine', 0, '', $conf->entity) > 0) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } - else { + } else { dol_print_error($db); } } @@ -161,13 +156,11 @@ print ''; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('DISPLAY_MARGIN_RATES'); -} -else { +} else { if (empty($conf->global->DISPLAY_MARGIN_RATES)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; - } - else { + } else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } @@ -182,13 +175,11 @@ print ''; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('DISPLAY_MARK_RATES'); -} -else { +} else { if (empty($conf->global->DISPLAY_MARK_RATES)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; - } - else { + } else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } @@ -203,13 +194,11 @@ print ''; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('ForceBuyingPriceIfNull'); -} -else { +} else { if (empty($conf->global->ForceBuyingPriceIfNull)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; - } - else { + } else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 8dfaecc7d41..6ff9cdc7274 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -303,8 +303,7 @@ if ($result) } print ""; print ''; -} -else { +} else { dol_print_error($db); } $db->free($result); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 20d2b2a1b52..e1fd6876e0f 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -108,8 +108,7 @@ if ($socid > 0) { if (!$sortorder) $sortorder = "DESC"; if (!$sortfield) $sortfield = "f.datef"; } -} -else { +} else { print ''.$langs->trans('ThirdPartyName').''; print ''; print $form->select_company(null, 'socid', '(client=1 OR client=3)', 1, 0, 0); @@ -125,8 +124,7 @@ if (!$sortfield) { $sortfield = "f.datef"; $sortorder = "DESC"; - } - else { + } else { $sortfield = "s.nom"; $sortorder = "ASC"; } @@ -267,8 +265,7 @@ if ($result) if (!empty($client)) { print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&socid=".$socid, '', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&socid=".$socid, 'align="center"', $sortfield, $sortorder); - } - else print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder); + } else print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder); print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); @@ -295,8 +292,7 @@ if ($result) { $marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : ''; - } - else { + } else { $marginRate = ($pa != 0) ? (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ? (100 * $marge / $pv) : ''; } @@ -310,8 +306,7 @@ if ($result) print "\n"; print ""; print dol_print_date($db->jdate($objp->datef), 'day').""; - } - else { + } else { $companystatic->id = $objp->socid; $companystatic->name = $objp->name; $companystatic->client = $objp->client; @@ -363,8 +358,7 @@ if ($result) print ""; print ''; -} -else { +} else { dol_print_error($db); } $db->free($result); diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index 41618b174fa..fdfea1610bf 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -127,12 +127,10 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta if ($product->fetch_product_fournisseur_price($fk_pa)) { $paht_ret = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100); - } - else { + } else { $paht_ret = $paht; } - } - else { + } else { $paht_ret = $paht; } diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 3e2fd804ff6..cb67cb0d58f 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -61,8 +61,7 @@ if (!$sortfield) { $sortfield = "f.datef"; $sortorder = "DESC"; - } - else { + } else { $sortfield = "p.ref"; $sortorder = "ASC"; } @@ -112,8 +111,7 @@ if ($id > 0) { if (!$sortorder) $sortorder = "DESC"; if (!$sortfield) $sortfield = "f.datef"; -} -else { +} else { print ''.$langs->trans('ChooseProduct/Service').''; print ''; $form->select_produits('', 'id', '', 20, 0, 1, 2, '', 1, array(), 0, 'All'); @@ -238,8 +236,7 @@ if ($result) if ($id > 0) { print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&id=".$id, '', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&id=".$id, 'align="center"', $sortfield, $sortorder); - } - else { + } else { print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&id=".$id, '', $sortfield, $sortorder); } print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&id=".$id, 'align="right"', $sortfield, $sortorder); @@ -267,8 +264,7 @@ if ($result) { $marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : ''; - } - else { + } else { $marginRate = ($pa != 0) ? (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ? (100 * $marge / $pv) : ''; } @@ -282,8 +278,7 @@ if ($result) print "\n"; print ""; print dol_print_date($db->jdate($objp->datef), 'day').""; - } - else { + } else { print ''; if ($objp->rowid > 0) { @@ -294,8 +289,7 @@ if ($result) $product_static->entity = $objp->pentity; $text = $product_static->getNomUrl(1); print $text .= ' - '.$objp->label; - } - else { + } else { print img_object('', 'product').' '.$langs->trans("NotPredefinedProducts"); } print "\n"; @@ -339,8 +333,7 @@ if ($result) print ""; print ''; -} -else { +} else { dol_print_error($db); } $db->free($result); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 489946e43fe..70cbf6a9e42 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -229,8 +229,7 @@ if ($id > 0 || !empty($ref)) { $marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : ''; - } - else { + } else { $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : ''; } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index c04537fa99e..c9711bd99ef 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -235,8 +235,7 @@ if ($socid > 0) { $marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : ''; - } - else { + } else { $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : ''; } @@ -253,8 +252,7 @@ if ($socid > 0) print "".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."\n"; print ' '; print "\n"; - } - else { + } else { dol_print_error($db); } print ""; @@ -262,8 +260,7 @@ if ($socid > 0) print '
'; $db->free($result); -} -else { +} else { dol_print_error('', 'Parameter socid not defined'); } diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 1ef1f9c1f50..e50539fd05b 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -160,20 +160,17 @@ if (!defined('NOREQUIREUSER')) { */ // By default conf->entity is 1, but we change this if we ask another value. -if (session_id() && !empty($_SESSION["dol_entity"])) // Entity inside an opened session -{ +if (session_id() && !empty($_SESSION["dol_entity"])) { + // Entity inside an opened session $conf->entity = $_SESSION["dol_entity"]; -} -elseif (!empty($_ENV["dol_entity"])) // Entity inside a CLI script -{ +} elseif (!empty($_ENV["dol_entity"])) { + // Entity inside a CLI script $conf->entity = $_ENV["dol_entity"]; -} -elseif (GETPOSTISSET("loginfunction") && GETPOST("entity", 'int')) // Just after a login page -{ +} elseif (GETPOSTISSET("loginfunction") && GETPOST("entity", 'int')) { + // Just after a login page $conf->entity = GETPOST("entity", 'int'); -} -elseif (defined('DOLENTITY') && is_numeric(DOLENTITY)) // For public page with MultiCompany module -{ +} elseif (defined('DOLENTITY') && is_numeric(DOLENTITY)) { + // For public page with MultiCompany module $conf->entity = DOLENTITY; } diff --git a/htdocs/mrp/ajax/ajax_bom.php b/htdocs/mrp/ajax/ajax_bom.php index d5c1355d361..57f1089c2e2 100644 --- a/htdocs/mrp/ajax/ajax_bom.php +++ b/htdocs/mrp/ajax/ajax_bom.php @@ -49,7 +49,6 @@ if ($result > 0) unset($object->fields); unset($object->db); echo json_encode($object); -} -else { +} else { echo 'Failed to load category with id='.$idbom; } diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 5cf3d5798f8..404a3329133 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -421,14 +421,11 @@ class Mo extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } - elseif (strpos($key, 'date') !== false) { + } elseif (strpos($key, 'date') !== false) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; - } - elseif ($key == 'customsql') { + } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } - else { + } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } } @@ -582,8 +579,7 @@ class Mo extends CommonObject setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); $this->db->commit(); return 1; - } - else { + } else { setEventMessages($this->error, $this->errors, 'errors'); $this->db->rollback(); return -1; @@ -655,8 +651,7 @@ class Mo extends CommonObject $error++; $this->error = "BadValueForquantityToConsume"; break; - } - else { + } else { $moline->fk_product = $line->fk_product; $moline->role = 'toconsume'; $moline->position = $line->position; @@ -762,14 +757,12 @@ class Mo extends CommonObject if ($numref != "") { return $numref; - } - else { + } else { $this->error = $obj->error; //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); return ""; } - } - else { + } else { print $langs->trans("Error")." ".$langs->trans("Error_MRP_MO_ADDON_NotDefined"); return ""; } @@ -814,8 +807,7 @@ class Mo extends CommonObject { $this->fetch_product(); $num = $this->getNextNumRef($this->product); - } - else { + } else { $num = $this->ref; } $this->newref = $num; @@ -896,8 +888,7 @@ class Mo extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1024,8 +1015,7 @@ class Mo extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -1141,8 +1131,7 @@ class Mo extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -1175,8 +1164,7 @@ class Mo extends CommonObject $this->error = $this->error; $this->errors = $this->errors; return $result; - } - else { + } else { $this->lines = $result; return $this->lines; } @@ -1322,8 +1310,7 @@ class Mo extends CommonObject $productstatic->fetch($line->fk_product); $this->tpl['label'] .= $productstatic->getNomUrl(1); //$this->tpl['label'].= ' - '.$productstatic->label; - } - else { + } else { // If origin MRP line is not a product, but another MRP // TODO } @@ -1506,14 +1493,11 @@ class MoLine extends CommonObjectLine foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } - elseif (strpos($key, 'date') !== false) { + } elseif (strpos($key, 'date') !== false) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; - } - elseif ($key == 'customsql') { + } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } - else { + } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; } } diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index e05a93494f3..d4359dcae90 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -136,8 +136,7 @@ if ($conf->use_javascript_ajax) print ""; print "
"; - } - else { + } else { dol_print_error($db); } } @@ -194,8 +193,7 @@ if ($resql) } print ""; print "
"; -} -else { +} else { dol_print_error($db); } @@ -246,8 +244,7 @@ if ($resql) } print ""; print "
"; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 5b18f18d1ca..6630688b64a 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -48,8 +48,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); @@ -215,8 +214,7 @@ if ($object->id > 0) if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print '
'.$langs->trans("AddAction").''; - } - else { + } else { print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index eda7d0c30ca..a4ab216156c 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -192,8 +192,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, 0, 0, 0); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -623,8 +622,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { print ''.$langs->trans("Modify").''."\n"; - } - else { + } else { print ''.$langs->trans('Modify').''."\n"; } } @@ -637,8 +635,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { print ''.$langs->trans("Validate").''; - } - else { + } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; } @@ -672,8 +669,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { print ''.$langs->trans('Delete').''."\n"; - } - else { + } else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 9ed658ab1c1..86aefd8a5d5 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -183,8 +183,7 @@ if ($object->id) $relativepathwithnofile = 'mo/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { accessforbidden('', 0, 1); } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 9866dabf8e0..64441a4fec9 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -279,8 +279,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { $num = $nbtotalofrecords; -} -else { +} else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -415,8 +414,7 @@ foreach ($object->fields as $key => $val) if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75'); elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); - } - elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; + } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 6c800446595..b168371c0ea 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -352,8 +352,7 @@ if (empty($reshook)) } } } - } - else { + } else { $consumptioncomplete = false; $productioncomplete = false; } @@ -406,8 +405,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, 0, 0, 0); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -591,8 +589,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { print ''.$langs->trans("Validate").''; - } - else { + } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; } diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 50bd5d6cdcf..27bf6dc1c8f 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -409,8 +409,7 @@ class MultiCurrency extends CommonObject { $this->rate = $currencyRate; return 1; - } - else { + } else { $this->rate = null; $this->errors = $currencyRate->errors; return -1; @@ -562,8 +561,7 @@ class MultiCurrency extends CommonObject { if ($way == 'dolibarr') return $amount * $multicurrency_tx; else return $amount / $multicurrency_tx; - } - else return $amount; + } else return $amount; } /** @@ -657,8 +655,7 @@ class MultiCurrency extends CommonObject if ($obj->fetch(null, $code) > 0) { $obj->updateRate($rate); - } - elseif ($addifnotfound) + } elseif ($addifnotfound) { self::addRateFromDolibarr($code, $rate); } @@ -666,8 +663,7 @@ class MultiCurrency extends CommonObject } return 1; - } - else { + } else { dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING); setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors'); diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 1a794ac76d9..7322c70780c 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -241,8 +241,7 @@ print $langs->trans("Title").''; if ($action == 'edit') { print ''; -} -else print dol_htmlentities($object->titre); +} else print dol_htmlentities($object->titre); print ''; // Description @@ -251,8 +250,7 @@ if ($action == 'edit') { $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); $doleditor->Create(0, ''); -} -else { +} else { print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)); } print ''; @@ -264,8 +262,7 @@ if (!$object->fk_user_creat) { if ($action == 'edit') { print ''; - } - else print dol_print_email($object->mail_admin, 0, 0, 1); + } else print dol_print_email($object->mail_admin, 0, 0, 1); print ''; } @@ -274,8 +271,7 @@ print ''.$langs->trans('ToReceiveEMailForEachVote').'mailsonde ? 'checked="checked"' : '').'">'; -} -else { +} else { print yn($object->mailsonde); //If option is active and linked user does not have an email, we show a warning @@ -292,8 +288,7 @@ print ''.$langs->trans('CanComment').''; if ($action == 'edit') { print 'allow_comments ? 'checked="checked"' : '').'">'; -} -else print yn($object->allow_comments); +} else print yn($object->allow_comments); print ''; // Users can see others vote @@ -301,8 +296,7 @@ print ''.$langs->trans('CanSeeOthersVote').''; if ($action == 'edit') { print 'allow_spy ? 'checked="checked"' : '').'">'; -} -else print yn($object->allow_spy); +} else print yn($object->allow_spy); print ''; // Expire date @@ -407,8 +401,7 @@ if ($comments) { print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))."
"; } -} -else { +} else { print $langs->trans("NoCommentYet").'
'; } diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index f7541f2ebe0..19a29f5fa71 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -199,8 +199,7 @@ class Opensurveysondage extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -261,8 +260,7 @@ class Opensurveysondage extends CommonObject $this->date_m = $this->db->jdate($obj->tls); $ret = 1; - } - else { + } else { $sondage = ($id ? 'id='.$id : 'sondageid='.$numsurvey); $this->error = 'Fetch no poll found for '.$sondage; dol_syslog($this->error, LOG_ERR); @@ -270,8 +268,7 @@ class Opensurveysondage extends CommonObject } $this->db->free($resql); - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); $ret = -1; } @@ -339,8 +336,7 @@ class Opensurveysondage extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -404,8 +400,7 @@ class Opensurveysondage extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -453,8 +448,7 @@ class Opensurveysondage extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -495,8 +489,7 @@ class Opensurveysondage extends CommonObject $ret[] = $tmp; $i++; } - } - else dol_print_error($this->db); + } else dol_print_error($this->db); $this->lines = $ret; diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php index 2125ac76774..6f9a699273b 100644 --- a/htdocs/opensurvey/exportcsv.php +++ b/htdocs/opensurvey/exportcsv.php @@ -108,13 +108,11 @@ if ($resql) { $input .= 'OK;'; $somme[$k]++; - } - elseif ($car == "2") + } elseif ($car == "2") { $input .= 'KO;'; $somme[$k]++; - } - else { + } else { $input .= ';'; } } @@ -122,8 +120,7 @@ if ($resql) $input .= "\r\n"; $i++; } -} -else dol_print_error($db); +} else dol_print_error($db); $filesize = strlen($input); diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 2fa067ba9a3..635fc3ceb5c 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -103,8 +103,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $width = 150; - } - elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) + } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 20609602ad2..50198e5202f 100644 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -52,8 +52,7 @@ if ($resql) { $obj = $db->fetch_object($resql); $nbsondages = $obj->nb; -} -else dol_print_error($db, ''); +} else dol_print_error($db, ''); $title = $langs->trans("OpenSurveyArea"); diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 918c8e20ef9..4fcbb93a18c 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -190,8 +190,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; -} -else { +} else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -356,8 +355,7 @@ while ($i < min($num, $limit)) { $obj2 = $db->fetch_object($resql2); $nbuser = $obj2->nb; - } - else dol_print_error($db); + } else dol_print_error($db); $opensurvey_static->id = $obj->rowid; $opensurvey_static->ref = $obj->rowid; diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index c86c6919f00..59f605daf31 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -70,12 +70,10 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '1') { $nouveauchoix .= "1"; - } - elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') + } elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') { $nouveauchoix .= "2"; - } - else { // sinon c'est 0 + } else { // sinon c'est 0 $nouveauchoix .= "0"; } } @@ -93,8 +91,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout { setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); $error++; - } - else { + } else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $resql = $db->query($sql); @@ -134,12 +131,10 @@ if ($testmodifier) if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '1') { $nouveauchoix .= "1"; - } - elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') + } elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') { $nouveauchoix .= "2"; - } - else { // sinon c'est 0 + } else { // sinon c'est 0 $nouveauchoix .= "0"; } } @@ -260,8 +255,7 @@ if (isset($_POST["ajoutercolonne"]) && $object->format == "D") } $adresseadmin = $object->mail_admin; - } - else { + } else { $erreur_ajout_date = "yes"; } } @@ -449,8 +443,7 @@ print $langs->trans("Title").''; if ($action == 'edit') { print ''; -} -else print dol_htmlentities($object->titre); +} else print dol_htmlentities($object->titre); print ''; // Expire date @@ -533,8 +526,7 @@ if (GETPOST('ajoutsujet')) print '     '; print ''; print '

'."\n"; - } - else { + } else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); @@ -749,8 +741,7 @@ if ($object->format == "D") print ''."\n"; } -} -else { +} else { // Show titles print ''."\n"; print ''."\n"; @@ -836,8 +827,7 @@ while ($compteur < $num) if (((string) $car) == "0") $sumagainst[$i]++; } } - } - else { + } else { //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs if ($compteur == $ligneamodifier) { @@ -863,8 +853,7 @@ while ($compteur < $num) } print ''."\n"; } - } - else { + } else { for ($i = 0; $i < $nbcolonnes; $i++) { $car = substr($ensemblereponses, $i, 1); @@ -1058,8 +1047,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) } else { $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').($toutsujet[$i] ? ' ('.dol_print_date($toutsujet[$i], '%A').')' : ''); } - } - else { + } else { $tmps = explode('@', $toutsujet[$i]); $meilleursujet .= dol_htmlentities($tmps[0]); } diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 4254199ec96..17d60d4a406 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -209,8 +209,7 @@ llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss if (!isset($_SESSION["nbrecaseshoraires"])) { $_SESSION["nbrecaseshoraires"] = 5; -} -elseif (GETPOST('ajoutcases') && $_SESSION["nbrecaseshoraires"] == 5) +} elseif (GETPOST('ajoutcases') && $_SESSION["nbrecaseshoraires"] == 5) { $_SESSION["nbrecaseshoraires"] = 10; } @@ -319,8 +318,7 @@ $premierjourmois = date("N", mktime(0, 0, 0, $_SESSION["mois"], 1, $_SESSION["an if (is_integer($_SESSION["mois"]) && $_SESSION["mois"] > 0 && $_SESSION["mois"] < 13) { $motmois = dol_print_date(mktime(0, 0, 0, $_SESSION["mois"], 10), '%B'); -} -else { +} else { $motmois = dol_print_date(dol_now(), '%B'); } diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 9752a4c43c4..5d7363b4c9f 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -88,8 +88,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre")) { $testdate = true; $_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc'); - } - else { + } else { $testdate = true; $_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc'); //$testdate = false; @@ -191,8 +190,7 @@ if (GETPOST('choix_sondage')) else print ''; print ''; print '
trans("TypeDate") : $langs->trans("TypeClassic")).')">'; -} -else { +} else { // Show image to selecte between date survey or other survey print '
'."\n"; print ' '."\n"; diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 5e21326062c..cb1ad560158 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -79,8 +79,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 94dff45e543..71f4b25829b 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -79,8 +79,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -94,8 +93,7 @@ if ($action == "setlive") if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -149,8 +147,7 @@ if (empty($conf->global->PAYPAL_API_SANDBOX)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 6da045aaf4f..18ebce49479 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -259,8 +259,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, $payPalURL = $API_Url.$token; header("Location: ".$payPalURL); exit; - } - else { + } else { //Display a user friendly Error on the page using any of the following error information returned by PayPal $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); @@ -270,8 +269,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, if ($ErrorCode == 10729) { $mesg .= "PayPal can't accept payments for this thirdparty. An address is defined but is not complete (missing State).
Ask system administrator to fix address or to setup Paypal module to accept payments even on not complete addresses (remove option PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS).
\n"; - } - else { + } else { $mesg = $langs->trans('SetExpressCheckoutAPICallFailed')."
\n"; $mesg .= $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."
\n"; $mesg .= $langs->trans('ShortErrorMessage').": ".$ErrorShortMsg."
\n"; @@ -345,8 +343,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, if (empty($conf->global->PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS)) { $nvpstr = $nvpstr."&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted - } - else { + } else { $nvpstr = $nvpstr."&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory) } $nvpstr = $nvpstr."&SOLUTIONTYPE=".urlencode($solutionType); @@ -589,8 +586,7 @@ function hash_call($methodName, $nvpStr) { $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; - } - else { + } else { $API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; } @@ -668,8 +664,7 @@ function hash_call($methodName, $nvpStr) $_SESSION['curl_error_msg'] = curl_error($ch); //Execute the Error handling module to display errors. - } - else { + } else { //closing the curl curl_close($ch); } diff --git a/htdocs/paypal/lib/paypalfunctions.lib.php b/htdocs/paypal/lib/paypalfunctions.lib.php index 1c495bdb5ae..5fbe0f6e9cd 100644 --- a/htdocs/paypal/lib/paypalfunctions.lib.php +++ b/htdocs/paypal/lib/paypalfunctions.lib.php @@ -52,8 +52,7 @@ if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha' { $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; -} -else { +} else { $API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; } diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 5282684f81f..02fd4545c84 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -73,8 +73,7 @@ if ($action == 'setconst' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -92,8 +91,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -159,8 +157,7 @@ if ($mode == 'setup' && $user->admin) if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS') { print $langs->trans("IsTokenGenerated"); - } - else { + } else { print $langs->trans($key['varname']); } print ''; @@ -196,8 +193,7 @@ if ($mode == 'setup' && $user->admin) $storage = new DoliStorage($db, $conf); try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE); - } - catch (Exception $e) + } catch (Exception $e) { // Return an error if token not found } @@ -263,13 +259,11 @@ if ($mode == 'config' && $user->admin) if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff($printer->active); - } - else { + } else { if (empty($conf->global->{$printer->conf})) { print '
'.img_picto($langs->trans("Disabled"), 'off').''; - } - else { + } else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } @@ -303,8 +297,7 @@ if ($mode == 'test' && $user->admin) } else { setEventMessages($printer->error, $printer->errors, 'errors'); } - } - else { + } else { print $langs->trans('PleaseConfigureDriverfromList'); } } else { diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index a1077a4f845..752ddecbea8 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -182,8 +182,7 @@ if ($action != 'create_updater' && $action != 'edit_updater') print 'id.'">'.img_delete().''; print ''; } - } - else { + } else { print ''; @@ -274,8 +273,7 @@ if ($action != 'create_variable' && $action != 'edit_variable') print 'id.'">'.img_delete().''; print ''; } - } - else { + } else { print ''; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 8ac181e64c9..23b1cb43f56 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -81,8 +81,7 @@ if ($action == 'setcodeproduct') { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -110,16 +109,14 @@ if ($action == 'other') $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES', 0, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'PRODUCT_PRICE_UNIQ', 1, 'chaine', 0, '', $conf->entity); - } - else { + } else { $multirule = explode('&', $princingrules); foreach ($multirule as $rulesselected) { $res = dolibarr_set_const($db, $rulesselected, 1, 'chaine', 0, '', $conf->entity); } } - } - else // We clear this mode + } else // We clear this mode { if (strpos($rule, '&') === false) { $res = dolibarr_set_const($db, $rule, 0, 'chaine', 0, '', $conf->entity); @@ -199,13 +196,11 @@ if ($action == 'specimen') // For products { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=product&file=SPECIMEN.pdf"); return; - } - else { + } else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } - } - else { + } else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -266,8 +261,7 @@ if ($action) if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("SetupNotError"), null, 'errors'); } } @@ -284,8 +278,7 @@ if (empty($conf->product->enabled)) { $title = $langs->trans('ServiceSetup'); $tab = $langs->trans('Services'); -} -elseif (empty($conf->service->enabled)) +} elseif (empty($conf->service->enabled)) { $title = $langs->trans('ProductSetup'); $tab = $langs->trans('Products'); @@ -333,8 +326,7 @@ foreach ($dirproduct as $dirroot) try { dol_include_once($dirroot.$file.'.php'); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -356,8 +348,7 @@ foreach ($dirproduct as $dirroot) print '\n"; - } - else { + } else { $disabled = false; if (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true); print ''; - } - else { + } else { print '"; @@ -480,8 +469,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->PRODUCT_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); - } - else { + } else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -507,8 +495,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'contract').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -561,8 +548,7 @@ print ''; if (empty($conf->multicompany->enabled)) { print ''; -} -else { +} else { print ''; } print ''; -} -else { +} else { print ''; - } - else { + } else { print ''; print ''; } @@ -1193,8 +1170,7 @@ else { print '
'.$langs->trans("CreateSurveyDate").'
'; print $langs->trans("None"); print '
'; print $langs->trans("None"); print '
'."\n"; print img_picto($langs->trans("Activated"), 'switch_on'); print "'; @@ -397,8 +388,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -468,8 +458,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'.$langs->trans("PricingRule").''.$form->textwithpicto($langs->trans("PricingRule"), $langs->trans("SamePriceAlsoForSharedCompanies"), 1).''; @@ -605,8 +591,7 @@ if (empty($conf->use_javascript_ajax)) print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; $arrval = array( '0'=>$langs->trans("No"), @@ -730,8 +715,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) print img_picto($langs->trans("Active"), 'tick'); print ''; print ''.$langs->trans("Disable").''; - } - else { + } else { print ' '; print ''.$langs->trans("Activate").''; } @@ -742,8 +726,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) } closedir($handle); } - } - else { + } else { setEventMessages($dir.' '.$langs->trans("IsNotADir"), null, 'errors'); } } diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 7814c3bcda8..1e67a1d469a 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -65,8 +65,7 @@ if (empty($conf->product->enabled)) { $title = $langs->trans('ServiceSetup'); $textobject = $langs->trans('Services'); -} -elseif (empty($conf->service->enabled)) +} elseif (empty($conf->service->enabled)) { $title = $langs->trans('ProductSetup'); $textobject = $langs->trans('Products'); diff --git a/htdocs/product/admin/product_supplier_extrafields.php b/htdocs/product/admin/product_supplier_extrafields.php index d35e6012e1f..b400843ab5c 100644 --- a/htdocs/product/admin/product_supplier_extrafields.php +++ b/htdocs/product/admin/product_supplier_extrafields.php @@ -66,8 +66,7 @@ if (empty($conf->product->enabled)) { $title = $langs->trans('ServiceSetup'); $textobject = $langs->trans('Services'); -} -elseif (empty($conf->service->enabled)) +} elseif (empty($conf->service->enabled)) { $title = $langs->trans('ProductSetup'); $textobject = $langs->trans('Products'); diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index 898d23ae8fb..ce7bcf733a5 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -120,8 +120,7 @@ if ($action == 'convert') { $newprice = price2num($objectstatic->multiprices_ttc[$level], 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) $newminprice = $objectstatic->multiprices_min_ttc[$level]; - } - else { + } else { $newprice = price2num($objectstatic->multiprices[$level], 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) $newminprice = $objectstatic->multiprices_min[$level]; } @@ -150,8 +149,7 @@ if ($action == 'convert') { $newprice = price2num($objectstatic->price_ttc, 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) $newminprice = $objectstatic->price_min_ttc; - } - else { + } else { $newprice = price2num($objectstatic->price, 'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) $newminprice = $objectstatic->price_min; } @@ -174,8 +172,7 @@ if ($action == 'convert') $i++; } - } - else dol_print_error($db); + } else dol_print_error($db); } $fourn = new Fournisseur($db); @@ -243,14 +240,12 @@ if ($action == 'convert') $i++; } - } - else dol_print_error($db); + } else dol_print_error($db); if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } @@ -259,8 +254,7 @@ if ($action == 'convert') { if ($nbrecordsmodified > 0) setEventMessages($langs->trans("RecordsModified", $nbrecordsmodified), null, 'mesgs'); else setEventMessages($langs->trans("NoRecordFound"), null, 'warnings'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -285,8 +279,7 @@ if (empty($mysoc->country_code)) $langs->load("errors"); $warnpicto = img_error($langs->trans("WarningMandatorySetupNotComplete")); print '
'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").''; -} -else { +} else { print '
'; print ''; print ''; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 3d0dc302283..acd698d9f37 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -40,8 +40,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 219e68171d2..f206d868347 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -162,8 +162,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) } echo json_encode($outjson); -} -else { +} else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $langs->loadLangs(array("main", "products")); diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index da99efc337d..c14bfaf5e74 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -287,8 +287,7 @@ class ActionsCardProduct $i++; } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db, $sql); } } @@ -406,14 +405,12 @@ class ActionsCardProduct $this->type = $obj->fk_product_type; $this->entity = $obj->entity; $datas[$alias] = $this->getNomUrl(1, '', 24); - } - elseif ($alias == 'stock') + } elseif ($alias == 'stock') { $this->load_stock(); if ($this->stock_reel < $obj->seuil_stock_alerte) $datas[$alias] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow")); else $datas[$alias] = $this->stock_reel; - } - elseif ($alias == 'label') $datas[$alias] = dol_trunc($obj->$alias, 40); + } elseif ($alias == 'label') $datas[$alias] = dol_trunc($obj->$alias, 40); elseif (preg_match('/price/i', $alias)) $datas[$alias] = price($obj->$alias); elseif ($alias == 'datem') $datas[$alias] = dol_print_date($this->db->jdate($obj->$alias), 'day'); elseif ($alias == 'status') $datas[$alias] = $this->LibStatut($obj->$alias, 5); @@ -426,8 +423,7 @@ class ActionsCardProduct $i++; } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index aaf9b584068..0518cfed475 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -205,8 +205,7 @@ class ActionsCardService if ($this->object->duration_value > 1) { $dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); - } - elseif ($this->object->duration_value > 0) + } elseif ($this->object->duration_value > 0) { $dur = array("h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } @@ -267,8 +266,7 @@ class ActionsCardService $i++; } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db, $sql); } } @@ -359,8 +357,7 @@ class ActionsCardService $i++; } $this->db->free($resql); - } - else { + } else { print $sql; } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index bd18737bd6b..657add84bd1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -174,8 +174,7 @@ if (empty($reshook)) $result = $object->setValueFrom('barcode', GETPOST('barcode'), '', null, 'text', '', $user, 'PRODUCT_MODIFY'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { $langs->load("errors"); if ($result == -1) $errors[] = 'ErrorBadBarCodeSyntax'; elseif ($result == -2) $errors[] = 'ErrorBarCodeRequired'; @@ -336,8 +335,7 @@ if (empty($reshook)) { $object->multiprices["$i"] = price2num($_POST["price_".$i], 'MU'); $object->multiprices_base_type["$i"] = $_POST["multiprices_base_type_".$i]; - } - else { + } else { $object->multiprices["$i"] = ""; } } @@ -364,13 +362,11 @@ if (empty($reshook)) if (preg_match('/\?/', $backtopage)) $backtopage .= '&socid='.$object->id; // Old method header("Location: ".$backtopage); exit; - } - else { + } else { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } - else { + } else { if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors'); $action = "create"; @@ -384,8 +380,7 @@ if (empty($reshook)) if (GETPOST('cancel', 'alpha')) { $action = ''; - } - else { + } else { if ($object->id > 0) { $object->oldcopy = clone $object; @@ -481,14 +476,12 @@ if (empty($reshook)) $object->setCategories($categories); $action = 'view'; - } - else { + } else { if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors'); $action = 'edit'; } - } - else { + } else { if (count($object->errors)) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans("ErrorProductBadRefOrLabel"), null, 'errors'); $action = 'edit'; @@ -504,8 +497,7 @@ if (empty($reshook)) if (!GETPOST('clone_content') && !GETPOST('clone_prices')) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); - } - else { + } else { $db->begin(); $originalId = $id; @@ -567,8 +559,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } - else { + } else { $id = $originalId; if ($object->error == 'ErrorProductAlreadyExists') @@ -582,15 +573,13 @@ if (empty($reshook)) $mesg .= ' '.$langs->trans("ShowCardHere").'.'; setEventMessages($mesg, null, 'errors'); $object->fetch($id); - } - else { + } else { $db->rollback(); if (count($object->errors)) { setEventMessages($object->error, $object->errors, 'errors'); dol_print_error($db, $object->errors); - } - else { + } else { setEventMessages($langs->trans($object->error), null, 'errors'); dol_print_error($db, $object->error); } @@ -599,8 +588,7 @@ if (empty($reshook)) unset($object->context['createfromclone']); } - } - else { + } else { $db->rollback(); dol_print_error($db, $object->error); } @@ -617,8 +605,7 @@ if (empty($reshook)) { header('Location: '.DOL_URL_ROOT.'/product/list.php?type='.$object->type.'&delprod='.urlencode($object->ref)); exit; - } - else { + } else { setEventMessages($langs->trans($object->error), null, 'errors'); $reload = 0; $action = ''; @@ -640,8 +627,7 @@ if (empty($reshook)) exit; } $thirpdartyid = $propal->socid; - } - elseif (GETPOST('commandeid') > 0) + } elseif (GETPOST('commandeid') > 0) { $commande = new Commande($db); $result = $commande->fetch(GETPOST('commandeid')); @@ -651,8 +637,7 @@ if (empty($reshook)) exit; } $thirpdartyid = $commande->socid; - } - elseif (GETPOST('factureid') > 0) + } elseif (GETPOST('factureid') > 0) { $facture = new Facture($db); $result = $facture->fetch(GETPOST('factureid')); @@ -727,8 +712,7 @@ if (empty($reshook)) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); - } - else { + } else { $buyprice = $result; } @@ -769,8 +753,7 @@ if (empty($reshook)) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); - } - else { + } else { $buyprice = $result; } @@ -811,8 +794,7 @@ if (empty($reshook)) { dol_syslog($langs->trans('FailedToGetCostPrice')); setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); - } - else { + } else { $buyprice = $result; } @@ -852,8 +834,7 @@ if (empty($reshook)) exit; } } - } - else { + } else { $action = ""; setEventMessages($langs->trans("WarningSelectOneDocument"), null, 'warnings'); } @@ -918,8 +899,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template -} -else { +} else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -955,8 +935,7 @@ else { if ($type == 1) { $picto = 'service'; $title = $langs->trans("NewService"); - } - else { + } else { $picto = 'product'; $title = $langs->trans("NewProduct"); } @@ -1010,8 +989,7 @@ else { if (isset($_POST['fk_barcode_type'])) { $fk_barcode_type = GETPOST('fk_barcode_type'); - } - else { + } else { if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; @@ -1059,8 +1037,7 @@ else { print '
'.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).''; print ''; print '
'; print '
'; - } - else { + } else { print ''; // Price @@ -1298,8 +1274,7 @@ else { } print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, ''); print ''; - } - else // For external software + } else // For external software { // Accountancy_code_sell print ''; @@ -1348,14 +1323,10 @@ else { print ''; print ''; - } - - /* - * Product card - */ - - elseif ($object->id > 0) - { + } elseif ($object->id > 0) { + /* + * Product card + */ // Fiche en mode edition if ($action == 'edit' && $usercancreate) { @@ -1393,8 +1364,7 @@ else { { print ''; print ''; - } - else { + } else { print ''; print ''; } @@ -1408,8 +1378,7 @@ else { { print ''; print ''; - } - else { + } else { print ''; print ''; } @@ -1438,8 +1407,7 @@ else { if (isset($_POST['fk_barcode_type'])) { $fk_barcode_type = GETPOST('fk_barcode_type'); - } - else { + } else { $fk_barcode_type = $object->barcode_type; if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; } @@ -1500,8 +1468,7 @@ else { print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); print ''; - } - else { + } else { // Nature print ''; - } - else // For external software - { + } else { + // For external software // Accountancy_code_sell print ''; print ''."\n"; @@ -1974,16 +1938,14 @@ else { if ($object->duration_value > 1) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); - } - elseif ($object->duration_value > 0) + } elseif ($object->duration_value > 0) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." "; print ''; - } - else { + } else { // Nature print '\n"; @@ -2010,8 +1971,7 @@ else { if ($object->width) print " x ".$object->width; if ($object->height) print " x ".$object->height; print ' '.measuringUnitString(0, "size", $object->length_units); - } - else { + } else { print ' '; } print "\n"; @@ -2023,8 +1983,7 @@ else { if ($object->surface != '') { print $object->surface." ".measuringUnitString(0, "surface", $object->surface_units); - } - else { + } else { print ' '; } print "\n"; @@ -2036,8 +1995,7 @@ else { if ($object->volume != '') { print $object->volume." ".measuringUnitString(0, "volume", $object->volume_units); - } - else { + } else { print ' '; } print "\n"; @@ -2050,8 +2008,7 @@ else { if ($object->net_measure != '') { print $object->net_measure." ".measuringUnitString($object->net_measure_units); - } - else { + } else { print ' '; } } @@ -2105,8 +2062,7 @@ else { dol_fiche_end(); } - } - elseif ($action != 'create') + } elseif ($action != 'create') { exit; } @@ -2179,8 +2135,7 @@ if ($action != 'create' && $action != 'edit') if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { print ''.$langs->trans('ToClone').''."\n"; - } - else { + } else { print 'id.'">'.$langs->trans("ToClone").''; } } @@ -2194,16 +2149,13 @@ if ($action != 'create' && $action != 'edit') if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { print ''.$langs->trans('Delete').''."\n"; - } - else { + } else { print 'id.'">'.$langs->trans("Delete").''; } - } - else { + } else { print ''.$langs->trans("Delete").''; } - } - else { + } else { print ''.$langs->trans("Delete").''; } } @@ -2236,8 +2188,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == $html .= $langs->trans("AddToDraftProposals").''; - } - else { + } else { $html .= ''; - } - else { + } else { $html .= ''; - } - else { + } else { $html .= ''; @@ -241,8 +235,7 @@ if ($id > 0 || !empty($ref)) if ($object->price_base_type == 'TTC') { print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type); - } - else { + } else { print price($object->price_min).' '.$langs->trans($object->price_base_type ? $object->price_base_type : 'HT'); } print ''; @@ -292,8 +285,7 @@ if ($id > 0 || !empty($ref)) print ''; print ''; } - } - else { + } else { print ''; print ''; print ''; @@ -370,8 +362,7 @@ if ($id > 0 || !empty($ref)) if (!empty($conf->global->PRODUIT_MULTIPRICES)) { $pricesell = 'Variable'; - } - else { + } else { $totallinesell = price2num($value['nb'] * ($pricesell), 'MT'); $totalsell += $totallinesell; } @@ -389,15 +380,13 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - } - else { + } else { print ''; print ''; } print ''."\n"; - } - else { + } else { $hide = ''; if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide = ' hideobject'; // By default, we do not show this. It makes screen very difficult to understand @@ -459,8 +448,7 @@ if ($id > 0 || !empty($ref)) } print ''; print ''."\n"; - } - else { + } else { $colspan = 8; if (!empty($conf->stock->enabled)) $colspan++; @@ -589,8 +577,7 @@ if ($id > 0 || !empty($ref)) //$addchecked = ' checked'; $qty = $object->is_sousproduit_qty; $incdec = $object->is_sousproduit_incdec; - } - else { + } else { //$addchecked = ''; $qty = 0; $incdec = 0; @@ -623,8 +610,7 @@ if ($id > 0 || !empty($ref)) print ''; print ''; } - } - else { + } else { dol_print_error($db); } print '
'.$langs->trans("ProductAccountancySellCode").'
'.$langs->trans("Nature").''; $statutarray = array('-1'=>' ', '1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); @@ -1656,9 +1623,8 @@ else { print ''; print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1); print '
'.$langs->trans("ProductAccountancySellCode").''; @@ -1763,8 +1729,7 @@ else { if ($action == 'editbarcodetype') { print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type'); - } - else { + } else { $object->fetch_barcode(); print $object->barcode_type_label ? $object->barcode_type_label : ($object->barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); } @@ -1790,8 +1755,7 @@ else { print ''; print ' '; print ''; - } - else { + } else { print $object->barcode; } print '
'.$langs->trans("Nature").''; print $object->getLibFinished(); @@ -1994,8 +1956,7 @@ else { if ($object->weight != '') { print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); - } - else { + } else { print ' '; } print "
'; $html .= $form->selectarray("propalid", $otherprop, 0, 1); $html .= '
'; $html .= $langs->trans("AddToDraftProposals").''; $html .= $langs->trans("NoDraftProposals"); @@ -2259,8 +2210,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == $html .= $langs->trans("AddToDraftOrders").''; $html .= $form->selectarray("commandeid", $othercom, 0, 1); $html .= '
'; $html .= $langs->trans("AddToDraftOrders").''; $html .= $langs->trans("NoDraftOrders"); @@ -2282,8 +2232,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == $html .= $langs->trans("AddToDraftInvoices").''; $html .= $form->selectarray("factureid", $otherinvoice, 0, 1); $html .= '
'; $html .= $langs->trans("AddToDraftInvoices").''; $html .= $langs->trans("NoDraftInvoices"); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 66cef158439..e7fce1b480f 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -221,8 +221,7 @@ class Products extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -316,8 +315,7 @@ class Products extends DolibarrApi } if ($this->product->price_min_ttc != $oldproduct->price_min_ttc) { $pricemodified = true; } - } - else { + } else { if ($this->product->price != $oldproduct->price) { $pricemodified = true; } if ($this->product->price_min != $oldproduct->price_min) { $pricemodified = true; @@ -811,8 +809,7 @@ class Products extends DolibarrApi $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); } if (!count($obj_ret)) { diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index b38501cb788..30445615413 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -101,12 +101,10 @@ class FormProduct if (!empty($batch)) { $sql .= ", pb.qty as stock"; - } - else { + } else { $sql .= ", ps.reel as stock"; } - } - elseif ($sumStock) + } elseif ($sumStock) { $sql .= ", sum(ps.reel) as stock"; } @@ -124,8 +122,7 @@ class FormProduct if (count($warehouseStatus)) { $sql .= " AND e.statut IN (".$this->db->escape(implode(',', $warehouseStatus)).")"; - } - else { + } else { $sql .= " AND e.statut = 1"; } @@ -176,8 +173,7 @@ class FormProduct } return $num; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -267,8 +263,7 @@ class FormProduct { if ($arraytypes['stock'] <= 0) { $label .= ' ('.$langs->trans("Stock").':'.$arraytypes['stock'].')'; - } - else { + } else { $label .= ' ('.$langs->trans("Stock").':'.$arraytypes['stock'].')'; } } @@ -432,8 +427,7 @@ class FormProduct if (!is_array($objectLines) || !count($objectLines)) { if (!empty($fk_product)) $productIdArray[] = $fk_product; - } - else { + } else { foreach ($objectLines as $line) { if ($line->fk_product) $productIdArray[] = $line->fk_product; } @@ -453,8 +447,7 @@ class FormProduct if (!empty($fk_product)) { $productIdArray = array($fk_product); // only show lot stock for product - } - else { + } else { foreach ($this->cache_lot as $key => $value) { $productIdArray[] = $key; @@ -471,8 +464,7 @@ class FormProduct $label .= $arraytypes['batch']; if ($arraytypes['qty'] <= 0) { $label .= ' ('.$langs->trans("Stock").' '.$arraytypes['qty'].')'; - } - else { + } else { $label .= ' ('.$langs->trans("Stock").' '.$arraytypes['qty'].')'; } @@ -520,8 +512,7 @@ class FormProduct if ($cacheLoaded) { return count($this->cache_lot); - } - else { + } else { // clear cache $this->cache_lot = array(); $productIdList = implode(',', $productIdArray); @@ -553,8 +544,7 @@ class FormProduct } return $num; - } - else { + } else { dol_print_error($this->db); return -1; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f072d04916e..6e559c3e7fb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -456,8 +456,7 @@ class Product extends CommonObject if ($err > 0) { return 0; - } - else { + } else { return 1; } } @@ -681,30 +680,25 @@ class Product extends CommonObject if ($this->update($id, $user, true, 'add') <= 0) { $error++; } - } - else { + } else { $error++; $this->error = $this->db->lasterror(); } - } - else { + } else { $error++; $this->error = 'ErrorFailedToGetInsertedId'; } - } - else { + } else { $error++; $this->error = $this->db->lasterror(); } - } - else { + } else { // Product already exists with this ref $langs->load("products"); $error++; $this->error = "ErrorProductAlreadyExists"; } - } - else { + } else { $error++; $this->error = $this->db->lasterror(); } @@ -720,13 +714,11 @@ class Product extends CommonObject if (!$error) { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -$error; } - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::Create fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -756,11 +748,9 @@ class Product extends CommonObject if ($rescode) { if ($rescode == -1) { $this->errors[] = 'ErrorBadBarCodeSyntax'; - } - elseif ($rescode == -2) { + } elseif ($rescode == -2) { $this->errors[] = 'ErrorBarCodeRequired'; - } - elseif ($rescode == -3) { + } elseif ($rescode == -3) { // Note: Common usage is to have barcode unique. For variants, we should have a different barcode. $this->errors[] = 'ErrorBarCodeAlreadyUsed'; } @@ -802,8 +792,7 @@ class Product extends CommonObject dol_syslog(get_class($this)."::check_barcode value=".$valuetotest." type=".$typefortest." module=".$module); $result = $mod->verif($this->db, $valuetotest, $this, 0, $typefortest); return $result; - } - else { + } else { return 0; } } @@ -1094,13 +1083,11 @@ class Product extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -$error; } - } - else { + } else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); if (empty($conf->barcode->enabled) || empty($this->barcode)) { @@ -1111,16 +1098,14 @@ class Product extends CommonObject $this->errors[] = $this->error; $this->db->rollback(); return -1; - } - else { + } else { $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; $this->errors[] = $this->error; $this->db->rollback(); return -2; } } - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::Update fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1267,8 +1252,7 @@ class Product extends CommonObject if (!$error) { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -1277,8 +1261,7 @@ class Product extends CommonObject $this->db->rollback(); return -$error; } - } - else { + } else { $this->error = "ErrorRecordIsUsedCantDelete"; return 0; } @@ -1316,8 +1299,7 @@ class Product extends CommonObject if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note='".$this->db->escape($this->other)."'"; } $sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'"; - } - else { + } else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_lang (fk_product, lang, label, description"; if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note"; } @@ -1334,8 +1316,7 @@ class Product extends CommonObject $this->error = $this->db->lasterror(); return -1; } - } - elseif (isset($this->multilangs[$key])) { + } elseif (isset($this->multilangs[$key])) { $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " WHERE fk_product=".$this->id; @@ -1353,8 +1334,7 @@ class Product extends CommonObject $sql2 .= ", note='".$this->db->escape($this->multilangs["$key"]["other"])."'"; } $sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'"; - } - else { + } else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_lang (fk_product, lang, label, description"; if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note"; } @@ -1374,8 +1354,7 @@ class Product extends CommonObject return -1; } } - } - else { + } else { // language is not current language and we didn't provide a multilang description for this language } } @@ -1416,8 +1395,7 @@ class Product extends CommonObject } // End call triggers return 1; - } - else { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR); return -1; @@ -1478,8 +1456,7 @@ class Product extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1517,8 +1494,7 @@ class Product extends CommonObject $this->multilangs["$obj->lang"]["other"] = $obj->other; } return 1; - } - else { + } else { $this->error = "Error: ".$this->db->lasterror()." - ".$sql; return -1; } @@ -1559,8 +1535,7 @@ class Product extends CommonObject $this->error = $this->db->lasterror(); dol_print_error($this->db); return -1; - } - else { + } else { return 1; } } @@ -1586,8 +1561,7 @@ class Product extends CommonObject $resql = $this->db->query($sql); if ($resql) { return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -1663,8 +1637,7 @@ class Product extends CommonObject if ($priceforthequantityarray['price_base_type'] == 'HT') { $pu_ht = $priceforthequantityarray['unitprice']; - } - else { + } else { $pu_ttc = $priceforthequantityarray['unitprice']; } break; @@ -1683,8 +1656,7 @@ class Product extends CommonObject if ($priceforthequantityarray['price_base_type'] == 'HT') { $pu_ht = $priceforthequantityarray['unitprice']; - } - else { + } else { $pu_ttc = $priceforthequantityarray['unitprice']; } break; @@ -1766,8 +1738,7 @@ class Product extends CommonObject if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging; $result = $obj->fk_product; return $result; - } - else // If not found + } else // If not found { // We do a second search by doing a select again but searching with less reliable criteria: couple qty/id product, and if set fourn_ref or fk_soc. $sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.fk_soc,"; @@ -1826,18 +1797,15 @@ class Product extends CommonObject if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) $this->packaging = $obj->packaging; $result = $obj->fk_product; return $result; - } - else { + } else { return -1; // Ce produit n'existe pas avec cet id tarif fournisseur ou existe mais qte insuffisante, ni pour le couple produit/ref fournisseur dans la quantité. } - } - else { + } else { $this->error = $this->db->lasterror(); return -3; } } - } - else { + } else { $this->error = $this->db->lasterror(); return -2; } @@ -1908,13 +1876,11 @@ class Product extends CommonObject $price_min_ttc = price2num($newminprice, 'MU'); $price_min = price2num($newminprice) / (1 + ($newvat / 100)); $price_min = price2num($price_min, 'MU'); - } - else { + } else { $price_min = 0; $price_min_ttc = 0; } - } - else { + } else { $price = price2num($newprice, 'MU'); $price_ttc = ($newnpr != 1) ? price2num($newprice) * (1 + ($newvat / 100)) : $price; $price_ttc = price2num($price_ttc, 'MU'); @@ -1924,8 +1890,7 @@ class Product extends CommonObject $price_min_ttc = price2num($newminprice) * (1 + ($newvat / 100)); $price_min_ttc = price2num($price_min_ttc, 'MU'); //print 'X'.$newminprice.'-'.$price_min; - } - else { + } else { $price_min = 0; $price_min_ttc = 0; } @@ -1937,8 +1902,7 @@ class Product extends CommonObject $localtax1 = $localtaxes_array['1']; $localtaxtype2 = $localtaxes_array['2']; $localtax2 = $localtaxes_array['3']; - } - else // old method. deprecated because ot can't retreive type + } else // old method. deprecated because ot can't retreive type { $localtaxtype1 = '0'; $localtax1 = get_localtax($newvat, 1); @@ -2013,8 +1977,7 @@ class Product extends CommonObject // End call triggers $this->db->commit(); - } - else { + } else { $this->db->rollback(); dol_print_error($this->db); } @@ -2248,18 +2211,15 @@ class Product extends CommonObject return -1; } }*/ - } - else { + } else { dol_print_error($this->db); return -1; } } - } - elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && empty($ignore_price_load)) // prices per customers + } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && empty($ignore_price_load)) // prices per customers { // Nothing loaded by default. List may be very long. - } - elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) && empty($ignore_price_load)) // prices per quantity + } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) && empty($ignore_price_load)) // prices per quantity { $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid"; @@ -2296,19 +2256,16 @@ class Product extends CommonObject $ii++; } $this->prices_by_qty_list[0] = $resultat; - } - else { + } else { dol_print_error($this->db); return -1; } } - } - else { + } else { dol_print_error($this->db); return -1; } - } - elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES) && empty($ignore_price_load)) // prices per customer and quantity + } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES) && empty($ignore_price_load)) // prices per customer and quantity { for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { @@ -2358,14 +2315,12 @@ class Product extends CommonObject $ii++; } $this->prices_by_qty_list[$i] = $resultat; - } - else { + } else { dol_print_error($this->db); return -1; } } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2389,12 +2344,10 @@ class Product extends CommonObject $this->stock_warehouse = array(); return 1; - } - else { + } else { return 0; } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2467,8 +2420,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_propale = $hookmanager->resArray['stats_propale']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2517,8 +2469,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_proposal_supplier = $hookmanager->resArray['stats_proposal_supplier']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2619,8 +2570,7 @@ class Product extends CommonObject $reshook = $hookmanager->executeHooks('loadStatsCustomerOrder', $parameters, $this, $action); if ($reshook > 0) $this->stats_commande = $hookmanager->resArray['stats_commande']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2675,8 +2625,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_commande_fournisseur = $hookmanager->resArray['stats_commande_fournisseur']; return 1; - } - else { + } else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -2758,8 +2707,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_expedition = $hookmanager->resArray['stats_expedition']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2810,8 +2758,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_reception = $hookmanager->resArray['stats_reception']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2900,8 +2847,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_mrptoproduce = $hookmanager->resArray['stats_mrptoproduce']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2973,8 +2919,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_contrat = $hookmanager->resArray['stats_contrat']; return 1; - } - else { + } else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -3046,8 +2991,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_facture = $hookmanager->resArray['stats_facture']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -3098,8 +3042,7 @@ class Product extends CommonObject if ($reshook > 0) $this->stats_facture_fournisseur = $hookmanager->resArray['stats_facture_fournisseur']; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -3132,8 +3075,7 @@ class Product extends CommonObject } $i++; } - } - else { + } else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -3141,8 +3083,7 @@ class Product extends CommonObject if (empty($year)) { $year = strftime('%Y', time()); $month = strftime('%m', time()); - } - else { + } else { $month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year. } $result = array(); @@ -3622,23 +3563,20 @@ class Product extends CommonObject if (!$this->db->query($sql)) { dol_print_error($this->db); return -1; - } - else { + } else { $result = $this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); if ($num > 0) { $this->error = "isFatherOfThis"; return -1; - } - else { + } else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec)'; $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.', '.$incdec.')'; if (!$this->db->query($sql)) { dol_print_error($this->db); return -1; - } - else { + } else { return 1; } } @@ -3681,8 +3619,7 @@ class Product extends CommonObject if (!$this->db->query($sql)) { dol_print_error($this->db); return -1; - } - else { + } else { return 1; } } @@ -3744,12 +3681,10 @@ class Product extends CommonObject $this->is_sousproduit_incdec = $obj->incdec; return true; - } - else { + } else { return false; } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -3838,8 +3773,7 @@ class Product extends CommonObject if ($this->db->query($sql)) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -3849,8 +3783,7 @@ class Product extends CommonObject $this->product_fourn_price_id = $obj->rowid; return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); return -2; } @@ -4045,8 +3978,7 @@ class Product extends CommonObject if (!$resql) { $this->db->rollback(); return -1; - } - else { + } else { $this->db->commit(); return 1; } @@ -4156,8 +4088,7 @@ class Product extends CommonObject $obj = $this->db->fetch_object($resql); if ($obj) { $nb = $obj->nb; } - } - else { + } else { return -1; } @@ -4241,8 +4172,7 @@ class Product extends CommonObject $prods[$record['id']]['entity'] = $record['entity']; } return $prods; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -4305,8 +4235,7 @@ class Product extends CommonObject } return $prods; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -4433,8 +4362,7 @@ class Product extends CommonObject $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"'; $linkclose .= ' class="nowraponall classfortooltip"'; - } - else { + } else { $linkclose = ' class="nowraponall"'; } @@ -4508,8 +4436,7 @@ class Product extends CommonObject if (!dol_strlen($modele)) { if (!empty($conf->global->PRODUCT_ADDON_PDF)) { $modele = $conf->global->PRODUCT_ADDON_PDF; - } - else { + } else { $modele = 'strato'; } } @@ -4591,27 +4518,22 @@ class Product extends CommonObject if ($type == 0) { $labelStatus = $langs->trans('ProductStatusNotOnSellShort'); $labelStatusShort = $langs->trans('ProductStatusNotOnSell'); - } - elseif ($type == 1) { + } elseif ($type == 1) { $labelStatus = $langs->trans('ProductStatusNotOnBuyShort'); $labelStatusShort = $langs->trans('ProductStatusNotOnBuy'); - } - elseif ($type == 2) { + } elseif ($type == 2) { $labelStatus = $langs->trans('ProductStatusNotOnBatch'); $labelStatusShort = $langs->trans('ProductStatusNotOnBatchShort'); } - } - elseif ($status == 1) { + } elseif ($status == 1) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" if ($type == 0) { $labelStatus = $langs->trans('ProductStatusOnSellShort'); $labelStatusShort = $langs->trans('ProductStatusOnSell'); - } - elseif ($type == 1) { + } elseif ($type == 1) { $labelStatus = $langs->trans('ProductStatusOnBuyShort'); $labelStatusShort = $langs->trans('ProductStatusOnBuy'); - } - elseif ($type == 2) { + } elseif ($type == 2) { $labelStatus = $langs->trans('ProductStatusOnBatch'); $labelStatusShort = $langs->trans('ProductStatusOnBatchShort'); } @@ -4677,8 +4599,7 @@ class Product extends CommonObject if ($result >= 0) { $this->db->commit(); return 1; - } - else { + } else { $this->error = $movementstock->error; $this->errors = $movementstock->errors; @@ -4724,8 +4645,7 @@ class Product extends CommonObject if ($result >= 0) { $this->db->commit(); return 1; - } - else { + } else { $this->error = $movementstock->error; $this->errors = $movementstock->errors; @@ -4803,8 +4723,7 @@ class Product extends CommonObject } return 1; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -4888,24 +4807,19 @@ class Product extends CommonObject // Stock decrease mode if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { $this->stock_theorique -= ($stock_commande_client - $stock_sending_client); - } - elseif (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) { + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) { $this->stock_theorique += 0; - } - elseif (!empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $this->stock_theorique -= $stock_commande_client; } // Stock Increase mode if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { $this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur); - } - elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { $this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur); - } - elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { $this->stock_theorique -= $stock_reception_fournisseur; - } - elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { + } elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { $this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur); } @@ -4949,8 +4863,7 @@ class Product extends CommonObject $i++; } return $result; - } - else { + } else { dol_print_error($this->db); $this->db->rollback(); return array(); @@ -5187,8 +5100,7 @@ class Product extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -5323,8 +5235,7 @@ class Product extends CommonObject $label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']); $this->db->free($resql); return $label; - } - else { + } else { $this->error = $this->db->error().' sql='.$sql; dol_syslog(get_class($this)."::getLabelOfUnit Error ".$this->error, LOG_ERR); return -1; @@ -5556,8 +5467,7 @@ class Product extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 3c56221863c..db59efcdfb7 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -119,8 +119,7 @@ class Productbatch extends CommonObject { $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -177,8 +176,7 @@ class Productbatch extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -230,8 +228,7 @@ class Productbatch extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -271,8 +268,7 @@ class Productbatch extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -326,8 +322,7 @@ class Productbatch extends CommonObject { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -419,8 +414,7 @@ class Productbatch extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -488,8 +482,7 @@ class Productbatch extends CommonObject $db->free($resql); return $ret; - } - else { + } else { $error = "Error ".$db->lasterror(); return -1; } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 26c627ee0e4..331708ff096 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -139,8 +139,7 @@ class Propalmergepdfproduct extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -197,8 +196,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -270,8 +268,7 @@ class Propalmergepdfproduct extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch_by_product ".$this->error, LOG_ERR); return -1; @@ -330,8 +327,7 @@ class Propalmergepdfproduct extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -372,8 +368,7 @@ class Propalmergepdfproduct extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -421,8 +416,7 @@ class Propalmergepdfproduct extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -463,8 +457,7 @@ class Propalmergepdfproduct extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -518,8 +511,7 @@ class Propalmergepdfproduct extends CommonObject { $this->db->commit(); return $object->id; - } - else { + } else { $this->db->rollback(); return -1; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 194a342d391..975dcfda831 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -80,24 +80,20 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se { //var_dump($i.' '.GETPOST("prod_id_".$i, 'int'), $qty, GETPOST("prod_incdec_".$i, 'int')); $action = 'edit'; - } - else { + } else { $error++; $action = 're-edit'; if ($object->error == "isFatherOfThis") { setEventMessages($langs->trans("ErrorAssociationIsFatherOfThis"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } - } - else { + } else { if ($object->del_sousproduit($id, GETPOST("prod_id_".$i, 'int')) > 0) { $action = 'edit'; - } - else { + } else { $error++; $action = 're-edit'; setEventMessages($object->error, $object->errors, 'errors'); @@ -110,8 +106,7 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } -} -elseif ($action === 'save_composed_product') +} elseif ($action === 'save_composed_product') { $TProduct = GETPOST('TProduct', 'array'); if (!empty($TProduct)) @@ -230,8 +225,7 @@ if ($id > 0 || !empty($ref)) if ($object->price_base_type == 'TTC') { print price($object->price_ttc).' '.$langs->trans($object->price_base_type); - } - else { + } else { print price($object->price).' '.$langs->trans($object->price_base_type ? $object->price_base_type : 'HT'); } print '
'.$value['qty'].'
'.$langs->trans("None").'
'.$nb_of_subproduct.''.($value['incdec'] == 1 ? 'x' : '').'
'; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index db233fbe84c..4f505bff187 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -313,8 +313,7 @@ if ($object->id) $filename = $filetoadd['name'].' - '.$langs->trans('Language_'.$default_lang); $checked = ' checked '; } - } - else { + } else { if (array_key_exists($filetoadd['name'], $filetomerge->lines)) { $checked = ' checked '; @@ -336,8 +335,7 @@ if ($object->id) print ''; } } -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 4f40e2b6c6f..cf498d6f998 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -123,8 +123,7 @@ class PriceExpression } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -161,12 +160,10 @@ class PriceExpression $this->title = $obj->title; $this->expression = $obj->expression; return 1; - } - else { + } else { return 0; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -202,8 +199,7 @@ class PriceExpression $this->db->free($resql); return $retarray; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -232,12 +228,10 @@ class PriceExpression if ($obj) { return (int) $obj->rowid; - } - else { + } else { return 0; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -295,8 +289,7 @@ class PriceExpression } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -352,8 +345,7 @@ class PriceExpression } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } 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 7f241518e4c..f2ab8006b02 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -128,8 +128,7 @@ class PriceGlobalVariable } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -161,12 +160,10 @@ class PriceGlobalVariable $this->value = $obj->value; $this->checkParameters(); return 1; - } - else { + } else { return 0; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -222,8 +219,7 @@ class PriceGlobalVariable } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -278,8 +274,7 @@ class PriceGlobalVariable } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -344,8 +339,7 @@ class PriceGlobalVariable $this->db->free($resql); return $retarray; - } - else { + } else { $this->error = $this->db->error(); return -1; } 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 12e497c0f2c..6706dded094 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 @@ -144,8 +144,7 @@ class PriceGlobalVariableUpdater } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -181,12 +180,10 @@ class PriceGlobalVariableUpdater $this->last_status = $obj->last_status; $this->checkParameters(); return 1; - } - else { + } else { return 0; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -246,8 +243,7 @@ class PriceGlobalVariableUpdater } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -301,8 +297,7 @@ class PriceGlobalVariableUpdater } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -394,8 +389,7 @@ class PriceGlobalVariableUpdater $this->db->free($resql); return $retarray; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -435,8 +429,7 @@ class PriceGlobalVariableUpdater $this->db->free($resql); return $retarray; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -591,8 +584,7 @@ class PriceGlobalVariableUpdater } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -636,8 +628,7 @@ class PriceGlobalVariableUpdater } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 6659dc56054..7a7dd5aac56 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -103,20 +103,16 @@ class PriceParser if (in_array($code, array(9, 14, 19, 20))) //Errors which have 0 arg { return $langs->trans("ErrorPriceExpression".$code); - } - elseif (in_array($code, array(1, 2, 3, 4, 5, 8, 10, 11, 17, 21, 22))) //Errors which have 1 arg + } elseif (in_array($code, array(1, 2, 3, 4, 5, 8, 10, 11, 17, 21, 22))) //Errors which have 1 arg { return $langs->trans("ErrorPriceExpression".$code, $info); - } - elseif (in_array($code, array(6, 23))) //Errors which have 2 args + } elseif (in_array($code, array(6, 23))) //Errors which have 2 args { return $langs->trans("ErrorPriceExpression".$code, $info[0], $info[1]); - } - elseif (in_array($code, array(7, 12, 13, 15, 16, 18))) //Internal errors + } elseif (in_array($code, array(7, 12, 13, 15, 16, 18))) //Internal errors { return $langs->trans("ErrorPriceExpressionInternal", $code); - } - else //Unknown errors + } else //Unknown errors { return $langs->trans("ErrorPriceExpressionUnknown", $code); } @@ -276,7 +272,7 @@ class PriceParser if ($res < 0) { $this->error_parser = array(25, null); return -1; - } elseif ($res == 0) { + } elseif ($res == 0) { $supplier_min_price = 0; } else { $supplier_min_price = $productFournisseur->fourn_unitprice; diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index 778f749f983..c8855b0665e 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -54,8 +54,7 @@ $price_globals = new PriceGlobalVariable($db); if (empty($eid)) //This also disables fetch when eid == 0 { $eid = 0; -} -elseif ($action != 'delete') +} elseif ($action != 'delete') { $price_expression->fetch($eid); } @@ -77,8 +76,7 @@ if ($action == 'add') $price_result = $priceparser->testExpression($id, $expression); if ($price_result < 0) { //Expression is not valid setEventMessages($priceparser->translatedError(), null, 'errors'); - } - else { + } else { $price_expression->title = $title; $price_expression->expression = $expression; $result = $price_expression->create($user); @@ -86,17 +84,14 @@ if ($action == 'add') { $eid = $price_expression->id; setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages("add: ".$price_expression->error, $price_expression->errors, 'errors'); } } - } - elseif ($result < 0) + } elseif ($result < 0) { setEventMessages("add find: ".$price_expression->error, $price_expression->errors, 'errors'); - } - else { + } else { setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); } } @@ -114,8 +109,7 @@ if ($action == 'update') $price_result = $priceparser->testExpression($id, $expression); if ($price_result < 0) { //Expression is not valid setEventMessages($priceparser->translatedError(), null, 'errors'); - } - else { + } else { $price_expression->id = $eid; $price_expression->title = $title; $price_expression->expression = $expression; @@ -123,17 +117,14 @@ if ($action == 'update') if ($result < 0) { setEventMessages("update: ".$price_expression->error, $price_expression->errors, 'errors'); - } - else { + } else { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } } - } - elseif ($result < 0) + } elseif ($result < 0) { setEventMessages("update find: ".$price_expression->error, $price_expression->errors, 'errors'); - } - else { + } else { setEventMessages($langs->trans("ErrorRecordAlreadyExists"), null, 'errors'); } } @@ -214,8 +205,7 @@ print ''.$langs->trans("Back").''; if ($eid == 0) { print '
'.$langs->trans('Delete').'
'."\n"; -} -else { +} else { print ''; } print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 3c4ebfc6acb..efcf0b33553 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -127,8 +127,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action = ''; - } - else { + } else { $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -209,8 +208,7 @@ if (empty($reshook)) $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors'); - } - else { + } else { $_POST["price"] = 0; } } @@ -253,8 +251,7 @@ if (empty($reshook)) $productLink = $object->getNomUrl(1, 'supplier'); setEventMessages($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct", $productLink), null, 'errors'); - } - elseif ($ret < 0) + } elseif ($ret < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); @@ -284,8 +281,8 @@ if (empty($reshook)) $sql .= '"'.$value.'", '; } $sql = substr($sql, 0, strlen($sql) - 2).')'; - } // else update the existing one - else { + } else { + // update the existing one $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields SET "; foreach ($extrafield_values as $key => $value) { $sql .= str_replace('options_', '', $key).' = "'.$value.'", '; @@ -313,8 +310,7 @@ if (empty($reshook)) { $error++; setEventMessages($object->error, $object->errors, 'errors'); - } - else { + } else { if (!empty($conf->dynamicprices->enabled) && $price_expression !== '') { //Check the expression validity by parsing it @@ -343,12 +339,10 @@ if (empty($reshook)) { $db->commit(); $action = ''; - } - else { + } else { $db->rollback(); } - } - else { + } else { $action = 'add_price'; } } @@ -447,8 +441,7 @@ if ($id > 0 || $ref) { $object->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price print load_fiche_titre($langs->trans("ChangeSupplierPrice")); - } - else { + } else { print load_fiche_titre($langs->trans("AddSupplierPrice")); } @@ -471,8 +464,7 @@ if ($id > 0 || $ref) print ''; print ''; print ''; - } - else { + } else { $events = array(); $events[] = array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array()); print $form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', 'fournisseur=1', 'SelectThirdParty', 0, 0, $events); @@ -495,8 +487,7 @@ if ($id > 0 || $ref) { print ''; print ''; - } - else { + } else { print ''; } print ''; @@ -520,8 +511,7 @@ if ($id > 0 || $ref) { print ''; print $object->fourn_qty; - } - else { + } else { print ''; } // Units @@ -554,8 +544,7 @@ if ($id > 0 || $ref) $tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1); $default_vat = $tmpproductsupplier->fourn_tva_tx; $default_npr = $tmpproductsupplier->fourn_tva_npr; - } - else { + } else { if (empty($default_vat)) { $default_vat = $object->tva_tx; @@ -934,8 +923,7 @@ SCRIPT; if ($usercancreate) // change required right here { print ''.$productfourn->getNomUrl().''; - } - else { + } else { print ''.$productfourn->fourn_ref.''; } @@ -1087,8 +1075,7 @@ SCRIPT; print ''; } - } - else { + } else { dol_print_error($db); } @@ -1097,8 +1084,7 @@ SCRIPT; } } } -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/product/index.php b/htdocs/product/index.php index ebe55716bae..f2a9ea98b79 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -225,8 +225,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA if ($i < $nbmax) { $dataseries[] = array($obj->label, round($obj->nb)); - } - else { + } else { $rest += $obj->nb; } $total += $obj->nb; @@ -246,8 +245,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $dolgraph->setHeight('200'); $dolgraph->draw('idstatscategproduct'); print $dolgraph->show($total ? 0 : 1); - } - else { + } else { while ($i < $num) { $obj = $db->fetch_object($result); @@ -383,8 +381,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print ''; print '
'; } - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/product/inventory/ajax/ajax.inventory.php b/htdocs/product/inventory/ajax/ajax.inventory.php index c258b63de2b..85dd488df6f 100644 --- a/htdocs/product/inventory/ajax/ajax.inventory.php +++ b/htdocs/product/inventory/ajax/ajax.inventory.php @@ -20,8 +20,7 @@ switch ($put) $res = $det->update($user); echo $det->qty_view; - } - else { + } else { echo -2; } @@ -39,8 +38,7 @@ switch ($put) $det->update($user); echo $det->new_pmp; - } - else { + } else { echo -2; } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index a5084c296a1..9f3afa55738 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -41,8 +41,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $id); -} -else { +} else { $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } @@ -79,8 +78,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $permissiontoadd = $user->rights->stock->creer; $permissiontodelete = $user->rights->stock->supprimer; -} -else { +} else { $permissiontoadd = $user->rights->stock->inventory_advance->write; $permissiontodelete = $user->rights->stock->inventory_advance->write; } @@ -334,24 +332,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { print ''.$langs->trans("Modify").''."\n"; - } - else { + } else { print ''.$langs->trans('Modify').''."\n"; } if ($permissiontoadd) { print ''.$langs->trans("Validate").''."\n"; - } - else { + } else { print ''.$langs->trans('Validate').''."\n"; } if ($permissiontodelete) { print ''.$langs->trans('Delete').''."\n"; - } - else { + } else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 381c40d0aa4..983a7a4acb9 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -371,8 +371,7 @@ class Inventory extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -465,8 +464,7 @@ class Inventory extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 373164eeae4..5261b0432b8 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -41,8 +41,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $id); -} -else { +} else { $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); } @@ -79,8 +78,7 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $permissiontoadd = $user->rights->stock->creer; $permissiontodelete = $user->rights->stock->supprimer; -} -else { +} else { $permissiontoadd = $user->rights->stock->inventory_advance->write; $permissiontodelete = $user->rights->stock->inventory_advance->write; } @@ -266,8 +264,7 @@ if ($object->id > 0) print ''; print ''; print '
'; - } - else { + } else { print '
'."\n"; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -280,8 +277,7 @@ if ($object->id > 0) if ($permissiontoadd) { print ''.$langs->trans("Edit").''."\n"; - } - else { + } else { print ''.$langs->trans('Edit').''."\n"; } } @@ -291,8 +287,7 @@ if ($object->id > 0) if ($permissiontoadd) { print ''.$langs->trans("Validate").''."\n"; - } - else { + } else { print ''.$langs->trans('Validate').''."\n"; } } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index c799ab7da87..4d451fcbeec 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -76,8 +76,7 @@ if ($user->socid > 0) // Protection if external user if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $objectid); -} -else { +} else { $result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance'); } @@ -254,8 +253,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { $num = $nbtotalofrecords; -} -else { +} else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -376,8 +374,7 @@ foreach ($object->fields as $key => $val) if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75'); elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); - } - elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; + } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; print ''; } } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 347281f0c75..e3889258df7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -291,12 +291,10 @@ if ($search_type != '' && $search_type != '-1') if ($search_type == 1) { $texte = $langs->trans("Services"); - } - else { + } else { $texte = $langs->trans("Products"); } -} -else { +} else { $texte = $langs->trans("ProductsAndServices"); } @@ -450,8 +448,7 @@ if ($resql) if ($search_type == 0) { $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; - } - elseif ($search_type == 1) + } elseif ($search_type == 1) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } @@ -1058,15 +1055,13 @@ if ($resql) if ((float) $duration_value > 1) { $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); - } - elseif ((float) $duration_value > 0) + } elseif ((float) $duration_value > 0) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } print $duration_value; print ((!empty($duration_unit) && isset($dur[$duration_unit]) && $duration_value != '') ? ' '.$langs->trans($dur[$duration_unit]) : ''); - } - elseif (!preg_match('/^[a-z]$/i', $obj->duration)) // If duration is a simple char (like 's' of 'm'), we do not show value + } elseif (!preg_match('/^[a-z]$/i', $obj->duration)) // If duration is a simple char (like 's' of 'm'), we do not show value { print $obj->duration; } @@ -1213,8 +1208,7 @@ if ($resql) { $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1); print $form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext); - } - else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); + } else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); } } } @@ -1408,8 +1402,7 @@ if ($resql) print ""; print "
"; print ''; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/product/popucom.php b/htdocs/product/popucom.php index c21afa711e7..a0ee53a5758 100644 --- a/htdocs/product/popucom.php +++ b/htdocs/product/popucom.php @@ -62,12 +62,10 @@ $helpurl = ''; if ($type == '0') { $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -} -elseif ($type == '1') +} elseif ($type == '1') { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; -} -else { +} else { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } $title = $langs->trans("Statistics"); @@ -151,8 +149,7 @@ if ($resql) $i++; } $db->free($resql); -} -else { +} else { dol_print_error($db); } //var_dump($infoprod); diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 92de8b33546..b48afc6d162 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -62,12 +62,10 @@ $helpurl = ''; if ($type == '0') { $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -} -elseif ($type == '1') +} elseif ($type == '1') { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; -} -else { +} else { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } $title = $langs->trans("Statistics"); @@ -151,8 +149,7 @@ if ($resql) $i++; } $db->free($resql); -} -else { +} else { dol_print_error($db); } //var_dump($infoprod); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1db2219bf63..2c1bc26d092 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -169,8 +169,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } @@ -274,8 +273,7 @@ if (empty($reshook)) break; } } - } - elseif (!$error) + } elseif (!$error) { $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' @@ -765,8 +763,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ echo vatrate($positiverates.($object->default_vat_code ? ' ('.$object->default_vat_code.')' : ''), '%', $object->tva_npr); //print vatrate($object->multiprices_tva_tx[$soc->price_level], true); print ''; - } - else { + } else { // TVA print ''.$langs->trans("DefaultTaxRate").''; @@ -784,16 +781,14 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ else print vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true);*/ print ''; } - } - else { + } else { if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility { // We show only vat for level 1 print ''.$langs->trans("DefaultTaxRate").''; print ''.vatrate($object->multiprices_tva_tx[1], true).''; print ''; - } - else { + } else { // TVA print ''.$langs->trans("DefaultTaxRate").''; @@ -841,8 +836,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ print ''; print ' '; print ''; - } - else { + } else { print $langs->trans("SellingPrice").' '.$i; if (!empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); } @@ -866,8 +860,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ if ($object->multiprices_base_type[$i] == 'TTC') { print price($object->multiprices_min_ttc[$i]).' '.$langs->trans($object->multiprices_base_type[$i]); - } - else { + } else { print price($object->multiprices_min[$i]).' '.$langs->trans($object->multiprices_base_type[$i]); } print ''; @@ -947,8 +940,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ } } } -} -else { +} else { // TVA print ''.$langs->trans("DefaultTaxRate").''; @@ -990,8 +982,7 @@ else { print ''.$langs->trans("PriceByQuantity"); if ($object->prices_by_qty[0] == 0) { print '  ('.$langs->trans("Activate").')'; - } - else { + } else { print '  ('.$langs->trans("DisablePriceByQty").')'; } print ''; @@ -1280,8 +1271,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) print ''; print '
'; - } - else { + } else { print ''."\n"; ?> '; -} -elseif ($object->id > 0) +} elseif ($object->id > 0) { /* * Show or edit @@ -885,8 +874,7 @@ elseif ($object->id > 0) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); - } - else print $text; + } else print $text; print ''; } @@ -974,8 +962,7 @@ elseif ($object->id > 0) } print ''; - } - else { + } else { dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); // Project card @@ -1228,8 +1215,7 @@ elseif ($object->id > 0) if ($userWrite > 0) { print '
'.$langs->trans("Modify").''; - } - else { + } else { print ''.$langs->trans('Modify').''; } } @@ -1240,8 +1226,7 @@ elseif ($object->id > 0) if ($userWrite > 0) { print ''.$langs->trans("Validate").''; - } - else { + } else { print ''.$langs->trans('Validate').''; } } @@ -1252,8 +1237,7 @@ elseif ($object->id > 0) if ($userWrite > 0) { print ''.$langs->trans("Close").''; - } - else { + } else { print ''.$langs->trans('Close').''; } } @@ -1264,8 +1248,7 @@ elseif ($object->id > 0) if ($userWrite > 0) { print ''.$langs->trans("ReOpen").''; - } - else { + } else { print ''.$langs->trans('ReOpen').''; } } @@ -1331,8 +1314,7 @@ elseif ($object->id > 0) if ($userWrite > 0) { print ''.$langs->trans('ToClone').''; - } - else { + } else { print ''.$langs->trans('ToClone').''; } } @@ -1343,8 +1325,7 @@ elseif ($object->id > 0) if ($userDelete > 0 || ($object->statut == 0 && $user->rights->projet->creer)) { print ''.$langs->trans("Delete").''; - } - else { + } else { print ''.$langs->trans('Delete').''; } } @@ -1401,8 +1382,7 @@ elseif ($object->id > 0) // Hook to add more things on page $parameters = array(); $reshook = $hookmanager->executeHooks('mainCardTabAddMore', $parameters, $object, $action); // Note that $action and $object may have been modified by hook -} -else { +} else { print $langs->trans("RecordNotFound"); } diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 77feddb91bd..5ef21879c7f 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -171,8 +171,7 @@ class Projects extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve project list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -452,8 +451,7 @@ class Projects extends DolibarrApi if ($this->project->update(DolibarrApiAccess::$user) >= 0) { return $this->get($id); - } - else { + } else { throw new RestException(500, $this->project->error); } } diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 1a16d9ce199..084292d0727 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -173,8 +173,7 @@ class Tasks extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve task list : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -450,8 +449,7 @@ class Tasks extends DolibarrApi if ($this->task->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); - } - else { + } else { throw new RestException(500, $this->task->error); } } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 8337a625415..7389af9083c 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -306,8 +306,7 @@ class Project extends CommonObject if ($result < 0) { $error++; } // End call triggers } - } - else { + } else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); $error++; @@ -332,8 +331,7 @@ class Project extends CommonObject { $this->db->commit(); return $ret; - } - else { + } else { $this->db->rollback(); return -1; } @@ -439,27 +437,23 @@ class Project extends CommonObject { $this->db->commit(); $result = 1; - } - else { + } else { $this->db->rollback(); $result = -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; $this->db->rollback(); if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $result = -4; - } - else { + } else { $result = -2; } dol_syslog(get_class($this)."::update error ".$result." ".$this->error, LOG_ERR); } - } - else { + } else { dol_syslog(get_class($this)."::update ref null"); $result = -1; } @@ -487,8 +481,7 @@ class Project extends CommonObject if (!empty($id)) { $sql .= " WHERE rowid=".$id; - } - elseif (!empty($ref)) + } elseif (!empty($ref)) { $sql .= " WHERE ref='".$this->db->escape($ref)."'"; $sql .= " AND entity IN (".getEntity('project').")"; @@ -547,8 +540,7 @@ class Project extends CommonObject $this->db->free($resql); return 0; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -578,35 +570,28 @@ class Project extends CommonObject if ($type == 'agenda') { $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project IN (".$ids.") AND entity IN (".getEntity('agenda').")"; - } - elseif ($type == 'expensereport') + } elseif ($type == 'expensereport') { $sql = "SELECT ed.rowid FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND e.entity IN (".getEntity('expensereport').") AND ed.fk_projet IN (".$ids.")"; - } - elseif ($type == 'project_task') + } elseif ($type == 'project_task') { $sql = "SELECT DISTINCT pt.rowid FROM ".MAIN_DB_PREFIX."projet_task as pt WHERE pt.fk_projet IN (".$ids.")"; - } - elseif ($type == 'project_task_time') // Case we want to duplicate line foreach user + } elseif ($type == 'project_task_time') // Case we want to duplicate line foreach user { $sql = "SELECT DISTINCT pt.rowid, ptt.fk_user FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt WHERE pt.rowid = ptt.fk_task AND pt.fk_projet IN (".$ids.")"; - } - elseif ($type == 'stock_mouvement') + } elseif ($type == 'stock_mouvement') { $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM '.MAIN_DB_PREFIX."stock_mouvement as ms, ".MAIN_DB_PREFIX."entrepot as e WHERE e.rowid = ms.fk_entrepot AND e.entity IN (".getEntity('stock').") AND ms.origintype = 'project' AND ms.fk_origin IN (".$ids.") AND ms.type_mouvement = 1"; - } - elseif ($type == 'loan') + } elseif ($type == 'loan') { $sql = 'SELECT l.rowid, l.fk_user_author as fk_user FROM '.MAIN_DB_PREFIX."loan as l WHERE l.entity IN (".getEntity('loan').") AND l.fk_projet IN (".$ids.")"; - } - else { + } else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$ids.") AND entity IN (".getEntity($type).")"; } if ($dates > 0 && $type == 'loan'){ $sql .= " AND (dateend > '".$this->db->idate($dates)."' OR dateend IS NULL)"; - } - elseif ($dates > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table + } elseif ($dates > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table { if (empty($datefieldname) && !empty($this->table_element_date)) $datefieldname = $this->table_element_date; if (empty($datefieldname)) return 'Error this object has no date field defined'; @@ -615,8 +600,7 @@ class Project extends CommonObject if ($datee > 0 && $type == 'loan'){ $sql .= " AND (datestart < '".$this->db->idate($datee)."' OR datestart IS NULL)"; - } - elseif ($datee > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table + } elseif ($datee > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table { if (empty($datefieldname) && !empty($this->table_element_date)) $datefieldname = $this->table_element_date; if (empty($datefieldname)) return 'Error this object has no date field defined'; @@ -646,8 +630,7 @@ class Project extends CommonObject /* Return array even if empty*/ return $elements; - } - else { + } else { dol_print_error($this->db); } } @@ -797,8 +780,7 @@ class Project extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -890,15 +872,13 @@ class Project extends CommonObject $this->statut = 1; $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); $this->error = join(',', $this->errors); dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR); return -1; } - } - else { + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -948,15 +928,13 @@ class Project extends CommonObject $this->statut = 2; $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); $this->error = join(',', $this->errors); dol_syslog(get_class($this)."::setClose ".$this->error, LOG_ERR); return -1; } - } - else { + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -1054,16 +1032,13 @@ class Project extends CommonObject { if (preg_match('/\.php$/', $option)) { $url = dol_buildpath($option, 1).'?id='.$this->id; - } - elseif ($option == 'task') + } elseif ($option == 'task') { $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id; - } - elseif ($option == 'preview') + } elseif ($option == 'preview') { $url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id; - } - else { + } else { $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; } // Add param to save lastsearch_values or not @@ -1179,12 +1154,10 @@ class Project extends CommonObject if (($mode == 'read' && !empty($user->rights->projet->all->lire)) || ($mode == 'write' && !empty($user->rights->projet->all->creer)) || ($mode == 'delete' && !empty($user->rights->projet->all->supprimer))) { $userAccess = 1; - } - elseif ($this->public && (($mode == 'read' && !empty($user->rights->projet->lire)) || ($mode == 'write' && !empty($user->rights->projet->creer)) || ($mode == 'delete' && !empty($user->rights->projet->supprimer)))) + } elseif ($this->public && (($mode == 'read' && !empty($user->rights->projet->lire)) || ($mode == 'write' && !empty($user->rights->projet->creer)) || ($mode == 'delete' && !empty($user->rights->projet->supprimer)))) { $userAccess = 1; - } - else { + } else { foreach (array('internal', 'external') as $source) { $userRole = $this->liste_contact(4, $source); @@ -1234,12 +1207,10 @@ class Project extends CommonObject if ($mode == 0) { $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "element_contact as ec ON ec.element_id = p.rowid"; - } - elseif ($mode == 1) + } elseif ($mode == 1) { $sql.= ", " . MAIN_DB_PREFIX . "element_contact as ec"; - } - elseif ($mode == 2) + } elseif ($mode == 2) { // No filter. Use this if user has permission to see all project } @@ -1260,8 +1231,7 @@ class Project extends CommonObject { $listofprojectcontacttype[$obj->rowid]=$obj->code; } - } - else dol_print_error($this->db); + } else dol_print_error($this->db); if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid syntax error if not found if ($mode == 0) @@ -1270,16 +1240,14 @@ class Project extends CommonObject $sql.= " OR ( ec.fk_c_type_contact IN (".join(',', array_keys($listofprojectcontacttype)).")"; $sql.= " AND ec.fk_socpeople = ".$user->id.")"; $sql.= " )"; - } - elseif ($mode == 1) + } elseif ($mode == 1) { $sql.= " AND ec.element_id = p.rowid"; $sql.= " AND ("; $sql.= " ( ec.fk_c_type_contact IN (".join(',', array_keys($listofprojectcontacttype)).")"; $sql.= " AND ec.fk_socpeople = ".$user->id.")"; $sql.= " )"; - } - elseif ($mode == 2) + } elseif ($mode == 2) { // No filter. Use this if user has permission to see all project } @@ -1308,8 +1276,7 @@ class Project extends CommonObject $result = implode(',', $temp); return $result; } - } - else { + } else { dol_print_error($this->db); } @@ -1416,8 +1383,7 @@ class Project extends CommonObject { $clone_project->note_private = ''; $clone_project->note_public = ''; - } - else { + } else { $this->db->begin(); $res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES), '_public'); if ($res < 0) @@ -1425,8 +1391,7 @@ class Project extends CommonObject $this->error .= $clone_project->error; $error++; $this->db->rollback(); - } - else { + } else { $this->db->commit(); } @@ -1437,8 +1402,7 @@ class Project extends CommonObject $this->error .= $clone_project->error; $error++; $this->db->rollback(); - } - else { + } else { $this->db->commit(); } } @@ -1461,8 +1425,7 @@ class Project extends CommonObject $langs->load("errors"); $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $error++; - } - else { + } else { if ($clone_project->error != '') { $this->error .= $clone_project->error; @@ -1493,8 +1456,7 @@ class Project extends CommonObject $error++; } } - } - else { + } else { $this->error .= $langs->trans('ErrorInternalErrorDetected').':dol_mkdir'; $error++; } @@ -1523,8 +1485,7 @@ class Project extends CommonObject { $this->error .= $result_clone->error; $error++; - } - else { + } else { $new_task_id = $result_clone; $taskstatic->fetch($tasktoclone->id); @@ -1562,8 +1523,7 @@ class Project extends CommonObject { $this->db->commit(); return $clone_project_id; - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR); return -1; @@ -1656,8 +1616,7 @@ class Project extends CommonObject { $sql .= " SET fk_project=".$this->id; $sql .= " WHERE id=".$elementSelectId; - } - else { + } else { $sql .= " SET fk_projet=".$this->id; $sql .= " WHERE rowid=".$elementSelectId; } @@ -1782,8 +1741,7 @@ class Project extends CommonObject { $this->weekWorkLoad[$day] = $obj->task_duration; $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration; - } - else { + } else { $this->weekWorkLoad[$day] += $obj->task_duration; $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration; } @@ -1792,8 +1750,7 @@ class Project extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -1847,8 +1804,7 @@ class Project extends CommonObject { $this->monthWorkLoad[$week_number] = $obj->task_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_task] = $obj->task_duration; - } - else { + } else { $this->monthWorkLoad[$week_number] += $obj->task_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_task] += $obj->task_duration; } @@ -1857,8 +1813,7 @@ class Project extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -1927,8 +1882,7 @@ class Project extends CommonObject } return $response; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1985,8 +1939,7 @@ class Project extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2052,8 +2005,7 @@ class Project extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 1452b0e919f..cb6150b6dc7 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -92,8 +92,7 @@ class ProjectStats extends Stats $label.' ('.price(price2num($row[0], 'MT'), 1, $langs, 1, -1, -1, $conf->currency).')', $row[0] ); - } - else $other += $row[1]; + } else $other += $row[1]; $i++; } if ($num > $limit) @@ -280,8 +279,7 @@ class ProjectStats extends Stats $foundintocache = 1; $this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $filedate; - } - else { + } else { dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it."); } } @@ -291,8 +289,7 @@ class ProjectStats extends Stats { dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate."."); $data = json_decode(file_get_contents($newpathofdestfile), true); - } - else { + } else { $year = $startyear; while ($year <= $endyear) { @@ -326,8 +323,7 @@ class ProjectStats extends Stats fclose($fp); if (!empty($conf->global->MAIN_UMASK)) $newmask = $conf->global->MAIN_UMASK; @chmod($newpathofdestfile, octdec($newmask)); - } - else dol_syslog("Failed to write cache file", LOG_ERR); + } else dol_syslog("Failed to write cache file", LOG_ERR); $this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $nowgmt; } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index cc74e565385..10f5a36d67f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -225,8 +225,7 @@ class Task extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -327,8 +326,7 @@ class Task extends CommonObject } else { return 0; } - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -437,8 +435,7 @@ class Task extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -540,8 +537,7 @@ class Task extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { //Delete associated link file if ($conf->projet->dir_output) { @@ -585,8 +581,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::hasChildren", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - else { + if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } else { $obj = $this->db->fetch_object($resql); if ($obj) $ret = $obj->nb; $this->db->free($resql); @@ -595,8 +590,7 @@ class Task extends CommonObject if (!$error) { return $ret; - } - else { + } else { return -1; } } @@ -617,8 +611,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::hasTimeSpent", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - else { + if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } else { $obj = $this->db->fetch_object($resql); if ($obj) $ret = $obj->nb; $this->db->free($resql); @@ -627,8 +620,7 @@ class Task extends CommonObject if (!$error) { return $ret; - } - else { + } else { return -1; } } @@ -791,8 +783,7 @@ class Task extends CommonObject $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_extrafields as efpt ON (t.rowid = efpt.fk_object)"; $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND t.fk_projet = p.rowid"; - } - elseif ($mode == 1) + } elseif ($mode == 1) { if ($filteronprojuser > 0) { @@ -808,8 +799,7 @@ class Task extends CommonObject } $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec2"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2"; - } - else { + } else { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid"; if ($includebilltime) { @@ -818,8 +808,7 @@ class Task extends CommonObject } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_extrafields as efpt ON (t.rowid = efpt.fk_object)"; $sql .= " WHERE p.entity IN (".getEntity('project').")"; - } - else return 'BadValueForParameterMode'; + } else return 'BadValueForParameterMode'; if ($filteronprojuser > 0) { @@ -965,8 +954,7 @@ class Task extends CommonObject $i++; } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db); } @@ -1044,8 +1032,7 @@ class Task extends CommonObject $i++; } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db); } @@ -1136,8 +1123,7 @@ class Task extends CommonObject if ($result < 0) { $ret = -1; } // End call triggers } - } - else { + } else { $this->error = $this->db->lasterror(); $ret = -1; } @@ -1172,8 +1158,7 @@ class Task extends CommonObject if ($ret > 0) { $this->db->commit(); - } - else { + } else { $this->db->rollback(); } return $ret; @@ -1233,8 +1218,7 @@ class Task extends CommonObject $this->timespent_nblines = ($obj->nblines ? $obj->nblines : 0); $this->db->free($resql); - } - else { + } else { dol_print_error($this->db); } return $result; @@ -1289,8 +1273,7 @@ class Task extends CommonObject $this->db->free($resql); return $result; - } - else { + } else { dol_print_error($this->db); return $result; } @@ -1341,8 +1324,7 @@ class Task extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -1427,8 +1409,7 @@ class Task extends CommonObject } $this->db->free($resql); - } - else { + } else { dol_print_error($this->db); $this->error = "Error ".$this->db->lasterror(); return -1; @@ -1488,13 +1469,10 @@ class Task extends CommonObject { $this->db->rollback(); $ret = -1; - } - else $ret = 1; + } else $ret = 1; // End call triggers - } - else $ret = 1; - } - else { + } else $ret = 1; + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); $ret = -1; @@ -1564,8 +1542,7 @@ class Task extends CommonObject if ($this->db->query($sql)) { $result = 0; - } - else { + } else { $this->error = $this->db->lasterror(); $result = -2; } @@ -1581,8 +1558,7 @@ class Task extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -1694,8 +1670,7 @@ class Task extends CommonObject { $clone_task->note_private = ''; $clone_task->note_public = ''; - } - else { + } else { $this->db->begin(); $res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES), '_public'); if ($res < 0) @@ -1703,8 +1678,7 @@ class Task extends CommonObject $this->error .= $clone_task->error; $error++; $this->db->rollback(); - } - else { + } else { $this->db->commit(); } @@ -1715,8 +1689,7 @@ class Task extends CommonObject $this->error .= $clone_task->error; $error++; $this->db->rollback(); - } - else { + } else { $this->db->commit(); } } @@ -1735,8 +1708,7 @@ class Task extends CommonObject { $projectstatic->fetch($project_id); $clone_project_ref = $projectstatic->ref; - } - else { + } else { $clone_project_ref = $ori_project_ref; } @@ -1783,8 +1755,7 @@ class Task extends CommonObject $langs->load("errors"); $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $error++; - } - else { + } else { if ($clone_task->error != '') { $this->error .= $clone_task->error; @@ -1808,8 +1779,7 @@ class Task extends CommonObject { $this->db->commit(); return $clone_task_id; - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR); return -1; @@ -1856,12 +1826,10 @@ class Task extends CommonObject 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]), 'statut1').' '.$langs->trans($this->statuts_short[$status]); @@ -1869,8 +1837,7 @@ class Task extends CommonObject elseif ($status == 3) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]); elseif ($status == 4) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]); elseif ($status == 5) return img_picto($langs->trans($this->statuts_short[$status]), 'statut5').' '.$langs->trans($this->statuts_short[$status]); - } - elseif ($mode == 3) + } elseif ($mode == 3) { if ($status == 0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0'); elseif ($status == 1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut1'); @@ -1878,8 +1845,7 @@ class Task extends CommonObject elseif ($status == 3) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); elseif ($status == 4) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6'); elseif ($status == 5) return img_picto($langs->trans($this->statuts_short[$status]), 'statut5'); - } - elseif ($mode == 4) + } elseif ($mode == 4) { if ($status == 0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]); elseif ($status == 1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut1').' '.$langs->trans($this->statuts[$status]); @@ -1887,8 +1853,7 @@ class Task extends CommonObject elseif ($status == 3) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); elseif ($status == 4) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]); elseif ($status == 5) return img_picto($langs->trans($this->statuts_short[$status]), 'statut5').' '.$langs->trans($this->statuts[$status]); - } - elseif ($mode == 5) + } elseif ($mode == 5) { /*if ($status==0) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut0'); elseif ($status==1) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut1'); @@ -1899,8 +1864,7 @@ class Task extends CommonObject */ //else return $this->progress.' %'; return ' '; - } - elseif ($mode == 6) + } elseif ($mode == 6) { /*if ($status==0) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut0'); elseif ($status==1) return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut1'); @@ -2012,8 +1976,7 @@ class Task extends CommonObject } return $response; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2060,8 +2023,7 @@ class Task extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index 1ab6189674a..722736fe9b8 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.class.php @@ -82,8 +82,7 @@ class TaskStats extends Stats $row[1], $row[0] ); - } - else $other += $row[1]; + } else $other += $row[1]; $i++; } if ($num > $limit) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index fde1563eac2..b8f1a24013d 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -73,14 +73,12 @@ if ($action == 'addcontact' && $user->rights->projet->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -92,8 +90,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); - } - else { + } else { dol_print_error($db); } } @@ -108,8 +105,7 @@ if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->pr { header("Location: contact.php?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 5b0409d7246..9015ef0d4d4 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -157,8 +157,7 @@ if ($object->id > 0) $permission = ($userWrite > 0); $permtoedit = ($userWrite > 0); include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { dol_print_error('', 'NoRecordFound'); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3907259e230..84612ef76ce 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -568,8 +568,7 @@ if ($action == "addelement") { setEventMessages($object->error, $object->errors, 'errors'); } -} -elseif ($action == "unlink") +} elseif ($action == "unlink") { $tablename = GETPOST("tablename", "aZ09"); $projectField = GETPOSTISSET('projectfield') ? GETPOST('projectfield', 'aZ09') : 'fk_projet'; @@ -685,18 +684,15 @@ foreach ($listofreferent as $key => $value) { $tmp = $element->getSumOfAmount($elementuser, $dates, $datee); $total_ht_by_line = price2num($tmp['amount'], 'MT'); - } - else { + } else { $tmp = $element->getSumOfAmount('', $dates, $datee); $total_ht_by_line = price2num($tmp['amount'], 'MT'); } - } - elseif ($key == 'loan') { + } elseif ($key == 'loan') { if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) { // Get total loan $total_ht_by_line = -$element->capital; - } - else { + } else { // Get loan schedule according to date filter $total_ht_by_line = 0; $loanScheduleStatic = new LoanSchedule($element->db); @@ -715,8 +711,7 @@ foreach ($listofreferent as $key => $value) } } } - } - else $total_ht_by_line = $element->total_ht; + } else $total_ht_by_line = $element->total_ht; // Define $total_ttc_by_line if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ttc_by_line = $element->amount; @@ -726,11 +721,9 @@ foreach ($listofreferent as $key => $value) { $defaultvat = get_default_tva($mysoc, $mysoc); $total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT'); - } - elseif ($key == 'loan') { + } elseif ($key == 'loan') { $total_ttc_by_line = $total_ht_by_line; // For loan there is actually no taxe managed in Dolibarr - } - else $total_ttc_by_line = $element->total_ttc; + } else $total_ttc_by_line = $element->total_ttc; // Change sign of $total_ht_by_line and $total_ttc_by_line for some cases if ($tablename == 'payment_various') @@ -844,8 +837,7 @@ foreach ($listofreferent as $key => $value) if ($selectList < 0) { setEventMessages($formproject->error, $formproject->errors, 'errors'); - } - elseif ($selectList) + } elseif ($selectList) { // Define form with the combo list of elements to link $addform .= '
'; @@ -951,8 +943,7 @@ foreach ($listofreferent as $key => $value) if ($tablename != 'expensereport_det') { if (method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty(); - } - else { + } else { $expensereport = new ExpenseReport($db); $expensereport->fetch($element->fk_expensereport); } @@ -997,19 +988,16 @@ foreach ($listofreferent as $key => $value) if ($tablename == 'expensereport_det') { print $expensereport->getNomUrl(1); - } - else { + } else { // Show ref with link if ($element instanceof Task) { print $element->getNomUrl(1, 'withproject', 'time'); print ' - '.dol_trunc($element->label, 48); - } - elseif ($key == 'loan') { + } elseif ($key == 'loan') { print $element->getNomUrl(1); print ' - '.dol_trunc($element->label, 48); - } - else print $element->getNomUrl(1); + } else print $element->getNomUrl(1); $element_doc = $element->element; $filename = dol_sanitizeFileName($element->ref); @@ -1018,8 +1006,7 @@ foreach ($listofreferent as $key => $value) if ($element_doc === 'order_supplier') { $element_doc = 'commande_fournisseur'; $filedir = $conf->fournisseur->commande->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref); - } - elseif ($element_doc === 'invoice_supplier') { + } elseif ($element_doc === 'invoice_supplier') { $element_doc = 'facture_fournisseur'; $filename = get_exdir($element->id, 2, 0, 0, $element, 'product').dol_sanitizeFileName($element->ref); $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.get_exdir($element->id, 2, 0, 0, $element, 'invoice_supplier').dol_sanitizeFileName($element->ref); @@ -1047,8 +1034,7 @@ foreach ($listofreferent as $key => $value) if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') { $date = ($element->date_commande ? $element->date_commande : $element->date_valid); - } - elseif ($tablename == 'supplier_proposal') $date = $element->date_validation; // There is no other date for this + } elseif ($tablename == 'supplier_proposal') $date = $element->date_validation; // There is no other date for this elseif ($tablename == 'fichinter') $date = $element->datev; // There is no other date for this elseif ($tablename == 'projet_task') $date = ''; // We show no date. Showing date of beginning of task make user think it is date of time consumed else { @@ -1059,8 +1045,7 @@ foreach ($listofreferent as $key => $value) $date = $element->$datefieldname; } } - } - elseif ($key == 'loan') { + } elseif ($key == 'loan') { $date = $element->datestart; } @@ -1069,16 +1054,14 @@ foreach ($listofreferent as $key => $value) { print dol_print_date($element->datep, 'dayhour'); if ($element->datef && $element->datef > $element->datep) print " - ".dol_print_date($element->datef, 'dayhour'); - } - elseif (in_array($tablename, array('projet_task'))) + } elseif (in_array($tablename, array('projet_task'))) { $tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty print ''; print convertSecondToTime($tmpprojtime['nbseconds'], 'allhourmin'); print ''; $total_time_by_line = $tmpprojtime['nbseconds']; - } - else print dol_print_date($date, 'day'); + } else print dol_print_date($date, 'day'); print ''; // Third party or user @@ -1089,14 +1072,12 @@ foreach ($listofreferent as $key => $value) $tmpuser = new User($db); $tmpuser->fetch($expensereport->fk_user_author); print $tmpuser->getNomUrl(1, '', 48); - } - elseif ($tablename == 'payment_salary') + } elseif ($tablename == 'payment_salary') { $tmpuser = new User($db); $tmpuser->fetch($element->fk_user); print $tmpuser->getNomUrl(1, '', 48); - } - elseif ($tablename == 'don' || $tablename == 'stock_mouvement') + } elseif ($tablename == 'don' || $tablename == 'stock_mouvement') { if ($element->fk_user_author > 0) { @@ -1104,8 +1085,7 @@ foreach ($listofreferent as $key => $value) $tmpuser2->fetch($element->fk_user_author); print $tmpuser2->getNomUrl(1, '', 48); } - } - elseif ($tablename == 'projet_task' && $key == 'project_task_time') // if $key == 'project_task', we don't want details per user + } elseif ($tablename == 'projet_task' && $key == 'project_task_time') // if $key == 'project_task', we don't want details per user { print $elementuser->getNomUrl(1); } @@ -1140,12 +1120,10 @@ foreach ($listofreferent as $key => $value) $langs->load("errors"); $warning = $langs->trans("WarningSomeLinesWithNullHourlyRate", $conf->currency); } - } - else { + } else { $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); } - } - elseif ($key == 'loan') $total_ht_by_line = $element->capital; + } elseif ($key == 'loan') $total_ht_by_line = $element->capital; else { $total_ht_by_line = $element->total_ht; } @@ -1169,8 +1147,7 @@ foreach ($listofreferent as $key => $value) } if ($warning) print ' '.img_warning($warning); print ''; - } - else print ''; + } else print ''; // Amount inc tax if (empty($value['disableamount'])) @@ -1186,12 +1163,10 @@ foreach ($listofreferent as $key => $value) // TODO Permission to read daily rate $defaultvat = get_default_tva($mysoc, $mysoc); $total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT'); - } - else { + } else { $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); } - } - elseif ($key == 'loan') $total_ttc_by_line = $element->capital - $element->getSumPayment(); + } elseif ($key == 'loan') $total_ttc_by_line = $element->capital - $element->getSumPayment(); else { $total_ttc_by_line = $element->total_ttc; } @@ -1215,32 +1190,27 @@ foreach ($listofreferent as $key => $value) } if ($warning) print ' '.img_warning($warning); print ''; - } - else print ''; + } else print ''; // Status print ''; if ($tablename == 'expensereport_det') { print $expensereport->getLibStatut(5); - } - elseif ($element instanceof CommonInvoice) + } elseif ($element instanceof CommonInvoice) { //This applies for Facture and FactureFournisseur print $element->getLibStatut(5, $element->getSommePaiement()); - } - elseif ($element instanceof Task) + } elseif ($element instanceof Task) { if ($element->progress != '') { print $element->progress.' %'; } - } - elseif ($tablename == 'stock_mouvement') + } elseif ($tablename == 'stock_mouvement') { print $element->getLibStatut(3); - } - else { + } else { print $element->getLibStatut(5); } print ''; @@ -1314,8 +1284,7 @@ foreach ($listofreferent as $key => $value) print ''; print ' '; print ''; - } - else { + } else { if (!is_array($elementarray)) // error { print $elementarray; diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php index 5f88db6344d..457345d2fe3 100644 --- a/htdocs/projet/ganttchart.inc.php +++ b/htdocs/projet/ganttchart.inc.php @@ -195,8 +195,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje if ($project_id && $level < 0) { $parent = '-'.$project_id; - } - else { + } else { $parent = $task["task_parent_alternate_id"]; //$parent = $task["task_parent"]; } @@ -207,8 +206,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje { //$link=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]); $link = ''; - } - else { + } else { $link = DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"]; } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 2cecf9c85ba..d578f372777 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -281,8 +281,7 @@ if (count($tasksarray) > 0) $tasks[$taskcursor]['task_is_group'] = 1; $tasks[$taskcursor]['task_css'] = 'ggroupblack'; //$tasks[$taskcursor]['task_css'] = 'gtaskblue'; - } - elseif ($task->hasChildren() > 0) { + } elseif ($task->hasChildren() > 0) { $tasks[$taskcursor]['task_is_group'] = 1; //$tasks[$taskcursor]['task_is_group'] = 0; $tasks[$taskcursor]['task_css'] = 'ggroupblack'; @@ -379,13 +378,11 @@ if (count($tasksarray) > 0) print '
'."\n"; print ''; - } - else { + } else { $langs->load("admin"); print $langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled"); } -} -else { +} else { print '
'.$langs->trans("NoTasks").'
'; } diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 90f172f2fe2..a18b2dc54a5 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -98,8 +98,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print ""; print "
"; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 261b7529907..f4edfdea548 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -140,8 +140,7 @@ if ($resql) } $i++; } -} -else dol_print_error($db); +} else dol_print_error($db); //var_dump($listofoppcode); @@ -272,8 +271,7 @@ if ($resql) } } print "
"; -} -else dol_print_error($db); +} else dol_print_error($db); $companystatic = new Societe($db); // We need a clean new object for next loop because current one has some properties set. @@ -326,8 +324,7 @@ if ($resql) $companystatic->status = $obj->status; print $companystatic->getNomUrl(1); - } - else { + } else { print $langs->trans("OthersNotLinkedToThirdParty"); } print ''; @@ -351,8 +348,7 @@ if ($resql) } $db->free($resql); -} -else { +} else { dol_print_error($db); } print ""; diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 772188ec261..6c73d2cfc8b 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -52,8 +52,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 98d9d49fd8e..70ad0f61e96 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -233,8 +233,7 @@ if (empty($reshook)) } else { setEventMessages($langs->trans("DontHaveTheValidateStatus", $objecttmp->ref), null, 'warnings'); } - } - else { + } else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -246,8 +245,7 @@ if (empty($reshook)) if ($nbok > 1) setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); else setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -282,8 +280,7 @@ if ($resql) { $listofprojectcontacttype[$obj->rowid] = $obj->code; } -} -else dol_print_error($db); +} else dol_print_error($db); if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0] = '0'; // To avoid sql syntax error if not found $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. @@ -749,8 +746,7 @@ while ($i < min($num, $limit)) if ($obj->socid) { print $socstatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -769,8 +765,7 @@ while ($i < min($num, $limit)) if ($nbofsalesrepresentative > 3) // We print only number { print $nbofsalesrepresentative; - } - elseif ($nbofsalesrepresentative > 0) + } elseif ($nbofsalesrepresentative > 0) { $userstatic = new User($db); $j = 0; @@ -790,8 +785,7 @@ while ($i < min($num, $limit)) } } //else print $langs->trans("NoSalesRepresentativeAffected"); - } - else { + } else { print ' '; } print ''; diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 38d12081b4f..6d56b2088e9 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -350,8 +350,7 @@ print ''; print '
'; $stringtoshow .= ''; @@ -607,8 +598,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; } -} -elseif ($id > 0 || !empty($ref)) +} elseif ($id > 0 || !empty($ref)) { $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields @@ -805,8 +795,7 @@ elseif ($id > 0 || !empty($ref)) // Show all lines in taskarray (recursive function to go down on tree) $j = 0; $level = 0; $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields); - } - else { + } else { $colspan = 10; if ($object->usage_bill_time) $colspan += 2; print ''; @@ -829,8 +818,7 @@ elseif ($id > 0 || !empty($ref)) include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; cleanCorruptedTree($db, 'projet_task', 'fk_task_parent'); } - } - else { + } else { if ($nboftaskshown < count($tasksarray) && !GETPOST('search_user_id', 'int')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 905a6adedbf..e8a4ae93168 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -74,8 +74,7 @@ if (!empty($project_ref) && !empty($withproject)) if (count($objectsarray) > 0) { $id = $objectsarray[0]->id; - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); } } @@ -279,8 +278,7 @@ if ($id > 0 || !empty($ref)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = " fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; + } else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; $morehtmlref = ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 303ee19425a..2c3737c6788 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -68,16 +68,14 @@ if ($action == 'addcontact' && $user->rights->projet->creer) if ($result <= 0) { dol_print_error($db, $projectstatic->error, $projectstatic->errors); - } - else { + } else { $contactsofproject = $projectstatic->getListContactId('internal'); foreach ($contactsofproject as $key => $val) { $result = $object->add_contact($val, GETPOST("type"), GETPOST("source")); } } - } - else { + } else { $result = $object->add_contact($idfortaskuser, GETPOST("type"), GETPOST("source")); } } @@ -86,14 +84,12 @@ if ($action == 'addcontact' && $user->rights->projet->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : '')); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -105,8 +101,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) if ($object->fetch($id, $ref)) { $result = $object->swapContactStatus(GETPOST('ligne')); - } - else { + } else { dol_print_error($db); } } @@ -121,8 +116,7 @@ if ($action == 'deleteline' && $user->rights->projet->creer) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : '')); exit; - } - else { + } else { dol_print_error($db); } } @@ -136,8 +130,7 @@ if (!empty($project_ref) && !empty($withproject)) if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); exit; } @@ -318,8 +311,7 @@ if ($id > 0 || !empty($ref)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = " fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; + } else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; $morehtmlref = ''; @@ -538,8 +530,7 @@ if ($id > 0 || !empty($ref)) } } print "
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { $stringtoshow .= $px1->show(); $stringtoshow .= "
\n"; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index c70a9b042d5..f395a4ee27a 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -236,8 +236,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action = 'create'; $error++; - } - elseif (empty($_POST['task_parent'])) + } elseif (empty($_POST['task_parent'])) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ChildOfProjectTask")), null, 'errors'); $action = 'create'; @@ -273,15 +272,13 @@ if ($action == 'createtask' && $user->rights->projet->creer) if ($taskid > 0) { $result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal'); - } - else { + } else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("projects"); setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings'); $duplicate_code_error = true; - } - else { + } else { setEventMessages($task->error, $task->errors, 'errors'); } $action = 'create'; @@ -295,22 +292,19 @@ if ($action == 'createtask' && $user->rights->projet->creer) { header("Location: ".$backtopage); exit; - } - elseif (empty($projectid)) + } elseif (empty($projectid)) { header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php'.(empty($mode) ? '' : '?mode='.$mode)); exit; } $id = $projectid; } - } - else { + } else { if (!empty($backtopage)) { header("Location: ".$backtopage); exit; - } - elseif (empty($id)) + } elseif (empty($id)) { // We go back on task list header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php'.(empty($mode) ? '' : '?mode='.$mode)); @@ -504,8 +498,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third $langs->load("errors"); print $langs->trans("WarningProjectClosed"); print ''; - } - else { + } else { print '
'; print ''; print ''; @@ -532,8 +525,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third if (empty($duplicate_code_error)) { print (GETPOSTISSET("ref") ?GETPOST("ref", 'alpha') : $defaultref); - } - else { + } else { print $defaultref; } print ''; @@ -553,8 +545,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third if (is_array($contactsofproject) && count($contactsofproject)) { print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); - } - else { + } else { print $langs->trans("NoUserAssignedToTheProject"); } print '
'.$langs->trans("NoTasks").'
"; - } - else { + } else { print "ErrorRecordNotFound"; } } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 80183db3d60..1493542c5ed 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -79,8 +79,7 @@ if (!empty($project_ref) && !empty($withproject)) { $id = $tasksarray[0]->id; $object->fetch($id); - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); exit; } @@ -102,8 +101,7 @@ if ($id > 0 || !empty($ref)) $object->project = clone $projectstatic; $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); - } - else { + } else { dol_print_error($db); } } @@ -269,8 +267,7 @@ if ($object->id > 0) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = " fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; + } else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; $morehtmlref = ''; @@ -316,8 +313,7 @@ if ($object->id > 0) $permtoedit = $user->rights->projet->creer; $relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { header('Location: index.php'); exit; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index c25546bccbf..8930220f6ec 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -245,8 +245,7 @@ if ($resql) { $listofprojectcontacttype[$obj->rowid] = $obj->code; } -} -else dol_print_error($db); +} else dol_print_error($db); if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0] = '0'; // To avoid sql syntax error if not found // Get id of types of contacts for tasks (This list never contains a lot of elements) $listoftaskcontacttype = array(); @@ -260,8 +259,7 @@ if ($resql) { $listoftaskcontacttype[$obj->rowid] = $obj->code; } -} -else dol_print_error($db); +} else dol_print_error($db); if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0] = '0'; // To avoid sql syntax error if not found $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is assigned only once. @@ -752,8 +750,7 @@ while ($i < min($num, $limit)) $socstatic->id = $obj->socid; $socstatic->name = $obj->name; print $socstatic->getNomUrl(1); - } - else { + } else { print ' '; } print ''; @@ -854,8 +851,7 @@ while ($i < min($num, $limit)) print convertSecondToTime($obj->tobill, 'allhourmin'); $totalarray['val']['t.tobill'] += $obj->tobill; $totalarray['totaltobill'] += $obj->tobill; - } - else { + } else { print ''.$langs->trans("NA").''; } print ''; @@ -872,8 +868,7 @@ while ($i < min($num, $limit)) print convertSecondToTime($obj->billed, 'allhourmin'); $totalarray['val']['t.billed'] += $obj->billed; $totalarray['totalbilled'] += $obj->billed; - } - else { + } else { print ''.$langs->trans("NA").''; } print ''; @@ -938,8 +933,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota { if ($num < $limit && empty($offset)) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; - } - elseif ($totalarray['totalplannedworkloadfield'] == $i) print ''.convertSecondToTime($totalarray['totalplannedworkload'], $plannedworkloadoutputformat).''; + } elseif ($totalarray['totalplannedworkloadfield'] == $i) print ''.convertSecondToTime($totalarray['totalplannedworkload'], $plannedworkloadoutputformat).''; elseif ($totalarray['totaldurationeffectivefield'] == $i) print ''.convertSecondToTime($totalarray['totaldurationeffective'], $timespentoutputformat).''; elseif ($totalarray['totalprogress_calculatedfield'] == $i) print ''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationeffective'] / $totalarray['totalplannedworkload'], 2).' %' : '').''; elseif ($totalarray['totalprogress_declaredfield'] == $i) print ''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationdeclared'] / $totalarray['totalplannedworkload'], 2).' %' : '').''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 737346570f4..7af9bbbacef 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -57,8 +57,7 @@ if ($id > 0 || !empty($ref)) if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); $object->project = clone $projectstatic; - } - else { + } else { dol_print_error($db); } } @@ -74,8 +73,7 @@ if (!empty($project_ref) && !empty($withproject)) { $id = $tasksarray[0]->id; $object->fetch($id); - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); } } @@ -241,8 +239,7 @@ if ($object->id > 0) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = " fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; + } else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; $morehtmlref = ''; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index bbb275ef5df..a0bf33b34ba 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -199,8 +199,7 @@ print '
'; print '
'; $stringtoshow .= ''; // Other attributes @@ -601,8 +595,7 @@ if ($id > 0 || !empty($ref)) if ($user->rights->projet->creer) { print ''.$langs->trans('Modify').''; - } - else { + } else { print ''.$langs->trans('Modify').''; } @@ -612,12 +605,10 @@ if ($id > 0 || !empty($ref)) if (!$object->hasChildren() && !$object->hasTimeSpent()) { print ''.$langs->trans('Delete').''; - } - else { + } else { print ''.$langs->trans('Delete').''; } - } - else { + } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 95c50b9b62d..6c482264bbf 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -154,15 +154,13 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) if ($id || $ref) { $object->fetch($id, $ref); - } - else { + } else { if (!GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors'); $action = 'createtime'; $error++; - } - else { + } else { $object->fetch(GETPOST('taskid', 'int')); } } @@ -176,8 +174,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors'); $action = 'createtime'; $error++; - } - else { + } else { $object->timespent_note = $_POST["timespent_note"]; if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value $object->timespent_duration = $_POST["timespent_durationhour"] * 60 * 60; // We store duration in seconds @@ -186,8 +183,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) { $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); $object->timespent_withhour = 1; - } - else { + } else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); } $object->timespent_fk_user = $_POST["userid"]; @@ -195,15 +191,13 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) if ($result >= 0) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } } } - } - else { + } else { if (empty($id)) $action = 'createtime'; else $action = 'createtime'; } @@ -238,8 +232,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel { $object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_withhour = 1; - } - else { + } else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); } $object->timespent_fk_user = $_POST["userid_line"]; @@ -247,13 +240,11 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel if ($result >= 0) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } - } - else { + } else { $object->fetch($id, $ref); // TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids)) @@ -266,8 +257,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel { $object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_withhour = 1; - } - else { + } else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); } $object->timespent_fk_user = $_POST["userid_line"]; @@ -276,14 +266,12 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel if ($result >= 0) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } } - } - else { + } else { $action = ''; } } @@ -300,8 +288,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->l setEventMessages($langs->trans($object->error), null, 'errors'); $error++; $action = ''; - } - else { + } else { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } } @@ -315,8 +302,7 @@ if (!empty($project_ref) && !empty($withproject)) if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); exit; } @@ -332,14 +318,12 @@ if (GETPOST('projectid', 'int') > 0) $result = $projectstatic->fetch($projectidforalltimes); if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); $res = $projectstatic->fetch_optionals(); -} -elseif (GETPOST('project_ref', 'alpha')) +} elseif (GETPOST('project_ref', 'alpha')) { $projectstatic->fetch(0, GETPOST('project_ref', 'alpha')); $projectidforalltimes = $projectstatic->id; $withproject = 1; -} -elseif ($id > 0) +} elseif ($id > 0) { $object->fetch($id); $result = $projectstatic->fetch($object->fk_project); @@ -353,8 +337,7 @@ if ($action == 'confirm_generateinvoice') if (!($projectstatic->thirdparty->id > 0)) { setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); - } - else { + } else { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -392,8 +375,7 @@ if ($action == 'confirm_generateinvoice') $txtva = $dataforprice['tva_tx']; $localtax1 = $dataforprice['localtax1']; $localtax2 = $dataforprice['localtax2']; - } - else { + } else { $pu_ht = 0; $txtva = get_default_tva($mysoc, $projectstatic->thirdparty); $localtax1 = get_default_localtax($mysoc, $projectstatic->thirdparty, 1); @@ -406,8 +388,7 @@ if ($action == 'confirm_generateinvoice') if ($invoiceToUse) { $tmpinvoice->fetch($invoiceToUse); - } - else { + } else { $result = $tmpinvoice->create($user); if ($result <= 0) { @@ -458,8 +439,7 @@ if ($action == 'confirm_generateinvoice') break; } } - } - elseif ($generateinvoicemode == 'onelineperperiod') { + } elseif ($generateinvoicemode == 'onelineperperiod') { $arrayoftasks = array(); foreach ($toselect as $key => $value) { @@ -502,8 +482,7 @@ if ($action == 'confirm_generateinvoice') break; } } - } - elseif ($generateinvoicemode == 'onelinepertask') { + } elseif ($generateinvoicemode == 'onelinepertask') { $arrayoftasks = array(); foreach ($toselect as $key => $value) { @@ -553,8 +532,7 @@ if ($action == 'confirm_generateinvoice') //var_dump($tmpinvoice); $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -584,8 +562,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) $result = $projectstatic->fetch($projectidforalltimes); if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); $res = $projectstatic->fetch_optionals(); - } - elseif ($object->fetch($id, $ref) >= 0) + } elseif ($object->fetch($id, $ref) >= 0) { if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments(); $result = $projectstatic->fetch($object->fk_project); @@ -742,14 +719,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime'.$param.'&backtopage='.urlencode($backtourl); - } - else // We are on tab 'Time Spent' of task + } else // We are on tab 'Time Spent' of task { $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($backtourl); } - } - else { + } else { $linktocreatetimeBtnStatus = -2; $linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject"); } @@ -788,8 +763,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = " fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; + } else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; $morehtmlref = ''; @@ -855,8 +829,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) $tmparray = $object->getSummaryOfTimeSpent(); if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; else print '0 %'; - } - else print ''.$langs->trans("WorkloadNotDefined").''; + } else print ''.$langs->trans("WorkloadNotDefined").''; print ''; print ''; @@ -1051,8 +1024,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; - } - else { + } else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -1074,8 +1046,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) $title = $langs->trans("ListTaskTimeUserProject"); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit); - } - else { + } else { print ''."\n"; $title = $langs->trans("ListTaskTimeForTask"); @@ -1091,8 +1062,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) $i++; } $db->free($resql); - } - else { + } else { dol_print_error($db); } @@ -1150,8 +1120,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($projectstatic->public) $contactsofproject = array(); print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); - } - else { + } else { if ($nboftasks) { print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); } @@ -1310,10 +1279,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if (empty($task_time->task_date_withhour)) { print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0); - } - else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0); - } - else { + } else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0); + } else { print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day')); } print ''; @@ -1329,8 +1296,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { $formproject->selectTasks(-1, GETPOST('taskid', 'int') ?GETPOST('taskid', 'int') : $task_time->fk_task, 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, ''); - } - else { + } else { $tasktmp->id = $task_time->fk_task; $tasktmp->ref = $task_time->ref; $tasktmp->label = $task_time->label; @@ -1370,8 +1336,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } else { print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } - } - else { + } else { $userstatic->id = $task_time->fk_user; $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; @@ -1390,14 +1355,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; - } - else { + } else { print dol_nl2br($task_time->note); } print ''; if (!$i) $totalarray['nbfield']++; - } - elseif ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) + } elseif ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; } @@ -1410,8 +1373,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text'); - } - else { + } else { print convertSecondToTime($task_time->task_duration, 'allhourmin'); } print ''; @@ -1451,12 +1413,10 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print $tmpinvoice->getNomUrl(1); } - } - else { + } else { print $langs->trans("No"); } - } - else { + } else { print ''.$langs->trans("NA").''; } } @@ -1484,8 +1444,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print '
'; print ''; - } - elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks + } elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks { if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) { @@ -1537,10 +1496,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if (empty($task_time->task_date_withhour)) { print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0); - } - else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0); - } - else { + } else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0); + } else { print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day')); } print ''; @@ -1588,8 +1545,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } else { print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } - } - else { + } else { $userstatic->id = $task_time->fk_user; $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; @@ -1607,13 +1563,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { print ''; - } - else { + } else { print dol_nl2br($task_time->note); } print ''; - } - elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) + } elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { print ''; } @@ -1626,8 +1580,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text'); - } - else { + } else { print convertSecondToTime($task_time->task_duration, 'allhourmin'); } print ''; @@ -1681,10 +1634,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if (empty($task_time->task_date_withhour)) { print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 3, 3, 2, "timespent_date", 1, 0); - } - else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 1, 1, 2, "timespent_date", 1, 0); - } - else { + } else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 1, 1, 2, "timespent_date", 1, 0); + } else { print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day')); } print ''; @@ -1732,8 +1683,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } else { print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } - } - else { + } else { $userstatic->id = $task_time->fk_user; $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; @@ -1751,13 +1701,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { print ''; - } - else { + } else { print dol_nl2br($task_time->note); } print ''; - } - elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) + } elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { print ''; } @@ -1770,8 +1718,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; print $form->select_duration('new_duration_2', 0, 0, 'text'); - } - else { + } else { print convertSecondToTime($task_time->task_duration, 'allhourmin'); } print ''; @@ -1828,8 +1775,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { if ($num < $limit && empty($offset)) print ''; else print ''; - } - elseif ($totalarray['totaldurationfield'] == $i) print ''; + } elseif ($totalarray['totaldurationfield'] == $i) print ''; elseif ($totalarray['totalvaluefield'] == $i) print ''; //elseif ($totalarray['totalvaluebilledfield'] == $i) print ''; else print ''; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index ff8611ee0a4..9530757b283 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -109,8 +109,7 @@ if ($reshook < 0) { print '
'.$hookmanager->error.'
'; } llxFooterVierge(); -} -elseif (empty($reshook)) { +} elseif (empty($reshook)) { // Check exportkey if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_GET["exportkey"]) { $user->getrights(); @@ -188,8 +187,7 @@ if ($format == 'ical' || $format == 'vcal') //header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); exit; - } - else { + } else { print 'Error '.$agenda->error; exit; @@ -225,8 +223,7 @@ if ($format == 'rss') // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); exit; - } - else { + } else { print 'Error '.$agenda->error; exit; diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 13419207e07..9eb0579680a 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -90,8 +90,7 @@ if ($result < 0) echo "User Error:".$user->error; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); exit; -} -else { +} else { if (empty($user->id)) { echo " User login:".$userlogin." do not exists"; @@ -166,8 +165,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) echo "\nUser Error: ".$user->error."\n"; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); exit(-1); - } - else { + } else { if ($result == 0) { echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n"; @@ -204,8 +202,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) echo "You can also enable module Log if not yet enabled, run again and take a look into dolibarr.log file\n"; dol_syslog("cron_run_jobs.php::run_jobs Error".$cronjob->error, LOG_ERR); $nbofjobslaunchedko++; - } - else { + } else { $nbofjobslaunchedok++; } @@ -222,8 +219,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) } echo " - reprogrammed\n"; - } - else { + } else { echo " - not qualified\n"; dol_syslog("cron_run_jobs.php job not qualified line->datenextrun:".dol_print_date($line->datenextrun, 'dayhourrfc')." line->datestart:".dol_print_date($line->datestart, 'dayhourrfc')." line->dateend:".dol_print_date($line->dateend, 'dayhourrfc')." now:".dol_print_date($now, 'dayhourrfc')); @@ -233,8 +229,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) $conf = $savconf; echo "Result: ".($nbofjobs)." jobs - ".($nbofjobslaunchedok + $nbofjobslaunchedko)." launched = ".$nbofjobslaunchedok." OK + ".$nbofjobslaunchedko." KO"; -} -else { +} else { echo "Result: No active jobs found."; } diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 7e4f1b1b0d7..768b7d42392 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -151,8 +151,7 @@ foreach ($modulesdir as $dir) if ($objMod->numero > 0) { $j = $objMod->numero; - } - else { + } else { $j = 1000 + $i; } @@ -173,8 +172,7 @@ foreach ($modulesdir as $dir) $j++; $i++; } - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } @@ -378,8 +376,7 @@ foreach ($demoprofiles as $profilearray) { print "\n".''; print ''; - } - else { + } else { $modulo = ($j % $nbcolsmod); //if ($modulo == 0) print ''; print ''; @@ -431,8 +428,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIEN print 'src="http://pagead2.googlesyndication.com/pagead/show_ads.js">'."\n"; print ''."\n"; print ''."\n"; - } - else { + } else { print ''."\n"; } } diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 045f726fe1d..49114b89f46 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -87,8 +87,7 @@ if ($resql) if ($objp->public) { print "\n"; - } - else { + } else { print "\n"; } print "\n"; @@ -97,12 +96,10 @@ if ($resql) $i++; } print "
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { $stringtoshow .= $px1->show(); $stringtoshow .= "
\n"; } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 93f3ca3b01e..7a109eb1f50 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -113,8 +113,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->projet->creer) setEventMessages($object->error, $object->errors, 'errors'); } } - } - else { + } else { $action = 'edit'; } } @@ -130,8 +129,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->s { header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : '')); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -147,8 +145,7 @@ if (!empty($project_ref) && !empty($withproject)) if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; - } - else { + } else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); } } @@ -459,8 +456,7 @@ if ($id > 0 || !empty($ref)) print ''; print ''; - } - else { + } else { /* * Fiche tache en mode visu */ @@ -478,8 +474,7 @@ if ($id > 0 || !empty($ref)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = " fk_projet in (".$projectsListId.")"; - } - else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; + } else $object->next_prev_filter = " fk_projet = ".$projectstatic->id; $morehtmlref = ''; @@ -563,8 +558,7 @@ if ($id > 0 || !empty($ref)) $tmparray = $object->getSummaryOfTimeSpent(); if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; else print '0 %'; - } - else print ''.$langs->trans("WorkloadNotDefined").''; + } else print ''.$langs->trans("WorkloadNotDefined").''; print '
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.convertSecondToTime($totalarray['totalduration'], 'allhourmin').''.convertSecondToTime($totalarray['totalduration'], 'allhourmin').''.price($totalarray['totalvalue']).''.price($totalarray['totalvaluebilled']).'
".dolGetFirstLastname($objp->firstname, $objp->lastname)." ".$objp->societe."Anonyme Anonyme".dol_print_date($db->jdate($objp->datedon))."
"; - } - else { + } else { print "Aucun don publique"; } -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 71e28c94da8..7eb45f008e6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -107,13 +107,11 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); $width = 150; - } - elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 150; - } - elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; $width = 150; @@ -343,10 +341,8 @@ if ($action == 'add') if (preg_match('/\d\.\d/', $appli)) { if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli .= " ".DOL_VERSION; - } - else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL); $from = $conf->global->ADHERENT_MAIL_FROM; @@ -375,8 +371,7 @@ if ($action == 'add') { $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; // TODO Make replacement of __AMOUNT__, etc... - } - else $urlback = $_SERVER["PHP_SELF"]."?action=added"; + } else $urlback = $_SERVER["PHP_SELF"]."?action=added"; if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') { @@ -390,13 +385,11 @@ if ($action == 'add') if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } - else { + } else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } - } - elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') + } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') { $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); @@ -406,13 +399,11 @@ if ($action == 'add') if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } - else { + } else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } - } - elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') + } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') { $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref); if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); @@ -422,13 +413,11 @@ if ($action == 'add') if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } - else { + } else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } - } - elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') + } elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe') { $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref; if (price2num(GETPOST('amount', 'alpha'))) $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); @@ -438,13 +427,11 @@ if ($action == 'add') if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); - } - else { + } else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } - } - else { + } else { dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); exit; } @@ -452,8 +439,7 @@ if ($action == 'add') if (!empty($entity)) $urlback .= '&entity='.$entity; dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); - } - else { + } else { $error++; $errmsg .= join('
', $adh->errors); } @@ -465,8 +451,7 @@ if ($action == 'add') Header("Location: ".$urlback); exit; - } - else { + } else { $db->rollback(); } } @@ -567,8 +552,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) print ''.$langs->trans("Type").' *'; print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty); print ''."\n"; -} -else { +} else { $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); print ''; } @@ -580,8 +564,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) print ''.$langs->trans('MemberNature').' *'."\n"; print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print ''."\n"; -} -else { +} else { print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; print ''; } @@ -723,8 +706,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { print ''; - } - else { + } else { print ''; print ''; } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index a955c9605f2..c1677b2902b 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -84,8 +84,7 @@ if ($id > 0) if (empty($object->public)) { print $langs->trans("ErrorThisMemberIsNotPublic"); - } - else { + } else { print ''; print '\n"; diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 1a885ed3596..cb5b9308ed4 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -152,16 +152,14 @@ if ($result) print ''."\n"; - } - else { + } else { print "\n"; } print ""; $i++; } print "
'.$langs->trans("Type").''.$object->type."
'; print $form->showphoto('memberphoto', $objp, 64); print ' 
"; -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index b3b362fa6b2..a86b8c68e42 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.php @@ -38,8 +38,7 @@ if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml' { print 'Sorry, it seems your internet connexion is off.
'; print 'You need to be connected to network to use this software.
'; -} -else { +} else { $langs->load("error"); $langs->load("other"); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 20b029f960d..2031c11a3ad 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -174,8 +174,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $width = 150; -} -elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); @@ -235,8 +234,7 @@ if ($source == 'proposal') { $mesg = $proposal->error; $error++; - } - else { + } else { $result = $proposal->fetch_thirdparty($proposal->socid); } @@ -275,12 +273,10 @@ if ($action != 'dosign') { if ($found && !$error) // We are in a management option and no error { - } - else { + } else { dol_print_error_email('ERRORNEWONLINESIGN'); } -} -else { +} else { // Print } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index f26d31c483d..4f437c07740 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -108,12 +108,10 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '1') { $nouveauchoix .= "1"; - } - elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') + } elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') { $nouveauchoix .= "2"; - } - else { // sinon c'est 0 + } else { // sinon c'est 0 $nouveauchoix .= "0"; } } @@ -132,8 +130,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout { setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); $error++; - } - else { + } else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $resql = $db->query($sql); @@ -168,11 +165,9 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout $result = $cmailfile->sendfile(); } } - } - else dol_print_error($db); + } else dol_print_error($db); } - } - else { + } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } } @@ -208,12 +203,10 @@ if ($testmodifier) if (isset($_POST["choix".$i]) && $_POST["choix".$i] == '1') { $nouveauchoix .= "1"; - } - elseif (isset($_POST["choix".$i]) && $_POST["choix".$i] == '2') + } elseif (isset($_POST["choix".$i]) && $_POST["choix".$i] == '2') { $nouveauchoix .= "2"; - } - else { // sinon c'est 0 + } else { // sinon c'est 0 $nouveauchoix .= "0"; } } @@ -389,8 +382,7 @@ if ($object->format == "D") print ''."\n"; } -} -else { +} else { //display of survey topics print ''."\n"; print ''."\n"; @@ -477,8 +469,7 @@ while ($compteur < $num) if (((string) $car) == "0") $sumagainst[$i]++; } } - } - else { + } else { //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs if ($compteur == $ligneamodifier) { @@ -504,8 +495,7 @@ while ($compteur < $num) } print ''."\n"; } - } - else { + } else { for ($i = 0; $i < $nbcolonnes; $i++) { $car = substr($ensemblereponses, $i, 1); @@ -689,8 +679,7 @@ if ($object->allow_spy) { } else { $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').' ('.dol_print_date($toutsujet[$i], '%A').')'; } - } - else { + } else { $tmps = explode('@', $toutsujet[$i]); $meilleursujet .= dol_htmlentities($tmps[0]); } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b82dcc3360b..746fcffcfa4 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -210,8 +210,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - } - else { + } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } if ($SECUREKEY != $token) @@ -466,8 +465,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) dol_syslog('Failed to create card record', LOG_WARNING, 0, '_stripe'); setEventMessages('Failed to create card record', null, 'errors'); $action = ''; - } - else { + } else { if (!empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; if (!empty($dol_id)) $metadata["dol_id"] = $dol_id; if (!empty($dol_type)) $metadata["dol_type"] = $dol_type; @@ -493,8 +491,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) } } } - } - else { + } else { $vatcleaned = $vatnumber ? $vatnumber : null; /*$taxinfo = array('type'=>'vat'); @@ -648,8 +645,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) } else { $paymentintent = \Stripe\PaymentIntent::retrieve($paymentintent_id, array("stripe_account" => $stripeacc)); } - } - catch (Exception $e) + } catch (Exception $e) { $error++; $errormessage = "CantRetreivePaymentIntent ".$e->getMessage(); @@ -665,8 +661,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); setEventMessages($paymentintent->status, null, 'errors'); $action = ''; - } - else { + } else { // TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method // Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here. //dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe'); @@ -695,8 +690,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) { header("Location: ".$urlko); exit; - } - else { + } else { header("Location: ".$urlok); exit; } @@ -769,8 +763,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $width = 150; -} -elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); @@ -870,8 +863,7 @@ if (!$source) { print ''; print ''; - } - else { + } else { print ''.price($amount).''; print ''; print ''; @@ -907,8 +899,7 @@ if ($source == 'order') { $mesg = $order->error; $error++; - } - else { + } else { $result = $order->fetch_thirdparty($order->socid); } $object = $order; @@ -964,8 +955,7 @@ if ($source == 'order') { print ''; print ''; - } - else { + } else { print ''.price($amount).''; print ''; print ''; @@ -1001,8 +991,7 @@ if ($source == 'order') print ''."\n"; print ''."\n"; print ''."\n"; - } - else { + } else { print ''."\n"; } if (is_object($order->thirdparty)) print ''."\n"; @@ -1028,8 +1017,7 @@ if ($source == 'invoice') { $mesg = $invoice->error; $error++; - } - else { + } else { $result = $invoice->fetch_thirdparty($invoice->socid); } $object = $invoice; @@ -1087,14 +1075,12 @@ if ($source == 'invoice') { print ''; print ''; - } - else { + } else { print ''.price($amount).''; print ''; print ''; } - } - else { + } else { print ''.price($object->total_ttc, 1, $langs).''; } // Currency @@ -1128,8 +1114,7 @@ if ($source == 'invoice') print ''."\n"; print ''."\n"; print ''."\n"; - } - else { + } else { print ''."\n"; } if (is_object($invoice->thirdparty)) print ''."\n"; @@ -1156,21 +1141,18 @@ if ($source == 'contractline') { $mesg = $contractline->error; $error++; - } - else { + } else { if ($contractline->fk_contrat > 0) { $result = $contract->fetch($contractline->fk_contrat); if ($result > 0) { $result = $contract->fetch_thirdparty($contract->socid); - } - else { + } else { $mesg = $contract->error; $error++; } - } - else { + } else { $mesg = 'ErrorRecordNotFound'; $error++; } @@ -1192,8 +1174,7 @@ if ($source == 'contractline') $pu_ht = $product->multiprices[$contract->thirdparty->price_level]; $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; $price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level]; - } - else { + } else { $pu_ht = $product->price; $pu_ttc = $product->price_ttc; $price_base_type = $product->price_base_type; @@ -1278,8 +1259,7 @@ if ($source == 'contractline') if ($contractline->product->duration_value > 1) { $dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("DurationDays"), "w"=>$langs->trans("DurationWeeks"), "m"=>$langs->trans("DurationMonths"), "y"=>$langs->trans("DurationYears")); - } - else { + } else { $dur = array("h"=>$langs->trans("Hour"), "d"=>$langs->trans("DurationDay"), "w"=>$langs->trans("DurationWeek"), "m"=>$langs->trans("DurationMonth"), "y"=>$langs->trans("DurationYear")); } $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; @@ -1298,8 +1278,7 @@ if ($source == 'contractline') { print ''; print ''; - } - else { + } else { print ''.price($amount).''; print ''; print ''; @@ -1335,8 +1314,7 @@ if ($source == 'contractline') print ''."\n"; print ''."\n"; print ''."\n"; - } - else { + } else { print ''."\n"; } if (is_object($contract->thirdparty)) print ''."\n"; @@ -1362,8 +1340,7 @@ if ($source == 'membersubscription') { $mesg = $member->error; $error++; - } - else { + } else { $member->fetch_thirdparty(); $subscription = new Subscription($db); } @@ -1450,8 +1427,7 @@ if ($source == 'membersubscription') if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { $valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT; } - } - else { + } else { if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; } @@ -1464,8 +1440,7 @@ if ($source == 'membersubscription') if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); print ''; print ''; - } - else { + } else { $valtoshow = $amount; if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); print ''.price($valtoshow).''; @@ -1504,8 +1479,7 @@ if ($source == 'membersubscription') print ''."\n"; print ''."\n"; print ''."\n"; - } - else { + } else { print ''."\n"; } if (is_object($member->thirdparty)) print ''."\n"; @@ -1529,8 +1503,7 @@ if ($source == 'donation') { $mesg = $don->error; $error++; - } - else { + } else { $don->fetch_thirdparty(); } $object = $don; @@ -1593,8 +1566,7 @@ if ($source == 'donation') if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { $valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT; } - } - else { + } else { if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; } @@ -1607,8 +1579,7 @@ if ($source == 'donation') if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); print ''; print ''; - } - else { + } else { $valtoshow = $amount; if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow); print ''.price($valtoshow).''; @@ -1647,8 +1618,7 @@ if ($source == 'donation') print ''."\n"; print ''."\n"; print ''."\n"; - } - else { + } else { print ''."\n"; } if (is_object($don->thirdparty)) print ''."\n"; @@ -1675,16 +1645,13 @@ if ($action != 'dopayment') if ($source == 'order' && $object->billed) { print '

'.$langs->trans("OrderBilled").''; - } - elseif ($source == 'invoice' && $object->paye) + } elseif ($source == 'invoice' && $object->paye) { print '

'.$langs->trans("InvoicePaid").''; - } - elseif ($source == 'donation' && $object->paid) + } elseif ($source == 'donation' && $object->paid) { print '

'.$langs->trans("DonationPaid").''; - } - else { + } else { // Membership can be paid and we still allow to make renewal if ($source == 'membersubscription' && $object->datefin > dol_now()) { @@ -1773,12 +1740,10 @@ if ($action != 'dopayment') '; } } - } - else { + } else { dol_print_error_email('ERRORNEWPAYMENT'); } -} -else { +} else { // Print } @@ -1915,8 +1880,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment if (empty($paymentintent)) { print '
'.$langs->trans("Error").'
'; - } - else { + } else { print ''; //$_SESSION["paymentintent_id"] = $paymentintent->id; } @@ -1930,8 +1894,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { $langs->load("errors"); print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error'); - } - else { + } else { print ''; print ''."\n"; print ''."\n"; @@ -1993,8 +1956,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment $_SESSION['ipaddress'] = ($remoteip ? $remoteip : 'unknown'); // Payer ip $_SESSION['payerID'] = is_object($stripecu) ? $stripecu->id : ''; $_SESSION['TRANSACTIONID'] = $sessionstripe->id; - } - catch (Exception $e) + } catch (Exception $e) { print $e->getMessage(); } @@ -2042,8 +2004,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) + } elseif (!empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { ?> // Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set @@ -2146,8 +2107,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment }); // Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off @@ -2214,8 +2174,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment } }); /* Use 3DS source */ diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index a261c6101a0..c42677d8b21 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -77,8 +77,7 @@ if (empty($paymentmethod)) { dol_print_error(null, 'The back url does not contains a parameter fulltag that should help us to find the payment method used'); exit; -} -else { +} else { dol_syslog("paymentmethod=".$paymentmethod); } @@ -158,10 +157,8 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice if (preg_match('/\d\.\d/', $appli)) { if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli .= " ".DOL_VERSION; - } - else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed"); @@ -185,8 +182,7 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice if ($result) { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } - else { + } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } @@ -225,8 +221,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $width = 150; -} -elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index a1d562b8690..4bb899b930e 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -163,8 +163,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); $width = 150; -} -elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); @@ -221,8 +220,7 @@ if (!empty($conf->paypal->enabled)) { // Nothing to do dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment'); - } - else { + } else { dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment'); } @@ -249,8 +247,7 @@ if (!empty($conf->paypal->enabled)) $NOTE = urldecode($resArray2["NOTE"]); $ispaymentok = true; - } - else { + } else { dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING, 0, '_payment'); //Display a user friendly Error on the page using any of the following error information returned by PayPal @@ -259,12 +256,10 @@ if (!empty($conf->paypal->enabled)) $ErrorLongMsg = urldecode($resArray2["L_LONGMESSAGE0"]); $ErrorSeverityCode = urldecode($resArray2["L_SEVERITYCODE0"]); } - } - else { + } else { dol_print_error('', 'Session expired'); } - } - else { + } else { dol_print_error('', '$PAYPALTOKEN not defined'); } } @@ -415,8 +410,7 @@ if ($ispaymentok) $errmsg = $object->error; $postactionmessages[] = $errmsg; $ispostactionok = -1; - } - else { + } else { $postactionmessages[] = 'Subscription created'; $ispostactionok = 1; } @@ -437,8 +431,7 @@ if ($ispaymentok) $postactionmessages[] = $object->error; $postactionmessages = array_merge($postactionmessages, $object->errors); $ispostactionok = -1; - } - else { + } else { if ($option == 'bankviainvoice') { $postactionmessages[] = 'Invoice, payment and bank record created'; @@ -502,8 +495,7 @@ if ($ispaymentok) $postactionmessages[] = $errmsg; $ispostactionok = -1; } - } - catch (Exception $e) { + } catch (Exception $e) { $error++; $errmsg = 'Failed to save customer stripe id in database ; '.$e->getMessage(); $postactionmessages[] = $errmsg; @@ -516,8 +508,7 @@ if ($ispaymentok) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } @@ -582,8 +573,7 @@ if ($ispaymentok) $errmsg = $object->error; $postactionmessages[] = $errmsg; $ispostactionok = -1; - } - else { + } else { if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; else $postactionmessages[] = 'Email sent to member (without any attached document)'; @@ -591,18 +581,15 @@ if ($ispaymentok) } } } - } - else { + } else { $postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'].'. May be payment was already recorded.'; $ispostactionok = -1; } - } - else { + } else { $postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found'; $ispostactionok = -1; } - } - elseif (array_key_exists('INV', $tmptag) && $tmptag['INV'] > 0) + } elseif (array_key_exists('INV', $tmptag) && $tmptag['INV'] > 0) { // Record payment include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -637,8 +624,7 @@ if ($ispaymentok) if ($currencyCodeType == $conf->currency) { $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id - } - else { + } else { $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; @@ -660,8 +646,7 @@ if ($ispaymentok) $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); $ispostactionok = -1; $error++; - } - else { + } else { $postactionmessages[] = 'Payment created'; $ispostactionok = 1; } @@ -684,13 +669,11 @@ if ($ispaymentok) $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); $ispostactionok = -1; $error++; - } - else { + } else { $postactionmessages[] = 'Bank transaction of payment created'; $ispostactionok = 1; } - } - else { + } else { $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; $ispostactionok = -1; $error++; @@ -700,22 +683,18 @@ if ($ispaymentok) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } - } - else { + } else { $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'].'. May be payment was already recorded.'; $ispostactionok = -1; } - } - else { + } else { $postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found'; $ispostactionok = -1; } - } - else { + } else { // Nothing done } } @@ -770,10 +749,8 @@ if ($ispaymentok) if (preg_match('/\d\.\d/', $appli)) { if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli .= " ".DOL_VERSION; - } - else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); @@ -784,16 +761,14 @@ if ($ispaymentok) $content .= ''.$companylangs->trans("PaymentSubscription")."

\n"; $content .= $companylangs->trans("MemberId").': '.$tmptag['MEM']."
\n"; $content .= $companylangs->trans("Link").': '.$url.''."
\n"; - } - elseif (array_key_exists('INV', $tmptag)) + } elseif (array_key_exists('INV', $tmptag)) { $url = $urlwithroot."/compta/facture/card.php?id=".$tmptag['INV']; $content .= ''.$companylangs->trans("Payment")."

\n"; $content .= $companylangs->trans("InvoiceId").': '.$tmptag['INV']."
\n"; //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."
\n"; $content .= $companylangs->trans("Link").': '.$url.''."
\n"; - } - else { + } else { $content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."
\n"; } $content .= $companylangs->transnoentities("PostActionAfterPayment").' : '; @@ -801,12 +776,10 @@ if ($ispaymentok) { //$topic.=' ('.$companylangs->transnoentitiesnoconv("Status").' '.$companylangs->transnoentitiesnoconv("OK").')'; $content .= ''.$companylangs->transnoentitiesnoconv("OK").''; - } - elseif ($ispostactionok == 0) + } elseif ($ispostactionok == 0) { $content .= $companylangs->transnoentitiesnoconv("None"); - } - else { + } else { $topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')'); $content .= ''.$companylangs->transnoentitiesnoconv("Error").''; } @@ -844,14 +817,12 @@ if ($ispaymentok) { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); //dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0); - } - else { + } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); //dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0); } } -} -else { +} else { // Get on url call $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; $payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID; @@ -902,10 +873,8 @@ else { if (preg_match('/\d\.\d/', $appli)) { if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli .= " ".DOL_VERSION; - } - else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; + } else $appli .= " ".DOL_VERSION; $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); @@ -929,8 +898,7 @@ else { if ($result) { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } - else { + } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } diff --git a/htdocs/public/stripe/confirm_payment.php b/htdocs/public/stripe/confirm_payment.php index 9c6346842c8..683a537fe69 100644 --- a/htdocs/public/stripe/confirm_payment.php +++ b/htdocs/public/stripe/confirm_payment.php @@ -48,21 +48,18 @@ if (isset($_GET['connect'])) $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_CONNECT_KEY; $service = 'StripeTest'; $servicestatus = 0; - } - else { + } else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; $servicestatus = 1; } -} -else { +} else { if (isset($_GET['test'])) { $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_KEY; $service = 'StripeTest'; $servicestatus = 0; - } - else { + } else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; $servicestatus = 1; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index e3cc21b327b..d3a9521bf25 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -48,21 +48,18 @@ if (isset($_GET['connect'])) $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_CONNECT_KEY; $service = 'StripeTest'; $servicestatus = 0; - } - else { + } else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; $servicestatus = 1; } -} -else { +} else { if (isset($_GET['test'])) { $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_KEY; $service = 'StripeTest'; $servicestatus = 0; - } - else { + } else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -89,8 +86,7 @@ $error = 0; try { $event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); -} -catch (\UnexpectedValueException $e) { +} catch (\UnexpectedValueException $e) { // Invalid payload http_response_code(400); // PHP 5.4 or greater exit(); @@ -123,12 +119,10 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled { $obj = $db->fetch_object($result); $key = $obj->entity; - } - else { + } else { $key = 1; } - } - else { + } else { $key = 1; } $ret = $mc->switchEntity($key); @@ -186,14 +180,12 @@ if ($event->type == 'payout.created') { http_response_code(200); // PHP 5.4 or greater return 1; - } - else { + } else { $error++; http_response_code(500); // PHP 5.4 or greater return -1; } -} -elseif ($event->type == 'payout.paid') { +} elseif ($event->type == 'payout.paid') { global $conf; $error = 0; $result = dolibarr_set_const($db, $service."_NEXTPAYOUT", null, 'chaine', 0, '', $conf->entity); @@ -266,41 +258,32 @@ elseif ($event->type == 'payout.paid') { http_response_code(200); // PHP 5.4 or greater return 1; - } - else { + } else { $error++; http_response_code(500); // PHP 5.4 or greater return -1; } -} -elseif ($event->type == 'customer.source.created') { +} elseif ($event->type == 'customer.source.created') { //TODO: save customer's source -} -elseif ($event->type == 'customer.source.updated') { +} elseif ($event->type == 'customer.source.updated') { //TODO: update customer's source -} -elseif ($event->type == 'customer.source.delete') { +} elseif ($event->type == 'customer.source.delete') { //TODO: delete customer's source -} -elseif ($event->type == 'customer.deleted') { +} elseif ($event->type == 'customer.deleted') { $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE key_account = '".$db->escape($event->data->object->id)."' and site='stripe'"; $db->query($sql); $db->commit(); -} -elseif ($event->type == 'payment_intent.succeeded') { // Called when making payment with PaymentIntent method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). +} elseif ($event->type == 'payment_intent.succeeded') { // Called when making payment with PaymentIntent method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). // TODO: create fees // TODO: Redirect to paymentok.php -} -elseif ($event->type == 'payment_intent.payment_failed') { +} elseif ($event->type == 'payment_intent.payment_failed') { // TODO: Redirect to paymentko.php -} -elseif ($event->type == 'checkout.session.completed') // Called when making payment with new Checkout method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). +} elseif ($event->type == 'checkout.session.completed') // Called when making payment with new Checkout method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). { // TODO: create fees // TODO: Redirect to paymentok.php -} -elseif ($event->type == 'payment_method.attached') { +} elseif ($event->type == 'payment_method.attached') { require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; $societeaccount = new SocieteAccount($db); @@ -339,13 +322,11 @@ elseif ($event->type == 'payment_method.attached') { if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } -} -elseif ($event->type == 'payment_method.updated') { +} elseif ($event->type == 'payment_method.updated') { require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; $companypaymentmode = new CompanyPaymentMode($db); $companypaymentmode->fetch(0, '', 0, '', " AND stripe_card_ref = '".$db->escape($event->data->object->id)."'"); @@ -375,25 +356,20 @@ elseif ($event->type == 'payment_method.updated') { if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } -} -elseif ($event->type == 'payment_method.detached') { +} elseif ($event->type == 'payment_method.detached') { $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib WHERE ref = '".$db->escape($event->data->object->id)."' and status = ".$servicestatus; $db->query($sql); $db->commit(); -} -elseif ($event->type == 'charge.succeeded') { +} elseif ($event->type == 'charge.succeeded') { // TODO: create fees // TODO: Redirect to paymentok.php -} -elseif ($event->type == 'charge.failed') { +} elseif ($event->type == 'charge.failed') { // TODO: Redirect to paymentko.php -} -elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated == true)) { +} elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated == true)) { // This event is deprecated. } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index cbe88b006d4..ffa4b24fc59 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -45,8 +45,7 @@ if (empty($usedolheader)) trans("ErrorFieldRequired", $langs->transnoentities("TicketEmailNotificationFrom")).'
'; print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket")); print '
'; - } - else { + } else { print '
'.$langs->trans('TicketPublicInfoCreateTicket').'
'; $formticket->showForm(); } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 51e120cdbd5..2b9ab94c5b1 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -187,8 +187,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($action == "add_message") { $action = 'presend'; - } - else { + } else { $action = ''; } } @@ -371,8 +370,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Message list print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation'); $object->viewTicketMessages(false, true, $object->dao); - } - else { + } else { print ''; } } else { diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php index 2f18de010a0..d09b8e10012 100644 --- a/htdocs/public/website/index.php +++ b/htdocs/public/website/index.php @@ -95,8 +95,7 @@ if (empty($pageid)) if ($result > 0) { $pageid = $objectpage->id; - } - elseif ($result == 0) + } elseif ($result == 0) { // Page not found from ref=pageurl, we try using alternative alias $result = $objectpage->fetch(0, $object->id, null, $pageref); @@ -105,8 +104,7 @@ if (empty($pageid)) $pageid = $objectpage->id; } } - } - else { + } else { if ($object->fk_default_home > 0) { $result = $objectpage->fetch($object->fk_default_home); @@ -163,8 +161,7 @@ if ($pageid == 'css') // No more used ? //else header('Cache-Control: no-cache'); $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/styles.css.php'; -} -else { +} else { $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/page'.$pageid.'.tpl.php'; } diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php index 24125178f5d..8854c13ea52 100644 --- a/htdocs/public/website/styles.css.php +++ b/htdocs/public/website/styles.css.php @@ -77,8 +77,7 @@ if (empty($pageid)) { $object->fetch($websiteid); $website = $object->ref; - } - else { + } else { $object->fetch(0, $website); } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 2ada4b1c447..7bc99977943 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -79,7 +79,7 @@ else { $result = restrictedArea($user, 'reception'); if ($origin == 'supplierorder') { if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) accessforbidden(); - }elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) accessforbidden(); + } elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) accessforbidden(); } $action = GETPOST('action', 'alpha'); @@ -352,8 +352,7 @@ if (empty($reshook)) $error++; } } - } - else { + } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToReceive").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; } @@ -363,15 +362,12 @@ if (empty($reshook)) $db->commit(); header("Location: card.php?id=".$object->id); exit; - } - else { + } else { $db->rollback(); $_GET["commande_id"] = GETPOST('commande_id', 'int'); $action = 'create'; } - } - - elseif ($action == 'confirm_valid' && $confirm == 'yes' && + } elseif ($action == 'confirm_valid' && $confirm == 'yes' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))) ) @@ -384,8 +380,7 @@ if (empty($reshook)) { $langs->load("errors"); setEventMessages($langs->trans($object->error), null, 'errors'); - } - else { + } else { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -404,17 +399,14 @@ if (empty($reshook)) if ($result < 0) dol_print_error($db, $result); } } - } - - elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->reception->supprimer) + } elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->reception->supprimer) { $result = $object->delete($user); if ($result > 0) { header("Location: ".DOL_URL_ROOT.'/reception/index.php'); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -512,9 +504,7 @@ if (empty($reshook)) $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); - } - - elseif ($action == 'classifybilled') + } elseif ($action == 'classifybilled') { $object->fetch($id); $result = $object->set_billed(); @@ -522,9 +512,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit(); } - } - - elseif ($action == 'classifyclosed') + } elseif ($action == 'classifyclosed') { $object->fetch($id); $result = $object->setClosed(); @@ -561,8 +549,7 @@ if (empty($reshook)) if (!$error) { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit(); - } - else { + } else { setEventMessages($line->error, $line->errors, 'errors'); } } @@ -624,8 +611,7 @@ if (empty($reshook)) setEventMessages($line->error, $line->errors, 'errors'); $error++; } - } - else // Product no predefined + } else // Product no predefined { $qty = "qtyl".$line_id; $line->id = $line_id; @@ -660,8 +646,7 @@ if (empty($reshook)) $ret = $object->fetch($object->id); // Reload to get new records $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - else { + } else { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1041,8 +1026,7 @@ if ($action == 'create') } print ''; - } - else { + } else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1080,8 +1064,7 @@ if ($action == 'create') if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $quantityToBeDelivered = 0; - } - else { + } else { $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; } $warehouse_id = $dispatchLines[$indiceAsked]['ent']; @@ -1102,8 +1085,7 @@ if ($action == 'create') if (GETPOST('qtyl'.$indiceAsked, 'int')) $defaultqty = GETPOST('qtyl'.$indiceAsked, 'int'); print ''; print ''; - } - else print $langs->trans("NA"); + } else print $langs->trans("NA"); print ''; // Stock @@ -1121,8 +1103,7 @@ if ($action == 'create') print ''; print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0, 0, $line->fk_product, '', 1); } - } - else { + } else { print $langs->trans("Service"); } print ''; @@ -1139,8 +1120,7 @@ if ($action == 'create') print ''; print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, ""); print ''; - } - else { + } else { print ''; } } @@ -1184,13 +1164,11 @@ if ($action == 'create') print ''; print '
'; - } - else { + } else { dol_print_error($db); } } -} -elseif ($id || $ref) +} elseif ($id || $ref) /* *************************************************************************** */ /* */ /* Edit and view mode */ @@ -1235,8 +1213,7 @@ elseif ($id || $ref) if ($objectref == 'PROV') { $numref = $object->getNextNumRef($soc); - } - else { + } else { $numref = $object->ref; } @@ -1400,8 +1377,7 @@ elseif ($id || $ref) print $form->selectDate($object->date_delivery ? $object->date_delivery : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print ''; - } - else { + } else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -1423,8 +1399,7 @@ elseif ($id || $ref) print ' '; print ' '; print ''; - } - else { + } else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -1457,8 +1432,7 @@ elseif ($id || $ref) print ' '; print ' '; print ''; - } - else { + } else { print $object->trueHeight; print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; } @@ -1489,8 +1463,7 @@ elseif ($id || $ref) if ($volumeUnit < 50) { print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no'); - } - else print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit); + } else print $calculatedVolume.' '.measuringUnitString(0, "volume", $volumeUnit); } if ($totalVolume > 0) { @@ -1535,8 +1508,7 @@ elseif ($id || $ref) if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''; print ''; - } - else { + } else { if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey @@ -1568,8 +1540,7 @@ elseif ($id || $ref) if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -1622,8 +1593,7 @@ elseif ($id || $ref) if ($object->statut <= 1) { print $langs->trans("QtyToReceive").' - '; - } - else { + } else { print $langs->trans("QtyReceived").' - '; } if (!empty($conf->stock->enabled)) @@ -1635,13 +1605,11 @@ elseif ($id || $ref) print $langs->trans("Batch"); } print ''; - } - else { + } else { if ($object->statut <= 1) { print ''.$langs->trans("QtyToReceive").''; - } - else { + } else { print ''.$langs->trans("QtyReceived").''; } if (!empty($conf->stock->enabled)) @@ -1748,8 +1716,7 @@ elseif ($id || $ref) $prod = new Product($db); $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label; - } - else $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label); + } else $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label); print ''; @@ -1763,8 +1730,7 @@ elseif ($id || $ref) print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; } print "\n"; - } - else { + } else { print ""; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1783,8 +1749,7 @@ elseif ($id || $ref) if ($action == 'editline' && $lines[$i]->id == $line_id) { print ''; - } - else { + } else { print ''.$lines[$i]->comment.''; } @@ -1849,8 +1814,7 @@ elseif ($id || $ref) print ''; } print ''; - } - else { + } else { print ''; print ''; // Qty to receive or received @@ -1863,8 +1827,7 @@ elseif ($id || $ref) } } print ''; - } - else { + } else { // Qty to receive or received print ''.$lines[$i]->qty.''; @@ -1900,8 +1863,7 @@ elseif ($id || $ref) $detail .= '
'; print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); - } - else { + } else { print $langs->trans("NA"); } print ''; @@ -1929,8 +1891,7 @@ elseif ($id || $ref) print ''; print '
'; print '
'; - } - elseif ($object->statut == Reception::STATUS_DRAFT) + } elseif ($object->statut == Reception::STATUS_DRAFT) { // edit-delete buttons print ''; @@ -1961,8 +1922,7 @@ elseif ($id || $ref) if ($action == 'editline' && $lines[$i]->id == $line_id) { print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); - } - else { + } else { print $line->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); } } @@ -1999,8 +1959,7 @@ elseif ($id || $ref) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))) { print ''.$langs->trans("Validate").''; - } - else { + } else { print ''.$langs->trans("Validate").''; } } @@ -2016,8 +1975,7 @@ elseif ($id || $ref) if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? { print ''.$langs->trans("ClassifyUnbilled").''; - } - else { + } else { print ''.$langs->trans("ReOpen").''; } } @@ -2029,8 +1987,7 @@ elseif ($id || $ref) if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->reception->reception_advance->send) { print ''.$langs->trans('SendByMail').''; - } - else print ''.$langs->trans('SendByMail').''; + } else print ''.$langs->trans('SendByMail').''; } } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 111846347be..f4cbb08ee9e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -178,13 +178,11 @@ class Reception extends CommonObject if ($numref != "") { return $numref; - } - else { + } else { dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error); return ""; } - } - else { + } else { print $langs->trans("Error")." ".$langs->trans("Error_RECEPTION_ADDON_NUMBER_NotDefined"); return ""; } @@ -322,8 +320,7 @@ class Reception extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -332,15 +329,13 @@ class Reception extends CommonObject $this->db->rollback(); return -1 * $error; } - } - else { + } else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } - } - else { + } else { $error++; $this->error = $this->db->error()." - sql=$sql"; $this->db->rollback(); @@ -467,14 +462,12 @@ class Reception extends CommonObject } return 1; - } - else { + } else { dol_syslog(get_class($this).'::Fetch no reception found', LOG_ERR); $this->error = 'Delivery with id '.$id.' not found'; return 0; } - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -523,8 +516,7 @@ class Reception extends CommonObject if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $numref = $this->getNextNumRef($soc); - } - else { + } else { $numref = $this->ref; } @@ -594,8 +586,7 @@ class Reception extends CommonObject $this->errors = array_merge($this->errors, $mouvS->errors); break; } - } - else { + } else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. @@ -609,8 +600,7 @@ class Reception extends CommonObject } } } - } - else { + } else { $this->db->rollback(); $this->error = $this->db->error(); return -2; @@ -684,8 +674,7 @@ class Reception extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR); @@ -856,8 +845,7 @@ class Reception extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -910,8 +898,7 @@ class Reception extends CommonObject $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed } - } - else { + } else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -987,31 +974,26 @@ class Reception extends CommonObject } return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } - } - else { + } else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } - } - else { + } else { $this->db->rollback(); return -1; } @@ -1069,8 +1051,7 @@ class Reception extends CommonObject } return 1; - } - else { + } else { return -1; } } @@ -1256,13 +1237,11 @@ class Reception extends CommonObject { $this->date_delivery = $date_livraison; return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } - } - else { + } else { return -2; } } @@ -1345,8 +1324,7 @@ class Reception extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)"; $sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')"; $resql = $this->db->query($sql); - } - else { + } else { $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql .= " code='".$this->db->escape($this->update['code'])."'"; $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'"; @@ -1421,8 +1399,7 @@ class Reception extends CommonObject { $url = str_replace('{TRACKID}', $value, $tracking); $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); - } - else { + } else { $this->tracking_url = $value; } } @@ -1523,8 +1500,7 @@ class Reception extends CommonObject $this->errors = $mouvS->errors; $error++; break; } - } - else { + } else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1537,8 +1513,7 @@ class Reception extends CommonObject } } } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -1552,8 +1527,7 @@ class Reception extends CommonObject $error++; } } - } - else { + } else { dol_print_error($this->db); $error++; } @@ -1562,8 +1536,7 @@ class Reception extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1607,8 +1580,7 @@ class Reception extends CommonObject if (empty($error)) { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1683,8 +1655,7 @@ class Reception extends CommonObject $this->errors = $mouvS->errors; $error++; break; } - } - else { + } else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1696,8 +1667,7 @@ class Reception extends CommonObject } } } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -1726,8 +1696,7 @@ class Reception extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1816,8 +1785,7 @@ class Reception extends CommonObject $error++; break; } - } - else { + } else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1829,8 +1797,7 @@ class Reception extends CommonObject } } } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -1880,8 +1847,7 @@ class Reception extends CommonObject $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index b5e526bb1b3..4e8605ac74a 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -90,8 +90,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); @@ -119,8 +118,7 @@ elseif ($action == 'deletecontact' && $user->rights->reception->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index b9786229468..e3951458e40 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -120,8 +120,7 @@ if ($resql) print ''; $i++; } - } - else { + } else { print ''.$langs->trans("None").''; } @@ -182,16 +181,14 @@ if ($resql) $orderstatic->id = $obj->commande_fournisseur_id; $orderstatic->ref = $obj->commande_fournisseur_ref; print $orderstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; $i++; } print "

"; } $db->free($resql); -} -else dol_print_error($db); +} else dol_print_error($db); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index c753cf3e873..93aba12eb00 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -192,8 +192,7 @@ if (empty($reshook)) $object->add_object_linked('reception', $value); // add supplier order linked object } } - } - else { + } else { $object->socid = $rcp->socid; $object->type = FactureFournisseur::TYPE_STANDARD; $object->cond_reglement_id = $rcp->thirdparty->cond_reglement_supplier_id; @@ -278,14 +277,12 @@ if (empty($reshook)) { $result = $object->insert_discount($discountid); //$result=$discount->link_to_invoice($lineid,$id); - } - else { + } else { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; break; } - } - else { + } else { // Positive line $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Date start @@ -332,8 +329,7 @@ if (empty($reshook)) if ($result > 0) { $lineid = $result; - } - else { + } else { $lineid = 0; $error++; break; @@ -387,8 +383,7 @@ if (empty($reshook)) { $db->commit(); setEventMessage($langs->trans('BillCreated', $nb_bills_created)); - } - else { + } else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -580,8 +575,7 @@ if ($resql) { print $form->selectyesno('validate_invoices', 0, 1, 1); print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; - } - else { + } else { print $form->selectyesno('validate_invoices', 0, 1); } print ''; @@ -931,8 +925,7 @@ if ($resql) print "
"; print ''; $db->free($resql); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index 4a0bcb4fd04..5079671dafd 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -77,8 +77,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png'; -} -else { +} else { $filenamenb = $dir.'/receptionsnbinyear-'.$year.'.png'; } @@ -289,8 +288,7 @@ print '
'; // Show graphs print ''; } -} -else { +} else { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } print ''; diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index b1f1f627a99..a824a7d8eee 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -62,8 +62,7 @@ if ($action == 'update') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -113,8 +112,7 @@ foreach ($list as $key) if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); - } - else { + } else { print ''; } print ''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d7b71edbf0b..94add08291c 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -158,8 +158,7 @@ if ($action == 'add' && empty($cancel)) header("Location: list.php"); exit; } - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -192,19 +191,16 @@ if ($action == 'delete') $db->commit(); header("Location: ".DOL_URL_ROOT.'/salaries/list.php'); exit; - } - else { + } else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); } } @@ -489,12 +485,10 @@ if ($id) if (!empty($user->rights->salaries->delete)) { print ''; - } - else { + } else { print ''; } - } - else { + } else { print ''; } print ""; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 9fddd59ce51..34b58a5c0e4 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -182,8 +182,7 @@ class PaymentSalary extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -262,8 +261,7 @@ class PaymentSalary extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -478,8 +476,7 @@ class PaymentSalary extends CommonObject if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); - } - else { + } else { $this->error = $acc->error; $error++; } @@ -521,20 +518,17 @@ class PaymentSalary extends CommonObject $result = $this->call_trigger('PAYMENT_SALARY_CREATE', $user); if ($result < 0) $error++; // End call triggers - } - else $error++; + } else $error++; if (!$error) { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -557,8 +551,7 @@ class PaymentSalary extends CommonObject if ($result) { return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -616,8 +609,7 @@ class PaymentSalary extends CommonObject $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; */ - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -669,8 +661,7 @@ class PaymentSalary extends CommonObject $this->date_creation = $this->db->jdate($obj->datec); } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 0e6a1bccba0..69680df6a2a 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -128,8 +128,7 @@ if ($object->id) $permission = $user->rights->salaries->write; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index b06ad2348e4..6c4ee37a979 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -67,8 +67,7 @@ if (!GETPOST('typeid', 'int')) $part = explode(':', $val); if ($part[0] == 's.fk_typepayment') $typeid = $part[1]; } -} -else { +} else { $typeid = GETPOST('typeid', 'int'); } @@ -287,8 +286,7 @@ if ($result) } $accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); - } - else print ' '; + } else print ' '; print ''; if (!$i) $totalarray['nbfield']++; } @@ -316,8 +314,7 @@ if ($result) print ''; $db->free($result); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index b0023de8b64..06beda8ce41 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -256,8 +256,7 @@ print '
'; // Show graphs print '
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { print $px1->show(); print "
\n"; /*print $px2->show(); diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index fa99e4610d5..72d055da41d 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -48,8 +48,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 9f2a044525d..8d965c69c2c 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -99,8 +99,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $action = 'create'; - } - else { + } else { $object->ref = $ref; $object->description = $description; $object->fk_code_type_resource = $fk_code_type_resource; @@ -117,15 +116,13 @@ if (empty($reshook)) setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs'); Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { // Creation KO setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } } - } - else { + } else { Header("Location: list.php"); exit; } @@ -162,13 +159,11 @@ if (empty($reshook)) { Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } @@ -192,12 +187,10 @@ if (empty($reshook)) setEventMessages($langs->trans('RessourceSuccessfullyDeleted'), null, 'mesgs'); Header('Location: '.DOL_URL_ROOT.'/resource/list.php'); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -220,8 +213,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) { print load_fiche_titre($title, '', 'object_resource'); dol_fiche_head(''); - } - else { + } else { $head = resource_prepare_head($object); dol_fiche_head($head, 'resource', $title, -1, 'resource'); } @@ -283,8 +275,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) print ''; print ''; - } - else { + } else { $formconfirm = ''; // Confirm deleting resource line @@ -384,8 +375,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) } } print ''; -} -else { +} else { dol_print_error(); } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 41c0db7ec15..294f36e5589 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -164,8 +164,7 @@ class Dolresource extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return $this->id; } @@ -222,8 +221,7 @@ class Dolresource extends CommonObject $this->db->free($resql); return $this->id; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -327,8 +325,7 @@ class Dolresource extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -385,8 +382,7 @@ class Dolresource extends CommonObject $this->db->free($resql); return $this->id; - } - else { + } else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -423,8 +419,7 @@ class Dolresource extends CommonObject $this->error = $this->db->lasterror(); $error++; } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -470,8 +465,7 @@ class Dolresource extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -516,11 +510,9 @@ class Dolresource extends CommonObject foreach ($filter as $key => $value) { if (strpos($key, 'date')) { $sql .= ' AND '.$key.' = \''.$this->db->idate($value).'\''; - } - elseif (strpos($key, 'ef.') !== false) { + } elseif (strpos($key, 'ef.') !== false) { $sql .= $value; - } - else { + } else { $sql .= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } @@ -561,8 +553,7 @@ class Dolresource extends CommonObject $this->db->free($resql); } return $num; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -601,8 +592,7 @@ class Dolresource extends CommonObject foreach ($filter as $key => $value) { if (strpos($key, 'date')) { $sql .= ' AND '.$key.' = \''.$this->db->idate($value).'\''; - } - else { + } else { $sql .= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } @@ -638,8 +628,7 @@ class Dolresource extends CommonObject $this->db->free($resql); } return $num; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -682,8 +671,7 @@ class Dolresource extends CommonObject foreach ($filter as $key => $value) { if (strpos($key, 'date')) { $sql .= ' AND '.$key.' = \''.$this->db->idate($value).'\''; - } - else { + } else { $sql .= ' AND '.$key.' LIKE \'%'.$this->db->escape($value).'%\''; } } @@ -716,8 +704,7 @@ class Dolresource extends CommonObject $this->db->free($resql); } return $num; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -807,8 +794,7 @@ class Dolresource extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -914,8 +900,7 @@ class Dolresource extends CommonObject $i++; } return $num; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -967,8 +952,7 @@ class Dolresource extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 3eeebeaee45..451ca9922b1 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -126,8 +126,7 @@ class FormResource if ($selected > 0 && $selected == $resourcestat->lines[$i]->id) { $out .= ''; - } - else { + } else { $out .= ''; } @@ -145,8 +144,7 @@ class FormResource $out .= ''; } - } - else { + } else { dol_print_error($this->db); } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index dc916aa5f77..ee20d918648 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -62,8 +62,7 @@ if ($action == 'addcontact' && $user->rights->resource->write) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); @@ -90,8 +89,7 @@ elseif ($action == 'deletecontact' && $user->rights->resource->write) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 0e6b20923b5..077430cf4bb 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -136,8 +136,7 @@ if ($object->id > 0) $permission = $user->rights->resource->write; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 8e353b59788..dd3a02e18e3 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -97,8 +97,7 @@ if (empty($reshook)) $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Resource")), null, 'errors'); $action = ''; - } - else { + } else { $objstat = fetchObjectByElement($element_id, $element, $element_ref); $objstat->element = $element; // For externals module, we need to keep @xx @@ -168,8 +167,7 @@ if (empty($reshook)) setEventMessages($langs->trans('ResourceLinkedWithSuccess'), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF'].'?element='.$element.'&element_id='.$objstat->id); exit; - } - elseif ($objstat) + } elseif ($objstat) { setEventMessages($objstat->error, $objstat->errors, 'errors'); } @@ -264,8 +262,7 @@ if (empty($reshook)) setEventMessages($langs->trans('RessourceLineSuccessfullyDeleted'), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); exit; - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -295,8 +292,7 @@ if ($ret == -1) { } if (!$ret) { print '
'.$langs->trans('NoResourceInDatabase').'
'; -} -else { +} else { // Confirmation suppression resource line if ($action == 'delete_resource') { @@ -408,8 +404,7 @@ else { } } $_SESSION['assignedtouser'] = json_encode($listofuserid); - } - else { + } else { if (!empty($_SESSION['assignedtouser'])) { $listofuserid = json_decode($_SESSION['assignedtouser'], true); @@ -596,8 +591,7 @@ else { if (file_exists(dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_add.tpl.php'))) { $tpl = dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_add.tpl.php'); - } - else { + } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/resource_add.tpl.php'; } if (empty($conf->file->strict_mode)) { @@ -615,8 +609,7 @@ else { if (file_exists(dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_view.tpl.php'))) { $tpl = dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_view.tpl.php'); - } - else { + } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/resource_view.tpl.php'; } if (empty($conf->file->strict_mode)) { diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 4f94c6c3e17..4dca64b47a6 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -281,8 +281,7 @@ if ($ret) print '
'.$langs->trans("NoRecordFound").'
\n"; - } - else { + } else { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print ''; - } - else { + } else { print ''; @@ -520,8 +501,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -551,8 +531,7 @@ foreach ($dirsociete as $dirroot) try { dol_include_once($dirroot.'doc/'.$file); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -589,15 +568,13 @@ foreach ($dirsociete as $dirroot) // print img_picto($langs->trans("Enabled"),'on'); //} print ""; - } - else { + } else { if (versioncompare($module->phpmin, versionphparray()) > 0) { print ""; - } - else { + } else { print ""; @@ -623,8 +600,7 @@ foreach ($dirsociete as $dirroot) if ($module->type == 'pdf') { $linkspec = ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { $linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print $linkspec; @@ -693,8 +669,7 @@ foreach ($profid as $key => $val) print ''; - } - else { + } else { print ''; @@ -705,8 +680,7 @@ foreach ($profid as $key => $val) print ''; - } - else { + } else { print ''; @@ -717,8 +691,7 @@ foreach ($profid as $key => $val) print ''; - } - else { + } else { print ''; @@ -759,8 +732,7 @@ if (!$conf->use_javascript_ajax) print '"; -} -else { +} else { print '"; -} -else { +} else { print ''; - } - elseif ($mysoc->localtax1_assuj == "1") + } elseif ($mysoc->localtax1_assuj == "1") { $this->tpl['localtax'] .= ''; - } - elseif ($mysoc->localtax2_assuj == "1") + } elseif ($mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= ''; } } - } - else { + } else { $head = societe_prepare_head($this->object); $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company'); @@ -306,8 +303,7 @@ abstract class ActionsCardCommon if ($nbofsalesrepresentative > 3) // We print only number { $this->tpl['sales_representatives'] .= $nbofsalesrepresentative; - } - elseif ($nbofsalesrepresentative > 0) + } elseif ($nbofsalesrepresentative > 0) { $userstatic = new User($this->db); $i = 0; @@ -320,8 +316,7 @@ abstract class ActionsCardCommon $i++; if ($i < $nbofsalesrepresentative) $this->tpl['sales_representatives'] .= ', '; } - } - else $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected"); + } else $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected"); // Linked member if (!empty($conf->adherent->enabled)) @@ -333,8 +328,7 @@ abstract class ActionsCardCommon { $adh->ref = $adh->getFullName($langs); $this->tpl['linked_member'] = $adh->getNomUrl(1); - } - else { + } else { $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember"); } } @@ -351,13 +345,11 @@ abstract class ActionsCardCommon $this->tpl['localtax'] .= ''; $this->tpl['localtax'] .= ''; $this->tpl['localtax'] .= ''; - } - elseif ($mysoc->localtax1_assuj == "1") + } elseif ($mysoc->localtax1_assuj == "1") { $this->tpl['localtax'] .= ''; $this->tpl['localtax'] .= ''; - } - elseif ($mysoc->localtax2_assuj == "1") + } elseif ($mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= ''; $this->tpl['localtax'] .= ''; diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 348163195d9..73453aff62e 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -134,16 +134,13 @@ class ActionsCardCompany extends ActionsCardCommon { $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); - } - else { + } else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } - } - else { + } else { $this->tpl['tva_intra'] = $s; } - } - else { + } else { // Confirm delete third party if ($action == 'delete') { @@ -170,16 +167,13 @@ class ActionsCardCompany extends ActionsCardCommon { $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); - } - else { + } else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } - } - else { + } else { $this->tpl['tva_intra'] = $s; } - } - else { + } else { $this->tpl['tva_intra'] = ' '; } @@ -190,8 +184,7 @@ class ActionsCardCompany extends ActionsCardCommon $socm->fetch($this->object->parent); $this->tpl['parent_company'] = $socm->getNomUrl(1).' '.($socm->code_client ? "(".$socm->code_client.")" : ""); $this->tpl['parent_company'] .= ($socm->town ? ' - '.$socm->town : ''); - } - else { + } else { $this->tpl['parent_company'] = $langs->trans("NoParentCompany"); } } diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 6a93ac3e939..3abb9e9b6f7 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -110,8 +110,7 @@ class ActionsCardIndividual extends ActionsCardCommon if ($action == 'create' || $action == 'edit') { $this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civility_id')); - } - else { + } else { // Confirm delete third party if ($action == 'delete' || $conf->use_javascript_ajax) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 77299e3ee89..f468f4f63ce 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -136,8 +136,7 @@ if (empty($reshook)) { $langs->load('errors'); setEventMessages($langs->trans('ErrorThirdPartyIdIsMandatory', $langs->transnoentitiesnoconv('MergeOriginThirdparty')), null, 'errors'); - } - else { + } else { if (!$error && $soc_origin->fetch($soc_origin_id) < 1) { setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors'); @@ -300,8 +299,7 @@ if (empty($reshook)) { setEventMessages($langs->trans('ThirdpartiesMergeSuccess'), null, 'mesgs'); $db->commit(); - } - else { + } else { $langs->load("errors"); setEventMessages($langs->trans('ErrorsThirdpartyMerge'), null, 'errors'); $db->rollback(); @@ -389,8 +387,7 @@ if (empty($reshook)) { $ret = $object->fetch($socid); $object->oldcopy = clone $object; - } - else $object->canvas = $canvas; + } else $object->canvas = $canvas; if (GETPOST("private", 'int') == 1) // Ask to create a contact { @@ -401,8 +398,7 @@ if (empty($reshook)) // Add non official properties $object->name_bis = GETPOST('name', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); - } - else { + } else { $object->name = GETPOST('name', 'alpha'); } $object->entity = (GETPOSTISSET('entity') ?GETPOST('entity', 'int') : $conf->entity); @@ -605,15 +601,13 @@ if (empty($reshook)) if (!$result > 0) { $errors[] = "ErrorFailedToSaveFile"; - } - else { + } else { // Create thumbs $object->addThumbs($newfile); } } } - } - else { + } else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -626,8 +620,7 @@ if (empty($reshook)) } } // Gestion du logo de la société - } - else { + } else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case { $duplicate_code_error = true; @@ -649,8 +642,7 @@ if (empty($reshook)) if (preg_match('/\?/', $backtopage)) $backtopage .= '&socid='.$object->id; // Old method header("Location: ".$backtopage); exit; - } - else { + } else { $url = $_SERVER["PHP_SELF"]."?socid=".$object->id; // Old method if (($object->client == 1 || $object->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $url = DOL_URL_ROOT."/comm/card.php?socid=".$object->id; elseif ($object->fournisseur == 1) $url = DOL_URL_ROOT."/fourn/card.php?socid=".$object->id; @@ -658,8 +650,7 @@ if (empty($reshook)) header("Location: ".$url); exit; } - } - else { + } else { $db->rollback(); $action = 'create'; } @@ -675,8 +666,7 @@ if (empty($reshook)) { header("Location: ".$backtopage); exit; - } - else { + } else { header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } @@ -750,8 +740,7 @@ if (empty($reshook)) if (!$result > 0) { $errors[] = "ErrorFailedToSaveFile"; - } - else { + } else { // Create thumbs $object->addThumbs($newfile); @@ -766,12 +755,10 @@ if (empty($reshook)) } } } - } - else { + } else { $errors[] = "ErrorBadImageFormat"; } - } - else { + } else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -805,19 +792,16 @@ if (empty($reshook)) { header("Location: ".$backtopage); exit; - } - else { + } else { header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } - } - else { + } else { $object->id = $socid; $action = "edit"; } } - } - else { + } else { $action = ($action == 'add' ? 'create' : 'edit'); } } @@ -833,8 +817,7 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT."/societe/list.php?restore_lastsearch_values=1&delsoc=".urlencode($object->name)); exit; - } - else { + } else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -903,8 +886,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // ----------------------------------------- $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template -} -else { +} else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -972,8 +954,7 @@ else { $object->code_client = GETPOST('customer_code', 'alpha'); $object->fournisseur = GETPOST('fournisseur') ?GETPOST('fournisseur') : $object->fournisseur; $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); - } - else { + } else { setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'), '', 'warnings'); } @@ -1044,8 +1025,7 @@ else { if (!$result > 0) { $errors[] = "ErrorFailedToSaveFile"; - } - else { + } else { // Create thumbs $object->addThumbs($newfile); } @@ -1186,8 +1166,7 @@ else { if ($object->particulier || $private) { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; - } - else { + } else { print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; @@ -1322,8 +1301,7 @@ else { if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { print ''; - } - elseif ($mysoc->localtax1_assuj == "1") + } elseif ($mysoc->localtax1_assuj == "1") { print ''; - } - elseif ($mysoc->localtax2_assuj == "1") + } elseif ($mysoc->localtax2_assuj == "1") { print ''; @@ -1556,16 +1530,14 @@ else { { print '     '; print ''; - } - else { + } else { print '     '; print ''; } print ''."\n"; print ''."\n"; - } - elseif ($action == 'edit') + } elseif ($action == 'edit') { //print load_fiche_titre($langs->trans("EditCompany")); @@ -1813,8 +1785,7 @@ else { { print ''; print $object->prefix_comm; - } - else { + } else { print ''; } print ''; @@ -1835,12 +1806,10 @@ else { if (empty($tmpcode) && !empty($object->oldcopy->code_client)) $tmpcode = $object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. if (empty($tmpcode) && !empty($modCodeClient->code_auto)) $tmpcode = $modCodeClient->getNextValue($object, 0); print ''; - } - elseif ($object->codeclient_modifiable()) + } elseif ($object->codeclient_modifiable()) { print ''; - } - else { + } else { print $object->code_client; print ''; } @@ -1875,12 +1844,10 @@ else { if (empty($tmpcode) && !empty($object->oldcopy->code_fournisseur)) $tmpcode = $object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) $tmpcode = $modCodeFournisseur->getNextValue($object, 1); print ''; - } - elseif ($object->codefournisseur_modifiable()) + } elseif ($object->codefournisseur_modifiable()) { print ''; - } - else { + } else { print $object->code_fournisseur; print ''; } @@ -1935,8 +1902,7 @@ else { if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { print ''; - } - elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") + } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { print ''; - } - elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") + } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { print ''; - } - else { + } else { print ''; } print ''; @@ -2397,8 +2358,7 @@ else { } print ''; } - } - elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") + } elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") { print ''; } - } - elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") + } elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") { print ''; @@ -2553,8 +2510,7 @@ else { if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } - else { + } else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?socid='.$object->id); } print ''; @@ -2587,8 +2543,7 @@ else { if ($action == 'editparentcompany') { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'editparentcompany', 's.rowid <> '.$object->id, 1); - } - else { + } else { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'none', 's.rowid <> '.$object->id, 1); } print ''; @@ -2610,8 +2565,7 @@ else { { $adh->ref = $adh->getFullName($langs); print $adh->getNomUrl(1); - } - else { + } else { print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; } print ''; @@ -2660,8 +2614,7 @@ else { { $langs->load("mails"); print ''.$langs->trans('SendMail').''; - } - else { + } else { $langs->load("mails"); print ''.$langs->trans('SendMail').''; } @@ -2692,8 +2645,7 @@ else { if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can't use preloaded confirm form with jmobile { print ''.$langs->trans('Delete').''."\n"; - } - else { + } else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 99e18f036aa..725cab96065 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -49,8 +49,7 @@ if (!$vatNumber) { print '
'; print ''.$langs->transnoentities("ErrorFieldRequired", $langs->trans("VATIntraShort")).'
'; -} -else { +} else { $vatNumber = preg_replace('/\^\w/', '', $vatNumber); $vatNumber = str_replace(array(' ', '.'), '', $vatNumber); $countryCode = substr($vatNumber, 0, 2); @@ -101,18 +100,15 @@ else { { print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; $messagetoshow = $soapclient->response; - } - elseif (preg_match('/TIMEOUT/i', $result['faultstring'])) + } elseif (preg_match('/TIMEOUT/i', $result['faultstring'])) { print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; $messagetoshow = $soapclient->response; - } - elseif (preg_match('/SERVER_BUSY/i', $result['faultstring'])) + } elseif (preg_match('/SERVER_BUSY/i', $result['faultstring'])) { print ''.$langs->trans("ErrorServiceUnavailableTryLater").'
'; $messagetoshow = $soapclient->response; - } - elseif ($result['faultstring']) + } elseif ($result['faultstring']) { print ''.$langs->trans("Error").'
'; $messagetoshow = $result['faultstring']; @@ -125,8 +121,7 @@ else { print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; print $langs->trans("ValueIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; //$messagetoshow=$soapclient->response; - } - else { + } else { // Syntaxe ok if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'
'; print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
'; @@ -134,16 +129,14 @@ else { if (preg_match('/MS_UNAVAILABLE/i', $result['faultstring'])) { print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE", $countryCode).'
'; - } - else { + } else { if (!empty($result['valid']) && ($result['valid'] == 1 || $result['valid'] == 'true')) { print ''.$langs->trans("Yes").''; print '
'; print $langs->trans("Name").': '.$result['name'].'
'; print $langs->trans("Address").': '.$result['address'].'
'; - } - else { + } else { print ''.$langs->trans("No").''; print '
'."\n"; } diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index bfaed41f21b..37d9239265f 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -208,8 +208,7 @@ class Contacts extends DolibarrApi $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve contacts : '.$sql); } if (!count($obj_ret)) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 3ec6243a2c7..ca3e4385837 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -143,9 +143,7 @@ class Thirdparties extends DolibarrApi // Select thirdparties of given category if ($category > 0) { - if (!empty($mode) && $mode != 4) { $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid"; } - elseif (!empty($mode) && $mode == 4) { $sql .= " AND cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid"; } - else { $sql .= " AND ((c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid) OR (cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid))"; } + if (!empty($mode) && $mode != 4) { $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid"; } elseif (!empty($mode) && $mode == 4) { $sql .= " AND cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid"; } else { $sql .= " AND ((c.fk_categorie = ".$db->escape($category)." AND c.fk_soc = t.rowid) OR (cc.fk_categorie = ".$db->escape($category)." AND cc.fk_soc = t.rowid))"; } } if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= " AND t.rowid = sc.fk_soc"; @@ -195,8 +193,7 @@ class Thirdparties extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieve thirdparties : '.$db->lasterror()); } if (!count($obj_ret)) { @@ -466,8 +463,7 @@ class Thirdparties extends DolibarrApi $db->rollback(); throw new RestException(500, 'Error failed to merged thirdparty '.$this->companytoremove->id.' into '.$id.'. Enable and read log file for more information.'); - } - else { + } else { $db->commit(); } @@ -1104,8 +1100,7 @@ class Thirdparties extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(404, 'Account not found'); } @@ -1311,8 +1306,7 @@ class Thirdparties extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(404, 'Bank account not found'); } @@ -1328,8 +1322,7 @@ class Thirdparties extends DolibarrApi if ($result > 0) { return array("success" => $result); - } - else { + } else { throw new RestException(500); } } diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 803d0ddebe3..3b289547f8d 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -83,8 +83,7 @@ class Client extends Societe } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 00737c04504..283c32573e0 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -111,17 +111,14 @@ class CompanyBankAccount extends Account if (!$error) { return 1; - } - else { + } else { return 0; } - } - else { + } else { return 1; } } - } - else { + } else { print $this->db->error(); return 0; } @@ -179,16 +176,13 @@ class CompanyBankAccount extends Account if (!$error) { return 1; - } - else { + } else { return -1; } - } - else { + } else { return 1; } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -251,8 +245,7 @@ class CompanyBankAccount extends Account $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -299,8 +292,7 @@ class CompanyBankAccount extends Account { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1 * $error; } @@ -345,8 +337,7 @@ class CompanyBankAccount extends Account if ($this->db->num_rows($result1) == 0) { return 0; - } - else { + } else { $obj = $this->db->fetch_object($result1); $this->db->begin(); @@ -366,14 +357,12 @@ class CompanyBankAccount extends Account dol_print_error($this->db); $this->db->rollback(); return -1; - } - else { + } else { $this->db->commit(); return 1; } } - } - else { + } else { dol_print_error($this->db); return -1; } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index ca75b904b11..93f0d13b498 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -404,8 +404,7 @@ class CompanyPaymentMode extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -439,8 +438,7 @@ class CompanyPaymentMode extends CommonObject if ($this->db->num_rows($result1) == 0) { return 0; - } - else { + } else { $obj = $this->db->fetch_object($result1); $type = ''; @@ -465,14 +463,12 @@ class CompanyPaymentMode extends CommonObject dol_print_error($this->db); $this->db->rollback(); return -1; - } - else { + } else { $this->db->commit(); return 1; } } - } - else { + } else { dol_print_error($this->db); return -1; } @@ -562,8 +558,7 @@ class CompanyPaymentMode extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e2b24577bf9..03290f1581d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -818,36 +818,31 @@ class Societe extends CommonObject $result = $this->call_trigger('COMPANY_CREATE', $user); if ($result < 0) $error++; // End call triggers - } - else $error++; + } else $error++; if (!$error) { dol_syslog(get_class($this)."::Create success id=".$this->id); $this->db->commit(); return $this->id; - } - else { + } else { dol_syslog(get_class($this)."::Create echec update ".$this->error." ".join(',', $this->errors), LOG_ERR); $this->db->rollback(); return -4; } - } - else { + } else { if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $langs->trans("ErrorCompanyNameAlreadyExists", $this->name); // duplicate on a field (code or profid or ...) $result = -1; - } - else { + } else { $this->error = $this->db->lasterror(); $result = -2; } $this->db->rollback(); return $result; } - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::Create fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -925,16 +920,13 @@ class Societe extends CommonObject if ($rescode == -1) { $this->errors[] = 'ErrorBadCustomerCodeSyntax'; - } - elseif ($rescode == -2) + } elseif ($rescode == -2) { $this->errors[] = 'ErrorCustomerCodeRequired'; - } - elseif ($rescode == -3) + } elseif ($rescode == -3) { $this->errors[] = 'ErrorCustomerCodeAlreadyUsed'; - } - elseif ($rescode == -4) + } elseif ($rescode == -4) { $this->errors[] = 'ErrorPrefixRequired'; } @@ -950,16 +942,13 @@ class Societe extends CommonObject if ($rescode == -1) { $this->errors[] = 'ErrorBadSupplierCodeSyntax'; - } - elseif ($rescode == -2) + } elseif ($rescode == -2) { $this->errors[] = 'ErrorSupplierCodeRequired'; - } - elseif ($rescode == -3) + } elseif ($rescode == -3) { $this->errors[] = 'ErrorSupplierCodeAlreadyUsed'; - } - elseif ($rescode == -5) + } elseif ($rescode == -5) { $this->errors[] = 'ErrorPrefixRequired'; } @@ -1002,8 +991,7 @@ class Societe extends CommonObject $this->errors[] = $langs->transcountry('ProfId'.$i, $this->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } - } - else { + } else { //var_dump($conf->global->SOCIETE_EMAIL_UNIQUE); //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') @@ -1248,20 +1236,16 @@ class Societe extends CommonObject if ($this->localtax1_value != '') { $sql .= ",localtax1_value =".$this->localtax1_value; - } - else $sql .= ",localtax1_value =0.000"; - } - else $sql .= ",localtax1_value =0.000"; + } else $sql .= ",localtax1_value =0.000"; + } else $sql .= ",localtax1_value =0.000"; if ($this->localtax2_assuj == 1) { if ($this->localtax2_value != '') { $sql .= ",localtax2_value =".$this->localtax2_value; - } - else $sql .= ",localtax2_value =0.000"; - } - else $sql .= ",localtax2_value =0.000"; + } else $sql .= ",localtax2_value =0.000"; + } else $sql .= ",localtax2_value =0.000"; $sql .= ",capital = ".($this->capital == '' ? "null" : $this->capital); @@ -1331,8 +1315,7 @@ class Societe extends CommonObject unset($this->state_code); unset($this->state); } - } - else { + } else { unset($this->country_code); // We clean this, in the doubt, because it may have been changed after an update of country_id unset($this->country); unset($this->state_code); @@ -1375,8 +1358,7 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); $error++; } - } - elseif ($result < 0) + } elseif ($result < 0) { $this->error = $lmember->error; $error++; @@ -1418,28 +1400,24 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::Update success"); $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // Doublon $this->error = $langs->trans("ErrorDuplicateField"); $result = -1; - } - else { + } else { $this->error = $this->db->lasterror(); $result = -2; } $this->db->rollback(); return $result; } - } - else { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::Update fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1531,8 +1509,7 @@ class Societe extends CommonObject $this->error = 'Fetch found several records. Rename one of thirdparties to avoid duplicate.'; dol_syslog($this->error, LOG_ERR); $result = -2; - } - elseif ($num) // $num = 1 + } elseif ($num) // $num = 1 { $obj = $this->db->fetch_object($resql); @@ -1664,14 +1641,12 @@ class Societe extends CommonObject // fetch optionals attributes and labels $this->fetch_optionals(); - } - else { + } else { $result = 0; } $this->db->free($resql); - } - else { + } else { $this->error = $this->db->lasterror(); $result = -3; } @@ -1809,14 +1784,12 @@ class Societe extends CommonObject } return 1; - } - else { + } else { dol_syslog($this->error, LOG_ERR); $this->db->rollback(); return -1; } - } - else dol_syslog("Can't remove thirdparty with id ".$id.". There is ".$objectisused." childs", LOG_WARNING); + } else dol_syslog("Can't remove thirdparty with id ".$id.". There is ".$objectisused." childs", LOG_WARNING); return 0; } @@ -1842,8 +1815,7 @@ class Societe extends CommonObject { $this->client = $newclient; return 1; - } - else return -1; + } else return -1; } return 0; } @@ -2037,13 +2009,11 @@ class Societe extends CommonObject if ($result > 0) { return $result; - } - else { + } else { $this->error = $discount->error; return -3; } - } - else return 0; + } else return 0; } /** @@ -2064,8 +2034,7 @@ class Societe extends CommonObject if ($result >= 0) { return $result; - } - else { + } else { $this->error = $discountstatic->error; return -1; } @@ -2092,8 +2061,7 @@ class Societe extends CommonObject $sql .= " WHERE ((ug.fk_user = sc.fk_user"; $sql .= " AND ug.entity = ".$conf->entity.")"; $sql .= " OR u.admin = 1)"; - } - else $sql .= " WHERE entity in (0, ".$conf->entity.")"; + } else $sql .= " WHERE entity in (0, ".$conf->entity.")"; $sql .= " AND u.rowid = sc.fk_user AND sc.fk_soc = ".$this->id; @@ -2119,15 +2087,13 @@ class Societe extends CommonObject $reparray[$i]['entity'] = $obj->entity; $reparray[$i]['login'] = $obj->login; $reparray[$i]['photo'] = $obj->photo; - } - else { + } else { $reparray[] = $obj->rowid; } $i++; } return $reparray; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2231,8 +2197,7 @@ class Societe extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } @@ -2316,8 +2281,7 @@ class Societe extends CommonObject if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) { $name = $code.' '.$name; - } - else { + } else { $name = $code; } } @@ -2332,8 +2296,7 @@ class Societe extends CommonObject $label .= '
'; $label .= Form::showphoto('societe', $this, 0, 40, 0, '', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. $label .= '
'; - } - elseif (!empty($this->logo_squarred) && class_exists('Form')) + } elseif (!empty($this->logo_squarred) && class_exists('Form')) { /*$label.= '
'; $label.= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. @@ -2346,38 +2309,31 @@ class Societe extends CommonObject { $label .= ''.$langs->trans("ShowCustomer").''; $linkstart = ''; $linkstart = ''; $linkstart = ''; $linkstart = ''; $linkstart = ''; $linkstart = ''; $linkstart = ''; $linkstart = 'poste : "").(($mode != 'poste' && $property) ? " ".$sepa.$property.$sepb : ''); - } - else { + } else { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname, $obj->lastname)).(($mode != 'poste' && $property) ? " ".$sepa.$property.$sepb : ''); } } $i++; } } - } - else { + } else { dol_print_error($this->db); } return $contact_property; @@ -2651,8 +2605,7 @@ class Societe extends CommonObject $i++; } } - } - else { + } else { dol_print_error($this->db); } return $contacts; @@ -2687,8 +2640,7 @@ class Societe extends CommonObject $i++; } } - } - else { + } else { dol_print_error($this->db); } return $contacts; @@ -2726,8 +2678,7 @@ class Societe extends CommonObject elseif ($mode == 'mobile') $contact_property = $obj->phone_mobile; } return $contact_property; - } - else { + } else { dol_print_error($this->db); } } @@ -2751,8 +2702,7 @@ class Societe extends CommonObject if ($mode == 'label') { return $bac->getRibLabel(true); - } - elseif ($mode == 'rum') + } elseif ($mode == 'rum') { if (empty($bac->rum)) { @@ -2762,8 +2712,7 @@ class Societe extends CommonObject $bac->rum = $prelevement->buildRumNumber($bac->thirdparty->code_client, $bac->datec, $bac->id); } return $bac->rum; - } - elseif ($mode == 'format') + } elseif ($mode == 'format') { return $bac->frstrecur; } @@ -2893,8 +2842,7 @@ class Societe extends CommonObject if ($mod->code_modifiable_invalide && $this->check_codeclient() < 0) return 1; if ($mod->code_modifiable) return 1; // A mettre en dernier return 0; - } - else { + } else { return 0; } } @@ -2928,8 +2876,7 @@ class Societe extends CommonObject if ($mod->code_modifiable_invalide && $this->check_codefournisseur() < 0) return 1; if ($mod->code_modifiable) return 1; // A mettre en dernier return 0; - } - else { + } else { return 0; } } @@ -2965,8 +2912,7 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::check_codeclient code_client=".$this->code_client." module=".$module); $result = $mod->verif($this->db, $this->code_client, $this, 0); return $result; - } - else { + } else { return 0; } } @@ -3001,8 +2947,7 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$module); $result = $mod->verif($this->db, $this->code_fournisseur, $this, 1); return $result; - } - else { + } else { return 0; } } @@ -3043,13 +2988,11 @@ class Societe extends CommonObject elseif ($type == 'supplier') $this->code_compta_fournisseur = $mod->code; return $result; - } - else { + } else { $this->error = 'ErrorAccountancyCodeNotDefined'; return -1; } - } - else { + } else { if ($type == 'customer') $this->code_compta = ''; elseif ($type == 'supplier') $this->code_compta_fournisseur = ''; @@ -3078,12 +3021,10 @@ class Societe extends CommonObject { $this->parent = $id; return 1; - } - else { + } else { return -1; } - } - else return -1; + } else return -1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -3173,8 +3114,7 @@ class Societe extends CommonObject { $obj = $this->db->fetch_object($resql); $count = $obj->idprof; - } - else { + } else { $count = 0; print $this->db->error(); } @@ -3324,8 +3264,7 @@ class Societe extends CommonObject //Check NIF if (preg_match('/(^[0-9]{9}$)/', $string)) { return 1; - } - else { + } else { return -1; } } @@ -3379,8 +3318,7 @@ class Societe extends CommonObject if ($url) { return ''.$langs->trans("Check").''; } - } - else { + } else { return $hookmanager->resPrint; } @@ -3402,8 +3340,7 @@ class Societe extends CommonObject { $obj = $this->db->fetch_object($resql); $count = $obj->numproj; - } - else { + } else { $count = 0; print $this->db->error(); } @@ -3452,8 +3389,7 @@ class Societe extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -3471,11 +3407,9 @@ class Societe extends CommonObject $isacompany = empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES) ? 0 : 1; // 0 by default if (!empty($this->tva_intra)) { $isacompany = 1; - } - elseif (!empty($this->idprof1) || !empty($this->idprof2) || !empty($this->idprof3) || !empty($this->idprof4) || !empty($this->idprof5) || !empty($this->idprof6)) { + } elseif (!empty($this->idprof1) || !empty($this->idprof2) || !empty($this->idprof3) || !empty($this->idprof4) || !empty($this->idprof5) || !empty($this->idprof6)) { $isacompany = 1; - } - elseif (!empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN') + } elseif (!empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN') { // TODO Add a field is_a_company into dictionary if (preg_match('/^TE_PRIVATE/', $this->typent_code)) $isacompany = 0; @@ -3518,8 +3452,7 @@ class Societe extends CommonObject $this->SupplierCategories[$obj->rowid] = $obj->label; } return 0; - } - else { + } else { return -1; } } @@ -3540,8 +3473,7 @@ class Societe extends CommonObject $sql .= " VALUES (".$categorie_id.", ".$this->id.")"; if ($resql = $this->db->query($sql)) return 0; - } - else { + } else { return 0; } return -1; @@ -3603,15 +3535,13 @@ class Societe extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } - } - else { + } else { // $this->error deja positionne dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".join(',', $this->errors), LOG_ERR); @@ -3652,8 +3582,7 @@ class Societe extends CommonObject { $country_code = $tmp[1]; $country_label = $tmp[2]; - } - else // For backward compatibility + } else // For backward compatibility { dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -3677,8 +3606,7 @@ class Societe extends CommonObject { $state_code = $tmp[1]; $state_label = $tmp[2]; - } - else // For backward compatibility + } else // For backward compatibility { dol_syslog("Your state setup use an old syntax. Reedit it using setup area.", LOG_ERR); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -3816,8 +3744,7 @@ class Societe extends CommonObject if ($resql) { return ($this->db->num_rows($resql) > 0); - } - else return false; + } else return false; } /** @@ -3837,8 +3764,7 @@ class Societe extends CommonObject if ($resql) { return ($this->db->num_rows($resql) > 0); - } - else return false; + } else return false; } /** @@ -3860,8 +3786,7 @@ class Societe extends CommonObject { $obj = $this->db->fetch_object($resql); return (($obj->nb > 0) ?true:false); - } - else { + } else { $this->error = $this->db->lasterror(); return false; } @@ -4026,8 +3951,7 @@ class Societe extends CommonObject } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' - } - else return array(); + } else return array(); } /** @@ -4065,8 +3989,7 @@ class Societe extends CommonObject } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' - } - else return array(); + } else return array(); } /** @@ -4107,8 +4030,7 @@ class Societe extends CommonObject { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $tmpobject = new FactureFournisseur($this->db); - } - else { + } else { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $tmpobject = new Facture($this->db); } @@ -4143,8 +4065,7 @@ class Societe extends CommonObject } } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' - } - else { + } else { return array(); } } @@ -4203,16 +4124,14 @@ class Societe extends CommonObject $result = $companybankaccount->fetch($moreparams['use_companybankid']); if (!$result) dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); $result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - } - else { + } else { // Positionne le modele sur le nom du modele a utiliser if (!dol_strlen($modele)) { if (!empty($conf->global->COMPANY_ADDON_PDF)) { $modele = $conf->global->COMPANY_ADDON_PDF; - } - else { + } else { print $langs->trans("Error")." ".$langs->trans("Error_COMPANY_ADDON_PDF_NotDefined"); return 0; } diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 1f99e9bae8a..ba32086cc4d 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -433,8 +433,7 @@ class SocieteAccount extends CommonObject } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } - else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); $linkstart = ''; @@ -477,33 +476,27 @@ class SocieteAccount extends CommonObject $prefix = ''; if ($status == 1) return $langs->trans('Enabled'); elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 1) + } elseif ($mode == 1) { if ($status == 1) return $langs->trans('Enabled'); elseif ($status == 0) return $langs->trans('Disabled'); - } - elseif ($mode == 2) + } elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 3) + } elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 4) + } elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); - } - elseif ($mode == 5) + } elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); - } - elseif ($mode == 6) + } elseif ($mode == 6) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); @@ -556,8 +549,7 @@ class SocieteAccount extends CommonObject } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 2660625bd1c..312835e1a80 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -427,8 +427,7 @@ if ($sql_select) if ($type_element == 'contract') { print $documentstaticline->getLibStatut(2); - } - else { + } else { print $documentstatic->getLibStatut(2); } print ''; @@ -470,8 +469,7 @@ if ($sql_select) } $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; - } - else { + } else { $label = $objp->product_label; } @@ -505,27 +503,23 @@ if ($sql_select) $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); - } - elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) + } elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); - } - elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + } elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; - } - else { + } else { echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } - } - else { + } else { if ($objp->fk_product > 0) { echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); @@ -603,8 +597,7 @@ if ($sql_select) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); } $db->free($resql); -} -elseif (empty($type_element) || $type_element == -1) +} elseif (empty($type_element) || $type_element == -1) { print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', ''); @@ -621,8 +614,7 @@ elseif (empty($type_element) || $type_element == -1) print '
'; print "
'; -if ($mesg) { print $mesg; } -else { +if ($mesg) { print $mesg; } else { print $px1->show(); print "
\n"; print $px2->show(); diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 307b903787e..21ee679292a 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -53,8 +53,7 @@ if ($action == 'setcodeclient') { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -65,8 +64,7 @@ if ($action == 'setcodecompta') { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -81,8 +79,7 @@ if ($action == 'updateoptions') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -95,8 +92,7 @@ if ($action == 'updateoptions') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -109,8 +105,7 @@ if ($action == 'updateoptions') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -172,8 +167,7 @@ if ($action == 'setdoc') if ($result1 && $result2) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -186,8 +180,7 @@ if ($action == "setaddrefinlist") { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -200,8 +193,7 @@ if ($action == "setaddadressinlist") { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -214,8 +206,7 @@ if ($action == "setaskforshippingmet") { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -228,8 +219,7 @@ if ($action == "setdisableprospectcustomer") { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -244,8 +234,7 @@ if ($action == 'setprofid') { //header("Location: ".$_SERVER["PHP_SELF"]); //exit; - } - else { + } else { dol_print_error($db); } } @@ -260,8 +249,7 @@ if ($action == 'setprofidmandatory') { //header("Location: ".$_SERVER["PHP_SELF"]); //exit; - } - else { + } else { dol_print_error($db); } } @@ -276,8 +264,7 @@ if ($action == 'setprofidinvoicemandatory') { //header("Location: ".$_SERVER["PHP_SELF"]); //exit; - } - else { + } else { dol_print_error($db); } } @@ -291,8 +278,7 @@ if ($action == 'sethideinactivethirdparty') { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -303,8 +289,7 @@ if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -363,8 +348,7 @@ foreach ($dirsociete as $dirroot) try { dol_include_once($dirroot.$file.'.php'); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -396,8 +380,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) print '
'."\n"; print img_picto($langs->trans("Activated"), 'switch_on'); print "'; if (!$disabled) print ''; @@ -450,8 +433,7 @@ foreach ($dirsociete as $dirroot) try { dol_include_once($dirroot.$file.'.php'); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -481,8 +463,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '\n"; print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", join('.', $module->phpmin))), 'switch_off'); print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "'; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', @@ -782,8 +754,7 @@ if (!$conf->use_javascript_ajax) print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "'; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', @@ -807,8 +778,7 @@ if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -823,8 +793,7 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -841,8 +810,7 @@ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -858,8 +826,7 @@ if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 4142231261d..61d473f5c43 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -38,8 +38,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else { +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 1622b81384d..dc2d60df5e6 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -67,8 +67,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) } echo json_encode($outjson); -} -else { +} else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $langs->load("companies"); diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 0558d7d31c8..b98a5f75d5b 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -71,8 +71,7 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) $sql .= "nom LIKE '".$db->escape($socid)."%'"; $sql .= " OR code_client LIKE '".$db->escape($socid)."%'"; $sql .= " OR code_fournisseur LIKE '".$db->escape($socid)."%'"; - } - else { + } else { $sql .= "nom LIKE '%".$db->escape($socid)."%'"; $sql .= " OR code_client LIKE '%".$db->escape($socid)."%'"; $sql .= " OR code_fournisseur LIKE '%".$db->escape($socid)."%'"; @@ -99,11 +98,9 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) } echo json_encode($return_arr); - } - else { + } else { echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); } -} -else { +} else { echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 0cd103a2855..fa650a4e1fd 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -244,22 +244,19 @@ abstract class ActionsCardCommon $this->tpl['localtax'] .= ''.$langs->trans("LocalTax2IsUsedES").''; $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '
'.$langs->trans("LocalTax1IsUsedES").''; $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '
'.$langs->trans("LocalTax2IsUsedES").''; $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '
'.yn($this->object->localtax1_assuj).''.$langs->trans("LocalTax2IsUsedES").''.yn($this->object->localtax2_assuj).'
'.$langs->trans("LocalTax1IsUsedES").''.yn($this->object->localtax1_assuj).'
'.$langs->trans("LocalTax2IsUsedES").''.yn($this->object->localtax2_assuj).'
'.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; - } - else { + } else { print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } @@ -1411,8 +1389,7 @@ else { print "\n"; $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); - } - else { + } else { $s .= 'country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } @@ -1431,14 +1408,12 @@ else { print ''.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); print '
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax1assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1 : 0), 1); print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value', (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? $conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2 : 0), 1); @@ -1463,8 +1438,7 @@ else { if ($object->country_id) { print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); - } - else { + } else { print $countrynotdefined; } print '
'.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; - } - else { + } else { print '
'.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } @@ -2022,8 +1988,7 @@ else { print ''; } print '
'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).''; print $form->selectyesno('localtax1assuj_value', $object->localtax1_assuj, 1); @@ -2034,8 +1999,7 @@ else { print ''; } print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1); @@ -2071,8 +2035,7 @@ else { print "\n"; $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); - } - else { + } else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } @@ -2214,8 +2177,7 @@ else { print ''; } - } - else { + } else { /* * View */ @@ -2376,8 +2338,7 @@ else { print ''; $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); print ''.$object->localtax1_value.'
'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).''; print yn($object->localtax1_assuj); @@ -2418,8 +2378,7 @@ else { } print '
'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).''; print yn($object->localtax2_assuj); @@ -2469,14 +2428,12 @@ else { print "\n"; $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); - } - else { + } else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } print $s; - } - else { + } else { print ' '; } print '
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
"; -} -else { +} else { print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', ''); print ''."\n"; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 9f3751fd5b2..ba0241a90f7 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -166,8 +166,7 @@ if ($object->id) $permtoedit = $user->rights->societe->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { accessforbidden('', 0, 0); } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index c62ec602ecd..85c27a29b7e 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -95,8 +95,7 @@ if ($result) if (!empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { $found = 1; $third['other']++; } if ($found) $total++; } -} -else dol_print_error($db); +} else dol_print_error($db); print '
'; print '
'."\n"; @@ -119,8 +118,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + $dolgraph->draw('idgraphthirdparties'); print $dolgraph->show(); print ''."\n"; -} -else { +} else { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; @@ -184,8 +182,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA if ($i < $nbmax) { $dataseries[] = array($obj->label, round($obj->nb)); - } - else { + } else { $rest += $obj->nb; } $total += $obj->nb; @@ -204,8 +201,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $dolgraph->setHeight('200'); $dolgraph->draw('idgraphcateg'); print $dolgraph->show(); - } - else { + } else { while ($i < $num) { $obj = $db->fetch_object($result); @@ -331,8 +327,7 @@ if ($result) print ''; print "\n"; } -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index cb94da91e2f..4ead540eb8b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -386,8 +386,7 @@ if ($resql) if ($level == $obj->code) $level = $langs->trans($obj->label); $tab_level[$obj->code] = $level; } -} -else dol_print_error($db); +} else dol_print_error($db); $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,"; $sql .= " s.entity,"; @@ -1049,8 +1048,7 @@ while ($i < min($num, $limit)) if ($contextpage == 'poslist') { print $obj->name; - } - else { + } else { print $companystatic->getNomUrl(1, '', 100, 0, 1); } print "\n"; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 48a31085eb4..866a0e0964f 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -122,8 +122,7 @@ if ($object->id > 0) include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; dol_fiche_end(); -} -else { +} else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 0650261cefc..2a0d2603e5b 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -104,16 +104,14 @@ if (empty($reshook)) $error++; dol_print_error($db); } - } - else { + } else { dol_print_error($db); } if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -261,8 +259,7 @@ if ($result > 0) print ''; print ''; print ''; - } - else { + } else { print ''; @@ -290,8 +287,7 @@ if ($result > 0) if ($resql) { $num = $db->num_rows($resql); - } - else { + } else { dol_print_error($db); } @@ -329,8 +325,7 @@ if ($result > 0) if (isValidEmail($obj->email)) { print ' <'.$obj->email.'>'; - } - else { + } else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); } @@ -438,8 +433,7 @@ if ($result > 0) if ($resql) { $num = $db->num_rows($resql); - } - else { + } else { dol_print_error($db); } @@ -487,8 +481,7 @@ if ($result > 0) $contactstatic->firstname = $obj->firstname; print $contactstatic->getNomUrl(1); print $obj->email ? ' <'.$obj->email.'>' : $langs->trans("NoMail"); - } - else { + } else { print $obj->email; } print ''; @@ -522,8 +515,7 @@ if ($result > 0) print '
'; print $langs->trans("YouMustCreateContactFirst"); print '
'; print ''; -} -else dol_print_error('', 'RecordNotFound'); +} else dol_print_error('', 'RecordNotFound'); // End of page llxFooter(); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 2d5e0612959..fa01e2db095 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -175,8 +175,7 @@ if (empty($reshook)) if (!$result) { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); - } - else { + } else { // If this account is the default bank account, we disable others if ($companybankaccount->default_rib) { @@ -229,8 +228,7 @@ if (empty($reshook)) if (!$result) { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); - } - else { + } else { // If this account is the default bank account, we disable others if ($companypaymentmode->default_rib) { @@ -336,8 +334,7 @@ if (empty($reshook)) $url = $_SERVER["PHP_SELF"].'?socid='.$object->id; header('Location: '.$url); exit; - } - else { + } else { $db->rollback(); } } @@ -404,8 +401,7 @@ if (empty($reshook)) $url = $_SERVER["PHP_SELF"].'?socid='.$object->id; header('Location: '.$url); exit; - } - else { + } else { $db->rollback(); } } @@ -420,8 +416,7 @@ if (empty($reshook)) $url = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; header('Location: '.$url); exit; - } - else { + } else { setEventMessages($db->lasterror, null, 'errors'); } } @@ -446,12 +441,10 @@ if (empty($reshook)) $url = $_SERVER['PHP_SELF']."?socid=".$object->id; header('Location: '.$url); exit; - } - else { + } else { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } - } - else { + } else { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } } @@ -466,12 +459,10 @@ if (empty($reshook)) $url = $_SERVER['PHP_SELF']."?socid=".$object->id; header('Location: '.$url); exit; - } - else { + } else { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } - } - else { + } else { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } } @@ -506,16 +497,14 @@ if (empty($reshook)) { $error++; setEventMessages('ThisThirdpartyIsNotACustomer', null, 'errors'); - } - else { + } else { // Creation of Stripe customer + update of societe_account $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus, 1); if (!$cu) { $error++; setEventMessages($stripe->error, $stripe->errors, 'errors'); - } - else { + } else { $stripecu = $cu->id; } } @@ -529,8 +518,7 @@ if (empty($reshook)) { $error++; setEventMessages('ThisPaymentModeIsNotACard', null, 'errors'); - } - else { + } else { // Get the Stripe customer $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); if (!$cu) @@ -600,8 +588,7 @@ if (empty($reshook)) { $stripecu = $newcu; $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -656,8 +643,7 @@ if (empty($reshook)) { $stripesupplieracc = $newsup; $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -670,22 +656,19 @@ if (empty($reshook)) $url = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; header('Location: '.$url); exit; - } - catch (Exception $e) + } catch (Exception $e) { $error++; setEventMessages($e->getMessage(), null, 'errors'); } - } - elseif ($action == 'setassourcedefault') // Set as default when payment mode defined remotely only + } elseif ($action == 'setassourcedefault') // Set as default when payment mode defined remotely only { try { $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); if (preg_match('/pm_/', $source)) { $cu->invoice_settings->default_payment_method = (string) $source; // New - } - else { + } else { $cu->default_source = (string) $source; // Old } $result = $cu->save(); @@ -693,14 +676,12 @@ if (empty($reshook)) $url = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; header('Location: '.$url); exit; - } - catch (Exception $e) + } catch (Exception $e) { $error++; setEventMessages($e->getMessage(), null, 'errors'); } - } - elseif ($action == 'deletecard' && $source) + } elseif ($action == 'deletecard' && $source) { try { if (preg_match('/pm_/', $source)) @@ -710,8 +691,7 @@ if (empty($reshook)) { $payment_method->detach(); } - } - else { + } else { $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); $card = $cu->sources->retrieve("$source"); if ($card) { @@ -727,8 +707,7 @@ if (empty($reshook)) $url = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; header('Location: '.$url); exit; - } - catch (Exception $e) + } catch (Exception $e) { $error++; setEventMessages($e->getMessage(), null, 'errors'); @@ -766,8 +745,7 @@ if (!$id) { $companybankaccount->fetch(0, $object->id); $companypaymentmode->fetch(0, null, $object->id, 'card'); -} -else { +} else { $companybankaccount->fetch($id); $companypaymentmode->fetch($id); } @@ -958,8 +936,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { $listofsources = $customerstripe->sources->data; - } - else { + } else { $service = 'StripeTest'; $servicestatus = 0; if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) @@ -980,16 +957,14 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } $listofsources = $paymentmethodobjs->data; - } - catch (Exception $e) + } catch (Exception $e) { $error++; setEventMessages($e->getMessage(), null, 'errors'); } } } - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog("Error when searching/loading Stripe customer for thirdparty id =".$object->id); } @@ -1086,8 +1061,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $img = picto_from_langcode($companypaymentmodetemp->country_code); print $img ? $img.' ' : ''; print getCountry($companypaymentmodetemp->country_code, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; print ''; // Default print ''; @@ -1134,8 +1108,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $i++; } } - } - else dol_print_error($db); + } else dol_print_error($db); } // Show remote sources (not already shown as local source) @@ -1175,20 +1148,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ($src->object == 'card') { print img_credit_card($src->brand); - } - elseif ($src->object == 'source' && $src->type == 'card') + } elseif ($src->object == 'source' && $src->type == 'card') { print img_credit_card($src->card->brand); - } - elseif ($src->object == 'source' && $src->type == 'sepa_debit') + } elseif ($src->object == 'source' && $src->type == 'sepa_debit') { print ''; - } - elseif ($src->object == 'payment_method' && $src->type == 'card') + } elseif ($src->object == 'payment_method' && $src->type == 'card') { print img_credit_card($src->card->brand); - } - elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') + } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') { print ''; } @@ -1204,10 +1173,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $img = picto_from_langcode($src->country); print $img ? $img.' ' : ''; print getCountry($src->country, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; - } - elseif ($src->object == 'source' && $src->type == 'card') + } else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } elseif ($src->object == 'source' && $src->type == 'card') { print ''.$src->owner->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; print ''; @@ -1217,10 +1184,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $img = picto_from_langcode($src->card->country); print $img ? $img.' ' : ''; print getCountry($src->card->country, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; - } - elseif ($src->object == 'source' && $src->type == 'sepa_debit') + } else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } elseif ($src->object == 'source' && $src->type == 'sepa_debit') { print 'SEPA debit'; print ''; @@ -1229,10 +1194,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $img = picto_from_langcode($src->sepa_debit->country); print $img ? $img.' ' : ''; print getCountry($src->sepa_debit->country, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; - } - elseif ($src->object == 'payment_method' && $src->type == 'card') + } else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } elseif ($src->object == 'payment_method' && $src->type == 'card') { print ''.$src->billing_details->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; print ''; @@ -1242,10 +1205,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $img = picto_from_langcode($src->card->country); print $img ? $img.' ' : ''; print getCountry($src->card->country, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; - } - elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') + } else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') { print 'SEPA debit'; print ''; @@ -1254,10 +1215,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $img = picto_from_langcode($src->sepa_debit->country); print $img ? $img.' ' : ''; print getCountry($src->sepa_debit->country, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; - } - else { + } else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; + } else { print ''; } print ''; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 2f0595cf15d..278a85fa7f5 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -466,16 +466,14 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; } print ""; - } - else { + } else { print $langs->trans('None'); } print "\n".'

\n"; - } - else { + } else { // View mode /* ************************************************************************** */ @@ -588,8 +586,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n"; } - } - else { + } else { $colspan = 9; if ($user->rights->produit->supprimer || $user->rights->service->supprimer) $colspan += 1; print ''.$langs->trans('None').''; diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index e25b5c5e606..1369f29a185 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -78,14 +78,12 @@ if ($action == 'addcontact' && $user->rights->societe->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; - } - else { + } else { $mesg = '
'.$object->error.'
'; } } @@ -97,8 +95,7 @@ elseif ($action == 'swapstatut' && $user->rights->societe->creer) if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne')); - } - else { + } else { dol_print_error($db); } } @@ -113,8 +110,7 @@ elseif ($action == 'deletecontact' && $user->rights->societe->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } @@ -324,15 +320,13 @@ if ($id > 0 || !empty($ref)) print " ".img_warning($langs->trans("SubscriptionLate")); } print ''; - } - else { + } else { print ''; if ($objp->subscription == 'yes') { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) print " ".img_warning(); - } - else { + } else { print ' '; } print ''; @@ -345,8 +339,7 @@ if ($id > 0 || !empty($ref)) } } } - } - else { + } else { // Contrat non trouve print "ErrorRecordNotFound"; } diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 11b2d033b69..8ee338fba44 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -48,6 +48,5 @@ if ($nbofsalesrepresentative > 0) print $userstatic->getNomUrl(-1); print ' '; } -} -else print ''.$langs->trans("NoSalesRepresentativeAffected").''; +} else print ''.$langs->trans("NoSalesRepresentativeAffected").''; print ''; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index f20ac732fd4..728c076d1c8 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -136,8 +136,7 @@ if ($action == "setlive") $res = dolibarr_set_const($db, "STRIPE_LIVE", $liveenable, 'yesno', 0, '', $conf->entity); if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -236,14 +235,12 @@ if (empty($conf->stripeconnect->enabled)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; - } - else { + } else { print img_picto($langs->trans("inactive"), 'statut5'); } } @@ -307,20 +304,17 @@ if (empty($conf->stripeconnect->enabled)) { print ''; print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } //print $endpoint; - } - else { + } else { print img_picto($langs->trans("inactive"), 'statut5'); } } print ''; -} -else { +} else { print ''.$langs->trans("StripeConnect").''; print ''.$langs->trans("StripeConnect_Mode").''; } diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 74fa1aafc43..5672176168a 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -65,8 +65,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} -else { +} else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -84,8 +83,7 @@ if (!$rowid) if ($stripeacc) { $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc)); - } - else { + } else { $list = \Stripe\Charge::all($option); } @@ -177,19 +175,16 @@ if (!$rowid) if (!empty($tmparray['CUS']) && $tmparray['CUS'] > 0) { $societestatic->fetch($tmparray['CUS']); - } - elseif (!empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0) + } elseif (!empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0) { $societestatic->fetch($charge->metadata->dol_thirdparty_id); - } - else { + } else { $societestatic->id = 0; } if (!empty($tmparray['MEM']) && $tmparray['MEM'] > 0) { $memberstatic->fetch($tmparray['MEM']); - } - else { + } else { $memberstatic->id = 0; } @@ -227,8 +222,7 @@ if (!$rowid) if ($societestatic->id > 0) { print $societestatic->getNomUrl(1); - } - elseif ($memberstatic->id > 0) + } elseif ($memberstatic->id > 0) { print $memberstatic->getNomUrl(1); } diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 4b68ad72b09..2fafe09a693 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -75,8 +75,7 @@ class ActionsStripeconnect { $service = 'StripeTest'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); - } - else { + } else { $service = 'StripeLive'; } @@ -103,13 +102,11 @@ class ActionsStripeconnect if ($stripe->getStripeAccount($service) && $object->client != 0) { $customer = $stripe->customerStripe($object, $stripe->getStripeAccount($service)); $this->resprints .= $customer->id; - } - else { + } else { $this->resprints .= $langs->trans("NoStripe"); } $this->resprints .= ''; - } - elseif (is_object($object) && $object->element == 'member') { + } elseif (is_object($object) && $object->element == 'member') { $this->resprints .= ''; $this->resprints .= ''; print "
'; $this->resprints .= $langs->trans('StripeCustomer'); @@ -207,24 +204,19 @@ class ActionsStripeconnect { $langs->load("withdrawals"); print ''.$langs->trans("StripeConnectPay").''; - } - else { + } else { print ''.$langs->trans("StripeConnectPay").''; } - } - elseif ($resteapayer == 0) + } elseif ($resteapayer == 0) { print ''.$langs->trans("StripeConnectPay").''; } - } - else { + } else { print ''.$langs->trans("StripeConnectPay").''; } - } - elseif (is_object($object) && $object->element == 'invoice_supplier') { + } elseif (is_object($object) && $object->element == 'invoice_supplier') { print ''.$langs->trans("StripeConnectPay").''; - } - elseif (is_object($object) && $object->element == 'member') { + } elseif (is_object($object) && $object->element == 'member') { print ''.$langs->trans("StripeAutoSubscription").''; } return 0; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 4a56a2a1542..f3bb30d7efb 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -95,8 +95,7 @@ class Stripe extends CommonObject $sql .= " AND service = '".$mode."'"; if ($fk_soc > 0) { $sql .= " AND fk_soc = ".$fk_soc; - } - else { + } else { $sql .= " AND fk_soc IS NULL"; } $sql .= " AND fk_user IS NULL AND fk_adherent IS NULL"; @@ -113,8 +112,7 @@ class Stripe extends CommonObject } else { $tokenstring = ''; } - } - else { + } else { dol_print_error($this->db); } @@ -189,14 +187,12 @@ class Stripe extends CommonObject } else { $customer = \Stripe\Customer::retrieve("$tiers", array("stripe_account" => $key)); } - } - catch (Exception $e) + } catch (Exception $e) { // For exemple, we may have error: 'No such customer: cus_XXXXX; a similar object exists in live mode, but a test mode key was used to make this request.' $this->error = $e->getMessage(); } - } - elseif ($createifnotlinkedtostripe) + } elseif ($createifnotlinkedtostripe) { $ipaddress = getUserRemoteIP(); @@ -254,14 +250,12 @@ class Stripe extends CommonObject { $this->error = $this->db->lasterror(); } - } - catch (Exception $e) + } catch (Exception $e) { $this->error = $e->getMessage(); } } - } - else { + } else { dol_print_error($this->db); } @@ -289,8 +283,7 @@ class Stripe extends CommonObject } else { $stripepaymentmethod = \Stripe\PaymentMethod::retrieve(''.$paymentmethod->id.'', array("stripe_account" => $key)); } - } - catch (Exception $e) + } catch (Exception $e) { $this->error = $e->getMessage(); } @@ -480,8 +473,7 @@ class Stripe extends CommonObject $obj = $this->db->fetch_object($resql); if ($obj) $paymentintentalreadyexists++; } - } - else dol_print_error($this->db); + } else dol_print_error($this->db); // If not, we create it. if (!$paymentintentalreadyexists) @@ -497,19 +489,16 @@ class Stripe extends CommonObject dol_syslog(get_class($this)."::PaymentIntent failed to insert paymentintent with id=".$paymentintent->id." into database."); } } - } - else { + } else { $_SESSION["stripe_payment_intent"] = $paymentintent; } - } - catch (Stripe\Error\Card $e) + } catch (Stripe\Error\Card $e) { $error++; $this->error = $e->getMessage(); $this->code = $e->getStripeCode(); $this->declinecode = $e->getDeclineCode(); - } - catch (Exception $e) + } catch (Exception $e) { /*var_dump($dataforintent); var_dump($description); @@ -529,8 +518,7 @@ class Stripe extends CommonObject if (!$error) { return $paymentintent; - } - else { + } else { return null; } } @@ -654,8 +642,7 @@ class Stripe extends CommonObject { $_SESSION["stripe_setup_intent"] = $setupintent; }*/ - } - catch (Exception $e) + } catch (Exception $e) { /*var_dump($dataforintent); var_dump($description); @@ -671,8 +658,7 @@ class Stripe extends CommonObject { dol_syslog("getSetupIntent ".(is_object($setupintent) ? $setupintent->id : ''), LOG_INFO, -1); return $setupintent; - } - else { + } else { dol_syslog("getSetupIntent return error=".$error, LOG_INFO, -1); return null; } @@ -716,8 +702,7 @@ class Stripe extends CommonObject if (!preg_match('/^pm_/', $cardref)) { $card = $cu->sources->retrieve($cardref); - } - else { + } else { $card = \Stripe\PaymentMethod::retrieve($cardref); } } else { @@ -725,20 +710,17 @@ class Stripe extends CommonObject { //$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided $card = $cu->sources->retrieve($cardref); - } - else { + } else { //$card = \Stripe\PaymentMethod::retrieve($cardref, array("stripe_account" => $stripeacc)); // Don't know if this works $card = \Stripe\PaymentMethod::retrieve($cardref); } } - } - catch (Exception $e) + } catch (Exception $e) { $this->error = $e->getMessage(); dol_syslog($this->error, LOG_WARNING); } - } - elseif ($createifnotlinkedtostripe) + } elseif ($createifnotlinkedtostripe) { $exp_date_month = $obj->exp_date_month; $exp_date_year = $obj->exp_date_year; @@ -763,8 +745,7 @@ class Stripe extends CommonObject { $this->error = 'Creation of card on Stripe has failed'; } - } - else { + } else { $connect = ''; if (!empty($stripeacc)) $connect = $stripeacc.'/'; $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; @@ -786,8 +767,7 @@ class Stripe extends CommonObject { $this->error = 'Creation of card on Stripe has failed'; } - } - else { + } else { $connect = ''; if (!empty($stripeacc)) $connect = $stripeacc.'/'; $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$cu->id; @@ -816,16 +796,14 @@ class Stripe extends CommonObject $this->error = $this->db->lasterror(); } } - } - catch (Exception $e) + } catch (Exception $e) { $this->error = $e->getMessage(); dol_syslog($this->error, LOG_WARNING); } } } - } - else { + } else { dol_print_error($this->db); } @@ -935,8 +913,7 @@ class Stripe extends CommonObject if ($paymentintent->status == 'succeeded') { $charge->status = 'ok'; - } - else { + } else { $charge->status = 'failed'; $charge->failure_code = $stripe->code; $charge->failure_message = $stripe->error; @@ -945,8 +922,7 @@ class Stripe extends CommonObject $stripefailuremessage = $stripe->error; $stripefailuredeclinecode = $stripe->declinecode; } - } - elseif (preg_match('/acct_/i', $source)) + } elseif (preg_match('/acct_/i', $source)) { $charge = \Stripe\Charge::create(array( "amount" => "$stripeamount", @@ -1029,15 +1005,13 @@ class Stripe extends CommonObject { $charge->status = 'ok'; $charge->id = $paymentintent->id; - } - else { + } else { $charge->status = 'failed'; $charge->failure_code = $stripe->code; $charge->failure_message = $stripe->error; $charge->failure_declinecode = $stripe->declinecode; } - } - else { + } else { $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$description", "stripe_account" => "$account")); } } @@ -1049,8 +1023,7 @@ class Stripe extends CommonObject if (preg_match('/pm_/i', $source)) { $return->message = 'Payment retreived by card status = '.$charge->status; - } - else { + } else { if ($charge->source->type == 'card') { $return->message = $charge->source->card->brand." ....".$charge->source->card->last4; } elseif ($charge->source->type == 'three_d_secure') { diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 1efe9a7f386..e6dc75c04ec 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -47,8 +47,7 @@ $stripearrayofkeys = array(); if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')) { $stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test -} -else { +} else { $stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live } diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 741921ac63c..6823c32c0b7 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -64,8 +64,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} -else { +} else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -113,8 +112,7 @@ if (!$rowid) { if ($stripeacc) { $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); - } - else { + } else { $payout = \Stripe\Payout::all(array("limit" => $limit)); } diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index eb0ce7df09e..6f74d1a48c0 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -65,8 +65,7 @@ if (!empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETP $service = 'StripeTest'; $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} -else { +} else { $service = 'StripeLive'; $servicestatus = '1'; } @@ -112,8 +111,7 @@ if (!$rowid) { if ($stripeacc) { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); - } - else { + } else { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit)); } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index d911e310d90..dc696dcea90 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -133,15 +133,13 @@ if (empty($reshook)) if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); - } - else { + } else { if ($object->id > 0) { $result = $object->createFromClone($user, $socid); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit(); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -219,9 +217,7 @@ if (empty($reshook)) if (count($object->errors) > 0) setEventMessages($object->error, $object->errors, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors'); } - } - - elseif ($action == 'setdate_livraison' && $user->rights->supplier_proposal->creer) + } elseif ($action == 'setdate_livraison' && $user->rights->supplier_proposal->creer) { $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); if ($result < 0) @@ -439,13 +435,11 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit(); - } - else { + } else { $db->rollback(); $action = 'create'; } - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $action = 'create'; @@ -515,9 +509,7 @@ if (empty($reshook)) $ret = $object->fetch($id); // Reload to get new records $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } - - elseif ($action == "setabsolutediscount" && $user->rights->supplier_proposal->creer) { + } elseif ($action == "setabsolutediscount" && $user->rights->supplier_proposal->creer) { if ($_POST["remise_id"]) { if ($object->id > 0) { $result = $object->insert_discount($_POST["remise_id"]); @@ -546,8 +538,7 @@ if (empty($reshook)) $idprod = 0; $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - } - else { + } else { $idprod = GETPOST('idprod', 'int'); $price_ht = ''; $tva_tx = ''; @@ -615,13 +606,11 @@ if (empty($reshook)) { $productsupplier->ref_supplier = ''; } - } - else { + } else { $fksoctosearch = $object->thirdparty->id; $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist } - } - elseif (GETPOST('idprodfournprice', 'alpha') > 0) + } elseif (GETPOST('idprodfournprice', 'alpha') > 0) { //$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. $qtytosearch = -1; // We force qty to -1 to be sure to find if the supplier price that exists @@ -708,8 +697,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } - } - elseif ((GETPOST('price_ht') !== '' || GETPOST('price_ttc') !== '' || GETPOST('multicurrency_price_ht') != '') && empty($error)) // Free product. // $price_ht is already set + } elseif ((GETPOST('price_ht') !== '' || GETPOST('price_ttc') !== '' || GETPOST('multicurrency_price_ht') != '') && empty($error)) // Free product. // $price_ht is already set { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -730,8 +718,7 @@ if (empty($reshook)) if ($price_ht !== '') { $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings - } - else { + } else { $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU'); // $pu_ht must be rounded according to settings } @@ -826,8 +813,7 @@ if (empty($reshook)) unset($_POST['date_endday']); unset($_POST['date_endmonth']); unset($_POST['date_endyear']); - } - else { + } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); @@ -1002,9 +988,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - } - - elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { + } elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1022,13 +1006,9 @@ if (empty($reshook)) // Terms of payments elseif ($action == 'setconditions' && $user->rights->supplier_proposal->creer) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); - } - - elseif ($action == 'setremisepercent' && $user->rights->supplier_proposal->creer) { + } elseif ($action == 'setremisepercent' && $user->rights->supplier_proposal->creer) { $result = $object->set_remise_percent($user, $_POST['remise_percent']); - } - - elseif ($action == 'setremiseabsolue' && $user->rights->supplier_proposal->creer) { + } elseif ($action == 'setremiseabsolue' && $user->rights->supplier_proposal->creer) { $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); } @@ -1045,9 +1025,7 @@ if (empty($reshook)) // Multicurrency rate elseif ($action == 'setmulticurrencyrate' && $user->rights->supplier_proposal->creer) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); - } - - elseif ($action == 'update_extras') { + } elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); // Fill array 'array_options' with data from update form @@ -1129,8 +1107,7 @@ if ($action == 'create') if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } - } - else { + } else { $cond_reglement_id = $soc->cond_reglement_supplier_id; $mode_reglement_id = $soc->mode_reglement_supplier_id; if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 3fbe3afa021..3eea10bdf13 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -160,8 +160,7 @@ class Supplierproposals extends DolibarrApi } $i++; } - } - else { + } else { throw new RestException(503, 'Error when retrieving supplier proposal list : '.$db->lasterror()); } if (!count($obj_ret)) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 42c30c333d6..907a741c288 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -273,8 +273,7 @@ class SupplierProposal extends CommonObject if ($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) { $price = $prod->multiprices[$this->thirdparty->price_level]; - } - else { + } else { $price = $prod->price; } @@ -345,19 +344,16 @@ class SupplierProposal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $supplier_proposalligne->error; $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -2; } @@ -426,8 +422,7 @@ class SupplierProposal extends CommonObject if ($price_base_type == 'HT') { $pu = $pu_ht; - } - else { + } else { $pu = $pu_ttc; } @@ -487,15 +482,13 @@ class SupplierProposal extends CommonObject dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_ERR); return -1; } - } - else { + } else { $this->error = $prod->error; $this->db->rollback(); return -1; } } - } - else { + } else { $product_type = $type; } @@ -615,20 +608,17 @@ class SupplierProposal extends CommonObject { $this->db->commit(); return $this->line->id; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->line->error; $this->db->rollback(); return -2; } - } - else { + } else { $this->error = 'BadStatusOfObjectToAddLine'; return -5; } @@ -798,14 +788,12 @@ class SupplierProposal extends CommonObject $this->db->commit(); return $result; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } - } - else { + } else { dol_syslog(get_class($this)."::updateline Erreur -2 SupplierProposal en mode incompatible pour cette action"); return -2; } @@ -832,12 +820,10 @@ class SupplierProposal extends CommonObject $this->update_price(1); return 1; - } - else { + } else { return -1; } - } - else { + } else { return -2; } } @@ -1065,14 +1051,12 @@ class SupplierProposal extends CommonObject if ($result < 0) { $error++; } // End call triggers } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } } - } - else { + } else { $this->error = $this->db->lasterror(); $error++; } @@ -1082,13 +1066,11 @@ class SupplierProposal extends CommonObject $this->db->commit(); dol_syslog(get_class($this)."::create done id=".$this->id); return $this->id; - } - else { + } else { $this->db->rollback(); return -2; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1149,8 +1131,7 @@ class SupplierProposal extends CommonObject } // TODO Change product price if multi-prices - } - else { + } else { $objsoc->fetch($this->socid); } @@ -1198,8 +1179,7 @@ class SupplierProposal extends CommonObject { $this->db->commit(); return $this->id; - } - else { + } else { $this->db->rollback(); return -1; } @@ -1390,8 +1370,7 @@ class SupplierProposal extends CommonObject $i++; } $this->db->free($result); - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1405,8 +1384,7 @@ class SupplierProposal extends CommonObject $this->error = "Record Not Found"; return 0; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1441,8 +1419,7 @@ class SupplierProposal extends CommonObject if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($soc); - } - else { + } else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -1515,13 +1492,11 @@ class SupplierProposal extends CommonObject $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { dol_syslog("You don't have permission to validate supplier proposal", LOG_WARNING); return -2; } @@ -1548,8 +1523,7 @@ class SupplierProposal extends CommonObject { $this->date_livraison = $date_livraison; return 1; - } - else { + } else { $this->error = $this->db->error(); dol_syslog(get_class($this)."::set_date_livraison Erreur SQL"); return -1; @@ -1582,8 +1556,7 @@ class SupplierProposal extends CommonObject $this->remise_percent = $remise; $this->update_price(1); return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1617,8 +1590,7 @@ class SupplierProposal extends CommonObject $this->remise_absolue = $remise; $this->update_price(1); return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -1680,8 +1652,7 @@ class SupplierProposal extends CommonObject } $this->db->rollback(); return -1 * $error; - } - else { + } else { $this->db->commit(); return 1; } @@ -1753,13 +1724,11 @@ class SupplierProposal extends CommonObject { $this->db->commit(); return 1; - } - else { + } else { $this->db->rollback(); return -1; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->db->lasterror(); $this->db->rollback(); @@ -1861,8 +1830,7 @@ class SupplierProposal extends CommonObject $values[] = $product->multicurrency_subprice; $values[] = $product->multicurrency_total_ht; $values[] = $multicurrency->rate->rate; - } - else { + } else { for ($i = 0; $i < 5; $i++) $values[] = 'NULL'; } } @@ -1926,8 +1894,7 @@ class SupplierProposal extends CommonObject $this->db->rollback(); return -1; } - } - else { + } else { return -1; } } @@ -1987,12 +1954,10 @@ class SupplierProposal extends CommonObject if ($shortlist == 1) { $ga[$obj->supplier_proposalid] = $obj->ref; - } - elseif ($shortlist == 2) + } elseif ($shortlist == 2) { $ga[$obj->supplier_proposalid] = $obj->ref.' ('.$obj->name.')'; - } - else { + } else { $ga[$i]['id'] = $obj->supplier_proposalid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -2002,8 +1967,7 @@ class SupplierProposal extends CommonObject } } return $ga; - } - else { + } else { dol_print_error($this->db); return -1; } @@ -2099,26 +2063,22 @@ class SupplierProposal extends CommonObject dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG); $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return 0; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -3; } - } - else { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } - } - else { + } else { $this->db->rollback(); return -1; } @@ -2171,8 +2131,7 @@ class SupplierProposal extends CommonObject } } $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -2301,8 +2260,7 @@ class SupplierProposal extends CommonObject // if ($mode == 'signed' && ! count($this->FactureListeArray($obj->rowid))) $this->nbtodolate++; } return $response; - } - else { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -2369,8 +2327,7 @@ class SupplierProposal extends CommonObject $line->total_ttc = 59.8; $line->total_tva = 9.8; $line->remise_percent = 50; - } - else { + } else { $line->total_ht = 100; $line->total_ttc = 119.6; $line->total_tva = 19.6; @@ -2428,8 +2385,7 @@ class SupplierProposal extends CommonObject } $this->db->free($resql); return 1; - } - else { + } else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; @@ -2478,13 +2434,11 @@ class SupplierProposal extends CommonObject if ($numref != "") { return $numref; - } - else { + } else { $this->error = $obj->error; return ""; } - } - else { + } else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("SupplierProposal")); return ""; @@ -2654,8 +2608,7 @@ class SupplierProposal extends CommonObject $this->db->free($resql); return 1; - } - else { + } else { $this->error = $this->db->error(); return -1; } @@ -2949,8 +2902,7 @@ class SupplierProposalLine extends CommonObjectLine $this->fk_unit = $objp->fk_unit; $this->db->free($result); - } - else { + } else { dol_print_error($this->db); } } @@ -2995,8 +2947,7 @@ class SupplierProposalLine extends CommonObjectLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -3082,8 +3033,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -3129,8 +3079,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -3175,8 +3124,7 @@ class SupplierProposalLine extends CommonObjectLine if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { return $result; - } - else { + } else { $this->pa_ht = $result; } } @@ -3250,8 +3198,7 @@ class SupplierProposalLine extends CommonObjectLine $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -3284,8 +3231,7 @@ class SupplierProposalLine extends CommonObjectLine { $this->db->commit(); return 1; - } - else { + } else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 8f606ad4f67..4bd027299fa 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -65,14 +65,12 @@ if ($action == 'addcontact' && $permissiontoedit) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); - } - else { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -84,8 +82,7 @@ elseif ($action == 'swapstatut' && $permissiontoedit) if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne')); - } - else { + } else { dol_print_error($db); } } @@ -100,8 +97,7 @@ elseif ($action == 'deletecontact' && $permissiontoedit) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; - } - else { + } else { dol_print_error($db); } } @@ -191,8 +187,7 @@ if ($id > 0 || !empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; - } - else { + } else { // Contact not found print "ErrorRecordNotFound"; } diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 3096e6fbbdb..5b58c7de461 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -166,8 +166,7 @@ if ($object->id > 0) $permtoedit = $user->rights->supplier_proposal->creer; $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; -} -else { +} else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 7a575007be2..6ba425f323a 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -162,8 +162,7 @@ if ($resql) print '
'.$langs->trans("Total").''.$total.'

"; -} -else { +} else { dol_print_error($db); } @@ -293,8 +292,7 @@ if ($resql) } } print "

"; -} -else dol_print_error($db); +} else dol_print_error($db); /* @@ -375,15 +373,13 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa if ($num > $nbofloop) { print ''.$langs->trans("XMoreLines", ($num - $nbofloop)).""; - } - elseif ($total > 0) + } elseif ($total > 0) { print ''.$langs->trans("Total").''.price($total)." "; } print "
"; } - } - else { + } else { dol_print_error($db); } } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index eba1db92a94..d0ea3a2b625 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -358,8 +358,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfSupplierProposals').' - '.$soc->name; - } - else { + } else { $title = $langs->trans('ListOfSupplierProposals'); } @@ -949,8 +948,7 @@ if ($resql) $delallowed = $user->rights->supplier_proposal->creer; print $formfile->showdocuments('massfilesarea_supplier_proposal', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 3f09ac541d3..43077495238 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -110,12 +110,10 @@ if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > $includeconferror = 'ErrorBadValueForDolibarrMainDBType'; } } - } - else { + } else { $includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot'; } - } - else { + } else { $includeconferror = 'ErrorBadFormatForConfFile'; } } diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index a33f337cc96..81eaf319295 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -52,8 +52,7 @@ if (GETPOST('action', 'alpha') == 'set') { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index f0410f812d9..a9a4b945d0d 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -72,15 +72,7 @@ if ($action == "SavePrinter2") { $categstatic = new Categorie($db); $form = new Form($db); -if ($type == Categorie::TYPE_PRODUCT) { $title = $langs->trans("ProductsCategoriesArea"); $typetext = 'product'; } -elseif ($type == Categorie::TYPE_SUPPLIER) { $title = $langs->trans("SuppliersCategoriesArea"); $typetext = 'supplier'; } -elseif ($type == Categorie::TYPE_CUSTOMER) { $title = $langs->trans("CustomersCategoriesArea"); $typetext = 'customer'; } -elseif ($type == Categorie::TYPE_MEMBER) { $title = $langs->trans("MembersCategoriesArea"); $typetext = 'member'; } -elseif ($type == Categorie::TYPE_CONTACT) { $title = $langs->trans("ContactsCategoriesArea"); $typetext = 'contact'; } -elseif ($type == Categorie::TYPE_ACCOUNT) { $title = $langs->trans("AccountsCategoriesArea"); $typetext = 'bank_account'; } -elseif ($type == Categorie::TYPE_PROJECT) { $title = $langs->trans("ProjectsCategoriesArea"); $typetext = 'project'; } -elseif ($type == Categorie::TYPE_USER) { $title = $langs->trans("UsersCategoriesArea"); $typetext = 'user'; } -else { $title = $langs->trans("CategoriesArea"); $typetext = 'unknown'; } +if ($type == Categorie::TYPE_PRODUCT) { $title = $langs->trans("ProductsCategoriesArea"); $typetext = 'product'; } elseif ($type == Categorie::TYPE_SUPPLIER) { $title = $langs->trans("SuppliersCategoriesArea"); $typetext = 'supplier'; } elseif ($type == Categorie::TYPE_CUSTOMER) { $title = $langs->trans("CustomersCategoriesArea"); $typetext = 'customer'; } elseif ($type == Categorie::TYPE_MEMBER) { $title = $langs->trans("MembersCategoriesArea"); $typetext = 'member'; } elseif ($type == Categorie::TYPE_CONTACT) { $title = $langs->trans("ContactsCategoriesArea"); $typetext = 'contact'; } elseif ($type == Categorie::TYPE_ACCOUNT) { $title = $langs->trans("AccountsCategoriesArea"); $typetext = 'bank_account'; } elseif ($type == Categorie::TYPE_PROJECT) { $title = $langs->trans("ProjectsCategoriesArea"); $typetext = 'project'; } elseif ($type == Categorie::TYPE_USER) { $title = $langs->trans("UsersCategoriesArea"); $typetext = 'user'; } else { $title = $langs->trans("CategoriesArea"); $typetext = 'unknown'; } $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); @@ -146,8 +138,7 @@ if ($nbofentries > 0) if ($row["fk_menu"] == 0) print ''.$row["label"].'
'; } print ''; -} -else { +} else { print ''; print ''; print ''; -} -else { +} else { print ''; print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; @@ -175,8 +166,7 @@ if ($nbofentries > 0) if ($row["fk_menu"] == 0) print ''.$row["label"].'
'; } print '
'; print '\n"; @@ -119,8 +116,7 @@ if ($conf->receiptprinter->enabled) { if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; @@ -135,8 +131,7 @@ print '\n"; @@ -171,8 +166,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; - } - else { + } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); @@ -186,8 +180,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; - } - else { + } else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index f4e86677a1b..b03ae939fad 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -96,8 +96,7 @@ if ($action == 'set') if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } } elseif ($action == 'updateMask') { @@ -194,8 +193,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->TAKEPOS_REF_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index e2996ad763d..db85e96fa01 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -102,8 +102,7 @@ if (GETPOST('action', 'alpha') == 'set') { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -186,8 +185,7 @@ if (!empty($conf->stock->enabled)) print ''; diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 75c40e6607e..7c4471b0ec8 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -64,12 +64,10 @@ if ($action == 'getProducts') { } } echo json_encode($prods); - } - else { + } else { echo 'Failed to load category with id='.$category; } -} -elseif ($action == 'search' && $term != '') { +} elseif ($action == 'search' && $term != '') { // Define $filteroncategids, the filter on category ID if there is a Root category defined. $filteroncategids = ''; if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { // A root category is defined, we must filter on products inside this category tree @@ -108,8 +106,7 @@ elseif ($action == 'search' && $term != '') { ); } echo json_encode($rows); - } - else { + } else { echo 'Failed to search product : '.$db->lasterror(); } } elseif ($action == "opendrawer" && $term != '') { diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index 8a752a5d3a5..f549c0ec7bd 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -55,8 +55,7 @@ if ($query == "cat") if ($obj['photo_vignette']) { $filename = $obj['photo_vignette']; - } - else { + } else { $filename = $obj['photo']; } $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); @@ -64,8 +63,7 @@ if ($query == "cat") exit; } header('Location: ../../public/theme/common/nophoto.png'); -} -elseif ($query == "pro") +} elseif ($query == "pro") { require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; @@ -77,8 +75,7 @@ elseif ($query == "pro") $file = array_pop($match); if ($file == "") header('Location: ../../public/theme/common/nophoto.png'); else header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); -} -else { +} else { // TODO We don't need this. Size of image must be defined on HTML page, image must NOT be resize when downloaded. // The file diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 94cc526434e..4091e5fff90 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -134,8 +134,7 @@ foreach ($categories as $key => $categorycursor) if ($categorycursor['level'] == $levelofmaincategories) { $maincategories[$key] = $categorycursor; - } - else { + } else { $subcategories[$key] = $categorycursor; } } @@ -856,8 +855,7 @@ $r = 0; if (empty($conf->global->TAKEPOS_BAR_RESTAURANT)) { $menus[$r++] = array('title'=>'
'.$langs->trans("New").'
', 'action'=>'New();'); -} -else { +} else { // BAR RESTAURANT specific menu $menus[$r++] = array('title'=>'
'.$langs->trans("Place").'
', 'action'=>'Floors();'); } @@ -951,8 +949,7 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { { echo ''; echo ''; - } - elseif ($i > 12) echo ''; + } elseif ($i > 12) echo ''; else echo ''; } @@ -981,12 +978,10 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { if ($count == ($MAXCATEG - 2)) { //echo ''; echo ''; - } - elseif ($count == ($MAXCATEG - 1)) { + } elseif ($count == ($MAXCATEG - 1)) { //echo ''; echo ''; - } - else { + } else { echo ''; } ?> @@ -1015,12 +1010,10 @@ if (!empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { if ($count == ($MAXPRODUCT - 2)) { //echo ''; print ''; - } - elseif ($count == ($MAXPRODUCT - 1)) { + } elseif ($count == ($MAXPRODUCT - 1)) { //echo ''; print ''; - } - else { + } else { print '
'; print ''; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 274e47a1185..904f2ac7e4c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -116,8 +116,7 @@ $invoice = new Facture($db); if ($invoiceid > 0) { $ret = $invoice->fetch($invoiceid); -} -else { +} else { $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')'); } if ($ret > 0) @@ -186,13 +185,11 @@ if ($action == 'valid' && $user->rights->facture->creer) dol_syslog("Sale already validated"); dol_htmloutput_errors($langs->trans("InvoiceIsAlreadyValidated", "TakePos"), null, 1); } - } - elseif (count($invoice->lines) == 0) + } elseif (count($invoice->lines) == 0) { dol_syslog("Sale without lines"); dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1); - } - elseif (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") + } elseif (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") { $savconst = $conf->global->STOCK_CALCULATE_ON_BILL; $conf->global->STOCK_CALCULATE_ON_BILL = 1; @@ -207,8 +204,7 @@ if ($action == 'valid' && $user->rights->facture->creer) $res = $invoice->validate($user, '', $conf->global->$constantforkey, 0, $batch_rule); $conf->global->STOCK_CALCULATE_ON_BILL = $savconst; - } - else { + } else { $res = $invoice->validate($user); } @@ -270,8 +266,7 @@ if (($action == "addline" || $action == "freezone") && $placeid == 0) { $langs->load('errors'); dol_htmloutput_errors($langs->trans("ErrorModuleSetupNotComplete", "TakePos"), null, 1); - } - else { + } else { $placeid = $invoice->create($user); if ($placeid < 0) { @@ -375,8 +370,7 @@ if ($action == "deleteline") { if ($idline > 0 and $placeid > 0) { // If invoice exists and line selected. To avoid errors if deleted from another device or no line selected. $invoice->deleteline($idline); $invoice->fetch($placeid); - } - elseif ($placeid > 0) { // If invoice exists but no line selected, proceed to delete last line. + } elseif ($placeid > 0) { // If invoice exists but no line selected, proceed to delete last line. $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facturedet where fk_facture='".$placeid."' order by rowid DESC"; $resql = $db->query($sql); $row = $db->fetch_array($resql); @@ -415,8 +409,7 @@ if ($action == "delete") { if ($resql1 && $resql2 && $resql3) { $db->commit(); - } - else { + } else { $db->rollback(); } @@ -456,8 +449,7 @@ if ($action == "updateprice") if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($line->remise_percent) / 100) < price2num($price_min)))) { echo $langs->trans("CantBeLessThanMinPrice"); - } - else $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + } else $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); } } $invoice->fetch($placeid); @@ -481,8 +473,7 @@ if ($action == "updatereduction") if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->multicurrency_subprice) * (1 - price2num($number) / 100) < price2num($price_min)))) { echo $langs->trans("CantBeLessThanMinPrice"); - } - else $result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); + } else $result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); } } $invoice->fetch($placeid); @@ -574,8 +565,7 @@ if ($action == "valid" || $action == "history") if ($remaintopay > 0) { $sectionwithinvoicelink .= $langs->trans('RemainToPay').': '.price($remaintopay, 1, $langs, 1, -1, -1, $conf->currency).''; - } - else { + } else { if ($invoice->paye) $sectionwithinvoicelink .= ''.$langs->trans("Paid").''; else $sectionwithinvoicelink .= $langs->trans('BillShortStatusValidated'); } @@ -806,13 +796,11 @@ $( document ).ready(function() { if ($adh->hasDelay()) { $s .= " ".img_warning($langs->trans("Late")); } - } - else { + } else { $s .= '
'.$langs->trans("SubscriptionNotReceived"); if ($adh->statut > 0) $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } - } - else { + } else { $s .= '
'.$langs->trans("ThirdpartyNotLinkedToMember"); } $s .= ''; @@ -958,8 +946,7 @@ if ($placeid > 0) if ($firstline != $line->desc) { $htmlsupplements[$line->fk_parent_line] .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); - } - else { + } else { $htmlsupplements[$line->fk_parent_line] .= $line->desc; } } @@ -1008,8 +995,7 @@ if ($placeid > 0) if ($firstline != $line->desc) { $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); - } - else { + } else { $htmlforlines .= $line->desc; } } @@ -1036,12 +1022,10 @@ if ($placeid > 0) print $htmlforlines; } - } - else { + } else { print ''; } -} -else { // No invoice generated yet +} else { // No invoice generated yet print ''; } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index f370387d72e..95bb9118b48 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -51,8 +51,7 @@ $invoice = new Facture($db); if ($invoiceid > 0) { $invoice->fetch($invoiceid); -} -else { +} else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -63,8 +62,7 @@ else { if (!$invoiceid) { $invoiceid = 0; // Invoice does not exist yet - } - else { + } else { $invoice->fetch($invoiceid); } } diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 1cad9a9ede4..427f2e92ab1 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -41,8 +41,7 @@ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // Decode place if it is an order from customer phone $key = GETPOST('key'); $place = dol_decode($key); -} -else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant +} else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); $idproduct = GETPOST('idproduct', 'int'); @@ -82,8 +81,7 @@ if ($action == "productinfo") { print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; print '
'; print ''; -} -elseif ($action == "editline") { +} elseif ($action == "editline") { $placeid = GETPOST('placeid', 'int'); $selectedline = GETPOST('selectedline', 'int'); $invoice = new Facture($db); @@ -104,8 +102,7 @@ elseif ($action == "editline") { print ''; } } -} -else { +} else { ?> '; - } - } - } - - return $out; - } - - /** - * Fill array_options property of object by extrafields value (using for data sent by forms) - * - * @param array $extralabels Deprecated (old $array of extrafields, now set this to null) - * @param object $object Object - * @param string $onlykey Only the following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must set this to avoid to have other extrafields being reset. - * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) - */ - public function setOptionalsFromPost($extralabels, &$object, $onlykey = '') - { - global $_POST, $langs; - - $nofillrequired = 0; // For error when required field left blank - $error_field_required = array(); - - if (is_array($this->attributes[$object->table_element]['label'])) $extralabels = $this->attributes[$object->table_element]['label']; - - if (is_array($extralabels)) - { - // Get extra fields - foreach ($extralabels as $key => $value) - { - if (!empty($onlykey) && $key != $onlykey) continue; - - $key_type = $this->attributes[$object->table_element]['type'][$key]; - if ($key_type == 'separate') continue; - - $enabled = 1; - if (isset($this->attributes[$object->table_element]['list'][$key])) - { - $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); - } - $perms = 1; - if (isset($this->attributes[$object->table_element]['perms'][$key])) - { - $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); - } - if (empty($enabled)) continue; - if (empty($perms)) continue; - - if ($this->attributes[$object->table_element]['required'][$key]) // Value is required - { - // Check if empty without using GETPOST, value can be alpha, int, array, etc... - if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0') - || (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select') - || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) - { - //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; - $nofillrequired++; - $error_field_required[] = $langs->transnoentitiesnoconv($value); - } - } - - if (in_array($key_type, array('date'))) - { - // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - elseif (in_array($key_type, array('datetime'))) - { - // Clean parameters - // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); - } - elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) - { - $value_arr = GETPOST("options_".$key, 'array'); // check if an array - if (!empty($value_arr)) { - $value_key = implode($value_arr, ','); - } else { - $value_key = ''; - } - } - elseif (in_array($key_type, array('price', 'double'))) - { - $value_arr = GETPOST("options_".$key, 'alpha'); - $value_key = price2num($value_arr); - } - else - { - $value_key = GETPOST("options_".$key); - if (in_array($key_type, array('link')) && $value_key == '-1') $value_key = ''; - } - - $object->array_options["options_".$key] = $value_key; - } - - if ($nofillrequired) { - $langs->load('errors'); - setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ', $error_field_required), null, 'errors'); - return -1; - } - else { - return 1; - } - } - else { - return 0; - } - } - - /** - * return array_options array of data of extrafields value of object sent by a search form - * - * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @return array|int array_options set or 0 if no value - */ - public function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix = '', $keysuffix = '') - { - global $_POST; - - if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label'])) - { - $extralabels = $this->attributes[$extrafieldsobjectkey]['label']; - } - else - { - $extralabels = $extrafieldsobjectkey; - } - - if (is_array($extralabels)) - { - $array_options = array(); - - // Get extra fields - foreach ($extralabels as $key => $value) - { - $key_type = ''; - if (is_string($extrafieldsobjectkey)) - { - $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - } - - if (in_array($key_type, array('date', 'datetime'))) - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) continue; // Value was not provided, we should not set it. - // Clean parameters - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); - } - elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. - $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); - // Make sure we get an array even if there's only one checkbox - $value_arr = (array) $value_arr; - $value_key = implode(',', $value_arr); - } - elseif (in_array($key_type, array('price', 'double', 'int'))) - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. - $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); - $value_key = price2num($value_arr); - } - else - { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) continue; // Value was not provided, we should not set it. - $value_key = GETPOST($keysuffix."options_".$key.$keyprefix); - } - - $array_options[$keysuffix."options_".$key] = $value_key; // No keyprefix here. keyprefix is used only for read. - } - - return $array_options; - } - - return 0; - } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b07e5220384..f2b11938ca2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -368,6 +368,8 @@ class Form $s = picto_from_langcode($langcode, 'class="pictoforlang paddingright"'); $resultforextrlang .= $s; + + // TODO Use the showInputField() method of ExtraLanguages object if ($typeofdata == 'textarea') { $resultforextrlang .= ' - '; - print '
'; -} -elseif ($action == "publicpayment") { - $langs->loadLangs(array("orders")); - print '

'.$langs->trans('StatusOrderDelivered').'

'; - print ''; - print '
'; -} -elseif ($action == "checkplease") { - print ''; - print ''; - print '
'; -} -elseif ($action == "editline") { - $placeid = GETPOST('placeid', 'int'); - $selectedline = GETPOST('selectedline', 'int'); - $invoice = new Facture($db); - $invoice->fetch($placeid); - foreach ($invoice->lines as $line) - { - if ($line->id == $selectedline) - { - $prod = new Product($db); - $prod->fetch($line->fk_product); - print "".$prod->label."
"; - print ''; - print "
".$prod->description; - print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; - print '
'; - print ''; - print ''; - print ''; - } - } -} -else { - // Title - $title = 'TakePOS - Dolibarr '.DOL_VERSION; - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; - $head = ' - - -'; - $arrayofcss = array('/takepos/css/phone.css'); - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - ?> - - - - global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; - ?> -
-
- '.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; - print ''; - print ''; - print ''; - } - else { - print ''; - print ''; - print ''; - } - ?> -
-
-
-
-
-
-
-
- - close(); + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/phone.php + * \ingroup takepos + * \brief TakePOS Phone screen + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + +if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + // Decode place if it is an order from customer phone + if (GETPOSTISSET("key")) $place = dol_decode(GETPOST('key')); + else $place = GETPOST('place', 'aZ09'); +} +else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant +$action = GETPOST('action', 'alpha'); +$setterminal = GETPOST('setterminal', 'int'); +$idproduct = GETPOST('idproduct', 'int'); + +if ($setterminal > 0) +{ + $_SESSION["takeposterminal"] = $setterminal; +} + +$langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter")); + +if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + accessforbidden(); +} + +/* + * View + */ + +if ($action == "productinfo") { + $prod = new Product($db); + $prod->fetch($idproduct); + print ''; + print "
".$prod->label."
"; + print ''; + print "
".$prod->description; + print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; + print '
'; +} +elseif ($action == "publicpreorder") { + print ''; + print "

"; + print '
+ +
'; + print '
'; +} +elseif ($action == "publicpayment") { + $langs->loadLangs(array("orders")); + print '

'.$langs->trans('StatusOrderDelivered').'

'; + print ''; + print '
'; +} +elseif ($action == "checkplease") { + if (GETPOSTISSET("payment")){ + print '

'.$langs->trans('StatusOrderDelivered').'

'; + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $printer = new dolReceiptPrinter($db); + $printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->text($langs->trans('IM')); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Place').": ".$place); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Payment').": ".$langs->trans(GETPOST('payment', 'alpha'))); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->close(); + } + else{ + print ''; + print ''; + print '
'; + } +} +elseif ($action == "editline") { + $placeid = GETPOST('placeid', 'int'); + $selectedline = GETPOST('selectedline', 'int'); + $invoice = new Facture($db); + $invoice->fetch($placeid); + foreach ($invoice->lines as $line) + { + if ($line->id == $selectedline) + { + $prod = new Product($db); + $prod->fetch($line->fk_product); + print "".$prod->label."
"; + print ''; + print "
".$prod->description; + print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; + print '
'; + print ''; + print ''; + print ''; + } + } +} +else { +// Title +$title = 'TakePOS - Dolibarr '.DOL_VERSION; +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; +$head = ' + + +'; +$arrayofcss = array('/takepos/css/phone.css'); +top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + ?> + + + + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; + ?> +
+
+ '.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; + print ''; + print ''; + print ''; + } + else { + print ''; + print ''; + print ''; + } + ?> +
+
+
+
+
+
+
+
+ + close(); From 3632111705de7d7ef64b36080a5e08e844e3f72d Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 24 May 2020 17:29:35 +0200 Subject: [PATCH 438/490] Fix travis --- htdocs/takepos/phone.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 72d97e7a07a..059538d68cc 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -1,5 +1,5 @@ + /* Copyright (C) 2018 Andreu Bisquerra * * 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 @@ -136,15 +136,15 @@ elseif ($action == "editline") { } } else { -// Title -$title = 'TakePOS - Dolibarr '.DOL_VERSION; -if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; -$head = ' + // Title + $title = 'TakePOS - Dolibarr '.DOL_VERSION; + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; + $head = ' '; -$arrayofcss = array('/takepos/css/phone.css'); -top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + $arrayofcss = array('/takepos/css/phone.css'); + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> - - - global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; - ?> -
-
- '.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; - print ''; - print ''; - print ''; - } - else { - print ''; - print ''; - print ''; - } - ?> -
-
-
-
-
-
-
-
- - close(); + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/phone.php + * \ingroup takepos + * \brief TakePOS Phone screen + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + +if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + // Decode place if it is an order from customer phone + if (GETPOSTISSET("key")) $place = dol_decode(GETPOST('key')); + else $place = GETPOST('place', 'aZ09'); +} +else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant +$action = GETPOST('action', 'alpha'); +$setterminal = GETPOST('setterminal', 'int'); +$idproduct = GETPOST('idproduct', 'int'); + +if ($setterminal > 0) +{ + $_SESSION["takeposterminal"] = $setterminal; +} + +$langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter")); + +if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + accessforbidden(); +} + +/* + * View + */ + +if ($action == "productinfo") { + $prod = new Product($db); + $prod->fetch($idproduct); + print ''; + print "
".$prod->label."
"; + print ''; + print "
".$prod->description; + print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; + print '
'; +} +elseif ($action == "publicpreorder") { + print ''; + print "

"; + print '
+ +
'; + print '
'; +} +elseif ($action == "publicpayment") { + $langs->loadLangs(array("orders")); + print '

'.$langs->trans('StatusOrderDelivered').'

'; + print ''; + print '
'; +} +elseif ($action == "checkplease") { + if (GETPOSTISSET("payment")){ + print '

'.$langs->trans('StatusOrderDelivered').'

'; + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $printer = new dolReceiptPrinter($db); + $printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->text($langs->trans('IM')); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Place').": ".$place); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Payment').": ".$langs->trans(GETPOST('payment', 'alpha'))); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->close(); + } + else{ + print ''; + print ''; + print '
'; + } +} +elseif ($action == "editline") { + $placeid = GETPOST('placeid', 'int'); + $selectedline = GETPOST('selectedline', 'int'); + $invoice = new Facture($db); + $invoice->fetch($placeid); + foreach ($invoice->lines as $line) + { + if ($line->id == $selectedline) + { + $prod = new Product($db); + $prod->fetch($line->fk_product); + print "".$prod->label."
"; + print ''; + print "
".$prod->description; + print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).""; + print '
'; + print ''; + print ''; + print ''; + } + } +} +else { + // Title + $title = 'TakePOS - Dolibarr '.DOL_VERSION; + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; + $head = ' + + +'; + $arrayofcss = array('/takepos/css/phone.css'); + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + ?> + + + + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; + ?> +
+
+ '.strtoupper(substr($langs->trans('Floors'), 0, 3)).''; + print ''; + print ''; + print ''; + } + else { + print ''; + print ''; + print ''; + } + ?> +
+
+
+
+
+
+
+
+ + close(); From aee6fce9f85d38cfe2a05af77eea7d30a62ea1b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 May 2020 20:04:26 +0200 Subject: [PATCH 442/490] Fix remove bad use --- htdocs/core/class/conf.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 10d6fedf0e0..ad87949d4e9 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1,9 +1,7 @@ * Copyright (C) 2003 Xavier Dutoit - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2006 Jean Heimburger * From 6158e41822145b846baf1109adbc431046ed6698 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 May 2020 23:44:04 +0200 Subject: [PATCH 443/490] CSS --- htdocs/takepos/admin/other.php | 2 +- htdocs/takepos/admin/receipt.php | 2 +- htdocs/takepos/admin/setup.php | 2 +- htdocs/takepos/admin/terminal.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/admin/other.php b/htdocs/takepos/admin/other.php index cbb22c94f90..902bcfc81d4 100644 --- a/htdocs/takepos/admin/other.php +++ b/htdocs/takepos/admin/other.php @@ -111,7 +111,7 @@ llxHeader('', $langs->trans("CashDeskSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); $head = takepos_prepare_head(); -dol_fiche_head($head, 'other', 'TakePOS', -1); +dol_fiche_head($head, 'other', 'TakePOS', -1, 'cash-register'); print '
'; diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 83b31569a7b..2f54d79d603 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -82,7 +82,7 @@ llxHeader('', $langs->trans("CashDeskSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); $head = takepos_prepare_head(); -dol_fiche_head($head, 'receipt', 'TakePOS', -1); +dol_fiche_head($head, 'receipt', 'TakePOS', -1, 'cash-register'); print '
'; print ''; diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 85406c46faa..03607409ea7 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -133,7 +133,7 @@ llxHeader('', $langs->trans("CashDeskSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); $head = takepos_prepare_head(); -dol_fiche_head($head, 'setup', 'TakePOS', -1); +dol_fiche_head($head, 'setup', 'TakePOS', -1, 'cash-register'); // Numbering modules $now = dol_now(); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 46d168ddd24..ec3908361fc 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -123,7 +123,7 @@ llxHeader('', $langs->trans("CashDeskSetup")); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); $head = takepos_prepare_head(); -dol_fiche_head($head, 'terminal'.$terminal, 'TakePOS', -1); +dol_fiche_head($head, 'terminal'.$terminal, 'TakePOS', -1, 'cash-register'); print '
'; From 0041bca82f3dc0ea8c83eec91ef71fbf02fc87a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 May 2020 23:49:33 +0200 Subject: [PATCH 444/490] Fix ambiguous param --- htdocs/install/mysql/migration/repair.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index b21429a4d1b..7546790b151 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -495,8 +495,8 @@ UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS UPDATE llx_facturedet SET situation_percent = 100 WHERE situation_percent IS NULL AND fk_prev_id IS NULL; -- Test inconsistency of data into situation invoices: If it differs, it may be the total_ht that is wrong and situation_percent that is good. --- select f.rowid, f.type, qty, subprice, situation_percent, total_ht, total_ttc, total_tva, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc, (situation_percent / 100 * subprice * qty * (1 - (fd.remise_percent / 100))) --- from llx_facturedet as fd, llx_facture as f where fd.fk_facture = f.rowid AND (total_ht - situation_percent / 100 * subprice * qty * (1 - (fd.remise_percent / 100))) > 0.01 and f.type = 5; +-- select f.rowid, f.type, qty, subprice, situation_percent, fd.total_ht, fd.total_ttc, fd.total_tva, fd.multicurrency_total_ht, fd.multicurrency_total_tva, fd.multicurrency_total_ttc, (situation_percent / 100 * subprice * qty * (1 - (fd.remise_percent / 100))) +-- from llx_facturedet as fd, llx_facture as f where fd.fk_facture = f.rowid AND (fd.total_ht - situation_percent / 100 * subprice * qty * (1 - (fd.remise_percent / 100))) > 0.01 and f.type = 5; -- Note to make all deposit as payed when there is already a discount generated from it. From 47465f4108a541a03f01cc1dc30019177b9968ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 00:20:00 +0200 Subject: [PATCH 445/490] Fix for situation invoice (exclude credit not when searching last invoice to use) --- htdocs/compta/facture/card.php | 4 ++-- htdocs/core/class/html.form.class.php | 30 +++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d7ac591755a..b7cfb8272d1 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3146,10 +3146,10 @@ if ($action == 'create') print ''; // Next situation invoice - $opt = $form->selectSituationInvoices(GETPOST('originid'), $socid); + $opt = $form->selectSituationInvoices(GETPOST('originid', 'int'), $socid); print '
'; - $tmp = ''.$langs->trans('NoSituations').'') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande')) $tmp .= ' disabled'; $tmp .= '> '; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d7e46922f56..622ffb1d127 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3804,27 +3804,27 @@ class Form $sql .= ' FROM '.MAIN_DB_PREFIX.'facture'; $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; $sql .= ' AND situation_counter>=1'; + $sql .= ' AND fk_soc = '.(int) $socid; + $sql .= ' AND type <> 2'; $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; $resql = $this->db->query($sql); + if ($resql && $this->db->num_rows($resql) > 0) { // Last seen cycle $ref = 0; while ($obj = $this->db->fetch_object($resql)) { - //Same company ? - if ($socid == $obj->fk_soc) { - //Same cycle ? - if ($obj->situation_cycle_ref != $ref) { - // Just seen this cycle - $ref = $obj->situation_cycle_ref; - //not final ? - if ($obj->situation_final != 1) { - //Not prov? - if (substr($obj->ref, 1, 4) != 'PROV') { - if ($selected == $obj->rowid) { - $opt .= ''; - } else { - $opt .= ''; - } + //Same cycle ? + if ($obj->situation_cycle_ref != $ref) { + // Just seen this cycle + $ref = $obj->situation_cycle_ref; + //not final ? + if ($obj->situation_final != 1) { + //Not prov? + if (substr($obj->ref, 1, 4) != 'PROV') { + if ($selected == $obj->rowid) { + $opt .= ''; + } else { + $opt .= ''; } } } From 61545703d14c119acdfb6446a8908ae3b16e4aad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 10:58:18 +0200 Subject: [PATCH 446/490] CSS --- htdocs/compta/charges/index.php | 9 ++++++--- htdocs/theme/eldy/global.inc.php | 19 +++++++++++++------ htdocs/theme/eldy/theme_vars.inc.php | 3 ++- htdocs/theme/md/style.css.php | 6 ++++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 93065219248..c64797b801c 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -89,6 +89,8 @@ if ($mode == 'sconly') $param = '&mode=sconly'; if ($sortfield) $param .= '&sortfield='.$sortfield; if ($sortorder) $param .= '&sortorder='.$sortorder; +$totalnboflines = 0; +$num = 0; print ''; if ($optioncss != '') print ''; @@ -99,14 +101,15 @@ print ''; print ''; print ''; +$nav = ''; if ($mode != 'sconly') { - $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1); + $nav = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1); } else { - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 0); } if ($year) $param .= '&year='.$year; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 79bf092c82f..6e0bfd53e68 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -20,6 +20,7 @@ --colorbacklinebreak: rgb(); --colorbackbody: rgb(); --colortexttitlenotab: rgb(); + --colortexttitlenotab2: rgb(); --colortexttitle: rgb(); --colortext: rgb(); --colortextlink: rgb(); @@ -31,7 +32,7 @@ --tooltipbgcolor: ; --tooltipfontcolor : ; --oddevencolor: #202020; - --colorboxstatsborder: #ddd; + --colorboxstatsborder: #e0e0e0; --dolgraphbg: rgba(255,255,255,0); --fieldrequiredcolor: #000055; --colortextbacktab: #; @@ -62,6 +63,7 @@ if (!empty($conf->global->MAIN_THEME_DARKMODEENABLED)) { --colorbackbody: #1d1e20; --tooltipbgcolor: #2b2d2f; --colortexttitlenotab: rgb(220,220,220); + --colortexttitlenotab2: rgb(220,220,220); --colortexttitle: rgb(220,220,220); --colortext: rgb(220,220,220); --colortextlink: #4390dc; @@ -2688,7 +2690,7 @@ div.tabBar.tabBarNoTop { /* tabBar used for creation/update/send forms */ div.tabBarWithBottom { padding-bottom: 18px; - border-bottom: 1px solid #aaa; + border-bottom: 1px solid #bbb; } div.tabBarWithBottom tr { background: unset !important; @@ -3588,7 +3590,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { background: var(--colorbackbody); border: 1px solid var(--colorboxstatsborder); border-left: 6px solid var(--colorboxstatsborder); - box-shadow: 1px 1px 8px var(--colorboxstatsborder); + /* box-shadow: 1px 1px 8px var(--colorboxstatsborder); */ border-radius: 0px; } .boxstats, .boxstats130, .boxstatscontent { @@ -3981,9 +3983,14 @@ div.titre { padding-top: 5px; padding-bottom: 5px; } -div.titre, .secondary { - font-family: ; - color: var(--colortexttitlenotab); +.secondary, div.titre { + color: var(--colortexttitlenotab); +} +.tertiary { + color: var(--colortexttitlenotab2); +} +table.table-fiche-title:first-of-type div { + color: var(--colortexttitlenotab); } table.table-fiche-title .col-title div.titre{ diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index f7ae5b3c320..79b58c5c3ad 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,8 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '248,247,244'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 +$colortexttitlenotab = '0,123,140'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 +$colortexttitlenotab2 = '100,0,100'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 $colortexttitle = '0,0,0'; $colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c43fa9cd7d9..f1e2c9257e6 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3921,8 +3921,10 @@ div.titre { /* text-shadow: 1px 1px 2px #FFFFFF; */ dol_optimize_smallscreen) ? '' : 'margin-top: 4px;'); ?> } -div.titre, .secondary { - font-family: ; +.secondary, div.titre { + color: var(--colortexttitlenotab); +} +.tertiary { color: var(--colortexttitlenotab); } From a44f0d24ebfdc411dd6fbcd133413455c5a14c5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 11:06:16 +0200 Subject: [PATCH 447/490] Fix Popup --- .../core/boxes/box_produits_alerte_stock.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index f4a433c013d..dcd95445ddd 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -88,7 +88,9 @@ class box_produits_alerte_stock extends ModeleBoxes if (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire) { - $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity,"; + $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,"; + $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; + $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,"; $sql .= " SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") as total_stock"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product"; @@ -103,8 +105,10 @@ class box_produits_alerte_stock extends ModeleBoxes $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } - $sql .= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity"; - $sql .= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte"; + $sql .= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,"; + $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; + $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export"; + $sql .= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte"; $sql .= $this->db->order('p.seuil_stock_alerte', 'DESC'); $sql .= $this->db->plimit($max, 0); @@ -142,6 +146,15 @@ class box_produits_alerte_stock extends ModeleBoxes $productstatic->type = $objp->fk_product_type; $productstatic->label = $objp->label; $productstatic->entity = $objp->entity; + $productstatic->barcode = $objp->barcode; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->accountancy_code_sell = $objp->accountancy_code_sell; + $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra; + $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export; + $productstatic->accountancy_code_buy = $objp->accountancy_code_buy; + $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra; + $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; $this->info_box_contents[$line][] = array( 'td' => '', From c67eeeaf6cee16bf972adbf1466e92e40b2ea7c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 10:58:18 +0200 Subject: [PATCH 448/490] CSS --- htdocs/compta/charges/index.php | 9 ++++++--- htdocs/theme/eldy/global.inc.php | 19 +++++++++++++------ htdocs/theme/eldy/theme_vars.inc.php | 3 ++- htdocs/theme/md/style.css.php | 6 ++++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 93065219248..c64797b801c 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -89,6 +89,8 @@ if ($mode == 'sconly') $param = '&mode=sconly'; if ($sortfield) $param .= '&sortfield='.$sortfield; if ($sortorder) $param .= '&sortorder='.$sortorder; +$totalnboflines = 0; +$num = 0; print ''; if ($optioncss != '') print ''; @@ -99,14 +101,15 @@ print ''; print ''; print ''; +$nav = ''; if ($mode != 'sconly') { - $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1); + $nav = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1); } else { - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 0); } if ($year) $param .= '&year='.$year; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f907e057be5..569e84496b6 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -20,6 +20,7 @@ --colorbacklinebreak: rgb(); --colorbackbody: rgb(); --colortexttitlenotab: rgb(); + --colortexttitlenotab2: rgb(); --colortexttitle: rgb(); --colortext: rgb(); --colortextlink: rgb(); @@ -31,7 +32,7 @@ --tooltipbgcolor: ; --tooltipfontcolor : ; --oddevencolor: #202020; - --colorboxstatsborder: #ddd; + --colorboxstatsborder: #e0e0e0; --dolgraphbg: rgba(255,255,255,0); --fieldrequiredcolor: #000055; --colortextbacktab: #; @@ -62,6 +63,7 @@ if (!empty($conf->global->MAIN_THEME_DARKMODEENABLED)) { --colorbackbody: #1d1e20; --tooltipbgcolor: #2b2d2f; --colortexttitlenotab: rgb(220,220,220); + --colortexttitlenotab2: rgb(220,220,220); --colortexttitle: rgb(220,220,220); --colortext: rgb(220,220,220); --colortextlink: #4390dc; @@ -2688,7 +2690,7 @@ div.tabBar.tabBarNoTop { /* tabBar used for creation/update/send forms */ div.tabBarWithBottom { padding-bottom: 18px; - border-bottom: 1px solid #aaa; + border-bottom: 1px solid #bbb; } div.tabBarWithBottom tr { background: unset !important; @@ -3588,7 +3590,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) { background: var(--colorbackbody); border: 1px solid var(--colorboxstatsborder); border-left: 6px solid var(--colorboxstatsborder); - box-shadow: 1px 1px 8px var(--colorboxstatsborder); + /* box-shadow: 1px 1px 8px var(--colorboxstatsborder); */ border-radius: 0px; } .boxstats, .boxstats130, .boxstatscontent { @@ -3981,9 +3983,14 @@ div.titre { padding-top: 5px; padding-bottom: 5px; } -div.titre, .secondary { - font-family: ; - color: var(--colortexttitlenotab); +.secondary, div.titre { + color: var(--colortexttitlenotab); +} +.tertiary { + color: var(--colortexttitlenotab2); +} +table.table-fiche-title:first-of-type div { + color: var(--colortexttitlenotab); } table.table-fiche-title .col-title div.titre{ diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index f7ae5b3c320..79b58c5c3ad 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,8 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '248,247,244'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 +$colortexttitlenotab = '0,123,140'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 +$colortexttitlenotab2 = '100,0,100'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120 $colortexttitle = '0,0,0'; $colortexttitlelink = '10, 20, 100'; $colortext = '0,0,0'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c43fa9cd7d9..f1e2c9257e6 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3921,8 +3921,10 @@ div.titre { /* text-shadow: 1px 1px 2px #FFFFFF; */ dol_optimize_smallscreen) ? '' : 'margin-top: 4px;'); ?> } -div.titre, .secondary { - font-family: ; +.secondary, div.titre { + color: var(--colortexttitlenotab); +} +.tertiary { color: var(--colortexttitlenotab); } From 384e1e31add21c8c03d3e528d6cd96fc5ed6afcb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 11:06:16 +0200 Subject: [PATCH 449/490] Fix Popup --- .../core/boxes/box_produits_alerte_stock.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index f4a433c013d..dcd95445ddd 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -88,7 +88,9 @@ class box_produits_alerte_stock extends ModeleBoxes if (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire) { - $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity,"; + $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,"; + $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; + $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,"; $sql .= " SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") as total_stock"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product"; @@ -103,8 +105,10 @@ class box_produits_alerte_stock extends ModeleBoxes $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } - $sql .= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity"; - $sql .= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte"; + $sql .= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,"; + $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; + $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export"; + $sql .= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte"; $sql .= $this->db->order('p.seuil_stock_alerte', 'DESC'); $sql .= $this->db->plimit($max, 0); @@ -142,6 +146,15 @@ class box_produits_alerte_stock extends ModeleBoxes $productstatic->type = $objp->fk_product_type; $productstatic->label = $objp->label; $productstatic->entity = $objp->entity; + $productstatic->barcode = $objp->barcode; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->accountancy_code_sell = $objp->accountancy_code_sell; + $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra; + $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export; + $productstatic->accountancy_code_buy = $objp->accountancy_code_buy; + $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra; + $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; $this->info_box_contents[$line][] = array( 'td' => '', From 962d795740026942063abd64345a04cc6d19d89b Mon Sep 17 00:00:00 2001 From: laurantines Date: Mon, 25 May 2020 12:26:05 +0200 Subject: [PATCH 450/490] Update list.php Search by d,phone, d.phone_perso, d.phone_mobile in SELECT QUERY --- htdocs/adherents/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 6cb34192845..bf8353da5c9 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -301,6 +301,9 @@ if ($search_email) $sql .= natural_search("d.email", $search_email); if ($search_town) $sql .= natural_search("d.town", $search_town); if ($search_zip) $sql .= natural_search("d.zip", $search_zip); if ($search_state) $sql .= natural_search("state.nom", $search_state); +if ($search_phone) $sql .= natural_search("d.phone", $search_phone); +if ($search_phone_perso) $sql .= natural_search("d.phone_perso", $search_phone_perso); +if ($search_phone_mobile) $sql .= natural_search("d.phone_mobile", $search_phone_mobile); if ($search_country) $sql .= " AND d.country IN (".$search_country.')'; if ($filter == 'uptodate') $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)"; if ($filter == 'outofdate') $sql .= " AND ((datefin IS NULL OR datefin < '".$db->idate($now)."') AND t.subscription = 1)"; From 9e77dc0a261aa06ec63b7427f3f9d990728fde6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 12:50:29 +0200 Subject: [PATCH 451/490] CSS --- htdocs/admin/modules.php | 4 ++-- htdocs/core/lib/security2.lib.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/theme/eldy/manifest.json.php | 2 +- htdocs/theme/eldy/theme_vars.inc.php | 4 ++-- htdocs/theme/md/manifest.json.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c0f1991835b..ab2889368cd 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1198,7 +1198,7 @@ if ($mode == 'develop') print '
'."\n"; print ''; print ''; @@ -1208,7 +1208,7 @@ if ($mode == 'develop') print ''."\n"; $url = 'https://partners.dolibarr.org'; print ''; print ''; print ''; diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index c7f5a7b7330..ce346c0d26e 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -279,7 +279,7 @@ if (!function_exists('dol_loginfunction')) // Set jquery theme $dol_loginmesg = (!empty($_SESSION["dol_loginmesg"]) ? $_SESSION["dol_loginmesg"] : ''); - $favicon = DOL_URL_ROOT.'/theme/dolibarr_logo_256x256.png'; + $favicon = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; if (!empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); if (!empty($conf->global->MAIN_FAVICON_URL)) $favicon = $conf->global->MAIN_FAVICON_URL; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 48c9c0bc96c..0bc25d0c096 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1209,7 +1209,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; // Favicon - $favicon = DOL_URL_ROOT.'/theme/dolibarr_logo_256x256.png'; + $favicon = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; if (!empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); if (!empty($conf->global->MAIN_FAVICON_URL)) $favicon = $conf->global->MAIN_FAVICON_URL; if (empty($conf->dol_use_jmobile)) print ''."\n"; // Not required into an Android webview diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php index a4fc5c3618e..bc6262d1a92 100644 --- a/htdocs/theme/eldy/manifest.json.php +++ b/htdocs/theme/eldy/manifest.json.php @@ -46,7 +46,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_ "name": "", "icons": [ { - "src": "", + "src": "", "sizes": "256x256", "type": "image/png" } diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 79b58c5c3ad..fdbd23f1a3a 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -53,7 +53,7 @@ $theme_bgcolor = array(hexdec('F4'), hexdec('F4'), hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'), hexdec('E7'), hexdec('EC')); // Colors -$colorbackhmenu1 = '55,61,90'; // topmenu +$colorbackhmenu1 = '38,60,92'; // topmenu $colorbackvmenu1 = '250,250,250'; // vmenu $colortopbordertitle1 = '215,215,215'; // top border of title $colorbacktitle1 = '233,234,237'; // title of tables,list @@ -75,7 +75,7 @@ $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; $fontsize = '0.86em'; $fontsizesmaller = '0.75em'; -$topMenuFontSize = '1.2em'; +$topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; $toolTipFontColor = '#333'; diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php index f8d059752a6..e3423149e30 100644 --- a/htdocs/theme/md/manifest.json.php +++ b/htdocs/theme/md/manifest.json.php @@ -46,7 +46,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_AP "name": "", "icons": [ { - "src": "", + "src": "", "sizes": "256x256", "type": "image/png" } From 0dbb8224fb79e897f69b4944dcf7569bf20f22bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 12:50:54 +0200 Subject: [PATCH 452/490] Fix logo --- htdocs/theme/dolibarr_256x256_color.png | Bin 0 -> 5078 bytes htdocs/theme/dolibarr_logo.jpg | Bin 0 -> 18776 bytes htdocs/theme/dolibarr_logo.png | Bin 14082 -> 14133 bytes htdocs/theme/dolibarr_logo.svg | 258 +----------------- htdocs/theme/dolibarr_logo_256x256.png | Bin 3525 -> 0 bytes htdocs/theme/dolibarr_logo_squarred.png | Bin 6959 -> 0 bytes htdocs/theme/dolibarr_logo_squarred_alpha.png | Bin 7844 -> 0 bytes htdocs/theme/dolibarr_preferred_partner.png | Bin 0 -> 12136 bytes .../theme/dolibarr_preferred_partner_int.png | Bin 6719 -> 0 bytes htdocs/theme/dolistore_logo.jpg | Bin 0 -> 14843 bytes htdocs/theme/dolistore_logo.png | Bin 10077 -> 13413 bytes htdocs/theme/dolistore_logo.svg | 146 ++++++++++ htdocs/theme/eldy/thumb.png | Bin 11825 -> 10818 bytes 13 files changed, 160 insertions(+), 244 deletions(-) create mode 100644 htdocs/theme/dolibarr_256x256_color.png create mode 100644 htdocs/theme/dolibarr_logo.jpg mode change 100644 => 100755 htdocs/theme/dolibarr_logo.png delete mode 100644 htdocs/theme/dolibarr_logo_256x256.png delete mode 100644 htdocs/theme/dolibarr_logo_squarred.png delete mode 100644 htdocs/theme/dolibarr_logo_squarred_alpha.png create mode 100755 htdocs/theme/dolibarr_preferred_partner.png delete mode 100644 htdocs/theme/dolibarr_preferred_partner_int.png create mode 100644 htdocs/theme/dolistore_logo.jpg create mode 100755 htdocs/theme/dolistore_logo.svg diff --git a/htdocs/theme/dolibarr_256x256_color.png b/htdocs/theme/dolibarr_256x256_color.png new file mode 100644 index 0000000000000000000000000000000000000000..417387d6a27ce85f3ba64399804845b63da235c8 GIT binary patch literal 5078 zcmd5=c{r3``+vqV_9a`ECbE}ekR`%ktY7<*rLt#FvW?x4WT#|_42BR1MYb~8D}|{f zgb+s7$z)%C$M^UC{r>&Vbv@VfoHO^i&pG$<`P}CunVIOZF!D1(5X54jkG6my82E%i z^lYiY$@qxXq> z_|7DyOn8;amUr1!m1N}O)A(vEEMY)7htEef>bDiqo?9vC8qR`8?}jC6l#4y{0*uN) z|DCSBKK8uQ`-#E*j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>-Jfy z6a^bn&x!Kej8A{dTaD@`O zu2)rFQJ&X+A4R`6gENqAWKP5e{Rhx|ut5Wk%Ax*5@P3j+S_`NEE`wfEa-B~rMlfi0OG?rEpuhsXK=bLD74Gp^h=3kL{a6A z%7ueeSTd*zfxfZ|VoR4gsaUXbjP|?m`Yrjq2dgf!WmZ z*bao)geK}4VL%WD+*&%*1Tq%2(9U@Qexc7U2s7qVJ&xW!@2}8YS)~aAm|})j-p%}@ zNnXkNqj0OyKUI>u1W*_lGDV@9Lnm7qG)eM+QzDnh(KdQ9;-LbF4Z;ff%7D$HOdth- zG&!N8Ie_d%$k=X}o7K@_ESoDkYG1KgBE#{ZerRKszltx-PRIx@YJSCynnEEbNHt5n z1PNd#ku18&AtHhzSso}5E0HCBF-tB+B;SEzMV&TDb&1S7aX^7v;K?P30IJvyNbc&U z(ddoDxZFmO{{T?|(junB+p1r20Fk*fy-d|hkz^r zp~wsZ5RMu+E0Ny#BHiukt&F!Fk5OrypOh(1*Hc&U5U?y8Q*m{&LPZ2bvOHQeHw&}c z#H^BI5^uqe+Q){v#O7OZXwf%Ft)(IWs@M)KTALG(V+r-PMHb^RsR4CfB)I@ C&ZV0G literal 0 HcmV?d00001 diff --git a/htdocs/theme/dolibarr_logo.png b/htdocs/theme/dolibarr_logo.png old mode 100644 new mode 100755 index c15f03c821baf1e72192ebaee9c73477f5668810..9a0781ce2ea7820d09f3b00131a313120e804e8a GIT binary patch delta 13797 zcmXwAWl$U6*T$i^Q;Iu<7I$|kUffH8Vn2!#d~qx87ThWB8nkGUV#Qs8yUUyYXWo3s zOg6K7&fR)qrFe5Bn)q|#@=PRsEc?0&b9gM{7X8;-^C-^$|4OWaS554O#{n#Yk-+}{ z4*S2q-E+E%Nrbmno^#oYqJX!WVG0gX?f!RGw}!B4pQRw2XC9u!UdUw9$5p8n zgPUN=t&_vs25)GzOAOFI3Mn!q&ArMT4K4+Ki>HeoQyrUtE{&;> zxC zdHtU6G_>g=oraj236#fj+PyH?h~_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e}hV{cWZ45M406&ydfFckMU*20C}&;N_TmTl-gm_Zs~Y?~Wc z0HnD40^DFC4E;ld7ILveboWg6Cl2Qvu-5NOZ@W-*D(#N_YD$^F#&+gx0(;WQtL^7fhEU*-kT zZ{(I=CWo!A-|pmWves04A*KWGk{myN<& ziUs-FpDb)_E%nK5%S^d{5t|I9%ZKqVU#bR0l&hmUAecvVQ-%hJDQy8kZGpmYZ3Y${ z5wj6$EX{ArdTDP$A2B_e^k=q@7k?cpn%F#d4d>_6At^;i#<)sKR|ph>q=Vn%x&`*Y zP$qjpM1trE)(#`u!&qvlT0v5;9F)uLJUE_F$~C*S0|GhpuT&R%|FCc5tv%6xlh*juC=c2w1x0*2BpKd-k*~4VRZ<7n%*$e{<@=nhQ*?X Pfj(rVlq9RgO}_mPO+EXa diff --git a/htdocs/theme/dolibarr_logo.svg b/htdocs/theme/dolibarr_logo.svg index 44f6c07ece5..9c9259d0b33 100644 --- a/htdocs/theme/dolibarr_logo.svg +++ b/htdocs/theme/dolibarr_logo.svg @@ -23,94 +23,6 @@ id="title3072">Logo Dolibarr ERP-CRM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dolibarr - - - - - Dolibarr - - - - @@ -418,18 +188,18 @@ ERP/CRM ;8}Hega!f(!f^J2G%+Qn+O0104TvQY1V>i{ta{h z5CBku!2|$TAaDf&D-bBbU;=;=3?={w08G<>2>=2Bu0UV{fR|wK84j#KAOPSB1WGVi zfxs0AOaM@VK?w#c5C{MW062rfXH6;sSb;zQKmb4hc-gxL=t!0>4&Zkfdl@@x+xD|< z+qP}5&BwKEZ|uy(&LlG#_gByM)ca~u|KI7e=A6EL>sH^Y`o9BgjFlE0F}!;;c`b!q zisE#++2wM7{SAlH)oOQI?apt%G+P}ev#rTubGsD+^aA}l0Ir(co7y@>A+y!qXtp&r zTWgvu?5Z_cY8x%(buGpklgVNu;6^p#&UqxN(}$+scm5EP8w&sy28L==VR=J-c|$>Y zLqm&|J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%K!k!a?6%(IYx|Z0RZ4| zx*nUko_}45HNip-g5Zs1I||Bbh(F;L#NhsiJtvFiu02Q!F>(!o0P0MZ2R>M>D8$GW z001txa{qf@etq~mf0zcv2uQ@C|DIFDBsvtq2mub(AIP5h)jsk(6v60+7G73K)k7bw z7XH7F8UQ#bt7*Fa#pSIw2a#j}0MOLZdfki5YWTN2AOJwbjXrODWo2P`9r1&WvB-Ni z#$rDx)!l#nOUsVt8cB4>0Knnyzu}eT2eS;s9cFi^PQ*05~YAtbg!>ua0CJi37|6;rTE0gMY!gL$58}CU$Q# zS|Jbt9Gu82dt&CgjG{`C3Wh+?&}?~i@wOFPk0}aC1aE?o0?e)U*{k=ni)~~}@<0Xv ztKGR|(~%E8-OV2VBo71tG?}f7)*qU;?qI#iLLgNDV19GahQrIY9Q#E}4`_uxAO@$T z{yR>Wd-I{3#T$?8OD~e8%taB5B3M!AXpZr#J?ZQAWq!R~A;>TU0+-9p?t9j~ymoJ9 zd2JJc3;_V8HH`-|O12-%+kK+YWVRBt`2fHvENqDuTb+0~tK?9YL8OIRXoWyC5Qp2{ zSlw7sQO{;_at+n2QJHiik(`s%!YlNSVj$Qt~`mewA(fj+d?|%KI zUdyPp8jW77`Su%bx7*=zJDo0eE887Tw)&*mVl|n+zStyvRYP-Cor!%}S!ZIG%dL>d z{jXg+FaaQjK>#R^`>*V;QOMm6l9(0&fG;2baE<^#v*jx20#+ap01yE19r|_PFA!LP zz!?-w08oNK2?i?=2mrVOff5W>AaDf&695DNIy(?100;oM0)YttUV^~{;Cc8A2TCwl zfj|ic695DNT!Fw92$W#Z0YCsi0H9kg0woxJji!|dA|wrv00000NkvXXu0mjfVjEkt diff --git a/htdocs/theme/dolibarr_logo_squarred.png b/htdocs/theme/dolibarr_logo_squarred.png deleted file mode 100644 index bbe16cbc6dbb4163a0df89c94f9b949ead0fa9b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6959 zcmaJ`c|4Tg_rK2=jIr-pY$-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3wfB6DcnJBXGDM{WEpa=DlC~6NW&qx1_tY&Nod%b zc!b$;2RK?NO96I|z;g#a+Tl7a`1~u3{6+zm|L{f@2b ze-!$^^Ptpx+JnFieuEKN|5uai@K4RS|FQvoyZ!%~5ZRI-H^hPLq00N5z*3aXYR}9j z*d{A@N5XYqHwmbw)q$(2}eI>_ScXp*gSxU4(`$sNNF!l!kZv h`S6a=n*x^8$bKXC<7$tj-QYOTP}jMTd)_kme*nf^@UZ{@ diff --git a/htdocs/theme/dolibarr_preferred_partner.png b/htdocs/theme/dolibarr_preferred_partner.png new file mode 100755 index 0000000000000000000000000000000000000000..06e26cab9a292910cc002cbd780e783a3e3bcfc6 GIT binary patch literal 12136 zcmW++2Q(aQ7oOE6$}SS3_Y%EC55nrb3(;c{y?0g!D^Wwlik8(9U9{*cL|sAz(TNZx zTJ-+U_s=<7X3jhB%)E2U^E~$^80e{!-=e<-006nB2HXe$AbQ|`XA&at+bh1D1NE!avB~*9iy;3KDYlbn|nx z_jVHU@^yZCN$;vWU^^dv5KWeWlUcF#&wK>2NtiA*yO zYqi(TujyV7u+r3;@&AnUP@lc-`2Nh}4q+WB+X0zG&O4Y}o%3^9eLa>Ktxb%?2WFI{fnEioKsPUp{nZL3UCPy}9%1xROV?q`i|- zhKQ`JEE2CkT4O&TyX2vx7+L~x-C;ZJiMYPlnQx71@SK-@+axH5+&y~j0|cvUoefQt zn|E%sx=7H+Zyueu6UErCzr4fW!hiq%%Q?@Jhrk-pkIxFZe1Z0=pWU{_V^$f$O`UDj z&|+^I8XD$z#Ouq-6v(jsINF)*d zMcVa%lqV;3Ox7RG1k}&pmu)7%{qG7xdqc@@l1MvFKMMXsnSnGwM7~ql?+X+FUZlTZmlu=P=of2wy$yqjFbi>~nICc5@ z^3FW4`TPat0+BavsQAFYcZ~t(W}z zsG!!xfC#cu=r1D#^B3F;w2O3DmoY^C=c>P@`9j3pJn`*#`On_VeVR;P{`8X}hO^&D zg`e&ziXD*S1VZl!GRp=2ZCzb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>oz|QfCAsHmuTfp2%=nFquq6K zeSDjS3+1_buj*UC<>T*WNWsglhqQHv(yP<&Qd`Ghf8zMg)p&o2Mb@`Ytyt|yhla`?N!~m1Sih8PwYg&p&(5^X3=Dx zJfHRzIUdA%jDf>0$YHfXJ7L!r^e^_Ig3XFw^s=`NUf9k*D2LO? zRNAk}In;DbK8V_WgF9^J-}drTLi?UVf@pDxwc07Z8op+TY2i8bev-UA6Gd};Q#;t diff --git a/htdocs/theme/dolistore_logo.jpg b/htdocs/theme/dolistore_logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b79280d819f5144fa0e3c2283bf1d839640de377 GIT binary patch literal 14843 zcmb8V1z23mvM4-*4X%R(m%-g7xVyW%LvRQd+}+(Zkl-#sgC}SpSg;U0xCVHW?6c3= z_x|_(?|W<3H%qF!yt=wp_w&;81^`oDT22}O1Ofpcpg+L#3P1t?3j_1}gdT9v6CM#B z9u5v383aN=L`6nLML|YEK|{yJL_^0yM?t~F!^FY?dewKv*o`^ALa-00h87xrOrk_kjRHgolHL z`3)uf{T>Sb8w9<=!@wcH0-u)wsIWi)3??il003Md|3`!Wyb3YDNm_N$-^!DjR&Z$P$M-2MXSKm{1e5c+)qCU3IgW8K1qQu6*b_t zH2PAkHp8;OaTtAa`G`Ax;UD@Ur#6q+yphEmViT(WHy(IBmUsBrw*Y|f2iF-P5I_I= z^ly-jv0quR?KIw$9=>OlAsL4MkIx>xj_%WKcVk}b`TnXOI{`3%&|pN5y$k}pL8o69 zsqFinUk~^8atH!$DCgjHHMh_g;;RKLYEoPlkQU~(qxC@yxZAmm0PeHQ9d?nJFo z&mRA6h}RGn3jpla8j>eq|$&Xp+txS0VWZ80l1c( z&4vma4x}|nhrV~f{JWX^kR6}>nwq4TokhxswLaZi{l2<0Ig`ZnAJLlsJ ziuAaw4O=O#NDbb@%3T@`&3VfgC0l1EI(h^MwzTPt{{M&yK$W-OzWps{6GN&R?3USu zE3O(Qmnfb4o^cQWz%b@%+n(76HPz*$Um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)_0dU cX8=j8M*f8_kSUul2Z-^2ATEqwtj}Nn4}HGZXaE2J literal 0 HcmV?d00001 diff --git a/htdocs/theme/dolistore_logo.png b/htdocs/theme/dolistore_logo.png index adcb01473954857e53eed709447724935e53ddcd..747863108ce41416e1671339a0fbd4d936076668 100644 GIT binary patch literal 13413 zcmbuG_d8r)w8qa2qL)#E=)MxYixORiDA6N`UPg)DdlyEF2*IdPLUbX~YqVexBuYk$ z-g~e2 z9QNSfFnKReI~RB0xrLWI!r7A?k^BZn>HHh@)Wy}$-QL#D6L|WR zS>Dsr-QLp6)856ISJw_)hrFY`1A^Jk)6?|{Kfjeb!ot(u8)4<*T){szF{*N8{3#s(S69u3_-xAGafnK zPh!a9O{r5EM@x_FC1SVbiFoXxX98>=N$*X@O~&c3qWyB}RCa~ea<1s*v?&$;ug`~O zT6Gj!l!_{P9F$L#@B~q)LFBqQu$112M0%@m1^_K23smakO>uE?VmxMTfwrl-FH>3y z2(T5W`*wb};XFxTz1lNFa{=Z3Z%LP>l{jt&q;le-`K67=N#r+P3P=lk+fYu@XZ!Vih zVuP*1L`xilHO^2nD6?_;p&sii9CH<(`&adZN1Ox5LU0z^zZqKtBR2aLz@tz5b(6rY z{8P0vp{m0giWoTD)^_a-xCZ3D;IgoV$_gE+ANXEtldkHgv=se&Yu*G+R9)>tqhfc1 zRD}J5D~t!@4-(`SEgbrEj_D zh1)m?K0Y~`ZfGqGdG4!pJUWM7tFfi&#U8A=C0Ov4T_m;;^r%e{s&Srenhbnf!69Mm za>hcX*zaN0OMP>%k`fn?)06JpsmDs+84m0!D=DFMGJGj{%})Zz{g;1{QIt*eQ7Sn` zA@8Rlpz&bWi}jU##_ATTTZ^))1S+qsl-_HIIO=TpwPJ7k`1c3dUq5TyVg`?bp9|19 zTCOIy##=S7Ugni>8z+dwsgrGRTMWM zLz>XGdD`M^zR((W_xB73W)xoMp1-#<`8MG1jxx5;;0C8e`Ng6NyTGWMX&(!%Z_RBb zF@Mp~94;3(R+agY*v#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Z#>(EBSe z*FNuGU7y*IAb&#(o@(o3-u~x0I3-#l-EU$?C#IpLwFoCYdqrk9=`9|Q) z#~K}k+2EXz=ZY05M7j!LjghM{EaZuLs;`Qgb};@3H65wOeN&6N>QNPHIF2yZ(2J#h z)YYkJ7(y6=BO)uH3dq+K0oy_cZ(DRk=pOzSg9S<70`aS!z&ta+G!k<%W(RR1*S;qz zf%$frE5x-(fw7+IE1{-!TT`Hk_%y|mL51dk=e$@A#0oQrmM{c=WnDBYTp6e&z?G~n zG=RDhf0@D(923YOZhFT+fmTh9O#nGtf%?KCtTE7-5-6E^ED(spxuj!R(+V>PL-3kM zVgUqv5|)4xKysG&c_ivH7{QYa&li;ymY;LRUB)yu_3A-n#`29I%peTmY2xukl#2zx zk~3)l&q>zj5U7watY@hyMN6b(WyT9dgdyY$XgbU}m?d75sQJ03bIu$4?crw^Ees*E zeKwN5b-vFX`vvlh7KRWl1QqQ|8NzP_0)fC!>p^<_H)KFx00000NkvXXu0mjfGFIu| diff --git a/htdocs/theme/dolistore_logo.svg b/htdocs/theme/dolistore_logo.svg new file mode 100755 index 00000000000..844010e19b5 --- /dev/null +++ b/htdocs/theme/dolistore_logo.svg @@ -0,0 +1,146 @@ + + + + + Logo Dolibarr ERP-CRM + + + + + + + + + + + image/svg+xml + + Logo Dolibarr ERP-CRM + + + + Laurent Destailleur + + + + + Laurent Destailleur + + + + + + + + + + + + + + + Store + + + + + + + diff --git a/htdocs/theme/eldy/thumb.png b/htdocs/theme/eldy/thumb.png index 47ddbfe36d1e7ab7b13cf3b3bf158dd0754c0bbd..6d385ae4c03a9b3d90b196bbdaa688ea401d2c5a 100644 GIT binary patch literal 10818 zcmV-ID!tW-P)003kN0ssI2j?}E!00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF->s83{NHwFs{c001BWNklCb?2$7yS;ng z+WlVd-Riw1bxW44eX)e)*hZFdynqeZIKYGuhk$`FWJ2j4{|?%SN(n?R!h=eRG18`0O0b_zdfOFtLfn$WdYk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YefAKDbN5|k00000NkvXXu0mjfQUAna From 056206098b874118e4f23c0cde341cc172fb269e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 12:50:29 +0200 Subject: [PATCH 453/490] CSS --- htdocs/admin/modules.php | 4 ++-- htdocs/core/lib/security2.lib.php | 2 +- htdocs/main.inc.php | 2 +- htdocs/theme/eldy/manifest.json.php | 2 +- htdocs/theme/eldy/theme_vars.inc.php | 4 ++-- htdocs/theme/md/manifest.json.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c0f1991835b..ab2889368cd 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1198,7 +1198,7 @@ if ($mode == 'develop') print '

'."\n"; print ''; print ''; @@ -1208,7 +1208,7 @@ if ($mode == 'develop') print ''."\n"; $url = 'https://partners.dolibarr.org'; print ''; print ''; print ''; diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index c7f5a7b7330..ce346c0d26e 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -279,7 +279,7 @@ if (!function_exists('dol_loginfunction')) // Set jquery theme $dol_loginmesg = (!empty($_SESSION["dol_loginmesg"]) ? $_SESSION["dol_loginmesg"] : ''); - $favicon = DOL_URL_ROOT.'/theme/dolibarr_logo_256x256.png'; + $favicon = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; if (!empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); if (!empty($conf->global->MAIN_FAVICON_URL)) $favicon = $conf->global->MAIN_FAVICON_URL; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 49c48e34ec1..98d00a98404 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1209,7 +1209,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; // Favicon - $favicon = DOL_URL_ROOT.'/theme/dolibarr_logo_256x256.png'; + $favicon = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; if (!empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); if (!empty($conf->global->MAIN_FAVICON_URL)) $favicon = $conf->global->MAIN_FAVICON_URL; if (empty($conf->dol_use_jmobile)) print ''."\n"; // Not required into an Android webview diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php index a4fc5c3618e..bc6262d1a92 100644 --- a/htdocs/theme/eldy/manifest.json.php +++ b/htdocs/theme/eldy/manifest.json.php @@ -46,7 +46,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_ "name": "", "icons": [ { - "src": "", + "src": "", "sizes": "256x256", "type": "image/png" } diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 79b58c5c3ad..fdbd23f1a3a 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -53,7 +53,7 @@ $theme_bgcolor = array(hexdec('F4'), hexdec('F4'), hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'), hexdec('E7'), hexdec('EC')); // Colors -$colorbackhmenu1 = '55,61,90'; // topmenu +$colorbackhmenu1 = '38,60,92'; // topmenu $colorbackvmenu1 = '250,250,250'; // vmenu $colortopbordertitle1 = '215,215,215'; // top border of title $colorbacktitle1 = '233,234,237'; // title of tables,list @@ -75,7 +75,7 @@ $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; $fontsize = '0.86em'; $fontsizesmaller = '0.75em'; -$topMenuFontSize = '1.2em'; +$topMenuFontSize = '1.1em'; $toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; $toolTipFontColor = '#333'; diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php index f8d059752a6..e3423149e30 100644 --- a/htdocs/theme/md/manifest.json.php +++ b/htdocs/theme/md/manifest.json.php @@ -46,7 +46,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_AP "name": "", "icons": [ { - "src": "", + "src": "", "sizes": "256x256", "type": "image/png" } From 0409ec00d7ccd65db2a5fe631c9e30fbd9bfcabd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 13:01:32 +0200 Subject: [PATCH 454/490] CSS --- htdocs/install/check.php | 4 ++-- htdocs/install/default.css | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 95e3082cb56..1b7ac620057 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -430,7 +430,7 @@ else { $choice .= '
'; //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); - $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; + $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; // Ok '; } @@ -534,7 +534,7 @@ else $choice .= '
'; //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); $choice .= '
'; - $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; + $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; if ($count < count($migarray)) // There are other choices after { print $langs->trans("MigrateIsDoneStepByStep", DOL_VERSION); diff --git a/htdocs/install/default.css b/htdocs/install/default.css index f363789c129..e469a3bbb80 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -361,7 +361,7 @@ a.button:link,a.button:visited,a.button:active { background: #ddd; color: #fff; /* border: 1px solid #e0e0e0; */ - padding: 0.3em 0.7em; + padding: 0.5em 0.7em; margin: 0 0.5em; -moz-border-radius: 3px; -webkit-border-radius: 3px; @@ -374,6 +374,13 @@ a.button:hover { text-decoration:none; } +.suggestedchoice { + color: rgba(70, 3, 62, 0.6) !important; + /* background-color: rgba(70, 3, 62, 0.3); */ + padding: 2px 4px; + border-radius: 4px; + white-space: nowrap; +} .choiceselected { background-color: #f4f6f4; background-repeat: repeat-x; From 160ac14eb30c04818edb876fb4a087b002339e13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 13:32:57 +0200 Subject: [PATCH 455/490] Update logo --- htdocs/theme/dolibarr.png | Bin 794 -> 1711 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/theme/dolibarr.png b/htdocs/theme/dolibarr.png index 1ef6b77d4ca2cf880ef5158128f0b1b8917dca2c..3f7c35b6cf82059973602c2bf0cdbbf68e84b76d 100644 GIT binary patch literal 1711 zcmV;g22lBlP)Ih|R#B@6 z5D0`2NGYP}7|=>#l)@MgLLe-Ow5_!T*4ogrC5P+SE2a&VVtziLcx#r)=^|mMuq}yY zS=g3^Wm$+1ya%H-AlP*8PBJ^1aZ(B9XKpc7xW?p#K`h7SLki^to}DZ4>Nj4Zy>07? z4Qvc(qftr|1R-M+lUyDgp|3E=$uk#t@8Te#Qh2V51iZR5ZIA9JvttW(!bM1lR+`59 zI+*OgO5yM^&?+)?JPR8`b5oAimd3Kh)b4v)dH4Z^9|ZV*$jJC4UEQbn)!{A%hR0}o z>;SpW`~uKoC`sGGtxL1{z7B*CTzLH`GNRYT_D!S9+iM6Ra2y-Qv8hQxeYTeN{8nCi z`g8o`#A%KfXa4OP|KTdqvB|c#($JabM&CfBn6AhyZQB-JDuK$T2`%|Qmb7_deo9|$hUYmXRZb*AwhOg}H_{c~?OT7RXJmpz zGO>2GbR3x}&N4DKi64fyQ;L)V*L6szlH}?$NV&X|Wj&Y2@~yYCx3y@^#%CYpXjc!$ z7(^vl_c5v^meB|uCB%K}GIq=ZO z>FVyqb)CBpJax0k>2sI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htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/theme/dolibarr_512x512_white.png | Bin 0 -> 8921 bytes 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 htdocs/theme/dolibarr_512x512_white.png diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 4b4a4c54151..e55da6f93ac 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -147,7 +147,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout }*/ else { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo_squarred_alpha.png'; + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_512x512_white.png'; $logoContainerAdditionalClass = ''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3f539260856..be455d5431a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -514,7 +514,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = }*/ else { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo_squarred_alpha.png'; + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_512x512_white.png'; $logoContainerAdditionalClass = ''; } $title = $langs->trans("GoIntoSetupToChangeLogo"); diff --git a/htdocs/theme/dolibarr_512x512_white.png b/htdocs/theme/dolibarr_512x512_white.png new file mode 100644 index 0000000000000000000000000000000000000000..06e69ad8b7b66c0fb6b464644290dd3bcc66064e GIT binary patch literal 8921 zcmZ`<1z40%w||MH6;x7?PH9oP6cGU_kuDV!lm_Wq1^!ASDUGy%AV{|~C?KtLH!RH( zyL)Hx|Hb{jdmo;ChJD}JGiOfz&Y20)R9Ct{a+L&vpbN_P?>>YeT<|Y0L_`3FefOag zFc3UdRk{mduz%_GxzXSWvBP}>X9$uW#eQ&J#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-onWRU|AMjqt6kVc=KEUe4}i$}w=5k;d1r615pmnb`X^fShd+Y&ErCWxH|(YE((bv3LZ`QM%5` z)@iwJ*&JP}hRb3OfWG<2$d<~MuZ8j%a_3p^VV4t*gCXucD9|3n0E?;Sa>u@TRrAGm z$=B(iWy<{sYcr>52G@@G^{GNeM?3?_DWP=D`m#(GkB#F4N6gm(^PM$A-UDD@lo_d0 zH{%M&6QxVtO@5eF2JZTts!aKLFJ`=m_$&Rm>HSMzXriGzzRpP>o;fmad?5B%sp;c1VHR}>Zf z`qQ?*YJe#V=-TCnRD=u6g7fNy+Fo!jX$Q%WNJM zq|v!h$0Sq3o@zWM_rA5iytukYQogZcDyJf>_G%I*fVMOniug+4N`WEvE2Oaw<6C@b29Ku#Rt z#DK$GN3y*9cclYSdEA0(1-#!gt5#NCHI9TAS-pIr0SeZPPvtUTc-q$xmuGJioD!y1 zQZVa>t}ZB%kgTb(wE$qMB^#W*t#$7L3Soc{t)|W;<-6cKvA@x*jn@w``n|ary=8xG zXk03@ww8;P6&yF4R*y_2<@65?FrFHYnMwSj?@@T-Ob#tn0qq>3c4x>Oswjj0{b~Sk zGEiik-xqMwQPxkr@{faZZg~y?a4ZgTABc;fT>bZ7H6Abw%5F~Hwg@H{@hs_^%kU|`np`1}4r!iV!K1;DXDmGfu%)Uoe6Gao6CSUxI(*mn7<6jQ-64cIc!51u%Al@|>Jd z9M}-ZW6Z$K{=eG?*hQTJ-EcsVB!#=cA;70R9t8j4NDlJLPYmI;Uj7!p8oRq-myoie L`rV>CkKg Date: Mon, 25 May 2020 14:08:36 +0200 Subject: [PATCH 457/490] Look and feel v12 --- htdocs/bom/class/bom.class.php | 2 +- htdocs/core/class/commonobject.class.php | 9 +++++---- htdocs/core/class/html.formticket.class.php | 4 ++-- htdocs/ecm/dir_add_card.php | 2 +- htdocs/modulebuilder/template/class/myobject.class.php | 1 + htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/eldy/theme_vars.inc.php | 4 ++-- htdocs/ticket/class/ticket.class.php | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 86e0b84b655..790487b4032 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -91,7 +91,7 @@ class BOM extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f3f1b9eaee3..4fcac1979b7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6046,6 +6046,7 @@ abstract class CommonObject $computed = $this->fields[$key]['computed']; $unique = $this->fields[$key]['unique']; $required = $this->fields[$key]['required']; + $autofocusoncreate = $this->fields[$key]['autofocusoncreate']; $langfile = $this->fields[$key]['langfile']; $list = $this->fields[$key]['list']; @@ -6122,19 +6123,19 @@ abstract class CommonObject { $tmp = explode(',', $size); $newsize = $tmp[0]; - $out = ''; + $out = ''; } elseif (in_array($type, array('real'))) { - $out = ''; + $out = ''; } elseif (preg_match('/varchar/', $type)) { - $out = ''; + $out = ''; } elseif (in_array($type, array('mail', 'phone', 'url'))) { - $out = ''; + $out = ''; } elseif ($type == 'text') { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index da41a02491b..a8654f6bfc5 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -175,7 +175,7 @@ class FormTicket print '
'; } - // Si origin du ticket + // If ticket created from another object if (isset($this->param['origin']) && $this->param['originid'] > 0) { // Parse element/subelement (ex: project_task) $element = $subelement = $this->param['origin']; @@ -225,7 +225,7 @@ class FormTicket if ($this->withthreadid > 0) { $subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withthreadid.' : '.$this->topic_title.''; } - print ''; + print ''; print ''; } } diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 4d6f2bdce5a..a826c6382ce 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -241,7 +241,7 @@ if ($action == 'create') print '
'.img_picto_common('', 'treemenu/branchbottom.gif').''; diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 7ed4f2786b2..44fdf5c89f7 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -57,13 +57,11 @@ if (GETPOST('action', 'alpha') == 'set') { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif (GETPOST('action', 'alpha') == 'setmethod') +} elseif (GETPOST('action', 'alpha') == 'setmethod') { dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity); } @@ -103,8 +101,7 @@ print ''; if ($conf->global->TAKEPOS_PRINT_METHOD == "browser") { print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "
'; if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print img_picto($langs->trans("Activated"), 'switch_on'); -} -else { +} else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "
'; if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) { print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1); - } - else { + } else { if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) { $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity); } @@ -205,8 +203,7 @@ if (!empty($conf->stock->enabled)) { print $formproduct->selectWarehouses($conf->global->{'CASHDESK_ID_WAREHOUSE'.$terminal}, 'CASHDESK_ID_WAREHOUSE'.$terminal, '', 1, $disabled); print ' '; - } - else { + } else { print ''.$langs->trans("StockDecreaseForPointOfSaleDisabled").''; } print '
'.$langs->trans("Empty").'
'.$langs->trans("Empty").'
'; //span class="fa fa-bug"> - //print ''; + //print ''; print '
'; print '
'.$langs->trans("TryToUseTheModuleBuilder", $langs->transnoentitiesnoconv("ModuleBuilder")).'
'; - print''; + print''; print ''.$langs->trans("DoliPartnersDesc").''.$url.'
'; //span class="fa fa-bug"> - //print ''; + //print ''; print '
'; print '
'.$langs->trans("TryToUseTheModuleBuilder", $langs->transnoentitiesnoconv("ModuleBuilder")).'
'; - print''; + print''; print ''.$langs->trans("DoliPartnersDesc").''.$url.'
'; // Label - print ''."\n"; + print ''."\n"; print '\n"; @@ -730,7 +736,7 @@ class FormMail extends Form if (!empty($this->withtocc) || is_array($this->withtocc)) { $out .= '\n"; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index aa568bedce3..bef3d9fd0dc 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2288,7 +2288,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $total_plannedworkload += $plannedworkload; if (!in_array('plannedworkload', $hiddenfields)) { - print ''; + print ''; } if (!in_array('declaredprogress', $hiddenfields)) { diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 9806748a1c0..7b3bfd3852a 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -117,7 +117,6 @@ NbOfEMailingsSend=Mass emailings sent IdRecord=ID record DeliveryReceipt=Delivery Ack. YouCanUseCommaSeparatorForSeveralRecipients=You can use the comma separator to specify several recipients. -YouCanUseFreeEmailsForRecipients=You can enter free emails to specify several recipients. TagCheckMail=Track mail opening TagUnsubscribe=Unsubscribe link TagSignature=Signature of sending user From faf7a379ba090e6d6d6e663c576c7a55a4d1e1e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 23:01:20 +0200 Subject: [PATCH 466/490] Revert "clean" This reverts commit 8f9ee3250dba03aea88cfd5188253383c866e2fd. --- htdocs/core/class/html.formmail.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 8881b93349f..6007dd1dbaa 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -669,7 +669,6 @@ class FormMail extends Form } else { - // The select combo if (!empty($this->withto) && is_array($this->withto)) { // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time From a80270ebb5a1c68f042af8b9ebb974a3fb452f0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 23:01:25 +0200 Subject: [PATCH 467/490] Revert "clean" This reverts commit 7e7a10f8d2140ff2ca0eae2a3818bb2da35435b5. --- htdocs/core/class/html.formmail.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 6007dd1dbaa..45c40a8bc72 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -669,8 +669,15 @@ class FormMail extends Form } else { + // The free input of email + // if (!empty($this->withtofree)) + // { + // $out .= 'withto) : "")).'" />'; + // } + // The select combo if (!empty($this->withto) && is_array($this->withto)) { + //if (!empty($this->withtofree)) $out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withto; foreach ($tmparray as $key => $val) @@ -737,8 +744,10 @@ class FormMail extends Form } else { + //$out .= 'withtocc) && !is_numeric($this->withtocc)) ? $this->withtocc : '')).'" />'; if (!empty($this->withtocc) && is_array($this->withtocc)) { + //$out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtocc; foreach ($tmparray as $key => $val) From 80ace3b52ca3eb5443f9b90a8bf2f9bdcb1e36aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 23:05:29 +0200 Subject: [PATCH 468/490] Revert due to regressions --- htdocs/core/actions_sendmails.inc.php | 8 +--- htdocs/core/class/html.form.class.php | 52 +++-------------------- htdocs/core/class/html.formmail.class.php | 22 +++++----- htdocs/langs/en_US/mails.lang | 1 - 4 files changed, 19 insertions(+), 64 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index d6c4c0a6313..e23d2ce01a9 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -190,12 +190,10 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; } - elseif ((int) $val > 0) // $val is the Id of a contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; - } else { - $tmparray[] = $val; } } } @@ -242,12 +240,10 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; } - elseif ((int) $val > 0) // $val is the Id of a contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? - } else { - $tmparray[] = $val; } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6d1ce33b0be..bc89fb3403d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6621,11 +6621,10 @@ class Form * @param string $elemtype Type of element we show ('category', ...). Will execute a formating function on it. To use in readonly mode if js component support HTML formatting. * @param string $placeholder String to use as placeholder * @param int $addjscombo Add js combo - * @param int $enablefreetag 0 no free tag, 1 enable free tag for elemtype * @return string HTML multiselect string * @see selectarray(), selectArrayAjax(), selectArrayFilter() */ - public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1, $enablefreetag = 0) + public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1) { global $conf, $langs; @@ -6639,11 +6638,11 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { + $out .= "\n".' +
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("AddIn").''; print $formecm->selectAllSections((GETPOST("catParent", 'alpha') ? GETPOST("catParent", 'alpha') : $ecmdir->fk_parent), 'catParent', $module); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 2070bedf568..12400ecb087 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -83,6 +83,7 @@ class MyObject extends CommonObject * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. * 'comment' is not used. You can store here any text of your choice. It is not used by application. * * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 569e84496b6..4eaa193e682 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3843,7 +3843,7 @@ div.info { padding-bottom: 8px; margin: 1em 0em 1em 0em; background: #eff8fc; - color: #668; + color: #558; } /* Warning message */ diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index fdbd23f1a3a..0677c8e4918 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -82,7 +82,7 @@ $toolTipFontColor = '#333'; // text color $textSuccess = '#28a745'; $colorblind_deuteranopes_textSuccess = '#37de5d'; -$textWarning = '#a37c0d'; // See $badgeWarning +$textWarning = '#bc9526'; // See $badgeWarning $textDanger = '#9f4705'; // See $badgeDanger $colorblind_deuteranopes_textWarning = $textWarning; // currently not tested with a color blind people so use default color @@ -91,7 +91,7 @@ $colorblind_deuteranopes_textWarning = $textWarning; // currently not tested wit $badgePrimary = '#007bff'; $badgeSecondary = '#cccccc'; $badgeSuccess = '#55a580'; -$badgeWarning = '#a37c0d'; // See $textDanger bc9526 +$badgeWarning = '#bc9526'; // See $textWarning bc9526 $badgeDanger = '#9f4705'; // See $textDanger $badgeInfo = '#aaaabb'; $badgeDark = '#343a40'; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4db98cfe7ad..4545497be62 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -184,7 +184,7 @@ class Ticket extends CommonObject 'track_id' => array('type'=>'varchar(255)', 'label'=>'TicketTrackId', 'visible'=>-2, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'tdoverflowmax150'), - 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth75'), + 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth75', 'autofocusoncreate'=>1), 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'), 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketGroup', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), From 02b9ce59013d473546604837b03fa5814f206042 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 18:16:36 +0200 Subject: [PATCH 458/490] Fix length of title --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_facture_rec.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 96506120263..5e673d97611 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -64,6 +64,8 @@ create table llx_facturedet_rec_extrafields ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object); +ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL; + -- This var is per entity now, so we remove const if global if exists delete from llx_const where name = 'PROJECT_HIDE_TASKS' and entity = 0; diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index d0e4486262a..220c1fa608a 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -22,7 +22,7 @@ create table llx_facture_rec ( rowid integer AUTO_INCREMENT PRIMARY KEY, - titre varchar(100) NOT NULL, + titre varchar(200) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id fk_soc integer NOT NULL, datec datetime, -- date de creation From 19bcdb6418eba5700d2b045ed2f7baad8bbd3fb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 22:19:28 +0200 Subject: [PATCH 459/490] Fix structured data --- htdocs/core/lib/website.lib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 1864ca27bea..977397c2ca4 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -559,7 +559,7 @@ function getStructuredData($type, $data = array()) if ($type == 'software') { - $ret = ''."\n"; + $ret = ''."\n"; $ret .= ''."\n"; @@ -684,7 +685,7 @@ function getStructuredData($type, $data = array()) } elseif ($type == 'product') { - $ret = ''."\n"; + $ret = ''."\n"; $ret .= ''."\n"; } elseif ($type == 'blogpost') From 2fe8e03ed6f3bda4325e1fa436c28d9216a33e03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 22:23:22 +0200 Subject: [PATCH 461/490] Fix missing quote --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 804509b4154..f3a4f738927 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -600,7 +600,7 @@ function getStructuredData($type, $data = array()) }'."\n"; if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= ",\n"; - $ret .= 'sameAs": ['; + $ret .= '"sameAs": ['; $i = 0; foreach($mysoc->socialnetworks as $key => $value) { if ($key == 'linkedin') { From 5fe4520385a89b8651218909d6f2c34bb0f53116 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 25 May 2020 20:43:35 +0000 Subject: [PATCH 462/490] Fixing style errors. --- htdocs/takepos/phone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 0bc483b3fe1..2fd2beec15d 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -41,7 +41,7 @@ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // Decode place if it is an order from customer phone $place = GETPOSTISSET("key") ? dol_decode(GETPOST('key')) : GETPOST('place', 'aZ09'); } else { - $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant + $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant } $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); From 49c4ed5a085dc32a143220d80b21017018cc71ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 22:50:00 +0200 Subject: [PATCH 463/490] Update list.php --- htdocs/product/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 97d08477946..064ac2dce4f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1255,6 +1255,8 @@ if ($resql) print ''; if ($obj->tosell) { + // TODO Make 1 request for all price levels (without filter on price_level) and saved result into an cache array + // then reuse the cache array if we need prices for other price levels $resultp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price"; $resultp .= " FROM ".MAIN_DB_PREFIX."product_price as p"; $resultp .= " WHERE fk_product = ".$obj->rowid; From 416d1d0301640ce9c22483f1160ed3107824540a Mon Sep 17 00:00:00 2001 From: laurantines Date: Mon, 25 May 2020 12:26:05 +0200 Subject: [PATCH 464/490] Update list.php Search by d,phone, d.phone_perso, d.phone_mobile in SELECT QUERY --- htdocs/adherents/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 6cb34192845..bf8353da5c9 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -301,6 +301,9 @@ if ($search_email) $sql .= natural_search("d.email", $search_email); if ($search_town) $sql .= natural_search("d.town", $search_town); if ($search_zip) $sql .= natural_search("d.zip", $search_zip); if ($search_state) $sql .= natural_search("state.nom", $search_state); +if ($search_phone) $sql .= natural_search("d.phone", $search_phone); +if ($search_phone_perso) $sql .= natural_search("d.phone_perso", $search_phone_perso); +if ($search_phone_mobile) $sql .= natural_search("d.phone_mobile", $search_phone_mobile); if ($search_country) $sql .= " AND d.country IN (".$search_country.')'; if ($filter == 'uptodate') $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)"; if ($filter == 'outofdate') $sql .= " AND ((datefin IS NULL OR datefin < '".$db->idate($now)."') AND t.subscription = 1)"; From d169162ef12d370fa8994414cbdcc6aaa635d331 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 22:56:29 +0200 Subject: [PATCH 465/490] Revert "NEW enable free emails input with select2" --- htdocs/core/actions_sendmails.inc.php | 8 +--- htdocs/core/class/html.form.class.php | 46 ++--------------------- htdocs/core/class/html.formmail.class.php | 16 ++++++-- htdocs/core/lib/project.lib.php | 2 +- htdocs/langs/en_US/mails.lang | 1 - 5 files changed, 19 insertions(+), 54 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index d6c4c0a6313..e23d2ce01a9 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -190,12 +190,10 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>'; } - elseif ((int) $val > 0) // $val is the Id of a contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); $sendtoid[] = $val; - } else { - $tmparray[] = $val; } } } @@ -242,12 +240,10 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST { $tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>'; } - elseif ((int) $val > 0) // $val is the Id of a contact + elseif ($val) // $val is the Id of a contact { $tmparray[] = $thirdparty->contact_get_property((int) $val, 'email'); //$sendtoid[] = $val; TODO Add also id of contact in CC ? - } else { - $tmparray[] = $val; } } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6d1ce33b0be..622ffb1d127 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6621,11 +6621,10 @@ class Form * @param string $elemtype Type of element we show ('category', ...). Will execute a formating function on it. To use in readonly mode if js component support HTML formatting. * @param string $placeholder String to use as placeholder * @param int $addjscombo Add js combo - * @param int $enablefreetag 0 no free tag, 1 enable free tag for elemtype * @return string HTML multiselect string * @see selectarray(), selectArrayAjax(), selectArrayFilter() */ - public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1, $enablefreetag = 0) + public static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1) { global $conf, $langs; @@ -6667,50 +6666,13 @@ class Form $out .= '$(document).ready(function () { $(\'#'.$htmlname.'\').'.$tmpplugin.'({ dir: \'ltr\', - tags: '.($enablefreetag?'true':'false').', // Specify format function for dropdown item formatResult: formatResult, - /* For 4.0 */ - templateResult: formatResult, + templateResult: formatResult, /* For 4.0 */ // Specify format function for selected item formatSelection: formatSelection, - /* For 4.0 */ - templateSelection: formatSelection'; - if ($enablefreetag && $elemtype == 'email') { - $out .= ', - createTag: function (params) { - var REGEX_EMAIL = "([a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@" + - "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)"; - // Dont offset to create a tag if there is no @ symbol - if (params.term.indexOf("@") === -1) { - // Return null to disable tag creation - return null; - } - var match = params.term.match(new RegExp("^([^<]*)\<" + REGEX_EMAIL + "\>$", "i")); - // console.log(match); - if (match !== null) { - return { - id: $.trim(match[1]) + " <" + match[2] + ">", - text: $.trim(match[1]) + " <" + match[2] + ">" - } - } - if (params.term.indexOf("<") >= 0) { - // Return null to disable tag creation - return null; - } - var match = params.term.match(new RegExp("^" + REGEX_EMAIL + "$", "i")); - // console.log(match); - if (match !== null) { - var pos = params.term.indexOf("@"); - return { - id: $.trim(match[1].substring(0, pos)) + " <" + match[1] + ">", - text: $.trim(match[1].substring(0, pos)) + " <" + match[1] + ">" - } - } - return null; - }'; - } - $out .= ' }); + templateSelection: formatSelection /* For 4.0 */ + }); });'."\n"; } elseif ($addjscombo == 2) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 8881b93349f..d961cd20536 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -630,7 +630,7 @@ class FormMail extends Form if (!empty($this->withto) || is_array($this->withto)) { $out .= '
'; - if ($this->withtofree) $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseFreeEmailsForRecipients")); + if ($this->withtofree) $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); else $out .= $langs->trans("MailTo"); $out .= ''; if ($this->withtoreadonly) @@ -669,9 +669,15 @@ class FormMail extends Form } else { + // The free input of email + if (!empty($this->withtofree)) + { + $out .= 'withto) : "")).'" />'; + } // The select combo if (!empty($this->withto) && is_array($this->withto)) { + if (!empty($this->withtofree)) $out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withto; foreach ($tmparray as $key => $val) @@ -683,7 +689,7 @@ class FormMail extends Form { $withtoselected = array_keys($tmparray); } - $out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', 0, '', '', 'email', '', -1, !empty($this->withtofree)?1:0); + $out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, ""); } } $out .= "
'; - $out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseFreeEmailsForRecipients")); + $out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); $out .= ''; if ($this->withtoccreadonly) { @@ -738,8 +744,10 @@ class FormMail extends Form } else { + $out .= 'withtocc) && !is_numeric($this->withtocc)) ? $this->withtocc : '')).'" />'; if (!empty($this->withtocc) && is_array($this->withtocc)) { + $out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtocc; foreach ($tmparray as $key => $val) @@ -747,7 +755,7 @@ class FormMail extends Form $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } $withtoccselected = GETPOST("receivercc"); // Array of selected value - $out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500', 0, '', '', 'email', '', -1, !empty($this->withtofree)?1:0); + $out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500', null, ""); } } $out .= "
'.($plannedworkload ? convertSecondToTime($plannedworkload) : '').''.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'