From 7cc9639417d9a33ff9b2e0c34737c1cdd9e6908e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 22 Feb 2020 12:28:15 +0100 Subject: [PATCH 001/539] 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 ab870dd5322346e5a8b0dde5c7e7ee8b0570dffa Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Sun, 12 Apr 2020 13:30:02 +0200 Subject: [PATCH 002/539] Switch to new category API in project list view --- htdocs/core/class/html.formcategory.class.php | 9 ++--- htdocs/product/stock/list.php | 4 +- htdocs/projet/list.php | 37 ++++++++++++------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index 4dd8bed247b..bb7e523d1c8 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -28,13 +28,12 @@ class FormCategory extends Form /** * Return a HTML filter box for a list filter view * - * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) - * @param Array $preSelected A list with the elements that should pre-selected - * @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list")) + * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) + * @param Array $preSelected A list with the elements that should pre-selected + * @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list")) */ - public function getFilterBox($type, $preSelected) + public function getFilterBox($type, array $preSelected) { - // phpcs:enable global $langs; if (empty($preSelected) || !is_array($preSelected)) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index a2f3da7abf0..569226a263d 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -27,10 +27,10 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; if (!empty($conf->categorie->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -185,7 +185,6 @@ if (empty($reshook)) */ $form = new Form($db); -$formcategory = new FormCategory($db); $warehouse = new Entrepot($db); $totalarray = array(); @@ -380,6 +379,7 @@ $moreforfilter = ''; if (!empty($conf->categorie->enabled)) { + $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_WAREHOUSE, $search_category_list); } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index e04875294bf..23333419902 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -7,6 +7,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2020 Tobias Sean * * 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 @@ -34,6 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +if (!empty($conf->categorie->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +} + // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'commercial')); @@ -72,7 +79,6 @@ $pageprev = $page - 1; $pagenext = $page + 1; $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); -$search_categ = GETPOST("search_categ", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_societe = GETPOST("search_societe", 'alpha'); @@ -101,6 +107,11 @@ $search_eyear = GETPOST('search_eyear', 'int'); if ($search_status == '') $search_status = -1; // -1 or 1 +if (!empty($conf->categorie->enabled)) +{ + $search_category_list = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); +} + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Project($db); $hookmanager->initHooks(array('projectlist')); @@ -174,7 +185,6 @@ if (empty($reshook)) 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_all = ''; - $search_categ = ''; $search_ref = ""; $search_label = ""; $search_societe = ""; @@ -197,6 +207,7 @@ if (empty($reshook)) $search_usage_bill_time = ''; $toselect = ''; $search_array_options = array(); + $search_category_list = array(); } @@ -293,8 +304,6 @@ $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut, p.fk_op $sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount, p.usage_opportunity, p.usage_task, p.usage_bill_time"; $sql .= ", s.rowid as socid, s.nom as name, s.email"; $sql .= ", cls.code as opp_status_code"; -// We'll need these fields in order to filter by categ -if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_project"; // Add fields from extrafields 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.' as options_'.$key : ''); @@ -304,11 +313,12 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; +if (!empty($conf->categorie->enabled)) +{ + $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid"); +} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; -// We'll need this table joined to the select in order to filter by categ -if (!empty($search_categ)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ // We'll need this table joined to the select in order to filter by sale // No check is done on company permission because readability is managed by public status of project and assignement. //if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; @@ -318,11 +328,13 @@ if ($search_project_user > 0) $sql .= ", ".MAIN_DB_PREFIX."element_contact as ecp"; } $sql .= " WHERE p.entity IN (".getEntity('project').')'; +if (!empty($conf->categorie->enabled)) +{ + $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, "p.rowid", $search_category_list); +} if (!$user->rights->projet->all->lire) $sql .= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users // No need to check if company is external user, as filtering of projects must be done by getProjectsAuthorizedForUser if ($socid > 0) $sql .= " AND (p.fk_soc = ".$socid.")"; // This filter if when we use a hard coded filter on company on url (not related to filter for external users) -if ($search_categ > 0) $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ); -if ($search_categ == -2) $sql .= " AND cs.fk_categorie IS NULL"; if ($search_ref) $sql .= natural_search('p.ref', $search_ref); if ($search_label) $sql .= natural_search('p.title', $search_label); if ($search_societe) $sql .= natural_search('s.nom', $search_societe); @@ -486,11 +498,8 @@ $moreforfilter = ''; // Filter on categories if (!empty($conf->categorie->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('ProjectCategories').': '; - $moreforfilter .= $formother->select_categories('project', $search_categ, 'search_categ', 1, 1, 'maxwidth300'); - $moreforfilter .= '
'; + $formcategory = new FormCategory($db); + $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_list); } // If the user can view user other than himself From ef38b5a015286c3329a30fa1ab287d04b54f20c0 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Sun, 12 Apr 2020 13:59:24 +0200 Subject: [PATCH 003/539] fix wrong delete code line --- htdocs/projet/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 23333419902..d0f14a3f03d 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -317,6 +317,7 @@ if (!empty($conf->categorie->enabled)) { $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid"); } +if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; // We'll need this table joined to the select in order to filter by sale From 104e786a794b8e1c994bc2c9a6e5a5ba9e97f1ef Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 21 Apr 2020 10:02:18 +0200 Subject: [PATCH 004/539] cleanup user rights on forun facture card --- htdocs/fourn/facture/card.php | 109 +++++++++++++++++----------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 697c8cb74f0..c49d4c6e76b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -99,12 +99,16 @@ if (!empty($user->socid)) $socid = $user->socid; $isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft); +$usercanread = $user->rights->fournisseur->facture->lire; $usercancreate = $user->rights->fournisseur->facture->creer; +$usercandelete = $user->rights->fournisseur->facture->supprimer; +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); +$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send); -$permissionnote = $user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->fournisseur->facture->creer; // Used by the include of actions_dellink.inc.php -$permissiontoedit = $user->rights->fournisseur->facture->creer; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd = $user->rights->fournisseur->facture->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php /* @@ -163,10 +167,7 @@ if (empty($reshook)) } } - elseif ($action == 'confirm_valid' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) - ) + elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) { $idwarehouse = GETPOST('idwarehouse'); @@ -230,8 +231,7 @@ if (empty($reshook)) $isErasable = $object->is_erasable(); - if (($user->rights->fournisseur->facture->supprimer && $isErasable > 0) - || ($user->rights->fournisseur->facture->creer && $isErasable == 1)) + if (($usercandelete && $isErasable > 0) || ($usercancreate && $isErasable == 1)) { $result = $object->delete($user); if ($result > 0) @@ -247,7 +247,7 @@ if (empty($reshook)) } // Remove a product line - elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) { $result = $object->deleteline($lineid); if ($result > 0) @@ -280,14 +280,14 @@ if (empty($reshook)) } // Delete link of credit note to invoice - elseif ($action == 'unlinkdiscount' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'unlinkdiscount' && $usercancreate) { $discount = new DiscountAbsolute($db); $result = $discount->fetch(GETPOST("discountid")); $discount->unlink_invoice(); } - elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercancreate) { $object->fetch($id); $result = $object->set_paid($user); @@ -298,7 +298,7 @@ if (empty($reshook)) } // Set supplier ref - if ($action == 'setref_supplier' && $user->rights->fournisseur->facture->creer) + if ($action == 'setref_supplier' && $usercancreate) { $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); @@ -328,7 +328,7 @@ if (empty($reshook)) } // payments conditions - if ($action == 'setconditions' && $user->rights->fournisseur->facture->creer) + if ($action == 'setconditions' && $usercancreate) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); } @@ -340,35 +340,35 @@ if (empty($reshook)) } // payment mode - elseif ($action == 'setmode' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'setmode' && $usercancreate) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); } // Multicurrency Code - elseif ($action == 'setmulticurrencycode' && $user->rights->fournisseur->facture->creer) { + elseif ($action == 'setmulticurrencycode' && $usercancreate) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - elseif ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->facture->creer) { + elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx', 'alpha'))); } // bank account - elseif ($action == 'setbankaccount' && $user->rights->fournisseur->facture->creer) { + elseif ($action == 'setbankaccount' && $usercancreate) { $result = $object->setBankAccount(GETPOST('fk_account', 'int')); } // Set label - elseif ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'setlabel' && $usercancreate) { $object->fetch($id); $object->label = GETPOST('label'); $result = $object->update($user); if ($result < 0) dol_print_error($db); } - elseif ($action == 'setdatef' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'setdatef' && $usercancreate) { $newdate = dol_mktime(0, 0, 0, $_POST['datefmonth'], $_POST['datefday'], $_POST['datefyear']); if ($newdate > (dol_now() + (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE) ? 0 : $conf->global->INVOICE_MAX_OFFSET_IN_FUTURE))) @@ -393,7 +393,7 @@ if (empty($reshook)) $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); } - elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'setdate_lim_reglement' && $usercancreate) { $object->fetch($id); $object->date_echeance = dol_mktime(12, 0, 0, $_POST['date_lim_reglementmonth'], $_POST['date_lim_reglementday'], $_POST['date_lim_reglementyear']); @@ -614,7 +614,7 @@ if (empty($reshook)) // Delete payment - elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $usercancreate) { $object->fetch($id); if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0) @@ -1065,7 +1065,7 @@ if (empty($reshook)) } // Edit line - elseif ($action == 'updateline' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'updateline' && $usercancreate) { $db->begin(); @@ -1162,7 +1162,7 @@ if (empty($reshook)) } } - elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'addline' && $usercancreate) { $db->begin(); @@ -1463,7 +1463,7 @@ if (empty($reshook)) $action = ''; } - elseif ($action == 'classin' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'classin' && $usercancreate) { $object->fetch($id); $result = $object->setProject($projectid); @@ -1471,7 +1471,7 @@ if (empty($reshook)) // Set invoice to draft status - elseif ($action == 'confirm_edit' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'confirm_edit' && $confirm == 'yes' && $usercancreate) { $object->fetch($id); @@ -1538,7 +1538,7 @@ if (empty($reshook)) } // Set invoice to validated/unpaid status - elseif ($action == 'reopen' && $user->rights->fournisseur->facture->creer) + elseif ($action == 'reopen' && $usercancreate) { $result = $object->fetch($id); if ($object->statut == FactureFournisseur::STATUS_CLOSED @@ -1569,7 +1569,7 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->fournisseur->facture->dir_output; - $permissiontoadd = $user->rights->fournisseur->facture->creer; + $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Make calculation according to calculationrule @@ -1611,7 +1611,7 @@ if (empty($reshook)) $action = 'edit_extras'; } - if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->facture->creer) + if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $usercancreate) { if ($action == 'addcontact') { @@ -2439,8 +2439,8 @@ else $morehtmlref = '
'; // Ref supplier - $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; @@ -2449,7 +2449,7 @@ else { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->facture->creer) + if ($usercancreate) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; @@ -2549,11 +2549,11 @@ else // Label print ''; - print ''.$form->editfieldkey("Label", 'label', $object->label, $object, ($user->rights->fournisseur->facture->creer)).''; - print ''.$form->editfieldval("Label", 'label', $object->label, $object, ($user->rights->fournisseur->facture->creer)).''; + print ''.$form->editfieldkey("Label", 'label', $object->label, $object, ($usercancreate)).''; + print ''.$form->editfieldval("Label", 'label', $object->label, $object, ($usercancreate)).''; print ''; - $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $user->rights->fournisseur->facture->creer && ($object->getSommePaiement() <= 0); + $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); // Date print ''.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').''; @@ -2574,7 +2574,7 @@ else print ''; } print '
'; print $langs->trans('PaymentConditions'); print ''; - if ($action != 'editconditions' && $user->rights->fournisseur->facture->creer) { + if ($action != 'editconditions' && $usercancreate) { print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; @@ -2596,7 +2596,7 @@ else print ''; - if ($action != 'editmode' && $user->rights->fournisseur->facture->creer) { + if ($action != 'editmode' && $usercancreate) { print ''; } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; @@ -2665,7 +2665,7 @@ else print ''; print '
'; print $langs->trans('BankAccount'); print ''; - if ($action != 'editbankaccount' && $user->rights->fournisseur->facture->creer) + if ($action != 'editbankaccount' && $usercancreate) print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; print ''; @@ -2684,7 +2684,7 @@ else print '
'; print $langs->trans('IncotermLabel'); print ''; - if ($user->rights->fournisseur->facture->creer) print ''.img_edit().''; + if ($usercancreate) print ''.img_edit().''; else print ' '; print '
'; print ''; @@ -3077,7 +3077,7 @@ else $num = count($object->lines); // Form to add new line - if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer) + if ($object->statut == FactureFournisseur::STATUS_DRAFT && $usercancreate) { if ($action != 'editline') { @@ -3110,7 +3110,7 @@ else if (empty($reshook)) { // Modify a validated invoice with no payments - if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'confirm_edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'confirm_edit' && $object->getSommePaiement() == 0 && $usercancreate) { // We check if lines of invoice are not already transfered into accountancy $ventilExportCompta = $object->getVentilExportCompta(); // Should be 0 since the sum of payments are zero. But we keep the protection. @@ -3133,13 +3133,13 @@ else || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id))) && ($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED)) // A paid invoice (partially or completely) { - if (!$facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice + if (!$facidnext && $object->close_code != 'replaced' && $usercancreate) // Not replaced by another invoice { print ''; } else { - if ($user->rights->fournisseur->facture->creer) { + if ($usercancreate) { print '
'.$langs->trans('ReOpen').'
'; } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { print '
'.$langs->trans('ReOpen').'
'; @@ -3151,7 +3151,7 @@ else if (empty($user->socid)) { if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) + if ($usercansend) { print ''; } @@ -3190,18 +3190,18 @@ else } // For standard invoice with excess paid - if ($object->type == FactureFournisseur::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->fournisseur->facture->creer && empty($discount->id)) + if ($object->type == FactureFournisseur::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $usercancreate && empty($discount->id)) { print ''; } // For credit note - if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->fournisseur->facture->creer + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $usercancreate && (!empty($conf->global->SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) || $object->getSommePaiement() == 0) ) { print ''; } // For deposit invoice - if ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->paye == 1 && $resteapayer == 0 && $user->rights->fournisseur->facture->creer && empty($discount->id)) + if ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->paye == 1 && $resteapayer == 0 && $usercancreate && empty($discount->id)) { print ''; } @@ -3212,8 +3212,7 @@ else { if (count($object->lines)) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->facture->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))) + if ($usercanvalidate) { print ''; @@ -3233,13 +3232,13 @@ else }*/ // Clone - if ($action != 'edit' && $user->rights->fournisseur->facture->creer) + if ($action != 'edit' && $usercancreate) { print ''; } // Create a credit note - if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut > 0 && $user->rights->fournisseur->facture->creer) + if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut > 0 && $usercancreate) { if (!$objectidnext) { @@ -3249,7 +3248,7 @@ else // Delete $isErasable = $object->is_erasable(); - if ($action != 'confirm_edit' && ($user->rights->fournisseur->facture->supprimer || ($user->rights->fournisseur->facture->creer && $isErasable == 1))) // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) + if ($action != 'confirm_edit' && ($user->rights->fournisseur->facture->supprimer || ($usercancreate && $isErasable == 1))) // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) { //var_dump($isErasable); if ($isErasable == -4) { @@ -3286,8 +3285,8 @@ else $subdir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref; $filedir = $conf->fournisseur->facture->dir_output.'/'.$subdir; $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; - $genallowed = $user->rights->fournisseur->facture->lire; - $delallowed = $user->rights->fournisseur->facture->creer; + $genallowed = $usercanread; + $delallowed = $usercancreate; $modelpdf = (!empty($object->modelpdf) ? $object->modelpdf : (empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF) ? '' : $conf->global->INVOICE_SUPPLIER_ADDON_PDF)); print $formfile->showdocuments('facture_fournisseur', $subdir, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang); From 7de4f4d0bb3aacf7053ddd46808607a13bc163a3 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 21 Apr 2020 12:13:15 +0200 Subject: [PATCH 005/539] Cleanup user rights on forun commande card --- htdocs/fourn/commande/card.php | 137 ++++++++++++++++++--------------- 1 file changed, 74 insertions(+), 63 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index bc86076644c..20d76b74e00 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -110,10 +110,25 @@ elseif (!empty($socid) && $socid > 0) if ($ret < 0) dol_print_error($db, $object->error); } -$permissionnote = $user->rights->fournisseur->commande->creer; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->fournisseur->commande->creer; // Used by the include of actions_dellink.inc.php -$permissiontoedit = $user->rights->fournisseur->commande->creer; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd = $user->rights->fournisseur->commande->creer; // Used by the include of actions_addupdatedelete.inc.php +// Common permissions +$usercanread = $user->rights->fournisseur->commande->lire; +$usercancreate = $user->rights->fournisseur->commande->creer; +$usercandelete = $user->rights->fournisseur->commande->supprimer; + +// Advanced permissions +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))); + +// Additional area permissions +$usercanapprove = $user->rights->fournisseur->commande->approuver; +$usercanapprovesecond = $user->rights->fournisseur->commande->approve2; +$usercanorder = $user->rights->fournisseur->commande->commander; +$usercanreceived = $user->rights->fournisseur->commande->receptionner; + +// Permissions for includes +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* @@ -142,66 +157,66 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) + if ($action == 'setref_supplier' && $usercancreate) { $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier', 'alpha'), '', null, 'text', '', $user, 'ORDER_SUPPLIER_MODIFY'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // Set incoterm - if ($action == 'set_incoterms' && $user->rights->fournisseur->commande->creer) + if ($action == 'set_incoterms' && $usercancreate) { $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // payment conditions - if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) + if ($action == 'setconditions' && $usercancreate) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // payment mode - if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) + if ($action == 'setmode' && $usercancreate) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // Multicurrency Code - elseif ($action == 'setmulticurrencycode' && $user->rights->fournisseur->commande->creer) { + elseif ($action == 'setmulticurrencycode' && $usercancreate) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - elseif ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->commande->creer) { + elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } // bank account - if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer) + if ($action == 'setbankaccount' && $usercancreate) { $result = $object->setBankAccount(GETPOST('fk_account', 'int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // date of delivery - if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) + if ($action == 'setdate_livraison' && $usercancreate) { $result = $object->set_date_livraison($user, $datelivraison); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // Set project - if ($action == 'classin' && $user->rights->fournisseur->commande->creer) + if ($action == 'classin' && $usercancreate) { $result = $object->setProject($projectid); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // Edit Thirdparty - if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $action == 'set_thirdparty' && $user->rights->fournisseur->commande->creer && $object->statut == CommandeFournisseur::STATUS_DRAFT) + if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $action == 'set_thirdparty' && $usercancreate && $object->statut == CommandeFournisseur::STATUS_DRAFT) { $new_socid = GETPOST('new_socid', 'int'); if (!empty($new_socid) && $new_socid != $object->thirdparty->id) { @@ -263,7 +278,7 @@ if (empty($reshook)) exit; } - if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) + if ($action == 'setremisepercent' && $usercancreate) { $result = $object->set_remise($user, $_POST['remise_percent']); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); @@ -329,7 +344,7 @@ if (empty($reshook)) /* * Classify supplier order as billed */ - if ($action == 'classifybilled' && $user->rights->fournisseur->commande->creer) + if ($action == 'classifybilled' && $usercancreate) { $ret = $object->classifyBilled($user); if ($ret < 0) { @@ -338,7 +353,7 @@ if (empty($reshook)) } // Add a product line - if ($action == 'addline' && $user->rights->fournisseur->commande->creer) + if ($action == 'addline' && $usercancreate) { $db->begin(); @@ -636,7 +651,7 @@ if (empty($reshook)) /* * Updating a line in the order */ - if ($action == 'updateline' && $user->rights->fournisseur->commande->creer && !GETPOST('cancel', 'alpha')) + if ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { $vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0); @@ -777,7 +792,7 @@ if (empty($reshook)) } // Remove a product line - if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) + if ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) { $result = $object->deleteline($lineid); if ($result > 0) @@ -810,10 +825,7 @@ if (empty($reshook)) } // Validate - if ($action == 'confirm_valid' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) - ) + if ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) { $object->date_commande = dol_now(); $result = $object->valid($user); @@ -843,13 +855,13 @@ if (empty($reshook)) } // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step - if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))) + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $usercanapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))) { $action = 'confirm_approve'; // can make standard or first level approval also if permission is set } } - if (($action == 'confirm_approve' || $action == 'confirm_approve2') && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) + if (($action == 'confirm_approve' || $action == 'confirm_approve2') && $confirm == 'yes' && $usercanapprove) { $idwarehouse = GETPOST('idwarehouse', 'int'); @@ -900,7 +912,7 @@ if (empty($reshook)) } } - if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) + if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove) { $result = $object->refuse($user); if ($result > 0) @@ -924,7 +936,7 @@ if (empty($reshook)) } } - if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) + if ($action == 'confirm_commande' && $confirm == 'yes' && $usercanorder) { $result = $object->commande($user, GETPOST("datecommande"), GETPOST("methode", 'int'), GETPOST('comment', 'alphanohtml')); if ($result > 0) @@ -952,7 +964,7 @@ if (empty($reshook)) } - if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer) + if ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) { $result = $object->delete($user); if ($result > 0) @@ -967,7 +979,7 @@ if (empty($reshook)) } // Action clone object - if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) + if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) { if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) { @@ -996,7 +1008,7 @@ if (empty($reshook)) } // Set status of reception (complete, partial, ...) - if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner) + if ($action == 'livraison' && $usercanreceived) { if (GETPOST("type") != '') { @@ -1024,7 +1036,7 @@ if (empty($reshook)) } } - if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) + if ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanorder) { $result = $object->cancel($user); if ($result > 0) @@ -1049,7 +1061,7 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->fournisseur->commande->dir_output; - $permissiontoadd = $user->rights->fournisseur->commande->creer; + $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; @@ -1082,7 +1094,7 @@ if (empty($reshook)) /* * Create an order */ - if ($action == 'add' && $user->rights->fournisseur->commande->creer) + if ($action == 'add' && $usercancreate) { $error = 0; $selectedLines = GETPOST('toselect', 'array'); @@ -1395,7 +1407,7 @@ if (empty($reshook)) } } - if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->commande->creer) + if (!empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $usercancreate) { if ($action == 'addcontact') { @@ -1922,11 +1934,11 @@ elseif (!empty($object->id)) $morehtmlref = '
'; // Ref supplier - $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty'); - if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && !empty($user->rights->fournisseur->commande->creer) && $action == 'edit_thirdparty') { + if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && !empty($usercancreate) && $action == 'edit_thirdparty') { $morehtmlref .= ' : '; $morehtmlref .= '
'; $morehtmlref .= ''; @@ -1947,7 +1959,7 @@ elseif (!empty($object->id)) if (!empty($conf->projet->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer) { + if ($usercancreate) { if ($action != 'classify') $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; if ($action == 'classify') { @@ -2128,7 +2140,7 @@ elseif (!empty($object->id)) print ''; print '
'; print $langs->trans('BankAccount'); print ''; - if ($action != 'editbankaccount' && $user->rights->fournisseur->commande->creer) + if ($action != 'editbankaccount' && $usercancreate) print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; print ''; @@ -2184,7 +2196,7 @@ elseif (!empty($object->id)) print '
'; print $langs->trans('IncotermLabel'); print ''; - if ($user->rights->fournisseur->commande->creer) print ''.img_edit().''; + if ($usercancreate) print ''.img_edit().''; else print ' '; print '
'; print ''; @@ -2324,7 +2336,7 @@ elseif (!empty($object->id)) $num = count($object->lines); // Form to add new line - if ($object->statut == CommandeFournisseur::STATUS_DRAFT && $user->rights->fournisseur->commande->creer) + if ($object->statut == CommandeFournisseur::STATUS_DRAFT && $usercancreate) { if ($action != 'editline') { @@ -2359,11 +2371,10 @@ elseif (!empty($object->id)) // Validate if ($object->statut == 0 && $num > 0) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate))) + if ($usercanvalidate) { $tmpbuttonlabel = $langs->trans('Validate'); - if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) $tmpbuttonlabel = $langs->trans("ValidateAndApprove"); + if ($usercanapprove && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) $tmpbuttonlabel = $langs->trans("ValidateAndApprove"); print ''; print $tmpbuttonlabel; @@ -2379,7 +2390,7 @@ elseif (!empty($object->id)) // Modify if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { - if ($user->rights->fournisseur->commande->commander) + if ($usercanorder) { print ''.$langs->trans("Modify").''; } @@ -2388,7 +2399,7 @@ elseif (!empty($object->id)) // Approve if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { - if ($user->rights->fournisseur->commande->approuver) + if ($usercanapprove) { if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED && !empty($object->user_approve_id)) { @@ -2410,7 +2421,7 @@ elseif (!empty($object->id)) { if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { - if ($user->rights->fournisseur->commande->approve2) + if ($usercanapprovesecond) { if (!empty($object->user_approve_id2)) { @@ -2431,7 +2442,7 @@ elseif (!empty($object->id)) // Refuse if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { - if ($user->rights->fournisseur->commande->approuver || $user->rights->fournisseur->commande->approve2) + if ($usercanapprove || $usercanapprovesecond) { print ''.$langs->trans("RefuseOrder").''; } @@ -2445,7 +2456,7 @@ elseif (!empty($object->id)) if (empty($user->socid)) { if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5)) || !empty($conf->global->SUPPLIER_ORDER_SENDBYEMAIL_FOR_ALL_STATUS)) { - if ($user->rights->fournisseur->commande->commander) + if ($usercanorder) { print ''.$langs->trans('SendMail').''; } @@ -2456,7 +2467,7 @@ elseif (!empty($object->id)) if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED))) { $buttonshown = 0; - if (!$buttonshown && $user->rights->fournisseur->commande->approuver) + if (!$buttonshown && $usercanapprove) { if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) || (!empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) && $user->id == $object->user_approve_id)) @@ -2465,7 +2476,7 @@ elseif (!empty($object->id)) $buttonshown++; } } - if (!$buttonshown && $user->rights->fournisseur->commande->approve2 && !empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) + if (!$buttonshown && $usercanapprovesecond && !empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) { if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) || (!empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2)) @@ -2476,7 +2487,7 @@ elseif (!empty($object->id)) } if (in_array($object->statut, array(3, 4, 5, 6, 7, 9))) { - if ($user->rights->fournisseur->commande->commander) + if ($usercanorder) { print ''.$langs->trans("ReOpen").''; } @@ -2490,7 +2501,7 @@ elseif (!empty($object->id)) if ($conf->reception->enabled) $labelofbutton = $langs->trans("CreateReception"); if (in_array($object->statut, array(3, 4, 5))) { - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) { + if ($conf->fournisseur->enabled && $usercanreceived) { print ''; } else { print ''; @@ -2500,7 +2511,7 @@ elseif (!empty($object->id)) if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) { - if ($user->rights->fournisseur->commande->commander) + if ($usercanorder) { print ''; } @@ -2513,7 +2524,7 @@ elseif (!empty($object->id)) // Classify received (this does not record reception) if ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) { - if ($user->rights->fournisseur->commande->receptionner) + if ($usercanreceived) { print ''; } @@ -2532,7 +2543,7 @@ elseif (!empty($object->id)) //} // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) - if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved + if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved { if (empty($conf->facture->enabled)) { @@ -2561,7 +2572,7 @@ elseif (!empty($object->id)) } // Clone - if ($user->rights->fournisseur->commande->creer) + if ($usercancreate) { print ''.$langs->trans("ToClone").''; } @@ -2569,14 +2580,14 @@ elseif (!empty($object->id)) // Cancel if ($object->statut == 2) { - if ($user->rights->fournisseur->commande->commander) + if ($usercanorder) { print ''.$langs->trans("CancelOrder").''; } } // Delete - if (!empty($user->rights->fournisseur->commande->supprimer) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && !empty($user->rights->fournisseur->commande->creer))) + if (!empty($usercandelete) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && !empty($usercancreate))) { print ''.$langs->trans("Delete").''; } @@ -2586,7 +2597,7 @@ elseif (!empty($object->id)) - if ($user->rights->fournisseur->commande->commander && $object->statut == CommandeFournisseur::STATUS_ACCEPTED && $action == 'makeorder') + if ($usercanorder && $object->statut == CommandeFournisseur::STATUS_ACCEPTED && $action == 'makeorder') { // Set status to ordered (action=commande) print ''."\n"; @@ -2630,8 +2641,8 @@ elseif (!empty($object->id)) $relativepath = $comfournref.'/'.$comfournref.'.pdf'; $filedir = $conf->fournisseur->dir_output.'/commande/'.$comfournref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->fournisseur->commande->lire; - $delallowed = $user->rights->fournisseur->commande->creer; + $genallowed = $usercanread; + $delallowed = $usercancreate; print $formfile->showdocuments('commande_fournisseur', $comfournref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); $somethingshown = $formfile->numoffiles; @@ -2644,7 +2655,7 @@ elseif (!empty($object->id)) if ($action == 'classifyreception') { - if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) + if ($usercanreceived && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) { // Set status to received (action=livraison) print ''."\n"; From 06556fe14c048901f02d0088b2cafd5dcf649464 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 21 Apr 2020 12:25:44 +0200 Subject: [PATCH 006/539] indent + comments --- htdocs/fourn/facture/card.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c49d4c6e76b..828424b9f15 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -99,16 +99,20 @@ if (!empty($user->socid)) $socid = $user->socid; $isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft); -$usercanread = $user->rights->fournisseur->facture->lire; -$usercancreate = $user->rights->fournisseur->facture->creer; -$usercandelete = $user->rights->fournisseur->facture->supprimer; -$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); -$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send); +// Common permissions +$usercanread = $user->rights->fournisseur->facture->lire; +$usercancreate = $user->rights->fournisseur->facture->creer; +$usercandelete = $user->rights->fournisseur->facture->supprimer; -$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php -$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +// Advanced permissions +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); +$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send); + +// Permissions for includes +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php /* From b0ec9c1fcf56e7f4df58b1717ad58543638e2ef9 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Tue, 21 Apr 2020 12:45:07 +0200 Subject: [PATCH 007/539] Cleanup user rights on supplier proposal card --- htdocs/supplier_proposal/card.php | 103 ++++++++++++++++-------------- 1 file changed, 56 insertions(+), 47 deletions(-) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5910f77a819..43230d8f9b0 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -96,9 +96,23 @@ if ($id > 0 || !empty($ref)) { dol_print_error('', $object->error); } -$permissionnote = $user->rights->supplier_proposal->creer; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->supplier_proposal->creer; // Used by the include of actions_dellink.inc.php -$permissiontoedit = $user->rights->supplier_proposal->creer; // Used by the include of actions_lineupdown.inc.php +// Common permissions +$usercanread = $user->rights->supplier_proposal->lire; +$usercancreate = $user->rights->supplier_proposal->creer; +$usercandelete = $user->rights->supplier_proposal->supprimer; + +// Advanced permissions +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->supplier_proposal->validate_advance))); +$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance); + +// Additional area permissions +$usercanclose = $user->rights->supplier_proposal->cloturer; +$usercancreateorder = $user->rights->fournisseur->commande->creer; + +// Permissions for includes +$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php +$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php /* @@ -152,7 +166,7 @@ if (empty($reshook)) } // Delete askprice - elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->supplier_proposal->supprimer) + elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) { $result = $object->delete($user); if ($result > 0) { @@ -165,7 +179,7 @@ if (empty($reshook)) } // Remove line - elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->supplier_proposal->creer) + elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) { $result = $object->deleteline($lineid); // reorder lines @@ -189,10 +203,7 @@ if (empty($reshook)) } // Validation - elseif ($action == 'confirm_validate' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->supplier_proposal->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->supplier_proposal->validate_advance))) - ) + elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { $result = $object->valid($user); if ($result >= 0) @@ -223,7 +234,7 @@ if (empty($reshook)) } } - elseif ($action == 'setdate_livraison' && $user->rights->supplier_proposal->creer) + elseif ($action == 'setdate_livraison' && $usercancreate) { $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); if ($result < 0) @@ -231,7 +242,7 @@ if (empty($reshook)) } // Create supplier proposal - elseif ($action == 'add' && $user->rights->supplier_proposal->creer) + elseif ($action == 'add' && $usercancreate) { $object->socid = $socid; $object->fetch_thirdparty(); @@ -460,7 +471,7 @@ if (empty($reshook)) } // Reopen proposal - elseif ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && !GETPOST('cancel', 'alpha')) { + elseif ($action == 'confirm_reopen' && $usercanclose && !GETPOST('cancel', 'alpha')) { // prevent browser refresh from reopening proposal several times if ($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) { $object->reopen($user, SupplierProposal::STATUS_VALIDATED); @@ -468,7 +479,7 @@ if (empty($reshook)) } // Close proposal - elseif ($action == 'close' && $user->rights->supplier_proposal->cloturer && !GETPOST('cancel', 'alpha')) { + elseif ($action == 'close' && $usercanclose && !GETPOST('cancel', 'alpha')) { // prevent browser refresh from reopening proposal several times if ($object->statut == SupplierProposal::STATUS_SIGNED) { $object->setStatut(SupplierProposal::STATUS_CLOSE); @@ -476,7 +487,7 @@ if (empty($reshook)) } // Set accepted/refused - elseif ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && !GETPOST('cancel', 'alpha')) { + elseif ($action == 'setstatut' && $usercanclose && !GETPOST('cancel', 'alpha')) { if (!GETPOST('statut')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), null, 'errors'); $action = 'statut'; @@ -499,12 +510,12 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->supplier_proposal->dir_output; - $permissiontoadd = $user->rights->supplier_proposal->creer; + $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Go back to draft - if ($action == 'modif' && $user->rights->supplier_proposal->creer) + if ($action == 'modif' && $usercancreate) { $object->setDraft($user); @@ -522,7 +533,7 @@ if (empty($reshook)) } } - elseif ($action == "setabsolutediscount" && $user->rights->supplier_proposal->creer) { + elseif ($action == "setabsolutediscount" && $usercancreate) { if ($_POST["remise_id"]) { if ($object->id > 0) { $result = $object->insert_discount($_POST["remise_id"]); @@ -534,7 +545,7 @@ if (empty($reshook)) } // Add a product line - if ($action == 'addline' && $user->rights->supplier_proposal->creer) + if ($action == 'addline' && $usercancreate) { $langs->load('errors'); $error = 0; @@ -845,7 +856,7 @@ if (empty($reshook)) } // Mise a jour d'une ligne dans la demande de prix - elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) { + elseif ($action == 'updateline' && $usercancreate && GETPOST('save') == $langs->trans("Save")) { $vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0); // Define info_bits @@ -1013,46 +1024,46 @@ if (empty($reshook)) } } - elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { + 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(); } // Set project - elseif ($action == 'classin' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'classin' && $usercancreate) { $object->setProject(GETPOST('projectid'), 'int'); } // Delivery delay - elseif ($action == 'setavailability' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setavailability' && $usercancreate) { $result = $object->availability($_POST['availability_id']); } // Terms of payments - elseif ($action == 'setconditions' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setconditions' && $usercancreate) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); } - elseif ($action == 'setremisepercent' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setremisepercent' && $usercancreate) { $result = $object->set_remise_percent($user, $_POST['remise_percent']); } - elseif ($action == 'setremiseabsolue' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setremiseabsolue' && $usercancreate) { $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); } // Payment mode - elseif ($action == 'setmode' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setmode' && $usercancreate) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); } // Multicurrency Code - elseif ($action == 'setmulticurrencycode' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setmulticurrencycode' && $usercancreate) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - elseif ($action == 'setmulticurrencyrate' && $user->rights->supplier_proposal->creer) { + elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } @@ -1480,8 +1491,8 @@ if ($action == 'create') $morehtmlref = '
'; // Ref supplier - //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); - //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1); + //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreateorder, 'string', '', 0, 1); + //$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreateorder, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; @@ -1490,7 +1501,7 @@ if ($action == 'create') { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->supplier_proposal->creer) + if ($usercancreate) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; @@ -1680,7 +1691,7 @@ if ($action == 'create') print ''; - if ($action != 'editbankaccount' && $user->rights->supplier_proposal->creer) + if ($action != 'editbankaccount' && $usercancreate) print ''; print '
'; print $langs->trans('BankAccount'); print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; print ''; @@ -1809,7 +1820,7 @@ if ($action == 'create') $ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, $dateSelector); // Form to add new line - if ($object->statut == SupplierProposal::STATUS_DRAFT && $user->rights->supplier_proposal->creer) + if ($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) { if ($action != 'editline') { @@ -1870,22 +1881,20 @@ if ($action == 'create') if ($action != 'statut' && $action != 'editline') { // Validate - if ($object->statut == SupplierProposal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0 && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->supplier_proposal->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->supplier_proposal->validate_advance))) - ) { + if ($object->statut == SupplierProposal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0 && $usercanvalidate) + { if (count($object->lines) > 0) print ''; // else print ''.$langs->trans('Validate').''; } // Edit - if ($object->statut == SupplierProposal::STATUS_VALIDATED && $user->rights->supplier_proposal->creer) { + if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercancreate) { print ''; } // ReOpen - if (($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) && $user->rights->supplier_proposal->cloturer) { + if (($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) && $usercanclose) { print ''; } @@ -1893,7 +1902,7 @@ if ($action == 'create') // Send if (empty($user->socid)) { 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) { + if ($usercansend) { print ''; } else print ''; @@ -1902,30 +1911,30 @@ if ($action == 'create') // Create an order if (!empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { - if ($user->rights->fournisseur->commande->creer) { + if ($usercancreateorder) { print ''; } } // Set accepted/refused - if ($object->statut == SupplierProposal::STATUS_VALIDATED && $user->rights->supplier_proposal->cloturer) { + if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercanclose) { print ''; } // Close - if ($object->statut == SupplierProposal::STATUS_SIGNED && $user->rights->supplier_proposal->cloturer) { + if ($object->statut == SupplierProposal::STATUS_SIGNED && $usercanclose) { print ''; } // Clone - if ($user->rights->supplier_proposal->creer) { + if ($usercancreate) { print ''; } // Delete - if (($object->statut == SupplierProposal::STATUS_DRAFT && $user->rights->supplier_proposal->creer) || $user->rights->supplier_proposal->supprimer) { + if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) { print ''; } @@ -1945,8 +1954,8 @@ if ($action == 'create') $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->supplier_proposal->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->supplier_proposal->lire; - $delallowed = $user->rights->supplier_proposal->creer; + $genallowed = $usercanread; + $delallowed = $usercancreate; print $formfile->showdocuments('supplier_proposal', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); 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 008/539] 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 009/539] 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 010/539] 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 011/539] 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 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 012/539] 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 c6d2a1faf3944bb315951146550f3758b38a1ec4 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 6 May 2020 00:48:00 +0200 Subject: [PATCH 014/539] Add options Add options in module stock --- htdocs/admin/stock.php | 78 ++++++++++++++++++- htdocs/langs/en_US/stocks.lang | 7 ++ htdocs/langs/fr_FR/stocks.lang | 7 ++ .../product/class/html.formproduct.class.php | 10 ++- 4 files changed, 97 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 43e610c3052..fc5e9f98404 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -28,7 +28,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + // Load translation files required by the page $langs->loadLangs(array("admin", "stocks")); @@ -69,6 +70,16 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) } } +if ($action == 'warehouse') +{ + $value = GETPOST('default_warehouse', 'alpha'); + $res = dolibarr_set_const($db, "MAIN_DEFAULT_WAREHOUSE", $value, 'chaine', 0, '', $conf->entity); + if ($value == -1 || empty($value) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)){ + $res = dolibarr_del_const($db, "MAIN_DEFAULT_WAREHOUSE", $conf->entity); + } + if (!$res > 0) $error++; +} + /* * View */ @@ -83,6 +94,8 @@ $head = stock_admin_prepare_head(); dol_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock'); $form = new Form($db); +$formproduct = new FormProduct($db); + $disabled = ''; @@ -413,6 +426,68 @@ if ($virtualdiffersfromphysical) print '
'; } +print ''; +print ''; +print ''; + +$rowspan = 4; + +print ''; + +print ''; +print "\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + +print ''; +print ''; +print '"; +print ''; +print "\n"; + +print ''; +print ''; +print '\n"; +print "\n"; + +print ''; +print ''; +print '"; +print "\n"; + +print ''; +print ''; +print '\n"; +print "\n"; +print '
".$langs->trans("RuleForWarehouse")."'.$langs->trans("Status").' 
'.$langs->trans("WarehouseAskWarehouseDuringOrder").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER); +} +print "'; +print ''; +print '
'.$langs->trans("UserDefaultWarehouse").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('USER_DEFAULT_WAREHOUSE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("USER_DEFAULT_WAREHOUSE", $arrval, $conf->global->USER_DEFAULT_WAREHOUSE); +} +print "
'.$langs->trans("MainDefaultWarehouse").''; +print $formproduct->selectWarehouses($conf->global->MAIN_DEFAULT_WAREHOUSE, 'default_warehouse', '', 1); +print "
'.$form->textwithpicto($langs->trans("MainDefaultWarehouseUser"), $langs->trans("MainDefaultWarehouseUserDesc")).''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_DEFAULT_WAREHOUSE_USER'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_DEFAULT_WAREHOUSE_USER", $arrval, $conf->global->MAIN_DEFAULT_WAREHOUSE_USER); +} +print "
'; +print '
'; +print ''; print ''; @@ -458,7 +533,6 @@ if ($conf->use_javascript_ajax) { } print "\n"; print "\n"; - print '
'; /* diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 9856649b834..7c29c62b722 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -56,6 +56,13 @@ PMPValueShort=WAP EnhancedValueOfWarehouses=Warehouses value UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock per pairing (product-warehouse) in addition to the value for minimum and desired stock per product +RuleForWarehouse=Rule for warehouses +WarehouseAskWarehouseDuringOrder=Assign order on a warehouse +UserDefaultWarehouse=Assign a default warehouse on user +DefaultWarehouseActive=Default warehouse active +MainDefaultWarehouse=Warehouse default +MainDefaultWarehouseUser=Use user warehouse asign default +MainDefaultWarehouseUserDesc=/!\ By activating this option the gold of the creation of an article, the warehouse assigned to the user will be defined on this one. If no warehouse is defined on the user, the default warehouse is defined. IndependantSubProductStock=Product stock and subproduct stock are independent QtyDispatched=Quantity dispatched QtyDispatchedShort=Qty dispatched diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index b3ea9e04c13..d71c6c46397 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -56,6 +56,13 @@ PMPValueShort=PMP EnhancedValueOfWarehouses=Valorisation des stocks UserWarehouseAutoCreate=Créer automatiquement un stock/entrepôt propre à l'utilisateur lors de sa création AllowAddLimitStockByWarehouse=Gérez également les valeurs des stocks minimums et souhaités par paire (produit-entrepôt) en plus des valeurs de minimums et souhaités par produit +RuleForWarehouse=Régles pour entrepôts +WarehouseAskWarehouseDuringOrder=Affecter un entrepôt sur les commandes +UserDefaultWarehouse=Affecter un entrepôt par default sur les utilisateurs +DefaultWarehouseActive=Activation entrepot par default +MainDefaultWarehouse=Entrepôt par default +MainDefaultWarehouseUser=Utiliser l'entrepôt de l'utilisateur par default +MainDefaultWarehouseUserDesc=/!\ En activant cette option l'or de la création d'un article, l'entrepôt affecté à l'utilisateur sera défini sur celui-ci. Si aucun entrepôt n'est défini sur l'utilisateur, c'est l'entrepôt par défaut qui est défini. IndependantSubProductStock=Le stock du produit et le stock des sous-produits sont indépendant QtyDispatched=Quantité ventilée QtyDispatchedShort=Qté ventilée diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 0eeddd15c07..81ccdc79a4f 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -253,10 +253,14 @@ class FormProduct $comboenhancement = ajax_combobox($htmlname, $events); $out .= $comboenhancement; } - + if (strpos($htmlname, 'search_') !== 0) { - if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; - if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; + if (empty($user->fk_warehouse) || $user->fk_warehouse == -1){ + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE; + } + else{ + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse; + } } $out .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= "
'.$langs->trans("Search").'
'.$langs->trans("Invoice").':
"; + $result .= "
"; + $result .= ""; + + return $result; +} + +/** + * Return a HTML table that contains a pie chart of customer invoices + * + * @param int $socid (Optional) Show only results from the customer with this id + * @return string A HTML table that contains a pie chart of customer invoices + */ +function getPieChart($socid = 0) +{ + global $conf, $db, $langs, $user; + + $sql = "SELECT count(f.rowid), f.fk_statut"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= ", ".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture').")"; + if ($user->socid) $sql .= ' AND f.fk_soc = '.$user->socid; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " GROUP BY f.fk_statut"; + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + return ''; + } + + $num = $db->num_rows($resql); + $i = 0; + + $total = 0; + $vals = []; + + while ($i < $num) + { + $row = $db->fetch_row($resql); + if ($row) + { + $vals[$row[1]] = $row[0]; + $total += $row[0]; + } + + $i++; + } + + $db->free($resql); + + $result = '
'; + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + $objectstatic = new Facture($db); + $array = [Facture::STATUS_DRAFT, Facture::STATUS_VALIDATED, Facture::STATUS_CLOSED, Facture::STATUS_ABANDONED]; + $dataseries = []; + + foreach ($array as $status) + { + $objectstatic->statut = $status; + $objectstatic->paye = $status == Facture::STATUS_CLOSED ? -1 : 0; + + $dataseries[] = [$objectstatic->getLibStatut(1), (isset($vals[$status]) ? (int) $vals[$status] : 0)]; + if (!$conf->use_javascript_ajax) + { + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + } + } + + if ($conf->use_javascript_ajax) + { + $dolgraph = new DolGraph(); + $dolgraph->SetData($dataseries); + $dolgraph->setShowLegend(1); + $dolgraph->setShowPercent(1); + $dolgraph->SetType(['pie']); + $dolgraph->setWidth('100%'); + $dolgraph->draw('idgraphthirdparties'); + + $result .= ''; + $result .= ''; + $result .= ''; + } + + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= '
'.$langs->trans("Statistics").' - '.$langs->trans("CustomerInvoice").'
'.$objectstatic->getLibStatut(0).''.(isset($vals[$status]) ? $vals[$status] : 0).'
'.$dolgraph->show($total ? 0 : 1).'
'.$langs->trans("Total").''.$total.'
'; + $result .= '
'; + return $result; +} + +/** + * Return a HTML table that contains a list with customer invoice drafts + * + * @param int $maxCount (Optional) The maximum count of elements inside the table + * @param int $socid (Optional) Show only results from the customer with this id + * @return string A HTML table that contains a list with customer invoice drafts + */ +function getDraftTable($maxCount = 500, $socid = 0) +{ + global $db, $langs, $user; + + $sql = "SELECT f.rowid, f.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client, f.total as total_ttc"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture').")"; + $sql .= " AND f.fk_statut = ".Facture::STATUS_DRAFT; + if ($socid) $sql .= " AND f.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= $db->plimit($maxCount, 0); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + return ''; + } + + $num = $db->num_rows($resql); + + $result = '
'; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + if ($num < 1) + { + $result .= '
'; + $result .= $langs->trans("CustomersDraftInvoices"); + $result .= ' '; + $result .= ''.$num.''; + $result .= ''; + $result .= '
'; + $result .= '
'; + return $result; + } + + $objectstatic = new Facture($db); + $companystatic = new Societe($db); + $nbofloop = min($num, $maxCount); + $total = 0; + $i = 0; + + while ($i < $nbofloop) + { + $obj = $db->fetch_object($resql); + + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + + $result .= ''; + $result .= ''.$objectstatic->getNomUrl(1).''; + $result .= ''.$companystatic->getNomUrl(1, 'customer', 24).''; + $result .= ''.price($obj->total_ttc).''; + $result .= ''; + + $i++; + $total += $obj->total_ttc; + } + + if ($num > $nbofloop) + { + $result .= ''; + $result .= ''.$langs->trans("XMoreLines", ($num - $nbofloop)).''; + $result .= ''; + } + elseif ($total > 0) + { + $result .= ''; + $result .= ''.$langs->trans("Total").''; + $result .= ''.price($total).''; + $result .= ''; + } + + $result .= ''; + $result .= '
'; + return $result; +} + +/** + * Return a HTML table that contains a list with latest edited customer invoices + * + * @param int $maxCount (Optional) The maximum count of elements inside the table + * @param int $socid (Optional) Show only results from the customer with this id + * @return string A HTML table that contains a list with latest edited customer invoices + */ +function getLatestEditTable($maxCount = 5, $socid = 0) +{ + global $conf, $db, $langs, $user; + + $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; + $sql .= " f.datec"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture').")"; + if ($socid) $sql .= " AND f.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " ORDER BY f.tms DESC"; + $sql .= $db->plimit($maxCount, 0); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + } + + $num = $db->num_rows($resql); + + $result = '
'; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + if ($num < 1) + { + $result .= '
'.$langs->trans("LastCustomersBills", $maxCount).'
'; + $result .= '
'; + return $result; + } + + $formfile = new FormFile($db); + $objectstatic = new Facture($db); + $companystatic = new Societe($db); + $i = 0; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; + $objectstatic->paye = $obj->paye; + $objectstatic->statut = $obj->status; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->entity].'/'.$filename; + + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= '
'.$objectstatic->getNomUrl(1).' '.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).'
'; + $result .= ''; + + $result .= ''.$companystatic->getNomUrl(1, 'customer').''; + $result .= ''.dol_print_date($db->jdate($obj->datec), 'day').''; + $result .= ''.$objectstatic->getLibStatut(5).''; + + $result .= ''; + + $i++; + } + + $result .= ''; + $result .= '
'; + return $result; +} + +/** + * Return a HTML table that contains a list with open (unpaid) customer invoices + * + * @param int $maxCount (Optional) The maximum count of elements inside the table + * @param int $socid (Optional) Show only results from the customer with this id + * @return string A HTML table that conatins a list with open (unpaid) customer invoices + */ +function getOpenTable($maxCount = 500, $socid = 0) +{ + global $conf, $db, $langs, $user; + + $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client"; + $sql .= ", f.rowid as id, f.entity, f.total as total_ttc, f.total as total_ht, f.ref, f.fk_statut"; + $sql .= ", f.datef as df, f.date_lim_reglement as datelimite"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= ", ".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture').")"; + $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + if ($socid) $sql .= " AND s.rowid = ".$socid; + $sql .= " ORDER BY f.rowid DESC"; + $sql .= $db->plimit($maxCount, 0); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + } + + $num = $db->num_rows($resql); + + $result = '
'; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + if ($num < 1) + { + $result .= '
'; + $result .= $langs->trans("BillsCustomersUnpaid"); + $result .= ' '; + $result .= ''.$num.''; + $result .= ''; + $result .= '
'; + $result .= '
'; + return $result; + } + + $objectstatic = new Facture($db); + $companystatic = new Societe($db); + $formfile = new FormFile($db); + $nbofloop = min($num, $maxCount); + $now = dol_now(); + $total = 0; + $i = 0; + + while ($i < $nbofloop) + { + $obj = $db->fetch_object($resql); + + $objectstatic->id= $obj->id; + $objectstatic->ref = $obj->ref; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); + + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + + $result .= ''; + + $result .= ''; + + $result .= ''; + $result .= '
'.$objectstatic->getNomUrl(1).''; + + if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) + { + $result .= img_warning($langs->trans("Late")); + } + + $result .= ''.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).'
'; + $result .= ''; + + $result .= ''.$companystatic->getNomUrl(1, 'customer', 44).''; + $result .= ''.dol_print_date($db->jdate($obj->df), 'day').''; + $result .= ''.price($obj->total_ttc).''; + + $result .= ''; + + $i++; + $total += $obj->total_ttc; + } + + if ($num > $nbofloop) + { + $result .= ''; + $result .= ''.$langs->trans("XMoreLines", ($num - $nbofloop)).''; + $result .= ''; + } + elseif ($total > 0) + { + $result .= ''; + $result .= ''.$langs->trans("Total").''; + $result .= ''.price($total).''; + $result .= ' '; + $result .= ''; + } + + $result .= ''; + $result .= ''; + return $result; +} From 9b437c05855ad75a07b2e388e380adb882634660 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 11:36:30 +0200 Subject: [PATCH 019/539] Link to new customer invoice area --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8566575e5ca..79c7d7329da 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1010,7 +1010,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->facture->enabled)) { $langs->load("bills"); - $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills'); + $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->rights->facture->lire, '', $mainmenu, 'customers_bills'); $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->rights->facture->creer); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills", $langs->trans("List"), 1, $user->rights->facture->lire, '', $mainmenu, 'customers_bills_list'); From 5fb852b588e0876fce00906012ba743aba3a4ac1 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 11:37:39 +0200 Subject: [PATCH 020/539] Add one new lang entry --- htdocs/langs/en_US/bills.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 55de1591689..d85c7b0299a 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -571,3 +571,4 @@ AutoFillDateToShort=Set end date MaxNumberOfGenerationReached=Max number of gen. reached BILL_DELETEInDolibarr=Invoice deleted BILL_SUPPLIER_DELETEInDolibarr=Supplier invoice deleted +CustomersInvoicesArea=Customer billing area From 468829aa7000d00b0e9ab6e15357048b909018c9 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 11:48:01 +0200 Subject: [PATCH 021/539] Add new vendor invoice area page --- htdocs/fourn/facture/index.php | 535 +++++++++++++++++++++++++++++++++ 1 file changed, 535 insertions(+) create mode 100644 htdocs/fourn/facture/index.php diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php new file mode 100644 index 00000000000..b237ce19012 --- /dev/null +++ b/htdocs/fourn/facture/index.php @@ -0,0 +1,535 @@ + + * + * 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/forun/facture/index.php +* \ingroup facture + * \brief Home page of customer invoices area + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + +// Security check +restrictedArea($user, 'fournisseur', 0, '', 'facture'); + +// Load translation files required by the page +$langs->loadLangs(['bills', 'boxes']); + +// Filter to show only result of one supplier +$socid = GETPOST('socid', 'int'); +if (isset($user->socid) && $user->socid > 0) +{ + $action = ''; + $socid = $user->socid; +} + +// Maximum elements of the tables +$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; +$maxLatestEditCount = 5; +$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; + +/* +* View +*/ + +llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); + +print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'invoicing'); + +print '
'; + +print '
'; + +// This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) +{ + print getAreaSearchFrom(); + print '
'; +} + +print getPieChart($socid); +print '
'; +print getDraftTable($maxDraftCount, $socid); + +print '
'; + +print '
'; +print '
'; + +print getLatestEditTable($maxLatestEditCount, $socid); +print '
'; +print getOpenTable($maxOpenCount, $socid); + +print '
'; +print '
'; + +print '
'; + +// End of page +llxFooter(); +$db->close(); + +/** + * Return a HTML string that contains a additional search form + * + * @return string A HTML string that contains a additional search form + */ +function getAreaSearchFrom() +{ + global $langs; + + $result = '
'; + $result .= '
'; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= "
'.$langs->trans("Search").'
'.$langs->trans("Invoice").':
"; + $result .= "
"; + $result .= "
"; + + return $result; +} + +/** + * Return a HTML table that contains a pie chart of supplier invoices + * + * @param int $socid (Optional) Show only results from the supplier with this id + * @return string A HTML table that contains a pie chart of supplier invoices + */ +function getPieChart($socid = 0) +{ + global $conf, $db, $langs, $user; + + $sql = "SELECT count(f.rowid), f.fk_statut"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; + if ($user->socid) $sql .= ' AND f.fk_soc = '.$user->socid; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " GROUP BY f.fk_statut"; + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + return ''; + } + + $num = $db->num_rows($resql); + $i = 0; + + $total = 0; + $vals = []; + + while ($i < $num) + { + $row = $db->fetch_row($resql); + if ($row) + { + $vals[$row[1]] = $row[0]; + $total += $row[0]; + } + + $i++; + } + + $db->free($resql); + + $result = '
'; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $objectstatic = new FactureFournisseur($db); + $array = [FactureFournisseur::STATUS_DRAFT, FactureFournisseur::STATUS_VALIDATED, FactureFournisseur::STATUS_CLOSED, FactureFournisseur::STATUS_ABANDONED]; + $dataseries = []; + + foreach ($array as $status) + { + $objectstatic->statut = $status; + $objectstatic->paye = $status == FactureFournisseur::STATUS_CLOSED ? -1 : 0; + + $dataseries[] = [$objectstatic->getLibStatut(1), (isset($vals[$status]) ? (int) $vals[$status] : 0)]; + if (!$conf->use_javascript_ajax) + { + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + } + } + + if ($conf->use_javascript_ajax) + { + $dolgraph = new DolGraph(); + $dolgraph->SetData($dataseries); + $dolgraph->setShowLegend(1); + $dolgraph->setShowPercent(1); + $dolgraph->SetType(['pie']); + $dolgraph->setWidth('100%'); + $dolgraph->draw('idgraphthirdparties'); + + $result .= ''; + $result .= ''; + $result .= ''; + } + + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= '
'.$langs->trans("Statistics").' - '.$langs->trans("SupplierInvoice").'
'.$objectstatic->getLibStatut(0).''.(isset($vals[$status]) ? $vals[$status] : 0).'
'.$dolgraph->show($total ? 0 : 1).'
'.$langs->trans("Total").''.$total.'
'; + $result .= '
'; + + return $result; +} + +/** + * Return a HTML table that contains a list with supplier invoice drafts + * + * @param int $maxCount (Optional) The maximum count of elements inside the table + * @param int $socid (Optional) Show only results from the supplier with this id + * @return string A HTML table that contains a list with supplier invoice drafts + */ +function getDraftTable($maxCount = 500, $socid = 0) +{ + global $db, $langs, $user; + + $sql = "SELECT f.rowid, f.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client, f.total_ttc"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; + $sql .= " AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT; + if ($socid) $sql .= " AND f.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= $db->plimit($maxCount, 0); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + return ''; + } + + $num = $db->num_rows($resql); + + $result = '
'; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + if ($num < 1) + { + $result .= '
'; + $result .= $langs->trans("SuppliersDraftInvoices"); + $result .= ' '; + $result .= ''.$num.''; + $result .= ''; + $result .= '
'; + $result .= '
'; + return $result; + } + + $objectstatic = new FactureFournisseur($db); + $companystatic = new Societe($db); + $nbofloop = min($num, $maxCount); + $total = 0; + $i = 0; + + while ($i < $nbofloop) + { + $obj = $db->fetch_object($resql); + + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + + $result .= ''; + $result .= ''.$objectstatic->getNomUrl(1).''; + $result .= ''.$companystatic->getNomUrl(1, 'supplier', 24).''; + $result .= ''.price($obj->total_ttc).''; + $result .= ''; + + $i++; + $total += $obj->total_ttc; + } + + if ($num > $nbofloop) + { + $result .= ''; + $result .= ''.$langs->trans("XMoreLines", ($num - $nbofloop)).''; + $result .= ''; + } + elseif ($total > 0) + { + $result .= ''; + $result .= ''.$langs->trans("Total").''; + $result .= ''.price($total).''; + $result .= ''; + } + + $result .= ''; + $result .= ''; + return $result; +} + +/** + * Return a HTML table that contains a list with latest edited supplier invoices + * + * @param int $maxCount (Optional) The maximum count of elements inside the table + * @param int $socid (Optional) Show only results from the supplier with this id + * @return string A HTML table that contains a list with latest edited supplier invoices + */ +function getLatestEditTable($maxCount = 5, $socid = 0) +{ + global $conf, $db, $langs, $user; + + $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; + $sql .= " f.datec"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; + if ($socid) $sql .= " AND f.fk_soc = ".$socid; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " ORDER BY f.tms DESC"; + $sql .= $db->plimit($maxCount, 0); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + return ''; + } + + $num = $db->num_rows($resql); + + $result = '
'; + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + if ($num < 1) + { + $result .= '
'.$langs->trans("BoxTitleLastSupplierBills", $maxCount).'
'; + $result .= '
'; + return $result; + } + + $objectstatic = new FactureFournisseur($db); + $companystatic = new Societe($db); + $formfile = new FormFile($db); + $i = 0; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + $objectstatic->id = $obj->rowid; + $objectstatic->ref = $obj->ref; + $objectstatic->paye = $obj->paye; + $objectstatic->statut = $obj->status; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->entity].'/'.$filename; + + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= '
'.$objectstatic->getNomUrl(1).' '.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).'
'; + $result .= ''; + + $result .= ''.$companystatic->getNomUrl(1, 'supplier').''; + $result .= ''.dol_print_date($db->jdate($obj->datec), 'day').''; + $result .= ''.$objectstatic->getLibStatut(5).''; + + $result .= ''; + + $i++; + } + + $result .= ''; + $result .= ''; + return $result; +} + +/** + * Return a HTML table that contains a list with open (unpaid) supplier invoices + * + * @param int $maxCount (Optional) The maximum count of elements inside the table + * @param int $socid (Optional) Show only results from the supplier with this id + * @return string A HTML table that conatins a list with open (unpaid) supplier invoices + */ +function getOpenTable($maxCount = 500, $socid = 0) +{ + global $conf, $db, $langs, $user; + + $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client"; + $sql .= ", f.rowid as id, f.entity, f.total_ttc, f.total_ht, f.ref, f.fk_statut"; + $sql .= ", f.datef as df, f.date_lim_reglement as datelimite"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE f.fk_soc = s.rowid"; + $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; + $sql .= " AND f.fk_statut = ".FactureFournisseur::STATUS_VALIDATED; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + if ($socid) $sql .= " AND s.rowid = ".$socid; + $sql .= " ORDER BY f.rowid DESC"; + $sql .= $db->plimit($maxCount, 0); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + return ''; + } + + $num = $db->num_rows($resql); + + $result = '
'; + $result .= ''; + $result .= ''; + $result .= ''; + $result .= ''; + + if ($num < 1) + { + $result .= '
'; + $result .= $langs->trans("BillsCustomersUnpaid"); + $result .= ' '; + $result .= ''.$num.''; + $result .= ''; + $result .= '
'; + $result .= '
'; + return $result; + } + + $objectstatic = new FactureFournisseur($db); + $companystatic = new Societe($db); + $formfile = new FormFile($db); + $nbofloop = min($num, $maxCount); + $now = dol_now(); + $total = 0; + $i = 0; + + while ($i < $nbofloop) + { + $obj = $db->fetch_object($resql); + + $objectstatic->id = $obj->id; + $objectstatic->ref = $obj->ref; + + $companystatic->id = $obj->socid; + $companystatic->name = $obj->socname; + $companystatic->client = $obj->client; + $companystatic->canvas = $obj->canvas; + + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->propal->multidir_output[$obj->entity].'/'.$filename; + + $result .= ''; + + $result .= ''; + $result .= ''; + $result .= ''; + + $result .= ''; + $result .= ''; + + $result .= ''; + + $result .= ''; + $result .= '
'.$objectstatic->getNomUrl(1).''; + + if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) + { + $result .= img_warning($langs->trans("Late")); + } + + $result .= ''.$formfile->getDocumentsLink($objectstatic->element, $filename, $filedir).'
'; + $result .= ''; + + $result .= ''.$companystatic->getNomUrl(1, 'customer', 44).''; + $result .= ''.dol_print_date($db->jdate($obj->df), 'day').''; + $result .= ''.price($obj->total_ttc).''; + + $result .= ''; + + $i++; + $total += $obj->total_ttc; + } + + if ($num > $nbofloop) + { + $result .= ''; + $result .= ''.$langs->trans("XMoreLines", ($num - $nbofloop)).''; + $result .= ''; + } + elseif ($total > 0) + { + $result .= ''; + $result .= ''.$langs->trans("Total").''; + $result .= ''.price($total).''; + $result .= ' '; + $result .= ''; + } + + $result .= ''; + $result .= ''; + return $result; +} From 8334afa154c017b23febdc0834bbe48d1eae20f7 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 11:49:45 +0200 Subject: [PATCH 022/539] Add link to new vendor invoice are page --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8566575e5ca..396ee235eba 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1038,7 +1038,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->societe->enabled) && !empty($conf->supplier_invoice->enabled)) { $langs->load("bills"); - $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); + $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills'); $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create'); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list'); From 0da091c6093fe95a34b1140c563ccdd205271ef1 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 11:51:50 +0200 Subject: [PATCH 023/539] Add missing lang entry --- htdocs/langs/en_US/bills.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 55de1591689..70b54336047 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -571,3 +571,4 @@ AutoFillDateToShort=Set end date MaxNumberOfGenerationReached=Max number of gen. reached BILL_DELETEInDolibarr=Invoice deleted BILL_SUPPLIER_DELETEInDolibarr=Supplier invoice deleted +SupplierInvoicesArea=Supplier billing area From 3f5f6b3243694982820e0a951ecacf1a654c5aca Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 12:09:39 +0200 Subject: [PATCH 024/539] Fix lint errors --- htdocs/fourn/facture/index.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index b237ce19012..df32ee1b19a 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -148,7 +148,7 @@ function getPieChart($socid = 0) $total = 0; $vals = []; - + while ($i < $num) { $row = $db->fetch_row($resql); @@ -157,10 +157,10 @@ function getPieChart($socid = 0) $vals[$row[1]] = $row[0]; $total += $row[0]; } - + $i++; } - + $db->free($resql); $result = '
'; @@ -169,7 +169,7 @@ function getPieChart($socid = 0) $result .= ''; $result .= ''.$langs->trans("Statistics").' - '.$langs->trans("SupplierInvoice").''; $result .= ''; - + $objectstatic = new FactureFournisseur($db); $array = [FactureFournisseur::STATUS_DRAFT, FactureFournisseur::STATUS_VALIDATED, FactureFournisseur::STATUS_CLOSED, FactureFournisseur::STATUS_ABANDONED]; $dataseries = []; @@ -217,7 +217,7 @@ function getPieChart($socid = 0) /** * Return a HTML table that contains a list with supplier invoice drafts - * + * * @param int $maxCount (Optional) The maximum count of elements inside the table * @param int $socid (Optional) Show only results from the supplier with this id * @return string A HTML table that contains a list with supplier invoice drafts @@ -243,9 +243,9 @@ function getDraftTable($maxCount = 500, $socid = 0) dol_print_error($db); return ''; } - + $num = $db->num_rows($resql); - + $result = '
'; $result .= ''; @@ -277,12 +277,12 @@ function getDraftTable($maxCount = 500, $socid = 0) $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; - + $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; $companystatic->client = $obj->client; $companystatic->canvas = $obj->canvas; - + $result .= ''; $result .= ''; $result .= ''; @@ -313,11 +313,11 @@ function getDraftTable($maxCount = 500, $socid = 0) } /** - * Return a HTML table that contains a list with latest edited supplier invoices + * Return a HTML table that contains a list with latest edited supplier invoices * * @param int $maxCount (Optional) The maximum count of elements inside the table * @param int $socid (Optional) Show only results from the supplier with this id - * @return string A HTML table that contains a list with latest edited supplier invoices + * @return string A HTML table that contains a list with latest edited supplier invoices */ function getLatestEditTable($maxCount = 5, $socid = 0) { @@ -431,7 +431,7 @@ function getOpenTable($maxCount = 500, $socid = 0) if ($socid) $sql .= " AND s.rowid = ".$socid; $sql .= " ORDER BY f.rowid DESC"; $sql .= $db->plimit($maxCount, 0); - + $resql = $db->query($sql); if (!$resql) { From 3de77cff3fede4b928c9048662c0ee68aafef57b Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 6 May 2020 12:11:54 +0200 Subject: [PATCH 025/539] fix lint errors --- htdocs/compta/facture/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php index af64935fc2d..5c0aacfdb35 100644 --- a/htdocs/compta/facture/index.php +++ b/htdocs/compta/facture/index.php @@ -157,12 +157,12 @@ function getPieChart($socid = 0) $vals[$row[1]] = $row[0]; $total += $row[0]; } - + $i++; } $db->free($resql); - + $result = '
'; $result .= '
'.$objectstatic->getNomUrl(1).''.$companystatic->getNomUrl(1, 'supplier', 24).'
'; $result .= ''; @@ -215,7 +215,7 @@ function getPieChart($socid = 0) /** * Return a HTML table that contains a list with customer invoice drafts - * + * * @param int $maxCount (Optional) The maximum count of elements inside the table * @param int $socid (Optional) Show only results from the customer with this id * @return string A HTML table that contains a list with customer invoice drafts @@ -311,11 +311,11 @@ function getDraftTable($maxCount = 500, $socid = 0) } /** - * Return a HTML table that contains a list with latest edited customer invoices + * Return a HTML table that contains a list with latest edited customer invoices * * @param int $maxCount (Optional) The maximum count of elements inside the table * @param int $socid (Optional) Show only results from the customer with this id - * @return string A HTML table that contains a list with latest edited customer invoices + * @return string A HTML table that contains a list with latest edited customer invoices */ function getLatestEditTable($maxCount = 5, $socid = 0) { @@ -429,7 +429,7 @@ function getOpenTable($maxCount = 500, $socid = 0) if ($socid) $sql .= " AND s.rowid = ".$socid; $sql .= " ORDER BY f.rowid DESC"; $sql .= $db->plimit($maxCount, 0); - + $resql = $db->query($sql); if (!$resql) { 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 026/539] 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 027/539] 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 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 028/539] 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 a87d9cd740f2399f5d24e13e0f7791eadde19976 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Fri, 8 May 2020 22:41:49 +0200 Subject: [PATCH 029/539] 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 ''; } + + // Multiprice + if ($conf->global->PRODUIT_MULTIPRICES){ + foreach ($arraypricelevel as $key => $value) + { + if (!empty($arrayfields['p.sellprice'.$key]['checked'])) + { + 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 ''; + $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 030/539] 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 ''; $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 031/539] 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 c6e7b2e6a3281f14bd4b325b5cf4835e4108c487 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 13:39:02 +0200 Subject: [PATCH 032/539] 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 033/539] 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 ''; - // 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 36b63ed921b555b297da38c2467b1e32037c9c1f Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Thu, 14 May 2020 11:37:26 +0200 Subject: [PATCH 042/539] 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 043/539] 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 1453b8469ea6dad679dc652bc0fa4a175f081cae Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 15 May 2020 15:56:16 +0200 Subject: [PATCH 044/539] 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 045/539] 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 046/539] 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 047/539] 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 048/539] 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 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 049/539] 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 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 050/539] 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 051/539] 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 052/539] 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 ''; print ''; + print ''; } if (!in_array('declaredprogress', $hiddenfields)) { From 0847f5350a62f44ca098668611a6ab7d4a39eb2a Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Fri, 15 May 2020 23:44:19 +0200 Subject: [PATCH 053/539] 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 .= '
'; print ''; + 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 ''; - 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 '
".$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 034/539] 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 035/539] 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 036/539] 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 037/539] 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 39f228b98a92140d58d82c3be1220742728e4958 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 14:10:43 +0200 Subject: [PATCH 038/539] 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 ce9b841d9f1e026f0aaa0d94890bd40c5283d4b1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 12 May 2020 15:33:25 +0200 Subject: [PATCH 039/539] 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 040/539] 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 041/539] 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 ''; + 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 $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 .= 'id.')">'; - $htmlforlines .= ''; - $htmlforlines .= $row->label; - $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; - $htmlforlines .= ''."\n"; + $htmlforlines .= '
'; + $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency); + $htmlforlines .= '
'."\n"; } $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 054/539] 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"; @@ -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 106/539] 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 107/539] 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 108/539] 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 111/539] 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 112/539] 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 113/539] 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 219/539] 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 223/539] 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 224/539] 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 225/539] 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 226/539] 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 2595f571c74ef424add3c3ca687b769f90df3cb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 00:21:09 +0200 Subject: [PATCH 227/539] Fix exclude credit note when searching situation invoice to use for next --- htdocs/core/class/html.form.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index acbd15712e5..ec7bfeab7c4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3582,10 +3582,11 @@ class Form $opt = ''; $sql = 'SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc'; - $sql.= ' FROM ' . MAIN_DB_PREFIX . 'facture'; - $sql.= ' WHERE entity IN ('.getEntity('invoice').')'; - $sql.= ' AND situation_counter>=1'; - $sql.= ' ORDER by situation_cycle_ref, situation_counter desc'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture'; + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; + $sql .= ' AND situation_counter>=1'; + $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 From 61545703d14c119acdfb6446a8908ae3b16e4aad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 10:58:18 +0200 Subject: [PATCH 228/539] 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 229/539] 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 230/539] 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 231/539] 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 232/539] 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 233/539] 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 234/539] 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-O>lLR*uMBVraFPwj=_4$XUh>HO+%S(pq=KTGh8r4oMdz>We5 zbKHXoJ>aEAiORyU`Yz1S{cc`JI7t>lbGSl@qP-BiLF)gKKs5=5u6O^(Sl1$l(_qmH zIr^;b`%U^CYWkghl3!rgm(OrVy$aGJEhOZo>|RaFx1)XE4#}MEd?)j#{^CXvIXDPk z(+XSo;C;LO8N39AWc{Z{e(vN2GjxWK#T~T^v^K^v-EWg<>%_-O4^?2bY@g`*ht}tu zL&wvi+?<-B^E(GJ{;otfqWs0KrH!toznbP;4Q*{d$qw5`E348$A;G1M6KUTRl?IxE ziyPl?dJHyBTUjygs@-k^Ak0e$h$+K^QXK`6-wryZ+D>HPH!8V@&(CjY$iJk0Hz{BCIiNt}Xy+E;_`{GQUj2**lG$#$eWYX`{s>aQN{ zMXV0^J+v7vdG_LTpOlY(a|2_a)Dk;$?^@%_YEPbIt1TUY4J zj&?Lr)YFzs)F^WUV}s7J&PbzkACGoxgCio9Ew0?v)-!R6F}SpOS|wpXI^*}$xSO2w zHbOpAbf40~Lw5Svs4a@Qbo289-g{4?0=bQ`dsgxT*~5vr z&oayq!~Hy`zMC)0r(fB98H#+x?W4HTnXGWt%yR1MQbv=wm<#2{l52FQjITJS?qo1R z#le9#hIt^co2iyoX!-?R*=%gY+S}e6gFip@9Hkc27Eq=1{ISsxU+aBZ_e7Mz{=4ec z0O3D=kHy1v3G4LOi(PJVC7$+YlFPYgtX!EU9a>=3-~4DTvSj@&Vo70d_?2Y^St3|V zmp+COE%BWq(C4y_7Q5}?Ql`4FxsB%O!%JhAD1?Xa<2$Cl^@b&RBB3%bhNlK3fAJLD zZ5=z;dtEtIHMtVgE|C705G9-@YF4mS_R*(z{7QzD)XHONx`M%E9DB}3*)Y5W`Yuf9 z6JxxVGI2~gT-Wy0^H}6K1!GbOdaHslofYJ+qZA_^CJQ36a6iXMfLnfcZVqF$U8xPsLCc&gNa6RaYrmQ-RAv{F!qrd=dZia$+L|4Y(?yEgwKIq`|vmf=Zl6Y zF8@O`;&lxI@A0o~+I-Nb8zPy_j(W}zIq|(v=KS1~CoYC2uSk4vR4}jk5y88yRCN+? zY|!-N{t5jC&!wzb%_2bwrDYDaQb%6s^WD^VntdnV=qU|kx=Hj4&Pm0CsNLG*0j~BY zita7&BpeL#R0%!h!J3_dBi>?$7C*$rndiwN{~;x8a5q-kH))gLjlgkI?pX|M=>m6> zMqO43n07qRT($Zgd{zYaCUD|J{i9FYqYAFKXEUp3cB2Hg5MAWCf}pU8qdC%=dM~=! zU$m~+iA%Ral{`?-7)0l?RUk+DTk>bN(DUrm#L+EwpyT?UyNM#>=R#XM^Scvi9#(Jq z8X2%PPgvR}uhRhxPIk0Y1si%pp;0}3N(tUH*HYKs%DOkuAXJ7fqI&s0-e8m(8L@39 z8ouAWQZqa>6&yY74821pls}o7?yM%xZ#bK}%CjmI^(4It+3r$y_E0F0{jm79dl{CO zla)rH*}F@)55L^(#Co{hTg6*@@(xU>>-N}6^9_>I54j-ZehK^UABCR3mvvM6s7;ZH z(lOBcD^eUaJk0t=C_h8FYfsPCInIlhY3xrTY#T!aOcWIRc04#Dm?6IWPrkkMdi=V| z_!v*UxQPV4LuYAR=q?L)t{3$bT$Hiv$2cMFvdwc6UlriUPAAy{au#hMde96(jp8bA zY2xls&@adp(@R-^F1}l1D;}R+*%|>jrEg$j<$MBm@-Rv|FNO&hy*P-ks7!zj6|;Wtif$WygH1+f<$7{3KYlCe` zFriEFT8xJ2*7#qxVz`JXu|L;ZwpW)Q<;5%*xs@-?mLR;PcrS6;WDIoGGe)U16-%@; z73&;qpNe=k{8edY)W*hXe(G}aT|!h3JAnZ&yD;ygV`@eVsD!*jZQJH0F|SrfpK-94 zQmHm98g6mzQ_GIMt@H-bS&eu!h>f@4q7`_x+JV?QV8X>jiS5H%?RvABKYn=okiiu_ zNK%4ht){o=)_+I%AlLL#%EIjYyHbRVh)1fSQk`V z1=KbBcZXa{h(X94jL_jLy1&+)X=x>(5@AC^7c}T(t|jAt_B5%#T|1=Uz&M4#-B2Ru z?p^Tj8$lR_vRaj9+v;0L;**sRe%)?LBL{H>4z{;a`6#V$sfmb}r^;a8mrc1Ug2_zG zx%S89Z{f=)LyNfI8DWG5vqi#nzw$!KDZp(hhjm=Z2^w>}HSb5b5^?MbaO{lxT8FD` zd-zKbUjjDBYn1p(S%}}QTSH7H+<7skw0c}5JfZ539`gycGv3Tl&+yJG)@Qaattrgb z+^PKdan4v~EPU~=M!Elm>#tZHiX17-!(~rIMU+%6|HX8Ew_mvsG!*ch5U2=RNDNi)KLh~^;fAB`xLu-> ztbV5Oky`OFYm~a#u{rJ1p*WDL0{K9lj=dqrd7cy!-w9Vpzp^z!9;~I)O|IiK>t3WCxb+yK-AXf;dww174>Gme{(4%Y%jD~sH&UTnl~xpxLAsLno&6)Pz`G11F_ zohT>h-IO~XJqf3Q3bJ8B$%*$*i@Dd6)|#>od9q4GMM-PjqjNM=n*UL3kOYQl6cbAM z;MjOWLnC%IO@;8tOI={j1V+e_DwCf}TkX{H2THiin@JMcuMb#G!M395^Kav}Hek5K z5HCquUgiO02t-`v9wC)ScwwaFKSI2WNw^b$_~PFO&Iu`q835lk1d}%4 z6+lkD1?fnk8Gh{ddBHjjxbl5~?9ceyr66O{9Atdlp^N%C5mY7!4c%iQuS+uFT2{Oe zhYN-NWC9yPG(5rEr09~=znv@(rp4YCDw&*A)3k2wFW6C%n z`R!BI7Jv%No+sJKD*)9W=<3#!0v}1I5 zO;b1ita)wqDtYK&Dpo|n4v363->e081Ug*o9+`Y>J5c$dbj0(^%_9-ViAlyg{p~Hp zdsN23it9wb-^`P3WXDWiL^KUNW-KtCJPKkxC9St|Hfj<^viNg&&Z6jrTw$JyGqYd2 zALH{P^%G~`1FZAv)Ds9v#1-?yu@GdUcTSfX5g&J78+rShx_G((AggqeUHiKW>TAl(XF~vpb|5^!l+wrCP+c*Fl62e8ss}+Rmh*b!#5oiGt!_tCkY41QsN0*| zxzmkX-x6^rlz_mIHwH7Edqif8E6F6Cz1;E+)#r zX4XCtp7r&vID&M>Fhd4w{RevFA3jn#gY0oIp{K(|e!VidNb{Pnf3cJi*yKObM?(DFBG~Wd zT(qVaq6Lbg+f6B4#!iqvKj5g5!8d8#KCb|s^MUE7XKo$N3Gy8=67<(Qgxo?q%;-(k zH+ZhpjEjdS&x13ur#eB9smNYl<-o%ce|S;j zRW&V$Fuu9erjdod!v}K9V;GtO%yRDG>3#cd05g{z1Pu+P$kt@pWhv>d4v{(1<~Di| zF9nd|-051jIqP7_3$^X*gkmjiQd4fA2o5=eUqyVmFPLs;Mo?nyYJj6{{`b#lG+bInnJFLhH>75%e!rv$N6 zf+#(YlRsAd8roEelf0Kwgz;QEH#``^9$zJK5Q zcK1wwGd-ufs>@DwcXgfDU$5%`6j@0bNdOQC1jvIvfY&8}7yuj$?5%(<2vC89frNyB zfP{mFhJrzWLqLFsgNH{%LPJ4BLPdgyN5MitMaRIz#6&>G#=*kCLBqhrctZjN2f;u< z!a_pAVj#jJV*GDkuRQ=%7(h0dC^!%m0EP+#M+Lt20tf&=0QjE*_|F9e4Fd@V4)NBC z|HcRS+t)uA1Q<9Z5DNNr5r6=K1498v0RVurB>%Mk-&SDM`8y^2b_)ZBW2>rM%G>`UZFR zvzcA5Gq!4qV*r%b_fNJJ0A#kJsM-_l#X8&CE8FKk7>zUY`S~xfzdC(zP!YctlubPN z+I9A+%HZktfWsNjAxn~(>oalQ z^*Lt`?fn6VPf@dxL%r=EG=`pE%&)gakT3>fh6 zwEyB30g1_rM_VcwG;TiLH~>4kqOZ{N_)r?b!&ZQTzZNmQf4>jvj8P@G^N4qFu+fr->`{dp-a#^(;25(hdNCHEX*G zqJ0I_O}veY^Ra3?YA<+FMJ*?{tZzqT>b`?>s8Y~%`uciCU8RW1DHq)1qD7xr0Mr+B z5l2BEtw9M|`+(~IVFQ4@?X*Am3H-d0>(K9Xe)H0!$R;B1^F9>z(eJ$bO?Hg;`xd34 z);$b$z-#xDgghH{$@G-zV8pPI7WCGS-U#Ifx1O0_0AMtAFo7#xuK9BGsPjnwk~jvHA-x~b(;<)vAU?5r;9wR%#1Q&LV1T( zey^yM!4ZO_=}^d4EwF*9Mr}u%$EPbpuTEZ}OmYzk#lX<=GpFX4A^$LhTQ2gPznPQ} z({OH4Sr}k29IN#%vLG0(84-Y`gJbvI)mK$1$SzyFf?0JlQA}5{Nk)8!=vwY1{@pO9 z#csf{*Yd^FRlXhoWz`|e*xa?E7a8S&;M1QWO`_Z2+vqL;E7(?(q=6&3VgR6T$9Fzs z-T1ej>)NOH9;wji*_M|h1OAo^E~57Mf$(G7t>tA^+|k6(-+0%C-)!apU}v!rY>>vi zeV$sRttKTz0P&XM4 z0N_2QI49)U{#!5Ow{ls>$Ua+3vLx)*9OiTd0G;2bbNow|ynCarg8+bg zT2jnpv|)y4s|NR>C}7%do?<>x`am4;li=Yr!~%dY|21CU(YK|Ukmv>%n8BFnS8Kq@ z#ds(>bQsDWRW;%Kk#{0$jdfm9NSSegdd5!k|4#}9!ySZ;a8L_*DeHnstw&)~1JBZB zV~au6t@*iZb#N12*&N7%BboYF3UOvj1z?M5o?Dcd-=BGI7JQlt*W9GUmo&NnW3EFI z^W6AlF;i!T(Kvf0h#sxV_-Qed!x=d1X$@hDo{RHo7X9tgBzz5FqMnOeY5!~4nBqBT z%93y;5$DYf&^lD$TIJy2*Tqcr>q~RvZZhIF9(p-vMt$whh;;pN_D!TuF(9=3*1Gw0 zAxLb(wGqEy+pKjv_bA=9dc@g*m*hXzvhgfUxj@F4?-Q1&K;zpiA%e=Xn5bhP=QvUg; zKjP=H?^9VWjx9P!Lq2N+wu$sdB6t%(tBF>v-!?d(t0p4$d^+=rK*sLzUGLWVM`xgJ zQOwj|4>H=b`$?vfFyL>Y;dx|zFx;00fJ=#~Ula1YEY!8v`pyn8ee7^-KS$()bk&Rh zUp`akkGlxRzuS?aXZLD7-GAI1Jwdd7@UV)T9BQX7O=b5ru~@PiYw`c?w(17|!0Ys$ z!@SjW!ex~2&a}my5cQ9vvS*slT-d$>{Kv40ny+_>{C$8Nvvp<;mACENJCVdkzwbNl z0N|~Wy52F9kNmg)E9n4}zM#%XC|944%-OWf{ zO8cx!-~;k^Lju$tN?!p^{I?%3Pty;7F?W8j0sa;Uk9+BuJNP<8@cKx%bqEdtir&p=(~nr*7~syiW4}Uy^`B8Y)?=cl&bA&d6(o+{8%(}4BDl+YE~BP~^u1s=JKD2_d^coXYh$ z-!IeJW>?=!j~!%_Sx>y?1$T=1gl@)1FPm4;0wSkKf=45Gchsh&QFE!m&aw9cn#$J! z1x%Bl`i_ySxYnooTY|a_Y#P2a^O;?{dY}p5|LF1ttv^^%06;J(AQ%KB81!Fj5J(6p z&@FIi6b=$jR4i6DG;|DXW>R)c3Q86(VLN5evIGXSS^+|Wy#n$uTyl`APGOqlomq1} z+DUXZ8f?yo<5r^zEu-3Try6~SOH96o7%oIL3isnIJua!wd20yRXYsr=v4N9hkBBWE zWUObwsnrO}dj<5c>P)_e)Pt8>malx^T|_ELeg(*;nyS45c2uBuXoc&G3vK2PJv7jS znidvwOQ0HLp>w15h(czjH(l1`Ox1mSsSxqOQsm)R(7tqYGithrPLv&B@Etv*Cbu`w z#D>xfw~hwn{iozA8eR1zHMgRKQAgLY@Ia{W412LY4G>7sr~PJe1C@T0*_d>bwCk@Y zz)n?Tm6)T_rO$_F1G8&UWu4%iDzAX>SoL{@(CQ{h0b-FcstMh<@2tvnU!jxU* zQ*42mRz@_`3@yZ`HlM_u!u1{L$!czFKi!axpQQmO(0DS%)(yw%!cf4#N?S4P>t`?W3Xv*lhe|qk1TD>~LVc_eMiCDC(?i_ec$)B23`ravG_16NFa z$#BTnM7jtgrvFjLtYS)ED8 zPHb|u-M$oVjMxJ0T~4qV_z30+=0;t=8 zf8!I_{h3}TzVb7%`UU%?wtFt>9S-E~dkAj#XQR*WO|u*o#@E9WmiPws%cdgb<=vZx z3e6Ir^)bg+gkimLkdbTAi5B-k)DQMjg)~ov-YJ6Y%o-Z9t;RvE{W~HtxDsXQ{iy<_ zoc*WhUso1adl!qCC6&6RV`D}Qj@jk^?@_dXY{3jqI-I3Qe#&e5`SXXexwAtb>R)s@ zB0W_kG_CN%-cwg^8;rDtr%>Vy7b z&gSYv>?vZS>NCo_(I!_PW>+f=;uyiL0NND*OJ<|?8~PxL#!9p#|qxe z?@b}<^`WcPzlsoGKK*Fv7u$dTiRo94LcmZ*h;0prce!asl+v};4viZ1@LK02#Lo(@ z`GjV~Filf<$1#x&xot8_9#(-KESEJx)_!BsqI<>+t}uCACoB3YdHGa(nBnO15<+8m zVwP?sB5$pn|LSWnyX@h?;UbMTI&@xd+a->ght+9 zSjW2@TZWedQw2uehHUN}5YXzyIME3&W_4Dpm(V~A@K;Bza%(f02@m@7n1t7zS~f4E zG&9h}e5_NoT9hxnq?^x#dav{HXc?Yjd=aaxKo@4g3iQX)M!FtHQ&ilTdv}{he+(^9 zUNLByx7_Zo8@-hFHA-VU)x5w$G7F#bu4#Ww+bql!ZO1ihID$bd61^(eaeABb*sAKC*~9 zhMH|=Ttq!1yaY=O#H_v*b{!vs81^m`4r8aX0kzMsg-P+sw95-=Q0XV1B~3Tk7*5jM z*^JrQj0WJ+NpY4?Cd?rko#DmTAyTHNnU=+ClE>Mde2@5CF=uG=0a(`Xt&zc{=*xRILPxF3O z=FD>0J)1uj)-1_-=$l$(NYPGzLU39a91cF*mqkfZYpI!iK@-AhK}I!`HZSI0WG^~_ zzik&GznAdl7KQx2*ueCOHQ;*^y1f{6?SeuKoWx=9{?;?s9B-LI8jCh=@OQMz40S8< zSHQN@%tlE+pZWcOD%Xg$tI#hgnR}J%-UE^y?1WV&y0#CRZf%tpp88w8@1diZ31lAq z;y*ct4WEHp@hIkMkF2<&Ll&@9EJTCc`M%R(hIY-2dd9v2l&Rrb<2@L>f8)3lVMa(( z)kD!o=>F`HQv_uFo~Ey0{CWSVTB_3PoaLA58hR}xU9*7Ew@1jKliPR3fGlvNG|cOw z)DgFK8(Ys}VEe1^Q%@K1UOr`!4QEu{;(VcZxU+nD=z~{vr@f`=Dh3Vg?c4x%4vrL$nqCjns2!oD z+W;LEt6J`Qq*p+`(^-PJu1IZ1nvT=tfCg8J2w`vf$3VZjUZ-CDIxzQf25FZei$`72 z>_d|4z`;CAN);p1{w38_q2BVXyr;%F-ndT^OKM+=t|GJ7zw~HiT0ZnO)V5MemgIzi z!PH@vslOliBi@@1RduH>j^FA{W0@ur4lEY?L)vXa`CL=jAKf~Kaq1e)B>H*UX<*N# z2w@gOS$fgGc$!jXpT<9QN|n*0c+zz`<%1`x?xta-z7D+3C;scZF@ zt5d&SV%HqTB(H(Vp3J{tRWaD2AVlMwHtc4#zy&rG;@8b(1PUSQ747`>gPOYVs8G`K z{u(^6v@6}8r)jKW#?fhUh0>PIJVl^)rb%X{2`bjf)Rz}VqtFIn*Wu6YezVV3?7Lrs z8oChCv1eBK#d|U;#lR#KC{7RZS2%pEAZFMge$Lt0#=hBF=BDK`#qKgP2uo&la{ zBW}HgSw+9~?{`h9&gdT6d3KjX^I$JToN=R>1nUqHB(ct2lf$)d+KgLP;Pa1kqm%Ba zyhEWa;iWDI_QBYgN^$?)$Q#mLKGo!oY~|~XjE3$u8X78s!QLO^HVw#6c(b8fbj1xW zHL;JR`I8!oROdb8)&FH&jO5#aL({uRm(sP#gM&MV z`8Ud35c9S~VkHzi*qDoqboKh07RoO$EtOOD`q}Koh`>q?3OX$YBC^d^i9Q#fsa>?_ z3}zatLdMJ~r<*`u%<>F~=@_S*u%dcOsyrZO0LLODEn`_d)K5bOU?n9xQnapeSm_BO z7{dPwhNcCUtWKH=<;UN=!Nu<>r;xIa68fD2!h^JjADmM;$ z0n1Q`Pwye+2gAv7LM3KcNZm$;8xb#-BNpF7;|TgqbjUh(*hz_q7nPOq5K&(0CzC3= z)b9j&yoy&qjU!qoSwHz@a!;&`TD>6;@gfsCk|kU}biat8L6)R6xFaw$EjW#BmSmB| zJC=ELH5-*$7uE2gpL`p03weg^E?jemH=mkhm6a)Yu!EfJE<9{gfc=6fmT1!MXc142 z=@KR^-YH6fU#c*Z>`OpH$u~mS@+l{>Se`zAEeU_Zm)@_jOjZNU#OtI;mf5{?(FD66 zYB>D!UvO5L(m4X&JrX-WM$nheTujp(BsisaFFOpMxPd!#(?gxb#L3Ot;3Wp>gn6ZeJo8)U4Zq;PQSZBJ zOKrxflTNLhwQ}|(eVSfP^u-YRj;VeAFUU}Gz%SB!Ich(R$d`zjO_=>))^tY9en~aD zT@k_6o?XE*8ZXuJVyw1y#qJ8Uf^=$JhFmkby~~n(@5?dZmc+*;mJ?|BsWg!jCDzX} zg<9wg0+W+Nk*q26=MUGi3-*`^@kq1soEDrE`oaL!{vI@G{j1SvWc7%8GHgziVDwL$ zt{CEshRRg4y$&FL_PwOU3rAb1;Cb@v2RX))(!Cn~XI$nYfG`}VK^tv{OGL+=Wivd= zLW!x6Wy$l9XkAJ2M3DT&E_s<(t`v8TL|3Y=#`P-1H|au787vARcbU)gmt7VZc@N^q)Rbqc}50pI~lg_XN>mxnv`&2GtVTSzzPI0;P_5o{hJ73 zhj8gAyU9obz4u{P`7tJwzkE3T(}@eih3`Kk+l&WgVk}b0Uy~!Qi75eoi4R;OUK`%< z630wYI#dR685t=7wV&wT`INt4{2Qs5t!0o9orRYqdT=Glf{n;Du&Lc%pd|22)tX69 zu)oqe{~5$f0h$Mj=3f(dbm*Mb>oI3t?LbOhOG&o9_M-CnwaQfjI3tQhTBPDsr;0_KUPOpz;nc})^8ZJ?ATsOR zi1UzZrkE}dlkXuuOIR14=QB6WjYWTeZEgoK26`S=4xbcE1o}VbdhBvy#NO*Fl83+h zujI%N<&Y-VG*8i*DJ=p!Rq~^Acd6vZKmEhnCs;LmSZ3~7PTLRPJkiY7Hl2*Pga45z z$B$zxF5d?VX64UBx$aRa{Qb_qVWi63#ygCEDlwa92WAe~SnO~H^wO*fi2o+aMLGv5 zG0@?0UrH~p-25X;#@Bw5Z&qqZ!tGnU_u)sog!42<*=W4MdQ$hosX=Y#ADPWbf-)5s zW8L-F6~%~h??aAZ4q%Srok4xss*-zAY(5zdVuSjDF#TxR5wIflfw}-8b^eWxE1TJQ z5C!tfa&KWPFbF6F1V|w4pTo1aB{&2m3Mv{pXb~<_L&nOXV(;MS6j$3bg+b0Ns%q%_ zEheXXgMv*g_S^_lSk2hZFL(Mv+2rqd7L*Vuo~07ry0J`xb*vW4CiEzH-Xem14g*Iu zl|*6YedD|G1$MHZRk9q23hMg+*BoU z#3l$|0n6$2x_7qwi|;njZ{Ybwuf-EZ8Xl4p(`-o5E!`kW$Z0|Z9Wo^8sbvUIW#pI{ zs|)>xp$uFEb}3adSYr&;-|FrGD-lNRr^5a&5jR<> z%)pRZXEd#7%!8|+0aq$1AKx}QMHHQRQ#Jaa8ovKe{}wfUnoy~pLjC0CZ>|3N-)%}` z&BtKrDrI{2dh$IOYI9X{;{p^_h|~8@S?nGAF~)gckKfZC@#GHXm%sldKm6Y3(h4D1>I9zm@@okEE{i<)d}Ut6Abtb zY`}V3(Me3e_Ov9Bc~a0B+*n_-l>AkZ_iPo?;oJs<=5V*@KCnkoINxLBUU(_V(egBL z<*>1qb$m;=lvx$jiQ8jzj&Le!J$XO6WV8&K^HoikwyuxaE{wO7zto=6o#OB^Ql38u zD;%H{hHHFD1)40qPcY(+NqZ?7DzLce`98ME*elkd)sG0T&u$h1riD`dWoV!-<$I*b zeSZEPV6&jR6Qk2u*(_2&VR^2hn(|D7oL`jJrlWtXqh0*2R!H?BLz|6_qA6cDhUHBC zD&*4#Ew_6K>voG5s~}=4S^^m5=N`0rFY6ZNOV2DT!=WJPh*Z@z&F}y4Me^H&Dj{aB zofJ`?x$K0SiQ-;IDZP1)V>+J1Vy@P5nNLx<<-nnDqPF^+CEYVUC+GfnpD>aWc6D=a`tfq*F0Pp3V z*Qe6VHFvwnZ-XD_$>f<$(qgJ7XtgrGMci zl5^t9ZnV|(n7j-|p?LZeNU{_}pkOUbd|_`I|F7jeUZr}i{V(s&DmbI!p-orB#MyQDM$QN5>WZ(_C*>w0Lm8sP;h*7gS7Os+Mp0j{`2NDMIm9^#PpckP|J}IW z5#E84>tbp6x?`O_?zrv|Toi4(?7IK~*&owUSPA(SnlNF7{pKi~HlH8*$#%{35bHCT z3zJm~CZ=Ayf8B)9^u7JGcE{?X%+*o$7ttCF@iJnw$Y2sEWj40#|^*)Mp18c;#WoH!< zcODhyCZQm87KiTY;t*9A`;W-QuY~wmYHe8^6t4j44CO`wE@fYL@qLuz;S-qAMFEUW z1;@z2{+R8^Hd($ju34OTt5j)w0X-QZ6;O0L#b1`>S94xcDBClCC|aG>^d3Z&*3{Fr zy3Fq+-u@P~m7CH$Zi3@^Nyo&8p1k2Aw6HDmVteu0sF2iO-mOxu-wX5c)x(k(n1Tf# z+I&_6yw&K0vMqBLilj=Ap{0al1?tFpb?Ph`#;-Z|=}Y_HsfjumkE`Bvbi=*> z<^{_R)eByuS=^JR)l#1Z!;9$X@M0D5;pW?I=|65sUDA$cp)!1r;W|JnL6IU3oz|XO zRJG_%9sucMQ7RS3dlX};t=t%kA)s*&OC){N zo41neOkYpAxKRF!GnY$NHy<_8osn>NS{*(yZ?eQCAx5#xR%!-KRbxbSj>+EXsWe3+ z2rVEgAWL><_qZ*dFd9#-5ap@WcP^0u4y8FIVcA9q{ScLfvn|xwwS4tjV=EQkBrEy9 zs#Wc~xx(xd1`B>7?UQ(MliD*cqJm0zF%wkTX-xJ$PV6XXrLw4UjwhtpGG8rln zsY+z7BC0|@)Li!p!m}P>?KPD#_>`0cQDLwdV%j7}jZJlESeNLZwK9|#hh;G?GeeeE9 zCkflh55^Ft^0lljyXUJL{_NAD_`)sm5nx3-gp0gs46D2de6$a?Eeq9K4b)+AjKQUhdqM)zCDa% z>`{~kBw4L_89T1U($L%X(EU}1H7!lh1mQfjTzrYfA2T09H^g$)2M4I5*%Qnu^Fn2y z4T~t+RJ`x);V^oah7bAW4Y`Jsdu={0-W$Ls86=E~5VB+?0Gf zX8()+bk7olFh@O$G<+AV)lnevLO(uw;|PnHD1sA{V~d|+v=^8{^LiV z$6i;5ZI@L2MlyaH*B^>MgD93}aQZrpk`g$iVyb}{T`4^>+|CScHa%mi0n$bqi1)ub zQxG_an$}ZJ%Ek}-5bqCw_Fr@;pcDWwa2Qa|<=?4`pp-|@zDos##L(V1Cg;4Sn^|~j z$SL73X^Ftz?xT-8#mJJ>#*s6i3N)AI&PV~$A>5{+^M)w506R8=1y%5d zaNB-+Nt=xF>Zk-=wz*<|_MP7+m2V+vog*r>{V+NT<5$SVNtz^IrwQ_dy8>}}RU;7$ z6OU16b9_j2YNDP5fMhFnxi1x?jM~2~q(7K%hzU#XvsL6>1xrf~DgDMU0taxHAey-) zh;_Q?Xl>bDmlZMj>h>XstK7_MtS-*ALw|e56z@Tt9b+_iK2Zx(Lnz^p67%KRQN89F zfaB^U0m`5cS%$uUhbg0EkrxYw?Enf^8@22CQtV zgh^&Rd)0f*>gtqqbgp@q4zGX_vR|pkK6z_aW%aLsB??$$7sm|!?DaCv?=W!+bPVP? zb3tgwzl9^%{MkJU6YQ4PNfDWISsYo~=gnj8%D9P$z&`XlY1$#agFwi5M?gJ-0_dV` zC=csLPLm?c>iU@5-qAU(ex8`VHMUuuo&VjA)mzHdx9(E~pug|oT}G`VG_Ayd2LJKR zldHgZ){v!r_E3bHfOFPnF4uRplvGFZav~Tx#TE1bpQ~di)>J#E1L4L zYh0$kx^II#6}yjA=DQS3m-D`<1XJUM8UhfVr~7O{b)}ayW;FM7V?S*QHu5g7Tfjp6 z`-}HJ#y94C-TTp0_Pija$(42M9-sk*0_|;w7BnYm&lMI=aK$S5nEA!@N$G@n<5u&j z(@UBU+Tflf03MjwXU*+*c8p2hZ8B)+$WQ1>Kmt+btHG9s=UikoNfHI{ApX)ova6rf zuJf%c^s>r98BKaw;dvEmEJorS#=Ht@bIRfRL`JolY2z zQrv~Dkybzi{}DT!YxmKf<%O8hL!`Pu3sMh(M_;vrT`3 z^gcEWC9Hd0`reg9=tRhw`I_uNV3_X(KX2b2>}Bq71ibZujk z1INqZg2Rxmdn?3j2dFk`?rtz*eR99yIh298u{VxgouGMr0pHsjEK%?(~ve1Giv; zqcF1Qq;GLJw1ZOlz^au3Is zLJsS96#&LX!s~%55wU$wA~-W*r!u+U8ItV>k1>wAfIMV_R!rc4y8g438k98jl^QCk zEZVFdV#p5H3B^Wh)UywK=P#u=z@i)yqc`z>W^<+NVVE(3jXm~z$9Z_Qh&IDus^}{} z{w;Q9&!TeJBK~%HH_cPBqGSH!e7{k;X6uYMDw@RBZwe>p1=35ooTEcq&f0|mmJH(n zzpEm|!Km;y-CNtVHpHibUt8@3q3b`l5%}x}@RL+CM+dEKeWpuwTdfHMu2;z`yY(X- z{FtCCmuY!4FjNM^=KLgTKaFT=IzoS+zn;P=!aTiNO*Z}ELhx|~VQL-dTb*}^V6go| zuSkmb9Yn`HkBdRgrbBUM5{&KXxe%1#;zl_ zqyjgcmBD@7Rj!4{PK_jP1gq3vUI8>zR!ttLiqO*pCEXb8REK+=JC#y+a@-KehI<~a zzIUui_FLKP3g~#!McP_ZGvC~I3)ymR9e-#60Kz6V$^4NW_8e|Ifooh%l{Y#sspJ^@ zRu;9nPB0!`G{|y&&`IJd7_i@ad;LF3VwUuyMXFUWs5kD-Mq)tsBLTBN!_?#r^Q7Zz zC~D2rE{zEZTN3W5vDhoQX?$vX;p1z7shTmD=fb_xhJfiCt4Pzm-e%knxZr#Tn^8Ix zQ0?;FnjvzKLWABGeg50v&vd@=rFpgrJ_L)P=Hg*Rim&f`^`iW~(qR!%AJuw$6dv4$f~)*1AK9s>y-;)SlK_KeKc1|RH%cj z_OQXAwgy(C(P44=SP3TQ2gH(*uOAvb^3L` z0{Tz>jV}88_Mg9$=(R{bBpz>dv0s1gK%@%P^O?RuZm5JT0%~JrKr5TK&+r>TpzY5{ zbsFeoAJm?z!yeF8iXuZH^w#`T@&@w?xGS&ozWRfSB4Xg}R?uJI_Y^Sp6j`A2DV@)+ z08SZ-C@1gB-UO5w-jL@n*T^bx(L*P z!uwu`zMmP0s%(MG3UlrF~2HfdrlZ zg5J{kD@7IvKt*{wWiZTPRspScyKAP-FaDDn`$&9lV-sG~khXv!nGNH97d zz)uixBuCB9RCf5#@#afRT^ji&YoC6qz&Gu6WZk(PRPWje8DhjP$AdT4y?@xrG1;(D zb{8DD^8pfv*RO)!8+wrr>PH?DX#zr#-3yU;(eWj%=c1#C5{APY5bxjX$Upz|Bt^Rt zLw<(16Zb{yDK?M+kG{R}`GosLSVbh#7M%34ho~~jR+tyM)LmYQ`yTlO>uiVlM~W3z z4XAuVK~m=AEll@}6=QZQlPkP}LU>id391z)jIJXY1 zN@FKMyPCa>7~%8*AO(VNoSBfYe9lpACaSkt>e;V5{Nx$Xdaq#oO`%DQyZ?M(7I1w1 zZE~;XKI}{B*7T3&TNdMBHwbo>%!<)~r=JAp07&iCa`Z9li6K$1Dr6yip8!=qn{c2J zP!K%tW4~PU15gc_xx)qW{Ie4%M%!KYD7Z=$*qXirF(_`TOAb!sj=FSX-vO$TOhoaRa+~o8-U-%1z5kU%! zM+oewa4{Ot-lR9kNkf`t$mE!C7etwDywyZr$ulI zw=W=&ngDHe{~H)58A2pv2n3iS*d!T29%KssIu!T!Y+w&gc0YAk%ilu-9i#Ooea2Y9 z0ir9?0ddJ^=U@Alp|N1D*8jltEQ zCYUQ4&}Ygn5m2rrsSa0IJgI>?qfH)!5W);~q`zU+Mk_p-kJPY=)!GBmTZJ0MG4mcDHS}IdEL($)I@9a=k_)dt0=ZCc?*jEbfoPoU?YUY z81d_70CSVbCB8RIEHI7*zj>QXC=2F<2eQ=xg;ZIkD#_NnpaSrvQ~+Q772x?UzYi*u zdp9_$SPaZU|Cto6OCY*>ORQLUdfl)@4~dEsK*w}o`b^(hkaSfm7^7v{OM6~CatE0l z5C~6xVB$%uI)4a$d4iI8ZUC6wFrg2Ku6pvr4bZ9@dLfBG*j9l+u-AMRsrOmSU(AX` zhoXjns_zJWnHAA)L204_4t@URPv|XmG0ep>;a69}){vs`(#g7R&-u84aUe~z5G-xrC7>F5$Ro^P}BA?QJ>9PgWg=2kALlb+YJgTLQbB5^p>-db4UYJ&_q zR3o2s;IKs`A`@}iTmB-`vE zP{jb6`82Ad8W;=605VZAlgmtt0I}VM5v3Ev9Wj$E;$ZS%-MHovpp^?IOGh+sazd&` zJghb=L{TVd2`bp?-e^v`3KCH34^}KskI3a8p-KZqhDaubplHZnI^dEN%|3XC@BifXm1D|S%jS)%|BOGOZE+OL zn@9{q7ENz67`@Xl)Zmu0l4+c_4fhqD7W1BitJ&^_sz!ZCCZktGAqhft`-;H16?}6I zFW5d{YuHEcgIbIR13>FT>5DUS4k3Z2&V$cWL@=@7_Xo=l7j`=w|v7H zfWJJaU>$>t;U0o^d)UAIZ&W1Ab<89}q?C98;Fd7)z;KvoQVw@vqUk zbOTXOT&|9SB2#l7BKIBQ#BYy#Ok>hK$|sijErrJwW$pG>XMiCOC zSHKqWe?pkxpm(1j-yGi`zxS^Y=6MXWFv$DaOfV@w7BqshWN9TO*+ znn5gFolU$*_`zy`>U)GEG1mM-Q<4_YHe(~eBHY02olJl}@H47RN7$tX*s?QGebs|h zm82#wXMRmEm_tAaBs^tT&~g6#pv+~}rx)c&7nJuty~Sn1iRZno66-bg1$e>nkJQjn z@cs*Efh}rS5Rg6w>||PHwxfDl?JwX3QZ*4VI1t_CSfaGx>BdGd>=9_Y@wm-fzVPAE z3VxFCGYI~ElV#u{@?m*~;k+8!BQUUsr8DtY@+A9$im6V&H~Ztv%rhrr>gB~n> zF17~JKRnN}9DMr_UJ71G(%4;u!v(PRtGU0)d!g7yLjC!$L%v0W2AYa|wsfi&lruie-tq9jjL)+M26Ae`55lE63Bp`U;(n$1&WyA+W4@8u*xOMUq!{wN6RwhVUm;8ojt|kY z6#0c2KyCXq!=G6n5?Ql=^~k<@JOWL83eOq^rwRT%$**d(B*o}Cn($`;Tu+vP*-^`2 z#<_e8Vs&1b1ep$1@L)u*6tMx@;#tqB11=c`r+B?Gy~PlG?yXo3yy~NqFCVPH)UU~5 zDsTHaAt(UD?YnjGEohPjYUFYPaD$Do-i2l7$MC7%!Y!qKDA?bFVy7Pf!z~yis7RH? z$S-hec?L>kfrEO(L=aCjl%&H;C*r=e-EN15^?mgcd&DV7vmV^G;A& zGF`zW?xUo4W(`yGtZAxOsh+$Wq#hw^y{E|PP;qT@BjQw=s{~qie}2dNfMNIz5LR)! z>DR=9Bl!73EtVn@>sb8M@w(k3TNwJwSCmX*CZ7^J^c*h*THg%-7aF2k$afrjTOa

HnZRJ)@Uf0WE6>BB1Z~IU|}kTSu=3(j@Rh>W;+GK$+-CxgTN% zw(Jw<6qsmMB*Zytwcx*t)}IRbC1QW5`peF|N}JGZsm>I+MuCAu8+C%5+Cj^gYSJ9A z;%m1g?@4Z%lDGjJlIdrM(QZEtgqPMAarW0svm`N^PAGl;_B06&@Fx$9;vNq0wFbj; zz`k-Fq-Zx))0YbYUZedP zsF?6o8Wp52SoKLb3cna1UMJBn%gj9PR7;1b z-AV9M&)%5Gj4rADHXgcY`1@FgBI*gNPUPIR{X1g&U(Hf^v>H;a-r%;#_Put#@Kzsy z6O(>p={myu!5ln0Vi4I*bq56Wd3ycw?p4%cg=I`1MziYj#(>2W-DNIvl^oK~?6;@h&gC6fxgP zn)?^G0zBG7Kuak=W#yo=ko1QtQaxey2|PGInm;N}$h%NEQbuLyj6Gi)SXU~ctO-&} zRm|7`fPV_*I+@g6Z%A~YWoCT5&tz!H1+k#8^uW3-z!Gs-VWR=znwqkmVwSCHZVVjq zqX`-zs{bK;toGVB2wwCh_%R`zb_#tTBI5bzz*)m3knwzU-v2{guH9(rXyD3n4rQD(P-&| zsi=s16m!6a{Po^lG@20>p*9y|go1OM=GWxx*w#=e7yt%Pt!kL26E_p;Q9nUFR6iJ3 ztn!Y%37<+NK$MJR=CKt{>j?~e6l|(0{5ZsPkekVGi` z;F1fkCJV(+(uE;Xd7m+yZ81Lp+;?yt)~T)Bs>8_Sx-Ze(qdoUPk`7`FFfbko#;+q% zHA@34*N^d!LfyLWzhqy^;fuTghm9-Y5YIDjljQNz0W4DjH>-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~_Lp z98@udEV?)(nN~Pr!WE6}A^t z*t8}uLE3p2yy5Tv6i4ckW41cRFBJaxVOZU>ol};P+8K)j6D{Z|>8~;C;&Xe%iYKO% zszS(mD-T!)V7{XZp#$b=Je+9u}D{YcjV%$czRm3Px8o&#@d6zw&9+AVtlMG zVoBms?Ohqf`p%!IfA=*_Kn;;80GpcpfsvyzXz&p6k8NpZgy+wx!_L49@AhFBp(JVpnM;}Yi>*wK&5J5L&26Uf zD?E0L@UtoPqxZa)uxCtzW#A>prnK0q=TjPD;aBvEwsgx>eHsg8QzAnTq%htW_?E1b z)A#Og^KrQBdO(?`{ZYfl^(A6I>dNkQIOmrQC%4jEssQvm&_QUn@`seQ@nri6oHpQm zwLqe4(uXzT(4^CW`6nGO38T~X!>(a;saL(j`cc_vK*~nvRR7oG*bi@BasFnsZDg<6 z9Bt>;7KW}$%%annE29i_iHEls{)m)M#J@J!MBMWv7)^r{yzsiz?Tz=2Ir5aykeTCM zL+kUW!)~R&rr9JY8{O%?m(05hkuU*Vey+K<(7$|f`R)O~gMM-4v8&wPL^j+kNm#Ta z=xiXVxZTA5$heZ_qDx&6=zEb;?65x%z{Lex25m9qKVlTv52P1JF)_vHhHGvGYL`~?jzAGPwW9j}AhihSGhO_q)LjgMJSgBK8kj(;pJ zkL?-$(t1B9pT>E6hrM;sbuZZ%zGO0yzV{QCtGK$=^JQLxZA|^@lpqsi6#A7c(TqjH z>@u41W#v`WVRPigB-igh;q8;cCd?na_>1?=h?<)Pk6q*QB^|>hs9!lzxBGVuy}vx> ziK}7E;^sfzs*Q}=L3Ek<90UNzPY0nQ0kJn< zJI#jcfZWe1+58@WDu0;6x$67f{GxJX7)BXD^N5~Df|G^>&M25MN`ngbfA?q~yuZ@= zx}Gj!E1!FD^L`>ec>T8zFlcGa{O6s@VHK zw!K~9)BpV7kLvQR2P_fxyuezSGL)63CduRRZ+@|tQ|;`wFN*hWsFSt$J{*Eg=OX@g zN{90|F81izdXW=QbJk>~5Sb1+PUax*lqX9cE}L<7)(2LkxtF;K{_qnt_V)8 zBe94LUn(47lWl@`py}AjHI%U=5Xg*u135Raw?EEXN+6pa`CF@b;eNID9BFzSu?u`% ziOg|-m9ZTdrEpmykOTkl7hLhI3G&m5=ZbZ)O=Q0IYcOxy<^$U5x)pZ-|E0Fs&#)y= z4&uk7vcVm}zk(o>aeB{mF4MN>*m#<9pVPfF{@mIYmJRS7R|OPCBCY4%OI8V|r7Q^a zj#KVUQ`G9E-NhAXi2m@nAU5zSP5RAq5Ic=Q3xNl}A&estL%rL92bsD!!1M5)id90c zKiu+oF4NIJ1J+QkQL)O4KfbJQEMJ?|3-8lNQh!Hmz57u>WT)kUykqHT@*Q0mSkZfw zc-+b>o>*uHRZK#1|5o3;yIekTNT$l<&+@3aM@e@RTlo+ib)Mu1U%%Tti-Fhye?Hj* z=20n4YF@B&%Dv^blN3g7_vWExXz@vZKCM@aha65`0>98Lj=JpnMQdyV}mn5J*o?k|NK6> zR6CsUEb-{k%<$4o)^_VTTJ?t!{}(I6nyqej4%FtU05y3$i94!iwI9Qtp0?mvgO%sQ z$F^?DOm5JR5EhpbzrB5&s4u5>*qc}qDeHVBoMP$aO8$HO`u!5!CY`Eqf{F`JSkdV- zbcVxo#q`Z|-sv=D#HP&8K=7*n9)!~QTSGXZP%Jnn&0uwH z*Wxf6?vF3 zFH2A8TiGf%quWJ=hOZ$%#_UQf9#ke3N$X>WaAzLpC$Zm&ED!#Qg0?X}(;$z*38HV1 zjTyA$CQi@XYOZu2*-%gjEVk-n#3J9e?0SR|OZ}*d;_%JX__peT;IaVxE#PZs z+3<_)nB-YU)2e24-xFOi_(j!j%T#~j^=`ZV_vpUngfW+=$>rp_4ti6G`0_5zk~}l_ zFX8>Icxzc>vxd4$`+?~5po-JGMUy{`not$@OmSb5k-%NU=kCshHKc@+lgG~(*dK%8 zk{~CKLP;VeqbmJh5xrco*TLL?d+wh)3qR`f$>^1skOo(5pR{xkfCe`Ro7t=2!M+5W zdMW1m42=Ad650||F0Or8!!3cTNn97U)C04PpUa*1|EKJjaDEDJnCYPHc)3!*wfYUVaISB`m5R-uxYd$o8eqMLzc8*c z{0mt*G*k*cDYn$kI_QHDi`&mo0#zv4SE#2iEPOH#d#3cBP4g)e>Y26U(7`{>tDrAb?44t zl{{0@z{xw9uZ2o^p(8G%Mhpmvfqmzm3=Ju&I)Z#|Zzy*%S+u(5eOQ%;qTSfzrY{!N zk$i-%i;x}wFS8JJ4k>gOI)-E%u#c)`(|-w;4+tA!VhwfCB6}oa4dzjx*Ir%a$KUFUbUlWL3PT?D#~ zmV5bG=W>EueHROsd0tzeGg~bCMZV5MQhV--`8A)h>UTlc8f^6?Zm)Nw3fCTE832_d zH+8rRSy{nXF6koAfwYd^mHAWX)kB9dKRy)?zV(9786kP4LgB}aOhkC z)(8kl7j4|zD~4Zonr?>yT1a6N#2t4}xI49-ScWkD)$q%wOa6B)=8Fbu7l(|8c<8Ic z2L~hZ1S5k;;BYA2OuA%+@1y9=yJ#=df3QgZ`?RRUD5?1#r(F*d_g{m9zVNo=2^`yx z#7bx5>+FcHqXDQMK5zmUS3kOkkJtk<`~k9b?qfp}226=;HtI$K-dvJ@M4_Er8awTh z(Aoj^FeH79aWeKSuPNM2$|d0R?WUL)mp;&}p1;ZcPI_5V0>Ule{Fo$K$jExTz2>LL z-+KBe^#F+lEnl(a-yX$6RfW$GoD3W1pQqOy()iz6n~bjxKjqF58 z{!PU6M@W?YJLY5Ae9bF*l{s|By)J~AFYN1GyMy1Qm&;I1CJzMh?Y*6E*zUQ@F1MTV zMONMY^6p*)@;nyr-GWLI-RPzw-=5jCo8NH0y7Ou+)@(`&r%=mBQ5vUEQ5meyfBKNo zyOBp`NA-8^Qh{a6Kpi>hR)iQ1c%wC%&fN)?W}en1|M*%(JMR^*WrdX9SyeT%r*fs7 z!*70K7JT_RlWrF}-Cx}3i>+@}yqq&QC9FnUb~@;UH1#pq{pTB7^IjuMm*Be5M{>oN zTF2!g1}s*pWn5RTVtxY4CLQO?CloEOhYd?6+Efm2gLUKOU)#YmT_U`qKurDqh`<*s z!<#s)Xv-Y4n8YUt=TwArkZS*xd;YSRXy_+~;~bHd^kji?CQ-4E%Wutn%tO@OS-xxS zk(dvv4r2)6O{0#b8>oor2k-w!y~6gOtKJ#Dpjoi&-ifvI&fGZ#c3swuF)*V01bi_n zI1-9@l2wb?l3pj@r81QX5J*hOzeOZR#DrT2J&+5AtdA5db2f@yOFUll{MzPY4X#UL z(WGM_Vm(OJeP!7yF~j$0yU*eLb>+p!ld^(zcfS8;_+LT7WRz(#eVU}>B)ZIm zHxBN|yf9s54E`tX2zghM6C zP-}C+1E`^JY}@T`qGee55Dq2gs15e`pqf|{9~UT>)yy9v6^8pYHTLWz#B+hmX4If2 zzshCRgRA4?@cNzr2myMfq2Xhq=BG3rwWc>5G;l7}8;QlSDF^rR&w9n1d*mH9XA z;gP?rr&g{`S*Y6_&m&n0+;1k6?&(K2j$a}QB@$BK5=eE}r>r0UFW<;P2 zy}>=d>>-lxH&7ikV)a#o(t11ig0q}UF5Nt9BNR+PWN&*lhGO-Y6 znS%P=vyIVHidH~(= z+uZ!es>^E6>C6b}&!XPGbG6;ih*HSSB(kih$Kw9&rhav{sk&43J*7?rY6?Q*mQsC| zkuDvBr}k!(wFu^tU4qnFH2@v{$5)~e>AuU=2XlLS``+ofy8iz$shc(JG6CJTs_b{J zV#d5&Lhlojw%zib-|U-}o!&f=NaL&iVkucwM>|I9${7z~`Al7oD1qd*7CWTT&9RQS zJ?G-2JiYNej!21>f1YoB?>Skcp2r-1V@Qf~Qm4?6FURAw(nf>>IA9AS`R#Jujk$JJiT7sAc zJx+L$^T4m~e*tcTr5x~ggz85sUg;a*s=xN6td(6iC*`tQCCFTu5$L)@STWk7oE zru`#Ob!eMI_p1BETdh;gtg3#ibEG#RQV~{9rbAlN>0GwU{R9a#dpbsy)ZBgR(1$oQ z@gxdEhX@(g(^9IY+pw7#dc?63c~z0ld=A1*N!h_2U}RF4^)q2*haA38>N5tW^Ct)9 zV6UI|1OubLUsK>@R3R4hd6NUBCXqwoaMN~)y{++olvelV3!w^%1IW=Mw4W0%>!vnx zZ(*f9;hMSpzG-C4HB8{(+e=VOlzWmDtSf~C-D0*_ULVMwD>v`M!*Z!s$iJLYW!iaw z>P-TtvQ30OV5c3;16{UzrO7vL+EaIttg?C%wg{f8iq{C|+>`Y|<3&vWNe{TsRC`(5 z`x?9b=do%i8<~PwjRKyQ?9D&}pGpgV{s-7Dl@v+HykDSoDuZMS*&ati2zDx`4%w zx{rmAY(%DlNUYoH!)yh~!2HMRHqFH0S_{R~xZd=lq9Rh#RdNEbz|3%}c*I4Ba{q15 zRG=8e`}g9k`!dQWj)bp!>C7PqH9)@Oa^bYELpx%;^^P{0T0DkmPvsi|shFw{;?gisQW8Pjp&{J+Nr`?|zCQ6BePn$k;)^ShB) z)U+T%`O#CnyKnx29y`9}CqRx|bcM+KeHjCpU;JaJBZ1=u!gA4>9tbf{*bwhPgO-h` zkEQierI{vWhHbptZKe_){6ixBv*#uQ?}XhynTX7sl61>=My4~M2**4E1&qp=UTbuT zJImCezp!1?gdSwnT|y&2v5>Gh+vD0>4QVLKziJ7b{2>TZE#xrp6axa)gxkICj{d&) zR28Dqju4+^rSvCN%%JX z_nyVX(&Rr&3pZKAS2yJiC2 zfGfR6@S5dU_GJkeRdKI$sxO9}_vBW`bBJ8=8HEK|Bypk}Zvg1W^Q~Qrw)ps|2y+Tc zPQgXPDP$6v{GIv76>E)#&94EUAxqaX`ub=aVs+~vy2Q>#9W>8ePyXq3>=!~Yn5ajb zts^Fra6#=01xfCt47FUCaFQ;2u;LwAK&4AL8fywKG}9x+8HJommG(J9;L~mC+K23! zvQ0Ghb?pYW0CuVm9Bb7#LWRcc-y)j{jj(*^5f?0yyDoQAJ;l+hY@XFYRM73w&IONP zh0qYE?H*WVKO%#}huIQDrOiK*%U@d!Y_U%a#f(QEEMq(bDEE(leg@-;_m)s%Gx+gx zEXOtpF&GPre7pPm9+B`t=CqYaiqZx>j0!bSh`ZDf5S5DGFRa&KyB10(=Paj=?-1Ol zS9ZtaKbprQGd`Ep&Diy%XlSw6B*A0ph{-%g`t;)y3-?PKf4-};xJ>o1t8hA3%j*g2 zQ2uWohVK=>>Q;X(qBg-#pv?I2Gb#;|_gp^>@TM{gT}w|X4x)m?hACsVzM0bmcPEE1 z5S4fk0S>TkqprQ@SG~FOPX2lh*7+~E7v%hC{RBBaB-&g2Pt_!>!VtoNz;po`yljk8 zD4wyeL}B5EGxCIqo{JWQkl9f@}Kj0uUN0C~5p`C!vB9s<-%>O81HBR{CC*kzj;| zD1?B~(@!~KSY^{%=LW54pEP7^#M_6bZ|Ki3okaBwbzT-@uS&?CNn(5fZHD)$SQbp< zor49S&2W=0h9Pr0Br9okl^mb(&=;tQ5w2QFVu5iJ>AFBUcc5yo1*%iMi}g<+WJ^Hw zq{nqDVrk#fO4cpbuX~~PxK~-mJ?TQZ|62M|E;|P{cyWE2?Y!U%Id%Kf#o=z(>RIya z?o_;T)At`finHzWD4*4RwSrLGXRBteu$%=xZ%p4 zK-#a|Q)wDSr#U@F&)2|fo<>B*nCL8q+wc*;7?zYj-iPp;3*TidQ>!-NM8n6Ows~pj zQZ<11cl;@Yd^mQLOhR2kxI3fv(s@FEMJh2y=iyW_Hb@QGNl~ME71z^M9W8tDIi}%2 zx9JC-ohJp;z6c6(06ZwU3ZT^v_8XCS6N&Xg0w$xQg_Fg6pFb6P*`Lg9;FmC+ca+lAZZL|(S1m(YC5SeJ0qR+-|*M!-cl3^MYms$z^Qqw?88P=(0^ z<>I7Ka{i-XM;)_aOL_RyTUs4zBP->}_eeb^SE5=52JaYifrT4IrUe_C-~)ZJ!awQF z0kY-FsOg3I^9YyfCYVB;>uK>*UQ3##IEm`2V|WOT_z@n9N?D1>UShc8U&I7eWW=^) z$-{~hJHrVGiH;LP;-1Ys_E-APqR6AtV&ViKW9TMua753FGLl-}LT!L6blZG0q8}~i zkIksK*3QE<(0BWik&)4)Gxz&LhPvPxxv8RYUDM1+_B@ z&&+@HjgA>V`3HiUw!v^03~|-)1wKkAUp8Gg91MP0vcuaA;OOO@`K zVonq&)V}V^V6!VBDOI_4oBaWUME_~#p$zT!grklwM#R99nV~=2;Qi7ABLycb3&8C) zdNck|Tnll@<*w-e@NV3VPkxlT3E|XfNTLeFpuT*!a}E@p!BNW$6(R_zKs#x0iP-W% zDm~VS`vN*z3$D{!cfkKjP_^{eS^f|3<{0}p8F0H=f4OfDvl1I{XTW>$AF0;3Rgu4n zGrA4!BVDTbi%x?hSjCO-W_!9jhS$zEL#RV)MI-#wcxwV{mHW(Y<^%MCG4W7GOWcIK zvPE(uTbX_?;Gdee(>?B09i`vtr9qy?Usrg+pnJ_peQf?+gw}iZUf^snh7E8Yc;n14 zNf`&dhE+mMCysPAn_(Me%XPm~vN)Qcm$+j9O@AkOnS#pFQeDv`&$&m^rSd@ZT}Rv6 z4!i@HM8@7z)On|J_wMnjU;~Ej9S1n2KFM%xMigPa<5e0PgyPONeeQ0{6La(0zT#lY z4cKb+qHU`CY?)*$o*X2RFL_#7UC~v?B#Z06)h2oM?u99RJBs=Tb&b@J zX1?=h>f=uaR$2E3Xc1?9Fip|q)a)(tx6MnkD1l)-za}eZ)91+YH2@y;xKhQ!ROqx2 z#+5ykx4G`)_gq&r+IA;E(E;k-L71?hufPr$5)~ts?mk84zTT)*neIfR7kF`ard3|5 zDR1k!b;tP{5|^5!hBW=tT@S732KW3LhbQmNU?NQ=jBY_9T$is;d7Yj=zEe4!B*dPe z<;D9ePD>{Q2_3IK2eMXSD88jiIMxU@OE49N)&G|&`%S_@Eu{=}PcrK24d}XosWc?t z59j#%h}InF<~=Kpx!Wh1 zK(L;zPeFOMO4gFzW4DRyld)6jqGznSSErnbS8Lbz;ofWj$-`~o&o%Axp0<^#Z3cpmNd!ZF^G1)OI~VCg9*I-idMPDk z$A`OiFUJ93clL+SngYK{aA!Js0X{qP3Um*{#>Z&}5wN)ZhV(RcMVh4&*UM@~%B`v&k&4Sp?c+ zuXn$WlC)#e|0(hEWWD(0RV*o4@b1p2qUO)2N8kg{s!_U>mP)mc1f7G$mAJg;3dq`G zsPWd@kA{F;qqo8#qU0>EH+)~lkXH|{xT>uO9oQKA$YIjHA?bUsqCOl(%0rIVVxJsw zr1wBoW##pMhWbRlu%s<=_FU>U@8=oiqv|5zj#ywpRjG`Qbuk%JPz+M*ZHR zyqi}#;gt8}-zPVKkq|2xh9^-WX!bb$;4H-5J^JulVOTNZCUkr3A1Doo9ZU_^qamc$ z_4yzZf<`%UsGdyM5j7uy?ft2b{#o>S(y~2uBXp;8Wuq2%brdYcoTab}933Y88ID&M zgIyk#mLYkKHn&ysF}QI0jf>wcT5G;}XH+Vc+FhG?qQy7si9$uAC!b3)Jw1byffvrl zh=-=&;tLH@?z$d6B~Hm$4~7b3P#wp$Uj2JXYVC< zbI)G?EOzQY9hRfw3XB3<{#IV^stFECfy?+Y8l%B;H%%!;g$Ui+PfALC)Lld;`4qQk zJ0U(NytuwO^E5;+TW({k)YXt!RvXdc&2QQ#I%sa%`ufcHm3K|F;FI7%{~ZjGxDI~^a}>jcmn1)ZLlpcW2P>=Dvo zF3vZ>yu zXO`p|?8<(E;y3h3g=b{Ymzz+6rqc^(w?@Se0Vn0x)smm`rE0JdVim}z?!;!PbFy)D zUChDM5fY;;2rU=snakeqaS>G&mBl_|md)EYkQg)^J_o)9iiDi-SNck6hR)fmgW7Wy zv1S|W;-BZOJ!G-Moj;enPsl-D`oMg$?USDh5wrytLCc~5C;f;ihN&cvY>UK{fAJC+ z4gWJ7cB{k#Mq4lEhI7J(-ng$65;$k|87+&T!u(tT?HFXaK{G-&PX%H?02ic@$~I_> zOSI*lx@5~;xcD4&*hk0UY$_#bG29N)nRo9tZ`i3SBdnyNmY=~Lj=Pree@Wfw9FI- z`a^eS!6*2_4_9?`n;U+wKMrL5=s_GIRzcSDWf4K$9X+<7jCbFO@qHWyR~d2D+~ z+sfiM$x9TK=PLcHksT{D3gNdk+EKJO#(m$p?F*yhx`Wcl)hOCX@ZsS^QVSA^0Z-!L z&PwzKFQYiJOcZMijk3Vh#U)BGx(RI>EtDww{GhBWGgw<(zkn(AJ$e& z`fCNHd^M_%@D6sGju*Mt_l$kjVPY*Uex(O-_3fRaDcW{z?0-I!`n6&tp-Fy6X-i#dd_o z4W8He-|Z8M^C85^x#)Rww7Gcn?Q;w09W`bPeGVw#F!=CR>w9OJuD9w4*p9^e`XA|B z1M~H-Fb+3gXaMlx+|P2)YG#9}^;m9PXmZG?V`#|lDmnGN8F4_+M#(3id`^imN z=XC`!1liRl!7XP~KnKk-UWWNz$=QxH2nd#Mb8bbCwPGP+S6q5sd#QX^?;HF;&l>DJ znBw=m(=LjYKlGVB0UGksN92CA2+`%NRD-8 z#lNvIoi@~31xCh-N+}-V9R&Szw-DGd7nWX`O!^I)H%o-oJtu$Ybq)zfZ-^YeAC>x^ zmV+1p)0`MtmZ!mkimF#AcDW(pwnJVy57ewcaGhy^fRLb@V>!Q6-nQ?ZXTD1cfyER| z#khe@ouHQVae_+t6W6{--O%CnAWyN|-;18m9eXdrv&-e$?~{BcsZWL#R-#hAFn*!0 zW^Qsi{%}xNbSRnXLCPIwKkb-rm{SuiZZzNcn)8izd3J^Fi>;jagbGO)DTL zMpbNVuVQg&Fa2Sx>}hJGK5A5J7K>dkss411w)r7ZTvVoeeGLE(#_E^dA6 zPjyQ#VItroKDno94iCv^c3pWf7u&vna`>v9S}UXZLR&i}FQHLQc#;XiT) zbJ2}c$+@nGyQlN1fzfCC$yIolPV6=t?cbET*PrVu!&C|@?M0ss@tpB>!mlM^>0nrr zW&nPDr>B>`vV)^)I>-1s7~Oo3rJI~_TfNrp;oN$TmFcs`$9ELVqyAAJXonaP+GVp8 z(+xPLI^H?>F@6P^W|FZiPNoer!)~#EH@Bx}bdKr2S_J|}%vK@~+^Q-_rYb<^v*izM z4B0>%-;04^vuk6i2cH$AVJod}rD50IPE-@8$9^-i$&dxvFALaQ1>W{oS!}i1+1k0I zfED^i7}Qv}c=tuPEQ*Bh!dYP&lZW|AWO)wr)#fqPwmj^HipD{8-uVHhbQuCUKNp-H zCi6If+UY%&P<$s6~&hJO25JyVO2xL6sFgu=^O7!}M$7fN-Vf#pXx0t_rn zS*}|03g2FdZzZ=CEwlwyoe#lw?5XtiIT#0jrf_8wRZn%bl!C1T5+EC zov-j#ZFx;id>W8^uY~Sq|6-V{4bA^YsV5d|>JCgLnGhz`b+5_hXW8K-uaxy;qt3xZ zQt3sx+QErTv-8^Q*h1+i1`ubcQp}lR+!_j4iHWbk*~HiQS~ox>fp`iP{5(|0<--?D=g??_M$Din>Nt9MM<6Hx3qH10lAxcku8q zMH$_8Y)z?}t$OvdsjgcWH3@A8nX8z6sZ&N);-RkA^)GFiVvPSeWtsv$=w}3re&$#i zv?6IF*d+7p)m{So7K_vB?H1E8Q)(P8UFqby&h1B=B3bAmY?;1D!MHHgy_11un@X0V zd)pR0GB*oo&jx?N9Elx{`AuT#Z2YVY`!~cc$22P%IpakOH_l1!6I|EZgm zWqvsi)z-$6WJ&rsKxOyW_r$xPb~(a~(9<-&zrz8KyrF@T13eitnr z4z|hC*AS`F$tk6(y26WX-y*Q4=_Vi=rgj(YG>71St}1^G84AbbOGolGa3sbWT>`H3 zU_gfNN+JEIQ3EcEZ6{BtrkNAk|k$@RlNYJG?KPf{z}YKOX_4Sap}_xbl(T}(e1 zwPNsftL0kIb`+{NG3=|}aWfYD#Qn5JoU8gJWPPr(((nP{28yikn*nZDLx&G?R{2y< zzn%5tU;%;26W6bTS*`U<-tB_YUJrPw2f@vG;{Ltj&JB=TuV$WT!G;_~OK*LgW3TWcYKg3?v!gS7$f=^AAla_(4ucLqMxu1Y#!=Kx zF?qrymkUs`^sji-Aj&^6Xo%Y2C+PxfAlH;^1H&Ia%m_4W`mTVCE_6pw@%ak*qIOr>stfUjEeftr{PVxJv^g8Vyn<-eo4 z2mXipPR6yeS1943`N2HXq$ZDjs}XCI(vLt7=|ld{4}_kquY^u-3j}2I4GN|39N%&j z-kYKsn6O(Tt)iGn@9^TSP-6ptA|`p85E&?PqBJAJLUbnnfq$!Idh`JYZ7*7b-xVEu zAYX`FfLH+gEvS+wy_)<~2KaK)iz_& delta 13740 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 Je+b7BLQXmZ z#Uw|Lw4dH0knKd>3)i>VKqV$+KZoCn(9AZMDQXv$qm;*#x*m%=72WvkpA*RVwrF%W zqz~?&NdfoE74xHeeEE41FOZ`cwb<-D25mn3^Q|w*0jeNepID(AH3`MJZ>IS^=L=QKOE7kp8K z)MWZHf{qMaP-{hHZ8!3|ZQq&J1=mb8yv_kL)`v%*^Bn?as>K*&nxHv@6c*Q-hlO%X zTH}x2>+#Z7h}L(}B0Y4K5|_gEi{`+>sFplmERqGu&sJgXsz6&)@Y!U`*_LdtCckV# zs^dA5+g4~rQ%gh37mo#xA91X6{NezAPCHmBpM=MLwRxbc>xve7XA2}5&j_1H+5z;u zsg}^c?Jku<3Q%MU7h5xmUgXD3A+}M)@ zXkOT@uDRtzJ>JPq$&RA_S+j`%mU1ve5oG`FgB7)fSm88xjEx55Kd(B?Un7UECIB5f zs45}3vzNDEaGXhm~@Vubj8 zcSg>|Q7>7yMfJmw{{3D|i?p<7G7p-}0-}o_ciz;NI&@V;+YVvJ zuQ=25_MwT%gtxv&17w)>lP)YMqPX_3T6yE!^@RL)xIIul?Hr$wxqYuE8No@5Zn`cj z@wbw|L5o6L+ehKWfapgSo_ID7zlMg|t9=j!*7+5~mdN)J_nVh6`<{v2eHAqgpDF2f z6mI?yrwra&wL&F1>C|*L)r$r!wUkJse&*HHw_dSu-zP6QK_DjyXYK59mE`COhJ1 zUu+gl)HPw6F}Gk6+odhnq+BICp+)~5H|4D&1ztC|v+-E|wjeeNzg2G^p4U_T9j39V z%CR*!!wpAZZ^=aFpy)!14o_5#_qu=*=i4|#er-PeU5f@g{>8(XVY&ua$urIxiu3A_ z?BLHs&ki{zP5uun5YNoLUt~uVE1_yfF7vDtFGDvQR2pYxuDS=TRc)3|q>6VZ1P@rFjbI-a*z&I19!@VzJ*bwY$ z1%2_?xUsr_`Els6N`sIG`Aosduh5q{GZ}jk*+p{lu+yBF6ohCgGqmqg9V#;RI-t|7u8rP^Z z^6~d$vd*&o!pyLw`qb@{8E`X2;f!xue)?byEe1j=R zI-66d_Kl-$|JC5JyDoTz<-Y6qK@v!Hse@O3Po#buYG0$lutw+6w>TV}S%8Gk;`5W@ zfJ`yPD%g5~RM!6#TkiggYSHrzlrVEFehkE>p}(_XvwlVVk15u>LGh=f-)>@&FwjxZ ze)!bZ1}T6Nvjm5>S`S{U5gdkQP_Qebd3theMl5~olR@hnSESnKyn6;+s5`uW423?y zKe}2?M^B`KfB8C!G6)w06Ne{G1TthO1HxCJWE>#qXSdXrWT<1H=b;LvRipD>2|zH^ z%1Pp9DVZZB72u=rLv<;j7?0wHG8J$Qq5Uc>-k}nIjD5K2v3KnXtQ|;K>Eh6-U3@Gn z^?h~|N4EI!)ml%rs9h;VK(Yzdg|w%wV8m-`1EA3Va;Y%MPiXCT^TLiNHGkT@Zunz6 zM7}^Z1In0rsiokRw@zVuCRsC5NJkr{eCnH$Ezdgkb*P%rPf4BHXYsMwVC{el=5M2Iu89K2RMm{0U3cv=vIPhIXYuj2@%<@RhpB(mtV z&HfI?SyMSS@)MfkpJ8fs+aBOX`ZnH6YCHG{g!3{zuH;<}QP%Lz?v{E$*%;#RlK?_s zg6xP(m4DA&77Kbz)dso}Vd^PzHJ(=X&~2j)3OKd+`?2wp^uaWP-8SZ6Es(3V=l+14 z4wVZSMbG&t92-<4?pyb}?8_GaO~4<7d7fMLP8PCSGvcD?cU*nCqG;-gULK@&%k}l(gN_(GL z;EY#|v<;KSKkKcg@^_cGH6{)NxEU6%!F9d!KT>Q12fvNeh)rt zskMj^^pGP@XlDNflHu^Prb_PVoweY+XrsJFb&%5#9Xw}RCTA@euw0^r(<>icJ3~Mk8ROL4w7P~c0iOvJh_8Sjwjiw4Ezr`87;`fio z+VY@+pfHGG8tQ^xVg_hGksct!vhAdY(8ll{+E!3#_?+Kj_Fxj*mIGO*mh&}0CeUWJK8;NAFK; zdu53VJhtUsooAgJti!iCTvxQ%H)v)WIx`Q2plhv&Z1scAnamqF8Aos;DlezvU*w^it7xj^7y<;Cv!Bg2 zuf7Rf7I#)3YDWbGQ8E-Dtz%d)UQIn~+1OJnqg3Xz76)5Mtc5Pwrb%*GyqjfNey|o|r;N-IsyP4zvQA!j5=}2gz0Lb8prTE=uZN z361MI!6l5CHhjcCYbqW!Cx`2;1|P$Dxvxol;v&YWR(zIPWi;&xs|lcFq<%GXd~;kt zS$@gkcPJdWYmOZuwyj8QQ}W6x5T*UZW9)}Lr98KwrRZH@DK&s+O;7mm;K!1V{*48} zILw3oB=A5=Efn5t#RJW*speBp{a_`ApHPf@Xj|?$_n#SJYH1t4O`FrriT?-`B|)3Q z_FC9xiC#(Kqw*1-FR-)AjoRekX&rt4SekL`Lg#UM69JP({G_$@zDy( z8GH(2$A*GmsJDDuSu-l?H=AKUq&Z9flLu6{Tgz{58Z_0hUT{Y!WM&M=n@)zO2Z}WL zAP9Af_@K0Hfvz&Zea;ocfD=;1&B6<(4kh__;#A6ZIYFIpF$!i$93c#vy32fa3#jvz z!y)8MNe}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 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 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$-|Bk1P?!PDPaL%ZTiIvM*zcBHGCkWzCd*$v!Hy*h(Ul zEo7(cVt#k(^ZovQfBn2(^Kzf_oO{nX_n!B;=RD`Sp@9w~c0U#Xz^JFIc^&{19HIb* z@-Jk+#&ZDnuj^^583!Ws!w6%HA%kX1tnvQ*o|re6sLEvyEnZIk&DXz+Ca5@xB2sVj znL+Q?4l~IeEHeUt02}};0HFUJF0=6fdH@OpKq&y;^cc#+|KX90L?9jVXG8%KiZT~Y zY#*gCLt+D(<}VSBA-#t1Fa7VBvUCK32mpYgs80Z3lmiX803but;ByKIm;s5PT#Dxrd2M;f5(dsT1)mJ!7ASDyD zkvjJ3dLBJU{!90{p{lZ&Gw<#j?w5HR^Zg@UxCa3}SX3r0M{n7!?gSf_!wipC@7&lo zb*22#rKGLJ@ZolP#YY!BMnebz>-WV1SQO4w*bvamZHZNL2c=SPug#xZ4(9K2@rsI* zDgSm~4nsJ12H;!2DdTj?!$J;@bov$853LVWFFbS`s=ldO;xV+Is&`GV&EOxVdK=}P z#;0`o#O{p>*B2QVi4lz(C!P3FAoy}={o-=c?)H@*BjF`qE{+Tgi(*j-4iJn7%tHcy zEmEcXf12rTvj4{WNEg~Uc}3E`&C*cc&TuNR}WGS zK2`l$vg-I@cD8Y@deQb`qtmNui;{f0Y;^#1;~73@8GV(})GVQSC%;52{9@V^v{Y22 zyq$CrF@|T!mr~*68MPN5-%s=yu&H<0HP|&buPUg`y9f+WRHCI8;o5#IbUyAC4zIgyRgWC6o|*1P8|I<_%PbvF zpYpGy3$$Ur{qsBB`{l~c8Ppr_Bb=l>k3vug?i|WxM{G)}%Uw6l5vxOM8nm-a1wDY- zHY@PJ5Hjv^1N?cdpw4gI++N#`E>-GE@i=-6q3_Z$gXCIA$E zPjmnn#ChnN5AHfKhmqI!aqBPM=HNX;)T`WgCG z@`{5rp8ErufC>`~du+ykc6U3#t;xpX>+ISMMI1E{kWu-aA4K)-h0pB0y&!`){d*{g z&`^h-`@JD^(o$t!Nu92o7h5FKL@>Cssncl>!v2te-Zm~TPb zquj+0bNP8$T1f`8RBz5=`t9*E+nEtt-eutdWw@sht#y;HRYUq>(x;g*YcDiqA-)|u zZZ6*5YSX{q$V556CmbjM)KOFtnS;L`9&f)AW7Y})VL10qv#s2Ent53Cu)$V0Ne}Og z+6>WgK0lJNr}dV(VQWaztr~N$2!j8g*J0!@uNF^*#edt+)&~(QRVlV`f9~jpE}o){O3`m+}fuj5n$ z)^f``6#htf{D{ylc~Car=>d#t*`wvl`oCx%$(0*(XaazDetmMH-dd%xW{-PP3X1}c z3}P7HlS@HsDJCVR*~ZjR!Aqp)1x)2b&z|gudwMNEznMHghA^d57E4o!)l0Tk80;_R zcI3Jx40={h%h>bRdw)6-vGrS5qk@11g!8Lz4t$OHdrBlh0ccLXg0hJ%vv)Zk4gf>L z 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 i^H+JuK*ce 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 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 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 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 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 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 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 KfLAJ*hyM>mL72Y) literal 10077 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 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 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 M07*qoM6N<$g7~u-?f?J) literal 11825 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 From 056206098b874118e4f23c0cde341cc172fb269e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 May 2020 12:50:29 +0200 Subject: [PATCH 235/539] 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 236/539] 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 237/539] 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>2sI3Hav#>Ko&K|EL_@nQ_DJAw|*=XHi+X$87)Y*Q{UmW1t@F-vZ^0PEI=Av2Kve?s+C)bc+em;oQ zZmw~bHp^B&OSN>U6uN1iZZX<0Gbl9ZAl2S~H-vW^T@pTxrR5^3upNv%1wz7A3KC+G<1PqT%V95>E4{NP)U57)Tyq~?DJ0t6r zNqK( zmWFKYieF^^l_8GxoW`;3$^bSjd~IxP+03U8>?7g1aN> zuYK!#yxV&|(zNrgWa)BlZ(sf9cRBjbiB%oBSSR4s1@raM30{8XHG0qVuYRf$?_u=1 z!5U)-mEw)J{>rz%|8vG~Os&|BS7%|d!aGIO^ZkIilFvWS7x=+Xf6d=coOBr0>E<72`$33RoERzt zuw&c2-F=e2!r=1%b!>XiTqFoW2Cj|p#*yQsk{-r@!4L!?)5TfFZ`@>Pc$B`vRr;?C z5d6v}EK_ z&AM3F7(-1e5&I@fr*tYos)tLfz*XQXa22=;Tm`;+@-O&YauD64PEh~=002ovPDHLk FV1ilTO6ULp literal 794 zcmV+#1LgdQP)z97{|9-ZAf(cg#EH9djnJmAP?lE1~ zwXvC{*`;+Hs0w#S8@RRz^%~u?sp8p-i;vSUhGi(9z2wH3XKijerdKn#9=;imWpe{s=vW zb`nD)3{^#Wt^DBiIPyDM3cSYmZ2<}ihKG}#z{feWxJC<(L9*J%Av&W3uHbL(h>oc5 zmO}50qH1ka1&z3WZ|dxWRQP<}$WBONf!F@4F>L88phkPN2p0Oekv{{UVrL%FT3i=7rQuI0t z8Z%52I{yVtv89d$J}!9W)JR!W6>Y@61f#50P5?GIhLRZGwFx4)S_188Au)}(c;dwq z`{?N*qjY*f6|}>EW28%hdEC;;ecCqkCm4~b1xR9@7p};+cWXhf)&e~}eHvcg-H6E| z0AqDLvTNhst%c+xo-VewmKH=6ZbW86Ba9}twlEV1co22jeK8zQOjyIN3t`9@uI0Ys z3q&nSs_J)L3@13u^~cBww_xWL Date: Mon, 25 May 2020 13:36:56 +0200 Subject: [PATCH 238/539] Restore missing png file --- 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 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 L`rV>CkKg Date: Mon, 25 May 2020 14:08:36 +0200 Subject: [PATCH 239/539] 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 248/539] 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 249/539] 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 250/539] 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".' + - + global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print '
'.$langs->trans('TerminalSelect').'
'; ?> @@ -300,19 +363,19 @@ function CheckPlease(){ print ''; print ''; } - else{ - print ''; - print ''; - print ''; + else { + print ''; + print ''; + print ''; } ?> -
-
-
-
+
+
+
+
Date: Tue, 26 May 2020 23:03:47 +0200 Subject: [PATCH 270/539] Update invoice.php for Auto Order --- htdocs/takepos/invoice.php | 45 ++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3d6cec96319..07006eb5cd1 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 ' - - '; } /** @@ -863,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) print $langs->trans('Place')." ".$label." - "; print $langs->trans('Floor')." ".$floor." - "; } + elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name; + elseif ($mobilepage == "cats") print $langs->trans('Category'); + elseif ($mobilepage == "products") print $langs->trans('Label'); } // In phone version only show when is invoice page if ($mobilepage == "invoice" || $mobilepage == "") { @@ -877,6 +882,7 @@ if ($_SESSION["basiclayout"] != 1) print '
'; print ''; } +elseif ($mobilepage == "invoice") print ''; print "\n"; @@ -889,12 +895,14 @@ if ($_SESSION["basiclayout"] == 1) $categories = $categorie->get_full_arbo('product'); $htmlforlines = ''; foreach ($categories as $row) { - $htmlforlines .= ''; - $htmlforlines .= ''; - $htmlforlines .= ''."\n"; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= ''."\n"; + else $htmlforlines .= ''."\n"; } $htmlforlines .= '
'.$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 240/539] 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 241/539] 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 243/539] 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 244/539] 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 245/539] 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 246/539] 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 247/539] 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) : '').''.$langs->trans('Qty').''.$langs->trans('TotalTTCShort').''.$langs->trans('Qty').'
'; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '
'; + else $htmlforlines .= '
'; $htmlforlines .= $row['label']; - $htmlforlines .= '
'; $htmlforlines .= '
'; @@ -910,12 +918,20 @@ if ($_SESSION["basiclayout"] == 1) $prods = $object->getObjectsInCateg("product"); $htmlforlines = ''; foreach ($prods as $row) { - $htmlforlines .= 'id.')">'; - $htmlforlines .= ''; - $htmlforlines .= $row->label; - $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; - $htmlforlines .= ''."\n"; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + $htmlforlines .= '
'; + $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency); + $htmlforlines .= ''."\n"; + } + else { + $htmlforlines .= ''; + $htmlforlines .= $row->label; + $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; + $htmlforlines .= ''."\n"; + } } $htmlforlines .= ''; print $htmlforlines; @@ -991,7 +1007,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 +1042,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); From e02aa4e41b3a5c74fc0e5d60699bae5354e51229 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 May 2020 23:22:14 +0200 Subject: [PATCH 271/539] FIX Default bank account was not loaded for document generation. --- htdocs/core/class/commondocgenerator.class.php | 4 ++-- htdocs/societe/class/societe.class.php | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 56910b43e4a..4a8e097fd6d 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -212,8 +212,8 @@ abstract class CommonDocGenerator 'company_idprof6'=>$object->idprof6, 'company_note_public'=>$object->note_public, 'company_note_private'=>$object->note_private, - 'company_default_bank_iban'=>$object->bank_account->iban, - 'company_default_bank_bic'=>$object->bank_account->bic + 'company_default_bank_iban'=>(is_object($object->bank_account) ? $object->bank_account->iban : ''), + 'company_default_bank_bic'=>(is_object($object->bank_account) ? $object->bank_account->bic : '') ); // Retrieve extrafields diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9cc36dbb7b4..67bdbf5142c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -636,6 +636,12 @@ class Societe extends CommonObject */ public $multicurrency_code; + /** + * @var Account Default BAN account + */ + public $bank_account; + + /** * Constructor * @@ -4155,6 +4161,17 @@ class Societe extends CommonObject } } + if (! isset($this->bank_account)) { + require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; + $bac = new CompanyBankAccount($this->db); + $result = $bac->fetch(0, $this->id); + if ($result > 0) { + $this->bank_account = $bac; + } else { + $this->bank_account = ''; + } + } + $modelpath = "core/modules/societe/doc/"; $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); From c0ce584487af128fde4e862dc8357f4d5e26ef8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 00:26:04 +0200 Subject: [PATCH 272/539] Look and feel v12 --- htdocs/core/lib/company.lib.php | 5 ++++- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/societe/consumption.php | 15 +++++++++------ htdocs/societe/paymentmodes.php | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4b0a2d5b131..ec8e91f5419 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -802,7 +802,10 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel print ''; // Ref - print '
'.img_object($langs->trans("ShowProject"), ($obj->public ? 'projectpub' : 'project'))." ".$obj->ref.''; + print ''; + print $projecttmp->getNomUrl(1); + print ''; + // Label print ''.$obj->title.''; // Date start diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d08522bfaa4..2d8996523fe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3167,7 +3167,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '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', 'vcard', 'wrench', + 'setup', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic', @@ -3181,7 +3181,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) { $fa = 'far'; } - if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp'))) { + if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'stripe-s', 'youtube', 'google-plus-g', 'whatsapp'))) { $fa = 'fab'; } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index ad7383d81af..0ce28356d90 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist'; + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) $socid = $user->socid; @@ -147,6 +149,7 @@ if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeA if ($object->fournisseur) { + $langs->load("supplier_proposal"); print ''; print $langs->trans('SupplierCode').''; print $object->code_fournisseur; @@ -352,14 +355,14 @@ if ($sql_select) $num = $db->num_rows($resql); - $param = "&socid=".$socid."&type_element=".$type_element; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; + $param = "&socid=".urlencode($socid)."&type_element=".urlencode($type_element); + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($sprod_fulldescr) $param .= "&sprod_fulldescr=".urlencode($sprod_fulldescr); if ($sref) $param .= "&sref=".urlencode($sref); - if ($month) $param .= "&month=".$month; - if ($year) $param .= "&year=".$year; - if ($optioncss != '') $param .= '&optioncss='.$optioncss; + if ($month) $param .= "&month=".urlencode($month); + if ($year) $param .= "&year=".urlencode($year); + if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, '', 0, '', '', $limit); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6385346ce5d..e0636932cc2 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -963,7 +963,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' { $morehtmlright .= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=createcard'); } - print load_fiche_titre($langs->trans('StripePaymentModes').($stripeacc ? ' (Stripe connection with StripeConnect account '.$stripeacc.')' : ' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, ''); + print load_fiche_titre($langs->trans('StripePaymentModes').($stripeacc ? ' (Stripe connection with StripeConnect account '.$stripeacc.')' : ' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, 'stripe-s'); $listofsources = array(); if (is_object($stripe)) From e308170ed8ad0766300f1ddb15751aa34a801a72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 02:38:12 +0200 Subject: [PATCH 273/539] 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 9f2e022825c..bdd9e6a55c5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1966,6 +1966,9 @@ div.mainmenu { margin-left: 0px; min-width: 40px; } +a.tmenuimage:focus, .mainmenu.topmenuimage:focus { + outline: none; +} /* For mainmenu, we always load the img */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c58700dc007..1e760404c8d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2001,6 +2001,9 @@ div.mainmenu { margin-left: 0px; min-width: 40px; } +a.tmenuimage:focus, .mainmenu.topmenuimage:focus { + outline: none; +} /* Do not load menu img if hidden to save bandwidth */ From d3e21c82f2cd3cbf6f2e51d54a2b97321cc869e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 02:38:12 +0200 Subject: [PATCH 274/539] 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 4eaa193e682..3f6d999104e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1963,6 +1963,9 @@ div.mainmenu { margin-left: 0px; min-width: 40px; } +a.tmenuimage:focus, .mainmenu.topmenuimage:focus { + outline: none; +} /* For mainmenu, we always load the img */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f1e2c9257e6..b9fe51ca252 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2005,6 +2005,9 @@ div.mainmenu { margin-left: 0px; min-width: 40px; } +a.tmenuimage:focus, .mainmenu.topmenuimage:focus { + outline: none; +} /* Do not load menu img if hidden to save bandwidth */ From 3f4ae8875fdae9895cbcdb73fbdc574518275a62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 02:45:09 +0200 Subject: [PATCH 275/539] Fix bad tooltip --- htdocs/asset/class/asset.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 7c9d91d79e7..21cd3b6393e 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -82,7 +82,7 @@ class Asset extends CommonObject 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1), 'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",), 'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",), - 'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",), + 'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1), 'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,), From 479e8ceceb300ce212f963fdf4bf0ab8320a92fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 03:19:37 +0200 Subject: [PATCH 276/539] Look and feel v12 --- htdocs/opensurvey/card.php | 2 +- htdocs/opensurvey/css/style.css | 2 +- htdocs/opensurvey/results.php | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 32dde7ddb3e..56aabc24721 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -214,7 +214,7 @@ print ''; $head = opensurvey_prepare_head($object); -dol_fiche_head($head, 'general', $langs->trans("Survey"), -1, DOL_URL_ROOT.'/opensurvey/img/object_opensurvey.png', 1); +dol_fiche_head($head, 'general', $langs->trans("Survey"), -1, 'poll'); $morehtmlref = ''; diff --git a/htdocs/opensurvey/css/style.css b/htdocs/opensurvey/css/style.css index e6b84f5fde5..d9cf48c72ee 100644 --- a/htdocs/opensurvey/css/style.css +++ b/htdocs/opensurvey/css/style.css @@ -367,8 +367,8 @@ div.cadre td.vide { /*Case de tableau contenant les noms dans affichage de sondage*/ div.cadre td.nom { background-color: #DDDDDD; - font-size:12px; text-align:center; + padding: 8px; } div.cadre td.casevide { background-color: white; diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 337ccb3e435..181ec830433 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -421,10 +421,11 @@ $toutsujet = str_replace("°", "'", $toutsujet); print ''."\n"; +print ''; $head = opensurvey_prepare_head($object); -dol_fiche_head($head, 'preview', $langs->trans("Survey"), -1, DOL_URL_ROOT.'/opensurvey/img/object_opensurvey.png', 1); +dol_fiche_head($head, 'preview', $langs->trans("Survey"), -1, 'poll'); $morehtmlref = ''; @@ -519,6 +520,7 @@ if (GETPOST('ajoutsujet')) if (!$user->rights->opensurvey->write) accessforbidden(); print ''."\n"; + print ''; print ''; print '
'."\n"; @@ -605,6 +607,7 @@ if ($user->rights->opensurvey->write) { $nbcolonnes = substr_count($object->sujet, ',') + 1; print ''."\n"; +print ''; print '
'."\n"; @@ -766,7 +769,7 @@ else print ''.dol_htmlentities($tmp[0]).''."\n"; } - print ''.img_picto('', dol_buildpath('/opensurvey/img/add-16.png', 1), '', 1).''."\n"; + print ''."\n"; print ''."\n"; } From abf7fce10873bb24108dbc3cff0c4ed23bf86a8b Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:44:00 +0200 Subject: [PATCH 277/539] Update auto_order.php --- htdocs/takepos/public/auto_order.php | 1 + 1 file changed, 1 insertion(+) 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'; From 7d323f43793016f2dc0f4b107413ff5ecc6f3262 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:48:40 +0200 Subject: [PATCH 278/539] Update index.php --- htdocs/takepos/genimg/index.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index a5686054193..2559d5f5b29 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'); @@ -60,7 +60,7 @@ if ($query == "cat") { $filename = $obj['photo']; } - $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); + $file = DOL_URL_ROOT.'/viewimage.php?cache=1&publictakepos=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); header('Location: '.$file); exit; } @@ -72,12 +72,20 @@ 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'); + if ($file == "") { + header('Location: ../../public/theme/common/nophoto.png'); + } else { + if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + header('Location: '.$file.'&cache=1'); + } else { + header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); + } + } +} else header('Location: '.$file.'&cache=1'); } else { From 896e3166b75a8b7b30178db02ef2903f2a1196be Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:49:37 +0200 Subject: [PATCH 279/539] Update phone.css --- htdocs/takepos/css/phone.css | 96 ++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/css/phone.css b/htdocs/takepos/css/phone.css index 0f3606071f0..bdfdf45e116 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; +} From 8891595993a4ccf1fcb5334db0ada54af776cd2f Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 06:57:12 +0200 Subject: [PATCH 280/539] Fix travis --- 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 88ab8ef5227..0e49eff4ed5 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -130,7 +130,7 @@ elseif ($action == "checkplease") { print ''; } } -else { +} else { // Title $title = 'TakePOS - Dolibarr '.DOL_VERSION; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE; From 3b884c40513677a2280b779bd54ede87ace43a16 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 27 May 2020 07:03:57 +0200 Subject: [PATCH 281/539] Fix travis --- htdocs/takepos/genimg/index.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index 2559d5f5b29..ea863374f3c 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -85,10 +85,7 @@ elseif ($query == "pro") header('Location: '.$file.'&cache=1&publictakepos=1&modulepart=product'); } } -} else header('Location: '.$file.'&cache=1'); -} -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 From 0b48ffe3cd127e503c3493bc084d75af82bbbbb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 11:38:28 +0200 Subject: [PATCH 282/539] Removed not used var $useglobalvars --- htdocs/core/ajax/ajaxdirpreview.php | 2 +- htdocs/core/class/html.form.class.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index bb6a8de30d4..83227b00e51 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -355,7 +355,7 @@ if ($useajax || $action == 'delete') $section_id = $section; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - $useglobalvars = 1; + $form = new Form($db); $formquestion['urlfile'] = array('type'=>'hidden', 'value'=>$urlfile, 'name'=>'urlfile'); // We must always put field, even if empty because it is filled by javascript later $formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); // We must always put field, even if empty because it is filled by javascript later diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f2b11938ca2..30519077c9e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4207,7 +4207,6 @@ class Form public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0) { global $langs, $conf; - global $useglobalvars; $more = ''; $formconfirm = ''; @@ -4355,7 +4354,7 @@ class Form if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko, $input['name']); } } - // Show JQuery confirm box. Note that global var $useglobalvars is used inside this template + // Show JQuery confirm box. $formconfirm .= ''; print '
'; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 80518c3401a..a9cff9391d0 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -130,6 +130,10 @@ TicketNumberingModules=Tickets numbering module TicketNotifyTiersAtCreation=Notify third party at creation TicketGroup=Group TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface +TicketsPublicNotificationNewMessage=Send email(s) when a new message is added +TicketsPublicNotificationNewMessageHelp=Send email(s) when a new message is added from public interface (to assigned user or the notifications email to (update) and/or the notifications email to) +TicketPublicNotificationNewMessageDefaultEmail=Notifications email to (update) +TicketPublicNotificationNewMessageDefaultEmailHelp=Send email new message notifications to this address if the ticket don't have a user assigned or the user don't have a email. # # Index & list page # diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index cf077e518c4..370fdaa1c21 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -130,6 +130,10 @@ TicketNumberingModules=Module de numérotation des tickets TicketNotifyTiersAtCreation=Notifier le tiers à la création TicketGroup=Groupe TicketsDisableCustomerEmail=Toujours désactiver les courriels lorsqu'un ticket est créé depuis l'interface publique +TicketsPublicNotificationNewMessage=Envoi d'e-mails lorsqu'un nouveau message est ajouté +TicketsPublicNotificationNewMessageHelp=Envoi d'e-mails lorsqu'un nouveau message est ajouté depuis l'interface public (à l'utilisateur assigné ou à l'e-mail de notification à (nouveaux message) et/ou l'e-mail de notification à) +TicketPublicNotificationNewMessageDefaultEmail=E-mail de notification à (nouveaux message) +TicketPublicNotificationNewMessageDefaultEmailHelp=Envoyer des notifications de nouveaux message par e-mail à cette adresse si aucun utilisateur n'a été affecté au ticket ou qu'il n'a pas d'e-mail. # # Index & list page # diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 2b9ab94c5b1..ee8865170af 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -171,7 +171,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message')) { // TODO Add message... - $ret = $object->dao->newMessage($user, $action, 0); + $ret = $object->dao->newMessage($user, $action, 0, 1); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 0396779f214..ca9178d798d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2391,14 +2391,15 @@ class Ticket extends CommonObject /** - * Add new message on a ticket (private area). Can also send it be email if GETPOST('send_email', 'int') is set. + * Add new message on a ticket (private/public area). Can also send it be email if GETPOST('send_email', 'int') is set. * * @param User $user User for action * @param string $action Action string * @param int $private 1=Message is private. TODO Implement this. What does this means ? + * @param int $public_area 1=Is the public area * @return int */ - public function newMessage($user, &$action, $private = 1) + public function newMessage($user, &$action, $private = 1, $public_area = 0) { global $mysoc, $conf, $langs; @@ -2451,142 +2452,215 @@ class Ticket extends CommonObject //var_dump($_SESSION); var_dump($listofpaths);exit; /* - * Send emails to internal users (linked contacts) - */ - if ($send_email > 0) { - // Retrieve internal contact datas - $internal_contacts = $object->getInfosTicketInternalContact(); - - $sendto = array(); - if (is_array($internal_contacts) && count($internal_contacts) > 0) { - // altairis: set default subject - $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - $subject = GETPOST('subject', 'nohtml') ? GETPOST('subject', 'nohtml') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); - - $message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id); - $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; - - $message = $langs->trans('TicketMessageMailIntroText'); - $message .= "\n\n"; - $message .= GETPOST('message', 'restricthtml'); - - // Coordonnées client - $message .= "\n\n"; - $message .= "==============================================\n"; - $message .= !empty($object->thirdparty->name) ? $langs->trans('Thirdparty')." : ".$object->thirdparty->name : ''; - $message .= !empty($object->thirdparty->town) ? "\n".$langs->trans('Town')." : ".$object->thirdparty->town : ''; - $message .= !empty($object->thirdparty->phone) ? "\n".$langs->trans('Phone')." : ".$object->thirdparty->phone : ''; - - // Build array to display recipient list - foreach ($internal_contacts as $key => $info_sendto) { - // altairis: avoid duplicate notifications - if ($info_sendto['id'] == $user->id) { - continue; - } - - if ($info_sendto['email'] != '') { - if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">"; - - //Contact type - $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')'; - $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient."\n" : ''); + * Public area + */ + if (!empty($public_area)) { + /* + * Send emails to assigned users (public area notification) + */ + if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) { + $assigned_user_dont_have_email = ''; + $sendto = array(); + if ($this->fk_user_assign > 0) { + $assigned_user = new User($this->db); + $assigned_user->fetch($this->fk_user_assign); + if (!empty($assigned_user->email)) { + $sendto[] = $assigned_user->getFullName($langs) . " <" . $assigned_user->email . ">"; + } else { + $assigned_user_dont_have_email = $assigned_user->getFullName($langs); + } + } + if (empty($sendto)) { + if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL)) { + $sendto[] = $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL; + } elseif (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) { + $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; } } - $message .= "\n"; - // URL ticket - $url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id; - - // altairis: make html link on url - $message .= "\n".$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$object->track_id.''."\n"; // Add global email address recipient - if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) { - if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; + if (!empty($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS) && + !empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto) + ) { + $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; } - // altairis: dont try to send email if no recipient if (!empty($sendto)) { + $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; + $subject = '[' . $label_title . '- ticket #' . $object->track_id . '] ' . $langs->trans('TicketNewMessage'); + + // Message send + $message = $langs->trans('TicketMessageMailIntroText'); + $message .= "\n\n"; + $message .= GETPOST('message', 'restricthtml'); + + // Customer company infos + $message .= "\n\n"; + $message .= "=============================================="; + $message .= !empty($object->thirdparty->name) ? "\n" . $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : ''; + $message .= !empty($object->thirdparty->town) ? "\n" . $langs->trans('Town') . " : " . $object->thirdparty->town : ''; + $message .= !empty($object->thirdparty->phone) ? "\n" . $langs->trans('Phone') . " : " . $object->thirdparty->phone : ''; + + // Email send to + $message .= "\n\n"; + if (!empty($assigned_user_dont_have_email)) { + $message .= "\n" . $langs->trans('NoEMail') . ' : ' . $assigned_user_dont_have_email; + } + foreach ($sendto as $val) { + $message .= "\n" . $langs->trans('TicketNotificationRecipient') . ' : ' . $val; + } + + // URL ticket + $url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id; + $message .= "\n\n"; + $message .= $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '' . $object->track_id . ''; + $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); } } - + } + /* + * Private area + */ + else { /* - * Send emails for externals users if not private (linked contacts) - */ - if (empty($object->private)) { - // Retrieve email of all contacts (external) - $external_contacts = $object->getInfosTicketExternalContact(); - - // If no contact, get email from thirdparty - if (is_array($external_contacts) && count($external_contacts) === 0) { - if (!empty($object->fk_soc)) { - $object->fetch_thirdparty($object->fk_soc); - $array_company = array(array('firstname' => '', 'lastname' => $object->thirdparty->name, 'email' => $object->thirdparty->email, 'libelle' => $langs->transnoentities('Customer'), 'socid' => $object->thirdparty->id)); - $external_contacts = array_merge($external_contacts, $array_company); - } elseif (empty($object->fk_soc) && !empty($object->origin_email)) { - $array_external = array(array('firstname' => '', 'lastname' => $object->origin_email, 'email' => $object->thirdparty->email, 'libelle' => $langs->transnoentities('Customer'), 'socid' => $object->thirdparty->id)); - $external_contacts = array_merge($external_contacts, $array_external); - } - } + * Send emails to internal users (linked contacts) + */ + if ($send_email > 0) { + // Retrieve internal contact datas + $internal_contacts = $object->getInfosTicketInternalContact(); $sendto = array(); - if (is_array($external_contacts) && count($external_contacts) > 0) { - // altairis: get default subject for email to external contacts + if (is_array($internal_contacts) && count($internal_contacts) > 0) { + // altairis: set default subject $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - $subject = GETPOST('subject') ? GETPOST('subject') : '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); + $subject = GETPOST('subject', 'nohtml') ? GETPOST('subject', 'nohtml') : '[' . $label_title . '- ticket #' . $object->track_id . '] ' . $langs->trans('TicketNewMessage'); - $message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKET_MESSAGE_MAIL_INTRO; + $message_intro = $langs->trans('TicketNotificationEmailBody', "#" . $object->id); $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; - // We put intro after - $message = GETPOST('message'); + $message = $langs->trans('TicketMessageMailIntroText'); $message .= "\n\n"; + $message .= GETPOST('message', 'restricthtml'); - foreach ($external_contacts as $key => $info_sendto) { - // altairis: avoid duplicate emails to external contacts - if ($info_sendto['id'] == $user->contactid) { + // Coordonnées client + $message .= "\n\n"; + $message .= "==============================================\n"; + $message .= !empty($object->thirdparty->name) ? $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : ''; + $message .= !empty($object->thirdparty->town) ? "\n" . $langs->trans('Town') . " : " . $object->thirdparty->town : ''; + $message .= !empty($object->thirdparty->phone) ? "\n" . $langs->trans('Phone') . " : " . $object->thirdparty->phone : ''; + + // Build array to display recipient list + foreach ($internal_contacts as $key => $info_sendto) { + // altairis: avoid duplicate notifications + if ($info_sendto['id'] == $user->id) { continue; } - if ($info_sendto['email'] != '' && $info_sendto['email'] != $object->origin_email) { - if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">"; + if ($info_sendto['email'] != '') { + if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . ">"; - $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')'; - $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient."\n" : ''); + //Contact type + $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')'; + $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : ''); } } + $message .= "\n"; + // URL ticket + $url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id; - // If public interface is not enable, use link to internal page into mail - $url_public_ticket = (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? - (!empty($conf->global->TICKET_URL_PUBLIC_INTERFACE) ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id; - $message .= "\n".$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$object->track_id.''."\n"; + // altairis: make html link on url + $message .= "\n" . $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . $object->track_id . '' . "\n"; - // Build final message - $message = $message_intro.$message; - - // Add signature - $message .= '
'.$message_signature; - - if (!empty($object->origin_email)) { - $sendto[] = $object->origin_email; - } - - if ($object->fk_soc > 0 && !in_array($object->origin_email, $sendto)) { - $object->socid = $object->fk_soc; - $object->fetch_thirdparty(); - if (!empty($object->thirdparty->email)) $sendto[] = $object->thirdparty->email; - } - - // altairis: Add global email address reciepient + // Add global email address recipient if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) { if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; } - // altairis: dont try to send email when no recipient + // altairis: dont try to send email if no recipient if (!empty($sendto)) { $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); } } + + /* + * Send emails for externals users if not private (linked contacts) + */ + if (empty($object->private)) { + // Retrieve email of all contacts (external) + $external_contacts = $object->getInfosTicketExternalContact(); + + // If no contact, get email from thirdparty + if (is_array($external_contacts) && count($external_contacts) === 0) { + if (!empty($object->fk_soc)) { + $object->fetch_thirdparty($object->fk_soc); + $array_company = array(array('firstname' => '', 'lastname' => $object->thirdparty->name, 'email' => $object->thirdparty->email, 'libelle' => $langs->transnoentities('Customer'), 'socid' => $object->thirdparty->id)); + $external_contacts = array_merge($external_contacts, $array_company); + } elseif (empty($object->fk_soc) && !empty($object->origin_email)) { + $array_external = array(array('firstname' => '', 'lastname' => $object->origin_email, 'email' => $object->thirdparty->email, 'libelle' => $langs->transnoentities('Customer'), 'socid' => $object->thirdparty->id)); + $external_contacts = array_merge($external_contacts, $array_external); + } + } + + $sendto = array(); + if (is_array($external_contacts) && count($external_contacts) > 0) { + // altairis: get default subject for email to external contacts + $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; + $subject = GETPOST('subject') ? GETPOST('subject') : '[' . $label_title . '- ticket #' . $object->track_id . '] ' . $langs->trans('TicketNewMessage'); + + $message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKET_MESSAGE_MAIL_INTRO; + $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE; + + // We put intro after + $message = GETPOST('message'); + $message .= "\n\n"; + + foreach ($external_contacts as $key => $info_sendto) { + // altairis: avoid duplicate emails to external contacts + if ($info_sendto['id'] == $user->contactid) { + continue; + } + + if ($info_sendto['email'] != '' && $info_sendto['email'] != $object->origin_email) { + if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . ">"; + + $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')'; + $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : ''); + } + } + + // If public interface is not enable, use link to internal page into mail + $url_public_ticket = (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? + (!empty($conf->global->TICKET_URL_PUBLIC_INTERFACE) ? $conf->global->TICKET_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)) . '?track_id=' . $object->track_id; + $message .= "\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $object->track_id . '' . "\n"; + + // Build final message + $message = $message_intro . $message; + + // Add signature + $message .= '
' . $message_signature; + + if (!empty($object->origin_email)) { + $sendto[] = $object->origin_email; + } + + if ($object->fk_soc > 0 && !in_array($object->origin_email, $sendto)) { + $object->socid = $object->fk_soc; + $object->fetch_thirdparty(); + if (!empty($object->thirdparty->email)) $sendto[] = $object->thirdparty->email; + } + + // altairis: Add global email address reciepient + if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) { + if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) $sendto[] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; + } + + // altairis: dont try to send email when no recipient + if (!empty($sendto)) { + $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); + } + } + } } } From 54a68d888e2f879e4b41df41b68df09ba01b606b Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 27 May 2020 11:45:04 +0200 Subject: [PATCH 284/539] Correction Stickler CI --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index ca9178d798d..66d15408d1b 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2513,7 +2513,7 @@ class Ticket extends CommonObject // URL ticket $url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id; $message .= "\n\n"; - $message .= $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '' . $object->track_id . ''; + $message .= $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . $object->track_id . ''; $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); } From 954c29786e7102c7cf3bf771e42d00d5eb81933d Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 27 May 2020 12:15:42 +0200 Subject: [PATCH 285/539] FIX 10.0 - pagination in prelevement/bons.php --- htdocs/compta/prelevement/bons.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 27654de1ad0..b5610b81f68 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -36,7 +36,10 @@ $socid = GETPOST('socid', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +$urladd = ''; $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +if ($limit != $conf->liste_limit) $urladd .= '&limit=' . $limit; + $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); @@ -102,7 +105,7 @@ if ($result) $num = $db->num_rows($result); $i = 0; - $urladd= "&statut=".$statut; + $urladd .= "&statut=" . $statut; $selectedfields=''; From a207365bd2f3373405e04ebd292b29529d3b4217 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 13:12:18 +0200 Subject: [PATCH 286/539] FIX XSS using the renaming of .noexe files - reported by Nolan. --- htdocs/core/class/html.formfile.class.php | 3 +- htdocs/core/lib/files.lib.php | 27 +++++++++-------- htdocs/core/tpl/filemanager.tpl.php | 4 +-- htdocs/ecm/class/ecmfiles.class.php | 36 ++++++++++++----------- htdocs/ecm/file_card.php | 26 ++++++++++++---- htdocs/ecm/index.php | 6 ++-- htdocs/langs/en_US/errors.lang | 1 + 7 files changed, 63 insertions(+), 40 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index ec9dff5f1a3..97a4bdf1948 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1269,7 +1269,8 @@ class FormFile } else { - print dol_trunc($file['name'], 200); + $filenametoshow = preg_replace('/\.noexe$/', '', $file['name']); + print dol_trunc($filenametoshow, 200); print ''; } // Preview link diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 41d7bf1b294..6614b22e5ed 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -870,7 +870,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te { $rel_filetorenamebefore = preg_replace('/^[\\/]/', '', $rel_filetorenamebefore); $rel_filetorenameafter = preg_replace('/^[\\/]/', '', $rel_filetorenameafter); - //var_dump($rel_filetorenamebefore.' - '.$rel_filetorenameafter); + //var_dump($rel_filetorenamebefore.' - '.$rel_filetorenameafter);exit; dol_syslog("Try to rename also entries in database for full relative path before = ".$rel_filetorenamebefore." after = ".$rel_filetorenameafter, LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; @@ -893,6 +893,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te $ecmfile->filepath = $rel_dir; $ecmfile->filename = $filename; + $resultecm = $ecmfile->update($user); } elseif ($resultecm == 0) // If no entry were found for src files, create/update target file @@ -995,7 +996,7 @@ function dolCheckVirus($src_file) * @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error']) * @param int $nohook Disable all hooks * @param string $varfiles _FILES var name - * @return int|string >0 if OK, <0 or string if KO + * @return int|string 1 if OK, 2 if OK and .noexe appended, <0 or string if KO * @see dol_move() */ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile') @@ -1005,6 +1006,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable $reshook = 0; $file_name = $dest_file; + $successcode = 1; if (empty($nohook)) { @@ -1055,6 +1057,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (isAFileWithExecutableContent($dest_file) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED)) { $file_name .= '.noexe'; + $successcode = 2; } // Security: @@ -1109,7 +1112,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable { if (!empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - return 1; // Success + return $successcode; // Success } else { @@ -1118,7 +1121,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable } } - return 1; // Success + return $successcode; // Success } /** @@ -1173,8 +1176,6 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, } else { - $error = 0; - //print "x".$file." ".$disableglob;exit; $file_osencoded = dol_osencode($file); // New filename encoded in OS filesystem encoding charset if (empty($disableglob) && !empty($file_osencoded)) @@ -1197,10 +1198,11 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, $rel_filetodelete = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filename); if (!preg_match('/(\/temp\/|\/thumbs\/|\.meta$)/', $rel_filetodelete)) // If not a tmp file { - $rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete); - if (is_object($db) && $indexdatabase) // $db may not be defined when lib is in a context with define('NOREQUIREDB',1) { + $rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete); + $rel_filetodelete = preg_replace('/\.noexe$/', '', $rel_filetodelete); + dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($db); @@ -1564,6 +1566,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess $destfile = dol_string_nohtmltag($destfile); $destfull = dol_string_nohtmltag($destfull); + // Move file from temp directory to final directory. A .noexe may also be appended on file name. $resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles); if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists' @@ -1600,10 +1603,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess // Update table of files if ($donotupdatesession == 1) { - $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0); + $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', 0); if ($result < 0) { - setEventMessages('FailedToAddFileIntoDatabaseIndex', '', 'warnings'); + setEventMessages('WarningFailedToAddFileIntoDatabaseIndex', '', 'warnings'); } } @@ -1714,7 +1717,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef * See also commonGenerateDocument that also add/update database index when a file is generated. * * @param string $dir Directory name (full real path without ending /) - * @param string $file File name + * @param string $file File name (May end with '.noexe') * @param string $fullpathorig Full path of origin for file (can be '') * @param string $mode How file was created ('uploaded', 'generated', ...) * @param int $setsharekey Set also the share key @@ -1730,7 +1733,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo if (!preg_match('/[\\/]temp[\\/]|[\\/]thumbs|\.meta$/', $rel_dir)) // If not a tmp dir { - $filename = basename($file); + $filename = basename(preg_replace('/\.noexe$/', '', $file)); $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 3a3395432de..f95286bbcfc 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -178,7 +178,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg print ''; } - else // Show filtree when ajax is disabled (rare) + else // Show file tree when ajax is disabled (rare) { print ''; @@ -212,7 +212,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
entity = trim($this->entity); } if (isset($this->filename)) { - $this->filename = trim($this->filename); + $this->filename = preg_replace('/\.noexe$/', '', trim($this->filename)); } if (isset($this->filepath)) { $this->filepath = trim($this->filepath); @@ -346,12 +346,13 @@ class EcmFiles extends CommonObject $sql .= " t.src_object_id"; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql.= ' WHERE 1 = 1'; - /* Fetching this table depends on filepath+filename, it must not depends on entity + /* Fetching this table depends on filepath+filename, it must not depends on entity because filesystem on disk does not know what is Dolibarr entities if (! empty($conf->multicompany->enabled)) { $sql .= " AND entity IN (" . getEntity('ecmfiles') . ")"; }*/ if ($relativepath) { - $sql .= " AND t.filepath = '" . $this->db->escape(dirname($relativepath)) . "' AND t.filename = '".$this->db->escape(basename($relativepath))."'"; + $relativepathwithnoexe = preg_replace('/\.noexe$/', '', $relativepath); // We must never have the .noexe into the database + $sql .= " AND t.filepath = '" . $this->db->escape(dirname($relativepath)) . "' AND t.filename = '".$this->db->escape(basename($relativepathwithnoexe))."'"; $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index } elseif (! empty($ref)) { // hash of file path @@ -552,46 +553,47 @@ class EcmFiles extends CommonObject // Clean parameters if (isset($this->ref)) { - $this->ref = trim($this->ref); + $this->ref = trim($this->ref); } if (isset($this->label)) { - $this->label = trim($this->label); + $this->label = trim($this->label); } if (isset($this->share)) { - $this->share = trim($this->share); + $this->share = trim($this->share); } if (isset($this->entity)) { - $this->entity = trim($this->entity); + $this->entity = trim($this->entity); } if (isset($this->filename)) { - $this->filename = trim($this->filename); + $this->filename = preg_replace('/\.noexe$/', '', trim($this->filename)); } if (isset($this->filepath)) { - $this->filepath = trim($this->filepath); + $this->filepath = trim($this->filepath); + $this->filepath = preg_replace('/[\\/]+$/', '', $this->filepath); // Remove last / } if (isset($this->fullpath_orig)) { - $this->fullpath_orig = trim($this->fullpath_orig); + $this->fullpath_orig = trim($this->fullpath_orig); } if (isset($this->description)) { - $this->description = trim($this->description); + $this->description = trim($this->description); } if (isset($this->keywords)) { - $this->keywords = trim($this->keywords); + $this->keywords = trim($this->keywords); } if (isset($this->cover)) { - $this->cover = trim($this->cover); + $this->cover = trim($this->cover); } if (isset($this->gen_or_uploaded)) { - $this->gen_or_uploaded = trim($this->gen_or_uploaded); + $this->gen_or_uploaded = trim($this->gen_or_uploaded); } if (isset($this->extraparams)) { - $this->extraparams = trim($this->extraparams); + $this->extraparams = trim($this->extraparams); } if (isset($this->fk_user_m)) { - $this->fk_user_m = trim($this->fk_user_m); + $this->fk_user_m = trim($this->fk_user_m); } if (isset($this->acl)) { - $this->acl = trim($this->acl); + $this->acl = trim($this->acl); } if (isset($this->src_object_type)) { $this->src_object_type = trim($this->src_object_type); diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 3664a2e7f28..e1796068370 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -139,6 +139,12 @@ if ($action == 'update') $oldfile = $olddir.$oldlabel; $newfile = $newdir.$newlabel; + $newfileformove = $newfile; + // If old file end with .noexe, new file must also end with .noexe + if (preg_match('/\.noexe$/', $oldfile) && ! preg_match('/\.noexe$/', $newfileformove)) { + $newfileformove .= '.noexe'; + } + //var_dump($oldfile);var_dump($newfile);exit; // Now we update index of file $db->begin(); @@ -146,7 +152,7 @@ if ($action == 'update') //print $oldfile.' - '.$newfile; if ($newlabel != $oldlabel) { - $result = dol_move($oldfile, $newfile); // This include update of database + $result = dol_move($oldfile, $newfileformove); // This include update of database if (!$result) { $langs->load('errors'); @@ -190,7 +196,7 @@ if ($action == 'update') $object->entity = $conf->entity; $object->filepath = preg_replace('/[\\/]+$/', '', $newdirrelativetodocument); $object->filename = $newlabel; - $object->label = md5_file(dol_osencode($newfile)); // hash of file content + $object->label = md5_file(dol_osencode($newfileformove)); // hash of file content $object->fullpath_orig = ''; $object->gen_or_uploaded = 'unknown'; $object->description = ''; // indexed content @@ -208,6 +214,11 @@ if ($action == 'update') $db->commit(); $urlfile = $newlabel; + // If old file end with .noexe, new file must also end with .noexe + if (preg_match('/\.noexe$/', $newfileformove)) { + $urlfile .= '.noexe'; + } + header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section)); exit; } @@ -264,9 +275,13 @@ while ($tmpecmdir && $result > 0) $i++; } +$urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfile); + $s = img_picto('', 'object_dir').' '.$langs->trans("ECMRoot").' -> '.$s.' -> '; -if ($action == 'edit') $s .= ''; -else $s .= $urlfile; +if ($action == 'edit') $s .= ''; +else $s .= $urlfiletoshow; + +$morehtml = ''; $object->ref = ''; // Force to hide ref dol_banner_tab($object, '', $morehtml, 0, '', '', $s); @@ -289,10 +304,9 @@ print dol_print_size($totalsize); print ''; */ +// Hash of file content print ''.$langs->trans("HashOfFileContent").''; $object = new EcmFiles($db); -//$filenametosearch=basename($filepath); -//$filedirtosearch=basedir($filepath); $object->fetch(0, '', $filepathtodocument); if (!empty($object->label)) { diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index e51efb01aaa..852d148e258 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -124,15 +124,17 @@ if ($action == 'confirm_deletefile') if (GETPOST('confirm') == 'yes') { // GETPOST('urlfile','alpha') is full relative URL from ecm root dir. Contains path of all sections. - //var_dump(GETPOST('urlfile'));exit; $upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:''); $file = $upload_dir . "/" . GETPOST('urlfile', 'alpha'); + //var_dump($file);exit; $ret=dol_delete_file($file); // This include also the delete from file index in database. if ($ret) { - setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs'); + $urlfiletoshow = GETPOST('urlfile', 'alpha'); + $urlfiletoshow = preg_replace('/\.noexe$/', '', $urlfiletoshow); + setEventMessages($langs->trans("FileWasRemoved", $urlfiletoshow), null, 'mesgs'); $result=$ecmdir->changeNbOfFiles('-'); } else diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index c5b61e50ed6..d145e75bad6 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -255,3 +255,4 @@ WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different re WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report WarningProjectClosed=Project is closed. You must re-open it first. WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list. +WarningFailedToAddFileIntoDatabaseIndex=Warnin, failed to add file entry into ECM database index table \ No newline at end of file From 34d7dbe7e904270d7da264300190fc84a15557fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 14:42:17 +0200 Subject: [PATCH 287/539] Fix css --- htdocs/install/default.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/default.css b/htdocs/install/default.css index e469a3bbb80..b7fd69d9ecb 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -87,6 +87,9 @@ div.soustitre { tr.trlineforchoice { height: 4em; } +a.button.runupgrade { + padding: 10px; +} /* Force values for small screen 570 */ @media only screen and (max-width: 570px) From 264c1d64911025ebc2a5c6e7c74895670a0f3bac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 14:50:10 +0200 Subject: [PATCH 288/539] List website into combo sorted by position, ref fields --- htdocs/admin/website.php | 13 +++++++------ htdocs/website/index.php | 3 +-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 235f9eae850..4254408ed90 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -49,8 +49,6 @@ $acts[1] = "disable"; $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); $actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); -$status = 1; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); @@ -61,6 +59,9 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; +if (empty($sortfield)) $sortfield = 'position, ref'; +if (empty($sortorder)) $sortorder = 'ASC'; + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('website')); @@ -74,7 +75,7 @@ $tablib[1] = "Websites"; // Requests to extract data $tabsql = array(); -$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.status FROM ".MAIN_DB_PREFIX.'website as f WHERE f.entity IN ('.getEntity('website').')'; +$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.position, f.status FROM ".MAIN_DB_PREFIX.'website as f WHERE f.entity IN ('.getEntity('website').')'; // Criteria to sort dictionaries $tabsqlsort = array(); @@ -82,15 +83,15 @@ $tabsqlsort[1] = "ref ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield = array(); -$tabfield[1] = "ref,description,virtualhost"; +$tabfield[1] = "ref,description,virtualhost,position"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue = array(); -$tabfieldvalue[1] = "ref,description,virtualhost"; +$tabfieldvalue[1] = "ref,description,virtualhost,position"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert = array(); -$tabfieldinsert[1] = "ref,description,virtualhost,entity"; +$tabfieldinsert[1] = "ref,description,virtualhost,position,entity"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on diff --git a/htdocs/website/index.php b/htdocs/website/index.php index be1ea0eb4cb..b68f580bda2 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -106,7 +106,7 @@ if (empty($action)) $action = 'preview'; $object = new Website($db); $objectpage = new WebsitePage($db); -$object->fetchAll(); // Init $object->records with list of websites +$object->fetchAll('ASC', 'position'); // Init $object->records with list of websites // If website not defined, we take first found if (!($websiteid > 0) && empty($websitekey)) @@ -2207,7 +2207,6 @@ if (!GETPOST('hide_websitemenu')) print ''; print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'">'; - //print ' '; print ''; // List of website From 00e88fcf76b35d3d4cee8d01ff2d27b3c74114a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 15:26:38 +0200 Subject: [PATCH 289/539] Fix backtourl --- htdocs/website/index.php | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index b68f580bda2..c2661c54b9b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3720,6 +3720,9 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = if (GETPOST('optioncontent')) $param .= '&optioncontent=content'; if (GETPOST('optionmeta')) $param .= '&optionmeta=meta'; if (GETPOST('optionsitefiles')) $param .= '&optionsitefiles=optionsitefiles'; + if (GETPOST('optioncontainertype')) $param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09'); + if (GETPOST('optionlanguage')) $param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09'); + if (GETPOST('optioncategory')) $param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09'); print '
'; print ''; @@ -3751,14 +3754,18 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print ''.$answerrecord->description.''; print ''; - // Edit properties - print ''; + $param = '?action=replacesiteconfirm'; + $param .= '&websiteid='.$website->id; + $param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09'); + $param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09'); + $param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09'); + $param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09'); + $param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09'); + $param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09'); + $param .= '&searchstring='.urlencode($searchkey); + print ''; From 2f1e653f2f9bf0d065b66a817253268374994306 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 14:42:17 +0200 Subject: [PATCH 290/539] Fix css --- htdocs/install/default.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/default.css b/htdocs/install/default.css index e469a3bbb80..b7fd69d9ecb 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -87,6 +87,9 @@ div.soustitre { tr.trlineforchoice { height: 4em; } +a.button.runupgrade { + padding: 10px; +} /* Force values for small screen 570 */ @media only screen and (max-width: 570px) From 7c653c0873b3015c651ae138cc8f25d25e4deec9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 15:36:16 +0200 Subject: [PATCH 291/539] Fix count of records --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index c2661c54b9b..722be0b60e8 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3687,7 +3687,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; $nbtotalofrecords = count($listofpages['list']); - $num = $nbtotalofrecords = $limit; + $num = $limit; $permissiontodelete = 0; // List of mass actions available From ada9c9addc7eed2dbb411ce065e52e26750454eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 15:36:16 +0200 Subject: [PATCH 292/539] Fix count of records --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index eefebd0e652..09faa79d19a 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3592,7 +3592,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; $nbtotalofrecords = count($listofpages['list']); - $num = $nbtotalofrecords = $limit; + $num = $limit; $permissiontodelete = 0; // List of mass actions available From 6e10abe427e097e3a3f76e94fae3bc69e9e4c10e Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 27 May 2020 15:51:25 +0200 Subject: [PATCH 293/539] [NEW] Save filter of the project homepage Save the filter into the user parameters --- htdocs/projet/index.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index f4edfdea548..a3bf3be14a6 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -39,8 +39,10 @@ $hookmanager->initHooks(array('projectsindex')); // Load translation files required by the page $langs->loadLangs(array('projects', 'companies')); +$action = GETPOST('action', 'alpha'); $search_project_user = GETPOST('search_project_user', 'int'); $mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0; +if ($mine == 0 && $search_project_user === '') $search_project_user = $user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX; if ($search_project_user == $user->id) $mine = 1; // Security check @@ -54,6 +56,24 @@ $sortorder = GETPOST("sortorder", 'alpha'); $max = 3; +/* + * Actions + */ + +$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 (empty($reshook)) { + if ($action == 'refresh_search_project_user') { + $search_project_user = GETPOST('search_project_user', 'int'); + $tabparam = array("MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX" => $search_project_user); + + include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; + $result = dol_set_user_param($db, $conf, $user, $tabparam); + } +} + + /* * View */ @@ -81,6 +101,7 @@ else $titleall = $langs->trans("AllAllowedProjects").'

'; $morehtml = ''; $morehtml .= ''; $morehtml .= ''; +$morehtml .= ''; $morehtml .= '
'; $param = '?action=replacesiteconfirm'; $param .= '&websiteid='.$website->id; - $param .= '&optioncontent='.GETPOST('optioncontent'); - $param .= '&optionmeta='.GETPOST('optionmeta'); - $param .= '&optionsitefiles='.GETPOST('optionsitefiles'); - $param .= '&searchstring='.$searchkey; + $param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09'); + $param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09'); + $param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09'); + $param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09'); + $param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09'); + $param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09'); + $param .= '&searchstring='.urlencode($searchkey); + + // Edit properties + print ''; $disabled = ''; $urltoedithtmlsource = $_SERVER["PHP_SELF"].'?action=editmeta&websiteid='.$website->id.'&pageid='.$answerrecord->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].$param); if (empty($user->rights->website->write)) { @@ -3770,12 +3777,6 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = // Edit HTML source print ''; - $param = '?action=replacesiteconfirm'; - $param .= '&websiteid='.$website->id; - $param .= '&optioncontent='.GETPOST('optioncontent'); - $param .= '&optionmeta='.GETPOST('optionmeta'); - $param .= '&optionsitefiles='.GETPOST('optionsitefiles'); - $param .= '&searchstring='.$searchkey; $disabled = ''; $urltoedithtmlsource = $_SERVER["PHP_SELF"].'?action=editsource&websiteid='.$website->id.'&pageid='.$answerrecord->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].$param); if (empty($user->rights->website->write)) { @@ -3817,8 +3818,18 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = } print ''; - $backtopageurl = $_SERVER["PHP_SELF"].'?action=replacesiteconfirm&searchstring='.urlencode($searchkey).'&optioncontent='.GETPOST('optioncontent', 'aZ09').'&optionmeta='.GETPOST('optionmeta', 'aZ09').'&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09'); + $backtopageurl = $_SERVER["PHP_SELF"].$param; print 'ref.'&backtopage='.urlencode($backtopageurl).'">'.$langs->trans("EditCss").''; print '
'; print ''; -print ''; +print ''; print ''; @@ -100,11 +100,11 @@ $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; -$sql .= " AND f.entity IN (".getEntity('invoice').")"; +$sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; $sql .= " AND f.total_ttc > 0"; if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { - $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; + $sql .= " AND f.fk_statut = ".FactureFournisseur::STATUS_VALIDATED; } $sql .= " AND pfd.traite = 0 AND pfd.fk_facture_fourn = f.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -177,9 +177,11 @@ print '
'; /* * Withdraw receipts */ + $limit = 5; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; +$sql .= " WHERE p.type = 'bank-transfer'"; $sql .= " ORDER BY datec DESC"; $sql .= $db->plimit($limit); @@ -198,26 +200,30 @@ if ($result) print '
'; print ''; - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($result); + if ($num > 0) { + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($result); + print ''; - print ''; + print "\n"; + print '\n"; + print '\n"; + print '\n"; - print "\n"; - print '\n"; - print '\n"; - print '\n"; - - print "\n"; - $i++; + print "\n"; + $i++; + } + } else { + print ''; } + print "
'.$langs->trans("Statistics").'
'.$langs->trans("NbOfInvoiceToWithdraw").'
'.$langs->trans("NbOfInvoiceToPayByBankTransfer").''; -print ''; +print ''; print $bprev->NbFactureAPrelever(); print ''; print '
'.$langs->trans("Status").'
"; + $bprev->id = $obj->rowid; + $bprev->ref = $obj->ref; + $bprev->statut = $obj->statut; + print $bprev->getNomUrl(1); + print "'.dol_print_date($db->jdate($obj->datec), "dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3).""; - $bprev->id = $obj->rowid; - $bprev->ref = $obj->ref; - $bprev->statut = $obj->statut; - print $bprev->getNomUrl(1); - print "'.dol_print_date($db->jdate($obj->datec), "dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3)."
'.$langs->trans("None").'

"; $db->free($result); } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index c7c717e702b..ea768638552 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -38,6 +38,8 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +$type = GETPOST('type', 'aZ09'); + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); @@ -57,6 +59,11 @@ $search_amount = GETPOST('search_amount', 'alpha'); $bon = new BonPrelevement($db); $hookmanager->initHooks(array('withdrawalsreceiptslist')); +$usercancreate = $user->rights->prelevement->bons->creer; +if ($type == 'bank-transfer') { + $usercancreate = $user->rights->paymentbybanktransfer->create; +} + /* * Actions @@ -78,6 +85,11 @@ llxHeader('', $langs->trans("WithdrawalsReceipts")); $sql = "SELECT p.rowid, p.ref, p.amount, p.statut, p.datec"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; +if ($type == 'bank-transfer') { + $sql .= " AND p.type = 'bank-transfer'"; +} else { + $sql .= " AND p.type = 'debit-order'"; +} if ($search_ref) $sql .= natural_search("p.ref", $search_ref); if ($search_amount) $sql .= natural_search("p.amount", $search_amount, 1); @@ -112,7 +124,7 @@ if ($result) $selectedfields = ''; $newcardbutton = ''; - if ($user->rights->prelevement->bons->creer) + if ($usercancreate) { $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'); } @@ -127,7 +139,14 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); + $titlekey = "WithdrawalsReceipts"; + $title = $langs->trans("WithdrawalsReceipts"); + if ($type == 'bank-transfer') { + $titlekey = "BankTransferReceipts"; + $title = $langs->trans("BankTransferReceipts"); + } + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); $moreforfilter = ''; @@ -146,7 +165,7 @@ if ($result) print ''; print ''; - print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); + print_liste_field_titre($titlekey, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index d81e101be3d..d630f65edd7 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -45,6 +45,8 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); +$type = GETPOST('type', 'aZ09'); + // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0c21a3e6d2b..62188f1c7fc 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -638,8 +638,7 @@ class BonPrelevement extends CommonObject $arr = array(); /* - * Returns all invoices presented - * within a withdrawal receipt + * Returns all invoices presented within same order */ $sql = "SELECT fk_facture"; if ($amounts) $sql .= ", SUM(pl.amount)"; @@ -1159,8 +1158,12 @@ class BonPrelevement extends CommonObject if (!$notrigger) { + $triggername = 'DIRECT_DEBIT_ORDER_DELETE'; + if ($this->type == 'bank-transfer') { + $triggername = 'PAYMENTBYBANKTRANFER_DELETE'; + } // Call trigger - $result = $this->call_trigger('DIRECT_DEBIT_ORDER_DELETE', $user); + $result = $this->call_trigger($triggername, $user); if ($result < 0) $error++; // End call triggers } @@ -1224,7 +1227,12 @@ class BonPrelevement extends CommonObject $result = ''; - $label = ''.$langs->trans("ShowWithdraw").''; + $labeltoshow = 'Withdraw'; + if ($this->type == 'bank-transfer') { + $labeltoshow = 'PaymentByBankTransfer'; + } + + $label = ''.$langs->trans($labeltoshow).''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; if (isset($this->statut)) { @@ -1232,6 +1240,9 @@ class BonPrelevement extends CommonObject } $url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id; + if ($this->type == 'bank-transfer') { + $url = DOL_URL_ROOT.'/compta/paymentbybanktransfer/card.php?id='.$this->id; + } if ($option != 'nolink') { @@ -1272,7 +1283,7 @@ class BonPrelevement extends CommonObject //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); global $action, $hookmanager; - $hookmanager->initHooks(array('myobjectdao')); + $hookmanager->initHooks(array('banktransferdao')); $parameters = array('id'=>$this->id, 'getnomurl'=>$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $result = $hookmanager->resPrint; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 5306b6799b9..06ae8f7c794 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -43,6 +43,8 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bill if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +$type = GETPOST('type', 'aZ09'); + // Get supervariables $action = GETPOST('action', 'alpha'); $mode = GETPOST('mode', 'alpha') ?GETPOST('mode', 'alpha') : 'real'; @@ -130,7 +132,12 @@ $h++; dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment'); */ -print load_fiche_titre($langs->trans("NewStandingOrder")); +$title = $langs->trans("NewStandingOrder"); +if ($type == 'bank-transfer') { + $title = $langs->trans("NewPaymentByBankTransfer"); +} + +print load_fiche_titre($title); dol_fiche_head(); @@ -144,12 +151,17 @@ if ($nb < 0 || $nb1 < 0 || $nb11 < 0) } print ''; -print ''; +$title = $langs->trans("NbOfInvoiceToWithdraw"); +if ($type == 'bank-transfer') { + $title = $langs->trans("NbOfInvoiceToPayByBankTransfer"); +} + +print ''; print ''; -print ''; +print ''; print ''; @@ -160,7 +172,7 @@ print ''; if ($mesg) print $mesg; -print "
\n"; +print '
'."\n"; print ''; print ''; @@ -184,7 +196,11 @@ if ($nb) { } else { - print ''.$langs->trans("CreateAll")."\n"; + $title = $langs->trans("CreateAll"); + if ($type == 'bank-transfer') { + $title = $langs->trans("CreateFileForPaymentByBankTransfer"); + } + print ''.$title."\n"; } } } @@ -206,7 +222,11 @@ print '
'; $sql = "SELECT f.ref, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,"; $sql .= " pfd.date_demande, pfd.amount"; -$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; +if ($type == 'bank-transfer') { + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; +} else { + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; +} $sql .= " ".MAIN_DB_PREFIX."societe as s,"; $sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; @@ -217,7 +237,11 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) } $sql .= " AND f.total_ttc > 0"; $sql .= " AND pfd.traite = 0"; -$sql .= " AND pfd.fk_facture = f.rowid"; +if ($type == 'bank-transfer') { + $sql .= " AND pfd.fk_facture = f.rowid"; +} else { + $sql .= " AND pfd.fk_facture_fourn = f.rowid"; +} if ($socid > 0) $sql .= " AND f.fk_soc = ".$socid; $nbtotalofrecords = ''; @@ -252,7 +276,11 @@ if ($resql) print ''; } - print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit); + $title = $langs->trans("InvoiceWaitingWithdraw"); + if ($type == 'bank-transfer') { + $title = $langs->trans("InvoiceWaitingPaymentByBankTransfer"); + } + print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit); print '
'.$langs->trans("NbOfInvoiceToWithdraw").'
'.$title.''; print $nb; print '
'.$langs->trans("AmountToWithdraw").'
'.$langs->trans("AmountTotal").''; print price($pricetowithdraw); print '
'; print ''; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 181f71a678c..720aac24be5 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -21,12 +21,13 @@ /** * \file htdocs/compta/prelevement/demandes.php * \ingroup prelevement - * \brief Page to list withdraw requests + * \brief Page to list bank transfer requests (debit order or payments of vendors) */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -43,6 +44,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myo $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$type = GETPOST('type', 'aZ09'); + $search_facture = GETPOST('search_facture', 'alpha'); $search_societe = trim(GETPOST('search_societe', 'alpha')); @@ -85,13 +88,20 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' * View */ -if (!$status) -{ - $title = $langs->trans("RequestStandingOrderToTreat"); -} -else -{ - $title = $langs->trans("RequestStandingOrderTreated"); +if ($type != 'bank-transfer') { + if (!$status) + { + $title = $langs->trans("RequestStandingOrderToTreat"); + } else { + $title = $langs->trans("RequestStandingOrderTreated"); + } +} else { + if (!$status) + { + $title = $langs->trans("RequestPaymentsByBankTransferToTreat"); + } else { + $title = $langs->trans("RequestPaymentsByBankTransferTreated"); + } } llxHeader('', $title); @@ -105,7 +115,11 @@ $sql = "SELECT f.ref, f.rowid, f.total_ttc,"; $sql .= " s.nom as name, s.rowid as socid,"; $sql .= " pfd.date_demande as date_demande,"; $sql .= " pfd.fk_user_demande"; -$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; +if ($type != 'bank-transfer') { + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; +} else { + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; +} $sql .= " ".MAIN_DB_PREFIX."societe as s,"; $sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -120,7 +134,11 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; } -$sql .= " AND pfd.fk_facture = f.rowid"; +if ($type != 'bank-transfer') { + $sql .= " AND pfd.fk_facture = f.rowid"; +} else { + $sql .= " AND pfd.fk_facture_fourn = f.rowid"; +} if ($search_facture) $sql .= natural_search("f.ref", $search_facture); if ($search_societe) $sql .= natural_search("s.nom", $search_societe); $sql .= $db->order($sortfield, $sortorder); @@ -142,9 +160,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); @@ -160,6 +176,9 @@ else $newcardbutton = ''.$langs->trans("Back").''; +if ($type == 'bank-transfer') { + $newcardbutton = ''.$langs->trans("Back").''; +} print ''; if ($optioncss != '') print ''; @@ -171,6 +190,8 @@ print ''; print ''; print ''; +$param = ''; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); print '
'; @@ -195,8 +216,6 @@ print $searchpicto; print ''; print ''; -$users = array(); - $i = 0; while ($i < min($num, $limit)) { diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index fb0a5548426..06c20a2b04f 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -42,6 +42,8 @@ $prev_id = GETPOST('id', 'int'); $socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); +$type = GETPOST('type', 'aZ09'); + $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 1cc454a3d4d..75cff74da8a 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -41,6 +41,8 @@ if ($user->socid > 0) accessforbidden(); $prev_id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); +$type = GETPOST('type', 'aZ09'); + // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 18028e2059a..899ff69fea1 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -39,6 +39,8 @@ if ($user->socid > 0) accessforbidden(); $prev_id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); +$type = GETPOST('type', 'aZ09'); + // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index eb2932fd4cb..5e1905e3a59 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -180,6 +180,7 @@ print '
'; $limit = 5; $sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; +$sql .= " WHERE p.type = 'debit-order'"; $sql .= " ORDER BY datec DESC"; $sql .= $db->plimit($limit); @@ -198,26 +199,31 @@ if ($result) print '
'; print ''; - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($result); + if ($num > 0) { + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($result); - print ''; + print ''; - print "\n"; - print '\n"; - print '\n"; - print '\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; - print "\n"; - $i++; + print "\n"; + $i++; + } + } else { + print ''; } + print "
'.$langs->trans("Status").'
"; - $bprev->id = $obj->rowid; - $bprev->ref = $obj->ref; - $bprev->statut = $obj->statut; - print $bprev->getNomUrl(1); - print "'.dol_print_date($db->jdate($obj->datec), "dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3).""; + $bprev->id = $obj->rowid; + $bprev->ref = $obj->ref; + $bprev->statut = $obj->statut; + print $bprev->getNomUrl(1); + print "'.dol_print_date($db->jdate($obj->datec), "dayhour")."'.price($obj->amount)."'.$bprev->getLibStatut(3)."
'.$langs->trans("None").'

"; $db->free($result); } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 9169f71a377..c225b9d47f3 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -43,6 +43,8 @@ $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); $socid = GETPOST('socid', 'int'); +$type = GETPOST('type', 'aZ09'); + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha'); diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 48f9bcc7c54..e97a492de9b 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -47,6 +47,8 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) $socid=$user->socid; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +$type = GETPOST('type', 'aZ09'); + $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 6d1994b7a4b..7dfd5e558d9 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -38,6 +38,8 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +$type = GETPOST('type', 'aZ09'); + // Get supervariables $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'alpha'); @@ -47,6 +49,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; + + /* * View */ diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index c6d1962ff46..416bb68128b 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -36,6 +36,8 @@ $socid = GETPOST('socid', 'int'); if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'prelevement', '', '', 'bons'); +$type = GETPOST('type', 'aZ09'); + /* * View diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index be455d5431a..c0b80e50ad9 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1496,8 +1496,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire); $newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire); $newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire); - - //$newmenu->add("/compta/prelevement/config.php",$langs->trans("Setup"),1,$user->rights->prelevement->bons->configurer); } } @@ -1507,12 +1505,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer'); if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") { - $newmenu->add("/compta/paymentbybanktransfer/create.php?mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create); + $newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create); - $newmenu->add("/compta/paymentbybanktransfer/bons.php?mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/paymentbybanktransfer/list.php?mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/paymentbybanktransfer/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read); - $newmenu->add("/compta/paymentbybanktransfer/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/prelevement/bons.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read); + $newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read); } } 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 5e673d97611..90b627ea425 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 @@ -72,6 +72,9 @@ delete from llx_const where name = 'PROJECT_HIDE_TASKS' and entity = 0; -- For v12 +ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-order'; + + -- Delete an old index that is duplicated -- VMYSQL4.1 DROP INDEX ix_fk_product_stock on llx_product_batch; -- VPGSQL8.2 DROP INDEX ix_fk_product_stock diff --git a/htdocs/install/mysql/tables/llx_prelevement_bons.sql b/htdocs/install/mysql/tables/llx_prelevement_bons.sql index e7e0b9a89f1..fc7f3f2f538 100644 --- a/htdocs/install/mysql/tables/llx_prelevement_bons.sql +++ b/htdocs/install/mysql/tables/llx_prelevement_bons.sql @@ -26,6 +26,7 @@ create table llx_prelevement_bons ( rowid integer AUTO_INCREMENT PRIMARY KEY, + type varchar(16) DEFAULT 'debit-order', -- 'debit-order' or 'bank-transfer' ref varchar(12), -- reference entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, -- date de creation diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index ad51b045a37..a1e5521bef7 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -16,8 +16,9 @@ WithdrawalsLines=Direct debit order lines RequestStandingOrderToTreat=Request for direct debit payment order to process RequestStandingOrderTreated=Request for direct debit payment order processed NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines. -NbOfInvoiceToWithdraw=No. of qualified invoice with waiting direct debit order +NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information +NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by bank transfer SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by bank transfer InvoiceWaitingWithdraw=Invoice waiting for direct debit AmountToWithdraw=Amount to withdraw From e37e45f9845d0fb4b46b1b4316d203159891ab7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2020 22:35:55 +0200 Subject: [PATCH 296/539] Debug credit transfer --- htdocs/admin/modules.php | 7 ++-- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 12 +++---- htdocs/langs/en_US/admin.lang | 4 +-- htdocs/langs/en_US/banks.lang | 6 ++-- htdocs/langs/en_US/bills.lang | 4 --- htdocs/langs/en_US/withdrawals.lang | 12 +++---- htdocs/theme/eldy/btn.inc.php | 2 +- htdocs/theme/eldy/global.inc.php | 7 ++-- htdocs/theme/eldy/info-box.inc.php | 28 ++++++++++++---- htdocs/theme/md/info-box.inc.php | 32 +++++++++++-------- 11 files changed, 68 insertions(+), 48 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ab2889368cd..c4628ff44da 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -543,8 +543,8 @@ if ($mode == 'common' || $mode == 'commonkanban') $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition')); - $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition')); + $moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'common' ? '' : ' btnTitleSelected'))); + $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected'))); $moreforfilter .= '
'; $moreforfilter .= '
'.$moreinfo.'
'; @@ -654,7 +654,8 @@ if ($mode == 'common' || $mode == 'commonkanban') } $familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label']; - print load_fiche_titre($familytext, '', ''); + + print load_fiche_titre($familytext, '', '', 0, '', 'modulefamilygroup'); if ($mode == 'commonkanban') { print '
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2d8996523fe..b30bc99f38a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1205,7 +1205,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $out = "\n".''; if ((!empty($title) && $showtitle) || $morehtmlright || !empty($links)) { - $out .= '
'."\n"; + $out .= '
'."\n"; } // Show right part diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 384c4fc3a7e..d9f2c97724e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2321,24 +2321,24 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it print '
- '.$this->getName().' + '.$this->getName().' '.nl2br($this->getDesc()).''; /*print 'getVersion(1).'">'; print $this->getVersion(1); print ''; */ - print '
'; + print '
'; print '
'; - print '
'; - print $codeenabledisable; - print '
'; - print '
'; + print '
'; print $codetoconfig; print '
'; + print '
'; + print $codeenabledisable; + print '
'; print '
'; print ' diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index fef27b5b7de..bee43c2569f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -541,8 +541,8 @@ Module54Name=Contracts/Subscriptions Module54Desc=Management of contracts (services or recurring subscriptions) Module55Name=Barcodes Module55Desc=Barcode management -Module56Name=Payment by bank transfer -Module56Desc=Management of payment by bank transfer orders. It includes generation of SEPA file for European countries. +Module56Name=Payment by credit transfer +Module56Desc=Management of payment by credit transfer orders. It includes generation of SEPA file for European countries. Module57Name=Bank Direct Debit payments Module57Desc=Management of Direct Debit payment orders. It includes generation of SEPA file for European countries. Module58Name=ClickToDial diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 48bd2b81c2e..17ebc2ff7ed 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -35,10 +35,10 @@ SwiftValid=BIC/SWIFT valid SwiftVNotalid=BIC/SWIFT not valid IbanValid=BAN valid IbanNotValid=BAN not valid -StandingOrders=Direct Debit orders +StandingOrders=Direct debit orders StandingOrder=Direct debit order -PaymentByBankTransfers=Payments by bank transfer -PaymentByBankTransfer=Payment by bank transfer +PaymentByBankTransfers=Payments by credit transfer +PaymentByBankTransfer=Payment by credit transfer AccountStatement=Account statement AccountStatementShort=Statement AccountStatements=Account statements diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 2857b461e7b..1e562909360 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -241,10 +241,6 @@ EscompteOffered=Discount offered (payment before term) EscompteOfferedShort=Discount SendBillRef=Submission of invoice %s SendReminderBillRef=Submission of invoice %s (reminder) -StandingOrders=Direct debit orders -StandingOrder=Direct debit order -PaymentByBankTransfers=Payments by bank transfer -PaymentByBankTransfer=Payment by bank transfer NoDraftBills=No draft invoices NoOtherDraftBills=No other draft invoices NoDraftInvoices=No draft invoices diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index a1e5521bef7..fb6c56687ee 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -4,13 +4,13 @@ SuppliersStandingOrdersArea=Direct credit payment orders area StandingOrdersPayment=Direct debit payment orders StandingOrderPayment=Direct debit payment order NewStandingOrder=New direct debit order -NewPaymentByBankTransfer=New payment by bank transfer +NewPaymentByBankTransfer=New payment by credit transfer StandingOrderToProcess=To process -PaymentByBankTransferReceipts=Bank transfer orders -PaymentByBankTransferLines=Bank transfer order lines +PaymentByBankTransferReceipts=Credit transfer orders +PaymentByBankTransferLines=Credit transfer order lines WithdrawalsReceipts=Direct debit orders WithdrawalReceipt=Direct debit order -LatestBankTransferReceipts=Latest %s bank transfer orders +LatestBankTransferReceipts=Latest %s credit transfer orders LastWithdrawalReceipts=Latest %s direct debit files WithdrawalsLines=Direct debit order lines RequestStandingOrderToTreat=Request for direct debit payment order to process @@ -18,8 +18,8 @@ RequestStandingOrderTreated=Request for direct debit payment order processed NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines. NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information -NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by bank transfer -SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by bank transfer +NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer +SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer InvoiceWaitingWithdraw=Invoice waiting for direct debit AmountToWithdraw=Amount to withdraw WithdrawsRefused=Direct debit refused diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index ed5097f5944..5642a40c0e7 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -7,7 +7,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> --btncolorbg: #fbfbfb; --btncolorborderhover: none; --btncolorborder: #FFF; - --butactionbg:rgb(225, 235, 225); + --butactionbg:rgb(215, 235, 225); --butactiondeletebg: rgb(234,228,225); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 3f6d999104e..8d9c0276ac4 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2651,8 +2651,8 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { div.tabs { text-align: ; padding-top: 10px; - padding-left: 6px !important; - padding-right: 6px !important; + padding-left: 6px; + padding-right: 6px; clear:both; height:100%; } @@ -2870,6 +2870,9 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd .nopaddingleft { padding-: 0px; } +div.tabs.nopaddingleft { + padding-: 0px; +} .nopaddingright { padding-: 0px; } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index a0f54591534..badc7f2d655 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -17,15 +17,21 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> min-height: 90px; /* background: #fff; */ width: 100%; - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: 1px 1px 2px rgba(128, 128, 128, 0.2); border-radius: 2px; - border: 1px solid #eee; + border: 1px solid #e9e9e9; margin-bottom: 15px; } .info-box.info-box-sm{ min-height: 80px; margin-bottom: 10px; } +.info-box-more { + float: right; + top: 6px; + position: absolute; + right: 10px; +} .info-box small { font-size: 14px; @@ -74,13 +80,13 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> height: 80px; width: 80px; font-size: 25px; - line-height: 100px; + line-height: 92px; } .opened-dash-board-wrap .info-box-sm .info-box-icon { line-height: 80px; } .info-box-module .info-box-icon { - height: 107px; + height: 98px; } .info-box-icon > img { max-width: 100%; @@ -152,12 +158,19 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .info-box-content { padding: 5px 10px; - margin-left: 90px; + margin-left: 84px; } .info-box-sm .info-box-content{ margin-left: 80px; } +/*.info-box-setup span { + color: var(--colortexttitlenotab2); +} +.tdsetuppicto span { + color: var(--colortexttitlenotab2); +}*/ + .info-box-number { display: block; font-weight: bold; @@ -175,7 +188,8 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .info-box-title{ text-transform: uppercase; font-weight: bold; - padding-bottom: 4px; + margin-bottom: 6px; + /* padding-bottom: 4px; */ } .info-box-text{ font-size: 0.92em; @@ -373,7 +387,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = max-width: 350px; } .info-box-module .info-box-content { - height: 7em; + height: 6.4em; } /* Disabled. This break the responsive on smartphone .box{ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 65ff1811269..f1c58b4241e 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -3,14 +3,18 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> /*