From 85625a46bb9d18f8ae18d6054475180a253f9b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 09:35:30 +0200 Subject: [PATCH] add new rule --- htdocs/admin/agenda.php | 6 +- htdocs/admin/agenda_extsites.php | 9 +- htdocs/admin/agenda_other.php | 34 +-- htdocs/admin/agenda_reminder.php | 19 +- htdocs/admin/agenda_xcal.php | 3 +- htdocs/admin/bank.php | 57 ++-- htdocs/admin/barcode.php | 27 +- htdocs/admin/bom.php | 53 +--- htdocs/admin/boxes.php | 33 +-- htdocs/admin/chequereceipts.php | 12 +- htdocs/admin/clicktodial.php | 6 +- htdocs/admin/commande.php | 80 ++--- htdocs/admin/company.php | 57 ++-- htdocs/admin/compta.php | 3 +- htdocs/admin/confexped.php | 6 +- htdocs/admin/const.php | 21 +- htdocs/admin/contract.php | 49 +--- htdocs/admin/dav.php | 15 +- htdocs/admin/debugbar.php | 3 +- htdocs/admin/defaultvalues.php | 24 +- htdocs/admin/delais.php | 3 +- htdocs/admin/dict.php | 277 ++++++------------ .../class/PSWebServiceLibrary.class.php | 3 +- htdocs/admin/ecm.php | 12 +- htdocs/admin/emailcollector_card.php | 33 +-- htdocs/admin/emailcollector_list.php | 3 +- htdocs/admin/expedition.php | 43 +-- htdocs/admin/expensereport.php | 46 +-- htdocs/admin/expensereport_ik.php | 6 +- htdocs/admin/expensereport_rules.php | 31 +- htdocs/admin/external_rss.php | 21 +- htdocs/admin/facture.php | 74 ++--- htdocs/admin/facture_situation.php | 5 +- htdocs/admin/fckeditor.php | 12 +- htdocs/admin/fichinter.php | 60 ++-- htdocs/admin/geoipmaxmind.php | 6 +- htdocs/admin/holiday.php | 49 +--- htdocs/admin/ihm.php | 9 +- 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 | 18 +- htdocs/admin/limits.php | 12 +- htdocs/admin/livraison.php | 33 +-- htdocs/admin/loan.php | 6 +- htdocs/admin/mailing.php | 3 +- htdocs/admin/mailman.php | 15 +- htdocs/admin/mails.php | 87 ++---- htdocs/admin/mails_emailing.php | 60 ++-- htdocs/admin/mails_senderprofile_list.php | 9 +- htdocs/admin/mails_templates.php | 81 ++--- htdocs/admin/menus.php | 3 +- htdocs/admin/menus/edit.php | 21 +- htdocs/admin/menus/index.php | 14 +- htdocs/admin/menus/other.php | 6 +- htdocs/admin/modulehelp.php | 63 ++-- htdocs/admin/modules.php | 87 ++---- htdocs/admin/mrp.php | 53 +--- htdocs/admin/multicurrency.php | 21 +- htdocs/admin/notification.php | 12 +- htdocs/admin/oauth.php | 3 +- htdocs/admin/oauthlogintokens.php | 30 +- htdocs/admin/payment.php | 6 +- htdocs/admin/pdf.php | 6 +- htdocs/admin/perms.php | 6 +- htdocs/admin/prelevement.php | 6 +- htdocs/admin/propal.php | 84 ++---- htdocs/admin/receiptprinter.php | 6 +- htdocs/admin/reception_setup.php | 40 +-- htdocs/admin/resource.php | 3 +- htdocs/admin/security.php | 39 +-- htdocs/admin/security_other.php | 25 +- 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 | 37 +-- htdocs/admin/supplier_order.php | 59 ++-- htdocs/admin/supplier_payment.php | 37 +-- htdocs/admin/supplier_proposal.php | 57 ++-- htdocs/admin/syslog.php | 9 +- htdocs/admin/system/about.php | 3 +- htdocs/admin/system/constall.php | 6 +- htdocs/admin/system/database-tables.php | 15 +- htdocs/admin/system/database.php | 3 +- htdocs/admin/system/dbtable.php | 6 +- htdocs/admin/system/dolibarr.php | 21 +- htdocs/admin/system/filecheck.php | 33 +-- htdocs/admin/system/modules.php | 12 +- htdocs/admin/system/perf.php | 30 +- htdocs/admin/system/phpinfo.php | 24 +- 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 | 18 +- htdocs/admin/tools/dolibarr_import.php | 9 +- htdocs/admin/tools/export.php | 3 +- htdocs/admin/tools/export_files.php | 12 +- htdocs/admin/tools/listevents.php | 9 +- htdocs/admin/tools/listsessions.php | 9 +- htdocs/admin/tools/update.php | 6 +- htdocs/admin/translation.php | 33 +-- htdocs/admin/user.php | 44 +-- htdocs/admin/usergroup.php | 29 +- htdocs/admin/website.php | 51 ++-- htdocs/admin/website_options.php | 3 +- htdocs/admin/workflow.php | 12 +- htdocs/asterisk/cidlookup.php | 3 +- htdocs/asterisk/wrapper.php | 9 +- htdocs/modulebuilder/index.php | 237 +++++---------- htdocs/modulebuilder/template/admin/setup.php | 6 +- .../template/class/api_mymodule.class.php | 6 +- .../template/class/myobject.class.php | 36 +-- .../mailinglist_mymodule_myobject.modules.php | 3 +- .../doc/doc_generic_myobject_odt.modules.php | 39 +-- .../mymodule/mod_myobject_standard.php | 9 +- .../modulebuilder/template/myobject_card.php | 9 +- .../modulebuilder/template/myobject_list.php | 3 +- .../template/scripts/mymodule.php | 3 +- 122 files changed, 1031 insertions(+), 2128 deletions(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 52a1adc4fd2..382f242b7e7 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -61,8 +61,7 @@ if ($resql) $i++; } $db->free($resql); -} -else { +} else { dol_print_error($db); } @@ -106,8 +105,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 dd5d04732ff..e7e5edefaab 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -107,8 +107,7 @@ if ($actionsave) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -161,13 +160,11 @@ print ''; 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 a9e5bccd71b..560226438c3 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -59,8 +59,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -72,8 +71,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -85,8 +83,7 @@ if ($action == 'set') dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); -} -elseif ($action == 'specimen') // For orders +} elseif ($action == 'specimen') // For orders { $modele = GETPOST('module', 'alpha'); @@ -118,13 +115,11 @@ 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); } @@ -135,9 +130,7 @@ elseif ($action == 'setmodel') { //print "sssd".$value; $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -209,8 +202,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -270,13 +262,11 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print 'scandir.'&label='.urlencode($module->name).'&type=action">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; - } - else { + } else { print img_picto($langs->trans("Enabled"), 'switch_on'); } print ""; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -287,8 +277,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") { 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 ''; @@ -337,8 +326,7 @@ print ''."\n"; 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 d9b7ead6f2e..c55e4a1afd5 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -54,8 +54,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -67,8 +66,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -78,8 +76,7 @@ if ($action == 'set') dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); -} -elseif ($action == 'specimen') // For orders +} elseif ($action == 'specimen') // For orders { $modele = GETPOST('module', 'alpha'); @@ -111,13 +108,11 @@ 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); } @@ -128,9 +123,7 @@ elseif ($action == 'setmodel') { //print "sssd".$value; $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index b6d0472c3af..3075be2ada5 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -54,8 +54,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 662dc517436..6c91367f6c2 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -55,8 +55,7 @@ if ($action == 'setbankorder') { { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -67,18 +66,15 @@ if ($action == 'setreportlastnumreleve') { { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } -} -elseif ($action == 'unsetreportlastnumreleve') { +} elseif ($action == 'unsetreportlastnumreleve') { if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, '', $conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -89,18 +85,15 @@ if ($action == 'setbankcolorizemovement') { { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } -} -elseif ($action == 'unsetbankcolorizemovement') { +} elseif ($action == 'unsetbankcolorizemovement') { if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -127,8 +120,7 @@ if ($actionsave) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -140,8 +132,7 @@ if ($action == 'specimen') { if ($modele == 'sepamandate') { $object = new CompanyBankAccount($db); - } - else { + } else { $object = new Account($db); } $object->initAsSpecimen(); @@ -168,13 +159,11 @@ if ($action == 'specimen') { if ($module->write_file($object, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bank&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); } @@ -183,8 +172,7 @@ if ($action == 'specimen') { // Activate a model if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} -elseif ($action == 'del') { +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { if ($conf->global->BANKADDON_PDF == "$value") @@ -269,8 +257,7 @@ while ($i < $nbofbank) { print ''; print img_picto($langs->trans("Activated"), 'on'); print ''; - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'off'); print ''; @@ -307,8 +294,7 @@ if ($resql) { array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -368,8 +354,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -379,8 +364,7 @@ foreach ($dirmodels as $reldir) { print ''; if ($conf->global->BANKADDON_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 ''; @@ -408,8 +392,7 @@ foreach ($dirmodels as $reldir) { print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -445,8 +428,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) { print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; -} -else { +} else { print ''."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -505,8 +487,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; -} -else { +} else { print ''."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 90a2525de05..250e2cf6162 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -50,8 +50,7 @@ if ($action == 'setbarcodeproducton') { $res = dolibarr_set_const($db, "BARCODE_STANDARD_PRODUCT_MASK", '020{000000000}', 'chaine', 0, '', $conf->entity); } -} -elseif ($action == 'setbarcodeproductoff') +} elseif ($action == 'setbarcodeproductoff') { $res = dolibarr_del_const($db, "BARCODE_PRODUCT_ADDON_NUM", $conf->entity); } @@ -67,8 +66,7 @@ if ($action == 'setcoder') $resql = $db->query($sqlp); if (!$resql) dol_print_error($db); -} -elseif ($action == 'update') +} elseif ($action == 'update') { $location = GETPOST('GENBARCODE_LOCATION', 'alpha'); $res = dolibarr_set_const($db, "GENBARCODE_LOCATION", $location, 'chaine', 0, '', $conf->entity); @@ -80,12 +78,10 @@ elseif ($action == 'update') if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'updateengine') +} elseif ($action == 'updateengine') { $sql = "SELECT rowid, coder"; $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; @@ -263,17 +259,14 @@ if ($resql) $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); //print $url; print ''; - } - else { + } else { print $langs->trans("FormatNotSupportedByGenerator"); } - } - else { + } else { print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder; } } - } - else { + } else { print $langs->trans("ChooseABarCode"); } print ''; @@ -388,8 +381,7 @@ if ($conf->product->enabled) try { dol_include_once($dirroot.$file.'.php'); - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog($e->getMessage(), LOG_ERR); } @@ -407,8 +399,7 @@ if ($conf->product->enabled) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 26f3fe75858..46db7dd6c6c 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -57,13 +57,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -94,13 +91,11 @@ 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); } @@ -110,9 +105,7 @@ elseif ($action == 'specimen') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -137,17 +130,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Check if numbering module chosen can be activated // by calling method canBeActivated dolibarr_set_const($db, "BOM_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'set_BOM_DRAFT_WATERMARK') +} elseif ($action == 'set_BOM_DRAFT_WATERMARK') { $draft = GETPOST("BOM_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "BOM_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); @@ -157,13 +146,10 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_BOM_FREE_TEXT') +} elseif ($action == 'set_BOM_FREE_TEXT') { $freetext = GETPOST("BOM_FREE_TEXT", 'none'); // No alpha here, we want exact string @@ -174,8 +160,7 @@ elseif ($action == 'set_BOM_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -256,8 +241,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->BOM_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -321,8 +305,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -391,8 +374,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -403,8 +385,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->BOM_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 ''; @@ -432,8 +413,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -478,8 +458,7 @@ $variablename = 'BOM_FREE_TEXT'; 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 46f91e8b366..a45208db3b9 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -83,8 +83,7 @@ if ($action == 'add') { $distinctfkuser[$obj->fk_user] = $obj->fk_user; $i++; } - } - else { + } else { setEventMessages($db->lasterror(), null, 'errors'); $error++; } @@ -108,8 +107,7 @@ if ($action == 'add') { if (preg_match('/A/', $boxorder)) $nbboxonleft++; if (preg_match('/B/', $boxorder)) $nbboxonright++; } - } - else dol_print_error($db); + } else dol_print_error($db); $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes ("; $sql .= "box_id, position, box_order, fk_user, entity"; @@ -133,8 +131,7 @@ if ($action == 'add') { { $db->commit(); $action = ''; - } - else { + } else { $db->rollback(); } } @@ -202,8 +199,7 @@ if ($action == 'switch') if ($resultupdatefrom && $resultupdateto) { $db->commit(); - } - else { + } else { $db->rollback(); } } @@ -285,23 +281,20 @@ if ($resql) $box_order = "A0".$record['box_order']; $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; $resql = $db->query($sql); - } - elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) + } elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) { $box_order = "B0".$record['box_order']; $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; $resql = $db->query($sql); } - } - elseif (dol_strlen($record['box_order']) == 2) + } elseif (dol_strlen($record['box_order']) == 2) { if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) { $box_order = "A".$record['box_order']; $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; $resql = $db->query($sql); - } - elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) + } elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) { $box_order = "B".$record['box_order']; $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'"; @@ -342,8 +335,7 @@ foreach ($boxtoadd as $box) if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) { $logo = $box->boximg; - } - else { + } else { $logo = preg_replace("/^object_/i", "", $box->boximg); } @@ -357,8 +349,7 @@ foreach ($boxtoadd as $box) { $langs->load("errors"); print $langs->trans("WarningUsingThisBoxSlowDown"); - } - else print ($box->note ? $box->note : ' '); + } else print ($box->note ? $box->note : ' '); print ''."\n"; print ''.$box->sourcefile.''."\n"; @@ -406,8 +397,7 @@ foreach ($boxactivated as $key => $box) if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) { $logo = $box->boximg; - } - else { + } else { $logo = preg_replace("/^object_/i", "", $box->boximg); } @@ -421,8 +411,7 @@ foreach ($boxactivated as $key => $box) { $langs->load("errors"); print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown"); - } - else print ($box->note ? $box->note : ' '); + } else print ($box->note ? $box->note : ' '); print ''; print ''.(empty($pos_name[$box->position]) ? '' : $langs->trans($pos_name[$box->position])).''; $hasnext = ($key < (count($boxactivated) - 1)); diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 397f289eaee..b619f584736 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -60,8 +60,7 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -82,8 +81,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -179,8 +177,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -256,8 +253,7 @@ $variablename = 'BANK_CHEQUERECEIPT_FREE_TEXT'; 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 56f4f076e54..74c49092cb3 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -46,8 +46,7 @@ if ($action == 'setvalue' && $user->admin) if ($result1 >= 0 && $result2 >= 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -132,8 +131,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) if ($setupcomplete) { 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 f1f22203fa2..9acecc11604 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -66,13 +66,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -103,13 +100,11 @@ 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); } @@ -119,9 +114,7 @@ elseif ($action == 'specimen') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -146,17 +139,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Check if numbering module chosen can be activated // by calling method canBeActivated dolibarr_set_const($db, "COMMANDE_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') +} elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') { $draft = GETPOST("COMMANDE_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); @@ -166,13 +155,10 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_ORDER_FREE_TEXT') +} elseif ($action == 'set_ORDER_FREE_TEXT') { $freetext = GETPOST("ORDER_FREE_TEXT", 'none'); // No alpha here, we want exact string @@ -183,12 +169,10 @@ elseif ($action == 'set_ORDER_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == "setshippableiconinlist") { +} elseif ($action == "setshippableiconinlist") { // Activate Set Shippable Icon In List $setshippableiconinlist = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); @@ -198,8 +182,7 @@ elseif ($action == "setshippableiconinlist") { } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'setribchq') +} elseif ($action == 'setribchq') { $rib = GETPOST('rib', 'alpha'); $chq = GETPOST('chq', 'alpha'); @@ -212,8 +195,7 @@ elseif ($action == 'setribchq') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -228,8 +210,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -244,8 +225,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -326,8 +306,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->COMMANDE_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -391,8 +370,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -461,8 +439,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -473,8 +450,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->COMMANDE_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 +483,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -581,17 +556,14 @@ if (empty($conf->facture->enabled)) $i++; } print ""; - } - else { + } else { print "".$langs->trans("NoActiveBankAccountDefined").""; } } - } - else { + } else { print ''.$langs->trans("BankModuleNotActive").''; } -} -else { +} else { print ''.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).''; } print ""; @@ -628,8 +600,7 @@ if (empty($conf->facture->enabled)) } } print ""; -} -else { +} else { print ''.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).''; } print ""; @@ -666,8 +637,7 @@ $variablename = 'ORDER_FREE_TEXT'; 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 b5ae98378c9..f0aaf3fd074 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -84,8 +84,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); } @@ -145,8 +144,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { $imgThumbSmall = $reg[1]; // Save only basename dolibarr_set_const($db, $constant."_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbSmall); + } else dol_syslog($imgThumbSmall); // Create mini thumb, Used on menu or for setup page for example $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); @@ -154,22 +152,18 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) { $imgThumbMini = $reg[1]; // Save only basename dolibarr_set_const($db, $constant."_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbMini); - } - else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); + } else dol_syslog($imgThumbMini); + } else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); $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'); @@ -225,8 +219,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if (!isset($_REQUEST['lt1'])) { 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); @@ -236,8 +229,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if (!isset($_REQUEST['lt2'])) { 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); @@ -246,8 +238,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if (!$error) { $db->commit(); - } - else { + } else { $db->rollback(); } @@ -281,8 +272,7 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb { $imgThumbSmall = $reg[1]; // Save only basename dolibarr_set_const($db, $constant."_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbSmall); + } else dol_syslog($imgThumbSmall); // Create mini thumbs. Used on menu or for setup page for example $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini', $quality); @@ -290,20 +280,17 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb { $imgThumbMini = $reg[1]; // Save only basename dolibarr_set_const($db, $constant."_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbMini); + } else dol_syslog($imgThumbMini); 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'); @@ -574,8 +561,7 @@ if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') if (!empty($mysoc->country_code)) { print ''; - } - else { + } else { print $countrynotdefined; } print ''; @@ -588,8 +574,7 @@ if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') if (!empty($mysoc->country_code)) { print ''; - } - else { + } else { print $countrynotdefined; } print ''; @@ -602,8 +587,7 @@ if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') if (!empty($mysoc->country_code)) { print ''; - } - else { + } else { print $countrynotdefined; } print ''; @@ -616,8 +600,7 @@ if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') if (!empty($mysoc->country_code)) { print ''; - } - else { + } else { print $countrynotdefined; } print ''; @@ -630,8 +613,7 @@ if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') if (!empty($mysoc->country_code)) { print ''; - } - else { + } else { print $countrynotdefined; } print ''; @@ -644,8 +626,7 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') if (!empty($mysoc->country_code)) { print ''; - } - else { + } else { print $countrynotdefined; } print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 7c1c64369ad..4b98d8975eb 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -101,8 +101,7 @@ if ($action == 'update') if (!$error) { 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 3f5cc1cd920..620a6fe01ea 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -70,8 +70,7 @@ if ($action == 'activate_delivery') dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; -} -elseif ($action == 'disable_delivery') +} elseif ($action == 'disable_delivery') { dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); header("Location: confexped.php"); @@ -135,8 +134,7 @@ print ''; 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 9da7fb10bbf..18252d0849c 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -85,8 +85,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) $constname = ""; $constvalue = ""; $constnote = ""; - } - else { + } else { dol_print_error($db); } } @@ -103,8 +102,7 @@ if (!empty($consts) && $action == 'update') if (dolibarr_set_const($db, $const["name"], $const["value"], $const["type"], 1, $const["note"], $const["entity"]) >= 0) { $nbmodified++; - } - else { + } else { dol_print_error($db); } } @@ -124,8 +122,7 @@ if (!empty($consts) && $action == 'delete') if (dolibarr_del_const($db, $const["rowid"], -1) >= 0) { $nbdeleted++; - } - else { + } else { dol_print_error($db); } } @@ -140,8 +137,7 @@ if ($action == 'delete') if (dolibarr_del_const($db, $rowid, $entity) >= 0) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - } - else { + } else { dol_print_error($db); } } @@ -226,8 +222,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) print ''; print ''; print ''; -} -else { +} else { print ''; print ''; } @@ -292,8 +287,7 @@ if ($result) print ''; print ''; print ''; - } - else { + } else { print ''; print ''; } @@ -301,8 +295,7 @@ if ($result) if ($conf->use_javascript_ajax) { print ''; - } - else { + } else { print ''.img_delete().''; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index f3c50287107..474227349b8 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -62,13 +62,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') // For contract +} elseif ($action == 'specimen') // For contract { $modele = GETPOST('module', 'alpha'); @@ -99,13 +96,11 @@ 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); } @@ -115,9 +110,7 @@ elseif ($action == 'specimen') // For contract elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -142,17 +135,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated dolibarr_set_const($db, "CONTRACT_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'set_other') +} elseif ($action == 'set_other') { $freetext = GETPOST('CONTRACT_FREE_TEXT', 'none'); // No alpha here, we want exact string $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); @@ -165,8 +154,7 @@ elseif ($action == 'set_other') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -238,8 +226,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''; $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -247,8 +234,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->CONTRACT_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -311,8 +297,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -381,8 +366,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -393,8 +377,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->CONTRACT_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 ''; @@ -425,8 +408,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 ''; @@ -473,8 +455,7 @@ $variablename = 'CONTRACT_FREE_TEXT'; 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 b7cb424d2cb..2937de3ed51 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -96,12 +96,10 @@ if ($action == 'edit') if ($key == 'DAV_ALLOW_PRIVATE_DIR') { print $langs->trans("AlwaysActive"); - } - elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') + } elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') { print $form->selectyesno($key, $conf->global->$key, 1); - } - else { + } else { print ''; } print ''; @@ -115,8 +113,7 @@ if ($action == 'edit') print ''; print '
'; -} -else { +} else { print ''; print ''; @@ -134,12 +131,10 @@ else { if ($key == 'DAV_ALLOW_PRIVATE_DIR') { print $langs->trans("AlwaysActive"); - } - elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') + } elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') { 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 dad99b2ab39..f9dae118316 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -58,8 +58,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 2622d5ca514..10b6a536e9f 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -150,8 +150,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac $defaulturl = ''; $defaultkey = ''; $defaultvalue = ''; - } - else { + } else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); $action = ''; @@ -168,8 +167,7 @@ if ($action == 'delete') if ($result >= 0) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - } - else { + } else { dol_print_error($db); } } @@ -195,8 +193,7 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $enabledisablehtml .= ''; $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'); @@ -257,8 +254,7 @@ $texthelp = $langs->trans("TheKeyIsTheNameOfHtmlField"); if ($mode != 'sortorder') { $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); -} -else { +} else { $texthelp = 'field or alias.field'; $textkey = $form->textwithpicto($langs->trans("Field"), $texthelp); } @@ -276,8 +272,7 @@ if ($mode != 'focus' && $mode != 'mandatory') $texthelp .= $key.' -> '.$val.'
'; } $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); } @@ -316,8 +311,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity) print '
'; -} -else { +} else { print ''; @@ -387,8 +381,7 @@ if ($result) print ''.img_edit().''; print '   '; print ''.img_delete().''; - } - else { + } else { print ''; print ''; print '
'; @@ -401,8 +394,7 @@ if ($result) print "\n"; $i++; } -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 26f2f87e2d5..2ece442d74f 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -249,8 +249,7 @@ if ($action == 'edit') print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print ''; // We see environment, but to change it we must switch on other entity print ''; print ''; print '
'; -} -else { +} else { /* * Show parameters */ diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7ed84b59629..7f468cc1f1a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -697,8 +697,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if (in_array($tablib[$id], array('DictionaryCompanyType', 'DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries { $_POST["country"] = ''; - } - else { + } else { $ok = 0; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } @@ -758,8 +757,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); - } - elseif ($value == 'entity') { + } elseif ($value == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); } @@ -768,15 +766,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($keycode == 'sortorder') // For column name 'sortorder', we use the field name 'position' { $sql .= "'".(int) GETPOST('position', 'int')."'"; - } - elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' + } elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } - elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); - } - else { + } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } @@ -790,12 +785,10 @@ 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'); - } - else { + } else { dol_print_error($db); } } @@ -804,8 +797,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // If verif ok and action modify, modify the line if ($ok && GETPOST('actionmodify')) { - if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } - else { $rowidcol = "rowid"; } + if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; } // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; @@ -823,8 +815,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); - } - elseif ($field == 'entity') { + } elseif ($field == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); } @@ -833,15 +824,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($listfieldvalue[$i] == 'sortorder') // For column name 'sortorder', we use the field name 'position' { $sql .= (int) GETPOST('position', 'int'); - } - elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' + } elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = '' elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } - elseif (in_array($keycode, array('private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); - } - else { + } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } @@ -868,8 +856,7 @@ if (GETPOST('actioncancel')) if ($action == 'confirm_delete' && $confirm == 'yes') // delete { - if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } - else { $rowidcol = "rowid"; } + if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; } $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); @@ -880,8 +867,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); - } - else { + } else { dol_print_error($db); } } @@ -890,13 +876,11 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete // activate if ($action == $acts[0]) { - if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } - else { $rowidcol = "rowid"; } + if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; } if ($rowid) { $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); - } - elseif ($code) { + } elseif ($code) { $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } @@ -910,13 +894,11 @@ if ($action == $acts[0]) // disable if ($action == $acts[1]) { - if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } - else { $rowidcol = "rowid"; } + if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; } if ($rowid) { $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); - } - elseif ($code) { + } elseif ($code) { $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } @@ -930,13 +912,11 @@ if ($action == $acts[1]) // favorite if ($action == 'activate_favorite') { - if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } - else { $rowidcol = "rowid"; } + if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; } if ($rowid) { $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); - } - elseif ($code) { + } elseif ($code) { $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } @@ -950,13 +930,11 @@ if ($action == 'activate_favorite') // disable favorite if ($action == 'disable_favorite') { - if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } - else { $rowidcol = "rowid"; } + if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; } if ($rowid) { $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); - } - elseif ($code) { + } elseif ($code) { $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } @@ -1053,8 +1031,7 @@ if ($id) // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value $tabsqlsort[$id] = preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i', '', $tabsqlsort[$id]); $tabsqlsort[$id] = preg_replace('/([a-z]+\.)?'.$sortfield.',/i', '', $tabsqlsort[$id]); - } - else { + } else { $sql .= " ORDER BY "; } $sql .= $tabsqlsort[$id]; @@ -1291,15 +1268,13 @@ if ($id) print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth150 maxwidthonsmartphone'); print ''; $filterfound++; - } - elseif ($value == 'code') + } elseif ($value == 'code') { print ''; print ''; print ''; $filterfound++; - } - else { + } else { print ''; print ''; } @@ -1434,8 +1409,7 @@ if ($id) print ''; 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 @@ -1461,29 +1435,23 @@ if ($id) if ($value == 'element') { $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; - } - elseif ($value == 'source') + } elseif ($value == 'source') { $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow; - } - elseif ($valuetoshow == 'all') { + } elseif ($valuetoshow == 'all') { $valuetoshow = $langs->trans('All'); - } - elseif ($fieldlist[$field] == 'country') { + } elseif ($fieldlist[$field] == 'country') { if (empty($obj->country_code)) { $valuetoshow = '-'; - } - else { + } else { $key = $langs->trans("Country".strtoupper($obj->country_code)); $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); } - } - elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { + } elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { $valuetoshow = yn($valuetoshow); $class = "center"; - } - elseif ($fieldlist[$field] == 'type_cdr') { + } elseif ($fieldlist[$field] == 'type_cdr') { if (empty($valuetoshow)) $valuetoshow = $langs->trans('None'); elseif ($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth'); elseif ($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext'); @@ -1494,130 +1462,102 @@ if ($id) if ($value == 'private') { $valuetoshow = yn($elementList[$valuetoshow]); - } - elseif ($fieldlist[$field] == 'libelle_facture') { + } elseif ($fieldlist[$field] == 'libelle_facture') { $langs->load("bills"); $key = $langs->trans("PaymentCondition".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); $valuetoshow = nl2br($valuetoshow); - } - elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_country') { + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_country') { $key = $langs->trans("Country".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_availability') { + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_availability') { $langs->load("propal"); $key = $langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_actioncomm') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_actioncomm') { $key = $langs->trans("Action".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif (!empty($obj->code_iso) && $fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_currencies') { + } elseif (!empty($obj->code_iso) && $fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_currencies') { $key = $langs->trans("Currency".strtoupper($obj->code_iso)); $valuetoshow = ($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_typent') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_typent') { $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_prospectlevel') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_prospectlevel') { $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_civility') { + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_civility') { $key = $langs->trans("Civility".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "Civility".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_contact') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_contact') { $langs->load('agenda'); $key = $langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_payment_term') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_payment_term') { $langs->load("bills"); $key = $langs->trans("PaymentConditionShort".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') { $langs->load("bills"); $key = $langs->trans("PaymentType".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'type' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') { + } elseif ($fieldlist[$field] == 'type' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') { $payment_type_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth')); $valuetoshow = $payment_type_list[$valuetoshow]; - } - elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_reason') { + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_reason') { $key = $langs->trans("DemandReasonType".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "DemandReasonType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_method') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_method') { $langs->load("orders"); $key = $langs->trans($obj->code); $valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->{$fieldlist[$field]}; - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_shipment_mode') { + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_shipment_mode') { $langs->load("sendings"); $key = $langs->trans("SendingMethod".strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != "SendingMethod".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paper_format') + } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paper_format') { $key = $langs->trans('PaperFormat'.strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') { $langs->load('trips'); $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { + } elseif ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { $showfield = 0; - } - elseif ($fieldlist[$field] == 'unicode') { + } elseif ($fieldlist[$field] == 'unicode') { $valuetoshow = $langs->getCurrencySymbol($obj->code, 1); - } - elseif ($fieldlist[$field] == 'label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX.'c_units') { + } elseif ($fieldlist[$field] == 'label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX.'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'short_label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX.'c_units') { + } elseif ($fieldlist[$field] == 'short_label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX.'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); - } - elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) + } elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) { $key = $langs->trans('SizeUnit'.strtolower($obj->unit)); $valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'localtax1' || $fieldlist[$field] == 'localtax2') { + } elseif ($fieldlist[$field] == 'localtax1' || $fieldlist[$field] == 'localtax2') { $class = "center"; - } - elseif ($fieldlist[$field] == 'localtax1_type') { + } elseif ($fieldlist[$field] == 'localtax1_type') { if ($obj->localtax1 != 0) $valuetoshow = $localtax_typeList[$valuetoshow]; else $valuetoshow = ''; $class = "center"; - } - elseif ($fieldlist[$field] == 'localtax2_type') { + } elseif ($fieldlist[$field] == 'localtax2_type') { if ($obj->localtax2 != 0) $valuetoshow = $localtax_typeList[$valuetoshow]; else $valuetoshow = ''; $class = "center"; - } - elseif ($fieldlist[$field] == 'taux') { + } elseif ($fieldlist[$field] == 'taux') { $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); $class = "center"; } elseif (in_array($fieldlist[$field], array('recuperableonly'))) { $class = "center"; - } - elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') { + } elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') { $valuetoshow = length_accountg($valuetoshow); - } - elseif ($fieldlist[$field] == 'fk_tva') + } elseif ($fieldlist[$field] == 'fk_tva') { foreach ($form->cache_vatrates as $key => $Tab) { @@ -1627,23 +1567,19 @@ if ($id) break; } } - } - elseif ($fieldlist[$field] == 'fk_c_exp_tax_cat') + } elseif ($fieldlist[$field] == 'fk_c_exp_tax_cat') { $valuetoshow = getDictvalue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow); $valuetoshow = $langs->trans($valuetoshow); - } - elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') + } elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') { $valuetoshow = $langs->trans($valuetoshow); - } - elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_units') + } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_units') { $langs->load('other'); $key = $langs->trans($obj->label); $valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$fieldlist[$field]}); - } - elseif ($fieldlist[$field] == 'code' && $id == 3) { + } elseif ($fieldlist[$field] == 'code' && $id == 3) { $valuetoshow = $obj->state_code; } $class .= ($class ? ' ' : '').'tddict'; @@ -1664,9 +1600,7 @@ if ($id) $canbemodified = 1; if (isset($obj->code) && $id != 10) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; } - elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } - elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) { @@ -1720,8 +1654,7 @@ if ($id) if ($user->admin) print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ''; - } - else print ' '; + } else print ' '; print "\n"; } @@ -1731,14 +1664,12 @@ if ($id) print ''; print ''; - } - else { + } else { dol_print_error($db); } print ''; -} -else { +} else { /* * Show list of dictionary to show */ @@ -1771,8 +1702,7 @@ else { if (!empty($tabcond[$i])) { print ''.$langs->trans($tablib[$i]).''; - } - else { + } else { print $langs->trans($tablib[$i]); } print ''; @@ -1784,8 +1714,7 @@ else { print ''; print ''.$tabname[$i].''; $lastlineisempty = false; - } - else { + } else { if (!$lastlineisempty) { $showemptyline = 1; @@ -1840,8 +1769,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $langs->trans($hidden); print ''; - } - elseif ($fieldlist[$field] == 'country') + } elseif ($fieldlist[$field] == 'country') { if (in_array('region_id', $fieldlist)) { @@ -1853,8 +1781,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $fieldname = 'country'; print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')), $fieldname, '', 28, 'maxwidth150 maxwidthonsmartphone'); print ''; - } - elseif ($fieldlist[$field] == 'country_id') + } elseif ($fieldlist[$field] == 'country_id') { if (!in_array('country', $fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { @@ -1863,21 +1790,18 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print ''; } - } - elseif ($fieldlist[$field] == 'region') + } elseif ($fieldlist[$field] == 'region') { print ''; $formcompany->select_region($region_id, 'region'); print ''; - } - elseif ($fieldlist[$field] == 'region_id') + } elseif ($fieldlist[$field] == 'region_id') { $region_id = (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:0); print ''; print ''; print ''; - } - elseif ($fieldlist[$field] == 'lang') + } elseif ($fieldlist[$field] == 'lang') { print ''; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); @@ -1896,28 +1820,24 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $form->selectarray('source', $sourceList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'')); print ''; - } - elseif ($fieldlist[$field] == 'private') + } elseif ($fieldlist[$field] == 'private') { print ''; print $form->selectyesno("private", (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'')); print ''; - } - elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") + } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") { $type = (!empty($obj->type) ? $obj->type : 'user'); // Check if type is different of 'user' (external module) print ''; print $type.''; print ''; - } - elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX.'c_paiement') + } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX.'c_paiement') { print ''; $select_list = array(0=>$langs->trans('PaymentTypeCustomer'), 1=>$langs->trans('PaymentTypeSupplier'), 2=>$langs->trans('PaymentTypeBoth')); print $form->selectarray($fieldlist[$field], $select_list, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'2')); print ''; - } - elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { + } elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { if ($fieldlist[$field] == 'type_cdr') print ''; else print ''; if ($fieldlist[$field] == 'type_cdr') { @@ -1926,15 +1846,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1); } print ''; - } - elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) { + } elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) { $class = "left"; if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) $class = "center"; // Fields aligned on right print ''; print ''; print ''; - } - elseif (in_array($fieldlist[$field], array('libelle_facture'))) { + } elseif (in_array($fieldlist[$field], array('libelle_facture'))) { print ''; $transfound = 0; $transkey = ''; @@ -1952,19 +1870,15 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (!$transfound) { print ''; - } - else { + } else { print ''; } print ''; - } - elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) { + } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) { print ''; - } - elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { + } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { print ''; - } - elseif ($fieldlist[$field] == 'unit') { + } elseif ($fieldlist[$field] == 'unit') { print ''; $units = array( 'mm' => $langs->trans('SizeUnitmm'), @@ -1981,8 +1895,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $form->selectarray($fieldlist[$field], $localtax_typeList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'')); print ''; - } - elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') + } elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') { print ''; if (!empty($conf->accounting->enabled)) @@ -1990,32 +1903,27 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $fieldname = $fieldlist[$field]; $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 ''; } print ''; - } - elseif ($fieldlist[$field] == 'fk_tva') + } elseif ($fieldlist[$field] == 'fk_tva') { print ''; print $form->load_tva('fk_tva', $obj->taux, $mysoc, new Societe($db), 0, 0, '', false, -1); print ''; - } - elseif ($fieldlist[$field] == 'fk_c_exp_tax_cat') + } elseif ($fieldlist[$field] == 'fk_c_exp_tax_cat') { print ''; print $form->selectExpenseCategories($obj->fk_c_exp_tax_cat); print ''; - } - elseif ($fieldlist[$field] == 'fk_range') + } elseif ($fieldlist[$field] == 'fk_range') { print ''; print $form->selectExpenseRanges($obj->fk_range); print ''; - } - else { + } else { $fieldValue = isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''; if ($fieldlist[$field] == 'sortorder') @@ -2049,8 +1957,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (!$transfound) { print ''; - } - else { + } else { print ''; } print ''; diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 6eaf1cf375a..0227db8d969 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -237,8 +237,7 @@ class PrestaShopWebservice throw new PrestaShopWebserviceException('HTTP XML response is not parsable: '.$msg); } return $xml; - } - else { + } else { throw new PrestaShopWebserviceException('HTTP response is empty'); } } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index b9af92dc8a5..145dfc6cbf8 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -41,8 +41,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -54,8 +53,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -91,13 +89,11 @@ print ''; 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').''; - } - elseif (!empty($conf->global->USER_MAIL_REQUIRED)) + } elseif (!empty($conf->global->USER_MAIL_REQUIRED)) { print ''.img_picto($langs->trans("Enabled"), 'on').''; } diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index a554354420d..21dfb60c96e 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -126,8 +126,7 @@ if (GETPOST('addfilter', 'alpha')) if ($result > 0) { $object->fetchFilters(); - } - else { + } else { setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); } } @@ -140,8 +139,7 @@ if ($action == 'deletefilter') if ($result > 0) { $object->fetchFilters(); - } - else { + } else { setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors'); } } @@ -160,8 +158,7 @@ if (GETPOST('addoperation', 'alpha')) if ($result > 0) { $object->fetchActions(); - } - else { + } else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -178,8 +175,7 @@ if ($action == 'updateoperation') if ($result > 0) { $object->fetchActions(); - } - else { + } else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -191,8 +187,7 @@ if ($action == 'deleteoperation') if ($result > 0) { $object->fetchActions(); - } - else { + } else { setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors'); } } @@ -206,8 +201,7 @@ if ($action == 'confirm_collect') { $debuginfo = $object->debuginfo; setEventMessages($object->lastresult, null, 'mesgs'); - } - else { + } else { $debuginfo = $object->debuginfo; setEventMessages($object->error, null, 'errors'); } @@ -426,23 +420,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $connection = imap_open($connectstringsource, $object->login, $object->password); - } - catch (Exception $e) + } catch (Exception $e) { print $e->getMessage(); } $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); - } - else { + } else { $morehtml .= 'IMAP functions not available on your PHP'; } if (!$connection) { $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; - } - else { + } else { $morehtml .= imap_num_msg($connection); } @@ -605,8 +596,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (in_array($ruleaction['type'], array('recordevent'))) { print $form->textwithpicto('', $langs->transnoentitiesnoconv('IfTrackingIDFoundEventWillBeLinked')); - } - elseif (in_array($ruleaction['type'], array('loadthirdparty', 'loadandcreatethirdparty'))) { + } elseif (in_array($ruleaction['type'], array('loadthirdparty', 'loadandcreatethirdparty'))) { print $form->textwithpicto('', $langs->transnoentitiesnoconv('EmailCollectorLoadThirdPartyHelp')); } print ''; @@ -616,8 +606,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; print ' '; - } - else { + } else { print $ruleaction['actionparam']; } print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index bb17bbdca05..d2babfeaf5c 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -241,8 +241,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/admin/expedition.php b/htdocs/admin/expedition.php index cd9a2976e11..21cb83c356a 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -71,9 +71,7 @@ if ($action == 'updateMask') setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_param') +} elseif ($action == 'set_param') { $freetext = GETPOST('SHIPPING_FREE_TEXT', 'none'); // No alpha here, we want exact string $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); @@ -95,9 +93,7 @@ elseif ($action == 'set_param') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } -} - -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -128,13 +124,11 @@ 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); } @@ -144,9 +138,7 @@ elseif ($action == 'specimen') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -171,9 +163,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmodel') +} elseif ($action == 'setmodel') { dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -246,8 +236,7 @@ foreach ($dirmodels as $reldir) $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; - } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -255,8 +244,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") { 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 ''; @@ -322,8 +310,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -390,8 +377,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -402,8 +388,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->EXPEDITION_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 ''; @@ -431,8 +416,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -478,8 +462,7 @@ $variablename = 'SHIPPING_FREE_TEXT'; 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 20f85dc6a29..596428d4c7f 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -63,13 +63,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') // For fiche inter +} elseif ($action == 'specimen') // For fiche inter { $modele = GETPOST('module', 'alpha'); @@ -102,13 +99,11 @@ 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); } @@ -122,9 +117,7 @@ elseif ($action == 'set') { dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity); } -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -149,17 +142,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'setoptions') +} elseif ($action == 'setoptions') { $db->begin(); @@ -175,8 +164,7 @@ elseif ($action == 'setoptions') { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -259,8 +247,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->EXPENSEREPORT_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -323,8 +310,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -389,8 +375,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -401,8 +386,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->EXPENSEREPORT_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 ''; @@ -426,8 +410,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'intervention').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -475,8 +458,7 @@ $variablename = 'EXPENSEREPORT_FREE_TEXT'; 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 2b089335c40..ebdc1f7ed59 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -63,8 +63,7 @@ if ($action == 'updateik') header('Location: '.$_SERVER['PHP_SELF']); exit; -} -elseif ($action == 'delete') // TODO add confirm +} elseif ($action == 'delete') // TODO add confirm { $expIk = new ExpenseReportIk($db); if ($id > 0) @@ -161,8 +160,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 0c99b4e4dda..337311b85e7 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -100,11 +100,11 @@ if ($action == 'save') $object->fk_user = (int) $fk_user; $object->fk_usergroup = 0; $object->is_for_all = 0; - }elseif ($apply_to == 'G') { + } elseif ($apply_to == 'G') { $object->fk_usergroup = (int) $fk_usergroup; $object->fk_user = 0; $object->is_for_all = 0; - }elseif ($apply_to == 'A') { + } elseif ($apply_to == 'A') { $object->is_for_all = 1; $object->fk_user = 0; $object->fk_usergroup = 0; @@ -122,8 +122,7 @@ if ($action == 'save') header('Location: '.$_SERVER['PHP_SELF']); exit; } -} -elseif ($action == 'delete') +} elseif ($action == 'delete') { // TODO add confirm $res = $object->delete($user); @@ -228,8 +227,7 @@ foreach ($rules as $rule) echo '
'.$form->selectarray('apply_to', $tab_apply, $selected, 0).'
'; 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().')'; @@ -241,8 +239,7 @@ foreach ($rules as $rule) if ($action == 'edit' && $object->id == $rule->id) { 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 { $key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id'); @@ -257,8 +254,7 @@ foreach ($rules as $rule) if ($action == 'edit' && $object->id == $rule->id) { 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 ''; @@ -268,8 +264,7 @@ foreach ($rules as $rule) if ($action == 'edit' && $object->id == $rule->id) { print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0); - } - else { + } else { echo dol_print_date($rule->dates, 'day'); } echo ''; @@ -279,8 +274,7 @@ foreach ($rules as $rule) if ($action == 'edit' && $object->id == $rule->id) { print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0); - } - else { + } else { echo dol_print_date($rule->datee, 'day'); } echo ''; @@ -290,8 +284,7 @@ foreach ($rules as $rule) if ($action == 'edit' && $object->id == $rule->id) { echo ''.$conf->currency; - } - else { + } else { echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency); } echo ''; @@ -301,8 +294,7 @@ foreach ($rules as $rule) if ($action == 'edit' && $object->id == $rule->id) { echo $form->selectyesno('restrictive', $object->restrictive, 1); - } - else { + } else { echo yn($rule->restrictive, 1, 1); } echo ''; @@ -313,8 +305,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 eac6d7eb8e9..3d81ab01c43 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -60,8 +60,7 @@ if ($result) preg_match('/([0-9]+)$/i', $obj->name, $reg); if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; } -} -else { +} else { dol_print_error($db); } @@ -91,8 +90,7 @@ if ($action == 'add' || GETPOST("modify")) exit; } */ - } - 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')).")')"; @@ -111,8 +109,7 @@ if ($action == 'add' || GETPOST("modify")) $db->commit(); header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -158,8 +155,7 @@ if ($_POST["delete"]) } $db->commit(); - } - else { + } else { $db->rollback(); dol_print_error($db, "sql=".$sql); exit; @@ -174,8 +170,7 @@ if ($_POST["delete"]) $db->commit(); header("Location: external_rss.php"); exit; - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -287,8 +282,7 @@ if ($resql) if ($result > 0 && empty($rss->error)) { print ''.$langs->trans("Online").''; - } - else { + } else { print ''.$langs->trans("Offline"); $langs->load("errors"); if ($rssparser->error) print ' - '.$langs->trans($rssparser->error); @@ -325,8 +319,7 @@ if ($resql) $i++; } -} -else { +} else { dol_print_error($db); } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 6c0c03b6dda..f25a87b6a12 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -71,12 +71,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -107,13 +105,11 @@ 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); } @@ -122,9 +118,7 @@ elseif ($action == 'specimen') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -148,15 +142,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); -} -elseif ($action == 'setribchq') +} elseif ($action == 'setribchq') { $rib = GETPOST('rib', 'alpha'); $chq = GETPOST('chq', 'alpha'); @@ -169,12 +161,10 @@ elseif ($action == 'setribchq') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'set_FACTURE_DRAFT_WATERMARK') +} elseif ($action == 'set_FACTURE_DRAFT_WATERMARK') { $draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha'); @@ -185,13 +175,10 @@ elseif ($action == 'set_FACTURE_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_INVOICE_FREE_TEXT') +} elseif ($action == 'set_INVOICE_FREE_TEXT') { $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string @@ -202,12 +189,10 @@ elseif ($action == 'set_INVOICE_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'setforcedate') +} elseif ($action == 'setforcedate') { $forcedate = GETPOST('forcedate', 'alpha'); @@ -218,12 +203,10 @@ elseif ($action == 'setforcedate') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'setDefaultPDFModulesByType') +} elseif ($action == 'setDefaultPDFModulesByType') { $invoicetypemodels = GETPOST('invoicetypemodels'); @@ -240,8 +223,7 @@ elseif ($action == 'setDefaultPDFModulesByType') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -341,8 +323,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.'.php' == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -453,8 +434,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -524,8 +504,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; @@ -536,8 +515,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->FACTURE_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("SetAsDefault"), 'off').''; } print ''; @@ -570,8 +548,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -677,13 +654,11 @@ if (!empty($conf->banque->enabled)) $i++; } print ""; - } - else { + } else { print ''.$langs->trans("NoActiveBankAccountDefined").''; } } -} -else { +} else { print $langs->trans("BankModuleNotActive"); } print ""; @@ -761,8 +736,7 @@ $variablename = 'INVOICE_FREE_TEXT'; 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/facture_situation.php b/htdocs/admin/facture_situation.php index 223045db2e9..68f8e15e81c 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -246,10 +246,9 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra print ''; if ($type == 'textarea') { print ''; - }elseif ($type == 'input') { + } elseif ($type == 'input') { print ''; - } - else { + } else { // custom print $type; } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 9dfc2cff6d1..e98d02d9f9c 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -126,8 +126,7 @@ if (GETPOST('save', 'alpha')) if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -145,8 +144,7 @@ print '
'; if (empty($conf->use_javascript_ajax)) { setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors'); -} -else { +} else { print ''; print ''; print ''; @@ -168,8 +166,7 @@ else { if ($value == 0) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; - } - elseif ($value == 1) + } elseif ($value == 1) { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } @@ -209,8 +206,7 @@ else { $readonly = ($mode == 'dolibarr_readonly' ? 1 : 0); $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 602570194fd..c28ebcab4b2 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -63,13 +63,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') // For fiche inter +} elseif ($action == 'specimen') // For fiche inter { $modele = GETPOST('module', 'alpha'); @@ -100,13 +97,11 @@ 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); } @@ -116,9 +111,7 @@ elseif ($action == 'specimen') // For fiche inter elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -143,17 +136,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'set_FICHINTER_FREE_TEXT') +} elseif ($action == 'set_FICHINTER_FREE_TEXT') { $freetext = GETPOST('FICHINTER_FREE_TEXT', 'none'); // No alpha here, we want exact string $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); @@ -163,13 +152,10 @@ elseif ($action == 'set_FICHINTER_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') +} elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') { $draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); @@ -179,13 +165,10 @@ elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') +} elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') { $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); @@ -195,8 +178,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { @@ -318,8 +300,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->FICHEINTER_ADDON == $classname) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -381,8 +362,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -449,8 +429,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; - } - else { + } else { print ""; @@ -461,8 +440,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->FICHEINTER_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 ''; @@ -488,8 +466,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'intervention').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -533,8 +510,7 @@ $variablename = 'FICHINTER_FREE_TEXT'; 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 ba602c4b609..0a118dfe065 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -64,8 +64,7 @@ if ($action == 'set') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -181,8 +180,7 @@ if ($geoip) $result = dol_print_ip($ip, 1); 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 58f39e30ff2..5ad46e5bab6 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -64,13 +64,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') // For contract +} elseif ($action == 'specimen') // For contract { $modele = GETPOST('module', 'alpha'); @@ -101,13 +98,11 @@ 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); } @@ -117,9 +112,7 @@ elseif ($action == 'specimen') // For contract elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -144,17 +137,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated dolibarr_set_const($db, "HOLIDAY_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'set_other') +} elseif ($action == 'set_other') { $freetext = GETPOST('HOLIDAY_FREE_TEXT', 'none'); // No alpha here, we want exact string $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); @@ -167,8 +156,7 @@ elseif ($action == 'set_other') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -241,8 +229,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -250,8 +237,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->HOLIDAY_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -326,8 +312,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -397,8 +382,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print '"; @@ -409,8 +393,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->HOLIDAY_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 ''; @@ -441,8 +424,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 ''; @@ -492,8 +474,7 @@ $variablename = 'HOLIDAY_FREE_TEXT'; 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 8df8a120c05..b6233f13146 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -189,20 +189,17 @@ if ($action == 'update') if ($result > 0) { dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity); - } - elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) + } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); $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 33f1abb251f..951b93f908c 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -76,8 +76,7 @@ if (empty($reshook)) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -213,8 +212,7 @@ print ''; @@ -246,8 +244,7 @@ print ''; @@ -292,16 +289,14 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; 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 '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; } - } - else { + } else { print img_picto('', 'warning').' '; print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; print '
'; @@ -314,16 +309,14 @@ if (function_exists("ldap_connect")) print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion3").''; print '
'; - } - else { + } else { print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion2").''; print '
'; } $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 58eb04e595d..54de74c6371 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -78,8 +78,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -291,8 +290,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; @@ -304,8 +302,7 @@ if (function_exists("ldap_connect")) print "LDAP input file used for test:

\n"; 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 a301738db94..4e0c430fb90 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -70,8 +70,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -232,8 +231,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; @@ -245,8 +243,7 @@ if (function_exists("ldap_connect")) print "LDAP input file used for test:

\n"; 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 eba84afe925..0cd09d27f7e 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -95,8 +95,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -414,8 +413,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; @@ -427,8 +425,7 @@ if (function_exists("ldap_connect")) print "LDAP input file used for test:

\n"; 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 6913c477b38..371437e1640 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -68,8 +68,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -214,8 +213,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; @@ -227,8 +225,7 @@ if (function_exists("ldap_connect")) print "LDAP input file used for test:

\n"; 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 d0d3bb50d0d..d5778fbfb1c 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -89,8 +89,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -356,8 +355,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') $objectclass = $conf->global->LDAP_USER_OBJECT_CLASS; show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); -} -elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') +} elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') { $butlabel = $langs->trans("LDAPTestSearch"); $testlabel = 'testsearchuser'; @@ -394,8 +392,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; @@ -407,8 +404,7 @@ if (function_exists("ldap_connect")) print "LDAP input file used for test:

\n"; print nl2br($ldap->dump_content($dn, $info)); print "\n
"; - } - else { + } else { print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; @@ -473,8 +469,7 @@ if (function_exists("ldap_connect")) } $liste[$key] = $label; } - } - else { + } else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } @@ -486,8 +481,7 @@ if (function_exists("ldap_connect")) print "required_fields: ".implode(',', $required_fields)."
\n"; 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 b03067bd581..67106282a47 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -162,8 +162,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 "'; $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'.$langs->trans("LDAPServerPort").''; if (!empty($conf->global->LDAP_SERVER_PORT)) { print ''; -} -else { +} else { print ''; } print ''.$langs->trans("LDAPServerPortExample").'
'.$langs->trans("LDAPPassword").''; if (!empty($conf->global->LDAP_ADMIN_PASS)) { print ''; // je le met en visible pour test -} -else { +} else { print ''; } print ''.$langs->trans('Password').' (ex: secret)
'; print ''; @@ -202,8 +201,7 @@ if (empty($mysoc->country_code)) $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); print '
'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").''; -} -else { +} else { // Show examples print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); @@ -250,8 +248,7 @@ else { $vat_rates[$i] = $obj->vat_rate; } } - } - else dol_print_error($db); + } else dol_print_error($db); if (count($vat_rates)) { @@ -267,8 +264,7 @@ else { print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; } } - } - 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 f6e3c0e63f9..66f3a44cdcf 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -63,8 +63,7 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -79,8 +78,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -116,13 +114,11 @@ 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); } @@ -236,8 +232,7 @@ foreach ($dirmodels as $reldir) $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; - } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -245,8 +240,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -311,8 +305,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -377,8 +370,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; - } - else { + } else { print "
"; @@ -389,8 +381,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->LIVRAISON_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 ''; @@ -409,8 +400,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'sending').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -453,8 +443,7 @@ $variablename = 'DELIVERY_FREE_TEXT'; 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 23cd1fd6bba..651782bb23b 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -63,8 +63,7 @@ if ($action == 'update') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -106,8 +105,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/admin/mailing.php b/htdocs/admin/mailing.php index 020c1ef5241..7690ca02afa 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -65,8 +65,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 100b5cf3224..cbc908f973f 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -65,8 +65,7 @@ if ($action == 'update' || $action == 'add') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -98,8 +97,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); @@ -116,8 +114,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf { $error++; setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); - } - else { + } else { setEventMessages($langs->trans("MailmanCreationSuccess"), null); } } @@ -128,8 +125,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf { $error++; setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); - } - else { + } else { setEventMessages($langs->trans("MailmanDeletionSuccess"), null); } } @@ -207,8 +203,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) print '
'; 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 42ddb907b7d..ebbd549ecf8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -169,8 +169,7 @@ if ($action == 'edit') jQuery("#MAIN_MAIL_SMTP_PORT").hide(); 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); @@ -285,8 +284,7 @@ if ($action == 'edit') if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { 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"); @@ -302,8 +300,7 @@ if ($action == 'edit') print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print '
'; // STARTTLS @@ -413,10 +403,8 @@ if ($action == 'edit') if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS : 0), 1); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print ''; // DKIM @@ -426,10 +414,8 @@ if ($action == 'edit') if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (!empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED) ? $conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED : 0), 1); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print ''; // DKIM Domain @@ -488,8 +474,7 @@ if ($action == 'edit') print ''; print ''; -} -else { +} else { dol_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; @@ -529,8 +514,7 @@ else { if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { print '
'; - } - else { + } else { print ''; } @@ -538,8 +522,7 @@ else { if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { print ''; - } - else { + } else { print ''; } @@ -562,10 +545,8 @@ else { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_TLS); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; print ''; // STARTTLS @@ -575,10 +556,8 @@ else { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; print ''; @@ -591,10 +570,8 @@ else { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print ''; // Domain @@ -642,24 +619,20 @@ else { } $i++; } - } - else dol_print_error($db); + } else dol_print_error($db); print ''; print ''; @@ -709,8 +681,7 @@ else { { print ''.$langs->trans("DoTestServerAvailability").''; } - } - else { + } else { print ''.$langs->trans("DoTestServerAvailability").''; } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 98c44f2b503..f78ef0277bb 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -156,8 +156,7 @@ if ($action == 'edit') jQuery("#smtp_server_mess").show(); 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); @@ -235,8 +234,7 @@ if ($action == 'edit') if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { 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"); @@ -253,8 +251,7 @@ if ($action == 'edit') print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; // STARTTLS @@ -365,10 +355,8 @@ if ($action == 'edit') if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING) ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING : 0), 1); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print ''; 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"); @@ -315,8 +312,7 @@ if ($action == 'edit') print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; - } - else { + } else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -332,8 +328,7 @@ if ($action == 'edit') print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); 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"); @@ -345,8 +340,7 @@ if ($action == 'edit') print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; - } - else { + } else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -364,8 +358,7 @@ if ($action == 'edit') if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { print ''; - } - else { + } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); print ''; @@ -384,8 +377,7 @@ if ($action == 'edit') if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { print ''; - } - else { + } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); print ''; @@ -400,10 +392,8 @@ if ($action == 'edit') if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (!empty($conf->global->MAIN_MAIL_EMAIL_TLS) ? $conf->global->MAIN_MAIL_EMAIL_TLS : 0), 1); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; 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 : '').'
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { print $langs->trans('RobotEmail'); - } - elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { print $langs->trans('UserEmail'); - } - elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } - else { + } else { $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); if ($id > 0) { @@ -687,8 +660,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 '
'; 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"); @@ -266,8 +263,7 @@ if ($action == 'edit') print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; - } - else { + } else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -284,8 +280,7 @@ if ($action == 'edit') print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); 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"); @@ -297,8 +292,7 @@ if ($action == 'edit') print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; - } - else { + } else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); @@ -316,8 +310,7 @@ if ($action == 'edit') if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { print ''; - } - else { + } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print ''; @@ -334,8 +327,7 @@ if ($action == 'edit') if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { print ''; - } - else { + } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print ''; @@ -351,10 +343,8 @@ if ($action == 'edit') if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (!empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING) ? $conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING : 0), 1); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print '
'; @@ -382,8 +370,7 @@ if ($action == 'edit') print ''; print ''; -} -else { +} else { dol_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; @@ -405,8 +392,7 @@ else { if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; - } - else { + } else { print ''.$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 : '').''; } @@ -414,8 +400,7 @@ else { if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; - } - else { + } else { print ''.$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 : '').''; } @@ -438,10 +423,8 @@ else { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print ''; // STARTTLS @@ -451,10 +434,8 @@ else { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING); - } - else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } - else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; print ''; } @@ -495,8 +476,7 @@ else { { print ''.$langs->trans("DoTestServerAvailability").''; } - } - else { + } else { print ''.$langs->trans("DoTestServerAvailability").''; } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index fd5f4e3b1a7..bf841a03abe 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -171,8 +171,7 @@ if (empty($reshook)) $resql = $db->query($sql); if ($resql) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error").' '.$db->lasterror(), null, 'errors'); } } @@ -281,8 +280,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); @@ -449,8 +447,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/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 1dcc621095c..1467c2907a7 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -122,8 +122,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $helpsubstit .= $key.' -> '.$val.'
'; $helpsubstitforlines .= $key.' -> '.$val.'
'; } -} -else { +} else { $tmp = FormMail::getAvailableSubstitKey('formemailwithlines'); $tmp['__(AnyTranslationKey)__'] = 'Translation'; $helpsubstit = $langs->trans("AvailableVariables").':
'; @@ -277,11 +276,9 @@ if (empty($reshook)) elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } - elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); - } - else { + } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } @@ -295,12 +292,10 @@ 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'); - } - else { + } else { dol_print_error($db); } } @@ -335,11 +330,9 @@ if (empty($reshook)) elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } - elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); - } - else { + } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } @@ -353,8 +346,7 @@ if (empty($reshook)) if ($resql) { setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($db->error(), null, 'errors'); } } @@ -373,8 +365,7 @@ if (empty($reshook)) if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); - } - else { + } else { dol_print_error($db); } } @@ -501,8 +492,7 @@ foreach ($fieldlist as $field => $value) { if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover - } - else print $valuetoshow; + } else print $valuetoshow; print ''; } } @@ -569,11 +559,9 @@ foreach ($fieldsforcontent as $tmpfieldlist) // Input field if ($tmpfieldlist == 'topic') { print ''; - } - elseif ($tmpfieldlist == 'joinfiles') { + } elseif ($tmpfieldlist == 'joinfiles') { print ''; - } - else { + } else { if ($context != 'hide') { // print ''; $okforextended = true; @@ -581,8 +569,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) $okforextended = false; $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') { @@ -654,8 +641,7 @@ if ($resql) print ''; print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth100'); print ''; - } - elseif ($value == 'fk_user') + } elseif ($value == 'fk_user') { print ''; $restrictid = array(); @@ -663,13 +649,11 @@ if ($resql) //var_dump($restrictid); print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth100'); print ''; - } - elseif ($value == 'topic') print ''; + } elseif ($value == 'topic') print ''; elseif ($value == 'type_template') { print ''.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100 maxwidth100onsmartphone').''; - } - elseif (!in_array($value, array('content', 'content_lines'))) print ''; + } elseif (!in_array($value, array('content', 'content_lines'))) print ''; } if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print ''; // Action column @@ -795,8 +779,7 @@ if ($resql) } print "\n"; - } - else { + } else { $keyforobj = 'type_template'; if (!in_array($obj->$keyforobj, array_keys($elementList))) { @@ -938,8 +921,7 @@ if ($resql) $i++; } } -} -else { +} else { dol_print_error($db); } @@ -981,22 +963,19 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($user->admin) { 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); $fuser->fetch($obj->{$fieldlist[$field]}); print $fuser->getNomUrl(1); $forcedvalue = $fuser->id; - } - else { + } else { $forcedvalue = $obj->{$fieldlist[$field]}; } } @@ -1004,8 +983,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; } print ''; - } - elseif ($fieldlist[$field] == 'lang') + } elseif ($fieldlist[$field] == 'lang') { print ''; if (!empty($conf->global->MAIN_MULTILANGS)) @@ -1013,8 +991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang; 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]}); @@ -1034,13 +1011,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') // Current tempalte type is an unknown type, so we must keep it as it is. 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 ''; - } - elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; + } 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 { @@ -1059,13 +1034,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (empty($user->admin)) { 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 b66ab89075f..0b19285a072 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -96,8 +96,7 @@ if ($action == 'update' && !$cancel) if ($result > 0) { $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 a059a76b40c..d92a3b30504 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -124,8 +124,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; } @@ -214,8 +213,7 @@ if ($action == 'add') if (is_numeric(GETPOST('menuId', 'alpha', 3))) { $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; @@ -227,8 +225,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'); } @@ -251,8 +248,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs'); llxFooter(); exit; - } - else { + } else { $this->db->rollback(); $reload = 0; @@ -348,8 +344,7 @@ if ($action == 'create') { print $langs->trans('Left'); print ''; - } - else { + } else { print ''; - } - else { + } else { print ''; } print ''.$langs->trans('DetailMenuIdParent'); @@ -413,8 +407,7 @@ if ($action == 'create') print ''; print ''; -} -elseif ($action == 'edit') +} elseif ($action == 'edit') { print load_fiche_titre($langs->trans("ModifMenu"), '', 'title_setup'); print '
'; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index f27968d462d..590b6eb8034 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -118,9 +118,7 @@ if ($action == 'up') $sql .= " WHERE m.rowid = ".$previous['rowid']; // Descend celui du dessus dol_syslog("admin/menus/index.php ".$sql); $db->query($sql); -} - -elseif ($action == 'down') +} elseif ($action == 'down') { $current = array(); $next = array(); @@ -174,9 +172,7 @@ elseif ($action == 'down') $sql .= " WHERE m.rowid = ".$next['rowid']; dol_syslog("admin/menus/index.php ".$sql); $db->query($sql); -} - -elseif ($action == 'confirm_delete' && $confirm == 'yes') +} elseif ($action == 'confirm_delete' && $confirm == 'yes') { $db->begin(); @@ -191,8 +187,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; @@ -407,8 +402,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 145ec566057..6d88153611d 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -41,8 +41,7 @@ if ($action == 'activate_hidemenu') dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; -} -elseif ($action == 'disable_hidemenu') +} elseif ($action == 'disable_hidemenu') { dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); @@ -94,8 +93,7 @@ print ''; 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 ""; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 7b64dd08bd0..1cfd1c550c6 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -139,8 +139,7 @@ foreach ($modulesdir as $dir) if ($publisher) { $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; - } - else { + } else { $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } @@ -178,19 +177,15 @@ foreach ($modulesdir as $dir) else $categ[$specialstring] = 1; $j++; $i++; - } - else dol_syslog("Module ".get_class($objMod)." not qualified"); - } - catch (Exception $e) + } else dol_syslog("Module ".get_class($objMod)." not qualified"); + } catch (Exception $e) { 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)
"; } - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } @@ -198,8 +193,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); } } @@ -327,8 +321,7 @@ if ($mode == 'desc') if (!empty($objMod->editor_url) && !preg_match('/dolibarr\.org/i', $objMod->editor_url)) $textexternal .= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' '.$objMod->editor_url.''; $text .= $textexternal; $text .= '
'; - } - else { + } else { $text .= '
'.$langs->trans("Origin").': '.$langs->trans("Core").'
'; } @@ -359,8 +352,7 @@ if ($mode == 'feature') $i++; } $text .= ')'; - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -373,8 +365,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').$val; $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -383,8 +374,7 @@ if ($mode == 'feature') if (dol_is_file($filedata)) { $text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql)'; - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -402,8 +392,7 @@ if ($mode == 'feature') $i++; } } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -411,8 +400,7 @@ if ($mode == 'feature') if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) { $text .= $langs->trans("Yes"); - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -420,8 +408,7 @@ if ($mode == 'feature') if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) { $text .= $langs->trans("Yes"); - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -434,8 +421,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').($val['label']); $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -444,8 +430,7 @@ if ($mode == 'feature') if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers']) { $yesno = 'Yes'; - } - else { + } else { $yesno = 'No'; } require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; @@ -473,8 +458,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').($val['file'] ? $val['file'] : $val[0]); $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -504,8 +488,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').($val); $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -518,8 +501,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').($val[1]); $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -527,8 +509,7 @@ if ($mode == 'feature') if (isset($objMod->menu) && !empty($objMod->menu)) // objMod can be an array or just an int 1 { $text .= $langs->trans("Yes"); - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -541,8 +522,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').($val); $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; @@ -555,8 +535,7 @@ if ($mode == 'feature') $text .= ($i ? ', ' : '').($val); $i++; } - } - else $text .= $langs->trans("No"); + } else $text .= $langs->trans("No"); $text .= '
'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index dba149a2bb0..688e310b308 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -125,8 +125,7 @@ if ($action == 'install') $langs->load("Error"); setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings'); $error++; - } - else { + } else { if (!$error && !preg_match('/\.zip$/i', $original_file)) { $langs->load("errors"); @@ -172,8 +171,7 @@ if ($action == 'install') $langs->load("errors"); 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); @@ -228,8 +226,7 @@ if ($action == 'install') } } } - } - else { + } else { setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors'); $error++; } @@ -260,14 +257,12 @@ if ($action == 'set' && $user->admin) $msg = $langs->trans('ModuleEnabledAdminMustCheckRights'); setEventMessages($msg, null, 'warnings'); } - } - else dol_print_error($db); + } else dol_print_error($db); } } header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y ? '&page_y='.$page_y : '')); exit; -} -elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') +} elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') { $result = unActivateModule($value); if ($result) setEventMessages($result, null, 'errors'); @@ -370,8 +365,7 @@ foreach ($modulesdir as $dir) if ($publisher) { $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher; - } - else { + } else { $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers"); } } @@ -424,19 +418,15 @@ foreach ($modulesdir as $dir) else $categ[$specialstring] = 1; $j++; $i++; - } - else dol_syslog("Module ".get_class($objMod)." not qualified"); - } - catch (Exception $e) + } else dol_syslog("Module ".get_class($objMod)." not qualified"); + } catch (Exception $e) { 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)
"; } - } - catch (Exception $e) + } catch (Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } @@ -444,8 +434,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); } } @@ -698,8 +687,7 @@ if ($mode == 'common' || $mode == 'commonkanban') if (!empty($objMod->disabled)) { $codeenabledisable .= $langs->trans("Disabled"); - } - elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) + } elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) { if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) $codeenabledisable .= $langs->trans("Used"); else { @@ -707,14 +695,12 @@ if ($mode == 'common' || $mode == 'commonkanban') //print $langs->trans("Required"); } 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'); $codeenabledisable .= ''; - } - else { + } else { $codeenabledisable .= ''; $codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on'); $codeenabledisable .= ''; @@ -742,44 +728,36 @@ 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').''; } } } - } - elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) + } elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) { $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)) { // Should never happened - } - elseif (!empty($objMod->disabled)) + } elseif (!empty($objMod->disabled)) { $codeenabledisable .= $langs->trans("Disabled"); - } - else { + } else { // Module qualified for activation $warningmessage = ''; if (!empty($arrayofwarnings[$modName])) @@ -842,8 +820,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().''; @@ -1012,8 +989,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))) @@ -1022,14 +998,12 @@ if ($mode == 'deploy') $message = info_admin($langs->trans("ErrorFailedToWriteInDir", $dirins), 0, 0, '1', 'warning'); $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; } @@ -1049,8 +1023,7 @@ if ($mode == 'deploy') if ($allowfromweb == 1) { //print $langs->trans("ThisIsProcessToFollow").'
'; - } - else { + } else { print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; print ''.$langs->trans("StepNb", 1).': '; print $langs->trans("FindPackageFromWebSite", $fullurl).'
'; @@ -1130,8 +1103,7 @@ if ($mode == 'deploy') print ' '; print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1); } - } - else { + } else { print ' ('.$langs->trans("UploadDisabled").')'; } @@ -1141,8 +1113,7 @@ if ($mode == 'deploy') print '
'; 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 ddf55993fd7..de1a6888de0 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -58,13 +58,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -95,13 +92,11 @@ 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); } @@ -111,9 +106,7 @@ elseif ($action == 'specimen') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -138,17 +131,13 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Check if numbering module chosen can be activated // by calling method canBeActivated dolibarr_set_const($db, "MRP_MO_ADDON", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK') +} elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK') { $draft = GETPOST("MRP_MO_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "MRP_MO_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); @@ -158,13 +147,10 @@ elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_MRP_MO_FREE_TEXT') +} elseif ($action == 'set_MRP_MO_FREE_TEXT') { $freetext = GETPOST("MRP_MO_FREE_TEXT", 'none'); // No alpha here, we want exact string @@ -175,8 +161,7 @@ elseif ($action == 'set_MRP_MO_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -257,8 +242,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->MRP_MO_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -322,8 +306,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -392,8 +375,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -404,8 +386,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->MRP_MO_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 ''; @@ -433,8 +414,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -479,8 +459,7 @@ $variablename = 'MRP_MO_FREE_TEXT'; 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 1b912b27b5e..a7e073f08d2 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -53,8 +53,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -65,8 +64,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if (dolibarr_del_const($db, $code, 0) > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -94,11 +92,9 @@ if ($action == 'add_currency') { if ($currency->addRate($rate)) setEventMessages($langs->trans('RecordSaved'), array()); else setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors'); - } - else setEventMessages($langs->trans('ErrorAddCurrencyFail'), $currency->errors, 'errors'); + } else setEventMessages($langs->trans('ErrorAddCurrencyFail'), $currency->errors, 'errors'); } -} -elseif ($action == 'update_currency') +} elseif ($action == 'update_currency') { $error = 0; @@ -123,8 +119,7 @@ elseif ($action == 'update_currency') } } } - } - elseif (GETPOST('deletecurrency', 'alpha')) + } elseif (GETPOST('deletecurrency', 'alpha')) { $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); $currency = new MultiCurrency($db); @@ -135,16 +130,14 @@ elseif ($action == 'update_currency') else setEventMessages($langs->trans('ErrorDeleteCurrencyFail'), array(), 'errors'); } } -} -elseif ($action == 'setapilayer') +} elseif ($action == 'setapilayer') { if (GETPOSTISSET('modify_apilayer')) { dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha')); 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 859d36b7c36..a32cd0fa1f5 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -84,8 +84,7 @@ if ($action == 'settemplates') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); @@ -105,8 +104,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); @@ -138,8 +136,7 @@ if ($action == 'setfixednotif' && $user->admin) $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount')); $newval = GETPOST($shortkey.'_key'); //print $newkey.' - '.$newval.'
'; - } - elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) + } elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) { // Add a new entry $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount')); @@ -158,8 +155,7 @@ if ($action == 'setfixednotif' && $user->admin) $db->commit(); 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 85f9ebf0409..85cd9284535 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -119,8 +119,7 @@ foreach ($list as $key) print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''; print ''; - } - else { + } else { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''.$langs->trans("FeatureNotYetSupported").''; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index f0d3c530b71..a78913b7e16 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -78,8 +78,7 @@ if ($action == 'setconst' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -97,8 +96,7 @@ if ($action == 'setvalue' && $user->admin) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -151,8 +149,7 @@ if ($mode == 'setup' && $user->admin) $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://github.com/settings/applications/'; - } - elseif ($key[0] == 'OAUTH_GOOGLE_NAME') + } elseif ($key[0] == 'OAUTH_GOOGLE_NAME') { $OAUTH_SERVICENAME = 'Google'; // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). @@ -162,22 +159,19 @@ if ($mode == 'setup' && $user->admin) $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://security.google.com/settings/security/permissions'; - } - elseif ($key[0] == 'OAUTH_STRIPE_TEST_NAME') + } elseif ($key[0] == 'OAUTH_STRIPE_TEST_NAME') { $OAUTH_SERVICENAME = 'StripeTest'; $urltorenew = $urlwithroot.'/core/modules/oauth/stripetest_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = ''; $urltocheckperms = ''; - } - elseif ($key[0] == 'OAUTH_STRIPE_LIVE_NAME') + } elseif ($key[0] == 'OAUTH_STRIPE_LIVE_NAME') { $OAUTH_SERVICENAME = 'StripeLive'; $urltorenew = $urlwithroot.'/core/modules/oauth/stripelive_oauthcallback.php?backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltodelete = ''; $urltocheckperms = ''; - } - else { + } else { $urltorenew = ''; $urltodelete = ''; $urltocheckperms = ''; @@ -193,8 +187,7 @@ if ($mode == 'setup' && $user->admin) $storage = new DoliStorage($db, $conf); try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); - } - catch (Exception $e) + } catch (Exception $e) { // Return an error if token not found } @@ -217,12 +210,10 @@ if ($mode == 'setup' && $user->admin) if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES) { $expiredat = $langs->trans("Never"); - } - elseif ($endoflife == $tokenobj::EOL_UNKNOWN) + } elseif ($endoflife == $tokenobj::EOL_UNKNOWN) { $expiredat = $langs->trans("Unknown"); - } - else { + } else { $expiredat = dol_print_date($endoflife, "dayhour"); } } @@ -367,8 +358,7 @@ if ($mode == 'test' && $user->admin) } else { setEventMessages($printer->error, $printer->errors, 'errors'); } - } - else { + } else { print $langs->trans('PleaseConfigureDriverfromList'); } } diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 2873cf5d15f..85d7e140a6d 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -56,8 +56,7 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -182,8 +181,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->PAYMENT_ADDON == $file || $conf->global->PAYMENT_ADDON.'.php' == $file) { 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 ec4015f6e98..ece44f66677 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -92,8 +92,7 @@ if ($action == 'activate_pdfsecurity') dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1", 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; -} -elseif ($action == 'disable_pdfsecurity') +} elseif ($action == 'disable_pdfsecurity') { dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION", $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -189,8 +188,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 7dcaf0fba47..d5bc8fd938b 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -229,8 +229,7 @@ if ($result) print ''; print img_picto($langs->trans("Active"), 'tick'); print ''; - } - else { + } else { print ''; print ''.img_edit_add().''; print ''; @@ -246,8 +245,7 @@ if ($result) $i++; } -} -else dol_print_error($db); +} else dol_print_error($db); print ''; print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index b33b2396aa2..e4a27a51c65 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -70,8 +70,7 @@ if ($action == "set") $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ - } - else $error++; + } else $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity); if (!$res > 0) $error++; @@ -100,8 +99,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 f2c748b4ce2..9cde0e81e56 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -63,12 +63,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -99,18 +97,15 @@ 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); } -} -elseif ($action == 'setribchq') +} elseif ($action == 'setribchq') { $rib = GETPOST('rib', 'alpha'); $chq = GETPOST('chq', 'alpha'); @@ -123,12 +118,10 @@ elseif ($action == 'setribchq') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') +} elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') { $draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha'); @@ -138,12 +131,10 @@ elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'set_PROPOSAL_FREE_TEXT') +} elseif ($action == 'set_PROPOSAL_FREE_TEXT') { $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string @@ -154,12 +145,10 @@ elseif ($action == 'set_PROPOSAL_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} -elseif ($action == 'setdefaultduration') +} elseif ($action == 'setdefaultduration') { $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity); @@ -168,13 +157,10 @@ elseif ($action == 'setdefaultduration') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') +} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') { $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL", $value, 'chaine', 0, '', $conf->entity); @@ -183,8 +169,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -192,17 +177,14 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { if ($conf->global->PROPALE_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROPALE_ADDON_PDF', $conf->entity); } -} - -elseif ($action == 'setdoc') +} elseif ($action == 'setdoc') { if (dolibarr_set_const($db, "PROPALE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { @@ -215,9 +197,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -302,8 +282,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->PROPALE_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -367,8 +346,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -438,8 +416,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -450,8 +427,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->PROPALE_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 ''; @@ -484,8 +460,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -558,17 +533,14 @@ if (empty($conf->facture->enabled)) $i++; } print ""; - } - else { + } else { print "".$langs->trans("NoActiveBankAccountDefined").""; } } - } - else { + } else { print ''.$langs->trans("BankModuleNotActive").''; } -} -else { +} else { print ''.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).''; } print ""; @@ -605,8 +577,7 @@ if (empty($conf->facture->enabled)) } } print ""; -} -else { +} else { print ''.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).''; } print ""; @@ -670,8 +641,7 @@ $variablename = 'PROPOSAL_FREE_TEXT'; 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 dc6aa5da33b..d1b23c485ab 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -89,8 +89,7 @@ if ($action == 'addprinter' && $user->admin) { { $db->commit(); setEventMessages($langs->trans("PrinterAdded", $printername), null); - } - else { + } else { $db->rollback(); dol_print_error($db); } @@ -114,8 +113,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 68f8f0e62ee..7bcd054f13e 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -74,9 +74,7 @@ if ($action == 'updateMask') setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); else setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'set_param') +} elseif ($action == 'set_param') { $freetext = GETPOST('RECEPTION_FREE_TEXT', 'none'); // No alpha here, we want exact string $res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); @@ -98,9 +96,7 @@ elseif ($action == 'set_param') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } -} - -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -131,13 +127,11 @@ 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); } @@ -147,9 +141,7 @@ elseif ($action == 'specimen') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -174,9 +166,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmodel') +} elseif ($action == 'setmodel') { dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -251,8 +241,7 @@ foreach ($dirmodels as $reldir) $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; - } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -260,8 +249,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") { 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 +315,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -396,8 +383,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -408,8 +394,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->RECEPTION_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 ''; @@ -439,8 +424,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { 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 04ff3861c7f..e9cb6b8f554 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -91,8 +91,7 @@ if (empty($conf->use_javascript_ajax)) print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; -} -else { +} else { print ''; $arrval = array( '0'=>$langs->trans("No"), diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 161b521337b..4dcb83c32e6 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -45,8 +45,7 @@ if ($action == 'setgeneraterule') if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $_GET["value"], 'chaine', 0, '', $conf->entity)) { dol_print_error($db); - } - else { + } else { header("Location: ".$_SERVER["PHP_SELF"]); exit; } @@ -90,8 +89,7 @@ if ($action == 'activate_encrypt') $i++; } } - } - else dol_print_error($db); + } else dol_print_error($db); //print $error." ".$sql; //exit; @@ -100,13 +98,11 @@ if ($action == 'activate_encrypt') $db->commit(); header("Location: security.php"); exit; - } - else { + } else { $db->rollback(); dol_print_error($db, ''); } -} -elseif ($action == 'disable_encrypt') +} elseif ($action == 'disable_encrypt') { //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes //Do not allow "disable encryption" as passwords cannot be decrypted @@ -129,12 +125,10 @@ if ($action == 'activate_encryptdbpassconf') //dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1"); header("Location: security.php"); exit; - } - else { + } else { setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings'); } -} -elseif ($action == 'disable_encryptdbpassconf') +} elseif ($action == 'disable_encryptdbpassconf') { $result = encodedecode_dbpassconf(0); if ($result > 0) @@ -145,8 +139,7 @@ elseif ($action == 'disable_encryptdbpassconf') //dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity); header("Location: security.php"); exit; - } - else { + } else { setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); } } @@ -156,8 +149,7 @@ if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1', 'chaine', 0, '', $conf->entity); header("Location: security.php"); exit; -} -elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') +} elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') { dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity); header("Location: security.php"); @@ -264,8 +256,7 @@ foreach ($arrayhandler as $key => $module) // Show example of numbering module print ''; $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -273,8 +264,7 @@ foreach ($arrayhandler as $key => $module) if ($conf->global->USER_PASSWORD_GENERATED == $key) { print img_picto('', 'tick'); - } - else { + } else { print ''.$langs->trans("Activate").''; } print "\n"; @@ -430,8 +420,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes //Do not allow "disable encryption" as passwords cannot be decrypted print ''.$langs->trans("Disable").''; - } - else { + } else { print '-'; } print ""; @@ -456,8 +445,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").''; @@ -508,8 +496,7 @@ if (GETPOST('info', 'int') > 0) if (function_exists('password_hash')) { 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 b6674f00c5c..363340445c2 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -50,8 +50,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)) { @@ -60,13 +59,10 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { Header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } -} - -elseif ($action == 'updateform') +} elseif ($action == 'updateform') { $res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -116,18 +112,15 @@ if (function_exists("imagecreatefrompng")) if (!empty($conf->use_javascript_ajax)) { 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; } @@ -140,13 +133,11 @@ print ''; 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 0745203f365..91c4003ec92 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -122,8 +122,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'); } @@ -204,8 +203,7 @@ if ($action == 'edit') print ''; print '
'; -} -else { +} else { if (!count($listofmethods)) print '
'.$langs->trans("NoSmsEngine", 'DoliStore').'
'; print ''; @@ -262,8 +260,7 @@ else { if (count($listofmethods) && !empty($conf->global->MAIN_SMS_SENDMODE)) { print ''.$langs->trans("DoTestSend").''; - } - else { + } else { print ''.$langs->trans("DoTestSend").''; } print ''; diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php index fd4329b7023..b848dccd998 100644 --- a/htdocs/admin/socialnetworks.php +++ b/htdocs/admin/socialnetworks.php @@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -61,8 +60,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 6c1d1837ea8..34c83dbd434 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -73,8 +73,7 @@ if ($action == 'update' || $action == 'add') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -152,8 +151,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) print '
'; 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 d3b9061eecc..28ba40e0b7e 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -61,8 +60,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { header("Location: ".$_SERVER["PHP_SELF"]); exit; - } - else { + } else { dol_print_error($db); } } @@ -117,8 +115,7 @@ if (!empty($conf->facture->enabled)) $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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"; @@ -136,8 +133,7 @@ if (!empty($conf->commande->enabled)) $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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"; @@ -157,8 +153,7 @@ if (!empty($conf->expedition->enabled)) $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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"; @@ -176,8 +171,7 @@ if (!empty($conf->expedition->enabled)) $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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"; @@ -215,8 +209,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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"; @@ -235,8 +228,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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"; @@ -271,8 +263,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 c52f4296429..59613f6af5b 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -70,8 +70,7 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -108,13 +107,11 @@ 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); } @@ -124,9 +121,7 @@ if ($action == 'specimen') // For invoices elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -151,8 +146,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} -elseif ($action == 'unsetdoc') +} elseif ($action == 'unsetdoc') { dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity); } @@ -182,8 +176,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -259,8 +252,7 @@ foreach ($dirmodels as $reldir) $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; - } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -268,8 +260,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print '
'.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -335,8 +326,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -403,8 +393,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"),'switch_on'); }*/ print ""; - } - else { + } else { print '"; @@ -417,8 +406,7 @@ foreach ($dirmodels as $reldir) //print img_picto($langs->trans("Default"),'on'); // 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 ''; @@ -479,8 +467,7 @@ $variablename = 'SUPPLIER_INVOICE_FREE_TEXT'; 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 f282ee8d7ca..a390e4a4522 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -68,13 +68,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -elseif ($action == 'specimen') // For orders +} elseif ($action == 'specimen') // For orders { $modele = GETPOST('module', 'alpha'); @@ -106,13 +103,11 @@ 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); } @@ -122,9 +117,7 @@ elseif ($action == 'specimen') // For orders elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -149,23 +142,17 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); -} - -elseif ($action == 'addcat') +} elseif ($action == 'addcat') { $fourn = new Fournisseur($db); $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml')); -} - -elseif ($action == 'set_SUPPLIER_ORDER_OTHER') +} elseif ($action == 'set_SUPPLIER_ORDER_OTHER') { $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'none'); // No alpha here, we want exact string $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha'); @@ -193,8 +180,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER') // Insert $newmodule->insert_permissions(1); - } - else { + } else { // Remove all rights with Permission1190 $newmodule->delete_permissions(); @@ -213,8 +199,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -290,8 +275,7 @@ foreach ($dirmodels as $reldir) $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; - } - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -299,8 +283,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -364,8 +347,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -422,13 +404,11 @@ foreach ($dirmodels as $reldir) print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; - } - else { + } else { print img_picto($langs->trans("Enabled"), 'switch_on'); } print ""; - } - else { + } else { print '"; @@ -439,8 +419,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { 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 ''; @@ -543,8 +522,7 @@ $variablename = 'SUPPLIER_ORDER_FREE_TEXT'; 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(); @@ -561,8 +539,7 @@ print ''; @@ -393,8 +380,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"),'switch_on'); }*/ print ""; - } - else { + } else { print '"; @@ -407,8 +393,7 @@ foreach ($dirmodels as $reldir) //print img_picto($langs->trans("Default"),'on'); // 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 bb3454de4f7..5f35f3af310 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -60,8 +60,7 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -97,13 +96,11 @@ 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); } @@ -119,8 +116,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -136,8 +132,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -151,8 +146,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -161,18 +155,14 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL') if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF', $conf->entity); } -} - -elseif ($action == 'setdoc') +} elseif ($action == 'setdoc') { if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { @@ -185,9 +175,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'setmod') +} elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -272,8 +260,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -336,8 +323,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -406,8 +392,7 @@ foreach ($dirmodels as $reldir) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; - } - else { + } else { print ""; @@ -418,8 +403,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->SUPPLIER_PROPOSAL_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 ''; @@ -452,8 +436,7 @@ foreach ($dirmodels as $reldir) if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; - } - else { + } else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -500,8 +483,7 @@ $variablename = 'SUPPLIER_PROPOSAL_FREE_TEXT'; 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(); @@ -531,19 +513,16 @@ if ($conf->banque->enabled) if (!empty($conf->use_javascript_ajax)) { 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 44143afb270..f2d9e5aef60 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -126,8 +126,7 @@ if ($action == 'set') { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { $db->rollback(); setEventMessages($error, $errors, 'errors'); } @@ -154,8 +153,7 @@ if ($action == 'setlevel') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -228,8 +226,7 @@ foreach ($syslogModules as $moduleName) { if (isset($_POST[$tmpoption])) $value = $_POST[$tmpoption]; elseif (!empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption; - } - else $value = (isset($option['default']) ? $option['default'] : ''); + } else $value = (isset($option['default']) ? $option['default'] : ''); print $option['name'].': '; if (!empty($option['example'])) print '
'.$langs->trans("Example").': '.$option['example']; diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index db7559de17a..615d353bbf1 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -200,8 +200,7 @@ if ($showpromotemessage) print ''; - } - else { + } else { print $langs->trans("TitleExampleForMaintenanceRelease").':
'; print '
'.$langs->trans("ReStockOnDispatchOrder").''; @@ -284,8 +275,7 @@ else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); 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 "'; 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 1c4cfd5905e..da74784505a 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -57,11 +57,10 @@ if ($action == 'updateMask') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } -}elseif ($action == 'setmod') +} elseif ($action == 'setmod') { dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity); } @@ -70,9 +69,7 @@ if ($action == 'updateMask') elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); -} - -elseif ($action == 'del') +} elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -97,9 +94,7 @@ elseif ($action == 'setdoc') { $ret = addDocumentModel($value, $type, $label, $scandir); } -} - -elseif ($action == 'specimen') +} elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); @@ -130,21 +125,15 @@ 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); } -} - - - -elseif ($action == 'setparams') +} elseif ($action == 'setparams') { $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); if (!$res > 0) $error++; @@ -203,8 +192,7 @@ if ($resql) array_push($def, $array[0]); $i++; } -} -else { +} else { dol_print_error($db); } @@ -278,8 +266,7 @@ foreach ($dirmodels as $reldir) if ($conf->global->SUPPLIER_PAYMENT_ADDON == $file || $conf->global->SUPPLIER_PAYMENT_ADDON.'.php' == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); - } - else { + } else { print ''.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').'