From 43dcd9beb51781717595ae5db746a01792b62767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Thu, 21 May 2020 00:02:33 +0200
Subject: [PATCH 01/28] add new rule
---
dev/setup/codesniffer/ruleset.xml | 25 +-
htdocs/accountancy/admin/account.php | 6 +-
htdocs/accountancy/admin/accountmodel.php | 18 +-
htdocs/accountancy/admin/card.php | 12 +-
htdocs/accountancy/admin/categories_list.php | 26 +-
htdocs/accountancy/admin/journals_list.php | 12 +-
htdocs/accountancy/admin/productaccount.php | 4 +-
htdocs/accountancy/bookkeeping/card.php | 9 +-
htdocs/accountancy/bookkeeping/list.php | 30 +--
.../accountancy/bookkeeping/listbyaccount.php | 18 +-
.../class/accountancycategory.class.php | 21 +-
.../class/accountancyexport.class.php | 33 ++-
.../class/accountingjournal.class.php | 3 +-
.../accountancy/class/bookkeeping.class.php | 3 +-
htdocs/accountancy/closure/index.php | 3 +-
htdocs/accountancy/closure/validate.php | 3 +-
htdocs/accountancy/customer/card.php | 3 +-
htdocs/accountancy/customer/index.php | 3 +-
htdocs/accountancy/customer/list.php | 3 +-
htdocs/accountancy/expensereport/card.php | 3 +-
htdocs/accountancy/expensereport/index.php | 3 +-
htdocs/accountancy/expensereport/list.php | 3 +-
htdocs/accountancy/index.php | 3 +-
htdocs/accountancy/journal/bankjournal.php | 33 +--
.../journal/expensereportsjournal.php | 15 +-
.../accountancy/journal/purchasesjournal.php | 21 +-
htdocs/accountancy/journal/sellsjournal.php | 24 +-
htdocs/accountancy/supplier/card.php | 3 +-
htdocs/accountancy/supplier/index.php | 3 +-
htdocs/accountancy/supplier/list.php | 3 +-
htdocs/accountancy/tpl/export_journal.tpl.php | 3 +-
htdocs/adherents/type.php | 36 +--
htdocs/adherents/type_ldap.php | 9 +-
htdocs/adherents/type_translation.php | 15 +-
.../datapolicy/class/datapolicycron.class.php | 6 +-
htdocs/modulebuilder/admin/setup.php | 4 +-
htdocs/modulebuilder/index.php | 239 ++++++------------
htdocs/modulebuilder/template/admin/setup.php | 6 +-
.../template/class/actions_mymodule.class.php | 5 +-
.../template/class/api_mymodule.class.php | 6 +-
.../template/class/myobject.class.php | 18 +-
.../mailinglist_mymodule_myobject.modules.php | 3 +-
.../doc/doc_generic_myobject_odt.modules.php | 39 ++-
.../mymodule/mod_myobject_standard.php | 3 +-
.../template/myobject_agenda.php | 11 +-
.../modulebuilder/template/myobject_card.php | 9 +-
.../template/myobject_document.php | 4 +-
.../modulebuilder/template/myobject_list.php | 4 +-
.../template/scripts/mymodule.php | 3 +-
test/phpunit/CodingPhpTest.php | 16 +-
test/phpunit/CodingSqlTest.php | 10 +-
test/phpunit/ExportTest.php | 4 +-
test/phpunit/FactureRecTest.php | 5 +-
test/phpunit/FactureTest.php | 5 +-
test/phpunit/LangTest.php | 2 +-
test/phpunit/ModulesTest.php | 2 +-
test/phpunit/UserTest.php | 2 +-
test/phpunit/WebservicesInvoicesTest.php | 7 +-
test/phpunit/WebservicesOrdersTest.php | 2 +-
test/phpunit/WebservicesOtherTest.php | 4 +-
test/phpunit/WebservicesProductsTest.php | 6 +-
test/phpunit/WebservicesThirdpartyTest.php | 8 +-
test/phpunit/WebservicesUserTest.php | 4 +-
63 files changed, 315 insertions(+), 534 deletions(-)
diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml
index e726df6db7c..a6a915094e2 100644
--- a/dev/setup/codesniffer/ruleset.xml
+++ b/dev/setup/codesniffer/ruleset.xml
@@ -27,7 +27,7 @@
-
+
@@ -101,7 +101,7 @@
- -->
+ -->
0
@@ -117,7 +117,7 @@
-->
-
+
@@ -188,8 +188,8 @@
-
@@ -213,6 +213,9 @@
+
+
+
@@ -309,16 +312,16 @@
0
-
+
0
-
+
0
-
+
0
@@ -332,7 +335,7 @@
0
-
+
0
@@ -385,7 +388,7 @@
-
+
0
@@ -426,5 +429,5 @@
-
+
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index cf00519e9d7..d131e228f44 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -144,8 +144,7 @@ if (empty($reshook))
{
setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
}
}
@@ -432,8 +431,7 @@ if ($resql)
print "\n";
if (!$i) $totalarray['nbfield']++;
}
- else
- {
+ else {
print ' ';
if (!$i) $totalarray['nbfield']++;
}
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index b31cd23dfa4..66f1e3c0fa3 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -246,8 +246,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
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');
}
@@ -319,8 +318,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -582,8 +580,7 @@ if ($id)
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
print '';
}
- else
- {
+ else {
print ' ';
}
}
@@ -630,8 +627,7 @@ if ($id)
print ' ';
print ' ';
}
- else
- {
+ else {
$tmpaction = 'view';
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
@@ -665,8 +661,7 @@ if ($id)
{
$valuetoshow = '-';
}
- else
- {
+ else {
$key = $langs->trans("Country".strtoupper($obj->country_code));
$valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
}
@@ -785,8 +780,7 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context =
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
print ' ';
}
- else
- {
+ else {
print '';
$size = ''; $class = '';
if ($fieldlist[$field] == 'code') $size = 'size="8" ';
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 708165fc757..0fc2f9001a1 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -76,8 +76,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
{
$account_number = GETPOST('account_number', 'string');
}
- else
- {
+ else {
$account_number = clean_account(GETPOST('account_number', 'string'));
}
@@ -85,8 +84,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
{
$account_parent = 0;
}
- else
- {
+ else {
$account_parent = GETPOST('account_parent', 'int');
}
@@ -141,8 +139,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
{
$account_number = GETPOST('account_number', 'string');
}
- else
- {
+ else {
$account_number = clean_account(GETPOST('account_number', 'string'));
}
@@ -150,8 +147,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
{
$account_parent = 0;
}
- else
- {
+ else {
$account_parent = GETPOST('account_parent', 'int');
}
diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php
index 1b2733e2045..04c8cbce12a 100644
--- a/htdocs/accountancy/admin/categories_list.php
+++ b/htdocs/accountancy/admin/categories_list.php
@@ -236,8 +236,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
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');
}
@@ -309,8 +308,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -598,8 +596,7 @@ if ($id)
print ' ';
$filterfound++;
}
- else
- {
+ else {
print ' ';
}
}
@@ -727,9 +724,8 @@ if ($id)
print '';
print ' ';
}
- else
- {
- $tmpaction = 'view';
+ else {
+ $tmpaction = 'view';
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
@@ -754,8 +750,7 @@ if ($id)
{
$valuetoshow = '-';
}
- else
- {
+ else {
$key = $langs->trans("Country".strtoupper($obj->country_code));
$valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
}
@@ -799,8 +794,7 @@ if ($id)
// Active
print '';
if ($canbedisabled) print ''.$actl[$obj->active].' ';
- else
- {
+ else {
print $langs->trans("AlwaysActive");
}
print " ";
@@ -883,8 +877,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
$fieldname = 'country_id';
print $form->select_country(GETPOST('country_id', 'int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
}
- else
- {
+ else {
print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : $mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
}
print '';
@@ -907,8 +900,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
print ' ';
}
- else
- {
+ else {
print '';
$size = ''; $class = '';
if ($fieldlist[$field] == 'code') $class = 'maxwidth100';
diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php
index e34ce8094dd..93942946b26 100644
--- a/htdocs/accountancy/admin/journals_list.php
+++ b/htdocs/accountancy/admin/journals_list.php
@@ -239,8 +239,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
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');
}
@@ -314,8 +313,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -596,8 +594,7 @@ if ($id)
print '
';
print ' ';
}
- else
- {
+ else {
$tmpaction = 'view';
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
@@ -728,8 +725,7 @@ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
print ' ';
}
- else
- {
+ else {
print '';
$size = ''; $class = '';
if ($fieldlist[$field] == 'code') $class = 'maxwidth100';
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index e32e47b169d..6006e97b8da 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -268,9 +268,7 @@ elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL')
elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA')
{
$sql .= " p.accountancy_code_sell_intra = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
-}
-else
-{
+} else {
$sql .= " p.accountancy_code_sell_export = aa.account_number AND aa.fk_pcg_version = '".$pcgvercode."'";
}
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index f8fa0774400..8ab554c08e7 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -629,8 +629,7 @@ if ($action == 'create')
{
print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1);
}
- else
- {
+ else {
print ' subledger_account).'">';
}
print ' ';
@@ -686,8 +685,7 @@ if ($action == 'create')
{
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
}
- else
- {
+ else {
print ' ';
}
print '';
@@ -708,8 +706,7 @@ if ($action == 'create')
{
print 'piece_num.'&action=valid">'.$langs->trans("ValidTransaction").' ';
}
- else
- {
+ else {
print ' ';
}
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 2889fbf4ef1..87808e95500 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -352,8 +352,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
setEventMessages("RecordDeleted", null, 'mesgs');
}
@@ -361,8 +360,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
header("Location: list.php".($param ? '?'.$param : ''));
exit;
}
- else
- {
+ else {
setEventMessages("NoRecordDeleted", null, 'warnings');
}
}
@@ -374,8 +372,7 @@ if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->suppri
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
@@ -481,8 +478,7 @@ if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
{
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
// Export files
$accountancyexport = new AccountancyExport($db);
$accountancyexport->export($object->lines, $formatexportset);
@@ -491,8 +487,7 @@ if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
{
setEventMessages('', $accountancyexport->errors, 'errors');
}
- else
- {
+ else {
// Specify as export : update field date_export
$error = 0;
$db->begin();
@@ -522,8 +517,7 @@ if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
$db->commit();
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
}
- else
- {
+ else {
$error++;
$db->rollback();
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
@@ -560,8 +554,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{
$num = $nbtotalofrecords;
}
-else
-{
+else {
$sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
@@ -722,8 +715,7 @@ if (!empty($arrayfields['t.subledger_account']['checked']))
{
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
}
- else
- {
+ else {
print ' ';
}
print '';
@@ -735,8 +727,7 @@ if (!empty($arrayfields['t.subledger_account']['checked']))
{
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
}
- else
- {
+ else {
print ' ';
}
print '';
@@ -958,8 +949,7 @@ while ($i < min($num, $limit))
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
}
- else
- {
+ else {
// Other type
}
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index 25f664d955e..a2b456b52b3 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -255,8 +255,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
setEventMessages("RecordDeleted", null, 'mesgs');
}
@@ -264,8 +263,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
exit;
}
- else
- {
+ else {
setEventMessages("NoRecordDeleted", null, 'warnings');
}
}
@@ -277,8 +275,7 @@ if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->suppri
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
@@ -538,8 +535,7 @@ while ($i < min($num, $limit))
print '';
print ' ';
}
- else
- {
+ else {
print ' ';
print '';
print price($sous_total_credit - $sous_total_debit);
@@ -640,8 +636,7 @@ while ($i < min($num, $limit))
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
}
- else
- {
+ else {
// Other type
}
@@ -743,8 +738,7 @@ if ($balance > 0 )
print ' ';
print ' ';
}
-else
-{
+else {
print ' ';
print '';
print price($sous_total_credit - $sous_total_debit);
diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index cc93232dcdc..0150e1d155d 100644
--- a/htdocs/accountancy/class/accountancycategory.class.php
+++ b/htdocs/accountancy/class/accountancycategory.class.php
@@ -210,8 +210,7 @@ class AccountancyCategory // extends CommonObject
$this->db->rollback();
return -1 * $error;
}
- else
- {
+ else {
$this->db->commit();
return $this->id;
}
@@ -241,8 +240,7 @@ class AccountancyCategory // extends CommonObject
$sql .= " t.active";
$sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as t";
if ($id) $sql .= " WHERE t.rowid = ".$id;
- else
- {
+ else {
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
if ($code) $sql .= " AND t.code = '".$this->db->escape($code)."'";
elseif ($label) $sql .= " AND t.label = '".$this->db->escape($label)."'";
@@ -271,8 +269,7 @@ class AccountancyCategory // extends CommonObject
return 1;
}
- else
- {
+ else {
$this->error = "Error ".$this->db->lasterror();
return -1;
}
@@ -336,8 +333,7 @@ class AccountancyCategory // extends CommonObject
$this->db->rollback();
return -1 * $error;
}
- else
- {
+ else {
$this->db->commit();
return 1;
}
@@ -376,8 +372,7 @@ class AccountancyCategory // extends CommonObject
$this->db->rollback();
return -1 * $error;
}
- else
- {
+ else {
$this->db->commit();
return 1;
}
@@ -710,8 +705,7 @@ class AccountancyCategory // extends CommonObject
}
$sql .= " AND t.numero_compte IN (".$listofaccount.")";
}
- else
- {
+ else {
$sql .= " AND t.numero_compte = '".$this->db->escape($cpt)."'";
}
if (!empty($date_start) && !empty($date_end) && (empty($month) || empty($year))) // If month/year provided, it is stronger than filter date_start/date_end
@@ -834,8 +828,7 @@ class AccountancyCategory // extends CommonObject
$sql .= " AND t.entity = ".$conf->entity;
$sql .= " ORDER BY t.account_number";
}
- else
- {
+ else {
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as t";
$sql .= " WHERE ".$predefinedgroupwhere;
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 3bf41e6326f..33c2537f600 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -518,11 +518,12 @@ class AccountancyExport
$Tab['contrepartie'] = str_repeat(' ', 8);
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
- if (!empty($data->date_echeance))
+ if (!empty($data->date_echeance)) {
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy
- else
+ } else {
$Tab['date_echeance'] = '000000';
+ }
//elarifr please keep quadra named field lettrage(2) + codestat(3) instead of fake lettrage(5)
//$Tab['lettrage'] = str_repeat(' ', 5);
@@ -597,12 +598,12 @@ class AccountancyExport
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0');
- if($data->sens == 'D'){
+ if ($data->sens == 'D') {
$Tab['montant_debit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT);
$Tab['montant_crebit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
}
- else{
+ else {
$Tab['montant_debit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
$Tab['montant_crebit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT);
@@ -616,11 +617,12 @@ class AccountancyExport
$Tab['code_stat'] = str_repeat(' ', 4);
- if (!empty($data->date_echeance))
+ if (!empty($data->date_echeance)) {
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
- else
+ } else {
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
+ }
$Tab['monnaie'] = '1';
@@ -925,8 +927,7 @@ class AccountancyExport
{
print 'S'.$this->separator;
}
- else
- {
+ else {
print 'H'.$this->separator;
}
//Grp
@@ -938,13 +939,11 @@ class AccountancyExport
{
print length_accounta($thisPieceAccountNr).$this->separator;
}
- else
- {
+ else {
print "div".$this->separator;
}
}
- else
- {
+ else {
print length_accounta($line->code_tiers).$this->separator;
}
//SId
@@ -961,8 +960,7 @@ class AccountancyExport
{
print "2".$this->separator;
}
- else
- {
+ else {
print "1".$this->separator;
}
// Code
@@ -972,8 +970,7 @@ class AccountancyExport
{
print $line->montant.$this->separator;
}
- else
- {
+ else {
print ($line->montant * -1).$this->separator;
}
// Steuer
@@ -1458,7 +1455,9 @@ class AccountancyExport
print self::trunc($line->code_journal, 6).$separator; //Journal code
if (!empty($line->subledger_account)) $account = $line->subledger_account;
- else $account = $line->numero_compte;
+ else {
+ $account = $line->numero_compte;
+ }
print self::trunc($account, 15).$separator; //Account number
print self::trunc($line->label_compte, 60).$separator; //Account label
diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index 727e68346fa..7b78cbca84b 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -137,8 +137,7 @@ class AccountingJournal extends CommonObject
return 0;
}
}
- else
- {
+ else {
$this->error = "Error ".$this->db->lasterror();
$this->errors[] = "Error ".$this->db->lasterror();
}
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 0162a98394e..2f197d7919f 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -259,8 +259,7 @@ class BookKeeping extends CommonObject
{
$this->errors[] = $langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type);
}
- else
- {
+ else {
//$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForInvoiceLine', $this->doc_ref, $this->label_compte);
$mesg = $this->doc_ref.', '.$langs->trans("AccountAccounting").': '.$this->numero_compte;
if ($this->subledger_account && $this->subledger_account != $this->numero_compte)
diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php
index 39ed325b5fe..ed8fc8ecc7e 100644
--- a/htdocs/accountancy/closure/index.php
+++ b/htdocs/accountancy/closure/index.php
@@ -42,8 +42,7 @@ if (!$user->rights->accounting->fiscalyear->write)
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int');
-else
-{
+else {
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
diff --git a/htdocs/accountancy/closure/validate.php b/htdocs/accountancy/closure/validate.php
index fe7fda5054f..808ccfba0ef 100644
--- a/htdocs/accountancy/closure/validate.php
+++ b/htdocs/accountancy/closure/validate.php
@@ -42,8 +42,7 @@ if ($user->socid > 0)
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int');
-else
-{
+else {
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php
index 0a39fbc8254..7c184cced45 100644
--- a/htdocs/accountancy/customer/card.php
+++ b/htdocs/accountancy/customer/card.php
@@ -60,8 +60,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write)
if (!$resql) {
setEventMessages($db->lasterror(), null, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
if ($backtopage)
{
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index eff348816fb..c2ba41d7368 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -47,8 +47,7 @@ if (!$user->rights->accounting->bind->write)
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int');
-else
-{
+else {
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 1d93a0fea17..4e551fef9e8 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -160,8 +160,7 @@ if ($massaction == 'ventil') {
$msg .= ''.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'
';
$ko++;
}
- else
- {
+ else {
$sql = " UPDATE ".MAIN_DB_PREFIX."facturedet";
$sql .= " SET fk_code_ventilation = ".$monCompte;
$sql .= " WHERE rowid = ".$monId;
diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php
index 36d587e0c99..acea87f95a6 100644
--- a/htdocs/accountancy/expensereport/card.php
+++ b/htdocs/accountancy/expensereport/card.php
@@ -64,8 +64,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write)
if (!$resql) {
setEventMessages($db->lasterror(), null, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
if ($backtopage)
{
diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php
index 387cfd0fb8e..9573cbfc257 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -43,8 +43,7 @@ if (!$user->rights->accounting->bind->write)
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int');
-else
-{
+else {
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php
index 96eebd49b36..706bd41f2b0 100644
--- a/htdocs/accountancy/expensereport/list.php
+++ b/htdocs/accountancy/expensereport/list.php
@@ -139,8 +139,7 @@ if ($massaction == 'ventil') {
$msg .= ''.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'
';
$ko++;
}
- else
- {
+ else {
$sql = " UPDATE ".MAIN_DB_PREFIX."expensereport_det";
$sql .= " SET fk_code_ventilation = ".$monCompte;
$sql .= " WHERE rowid = ".$monId;
diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
index 56cf674505b..2fbbfe4b104 100644
--- a/htdocs/accountancy/index.php
+++ b/htdocs/accountancy/index.php
@@ -241,8 +241,7 @@ if ($conf->accounting->enabled)
print '';
}
-else
-{
+else {
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
print $langs->trans("Module10Desc")." \n";
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 3372105cd85..96fa45bcfd1 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -550,8 +550,7 @@ if (!$error && $action == 'writebookkeeping') {
$errorforline++;
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
@@ -576,8 +575,7 @@ if (!$error && $action == 'writebookkeeping') {
{
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
}
- else
- {
+ else {
$reflabel .= dol_string_nohtmltag($val['soclib']);
}
@@ -700,8 +698,7 @@ if (!$error && $action == 'writebookkeeping') {
$errorforline++;
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
@@ -748,8 +745,7 @@ if (!$error && $action == 'writebookkeeping') {
$errorforline++;
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
@@ -771,8 +767,7 @@ if (!$error && $action == 'writebookkeeping') {
{
$db->commit();
}
- else
- {
+ else {
//print 'KO for line '.$key.' '.$error.' ';
$db->rollback();
@@ -792,8 +787,7 @@ if (!$error && $action == 'writebookkeeping') {
{
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
}
@@ -880,8 +874,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
{
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
}
- else
- {
+ else {
$reflabel .= dol_string_nohtmltag($val['soclib']);
}
@@ -1105,8 +1098,7 @@ if (empty($action) || $action == 'view') {
{
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
}
- else
- {
+ else {
$reflabel .= $val['soclib'];
}
@@ -1135,13 +1127,11 @@ if (empty($action) || $action == 'view') {
{
print ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').' ';
}
- else
- {
+ else {
print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).' '; // We will use a waiting account
}
}
- else
- {
+ else {
// We will refuse writing
$errorstring = 'UnknownAccountForThirdpartyBlocking';
if ($tabtype[$key] == 'payment') $errorstring = 'MainAccountForCustomersNotDefined';
@@ -1178,8 +1168,7 @@ if (empty($action) || $action == 'view') {
print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).' ';
}
}
- else
- {
+ else {
print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").' ';
}
}
diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php
index 4be0b133143..6ed33f56ef1 100644
--- a/htdocs/accountancy/journal/expensereportsjournal.php
+++ b/htdocs/accountancy/journal/expensereportsjournal.php
@@ -232,8 +232,7 @@ if ($action == 'writebookkeeping') {
$errorforline++;
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
@@ -282,8 +281,7 @@ if ($action == 'writebookkeeping') {
$errorforline++;
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
@@ -342,8 +340,7 @@ if ($action == 'writebookkeeping') {
$errorforline++;
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
@@ -366,8 +363,7 @@ if ($action == 'writebookkeeping') {
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
if ($error >= 10)
@@ -387,8 +383,7 @@ if ($action == 'writebookkeeping') {
{
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
}
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 42bff74097f..c7cff6443ca 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -152,8 +152,9 @@ if ($result) {
if (empty($compta_prod)) {
if ($obj->product_type == 0)
$compta_prod = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : 'NotDefined';
- else
+ else {
$compta_prod = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : 'NotDefined';
+ }
}
$vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), $mysoc, $mysoc, 0);
@@ -332,8 +333,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -384,8 +384,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -447,8 +446,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -500,8 +498,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -525,8 +522,7 @@ if ($action == 'writebookkeeping') {
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
if ($error >= 10)
@@ -546,8 +542,7 @@ if ($action == 'writebookkeeping') {
{
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
}
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index c3c9f45ed5a..9bfa10dd3f1 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -158,8 +158,9 @@ if ($result) {
if (empty($compta_prod)) {
if ($obj->product_type == 0)
$compta_prod = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : 'NotDefined';
- else
+ else {
$compta_prod = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : 'NotDefined';
+ }
}
$vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), $mysoc, $mysoc, 0);
@@ -343,8 +344,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -395,8 +395,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -457,8 +456,7 @@ if ($action == 'writebookkeeping') {
$errorforinvoice[$key] = 'alreadyjournalized';
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
}
- else
- {
+ else {
$error++;
$errorforline++;
$errorforinvoice[$key] = 'other';
@@ -483,8 +481,7 @@ if ($action == 'writebookkeeping') {
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
if ($error >= 10)
@@ -500,12 +497,10 @@ if ($action == 'writebookkeeping') {
if (empty($error) && count($tabpay) > 0) {
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
}
- elseif (count($tabpay) == $error)
- {
+ elseif (count($tabpay) == $error) {
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
}
@@ -659,8 +654,9 @@ if (empty($action) || $action == 'view') {
$description .= $langs->trans("DescJournalOnlyBindedVisible").' ';
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
$description .= $langs->trans("DepositsAreNotIncluded");
- else
+ else {
$description .= $langs->trans("DepositsAreIncluded");
+ }
$listofchoices = array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0);
diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php
index 6140f90fe8d..b8d32e690a1 100644
--- a/htdocs/accountancy/supplier/card.php
+++ b/htdocs/accountancy/supplier/card.php
@@ -64,8 +64,7 @@ if ($action == 'ventil' && $user->rights->accounting->bind->write)
if (!$resql) {
setEventMessages($db->lasterror(), null, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
if ($backtopage)
{
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index 07877378ce1..9cd2b0c61e4 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -45,8 +45,7 @@ if (!$user->rights->accounting->bind->write)
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) $year_start = GETPOST("year", 'int');
-else
-{
+else {
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index 6ef942bea89..2c7110bf65d 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -164,8 +164,7 @@ if ($massaction == 'ventil') {
$msg .= ''.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'
';
$ko++;
}
- else
- {
+ else {
$sql = " UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
$sql .= " SET fk_code_ventilation = ".$monCompte;
$sql .= " WHERE rowid = ".$monId;
diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php
index fb957db2233..a6addb536a2 100644
--- a/htdocs/accountancy/tpl/export_journal.tpl.php
+++ b/htdocs/accountancy/tpl/export_journal.tpl.php
@@ -59,8 +59,7 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
}
-else
-{
+else {
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
}
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index c190398c1db..5f89f06b22f 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -146,14 +146,12 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create';
}
}
- else
- {
+ else {
$action = 'create';
}
}
@@ -184,8 +182,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
{
setEventMessages($langs->trans("MemberTypeModified"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -204,8 +201,7 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer)
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
setEventMessages($langs->trans("MemberTypeCanNotBeDeleted"), null, 'errors');
$action = '';
}
@@ -244,8 +240,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
$newcardbutton = '';
- if ($user->rights->adherent->configurer)
- {
+ if ($user->rights->adherent->configurer) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
}
@@ -300,8 +295,9 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print ' '.$membertype->getLibStatut(5).' ';
if ($user->rights->adherent->configurer)
print 'rowid.'">'.img_edit().' ';
- else
+ else {
print ' ';
+ }
print "";
$i++;
}
@@ -310,8 +306,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print '';
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -665,8 +660,7 @@ if ($rowid > 0)
{
print ''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).' '."\n";
}
- else
- {
+ else {
print ''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 32).' '."\n";
}
@@ -700,22 +694,19 @@ if ($rowid > 0)
{
print dol_print_date($datefin, 'day')." ".img_warning($langs->trans("SubscriptionLate"));
}
- else
- {
+ else {
print dol_print_date($datefin, 'day');
}
print '';
}
- else
- {
+ else {
print '';
if ($objp->subscription == 'yes')
{
print $langs->trans("SubscriptionNotReceived");
if ($objp->statut > 0) print " ".img_warning();
}
- else
- {
+ else {
print ' ';
}
print ' ';
@@ -747,8 +738,7 @@ if ($rowid > 0)
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php
index bfb81e8d5c4..9e52f05739e 100644
--- a/htdocs/adherents/type_ldap.php
+++ b/htdocs/adherents/type_ldap.php
@@ -167,21 +167,18 @@ if ($result > 0)
{
print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
}
- else
- {
+ else {
$result = show_ldap_content($records, 0, $records['count'], true);
}
}
- else
- {
+ else {
print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.') ';
}
$ldap->unbind();
$ldap->close();
}
-else
-{
+else {
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php
index 4c68b82784f..0e81240a020 100644
--- a/htdocs/adherents/type_translation.php
+++ b/htdocs/adherents/type_translation.php
@@ -77,8 +77,7 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
$object->other = dol_htmlcleanlastbr($_POST["other"]);
}
- else
- {
+ else {
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
$object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
@@ -89,8 +88,7 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad
{
$action = '';
}
- else
- {
+ else {
$action = 'add';
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -111,8 +109,7 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
$object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
}
- else
- {
+ else {
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
@@ -123,8 +120,7 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a
{
$action = '';
}
- else
- {
+ else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -142,8 +138,7 @@ if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && $user->rights-
{
$action = '';
}
- else
- {
+ else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
}
diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php
index 409df1362e9..ba93638455e 100644
--- a/htdocs/datapolicy/class/datapolicycron.class.php
+++ b/htdocs/datapolicy/class/datapolicycron.class.php
@@ -506,8 +506,7 @@ class DataPolicyCron
}
}
}
- else
- {
+ else {
$errormsg = $object->error;
$error++;
}
@@ -539,8 +538,7 @@ class DataPolicyCron
{
$this->output = $nbupdated.' record updated, '.$nbdeleted.' record deleted';
}
- else
- {
+ else {
$this->error = $errormsg;
}
diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php
index db30c32607f..45f6dd91b66 100644
--- a/htdocs/modulebuilder/admin/setup.php
+++ b/htdocs/modulebuilder/admin/setup.php
@@ -48,9 +48,7 @@ if ($action == "update")
if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) {
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback();
- }
- else
- {
+ } else {
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit();
}
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index d813c3b291b..02bd9c387b4 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -129,8 +129,8 @@ if ($dirins && $action == 'initmodule' && $modulename)
$langs->load("errors");
setEventMessages($langs->trans("ErrorFailToCopyDir", $srcdir, $destdir), null, 'errors');
}
- else // $result == 0
- {
+ else {
+ // $result == 0
setEventMessages($langs->trans("AllFilesDidAlreadyExist", $srcdir, $destdir), null, 'warnings');
}
}
@@ -271,8 +271,7 @@ if ($dirins && $action == 'initapi' && !empty($module))
dolReplaceInFile($destfile, $arrayreplacement);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -308,14 +307,12 @@ if ($dirins && $action == 'initphpunit' && !empty($module))
dolReplaceInFile($destfile, $arrayreplacement);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
}
-if ($dirins && $action == 'initsqlextrafields' && !empty($module))
-{
+if ($dirins && $action == 'initsqlextrafields' && !empty($module)) {
$modulename = ucfirst($module); // Force first letter in uppercase
$objectname = $tabobj;
@@ -354,8 +351,7 @@ if ($dirins && $action == 'initsqlextrafields' && !empty($module))
dolReplaceInFile($destfile1, $arrayreplacement);
dolReplaceInFile($destfile2, $arrayreplacement);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', ''), null, 'errors');
}
@@ -389,8 +385,7 @@ if ($dirins && $action == 'inithook' && !empty($module))
dolReplaceInFile($destfile, $arrayreplacement);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -423,8 +418,7 @@ if ($dirins && $action == 'inittrigger' && !empty($module))
dolReplaceInFile($destfile, $arrayreplacement);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -438,8 +432,7 @@ if ($dirins && $action == 'initwidget' && !empty($module))
//var_dump($srcfile);var_dump($destfile);
$result = dol_copy($srcfile, $destfile, 0, 0);
- if ($result > 0)
- {
+ if ($result > 0) {
$modulename = ucfirst($module); // Force first letter in uppercase
//var_dump($phpfileval['fullname']);
@@ -456,9 +449,7 @@ if ($dirins && $action == 'initwidget' && !empty($module))
);
dolReplaceInFile($destfile, $arrayreplacement);
- }
- else
- {
+ } else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -496,8 +487,7 @@ if ($dirins && $action == 'initcss' && !empty($module))
$arrayreplacement = array('/\/\/\s*\''.preg_quote('/'.strtolower($module).'/css/'.strtolower($module).'.css.php', '/').'\'/' => '\'/'.strtolower($module).'/css/'.strtolower($module).'.css.php\'');
dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -535,8 +525,7 @@ if ($dirins && $action == 'initjs' && !empty($module))
$arrayreplacement = array('/\/\/\s*\''.preg_quote('/'.strtolower($module).'/js/'.strtolower($module).'.js.php', '/').'\'/' => '\'/'.strtolower($module).'/js/'.strtolower($module).'.js.php\'');
dolReplaceInFile($srcfile, $arrayreplacement, '', 0, 0, 1);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -574,14 +563,12 @@ if ($dirins && $action == 'initcli' && !empty($module))
dolReplaceInFile($destfile, $arrayreplacement);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
}
-if ($dirins && $action == 'initdoc' && !empty($module))
-{
+if ($dirins && $action == 'initdoc' && !empty($module)) {
dol_mkdir($dirins.'/'.strtolower($module).'/doc');
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
$srcfile = $srcdir.'/doc/Documentation.asciidoc';
@@ -589,8 +576,7 @@ if ($dirins && $action == 'initdoc' && !empty($module))
//var_dump($srcfile);var_dump($destfile);
$result = dol_copy($srcfile, $destfile, 0, 0);
- if ($result > 0)
- {
+ if ($result > 0) {
$modulename = ucfirst($module); // Force first letter in uppercase
$modulelowercase = strtolower($module);
@@ -625,8 +611,7 @@ if ($dirins && $action == 'initdoc' && !empty($module))
dol_delete_file($outputfiledoc, 0, 0, 0, null, false, 0);
dol_delete_file($outputfiledocpdf, 0, 0, 0, null, false, 0);
}
- else
- {
+ else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
}
@@ -671,8 +656,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
{
setEventMessages($langs->trans("ErrorTableNotFound", $tablename), null, 'errors');
}
- else
- {
+ else {
/**
* 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float')
* 'label' the translation key.
@@ -882,8 +866,8 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
$langs->load("errors");
setEventMessages($langs->trans("ErrorFailToCopyFile", $srcdir.'/'.$srcfile, $destdir.'/'.$destfile), null, 'errors');
}
- else // $result == 0
- {
+ else {
+ // $result == 0
setEventMessages($langs->trans("FileAlreadyExists", $destfile), null, 'warnings');
}
}
@@ -1066,14 +1050,12 @@ if ($dirins && ($action == 'droptable' || $action == 'droptableextrafields') &&
$nb = $obj->nb;
}
}
- else
- {
+ else {
if ($db->lasterrno() == 'DB_ERROR_NOSUCHTABLE')
{
setEventMessages($langs->trans("TableDoesNotExists", $tabletodrop), null, 'warnings');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1231,8 +1213,7 @@ if ($dirins && $action == 'confirm_deletemodule')
{
setEventMessages($langs->trans("DirWasRemoved", $modulelowercase), null);
}
- else
- {
+ else {
setEventMessages($langs->trans("PurgeNothingToDelete"), null, 'warnings');
}
}
@@ -1291,8 +1272,7 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname)
{
setEventMessages($langs->trans("FilesDeleted"), null);
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorSomeFilesCouldNotBeDeleted"), null, 'warnings');
}
}
@@ -1326,8 +1306,7 @@ if ($dirins && $action == 'generatepackage')
dol_print_error($e->getMessage());
}
}
- else
- {
+ else {
$error++;
$langs->load("errors");
dol_print_error($langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module));
@@ -1346,8 +1325,7 @@ if ($dirins && $action == 'generatepackage')
if (!dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
$result = dol_compress_dir($dir, $outputfilezip, 'zip', '', $modulelowercase);
}
- else
- {
+ else {
$result = -1;
}
@@ -1355,15 +1333,13 @@ if ($dirins && $action == 'generatepackage')
{
setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfilezip), null);
}
- else
- {
+ else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfilezip), null, 'errors');
}
}
- else
- {
+ else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorCheckVersionIsDefined"), null, 'errors');
@@ -1382,8 +1358,7 @@ if ($dirins && $action == 'generatedoc')
{
setEventMessages($langs->trans("DocFileGeneratedInto", $dirofmodule), null);
}
- else
- {
+ else {
setEventMessages($util->error, $util->errors, 'errors');
}
}
@@ -1421,13 +1396,11 @@ if ($action == 'savefile' && empty($cancel))
setEventMessages($langs->trans("FileSaved"), null);
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ContentCantBeEmpty"), null, 'errors');
//$action='editfile';
$error++;
@@ -1446,8 +1419,7 @@ if ($action == 'set' && $user->admin)
$value = GETPOST('value', 'alpha');
$resarray = activateModule($value);
if (!empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors');
- else
- {
+ else {
//var_dump($resarray);exit;
if ($resarray['nbperms'] > 0)
{
@@ -1595,8 +1567,7 @@ if (!$dirins)
$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)))
@@ -1606,8 +1577,7 @@ else
$allowfromweb = 0;
}
}
- else
- {
+ else {
$message = info_admin($langs->trans("NotExistsDirect", $dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
$allowfromweb = 0;
}
@@ -1645,8 +1615,7 @@ if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule')
print $e->getMessage();
}
}
- else
- {
+ else {
if (empty($forceddirread)) $error++;
$langs->load("errors");
print img_warning('').' '.$langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module).' ';
@@ -1703,28 +1672,24 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
$linktoenabledisable .= ' '.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);
$linktoenabledisable .= ' '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').' ';
}
- else
- {
+ else {
$urltouse = $urlpage;
$linktoenabledisable .= ' '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').' ';
}
}
}
}
- elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
- {
+ elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) {
$linktoenabledisable .= ' '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').' ';
}
}
- else
- {
+ else {
$linktoenabledisable .= 'numero.'&action=set&value=mod'.$module.$param.'">';
$linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', '', false, 0, 0, '', 'classfortooltip', 1);
$linktoenabledisable .= " \n";
@@ -1775,8 +1740,7 @@ if ($module == 'initmodule')
print ' ';
print '';
}
-elseif ($module == 'deletemodule')
-{
+elseif ($module == 'deletemodule') {
print ''."\n";
print '';
}
-elseif (!empty($module))
-{
+elseif (!empty($module)) {
// Tabs for module
if (!$error)
{
@@ -1978,8 +1941,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
print $langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module).' ';
}
@@ -2006,8 +1968,7 @@ elseif (!empty($module))
dol_fiche_end();
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0, 1); // Description - level 2
if ($fullpathoffile)
@@ -2039,8 +2000,7 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
dol_fiche_head($head2, $tab, '', -1, ''); // Level 2
}
@@ -2078,8 +2038,7 @@ elseif (!empty($module))
}
print '';
}
- else
- {
+ else {
// Edit text language file
//print $langs->trans("UseAsciiDocFormat").' ';
@@ -2208,8 +2167,7 @@ elseif (!empty($module))
$i++;
}
}
- else
- {
+ else {
print ''.$langs->trans("None").' ';
}
@@ -2218,8 +2176,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -2324,8 +2281,7 @@ elseif (!empty($module))
print '';
}
- elseif ($tabobj == 'deleteobject')
- {
+ elseif ($tabobj == 'deleteobject') {
// Delete object tab
print '';
}
- else
- { // tabobj = module
+ else {
+ // tabobj = module
if ($action == 'deleteproperty')
{
$formconfirm = $form->formconfirm(
@@ -2413,13 +2369,11 @@ elseif (!empty($module))
{
print ''.$langs->trans("GoToApiExplorer").' ';
}
- else
- {
+ else {
print ''.$langs->trans("GoToApiExplorer").' ';
}
}
- else
- {
+ else {
//print ''.$langs->trans("FileNotYetGenerated").' ';
print ' ';
}
@@ -2433,8 +2387,7 @@ elseif (!empty($module))
print ' ';
print ''.img_picto($langs->trans("Delete"), 'delete').' ';
}
- else
- {
+ else {
//print ''.$langs->trans("FileNotYetGenerated").' ';
print ' ';
}
@@ -2542,8 +2495,7 @@ elseif (!empty($module))
{
$result = dol_include_once($pathtoclass);
}
- else
- {
+ else {
$result = @include_once $dirread.'/'.$pathtoclass;
}
if (class_exists($tabobj))
@@ -2748,8 +2700,7 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
if ($tab == 'specifications')
{
if ($action != 'editfile' || empty($file))
@@ -2769,8 +2720,7 @@ elseif (!empty($module))
print ' ';
}
}
- else
- {
+ else {
// Use MD or asciidoc
//print $langs->trans("UseAsciiDocFormat").' ';
@@ -2806,8 +2756,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
print ''.$langs->trans('Failed to init the object with the new.').' ';
}
}
@@ -2816,14 +2765,12 @@ elseif (!empty($module))
print $e->getMessage();
}
}
- else
- {
+ else {
if (empty($forceddirread))
{
$fullpathoffile = dol_buildpath($file, 0);
}
- else
- {
+ else {
$fullpathoffile = $dirread.'/'.$file;
}
@@ -2957,9 +2904,8 @@ elseif (!empty($module))
print '';
}
}
- else
- {
- print ''.$langs->trans("None").' ';
+ else {
+ print ''.$langs->trans("None").' ';
}
print '';
@@ -2967,8 +2913,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3057,9 +3002,8 @@ elseif (!empty($module))
print '';
}
}
- else
- {
- print ''.$langs->trans("None").' ';
+ else {
+ print ''.$langs->trans("None").' ';
}
print '';
@@ -3067,8 +3011,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3120,16 +3063,14 @@ elseif (!empty($module))
print ''.img_picto($langs->trans("Edit"), 'edit').' ';
print ''.img_picto($langs->trans("Delete"), 'delete').' ';
}
- else
- {
+ else {
print ''.$langs->trans("FileNotYetGenerated").' ';
print ' ';
print ' ';
}
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3189,8 +3130,7 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
print '';
print ' '.$langs->trans("NoTrigger");
print ' ';
@@ -3200,8 +3140,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3245,15 +3184,13 @@ elseif (!empty($module))
print ''.img_picto($langs->trans("Edit"), 'edit').' ';
print ''.img_picto($langs->trans("Delete"), 'delete').' ';
}
- else
- {
+ else {
print ''.$langs->trans("FileNotYetGenerated").' ';
print ' ';
}
print ' ';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3297,15 +3234,13 @@ elseif (!empty($module))
print ''.img_picto($langs->trans("Edit"), 'edit').' ';
print ''.img_picto($langs->trans("Delete"), 'delete').' ';
}
- else
- {
+ else {
print ''.$langs->trans("FileNotYetGenerated").' ';
print ' ';
}
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3355,16 +3290,14 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
print ' '.$langs->trans("NoWidget");
print ' ';
print ' ';
}
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3441,16 +3374,14 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
print ' '.$langs->trans("NoCLIFile");
print ' ';
print ' ';
}
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3561,8 +3492,7 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
print ''.$langs->trans("None").' ';
}
@@ -3571,8 +3501,7 @@ elseif (!empty($module))
print '';
}
- else
- {
+ else {
$fullpathoffile = dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
@@ -3622,8 +3551,7 @@ elseif (!empty($module))
print '';
}
}
- else
- {
+ else {
print '';
print ' '.$langs->trans("FileNotYetGenerated");
print ' ';
@@ -3631,8 +3559,7 @@ elseif (!empty($module))
}
print '';
}
- else
- {
+ else {
// Use MD or asciidoc
//print $langs->trans("UseAsciiDocFormat").' ';
@@ -3735,14 +3662,12 @@ elseif (!empty($module))
try {
$moduleobj = new $class($db);
}
- catch (Exception $e)
- {
+ catch (Exception $e) {
$error++;
dol_print_error($e->getMessage());
}
}
- else
- {
+ else {
$error++;
$langs->load("errors");
dol_print_error($langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module));
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 05b2c56ffb8..642fa838783 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -116,8 +116,7 @@ if ($action == 'edit')
print '';
print ' ';
}
-else
-{
+else {
if (!empty($arrayofparameters))
{
print '';
@@ -137,8 +136,7 @@ else
print ''.$langs->trans("Modify").' ';
print '';
}
- else
- {
+ else {
print ' '.$langs->trans("NothingToSetup");
}
}
diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
index 10bca2e8b9a..13a2b8e895c 100644
--- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php
+++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
@@ -165,6 +165,7 @@ class ActionsMyModule
global $conf, $user, $langs;
$error = 0; // Error counter
+ $disabled = 1;
/* print_r($parameters); print_r($object); echo "action: " . $action; */
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2'
@@ -231,8 +232,8 @@ class ActionsMyModule
dol_syslog(get_class($this).'::executeHooks action='.$action);
/* print_r($parameters); print_r($object); echo "action: " . $action; */
- if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2'
- {
+ if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {
+ // do something only for the context 'somecontext1' or 'somecontext2'
}
return $ret;
diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php
index f84210b9198..40af5ce2f0d 100644
--- a/htdocs/modulebuilder/template/class/api_mymodule.class.php
+++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php
@@ -159,6 +159,7 @@ class MyModuleApi extends DolibarrApi
}
$result = $db->query($sql);
+ $i = 0;
if ($result)
{
$num = $db->num_rows($result);
@@ -239,12 +240,11 @@ class MyModuleApi extends DolibarrApi
$this->myobject->$field = $value;
}
- if ($this->myobject->update($id, DolibarrApiAccess::$user) > 0)
+ if ($this->myobject->update(DolibarrApiAccess::$user, false) > 0)
{
return $this->get($id);
}
- else
- {
+ else {
throw new RestException(500, $this->myobject->error);
}
}
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 2070bedf568..6f1d45fee9f 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -546,8 +546,7 @@ class MyObject extends CommonObject
{
$num = $this->getNextNumRef();
}
- else
- {
+ else {
$num = $this->ref;
}
$this->newref = $num;
@@ -631,8 +630,7 @@ class MyObject extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
return -1;
}
@@ -900,8 +898,7 @@ class MyObject extends CommonObject
$this->db->free($result);
}
- else
- {
+ else {
dol_print_error($this->db);
}
}
@@ -935,8 +932,7 @@ class MyObject extends CommonObject
$this->errors = $this->errors;
return $result;
}
- else
- {
+ else {
$this->lines = $result;
return $this->lines;
}
@@ -987,8 +983,7 @@ class MyObject extends CommonObject
{
return $numref;
}
- else
- {
+ else {
$this->error = $obj->error;
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
return "";
@@ -998,8 +993,7 @@ class MyObject extends CommonObject
return "";
}
}
- else
- {
+ else {
print $langs->trans("ErrorNumberingModuleNotSetup", $this->element);
return "";
}
diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php
index 39b325924fc..e7d407dc8c9 100644
--- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php
@@ -147,8 +147,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
$i++;
}
}
- else
- {
+ else {
dol_syslog($this->db->error());
$this->error = $this->db->error();
return -1;
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
index 98c2c94bc7b..74a05a6b5e7 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
@@ -136,9 +136,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
if (!$tmpdir) {
unset($listofdir[$key]); continue;
}
- if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
- else
- {
+ if (!is_dir($tmpdir)) {
+ $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
+ } else {
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)');
if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles);
}
@@ -275,8 +275,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
if ($format == '1') $format = '%Y%m%d%H%M%S';
$filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
}
- else
- {
+ else {
$filename = $newfiletmp.'.'.$newfileformat;
}
$file = $dir.'/'.$filename;
@@ -309,18 +308,17 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$contactobject = $object->contact;
}
}
- else
- {
+ else {
$socobject = $object->thirdparty;
}
// Make substitution
$substitutionarray = array(
- '__FROM_NAME__' => $this->emetteur->name,
- '__FROM_EMAIL__' => $this->emetteur->email,
- '__TOTAL_TTC__' => $object->total_ttc,
- '__TOTAL_HT__' => $object->total_ht,
- '__TOTAL_VAT__' => $object->total_vat
+ '__FROM_NAME__' => $this->emetteur->name,
+ '__FROM_EMAIL__' => $this->emetteur->email,
+ '__TOTAL_TTC__' => $object->total_ttc,
+ '__TOTAL_HT__' => $object->total_ht,
+ '__TOTAL_VAT__' => $object->total_vat
);
complete_substitutions_array($substitutionarray, $langs, $object);
// Call the ODTSubstitution hook
@@ -392,13 +390,13 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
foreach ($tmparray as $key=>$value)
{
try {
- if (preg_match('/logo$/', $key)) // Image
- {
+ if (preg_match('/logo$/', $key)) {
+ // Image
if (file_exists($value)) $odfHandler->setImage($key, $value);
else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
}
- else // Text
- {
+ else {
+ // Text
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
@@ -408,8 +406,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
}
}
// Replace tags of lines
- try
- {
+ try {
$foundtagforlines = 1;
try {
$listlines = $odfHandler->setSegment('lines');
@@ -433,8 +430,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $val)
{
- try
- {
+ try {
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch (OdfException $e)
@@ -508,8 +504,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
return 1; // Success
}
- else
- {
+ else {
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
return -1;
}
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
index a611b6210bc..526c7c11213 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
@@ -141,8 +141,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject
if ($obj) $max = intval($obj->max);
else $max = 0;
}
- else
- {
+ else {
dol_syslog("mod_myobject_standard::getNextValue", LOG_DEBUG);
return -1;
}
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index 9b71971b6cf..4da40f0eb9a 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -54,13 +54,10 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
-if (GETPOST('actioncode', 'array'))
-{
+if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
-}
-else
-{
+} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -226,9 +223,7 @@ if ($object->id > 0)
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create))
{
print ''.$langs->trans("AddAction").' ';
- }
- else
- {
+ } else {
print ''.$langs->trans("AddAction").' ';
}
}
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index e92c88f1364..a31e9f6acdd 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -479,8 +479,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print 'id.'&action=edit">'.$langs->trans("Modify").' '."\n";
}
- else
- {
+ else {
print ''.$langs->trans('Modify').' '."\n";
}
@@ -493,8 +492,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print ''.$langs->trans("Validate").' ';
}
- else
- {
+ else {
$langs->load("errors");
print ''.$langs->trans("Validate").' ';
}
@@ -537,8 +535,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print 'id.'&action=delete">'.$langs->trans('Delete').' '."\n";
}
- else
- {
+ else {
print ''.$langs->trans('Delete').' '."\n";
}
}
diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php
index 63b114ffc10..186edc11da1 100644
--- a/htdocs/modulebuilder/template/myobject_document.php
+++ b/htdocs/modulebuilder/template/myobject_document.php
@@ -199,9 +199,7 @@ if ($object->id)
$relativepathwithnofile = 'myobject/'.dol_sanitizeFileName($object->ref).'/';
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
-}
-else
-{
+} else {
accessforbidden('', 0, 1);
}
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index a0fcb744bb1..a37890649e2 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -292,9 +292,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);
diff --git a/htdocs/modulebuilder/template/scripts/mymodule.php b/htdocs/modulebuilder/template/scripts/mymodule.php
index 02024759058..aab823d1cb0 100644
--- a/htdocs/modulebuilder/template/scripts/mymodule.php
+++ b/htdocs/modulebuilder/template/scripts/mymodule.php
@@ -164,8 +164,7 @@ if (!$error)
$db->commit();
print '--- end ok'."\n";
}
-else
-{
+else {
print '--- end error code='.$error."\n";
$db->rollback();
}
diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php
index 5c3c6d7d54e..c28021a6957 100644
--- a/test/phpunit/CodingPhpTest.php
+++ b/test/phpunit/CodingPhpTest.php
@@ -154,7 +154,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$filesarray = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, '\.php', null, 'fullname');
- foreach($filesarray as $key => $file)
+ foreach ($filesarray as $key => $file)
{
if (preg_match('/\/htdocs\/includes\//', $file['fullname'])) continue;
if (preg_match('/\/htdocs\/custom\//', $file['fullname'])) continue;
@@ -170,7 +170,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/'.preg_quote('get_class($this)."::".__METHOD__', '/').'/', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
$ok=false;
break;
@@ -183,7 +183,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/(..)\s*\.\s*\$this->db->idate\(/', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
if ($val[1] != '\'"' && $val[1] != '\'\'')
{
@@ -201,7 +201,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/(=|sql.+)\s*\'"\s*\.\s*\$this->(....)/', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
if ($val[2] != 'db->' && $val[2] != 'esca')
{
@@ -220,7 +220,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/(..............)\$_SERVER\[\'QUERY_STRING\'\]/', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
if ($val[1] != 'scape_htmltag(' && $val[1] != 'ing_nohtmltag(' && $val[1] != 'dol_escape_js(')
{
@@ -236,7 +236,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/print_liste_field_titre\(\$langs/', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
$ok=false;
break;
@@ -249,7 +249,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/ /', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
if ($file['name'] != 'functions.lib.php')
{
@@ -265,7 +265,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$matches=array();
// Check string ='".$this->xxx with xxx that is not 'escape'. It means we forget a db->escape when forging sql request.
preg_match_all('/@var\s+array\(/', $filecontent, $matches, PREG_SET_ORDER);
- foreach($matches as $key => $val)
+ foreach ($matches as $key => $val)
{
$ok=false;
break;
diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php
index f56d00b5bcd..c9a5d12f3fc 100644
--- a/test/phpunit/CodingSqlTest.php
+++ b/test/phpunit/CodingSqlTest.php
@@ -158,7 +158,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
print 'Process dir '.$dir."\n";
$filesarray = scandir($dir);
- foreach($filesarray as $key => $file)
+ foreach ($filesarray as $key => $file)
{
if (! preg_match('/\.sql$/', $file))
continue;
@@ -206,14 +206,12 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
{
// Test for data files only
}
- else
- {
+ else {
if (preg_match('/\.key\.sql$/', $file))
{
// Test for key files only
}
- else
- {
+ else {
// Test for non key files only
$result=(strpos($filecontent, 'KEY ') && strpos($filecontent, 'PRIMARY KEY') == 0);
print __METHOD__." Result for checking we don't have ' KEY ' instead of a sql file to create index = ".$result."\n";
@@ -244,7 +242,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
$db=$this->savdb;
$filesarray = scandir(DOL_DOCUMENT_ROOT.'/../dev/initdemo');
- foreach($filesarray as $key => $file) {
+ foreach ($filesarray as $key => $file) {
if (! preg_match('/\.sql$/', $file))
continue;
diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php
index 590accccbed..cf1cafe74b1 100644
--- a/test/phpunit/ExportTest.php
+++ b/test/phpunit/ExportTest.php
@@ -342,7 +342,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$result=$objexport->load_arrays($user, $filterdatatoexport); // This load ->array_export_xxx properties for datatoexport
// Loop on each dataset
- foreach($objexport->array_export_code as $key => $datatoexport)
+ foreach ($objexport->array_export_code as $key => $datatoexport)
{
$exportfile=$conf->export->dir_temp.'/'.$user->id.'/export_'.$datatoexport.'.csv';
print "Process export for dataset ".$datatoexport." into ".$exportfile."\n";
@@ -351,7 +351,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
// Generate $array_selected
$i=0;
$array_selected=array();
- foreach($objexport->array_export_fields[$key] as $key => $val)
+ foreach ($objexport->array_export_fields[$key] as $key => $val)
{
$array_selected[$key]=$i++;
}
diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php
index f89ab4b1f13..fa44fda619f 100644
--- a/test/phpunit/FactureRecTest.php
+++ b/test/phpunit/FactureRecTest.php
@@ -187,12 +187,11 @@ class FactureRecTest extends PHPUnit\Framework\TestCase
{
$retAr[]="Supplied objects are not of same class.";
}
- else
- {
+ else {
$oVarsA=get_object_vars($oA);
$oVarsB=get_object_vars($oB);
$aKeys=array_keys($oVarsA);
- foreach($aKeys as $sKey)
+ foreach ($aKeys as $sKey)
{
if (in_array($sKey, $fieldstoignorearray)) continue;
if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey])
diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php
index 47f3a639b29..83a7c0cfbe9 100644
--- a/test/phpunit/FactureTest.php
+++ b/test/phpunit/FactureTest.php
@@ -366,12 +366,11 @@ class FactureTest extends PHPUnit\Framework\TestCase
{
$retAr[]="Supplied objects are not of same class.";
}
- else
- {
+ else {
$oVarsA=get_object_vars($oA);
$oVarsB=get_object_vars($oB);
$aKeys=array_keys($oVarsA);
- foreach($aKeys as $sKey)
+ foreach ($aKeys as $sKey)
{
if (in_array($sKey, $fieldstoignorearray)) continue;
if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey])
diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php
index f4a14373ebe..92e96fc1ad4 100644
--- a/test/phpunit/LangTest.php
+++ b/test/phpunit/LangTest.php
@@ -154,7 +154,7 @@ class LangTest extends PHPUnit\Framework\TestCase
include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
$filesarray = scandir(DOL_DOCUMENT_ROOT.'/langs');
- foreach($filesarray as $key => $code)
+ foreach ($filesarray as $key => $code)
{
if (! preg_match('/^[a-z]+_[A-Z]+$/', $code)) continue;
diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php
index f8feaa8f829..32652200c2c 100755
--- a/test/phpunit/ModulesTest.php
+++ b/test/phpunit/ModulesTest.php
@@ -144,7 +144,7 @@ class ModulesTest extends PHPUnit\Framework\TestCase
'Mailing','MailmanSpip','Margin','ModuleBuilder','MultiCurrency',
'Notification','Oauth','OpenSurvey','Paybox','Paypal','Prelevement','Printing','Product','ProductBatch','Projet','Propale','ReceiptPrinter','Resource',
'Salaries','Service','SocialNetworks','Societe','Stock','Stripe','SupplierProposal','Syslog','TakePos','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow');
- foreach($modulelist as $modlabel)
+ foreach ($modulelist as $modlabel)
{
require_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php';
$class='mod'.$modlabel;
diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php
index 10b0bd7b0b7..08338de949b 100644
--- a/test/phpunit/UserTest.php
+++ b/test/phpunit/UserTest.php
@@ -339,7 +339,7 @@ class UserTest extends PHPUnit\Framework\TestCase
$oVarsA=get_object_vars($oA);
$oVarsB=get_object_vars($oB);
$aKeys=array_keys($oVarsA);
- foreach($aKeys as $sKey) {
+ foreach ($aKeys as $sKey) {
if (in_array($sKey, $fieldstoignorearray))
continue;
if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey]) {
diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php
index 8aada2fc03a..dc6cc93c8a5 100644
--- a/test/phpunit/WebservicesInvoicesTest.php
+++ b/test/phpunit/WebservicesInvoicesTest.php
@@ -256,7 +256,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
}
- catch(SoapFault $exception)
+ catch (SoapFault $exception)
{
echo $exception;
$result=0;
@@ -314,7 +314,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
}
- catch(SoapFault $exception)
+ catch (SoapFault $exception)
{
echo $exception;
$result=0;
@@ -414,7 +414,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
}
- catch(SoapFault $exception)
+ catch (SoapFault $exception)
{
echo $exception;
$result=0;
@@ -433,7 +433,6 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
$this->assertEquals('OK', $result['result']['result_code']);
$this->assertEquals('ref-phpunit-2', $result['ref_ext']);
-
return $result;
}
}
diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php
index 33d842f6d39..803247e2598 100644
--- a/test/phpunit/WebservicesOrdersTest.php
+++ b/test/phpunit/WebservicesOrdersTest.php
@@ -169,7 +169,7 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php
index 34686cbec92..10c74bb1821 100644
--- a/test/phpunit/WebservicesOtherTest.php
+++ b/test/phpunit/WebservicesOtherTest.php
@@ -170,7 +170,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -198,7 +198,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php
index 70a8c12a498..90911b289bc 100644
--- a/test/phpunit/WebservicesProductsTest.php
+++ b/test/phpunit/WebservicesProductsTest.php
@@ -188,7 +188,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -251,7 +251,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -314,7 +314,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php
index 1106164b4ee..285fc6d5ddb 100644
--- a/test/phpunit/WebservicesThirdpartyTest.php
+++ b/test/phpunit/WebservicesThirdpartyTest.php
@@ -214,7 +214,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -268,7 +268,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -330,7 +330,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -390,7 +390,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php
index bb68f413741..f78386fc5bf 100644
--- a/test/phpunit/WebservicesUserTest.php
+++ b/test/phpunit/WebservicesUserTest.php
@@ -170,7 +170,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase
print __METHOD__."Call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
@@ -197,7 +197,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase
print __METHOD__."Call method ".$WS_METHOD."\n";
try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
- } catch(SoapFault $exception) {
+ } catch (SoapFault $exception) {
echo $exception;
$result=0;
}
From ccadb1ec7a88f667ec95a11a898dc17759638be7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Thu, 21 May 2020 00:47:16 +0200
Subject: [PATCH 02/28] add new rule
---
htdocs/adherents/admin/adherent.php | 16 +-
htdocs/adherents/admin/adherent_emails.php | 7 +-
htdocs/adherents/admin/website.php | 12 +-
htdocs/adherents/agenda.php | 4 +-
.../actions_adherentcard_common.class.php | 12 +-
.../actions_adherentcard_default.class.php | 4 +-
htdocs/adherents/card.php | 140 +++++-------------
htdocs/adherents/cartes/carte.php | 10 +-
htdocs/adherents/class/adherent.class.php | 22 +--
.../adherents/class/adherent_type.class.php | 52 ++-----
htdocs/adherents/class/api_members.class.php | 6 +-
.../class/api_memberstypes.class.php | 6 +-
.../class/api_subscriptions.class.php | 6 +-
htdocs/adherents/class/subscription.class.php | 32 +---
htdocs/adherents/document.php | 8 +-
htdocs/adherents/htpasswd.php | 4 +-
htdocs/adherents/index.php | 12 +-
htdocs/adherents/ldap.php | 16 +-
htdocs/adherents/list.php | 16 +-
htdocs/adherents/stats/byproperties.php | 11 +-
htdocs/adherents/stats/geo.php | 11 +-
htdocs/adherents/subscription.php | 72 +++------
htdocs/adherents/subscription/card.php | 32 +---
htdocs/core/lib/functions.lib.php | 4 +-
24 files changed, 149 insertions(+), 366 deletions(-)
diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php
index 6b2d432fe46..ca5011849b1 100644
--- a/htdocs/adherents/admin/adherent.php
+++ b/htdocs/adherents/admin/adherent.php
@@ -71,9 +71,7 @@ if ($action == 'updateall')
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback();
- }
- else
- {
+ } else {
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit();
}
@@ -101,9 +99,7 @@ if ($action == 'update' || $action == 'add')
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- }
- else
- {
+ } else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -199,9 +195,7 @@ if ($conf->facture->enabled)
print '';
print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
print ' ';
- }
- else
- {
+ } else {
print '';
print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name"));
print ' ';
@@ -234,12 +228,12 @@ print ' ';
*/
$constantes = array(
'ADHERENT_CARD_TYPE',
-// 'ADHERENT_CARD_BACKGROUND',
+ //'ADHERENT_CARD_BACKGROUND',
'ADHERENT_CARD_HEADER_TEXT',
'ADHERENT_CARD_TEXT',
'ADHERENT_CARD_TEXT_RIGHT',
'ADHERENT_CARD_FOOTER_TEXT'
- );
+);
print load_fiche_titre($langs->trans("MembersCards"), '', '');
diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php
index e0675a6124a..f59a27c170b 100644
--- a/htdocs/adherents/admin/adherent_emails.php
+++ b/htdocs/adherents/admin/adherent_emails.php
@@ -74,9 +74,7 @@ if ($action == 'updateall')
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback();
- }
- else
- {
+ } else {
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit();
}
@@ -102,8 +100,7 @@ if ($action == 'update' || $action == 'add')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php
index a8cdc06784e..50a7f58e8c5 100644
--- a/htdocs/adherents/admin/website.php
+++ b/htdocs/adherents/admin/website.php
@@ -61,16 +61,16 @@ if ($action == 'update')
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
if ($forcetype < 0) $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
- else $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity);
+ else {
+ $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity);
+ }
if (!$res > 0) $error++;
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- }
- else
- {
+ } else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -145,9 +145,7 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
$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');
diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php
index 20d712e6179..f1d83a4b314 100644
--- a/htdocs/adherents/agenda.php
+++ b/htdocs/adherents/agenda.php
@@ -53,9 +53,7 @@ if (GETPOST('actioncode', 'array'))
{
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
-}
-else
-{
+} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php
index eeee48e2138..44046d5a26e 100644
--- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php
+++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php
@@ -118,9 +118,7 @@ abstract class ActionsAdherentCardCommon
{
$this->tpl['company'] = $objsoc->getNomUrl(1);
$this->tpl['company_id'] = $objsoc->id;
- }
- else
- {
+ } else {
$this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1);
}
@@ -190,9 +188,7 @@ abstract class ActionsAdherentCardCommon
$objsoc->fetch($this->object->socid);
$this->tpl['company'] = $objsoc->getNomUrl(1);
- }
- else
- {
+ } else {
$this->tpl['company'] = $langs->trans("AdherentNotLinkedToThirdParty");
}
@@ -273,9 +269,7 @@ abstract class ActionsAdherentCardCommon
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->libelle;
- }
- else
- {
+ } else {
dol_print_error($this->db);
}
}
diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
index 60bb2ecd034..f248256a547 100644
--- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
+++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
@@ -105,9 +105,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
$this->tpl['actionstodo'] = show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1);
$this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1);
- }
- else
- {
+ } else {
// Confirm delete contact
if ($action == 'delete' && $user->rights->adherent->supprimer)
{
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index c913d6a1b49..7a5880fc317 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -209,9 +209,7 @@ if (empty($reshook))
$langs->load("errors");
setEventMessages($langs->trans($nuser->error), null, 'errors');
}
- }
- else
- {
+ } else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -231,9 +229,7 @@ if (empty($reshook))
setEventMessages($langs->trans($company->error), null, 'errors');
setEventMessages($company->error, $company->errors, 'errors');
}
- }
- else
- {
+ } else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -376,21 +372,15 @@ if (empty($reshook))
if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0)
{
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
- }
- else
- {
+ } else {
// Create thumbs
$object->addThumbs($newfile);
}
}
- }
- else
- {
+ } else {
setEventMessages("ErrorBadImageFormat", null, 'errors');
}
- }
- else
- {
+ } else {
switch ($_FILES['photo']['error'])
{
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
@@ -412,15 +402,11 @@ if (empty($reshook))
header("Location: ".$backtopage);
exit;
}
- }
- else
- {
+ } else {
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
}
- }
- else
- {
+ } else {
$action = 'edit';
}
}
@@ -527,8 +513,7 @@ if (empty($reshook))
if (empty($login)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")), null, 'errors');
- }
- else {
+ } else {
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'";
$result = $db->query($sql);
if ($result) {
@@ -588,9 +573,7 @@ if (empty($reshook))
$rowid = $object->id;
$id = $object->id;
$action = '';
- }
- else
- {
+ } else {
$db->rollback();
if ($object->error) {
@@ -616,15 +599,11 @@ if (empty($reshook))
{
header("Location: ".$backtopage);
exit;
- }
- else
- {
+ } else {
header("Location: list.php");
exit;
}
- }
- else
- {
+ } else {
$errmesg = $object->error;
}
}
@@ -689,9 +668,7 @@ if (empty($reshook))
}
}
}
- }
- else
- {
+ } else {
$error++;
if ($object->error) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -703,9 +680,7 @@ if (empty($reshook))
if (!$error)
{
$db->commit();
- }
- else
- {
+ } else {
$db->rollback();
}
$action = '';
@@ -770,9 +745,7 @@ if (empty($reshook))
}
}
}
- }
- else
- {
+ } else {
$error++;
if ($object->error) {
@@ -857,9 +830,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
}
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
$objcanvas->display_canvas($action); // Show template
-}
-else
-{
+} else {
// -----------------------------------------
// When used in standard mode
// -----------------------------------------
@@ -1027,9 +998,7 @@ else
if ($object->country_id)
{
print $formcompany->select_state(GETPOST('state_id', 'int') ?GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
- }
- else
- {
+ } else {
print $countrynotdefined;
}
print '';
@@ -1084,9 +1053,7 @@ else
if (!empty($backtopage))
{
print ' ';
- }
- else
- {
+ } else {
print ' ';
}
print '';
@@ -1123,9 +1090,7 @@ else
if ($resql)
{
$obj = $db->fetch_object($resql);
- }
- else
- {
+ } else {
dol_print_error($db);
}
$object->country_id = $obj->rowid;
@@ -1204,9 +1169,7 @@ else
if ($user->rights->adherent->creer)
{
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ?GETPOST("typeid", 'int') : $object->typeid));
- }
- else
- {
+ } else {
print $adht->getNomUrl(1);
print ' ';
}
@@ -1334,9 +1297,7 @@ else
$company = new Societe($db);
$result = $company->fetch($object->socid);
print $company->getNomUrl(1);
- }
- else
- {
+ } else {
print $langs->trans("NoThirdPartyAssociatedToMember");
}
print '';
@@ -1432,9 +1393,7 @@ else
{
$companyname = $object->company;
if (!empty($fullname)) $companyalias = $fullname;
- }
- else
- {
+ } else {
$companyname = $fullname;
if (!empty($object->company)) $companyalias = $object->company;
}
@@ -1629,8 +1588,7 @@ else
{
print ''.$langs->trans("Password").' '.preg_replace('/./i', '*', $object->pass);
if ($object->pass) print preg_replace('/./i', '*', $object->pass);
- else
- {
+ else {
if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
else print $langs->trans("Hidden");
}
@@ -1651,9 +1609,7 @@ else
if ($object->hasDelay()) {
print " ".img_warning($langs->trans("Late"));
}
- }
- else
- {
+ } else {
if ($object->need_subscription == 0)
{
print $langs->trans("SubscriptionNotNeeded");
@@ -1662,9 +1618,7 @@ else
{
print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
- }
- else
- {
+ } else {
print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
}
@@ -1691,17 +1645,12 @@ else
print ' ';
print ' ';
print '
';
- }
- else
- {
- if ($object->socid)
- {
+ } else {
+ if ($object->socid) {
$company = new Societe($db);
$result = $company->fetch($object->socid);
print $company->getNomUrl(1);
- }
- else
- {
+ } else {
print $langs->trans("NoThirdPartyAssociatedToMember");
}
}
@@ -1716,14 +1665,13 @@ else
if ($action == 'editlogin')
{
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
- }
- else
- {
+ } else {
if ($object->user_id)
{
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
+ } else {
+ print $langs->trans("NoDolibarrAccess");
}
- else print $langs->trans("NoDolibarrAccess");
}
print ' ';
@@ -1803,9 +1751,7 @@ else
if ($user->rights->adherent->creer)
{
print '";
- }
- else
- {
+ } else {
print ''.$langs->trans("Modify").'
';
}
@@ -1815,9 +1761,7 @@ else
if ($user->rights->adherent->creer)
{
print '\n";
- }
- else
- {
+ } else {
print ''.$langs->trans("Validate").'
';
}
}
@@ -1828,9 +1772,7 @@ else
if ($user->rights->adherent->creer)
{
print '\n";
- }
- else
- {
+ } else {
print ''.$langs->trans("Reenable")."
";
}
}
@@ -1841,9 +1783,7 @@ else
if ($user->rights->adherent->supprimer)
{
print '\n";
- }
- else
- {
+ } else {
print ''.$langs->trans("Resiliate")."
";
}
}
@@ -1855,9 +1795,7 @@ else
{
if ($object->statut != -1) print '';
else print '';
- }
- else
- {
+ } else {
print ''.$langs->trans("CreateDolibarrThirdParty")."
";
}
}
@@ -1869,9 +1807,7 @@ else
{
if ($object->statut != -1) print '';
else print '';
- }
- else
- {
+ } else {
print ''.$langs->trans("CreateDolibarrLogin")."
";
}
}
@@ -1880,9 +1816,7 @@ else
if ($user->rights->adherent->supprimer)
{
print '\n";
- }
- else
- {
+ } else {
print ''.$langs->trans("Delete")."
";
}
diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php
index 86bf523ac51..345542f8cba 100644
--- a/htdocs/adherents/cartes/carte.php
+++ b/htdocs/adherents/cartes/carte.php
@@ -162,11 +162,9 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg)
'photo'=>$objp->photo
);
}
- }
- else
- {
+ } else {
$arrayofmembers[] = array(
- 'textleft'=>$textleft,
+ 'textleft'=>$textleft,
'textheader'=>$textheader,
'textfooter'=>$textfooter,
'textright'=>$textright,
@@ -226,9 +224,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg)
{
dol_print_error('', $result);
}
- }
- else
- {
+ } else {
dol_print_error($db);
}
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 55504a547c2..a7410d87973 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1282,10 +1282,11 @@ class Adherent extends CommonObject
$this->country_id = $obj->country_id;
$this->country_code = $obj->country_code;
- if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code)
+ if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) {
$this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code);
- else
+ } else {
$this->country = $obj->country;
+ }
$this->phone = $obj->phone;
$this->phone_perso = $obj->phone_perso;
@@ -2037,12 +2038,13 @@ class Adherent extends CommonObject
if ($withpictoimg > -2 && $withpictoimg != 2) {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= '';
- if ($mode == 'login')
+ if ($mode == 'login') {
$result .= dol_trunc($this->login, $maxlen);
- elseif ($mode == 'ref')
+ } elseif ($mode == 'ref') {
$result .= $this->id;
- else
+ } else {
$result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen);
+ }
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= ' ';
}
if ($withpictoimg) $result .= '';
@@ -2803,10 +2805,11 @@ class Adherent extends CommonObject
$listofids .= ', ...';
break;
}
- if (empty($listofids))
+ if (empty($listofids)) {
$listofids .= ' [';
- else
+ } else {
$listofids .= ', ';
+ }
$listofids .= $idmember;
$i++;
}
@@ -2823,10 +2826,11 @@ class Adherent extends CommonObject
$listofids .= ', ...';
break;
}
- if (empty($listofids))
+ if (empty($listofids)) {
$listofids .= ' [';
- else
+ } else {
$listofids .= ', ';
+ }
$listofids .= $idmember;
$i++;
}
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 4af80ab4a63..199bd5e8a51 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -146,9 +146,7 @@ class AdherentType extends CommonObject
$this->multilangs["$obj->lang"]["email"] = $obj->email;
}
return 1;
- }
- else
- {
+ } else {
$this->error = "Error: ".$this->db->lasterror()." - ".$sql;
return -1;
}
@@ -184,9 +182,7 @@ class AdherentType extends CommonObject
$sql2 .= " label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'";
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
- }
- else
- {
+ } else {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
@@ -214,9 +210,7 @@ class AdherentType extends CommonObject
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
- }
- else
- {
+ } else {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
@@ -231,9 +225,7 @@ class AdherentType extends CommonObject
return -1;
}
}
- }
- else
- {
+ } else {
// language is not current language and we didn't provide a multilang description for this language
}
}
@@ -274,9 +266,7 @@ class AdherentType extends CommonObject
}
// End call triggers
return 1;
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR);
return -1;
@@ -336,16 +326,12 @@ class AdherentType extends CommonObject
{
$this->db->commit();
return $this->id;
- }
- else
- {
+ } else {
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
@@ -418,16 +404,12 @@ class AdherentType extends CommonObject
{
$this->db->commit();
return 1;
- }
- else
- {
+ } else {
$this->db->rollback();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -$error;
}
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
@@ -458,9 +440,7 @@ class AdherentType extends CommonObject
$this->db->commit();
return 1;
- }
- else
- {
+ } else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -511,9 +491,7 @@ class AdherentType extends CommonObject
}
return 1;
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -552,9 +530,7 @@ class AdherentType extends CommonObject
$i++;
}
}
- }
- else
- {
+ } else {
print $this->db->error();
}
return $adherenttypes;
@@ -608,9 +584,7 @@ class AdherentType extends CommonObject
$this->members = $ret;
return $ret;
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
return -1;
}
diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php
index 8e2e0d278f0..a5d72f3b78f 100644
--- a/htdocs/adherents/class/api_members.class.php
+++ b/htdocs/adherents/class/api_members.class.php
@@ -239,10 +239,8 @@ class Members extends DolibarrApi
if ($member->update(DolibarrApiAccess::$user) >= 0)
{
return $this->get($id);
- }
- else
- {
- throw new RestException(500, $member->error);
+ } else {
+ throw new RestException(500, $member->error);
}
}
diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php
index 98cb25b7fc3..c9d12206962 100644
--- a/htdocs/adherents/class/api_memberstypes.class.php
+++ b/htdocs/adherents/class/api_memberstypes.class.php
@@ -207,10 +207,8 @@ class MembersTypes extends DolibarrApi
if ($membertype->update(DolibarrApiAccess::$user) >= 0)
{
return $this->get($id);
- }
- else
- {
- throw new RestException(500, $membertype->error);
+ } else {
+ throw new RestException(500, $membertype->error);
}
}
diff --git a/htdocs/adherents/class/api_subscriptions.class.php b/htdocs/adherents/class/api_subscriptions.class.php
index c9804e5d802..11ac1f17113 100644
--- a/htdocs/adherents/class/api_subscriptions.class.php
+++ b/htdocs/adherents/class/api_subscriptions.class.php
@@ -196,10 +196,8 @@ class Subscriptions extends DolibarrApi
if ($subscription->update(DolibarrApiAccess::$user) > 0)
{
return $this->get($id);
- }
- else
- {
- throw new RestException(500, $subscription->error);
+ } else {
+ throw new RestException(500, $subscription->error);
}
}
diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index e512e1152bb..e1ec3bd1753 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -232,14 +232,10 @@ class Subscription extends CommonObject
$this->note = $obj->note;
$this->fk_bank = $obj->fk_bank;
return 1;
- }
- else
- {
+ } else {
return 0;
}
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -286,9 +282,7 @@ class Subscription extends CommonObject
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
// End call triggers
}
- }
- else
- {
+ } else {
$error++;
$this->error = $this->db->lasterror();
}
@@ -355,28 +349,20 @@ class Subscription extends CommonObject
{
$this->db->commit();
return 1;
- }
- else
- {
+ } else {
$this->error = $accountline->error;
$this->db->rollback();
return -1;
}
- }
- else
- {
+ } else {
$this->db->commit();
return 1;
}
- }
- else
- {
+ } else {
$this->db->commit();
return 0;
}
- }
- else
- {
+ } else {
$error++;
$this->error = $this->db->lasterror();
}
@@ -488,9 +474,7 @@ class Subscription extends CommonObject
}
$this->db->free($result);
- }
- else
- {
+ } else {
dol_print_error($this->db);
}
}
diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php
index 05ccf20169c..291b1916e55 100644
--- a/htdocs/adherents/document.php
+++ b/htdocs/adherents/document.php
@@ -158,14 +158,10 @@ if ($id > 0)
$param = '&id='.$object->id;
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
print " ";
- }
- else
- {
+ } else {
dol_print_error($db);
}
-}
-else
-{
+} else {
$langs->load("errors");
print $langs->trans("ErrorRecordNotFound");
}
diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php
index b7aa8da5d14..385e34d6538 100644
--- a/htdocs/adherents/htpasswd.php
+++ b/htdocs/adherents/htpasswd.php
@@ -79,9 +79,7 @@ if ($resql)
$i++;
}
print " \n";
-}
-else
-{
+} else {
dol_print_error($db);
}
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index 6d069386592..001730d67b1 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -331,9 +331,7 @@ if ($resql)
$staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name = $staticmember->thirdparty->name;
- }
- else
- {
+ } else {
$staticmember->name = $obj->company;
}
$staticmember->ref = $staticmember->getFullName($langs);
@@ -349,9 +347,7 @@ if ($resql)
}
print "";
print " ";
-}
-else
-{
+} else {
dol_print_error($db);
}
@@ -411,9 +407,7 @@ if ($resql)
}
print "";
print " ";
-}
-else
-{
+} else {
dol_print_error($db);
}
diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index 6a49f99fbf4..43d6a34fcf9 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -176,9 +176,7 @@ if ($result > 0)
{
$langs->load("errors");
print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).' ';
- }
- else
- {
+ } else {
$records = $ldap->getAttribute($dn, $search);
//print_r($records);
@@ -189,23 +187,17 @@ if ($result > 0)
if (!is_array($records))
{
print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
- }
- else
- {
+ } else {
$result = show_ldap_content($records, 0, $records['count'], true);
}
- }
- else
- {
+ } else {
print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.') ';
}
}
$ldap->unbind();
$ldap->close();
-}
-else
-{
+} else {
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 6cb34192845..72745b54614 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -214,9 +214,7 @@ if (empty($reshook))
if ($result < 0 && !count($tmpmember->errors))
{
setEventMessages($tmpmember->error, $tmpmember->errors, 'errors');
- }
- else
- {
+ } else {
if ($result > 0) $nbclose++;
}
}
@@ -226,9 +224,7 @@ if (empty($reshook))
setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs');
$db->commit();
- }
- else
- {
+ } else {
$db->rollback();
}
}
@@ -858,17 +854,13 @@ while ($i < min($num, $limit))
print " ".img_warning($langs->trans("SubscriptionLate").$textlate);
}
print '';
- }
- else
- {
+ } else {
print '';
if ($obj->subscription == 'yes')
{
print $langs->trans("SubscriptionNotReceived");
if ($obj->statut > 0) print " ".img_warning();
- }
- else
- {
+ } else {
print ' ';
}
print ' ';
diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php
index 7927c2e3f00..70c6ab0689b 100644
--- a/htdocs/adherents/stats/byproperties.php
+++ b/htdocs/adherents/stats/byproperties.php
@@ -93,9 +93,7 @@ if ($resql)
$i++;
}
$db->free($resql);
-}
-else
-{
+} else {
dol_print_error($db);
}
@@ -106,13 +104,10 @@ dol_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), -1, 'use
// Print title
-if (!count($data))
-{
+if (!count($data)) {
print $langs->trans("NoValidatedMemberYet").' ';
print ' ';
-}
-else
-{
+} else {
print $langs->trans("MembersByNature").' ';
print ' ';
}
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index 5b51008a9a2..bde4d5c949c 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -200,9 +200,7 @@ if ($mode)
$i++;
}
$db->free($resql);
- }
- else
- {
+ } else {
dol_print_error($db);
}
}
@@ -218,15 +216,12 @@ if ($mode && !count($data))
{
print $langs->trans("NoValidatedMemberYet").' ';
print ' ';
-}
-else
-{
+} else {
if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").' ';
elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").' ';
elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").' ';
elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").' '; //+
- else
- {
+ else {
print $langs->trans("MembersStatisticsDesc").' ';
print ' ';
print ''.$langs->trans("MembersStatisticsByCountries").' ';
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 47866fc8981..3bf821db04e 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -128,13 +128,11 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
$langs->load("errors");
setEventMessages($company->error, $company->errors, 'errors');
}
- else
- {
+ else {
$action = 'addsubscription';
}
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -276,8 +274,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
$action = 'addsubscription';
}
- else
- {
+ else {
if (!empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none')
{
if ($_POST["subscription"])
@@ -286,8 +283,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if ($_POST["paymentsave"] != 'invoiceonly' && !$_POST["operation"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
if ($_POST["paymentsave"] != 'invoiceonly' && !($_POST["accountid"] > 0)) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
}
- else
- {
+ else {
if ($_POST["accountid"]) $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
}
if ($errmsg)
@@ -323,8 +319,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
// If an invoice was created, it is into $object->invoice
}
}
@@ -333,8 +328,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
$action = 'addsubscription';
}
@@ -403,13 +397,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$errmsg = $object->error;
setEventMessages($object->error, $object->errors, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs');
}
}
- else
- {
+ else {
setEventMessages($langs->trans("NoEmailSentToMember"), null, 'mesgs');
}
}
@@ -548,15 +540,13 @@ if ($rowid > 0)
print " ".img_warning($langs->trans("Late"));
}
}
- else
- {
+ else {
if (!$adht->subscription)
{
print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
}
- else
- {
+ else {
print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
}
@@ -587,16 +577,14 @@ if ($rowid > 0)
print ' ';
print '';
}
- else
- {
+ else {
if ($object->fk_soc)
{
$company = new Societe($db);
$result = $company->fetch($object->fk_soc);
print $company->getNomUrl(1);
}
- else
- {
+ else {
print $langs->trans("NoThirdPartyAssociatedToMember");
}
}
@@ -623,8 +611,7 @@ if ($rowid > 0)
{
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
}
- else
- {
+ else {
if ($object->user_id)
{
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
@@ -755,9 +742,7 @@ if ($rowid > 0)
$accountstatic->ref = $objp->ref;
print $accountstatic->getNomUrl(1);
- }
- else
- {
+ } else {
print ' ';
}
print '';
@@ -773,9 +758,7 @@ if ($rowid > 0)
}
print "";
- }
- else
- {
+ } else {
dol_print_error($db);
}
}
@@ -814,9 +797,7 @@ if ($rowid > 0)
if (GETPOST('paymentsave') == 'bankdirect') $bankdirect = 1;
if (GETPOST('paymentsave') == 'invoiceonly') $invoiceonly = 1;
if (GETPOST('paymentsave') == 'bankviainvoice') $bankviainvoice = 1;
- }
- else
- {
+ } else {
if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $bankviainvoice = 1;
elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) $bankdirect = 1;
elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $invoiceonly = 1;
@@ -870,9 +851,7 @@ if ($rowid > 0)
{
$companyname = $object->company;
if (!empty($fullname)) $companyalias = $fullname;
- }
- else
- {
+ } else {
$companyname = $fullname;
if (!empty($object->company)) $companyalias = $object->company;
}
@@ -999,8 +978,7 @@ if ($rowid > 0)
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
- else
- {
+ else {
print ' (';
if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
print $langs->trans("NoThirdPartyAssociatedToMember");
@@ -1009,8 +987,7 @@ if ($rowid > 0)
print ')';
}
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).' ';
- if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled)))
- {
+ if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
$prodtmp = new Product($db);
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
@@ -1024,8 +1001,7 @@ if ($rowid > 0)
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
- else
- {
+ else {
print ' (';
if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember"));
print $langs->trans("NoThirdPartyAssociatedToMember");
@@ -1083,9 +1059,7 @@ if ($rowid > 0)
if (!$object->email)
{
print $langs->trans("NoEMail");
- }
- else
- {
+ } else {
$adht = new AdherentType($db);
$adht->fetch($object->typeid);
@@ -1158,9 +1132,7 @@ if ($rowid > 0)
//print '';
//print '';
-}
-else
-{
+} else {
$langs->load("errors");
print $langs->trans("ErrorRecordNotFound");
}
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index 02941cb9967..303a4aa7b5a 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -85,9 +85,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
if ($accountline->rappro)
{
$errmsg = $langs->trans("SubscriptionLinkedToConciliatedTransaction");
- }
- else
- {
+ } else {
$accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
$accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']);
$accountline->amount = $_POST["amount"];
@@ -116,17 +114,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
header("Location: card.php?rowid=".$object->id);
exit;
- }
- else
- {
+ } else {
$db->rollback();
if ($object->error)
{
$errmsg = $object->error;
- }
- else
- {
+ } else {
foreach ($object->errors as $error)
{
if ($errmsg) $errmsg .= ' ';
@@ -135,9 +129,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance
}
$action = '';
}
- }
- else
- {
+ } else {
$db->rollback();
}
}
@@ -151,9 +143,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent-
{
header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent);
exit;
- }
- else
- {
+ } else {
$mesg = $adh->error;
}
}
@@ -248,9 +238,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
$bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1, 0, 'showall');
- }
- else
- {
+ } else {
print $langs->trans("NoneF");
}
print '';
@@ -355,9 +343,7 @@ if ($rowid && $action != 'edit')
$bankline = new AccountLine($db);
$result = $bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1, 0, 'showall');
- }
- else
- {
+ } else {
print $langs->trans("NoneF");
}
print '';
@@ -382,9 +368,7 @@ if ($rowid && $action != 'edit')
if (!$bankline->rappro)
{
print '";
- }
- else
- {
+ } else {
print '";
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index e3059ade21e..66d8c6b773a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4047,8 +4047,8 @@ function dol_print_error($db = '', $error = '', $errors = null)
}
if (empty($dolibarr_main_prod)) print $out;
- else // This should not happen, except if there is a bug somewhere. Enabled and check log in such case.
- {
+ else {
+ // This should not happen, except if there is a bug somewhere. Enabled and check log in such case.
print 'This website or feature is currently temporarly not available. This may be due to a maintenance operation. Current status of operation are on next line... '."\n";
$langs->load("errors");
print $langs->trans("DolibarrHasDetectedError").'. ';
From 4be4f975b00db33cc4d7ffed32ce419a5ae34991 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Thu, 21 May 2020 01:03:03 +0200
Subject: [PATCH 03/28] add new rule
---
htdocs/index.php | 4 +-
htdocs/main.inc.php | 85 +++++++++++++------------------------------
htdocs/master.inc.php | 16 +++-----
htdocs/viewimage.php | 25 ++++---------
4 files changed, 40 insertions(+), 90 deletions(-)
diff --git a/htdocs/index.php b/htdocs/index.php
index 7f6e462839b..38fde99682c 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -301,9 +301,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
$board = new $class($db);
$board->load_state_board($user);
$boardloaded[$class] = $board;
- }
- else
- {
+ } else {
$board = $boardloaded[$class];
}
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 49c48e34ec1..733ded3e447 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -131,17 +131,13 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type)
if (analyseVarsForSqlAndScriptsInjection($key, $type) && analyseVarsForSqlAndScriptsInjection($value, $type))
{
//$var[$key] = $value; // This is useless
- }
- else
- {
+ } else {
print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')';
exit;
}
}
return true;
- }
- else
- {
+ } else {
return (testSqlAndScriptInject($var, $type) <= 0);
}
}
@@ -271,13 +267,11 @@ if (!empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERV
$newurl = preg_replace('/^http:/i', 'https:', $_SERVER["SCRIPT_URI"]);
}
}
- else // Check HTTPS environment variable (Apache/mod_ssl only)
- {
+ else {
+ // Check HTTPS environment variable (Apache/mod_ssl only)
$newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"];
}
- }
- else
- {
+ } else {
// Check HTTPS environment variable (Apache/mod_ssl only)
$newurl = $conf->file->main_force_https.$_SERVER["REQUEST_URI"];
}
@@ -288,9 +282,7 @@ if (!empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERV
dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl);
header("Location: ".$newurl);
exit;
- }
- else
- {
+ } else {
dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING);
}
}
@@ -432,9 +424,7 @@ if (!defined('NOLOGIN'))
if (defined('MAIN_AUTHENTICATION_MODE'))
{
$dolibarr_main_authentication = constant('MAIN_AUTHENTICATION_MODE');
- }
- else
- {
+ } else {
// Authentication mode
if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication = 'http,dolibarr';
// Authentication mode: forceuser
@@ -658,9 +648,7 @@ if (!defined('NOLOGIN'))
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
exit;
}
- }
- else
- {
+ } else {
// We are already into an authenticated session
$login = $_SESSION["dol_login"];
$entity = $_SESSION["dol_entity"];
@@ -710,9 +698,7 @@ if (!defined('NOLOGIN'))
if (GETPOST('lang', 'aZ09')) $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09');
header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : ''));
exit;
- }
- else
- {
+ } else {
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('main'));
@@ -814,9 +800,7 @@ if (!defined('NOLOGIN'))
session_destroy();
dol_print_error($db, 'Error in some triggers USER_LOGIN or in some hooks afterLogin');
exit;
- }
- else
- {
+ } else {
$db->commit();
}
@@ -986,9 +970,7 @@ if (empty($conf->browser->firefox))
define('ROWS_7', 7);
define('ROWS_8', 8);
define('ROWS_9', 9);
-}
-else
-{
+} else {
define('ROWS_1', 0);
define('ROWS_2', 1);
define('ROWS_3', 2);
@@ -1008,9 +990,8 @@ if (!defined('NOREQUIREMENU'))
if (empty($user->socid)) // If internal user or not defined
{
$conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
- }
- else // If external user
- {
+ } else {
+ // If external user
$conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
}
@@ -1333,9 +1314,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
if (preg_match('/^(http|\/\/)/i', $cssfile))
{
$urltofile = $cssfile;
- }
- else
- {
+ } else {
$urltofile = dol_buildpath($cssfile, 1);
}
print ''."\n".' '."\n";
@@ -1505,9 +1482,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
if (preg_match('/^(http|\/\/)/i', $jsfile))
{
print ''."\n";
- }
- else
- {
+ } else {
print ''."\n";
}
}
@@ -1606,9 +1581,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$logouttext .= '';
$logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin');
$logouttext .= ' ';
- }
- else
- {
+ } else {
$logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]);
$logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin opacitymedium');
}
@@ -1625,11 +1598,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
{
if ($result == 0)
$toprightmenu .= $hookmanager->resPrint; // add
- else
+ else {
$toprightmenu = $hookmanager->resPrint; // replace
- }
- else
- {
+ }
+ } else {
$toprightmenu .= $result; // For backward compatibility
}
@@ -2362,8 +2334,9 @@ function main_area($title = '')
print ''."\n";
print '';
print '';
- if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO))
+ if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) {
print '';
+ }
print ' '."\n";
print ''.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).' '."\n";
print ''.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).' '."\n";
@@ -2398,9 +2371,7 @@ function getHelpParamFor($helppagename, $langs)
$helpbaseurl = '%s';
$helppage = $helppagename;
$mode = 'local';
- }
- else
- {
+ } else {
// If WIKI URL
$reg = array();
if (preg_match('/^es/i', $langs->defaultlang))
@@ -2538,10 +2509,8 @@ if (!function_exists("llxFooter"))
{
$title = img_warning().' '.$langs->trans('CoreErrorTitle');
print ajax_dialog($title, $langs->trans('CoreErrorMessage'));
- }
- // html version
- else
- {
+ } else {
+ // html version
$msg = img_warning().' '.$langs->trans('CoreErrorMessage');
print ''.$msg.'
';
}
@@ -2683,9 +2652,7 @@ if (!function_exists("llxFooter"))
\n";
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 4005e6a2ed5..1ef1f9c1f50 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -60,14 +60,14 @@ if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type = constant('TEST_DB_FORCE_TYP
// Set properties specific to conf file
$conf->file->main_limit_users = $dolibarr_main_limit_users;
-$conf->file->mailing_limit_sendbyweb = $dolibarr_mailing_limit_sendbyweb;
-$conf->file->mailing_limit_sendbycli = $dolibarr_mailing_limit_sendbycli;
+$conf->file->mailing_limit_sendbyweb = $dolibarr_mailing_limit_sendbyweb;
+$conf->file->mailing_limit_sendbycli = $dolibarr_mailing_limit_sendbycli;
$conf->file->main_authentication = empty($dolibarr_main_authentication) ? '' : $dolibarr_main_authentication; // Identification mode
$conf->file->main_force_https = empty($dolibarr_main_force_https) ? '' : $dolibarr_main_force_https; // Force https
-$conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug)
+$conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug)
$conf->file->instance_unique_id = empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; // Unique id of instance
$conf->file->dol_document_root = array('main' => (string) DOL_DOCUMENT_ROOT); // Define array of document root directories ('/home/htdocs')
-$conf->file->dol_url_root = array('main' => (string) DOL_URL_ROOT); // Define array of url root path ('' or '/dolibarr')
+$conf->file->dol_url_root = array('main' => (string) DOL_URL_ROOT); // Define array of url root path ('' or '/dolibarr')
if (!empty($dolibarr_main_document_root_alt))
{
// dolibarr_main_document_root_alt can contains several directories
@@ -132,9 +132,7 @@ if (!defined('NOREQUIREDB'))
$langs->setDefaultLang('auto');
$langs->load("website");
print $langs->trans("SorryWebsiteIsCurrentlyOffLine");
- }
- else
- {
+ } else {
print "SorryWebsiteIsCurrentlyOffLine";
}
print '';
@@ -225,9 +223,7 @@ if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'" is allowed to connect for the moment.'."\n";
$nexturl = DOL_URL_ROOT.'/user/logout.php';
print 'Please try later or click here to disconnect and change login user ...'."\n";
- }
- else
- {
+ } else {
print 'Sorry, your application is offline. Only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'" is allowed to connect for the moment.'."\n";
$nexturl = DOL_URL_ROOT.'/';
print 'Please try later or click here to change login user ...'."\n";
diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php
index b2534ee92dd..9970026a524 100644
--- a/htdocs/viewimage.php
+++ b/htdocs/viewimage.php
@@ -155,20 +155,14 @@ if (!empty($hashp))
// We remove first level of directory
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
//var_dump($original_file); exit;
- }
- else
- {
+ } else {
accessforbidden('Bad link. File is from another module part.', 0, 0, 1);
}
- }
- else
- {
+ } else {
$modulepart = $moduleparttocheck;
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
}
- }
- else
- {
+ } else {
$langs->load("errors");
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
}
@@ -208,9 +202,7 @@ elseif (isset($_GET["publictakepos"]))
if (! empty($conf->global->TAKEPOS_AUTO_ORDER)) {
$accessallowed = 1; // Only if TakePOS Public Auto Order is enabled and received publictakepos variable
}
-}
-else
-{
+} else {
// Basic protection (against external users only)
if ($user->socid > 0)
{
@@ -290,9 +282,8 @@ if ($modulepart == 'barcode')
{
$result = $module->buildBarCode($code, $encoding, $readable);
}
-}
-else // Open and return file
-{
+} else {
+ // Open and return file
clearstatcache();
$filename = basename($fullpath_original_file);
@@ -314,9 +305,7 @@ else // Open and return file
{
top_httphead($type);
header('Content-Disposition: inline; filename="'.basename($fullpath_original_file).'"');
- }
- else
- {
+ } else {
top_httphead('image/png');
header('Content-Disposition: inline; filename="'.basename($fullpath_original_file).'"');
}
From b70efb5d7b4bdbb76afd8549b62ba64a0b4ca2f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Thu, 21 May 2020 01:10:33 +0200
Subject: [PATCH 04/28] add new rule
---
.travis.yml | 4 ++--
htdocs/filefunc.inc.php | 11 +++--------
htdocs/zapier/admin/setup.php | 3 +--
htdocs/zapier/class/hook.class.php | 2 +-
htdocs/zapier/hook_agenda.php | 8 ++------
htdocs/zapier/hook_card.php | 8 ++------
htdocs/zapier/hook_document.php | 4 +---
7 files changed, 12 insertions(+), 28 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 9958556d42d..752dd572371 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -291,8 +291,8 @@ script:
# Ensure we catch errors
set -e
# Exclusions are defined in the ruleset.xml file
- #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
+ phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
+ #if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
set +e
echo
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index b70419de5f4..d1a33d24344 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -87,9 +87,7 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done
// Note: If calling page was an index.php not into htdocs (ie comm/index.php, ...), then this redirect will fails,
// but we don't want to change this because when URL is correct, we must be sure the redirect to install/index.php will be correct.
$path = '';
- }
- else
- {
+ } else {
// If what we look is not index.php, we can try to guess location of root. May not work all the time.
// There is no real solution, because the only way to know the apache url relative path is to have it into conf file.
// If it fails to find correct $path, then only solution is to ask user to enter the correct URL to index.php or install/index.php
@@ -114,9 +112,7 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done
if (!empty($dolibarr_strict_mode))
{
error_reporting(E_ALL | E_STRICT);
-}
-else
-{
+} else {
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
}
@@ -156,8 +152,7 @@ if (!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck))
{
$csrfattack = false;
if (empty($_SERVER['HTTP_REFERER'])) $csrfattack = true; // An evil browser was used
- else
- {
+ else {
$tmpa = parse_url($_SERVER['HTTP_HOST']);
$tmpb = parse_url($_SERVER['HTTP_REFERER']);
if ((empty($tmpa['host']) ? $tmpa['path'] : $tmpa['host']) != (empty($tmpb['host']) ? $tmpb['path'] : $tmpb['host'])) $csrfattack = true;
diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php
index e608ece5bb7..8a74b525c2b 100644
--- a/htdocs/zapier/admin/setup.php
+++ b/htdocs/zapier/admin/setup.php
@@ -110,8 +110,7 @@ if ($action == 'edit') {
print '';
- } else
- {
+ } else {
print ' '.$langs->trans("NothingToSetup");
}
}
diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php
index b985c77434e..280780f8f25 100644
--- a/htdocs/zapier/class/hook.class.php
+++ b/htdocs/zapier/class/hook.class.php
@@ -398,7 +398,7 @@ class Hook extends CommonObject
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0 && !empty($this->table_element_line)) {
- $this->fetchLines();
+ //$this->fetchLines();
}
return $result;
}
diff --git a/htdocs/zapier/hook_agenda.php b/htdocs/zapier/hook_agenda.php
index ca046392cec..b036057cb04 100644
--- a/htdocs/zapier/hook_agenda.php
+++ b/htdocs/zapier/hook_agenda.php
@@ -45,9 +45,7 @@ if (GETPOST('actioncode', 'array'))
{
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
-}
-else
-{
+} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -217,9 +215,7 @@ if ($object->id > 0)
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create))
{
print ''.$langs->trans("AddAction").' ';
- }
- else
- {
+ } else {
print ''.$langs->trans("AddAction").' ';
}
}
diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php
index c2755892716..660e972cf28 100644
--- a/htdocs/zapier/hook_card.php
+++ b/htdocs/zapier/hook_card.php
@@ -338,9 +338,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($user->rights->mymodule->write)
{
print 'id.'&action=edit">'.$langs->trans("Modify").' '."\n";
- }
- else
- {
+ } else {
print ''.$langs->trans('Modify').' '."\n";
}
@@ -367,9 +365,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($user->rights->mymodule->delete)
{
print 'id.'&action=delete">'.$langs->trans('Delete').' '."\n";
- }
- else
- {
+ } else {
print ''.$langs->trans('Delete').' '."\n";
}
}
diff --git a/htdocs/zapier/hook_document.php b/htdocs/zapier/hook_document.php
index cdc5f8c7ddf..4c390a118e2 100644
--- a/htdocs/zapier/hook_document.php
+++ b/htdocs/zapier/hook_document.php
@@ -132,9 +132,7 @@ if ($object->id)
print '';
dol_fiche_end();
-}
-else
-{
+} else {
accessforbidden('', 0, 0);
}
From ee6fadd0d57dd74c8ecfa52f6f18c530c6928486 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Thu, 21 May 2020 01:41:27 +0200
Subject: [PATCH 05/28] add new rule
---
dev/tools/dolibarr-postgres2mysql.php | 21 +-
dev/translation/autotranslator.class.php | 19 +-
dev/translation/sanity_check_en_langfiles.php | 6 +-
dev/translation/strip_language_file.php | 9 +-
htdocs/admin/agenda.php | 6 +-
htdocs/admin/agenda_extsites.php | 9 +-
htdocs/admin/agenda_other.php | 30 +-
htdocs/admin/agenda_reminder.php | 12 +-
htdocs/admin/agenda_xcal.php | 3 +-
htdocs/admin/bank.php | 12 +-
htdocs/admin/barcode.php | 15 +-
htdocs/admin/bom.php | 33 +-
htdocs/admin/boxes.php | 15 +-
htdocs/admin/chequereceipts.php | 12 +-
htdocs/admin/clicktodial.php | 6 +-
htdocs/admin/commande.php | 48 +-
htdocs/admin/company.php | 42 +-
htdocs/admin/compta.php | 3 +-
htdocs/admin/confexped.php | 3 +-
htdocs/admin/const.php | 21 +-
htdocs/admin/contract.php | 30 +-
htdocs/admin/dav.php | 9 +-
htdocs/admin/debugbar.php | 3 +-
htdocs/admin/defaultvalues.php | 24 +-
htdocs/admin/delais.php | 3 +-
htdocs/admin/dict.php | 42 +-
.../class/PSWebServiceLibrary.class.php | 22 +-
.../admin/dolistore/class/dolistore.class.php | 6 +-
htdocs/admin/ecm.php | 9 +-
htdocs/admin/emailcollector_card.php | 30 +-
htdocs/admin/emailcollector_list.php | 3 +-
htdocs/admin/expedition.php | 27 +-
htdocs/admin/expensereport.php | 30 +-
htdocs/admin/expensereport_ik.php | 3 +-
htdocs/admin/expensereport_rules.php | 27 +-
htdocs/admin/external_rss.php | 21 +-
htdocs/admin/facture.php | 48 +-
htdocs/admin/fckeditor.php | 9 +-
htdocs/admin/fichinter.php | 36 +-
htdocs/admin/geoipmaxmind.php | 6 +-
htdocs/admin/holiday.php | 30 +-
htdocs/admin/ihm.php | 6 +-
htdocs/admin/ldap.php | 21 +-
htdocs/admin/ldap_contacts.php | 9 +-
htdocs/admin/ldap_groups.php | 9 +-
htdocs/admin/ldap_members.php | 9 +-
htdocs/admin/ldap_members_types.php | 9 +-
htdocs/admin/ldap_users.php | 15 +-
htdocs/admin/limits.php | 9 +-
htdocs/admin/livraison.php | 30 +-
htdocs/admin/loan.php | 6 +-
htdocs/admin/mailing.php | 3 +-
htdocs/admin/mailman.php | 15 +-
htdocs/admin/mails.php | 42 +-
htdocs/admin/mails_emailing.php | 39 +-
htdocs/admin/mails_senderprofile_list.php | 3 +-
htdocs/admin/mails_templates.php | 45 +-
htdocs/admin/menus.php | 3 +-
htdocs/admin/menus/edit.php | 30 +-
htdocs/admin/menus/index.php | 6 +-
htdocs/admin/menus/other.php | 3 +-
htdocs/admin/modulehelp.php | 18 +-
htdocs/admin/modules.php | 65 +-
htdocs/admin/mrp.php | 33 +-
htdocs/admin/multicurrency.php | 9 +-
htdocs/admin/notification.php | 9 +-
htdocs/admin/oauth.php | 3 +-
htdocs/admin/oauthlogintokens.php | 15 +-
htdocs/admin/payment.php | 6 +-
htdocs/admin/pdf.php | 3 +-
htdocs/admin/perms.php | 3 +-
htdocs/admin/prelevement.php | 3 +-
htdocs/admin/propal.php | 48 +-
htdocs/admin/receiptprinter.php | 6 +-
htdocs/admin/reception_setup.php | 24 +-
htdocs/admin/resource.php | 3 +-
htdocs/admin/security.php | 24 +-
htdocs/admin/security_other.php | 21 +-
htdocs/admin/sms.php | 9 +-
htdocs/admin/socialnetworks.php | 6 +-
htdocs/admin/spip.php | 6 +-
htdocs/admin/stock.php | 30 +-
htdocs/admin/supplier_invoice.php | 27 +-
htdocs/admin/supplier_order.php | 36 +-
htdocs/admin/supplier_payment.php | 21 +-
htdocs/admin/supplier_proposal.php | 45 +-
htdocs/admin/syslog.php | 6 +-
htdocs/admin/system/about.php | 3 +-
htdocs/admin/system/constall.php | 6 +-
htdocs/admin/system/database-tables.php | 6 +-
htdocs/admin/system/database.php | 3 +-
htdocs/admin/system/dbtable.php | 3 +-
htdocs/admin/system/dolibarr.php | 18 +-
htdocs/admin/system/filecheck.php | 33 +-
htdocs/admin/system/modules.php | 9 +-
htdocs/admin/system/perf.php | 36 +-
htdocs/admin/system/phpinfo.php | 21 +-
htdocs/admin/system/xdebug.php | 6 +-
htdocs/admin/taxes.php | 18 +-
htdocs/admin/ticket.php | 3 +-
htdocs/admin/ticket_public.php | 3 +-
htdocs/admin/tools/dolibarr_export.php | 17 +-
htdocs/admin/tools/dolibarr_import.php | 3 +-
htdocs/admin/tools/export.php | 3 +-
htdocs/admin/tools/export_files.php | 3 +-
htdocs/admin/tools/listevents.php | 6 +-
htdocs/admin/tools/listsessions.php | 6 +-
htdocs/admin/tools/update.php | 6 +-
htdocs/admin/translation.php | 30 +-
htdocs/admin/user.php | 33 +-
htdocs/admin/usergroup.php | 18 +-
htdocs/admin/website.php | 24 +-
htdocs/admin/website_options.php | 3 +-
htdocs/admin/workflow.php | 9 +-
htdocs/api/admin/index.php | 12 +-
htdocs/api/class/api.class.php | 3 +-
htdocs/api/class/api_access.class.php | 3 +-
htdocs/api/class/api_login.class.php | 3 +-
htdocs/api/class/api_setup.class.php | 33 +-
htdocs/api/index.php | 3 +-
htdocs/asset/admin/setup.php | 3 +-
htdocs/asset/card.php | 6 +-
htdocs/asset/class/asset.class.php | 3 +-
htdocs/asset/class/asset_type.class.php | 24 +-
htdocs/asset/document.php | 3 +-
htdocs/asset/list.php | 3 +-
htdocs/asset/type.php | 18 +-
htdocs/asterisk/cidlookup.php | 3 +-
htdocs/asterisk/wrapper.php | 6 +-
htdocs/barcode/codeinit.php | 15 +-
htdocs/barcode/printsheet.php | 3 +-
htdocs/blockedlog/admin/blockedlog.php | 6 +-
htdocs/blockedlog/admin/blockedlog_list.php | 24 +-
htdocs/blockedlog/ajax/block-info.php | 3 +-
htdocs/blockedlog/class/authority.class.php | 15 +-
htdocs/blockedlog/class/blockedlog.class.php | 20 +-
htdocs/bom/bom_agenda.php | 6 +-
htdocs/bom/bom_card.php | 15 +-
htdocs/bom/bom_document.php | 3 +-
htdocs/bom/bom_list.php | 15 +-
htdocs/bom/class/api_boms.class.php | 3 +-
htdocs/bom/class/bom.class.php | 21 +-
htdocs/bom/tpl/objectline_create.tpl.php | 3 +-
htdocs/bookmarks/admin/bookmark.php | 3 +-
htdocs/bookmarks/bookmarks.lib.php | 6 +-
htdocs/bookmarks/card.php | 18 +-
htdocs/bookmarks/class/bookmark.class.php | 15 +-
htdocs/bookmarks/list.php | 12 +-
htdocs/cashdesk/admin/cashdesk.php | 9 +-
htdocs/cashdesk/affContenu.php | 6 +-
htdocs/cashdesk/class/Auth.class.php | 3 +-
htdocs/cashdesk/class/Facturation.class.php | 18 +-
htdocs/cashdesk/facturation.php | 12 +-
htdocs/cashdesk/facturation_dhtml.php | 6 +-
htdocs/cashdesk/facturation_verif.php | 15 +-
htdocs/cashdesk/index.php | 6 +-
htdocs/cashdesk/index_verif.php | 6 +-
htdocs/cashdesk/tpl/liste_articles.tpl.php | 3 +-
htdocs/cashdesk/tpl/validation1.tpl.php | 3 +-
htdocs/cashdesk/validation_verif.php | 18 +-
htdocs/comm/action/card.php | 66 +-
htdocs/comm/action/class/actioncomm.class.php | 69 +-
.../comm/action/class/cactioncomm.class.php | 9 +-
htdocs/comm/action/class/ical.class.php | 9 +-
htdocs/comm/action/document.php | 6 +-
htdocs/comm/action/index.php | 82 +-
htdocs/comm/action/list.php | 21 +-
htdocs/comm/action/pertype.php | 36 +-
htdocs/comm/action/peruser.php | 42 +-
htdocs/comm/action/rapport/index.php | 3 +-
htdocs/comm/card.php | 54 +-
htdocs/comm/contact.php | 3 +-
htdocs/comm/index.php | 36 +-
htdocs/comm/mailing/advtargetemailing.php | 3 +-
htdocs/comm/mailing/card.php | 99 +-
htdocs/comm/mailing/cibles.php | 39 +-
.../mailing/class/advtargetemailing.class.php | 21 +-
.../html.formadvtargetemailing.class.php | 6 +-
htdocs/comm/mailing/class/mailing.class.php | 39 +-
htdocs/comm/mailing/index.php | 9 +-
htdocs/comm/mailing/list.php | 9 +-
htdocs/comm/multiprix.php | 3 +-
htdocs/comm/propal/card.php | 45 +-
.../comm/propal/class/api_proposals.class.php | 6 +-
htdocs/comm/propal/class/propal.class.php | 200 +-
htdocs/comm/propal/contact.php | 12 +-
htdocs/comm/propal/document.php | 3 +-
htdocs/comm/propal/index.php | 6 +-
htdocs/comm/propal/list.php | 15 +-
htdocs/comm/propal/stats/index.php | 9 +-
htdocs/comm/prospect/index.php | 3 +-
htdocs/comm/prospect/recap-prospect.php | 3 +-
htdocs/comm/recap-client.php | 3 +-
htdocs/comm/remise.php | 18 +-
htdocs/comm/remx.php | 60 +-
htdocs/commande/card.php | 63 +-
htdocs/commande/class/api_orders.class.php | 3 +-
htdocs/commande/class/commande.class.php | 200 +-
htdocs/commande/contact.php | 12 +-
htdocs/commande/customer.php | 3 +-
htdocs/commande/document.php | 6 +-
htdocs/commande/index.php | 6 +-
htdocs/commande/list.php | 9 +-
htdocs/commande/orderstoinvoice.php | 27 +-
htdocs/commande/stats/index.php | 9 +-
htdocs/core/actions_addupdatedelete.inc.php | 41 +-
htdocs/core/actions_builddoc.inc.php | 6 +-
htdocs/core/actions_comments.inc.php | 9 +-
htdocs/core/actions_extrafields.inc.php | 33 +-
htdocs/core/actions_fetchobject.inc.php | 3 +-
htdocs/core/actions_linkedfiles.inc.php | 17 +-
htdocs/core/actions_massactions.inc.php | 78 +-
htdocs/core/actions_sendmails.inc.php | 15 +-
htdocs/core/actions_setmoduleoptions.inc.php | 9 +-
htdocs/core/ajax/ajaxdirpreview.php | 14 +-
htdocs/core/ajax/ajaxdirtree.php | 2 +-
htdocs/core/ajax/check_notifications.php | 6 +-
htdocs/core/ajax/loadinplace.php | 6 +-
htdocs/core/ajax/saveinplace.php | 15 +-
htdocs/core/ajax/vatrates.php | 3 +-
htdocs/core/ajax/ziptown.php | 5 +-
htdocs/core/boxes/box_actions.php | 3 +-
htdocs/core/boxes/box_activity.php | 3 +-
htdocs/core/boxes/box_bookmarks.php | 3 +-
htdocs/core/boxes/box_external_rss.php | 3 +-
htdocs/core/boxes/box_factures_imp.php | 3 +-
htdocs/core/boxes/box_ficheinter.php | 6 +-
.../boxes/box_graph_invoices_permonth.php | 12 +-
.../box_graph_invoices_supplier_permonth.php | 12 +-
.../core/boxes/box_graph_orders_permonth.php | 12 +-
.../box_graph_orders_supplier_permonth.php | 12 +-
.../boxes/box_graph_product_distribution.php | 6 +-
.../boxes/box_graph_propales_permonth.php | 12 +-
htdocs/core/boxes/box_produits.php | 3 +-
.../core/boxes/box_produits_alerte_stock.php | 6 +-
htdocs/core/boxes/box_project.php | 3 +-
htdocs/core/boxes/box_services_contracts.php | 6 +-
htdocs/core/boxes/box_services_expired.php | 6 +-
htdocs/core/boxes/box_supplier_orders.php | 3 +-
...box_supplier_orders_awaiting_reception.php | 3 +-
htdocs/core/boxes/modules_boxes.php | 9 +-
htdocs/core/class/CMailFile.class.php | 51 +-
htdocs/core/class/CSMSFile.class.php | 15 +-
htdocs/core/class/ccountry.class.php | 12 +-
htdocs/core/class/comment.class.php | 9 +-
.../core/class/commondocgenerator.class.php | 5 +-
htdocs/core/class/commoninvoice.class.php | 39 +-
htdocs/core/class/commonobject.class.php | 383 +--
htdocs/core/class/commonobjectline.class.php | 3 +-
htdocs/core/class/conf.class.php | 3 +-
htdocs/core/class/coreobject.class.php | 33 +-
htdocs/core/class/cstate.class.php | 9 +-
htdocs/core/class/ctypent.class.php | 12 +-
htdocs/core/class/cunits.class.php | 24 +-
htdocs/core/class/discount.class.php | 51 +-
htdocs/core/class/dolgeoip.class.php | 18 +-
htdocs/core/class/dolgraph.class.php | 33 +-
.../core/class/emailsenderprofile.class.php | 3 +-
htdocs/core/class/evalmath.class.php | 6 +-
htdocs/core/class/events.class.php | 6 +-
htdocs/core/class/extrafields.class.php | 88 +-
htdocs/core/class/extralanguages.class.php | 37 +-
htdocs/core/class/fileupload.class.php | 9 +-
htdocs/core/class/fiscalyear.class.php | 18 +-
htdocs/core/class/hookmanager.class.php | 3 +-
htdocs/core/class/html.form.class.php | 398 +--
.../core/class/html.formaccounting.class.php | 18 +-
htdocs/core/class/html.formactions.class.php | 12 +-
htdocs/core/class/html.formadmin.class.php | 12 +-
htdocs/core/class/html.formcompany.class.php | 36 +-
htdocs/core/class/html.formcontract.class.php | 12 +-
htdocs/core/class/html.formfile.class.php | 138 +-
.../class/html.formintervention.class.php | 12 +-
htdocs/core/class/html.formmail.class.php | 54 +-
htdocs/core/class/html.formmargin.class.php | 3 +-
htdocs/core/class/html.formother.class.php | 56 +-
htdocs/core/class/html.formprojet.class.php | 36 +-
htdocs/core/class/html.formpropal.class.php | 9 +-
htdocs/core/class/html.formsms.class.php | 30 +-
.../class/html.formsocialcontrib.class.php | 9 +-
htdocs/core/class/html.formwebsite.class.php | 18 +-
htdocs/core/class/infobox.class.php | 20 +-
htdocs/core/class/interfaces.class.php | 15 +-
htdocs/core/class/ldap.class.php | 92 +-
htdocs/core/class/lessc.class.php | 2663 +++++++++--------
htdocs/core/class/link.class.php | 18 +-
htdocs/core/class/menubase.class.php | 21 +-
htdocs/core/class/notify.class.php | 30 +-
htdocs/core/class/openid.class.php | 12 +-
htdocs/core/class/rssparser.class.php | 36 +-
htdocs/core/class/smtps.class.php | 51 +-
htdocs/core/class/stats.class.php | 21 +-
htdocs/core/class/translate.class.php | 17 +-
htdocs/core/class/utils.class.php | 44 +-
htdocs/core/commonfieldsinexport.inc.php | 3 +-
htdocs/core/datepicker.php | 18 +-
htdocs/core/db/DoliDB.class.php | 17 +-
htdocs/core/db/mssql.class.php | 57 +-
htdocs/core/db/mysqli.class.php | 27 +-
htdocs/core/db/pgsql.class.php | 24 +-
htdocs/core/db/sqlite3.class.php | 15 +-
htdocs/core/extrafieldsinexport.inc.php | 3 +-
.../filemanagerdol/connectors/php/basexml.php | 6 +-
.../connectors/php/commands.php | 24 +-
.../core/filemanagerdol/connectors/php/io.php | 12 +-
.../filemanagerdol/connectors/php/util.php | 6 +-
htdocs/core/get_info.php | 5 +-
htdocs/core/get_menudiv.php | 2 +-
htdocs/core/lib/admin.lib.php | 63 +-
htdocs/core/lib/agenda.lib.php | 6 +-
htdocs/core/lib/ajax.lib.php | 3 +-
htdocs/core/lib/bank.lib.php | 3 +-
htdocs/core/lib/barcode.lib.php | 9 +-
htdocs/core/lib/company.lib.php | 39 +-
htdocs/core/lib/cron.lib.php | 3 +-
htdocs/core/lib/date.lib.php | 33 +-
htdocs/core/lib/doc.lib.php | 9 +-
htdocs/core/lib/doleditor.lib.php | 3 +-
htdocs/core/lib/ecm.lib.php | 3 +-
htdocs/core/lib/files.lib.php | 101 +-
htdocs/core/lib/format_cards.lib.php | 3 +-
htdocs/core/lib/functions.lib.php | 247 +-
htdocs/core/lib/functions2.lib.php | 68 +-
htdocs/core/lib/functionsnumtoword.lib.php | 3 +-
htdocs/core/lib/geturl.lib.php | 12 +-
htdocs/core/lib/images.lib.php | 12 +-
htdocs/core/lib/invoice2.lib.php | 6 +-
htdocs/core/lib/json.lib.php | 8 +-
htdocs/core/lib/ldap.lib.php | 3 +-
htdocs/core/lib/memory.lib.php | 18 +-
htdocs/core/lib/modulebuilder.lib.php | 15 +-
htdocs/core/lib/parsemd.lib.php | 3 +-
htdocs/core/lib/payments.lib.php | 15 +-
htdocs/core/lib/pdf.lib.php | 52 +-
htdocs/core/lib/price.lib.php | 20 +-
htdocs/core/lib/product.lib.php | 3 +-
htdocs/core/lib/project.lib.php | 27 +-
htdocs/core/lib/security.lib.php | 18 +-
htdocs/core/lib/security2.lib.php | 23 +-
htdocs/core/lib/sendings.lib.php | 12 +-
htdocs/core/lib/signature.lib.php | 6 +-
htdocs/core/lib/tax.lib.php | 33 +-
htdocs/core/lib/ticket.lib.php | 21 +-
htdocs/core/lib/treeview.lib.php | 9 +-
htdocs/core/lib/usergroups.lib.php | 105 +-
htdocs/core/lib/website.lib.php | 47 +-
htdocs/core/lib/xcal.lib.php | 9 +-
htdocs/core/login/functions_dolibarr.php | 12 +-
htdocs/core/login/functions_ldap.php | 6 +-
htdocs/core/login/functions_openid.php | 6 +-
htdocs/core/menus/standard/auguria.lib.php | 12 +-
htdocs/core/menus/standard/auguria_menu.php | 26 +-
htdocs/core/menus/standard/eldy.lib.php | 18 +-
htdocs/core/menus/standard/eldy_menu.php | 26 +-
htdocs/core/menus/standard/empty.php | 20 +-
htdocs/core/modules/DolibarrModules.class.php | 89 +-
htdocs/core/modules/action/modules_action.php | 9 +-
htdocs/core/modules/action/rapport.pdf.php | 3 +-
.../core/modules/bank/doc/pdf_ban.modules.php | 15 +-
.../bank/doc/pdf_sepamandate.modules.php | 15 +-
.../barcode/mod_barcode_product_standard.php | 18 +-
.../bom/doc/doc_generic_bom_odt.modules.php | 20 +-
htdocs/core/modules/bom/mod_bom_standard.php | 3 +-
.../modules/cheque/mod_chequereceipt_mint.php | 3 +-
.../modules/cheque/modules_chequereceipts.php | 9 +-
.../doc/doc_generic_order_odt.modules.php | 20 +-
.../commande/doc/pdf_einstein.modules.php | 38 +-
.../commande/doc/pdf_eratosthene.modules.php | 53 +-
.../modules/commande/mod_commande_marbre.php | 3 +-
.../doc/doc_generic_contract_odt.modules.php | 20 +-
.../contract/doc/pdf_strato.modules.php | 32 +-
.../modules/contract/mod_contract_serpis.php | 3 +-
.../modules/dons/html_cerfafr.modules.php | 30 +-
.../doc/doc_generic_shipment_odt.modules.php | 25 +-
.../expedition/doc/pdf_espadon.modules.php | 53 +-
.../expedition/doc/pdf_merou.modules.php | 30 +-
.../expedition/doc/pdf_rouget.modules.php | 50 +-
.../expedition/mod_expedition_safor.php | 3 +-
.../doc/pdf_standard.modules.php | 38 +-
.../expensereport/mod_expensereport_jade.php | 3 +-
.../modules/export/export_csv.modules.php | 6 +-
.../export/export_excel2007new.modules.php | 12 +-
.../doc/doc_generic_invoice_odt.modules.php | 17 +-
.../modules/facture/doc/pdf_crabe.modules.php | 47 +-
.../facture/doc/pdf_sponge.modules.php | 59 +-
.../core/modules/facture/mod_facture_mars.php | 3 +-
.../modules/facture/mod_facture_terre.php | 3 +-
.../fichinter/doc/pdf_soleil.modules.php | 29 +-
htdocs/core/modules/fichinter/mod_pacific.php | 3 +-
.../modules/fichinter/modules_fichinter.php | 9 +-
.../modules/holiday/mod_holiday_madonna.php | 3 +-
.../modules/import/import_csv.modules.php | 50 +-
.../modules/import/import_xlsx.modules.php | 41 +-
.../livraison/doc/pdf_typhon.modules.php | 32 +-
.../modules/livraison/mod_livraison_jade.php | 3 +-
.../mailings/advthirdparties.modules.php | 9 +-
.../modules/mailings/contacts1.modules.php | 12 +-
.../core/modules/mailings/fraise.modules.php | 9 +-
.../modules/mailings/modules_mailings.php | 6 +-
.../core/modules/mailings/pomme.modules.php | 3 +-
.../modules/mailings/thirdparties.modules.php | 15 +-
.../thirdparties_services_expired.modules.php | 6 +-
.../modules/mailings/xinputfile.modules.php | 11 +-
.../modules/mailings/xinputuser.modules.php | 6 +-
.../modules/member/doc/pdf_standard.class.php | 19 +-
htdocs/core/modules/member/modules_cards.php | 9 +-
htdocs/core/modules/modAgenda.class.php | 3 +-
htdocs/core/modules/modBlockedLog.class.php | 3 +-
.../mrp/doc/doc_generic_mo_odt.modules.php | 20 +-
htdocs/core/modules/mrp/mod_mo_standard.php | 3 +-
.../modules/oauth/github_oauthcallback.php | 3 +-
.../modules/oauth/google_oauthcallback.php | 3 +-
.../oauth/stripelive_oauthcallback.php | 3 +-
.../oauth/stripetest_oauthcallback.php | 3 +-
.../modules/payment/mod_payment_cicada.php | 3 +-
.../modules/printing/printgcp.modules.php | 15 +-
.../modules/printing/printipp.modules.php | 6 +-
.../doc/pdf_standardlabel.class.php | 10 +-
.../printsheet/doc/pdf_tcpdflabel.class.php | 10 +-
.../modules/printsheet/modules_labels.php | 9 +-
.../doc/doc_generic_product_odt.modules.php | 20 +-
.../product/doc/pdf_standard.modules.php | 18 +-
.../product/mod_codeproduct_elephant.php | 9 +-
.../modules/product/modules_product.class.php | 3 +-
.../doc/doc_generic_project_odt.modules.php | 47 +-
.../project/doc/pdf_baleine.modules.php | 29 +-
.../project/doc/pdf_beluga.modules.php | 26 +-
.../project/doc/pdf_timespent.modules.php | 29 +-
.../modules/project/mod_project_simple.php | 6 +-
.../task/doc/doc_generic_task_odt.modules.php | 29 +-
.../modules/project/task/mod_task_simple.php | 6 +-
.../doc/doc_generic_proposal_odt.modules.php | 20 +-
.../modules/propale/doc/pdf_azur.modules.php | 53 +-
.../modules/propale/doc/pdf_cyan.modules.php | 56 +-
.../modules/propale/mod_propale_marbre.php | 6 +-
.../modules/rapport/pdf_paiement.class.php | 9 +-
.../doc/doc_generic_reception_odt.modules.php | 23 +-
.../reception/doc/pdf_squille.modules.php | 47 +-
.../modules/reception/mod_reception_beryl.php | 3 +-
.../societe/doc/doc_generic_odt.modules.php | 17 +-
.../societe/mod_codeclient_elephant.php | 9 +-
.../modules/societe/mod_codeclient_monkey.php | 24 +-
.../societe/mod_codecompta_aquarium.php | 12 +-
.../societe/mod_codecompta_digitaria.php | 15 +-
.../modules/societe/modules_societe.class.php | 3 +-
.../doc/doc_generic_stock_odt.modules.php | 20 +-
.../stock/doc/pdf_standard.modules.php | 47 +-
.../stock/doc/pdf_stdmovement.modules.php | 53 +-
.../doc/pdf_canelle.modules.php | 35 +-
.../mod_facture_fournisseur_cactus.php | 3 +-
...doc_generic_supplier_order_odt.modules.php | 23 +-
.../supplier_order/doc/pdf_cornas.modules.php | 50 +-
.../doc/pdf_muscadet.modules.php | 47 +-
.../mod_commande_fournisseur_muguet.php | 3 +-
.../doc/pdf_standard.modules.php | 32 +-
.../mod_supplier_payment_bronan.php | 3 +-
..._generic_supplier_proposal_odt.modules.php | 23 +-
.../doc/pdf_aurore.modules.php | 47 +-
.../mod_supplier_proposal_marbre.php | 6 +-
.../core/modules/syslog/mod_syslog_file.php | 3 +-
.../core/modules/syslog/mod_syslog_syslog.php | 3 +-
.../user/doc/doc_generic_user_odt.modules.php | 14 +-
.../doc/doc_generic_usergroup_odt.modules.php | 23 +-
htdocs/core/photos_resize.php | 17 +-
htdocs/core/search.php | 3 +-
htdocs/core/search_page.php | 3 +-
.../core/tpl/admin_extrafields_edit.tpl.php | 3 +-
.../core/tpl/admin_extrafields_view.tpl.php | 3 +-
htdocs/core/tpl/bloc_comment.tpl.php | 6 +-
htdocs/core/tpl/card_presend.tpl.php | 9 +-
htdocs/core/tpl/contacts.tpl.php | 3 +-
.../tpl/extrafields_list_print_fields.tpl.php | 3 +-
.../tpl/extrafields_list_search_input.tpl.php | 3 +-
.../tpl/extrafields_list_search_title.tpl.php | 3 +-
htdocs/core/tpl/extrafields_view.tpl.php | 9 +-
htdocs/core/tpl/filemanager.tpl.php | 5 +-
htdocs/core/tpl/list_print_total.tpl.php | 3 +-
htdocs/core/tpl/login.tpl.php | 3 +-
htdocs/core/tpl/massactions_pre.tpl.php | 6 +-
htdocs/core/tpl/object_discounts.tpl.php | 3 +-
htdocs/core/tpl/objectline_create.tpl.php | 21 +-
htdocs/core/tpl/objectline_edit.tpl.php | 6 +-
htdocs/core/tpl/objectline_view.tpl.php | 12 +-
htdocs/core/tpl/resource_view.tpl.php | 3 +-
.../interface_20_all_Logevents.class.php | 3 +-
...terface_50_modAgenda_ActionsAuto.class.php | 14 +-
..._modBlockedlog_ActionsBlockedLog.class.php | 3 +-
...odMailmanspip_Mailmanspipsynchro.class.php | 18 +-
...terface_50_modTicket_TicketEmail.class.php | 3 +-
.../interface_80_modStripe_Stripe.class.php | 3 +-
htdocs/core/website.inc.php | 3 +-
htdocs/stripe/admin/stripe.php | 18 +-
htdocs/stripe/charge.php | 12 +-
htdocs/stripe/class/actions_stripe.class.php | 6 +-
htdocs/stripe/class/stripe.class.php | 36 +-
htdocs/stripe/config.php | 3 +-
htdocs/stripe/payout.php | 6 +-
htdocs/stripe/transaction.php | 6 +-
htdocs/supplier_proposal/card.php | 33 +-
.../class/supplier_proposal.class.php | 156 +-
htdocs/supplier_proposal/contact.php | 12 +-
htdocs/supplier_proposal/document.php | 3 +-
htdocs/supplier_proposal/index.php | 6 +-
htdocs/supplier_proposal/list.php | 6 +-
htdocs/support/inc.php | 6 +-
htdocs/takepos/admin/bar.php | 3 +-
htdocs/takepos/admin/orderprinters.php | 6 +-
htdocs/takepos/admin/receipt.php | 18 +-
htdocs/takepos/admin/setup.php | 6 +-
htdocs/takepos/admin/terminal.php | 9 +-
htdocs/takepos/ajax/ajax.php | 3 +-
htdocs/takepos/genimg/index.php | 6 +-
htdocs/takepos/index.php | 12 +-
htdocs/takepos/invoice.php | 36 +-
htdocs/takepos/pay.php | 6 +-
htdocs/takepos/phone.php | 3 +-
htdocs/takepos/reduction.php | 6 +-
htdocs/theme/eldy/global.inc.php | 6 +-
htdocs/theme/eldy/theme_vars.inc.php | 3 +-
htdocs/theme/md/style.css.php | 6 +-
htdocs/theme/md/theme_vars.inc.php | 3 +-
htdocs/ticket/agenda.php | 3 +-
htdocs/ticket/card.php | 3 +-
htdocs/ticket/class/actions_ticket.class.php | 3 +-
htdocs/ticket/class/ticket.class.php | 12 +-
htdocs/ticket/document.php | 3 +-
htdocs/ticket/list.php | 3 +-
htdocs/ticket/messaging.php | 3 +-
htdocs/ticket/stats/index.php | 9 +-
htdocs/user/bank.php | 18 +-
htdocs/user/card.php | 180 +-
htdocs/user/class/api_users.class.php | 6 +-
htdocs/user/class/user.class.php | 179 +-
htdocs/user/class/userbankaccount.class.php | 12 +-
htdocs/user/class/usergroup.class.php | 39 +-
htdocs/user/clicktodial.php | 8 +-
htdocs/user/document.php | 3 +-
htdocs/user/group/card.php | 36 +-
htdocs/user/group/ldap.php | 12 +-
htdocs/user/group/list.php | 6 +-
htdocs/user/group/perms.php | 9 +-
htdocs/user/hierarchy.php | 9 +-
htdocs/user/home.php | 15 +-
htdocs/user/ldap.php | 12 +-
htdocs/user/list.php | 6 +-
htdocs/user/note.php | 3 +-
htdocs/user/notify/card.php | 27 +-
htdocs/user/param_ihm.php | 9 +-
htdocs/user/passwordforgotten.php | 24 +-
htdocs/user/perms.php | 12 +-
htdocs/variants/combinations.php | 12 +-
htdocs/variants/create.php | 3 +-
htdocs/webservices/admin/index.php | 3 +-
htdocs/webservices/server_actioncomm.php | 15 +-
htdocs/webservices/server_category.php | 6 +-
htdocs/webservices/server_contact.php | 12 +-
htdocs/webservices/server_invoice.php | 21 +-
htdocs/webservices/server_order.php | 24 +-
htdocs/webservices/server_other.php | 3 +-
htdocs/webservices/server_payment.php | 3 +-
.../webservices/server_productorservice.php | 42 +-
htdocs/webservices/server_project.php | 15 +-
.../webservices/server_supplier_invoice.php | 9 +-
htdocs/webservices/server_thirdparty.php | 24 +-
htdocs/webservices/server_user.php | 42 +-
565 files changed, 5190 insertions(+), 8632 deletions(-)
diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php
index f2794455ca3..c17a73dfe12 100644
--- a/dev/tools/dolibarr-postgres2mysql.php
+++ b/dev/tools/dolibarr-postgres2mysql.php
@@ -76,14 +76,12 @@ function getfieldname($l)
if (preg_match("/`(.*)`/", $l, $regs)) {
if ($regs[1])
return $regs[1];
- else
- return null;
+ else return null;
} // if its not in quotes, then it should (we hope!) be the first "word" on the line, up to the first space.
elseif (preg_match("/([^\ ]*)/", trim($l), $regs)) {
if ($regs[1])
return $regs[1];
- else
- return null;
+ else return null;
}
}
@@ -102,8 +100,7 @@ function formatsize($s)
return sprintf("%.1f", round($s / 1024, 1)) . "K";
elseif ($s < pow(2, 30))
return sprintf("%.1f", round($s / 1024 / 1024, 1)) . "M";
- else
- return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G";
+ else return sprintf("%.1f", round($s / 1024 / 1024 / 1024, 1)) . "G";
}
/**
@@ -146,8 +143,7 @@ function pg2mysql_large($infilename, $outfilename)
if ($c % 2 != 0) {
if ($inquotes)
$inquotes = false;
- else
- $inquotes = true;
+ else $inquotes = true;
}
if ($linenum % 10000 == 0) {
@@ -329,8 +325,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$num = $regs[1];
if ($num <= 255)
$line = preg_replace("/ character varying\([0-9]*\)/", " varchar($num)", $line);
- else
- $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line);
+ else $line = preg_replace("/ character varying\([0-9]*\)/", " text", $line);
}
// character varying with no size, we will default to varchar(255)
if (preg_match("/ character varying/", $line)) {
@@ -352,8 +347,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$num = $regs[1];
if ($num <= 255)
$line = preg_replace("/ character\([0-9]*\)/", " varchar($num)", $line);
- else
- $line = preg_replace("/ character\([0-9]*\)/", " text", $line);
+ else $line = preg_replace("/ character\([0-9]*\)/", " text", $line);
}
// timestamps
$line = str_replace(" timestamp with time zone", " datetime", $line);
@@ -465,8 +459,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
if ($c % 2 != 0) {
if ($inquotes)
$inquotes = false;
- else
- $inquotes = true;
+ else $inquotes = true;
// echo "inquotes=$inquotes\n";
}
} while (substr($lines[$linenumber], - 3, - 1) != ");" || $inquotes);
diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php
index f9657482c86..b51515a42cb 100644
--- a/dev/translation/autotranslator.class.php
+++ b/dev/translation/autotranslator.class.php
@@ -77,7 +77,7 @@ class autoTranslator
$files = $this->getTranslationFilesArray($this->_refLang);
$counter = 1;
- foreach($files as $file)
+ foreach ($files as $file)
{
if ($this->_limittofile && $this->_limittofile != $file) continue;
$counter++;
@@ -94,7 +94,7 @@ class autoTranslator
// If we must process all languages
$arraytmp=dol_dir_list($this->_langDir, 'directories', 0);
- foreach($arraytmp as $dirtmp)
+ foreach ($arraytmp as $dirtmp)
{
if ($dirtmp['name'] === $this->_refLang) continue; // We discard source language
$tmppart=explode('_', $dirtmp['name']);
@@ -112,7 +112,7 @@ class autoTranslator
}
// Process translation of source file for each target languages
- foreach($targetlangs as $my_destlang)
+ foreach ($targetlangs as $my_destlang)
{
$this->_translatedFiles = array();
@@ -124,15 +124,14 @@ class autoTranslator
echo "File not found: " . $destPath . ". We generate it. \n";
$this->createTranslationFile($destPath, $my_destlang);
}
- else
- {
+ else {
echo "Updating file: " . $destPath . " \n";
}
// Translate lines
$fileContentDest = file($destPath, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
$newlines=0;
- foreach($fileContent as $line){
+ foreach ($fileContent as $line){
$key = $this->getLineKey($line);
$value = $this->getLineValue($line);
if ($key && $value)
@@ -167,7 +166,7 @@ class autoTranslator
fwrite($fp, "\n");
fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\n");
fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\n");
- foreach($this->_translatedFiles[$file] as $line) {
+ foreach ($this->_translatedFiles[$file] as $line) {
fwrite($fp, $line . "\n");
}
fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\n");
@@ -209,7 +208,7 @@ class autoTranslator
{
//print "key =".$key."\n";
- foreach($content as $line) {
+ foreach ($content as $line) {
$destKey = $this->getLineKey($line);
$destValue = $this->getLineValue($line);
// If translated return
@@ -273,8 +272,8 @@ class autoTranslator
private function getTranslationFilesArray($lang)
{
$dir = new DirectoryIterator($this->_langDir.$lang);
- while($dir->valid()) {
- if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) {
+ while ($dir->valid()) {
+ if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) {
$files[] = $dir->getFilename();
}
$dir->next();
diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php
index f568ba2b04b..0268fc94ed8 100755
--- a/dev/translation/sanity_check_en_langfiles.php
+++ b/dev/translation/sanity_check_en_langfiles.php
@@ -360,16 +360,14 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
$unused[$value] = $line;
echo $line; // $trad contains the \n
}
- else
- {
+ else {
unset($output);
//print 'X'.$output.'Y';
}
}
if (empty($unused)) print "No string not used found.\n";
- else
- {
+ else {
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";
file_put_contents($filetosave, implode("", $unused));
diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php
index ce28ca5de63..5a94192b2bd 100755
--- a/dev/translation/strip_language_file.php
+++ b/dev/translation/strip_language_file.php
@@ -80,8 +80,8 @@ $aEnglish = array();
if ($filesToProcess == 'all')
{
$dir = new DirectoryIterator('htdocs/langs/'.$lPrimary);
- while($dir->valid()) {
- if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) {
+ while ($dir->valid()) {
+ if (!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./', $dir->getFilename())) {
$files[] = $dir->getFilename();
}
$dir->next();
@@ -94,7 +94,7 @@ else $filesToProcess=explode(',', $filesToProcess);
// Loop on each file
-foreach($filesToProcess as $fileToProcess)
+foreach ($filesToProcess as $fileToProcess)
{
$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
@@ -285,8 +285,7 @@ foreach($filesToProcess as $fileToProcess)
print "Key $key is redundant in file $lPrimaryFile (line: $cnt) - Already found into ".$fileFirstFound[$key]." (line: ".$lineFirstFound[$key].").\n";
continue;
}
- else
- {
+ else {
$fileFirstFound[$key] = $fileToProcess;
$lineFirstFound[$key] = $cnt;
}
diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php
index b6231a45a10..52a1adc4fd2 100644
--- a/htdocs/admin/agenda.php
+++ b/htdocs/admin/agenda.php
@@ -62,8 +62,7 @@ if ($resql)
}
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
@@ -108,8 +107,7 @@ if ($action == "save" && empty($cancel))
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
$db->commit();
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
$db->rollback();
}
diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php
index 77113ff1e13..dd5d04732ff 100644
--- a/htdocs/admin/agenda_extsites.php
+++ b/htdocs/admin/agenda_extsites.php
@@ -108,8 +108,7 @@ if ($actionsave)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
}
@@ -163,14 +162,12 @@ if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1);
}
-else
-{
+else {
if (empty($conf->global->AGENDA_DISABLE_EXT))
{
print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Disabled"), 'off').' ';
}
}
diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index c5b196146d5..a9e5bccd71b 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -60,8 +60,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -74,8 +73,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -121,14 +119,12 @@ elseif ($action == 'specimen') // For orders
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -214,8 +210,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -263,8 +258,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
$module = new $classname($db, $specimenthirdparty);
if (method_exists($module, 'info'))
print $module->info($langs);
- else
- print $module->description;
+ else print $module->description;
print "\n";
// Active
@@ -277,14 +271,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
}
- else
- {
+ else {
print img_picto($langs->trans("Enabled"), 'switch_on');
}
print "";
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -296,8 +288,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -347,8 +338,7 @@ if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
-else
-{
+else {
print ''.img_picto($langs->trans("Enabled"), 'switch_on').' ';
}
print ''."\n";
diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php
index 3d51bd3158c..d9b7ead6f2e 100644
--- a/htdocs/admin/agenda_reminder.php
+++ b/htdocs/admin/agenda_reminder.php
@@ -55,8 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -69,8 +68,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -114,14 +112,12 @@ elseif ($action == 'specimen') // For orders
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php
index 7df74ba6a9d..b6d0472c3af 100644
--- a/htdocs/admin/agenda_xcal.php
+++ b/htdocs/admin/agenda_xcal.php
@@ -55,8 +55,7 @@ if ($actionsave)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("SaveFailed"), null, 'errors');
}
diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index b048dea9565..662dc517436 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -128,8 +128,7 @@ if ($actionsave)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
}
@@ -359,8 +358,7 @@ foreach ($dirmodels as $reldir) {
print "\n";
if (method_exists($module, 'info'))
print $module->info($langs);
- else
- print $module->description;
+ else print $module->description;
print ' ';
// Active
@@ -448,8 +446,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) {
print '';
print '';
}
-else
-{
+else {
print ''."\n";
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -509,8 +506,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
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 e577942ab21..90a2525de05 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -81,8 +81,7 @@ elseif ($action == 'update')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -265,19 +264,16 @@ if ($resql)
//print $url;
print ' ';
}
- else
- {
+ else {
print $langs->trans("FormatNotSupportedByGenerator");
}
}
- else
- {
+ else {
print 'ErrorClassNotFoundInModule '.$classname.' '.$obj->coder;
}
}
}
- else
- {
+ else {
print $langs->trans("ChooseABarCode");
}
print '';
@@ -412,8 +408,7 @@ if ($conf->product->enabled)
print img_picto($langs->trans("Activated"), 'switch_on');
print '';
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php
index 6d37def3187..26f3fe75858 100644
--- a/htdocs/admin/bom.php
+++ b/htdocs/admin/bom.php
@@ -58,8 +58,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -96,14 +95,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -161,8 +158,7 @@ elseif ($action == 'set_BOM_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -179,8 +175,7 @@ elseif ($action == 'set_BOM_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -262,8 +257,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -328,8 +322,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -399,8 +392,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -412,8 +404,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -442,8 +433,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'bill').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -489,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index c6ff9e94749..46f91e8b366 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -84,8 +84,7 @@ if ($action == 'add') {
$i++;
}
}
- else
- {
+ else {
setEventMessages($db->lasterror(), null, 'errors');
$error++;
}
@@ -135,8 +134,7 @@ if ($action == 'add') {
$db->commit();
$action = '';
}
- else
- {
+ else {
$db->rollback();
}
}
@@ -205,8 +203,7 @@ if ($action == 'switch')
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
}
}
@@ -346,8 +343,7 @@ foreach ($boxtoadd as $box)
{
$logo = $box->boximg;
}
- else
- {
+ else {
$logo = preg_replace("/^object_/i", "", $box->boximg);
}
@@ -411,8 +407,7 @@ foreach ($boxactivated as $key => $box)
{
$logo = $box->boximg;
}
- else
- {
+ else {
$logo = preg_replace("/^object_/i", "", $box->boximg);
}
diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php
index 8b5e7c433bf..397f289eaee 100644
--- a/htdocs/admin/chequereceipts.php
+++ b/htdocs/admin/chequereceipts.php
@@ -61,8 +61,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -84,8 +83,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -182,8 +180,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -260,8 +257,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php
index 36205697e89..56f4f076e54 100644
--- a/htdocs/admin/clicktodial.php
+++ b/htdocs/admin/clicktodial.php
@@ -47,8 +47,7 @@ if ($action == 'setvalue' && $user->admin)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -134,8 +133,7 @@ if (!empty($conf->global->CLICKTODIAL_URL))
{
print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
}
- else
- {
+ else {
$langs->load("errors");
print ''.$langs->trans("WarningClickToDialUserSetupNotComplete").'
';
}
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index 76f04d94c15..f1f22203fa2 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -67,8 +67,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -105,14 +104,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -170,8 +167,7 @@ elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -188,8 +184,7 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -218,8 +213,7 @@ elseif ($action == 'setribchq')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -235,8 +229,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -252,8 +245,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -335,8 +327,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -401,8 +392,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -472,8 +462,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -485,8 +474,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -520,8 +508,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'bill').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -595,14 +582,12 @@ if (empty($conf->facture->enabled))
}
print "";
}
- else
- {
+ else {
print "".$langs->trans("NoActiveBankAccountDefined")." ";
}
}
}
- else
- {
+ else {
print ''.$langs->trans("BankModuleNotActive").' ';
}
}
@@ -682,8 +667,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index f33a3ea6f93..b5ae98378c9 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -85,8 +85,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
$s = $mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity);
}
- else
- {
+ else {
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity);
}
@@ -165,14 +164,12 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
$tmparray = explode(':', $result);
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
}
- else
- {
+ else {
$error++;
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
}
}
- else
- {
+ else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
@@ -229,8 +226,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
{
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity);
}
- else
- {
+ else {
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity);
}
dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1", 'aZ09'), 'chaine', 0, '', $conf->entity);
@@ -241,8 +237,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
{
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity);
}
- else
- {
+ else {
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity);
}
dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity);
@@ -252,8 +247,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
}
@@ -302,16 +296,14 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO);
}
}
- else
- {
+ else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors');
@@ -583,8 +575,7 @@ if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-')
{
print ' ';
}
- else
- {
+ else {
print $countrynotdefined;
}
print '';
@@ -598,8 +589,7 @@ if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-')
{
print ' ';
}
- else
- {
+ else {
print $countrynotdefined;
}
print '';
@@ -613,8 +603,7 @@ if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-')
{
print ' ';
}
- else
- {
+ else {
print $countrynotdefined;
}
print '';
@@ -628,8 +617,7 @@ if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-')
{
print ' ';
}
- else
- {
+ else {
print $countrynotdefined;
}
print '';
@@ -643,8 +631,7 @@ if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-')
{
print ' ';
}
- else
- {
+ else {
print $countrynotdefined;
}
print '';
@@ -658,8 +645,7 @@ if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-')
{
print ' ';
}
- else
- {
+ else {
print $countrynotdefined;
}
print '';
diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php
index 3ccc2a213ac..7c1c64369ad 100644
--- a/htdocs/admin/compta.php
+++ b/htdocs/admin/compta.php
@@ -102,8 +102,7 @@ if ($action == 'update')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index fd93b0fa83d..3f5cc1cd920 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -136,8 +136,7 @@ if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
-else
-{
+else {
print ''.img_picto($langs->trans("Enabled"), 'switch_on').' ';
}
diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php
index bc22a2020fb..9da7fb10bbf 100644
--- a/htdocs/admin/const.php
+++ b/htdocs/admin/const.php
@@ -86,8 +86,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
$constvalue = "";
$constnote = "";
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -105,8 +104,7 @@ if (!empty($consts) && $action == 'update')
{
$nbmodified++;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -127,8 +125,7 @@ if (!empty($consts) && $action == 'delete')
{
$nbdeleted++;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -144,8 +141,7 @@ if ($action == 'delete')
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -231,8 +227,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity)
print '';
print '';
}
-else
-{
+else {
print ' ';
print ' ';
}
@@ -298,8 +293,7 @@ if ($result)
print ' ';
print '';
}
- else
- {
+ else {
print ' ';
print ' ';
}
@@ -308,8 +302,7 @@ if ($result)
{
print ' ';
}
- else
- {
+ else {
print ''.img_delete().' ';
}
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index ae0c9c89b38..f3c50287107 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -63,8 +63,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -101,14 +100,12 @@ elseif ($action == 'specimen') // For contract
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -169,8 +166,7 @@ elseif ($action == 'set_other')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -252,8 +248,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -317,8 +312,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -388,8 +382,7 @@ foreach ($dirmodels as $reldir)
print '';
print ' ';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -401,8 +394,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -434,8 +426,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'contract').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -483,8 +474,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php
index bb7e82901f5..b7cb424d2cb 100644
--- a/htdocs/admin/dav.php
+++ b/htdocs/admin/dav.php
@@ -101,8 +101,7 @@ if ($action == 'edit')
{
print $form->selectyesno($key, $conf->global->$key, 1);
}
- else
- {
+ else {
print ' ';
}
print '';
@@ -117,8 +116,7 @@ if ($action == 'edit')
print '';
print ' ';
}
-else
-{
+else {
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
@@ -141,8 +139,7 @@ else
{
print yn($conf->global->$key);
}
- else
- {
+ else {
print $conf->global->$key;
}
print '';
diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php
index 926080cb9b5..dad99b2ab39 100644
--- a/htdocs/admin/debugbar.php
+++ b/htdocs/admin/debugbar.php
@@ -59,8 +59,7 @@ if ($action == 'set')
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($error, null, 'errors');
}
diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php
index 094c4a8dd7c..2622d5ca514 100644
--- a/htdocs/admin/defaultvalues.php
+++ b/htdocs/admin/defaultvalues.php
@@ -151,8 +151,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
$defaultkey = '';
$defaultvalue = '';
}
- else
- {
+ else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
$action = '';
@@ -170,8 +169,7 @@ if ($action == 'delete')
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -198,8 +196,7 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml .= '';
}
-else
-{
+else {
// Button on, click to disable
$enabledisablehtml .= '';
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
@@ -261,8 +258,7 @@ if ($mode != 'sortorder')
{
$textkey = $form->textwithpicto($langs->trans("Field"), $texthelp);
}
-else
-{
+else {
$texthelp = 'field or alias.field';
$textkey = $form->textwithpicto($langs->trans("Field"), $texthelp);
}
@@ -281,8 +277,7 @@ if ($mode != 'focus' && $mode != 'mandatory')
}
$textvalue = $form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, 'subsitutiontooltip');
}
- else
- {
+ else {
$texthelp = 'ASC or DESC';
$textvalue = $form->textwithpicto($langs->trans("SortOrder"), $texthelp);
}
@@ -322,8 +317,7 @@ if (!empty($conf->multicompany->enabled) && !$user->entity)
print ' '; // We see environment, but to change it we must switch on other entity
print '';
}
-else
-{
+else {
print ' ';
print ' ';
print ' ';
@@ -394,8 +388,7 @@ if ($result)
print ' ';
print ''.img_delete().' ';
}
- else
- {
+ else {
print ' ';
print ' ';
print '
';
@@ -409,8 +402,7 @@ if ($result)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index 3ee262b464a..26f2f87e2d5 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -250,8 +250,7 @@ if ($action == 'edit')
print '
';
}
-else
-{
+else {
/*
* Show parameters
*/
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index cce441c4052..7ed84b59629 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -698,8 +698,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
{
$_POST["country"] = '';
}
- else
- {
+ else {
$ok = 0;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
}
@@ -792,8 +791,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
}
- else
- {
+ else {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
}
@@ -883,8 +881,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1302,8 +1299,7 @@ if ($id)
print '';
$filterfound++;
}
- else
- {
+ else {
print '';
print ' ';
}
@@ -1439,8 +1435,7 @@ if ($id)
print ' ';
print '';
}
- else
- {
+ else {
$tmpaction = 'view';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
@@ -1479,8 +1474,7 @@ if ($id)
{
$valuetoshow = '-';
}
- else
- {
+ else {
$key = $langs->trans("Country".strtoupper($obj->country_code));
$valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
}
@@ -1605,15 +1599,13 @@ if ($id)
elseif ($fieldlist[$field] == 'localtax1_type') {
if ($obj->localtax1 != 0)
$valuetoshow = $localtax_typeList[$valuetoshow];
- else
- $valuetoshow = '';
+ else $valuetoshow = '';
$class = "center";
}
elseif ($fieldlist[$field] == 'localtax2_type') {
if ($obj->localtax2 != 0)
$valuetoshow = $localtax_typeList[$valuetoshow];
- else
- $valuetoshow = '';
+ else $valuetoshow = '';
$class = "center";
}
elseif ($fieldlist[$field] == 'taux') {
@@ -1709,8 +1701,7 @@ if ($id)
// Active
print '';
if ($canbedisabled) print ''.$actl[$obj->active].' ';
- else
- {
+ else {
if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
elseif (isset($obj->type) && in_array($obj->type, array('system')) && !empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
@@ -1747,8 +1738,7 @@ if ($id)
print '';
}
-else
-{
+else {
/*
* Show list of dictionary to show
*/
@@ -1782,8 +1772,7 @@ else
{
print ''.$langs->trans($tablib[$i]).' ';
}
- else
- {
+ else {
print $langs->trans($tablib[$i]);
}
print ' ';
@@ -1796,8 +1785,7 @@ else
print ''.$tabname[$i].' ';
$lastlineisempty = false;
}
- else
- {
+ else {
if (!$lastlineisempty)
{
$showemptyline = 1;
@@ -2003,8 +1991,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
print $formaccounting->select_account($accountancy_account, '.'.$fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
}
- else
- {
+ else {
$fieldname = $fieldlist[$field];
print ' ';
}
@@ -2028,8 +2015,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print $form->selectExpenseRanges($obj->fk_range);
print '';
}
- else
- {
+ else {
$fieldValue = isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'';
if ($fieldlist[$field] == 'sortorder')
diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
index 3c735707c4a..6eaf1cf375a 100644
--- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
+++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
@@ -136,8 +136,9 @@ class PrestaShopWebservice
{
if (isset($curl_params[$defkey]))
$curl_options[$defkey] = $curl_params[$defkey];
- else
+ else {
$curl_options[$defkey] = $defaultParams[$defkey];
+ }
}
foreach ($curl_params as $defkey => $defval)
if (!isset($curl_options[$defkey]))
@@ -237,8 +238,9 @@ class PrestaShopWebservice
}
return $xml;
}
- else
+ else {
throw new PrestaShopWebserviceException('HTTP response is empty');
+ }
}
/**
@@ -264,9 +266,7 @@ class PrestaShopWebservice
$url .= '&id_shop='.$options['id_shop'];
if (isset($options['id_group_shop']))
$url .= '&id_group_shop='.$options['id_group_shop'];
- }
- else
- {
+ } else {
throw new PrestaShopWebserviceException('Bad parameters given');
}
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml));
@@ -323,9 +323,9 @@ class PrestaShopWebservice
$url_params[$k] = $options[$k];
if (count($url_params) > 0)
$url .= '?'.http_build_query($url_params);
- }
- else
+ } else {
throw new PrestaShopWebserviceException('Bad parameters given ');
+ }
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
self::checkStatusCode($request['status_code']); // check the response validity
@@ -356,9 +356,9 @@ class PrestaShopWebservice
$url_params[$k] = $options[$k];
if (count($url_params) > 0)
$url .= '?'.http_build_query($url_params);
- }
- else
+ } else {
throw new PrestaShopWebserviceException('Bad parameters given');
+ }
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true));
self::checkStatusCode($request['status_code']); // check the response validity
return $request['header'];
@@ -387,9 +387,9 @@ class PrestaShopWebservice
$url .= '&id_shop='.$options['id_shop'];
if (isset($options['id_group_shop']))
$url .= '&id_group_shop='.$options['id_group_shop'];
- }
- else
+ } else {
throw new PrestaShopWebserviceException('Bad parameters given');
+ }
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml));
self::checkStatusCode($request['status_code']); // check the response validity
diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php
index a229f3c985d..1d764a849be 100644
--- a/htdocs/admin/dolistore/class/dolistore.class.php
+++ b/htdocs/admin/dolistore/class/dolistore.class.php
@@ -101,8 +101,7 @@ class Dolistore
$trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) die('Bad ID');
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
- else
- {
+ else {
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.' ';
print $e->getMessage();
}
@@ -183,8 +182,7 @@ class Dolistore
$trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) die('Bad ID');
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
- else
- {
+ else {
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.' ';
print $e->getMessage();
}
diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php
index 0c348b25f60..b9af92dc8a5 100644
--- a/htdocs/admin/ecm.php
+++ b/htdocs/admin/ecm.php
@@ -42,8 +42,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -56,8 +55,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -94,8 +92,7 @@ if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
}
-else
-{
+else {
if (empty($conf->global->ECM_AUTO_TREE_ENABLED))
{
print ''.img_picto($langs->trans("Disabled"), 'off').' ';
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index 80161eaadc6..a554354420d 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -127,8 +127,7 @@ if (GETPOST('addfilter', 'alpha'))
{
$object->fetchFilters();
}
- else
- {
+ else {
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
}
}
@@ -142,8 +141,7 @@ if ($action == 'deletefilter')
{
$object->fetchFilters();
}
- else
- {
+ else {
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
}
}
@@ -163,8 +161,7 @@ if (GETPOST('addoperation', 'alpha'))
{
$object->fetchActions();
}
- else
- {
+ else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
}
}
@@ -182,8 +179,7 @@ if ($action == 'updateoperation')
{
$object->fetchActions();
}
- else
- {
+ else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
}
}
@@ -196,8 +192,7 @@ if ($action == 'deleteoperation')
{
$object->fetchActions();
}
- else
- {
+ else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
}
}
@@ -212,8 +207,7 @@ if ($action == 'confirm_collect')
$debuginfo = $object->debuginfo;
setEventMessages($object->lastresult, null, 'mesgs');
}
- else
- {
+ else {
$debuginfo = $object->debuginfo;
setEventMessages($object->error, null, 'errors');
}
@@ -440,8 +434,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver);
}
- else
- {
+ else {
$morehtml .= 'IMAP functions not available on your PHP';
}
@@ -449,8 +442,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
}
- else
- {
+ else {
$morehtml .= imap_num_msg($connection);
}
@@ -582,8 +574,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($res)
$arrayoftypes = $hookmanager->resArray;
- else
- foreach ($hookmanager->resArray as $k=>$desc)
+ else foreach ($hookmanager->resArray as $k=>$desc)
$arrayoftypes[$k] = $desc;
@@ -626,8 +617,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' ';
print ' ';
}
- else
- {
+ else {
print $ruleaction['actionparam'];
}
print '';
diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php
index f180cdf10cf..bb17bbdca05 100644
--- a/htdocs/admin/emailcollector_list.php
+++ b/htdocs/admin/emailcollector_list.php
@@ -242,8 +242,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{
$num = $nbtotalofrecords;
}
-else
-{
+else {
$sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index be9e7091300..cd9a2976e11 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -69,8 +69,7 @@ if ($action == 'updateMask')
{
if ($res > 0)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- else
- setEventMessages($langs->trans("Error"), null, 'errors');
+ else setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -130,14 +129,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -259,8 +256,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -327,8 +323,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -396,8 +391,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -409,8 +403,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -439,8 +432,7 @@ foreach ($dirmodels as $reldir)
{
print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -487,8 +479,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index d076e77bf44..20f85dc6a29 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -64,8 +64,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -104,14 +103,12 @@ elseif ($action == 'specimen') // For fiche inter
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -179,8 +176,7 @@ elseif ($action == 'setoptions')
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
@@ -264,8 +260,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -329,8 +324,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -396,8 +390,7 @@ foreach ($dirmodels as $reldir)
print '';
print "";
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -409,8 +402,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -435,8 +427,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'intervention').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -485,8 +476,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php
index 83bb28ca440..2b089335c40 100644
--- a/htdocs/admin/expensereport_ik.php
+++ b/htdocs/admin/expensereport_ik.php
@@ -162,8 +162,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab)
echo ' ';
echo ' ';
}
- else
- {
+ else {
echo ''.img_edit().' ';
if (!empty($range->ik->id)) echo ''.img_delete().' ';
// TODO add delete link
diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php
index a40e8d95520..0c99b4e4dda 100644
--- a/htdocs/admin/expensereport_rules.php
+++ b/htdocs/admin/expensereport_rules.php
@@ -229,8 +229,7 @@ foreach ($rules as $rule)
echo ''.$form->select_dolusers($object->fk_user, 'fk_user').'
';
echo ''.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').'
';
}
- else
- {
+ else {
if ($rule->is_for_all > 0) echo $tab_apply['A'];
elseif ($rule->fk_usergroup > 0) echo $tab_apply['G'].' ('.$rule->getGroupLabel().')';
elseif ($rule->fk_user > 0) echo $tab_apply['U'].' ('.$rule->getUserName().')';
@@ -243,11 +242,9 @@ foreach ($rules as $rule)
{
echo $form->selectExpense($object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1);
}
- else
- {
+ else {
if ($rule->fk_c_type_fees == -1) echo $langs->trans('AllExpenseReport');
- else
- {
+ else {
$key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id');
if ($key != $langs->trans($key)) echo $langs->trans($key);
else echo $langs->trans(getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id')); // TODO check to return trans of 'code'
@@ -261,8 +258,7 @@ foreach ($rules as $rule)
{
echo $form->selectarray('code_expense_rules_type', $tab_rules_type, $object->code_expense_rules_type, 0);
}
- else
- {
+ else {
echo $tab_rules_type[$rule->code_expense_rules_type];
}
echo '';
@@ -273,8 +269,7 @@ foreach ($rules as $rule)
{
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0);
}
- else
- {
+ else {
echo dol_print_date($rule->dates, 'day');
}
echo '';
@@ -285,8 +280,7 @@ foreach ($rules as $rule)
{
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
}
- else
- {
+ else {
echo dol_print_date($rule->datee, 'day');
}
echo '';
@@ -297,8 +291,7 @@ foreach ($rules as $rule)
{
echo ' '.$conf->currency;
}
- else
- {
+ else {
echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency);
}
echo '';
@@ -309,8 +302,7 @@ foreach ($rules as $rule)
{
echo $form->selectyesno('restrictive', $object->restrictive, 1);
}
- else
- {
+ else {
echo yn($rule->restrictive, 1, 1);
}
echo '';
@@ -322,8 +314,7 @@ foreach ($rules as $rule)
echo ''.img_edit().' ';
echo ''.img_delete().' ';
}
- else
- {
+ else {
echo ' ';
echo ''.$langs->trans('Cancel').' ';
}
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index 8aa1a425778..eac6d7eb8e9 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -61,8 +61,7 @@ if ($result)
if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1];
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -93,8 +92,7 @@ if ($action == 'add' || GETPOST("modify"))
}
*/
}
- else
- {
+ else {
// Ajoute boite box_external_rss dans definition des boites
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)";
$sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')";
@@ -114,8 +112,7 @@ if ($action == 'add' || GETPOST("modify"))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -162,8 +159,7 @@ if ($_POST["delete"])
$db->commit();
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db, "sql=".$sql);
exit;
@@ -179,8 +175,7 @@ if ($_POST["delete"])
header("Location: external_rss.php");
exit;
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -293,8 +288,7 @@ if ($resql)
{
print ''.$langs->trans("Online").'';
}
- else
- {
+ else {
print ''.$langs->trans("Offline");
$langs->load("errors");
if ($rssparser->error) print ' - '.$langs->trans($rssparser->error);
@@ -332,8 +326,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 1a484ec8c7e..6c0c03b6dda 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -72,8 +72,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -109,14 +108,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -173,8 +170,7 @@ elseif ($action == 'setribchq')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -190,8 +186,7 @@ elseif ($action == 'set_FACTURE_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -208,8 +203,7 @@ elseif ($action == 'set_INVOICE_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -225,8 +219,7 @@ elseif ($action == 'setforcedate')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -248,8 +241,7 @@ elseif ($action == 'setDefaultPDFModulesByType')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -350,8 +342,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -463,8 +454,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -535,8 +525,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ' '."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').' ';
print " ";
@@ -548,8 +537,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').' ';
}
print '';
@@ -583,8 +571,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'bill').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -691,14 +678,12 @@ if (!empty($conf->banque->enabled))
}
print "";
}
- else
- {
+ else {
print ''.$langs->trans("NoActiveBankAccountDefined").' ';
}
}
}
-else
-{
+else {
print $langs->trans("BankModuleNotActive");
}
print "";
@@ -777,8 +762,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 00995a302a5..9dfc2cff6d1 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -127,8 +127,7 @@ if (GETPOST('save', 'alpha'))
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -147,8 +146,7 @@ if (empty($conf->use_javascript_ajax))
{
setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors');
}
-else
-{
+else {
print '';
print '';
print ''.$langs->trans("ActivateFCKeditor").' ';
@@ -212,8 +210,7 @@ else
$editor = new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST : 'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
$editor->Create();
}
- else
- {
+ else {
print '';
print $conf->global->FCKEDITOR_TEST;
print '
';
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 055384c0084..602570194fd 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -64,8 +64,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -102,14 +101,12 @@ elseif ($action == 'specimen') // For fiche inter
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -167,8 +164,7 @@ elseif ($action == 'set_FICHINTER_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -184,8 +180,7 @@ elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -201,8 +196,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
@@ -325,8 +319,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -389,8 +382,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -458,8 +450,7 @@ foreach ($dirmodels as $reldir)
print '';
print "";
}
- else
- {
+ else {
print "\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -471,8 +462,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -499,8 +489,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'intervention').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -545,8 +534,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php
index a661f3a8e9a..ba602c4b609 100644
--- a/htdocs/admin/geoipmaxmind.php
+++ b/htdocs/admin/geoipmaxmind.php
@@ -65,8 +65,7 @@ if ($action == 'set')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -183,8 +182,7 @@ if ($geoip)
if ($result) print $result;
else print $langs->trans("Error");
}
- else
- {
+ else {
print ' '.$ip.' -> ';
$result = dol_print_ip($ip, 1);
if ($result) print $result;
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index aafe01bf5bd..58f39e30ff2 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -65,8 +65,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -103,14 +102,12 @@ elseif ($action == 'specimen') // For contract
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -171,8 +168,7 @@ elseif ($action == 'set_other')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -255,8 +251,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -332,8 +327,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -404,8 +398,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -417,8 +410,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -450,8 +442,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'contract').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -502,8 +493,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index 1b088f0c2b9..8df8a120c05 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -197,14 +197,12 @@ if ($action == 'update')
$tmparray = explode(':', $result);
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
}
- else
- {
+ else {
$error++;
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
}
}
- else
- {
+ else {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index bd24e793374..33f1abb251f 100644
--- a/htdocs/admin/ldap.php
+++ b/htdocs/admin/ldap.php
@@ -77,8 +77,7 @@ if (empty($reshook))
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -215,8 +214,7 @@ if (!empty($conf->global->LDAP_SERVER_PORT))
{
print ' ';
}
-else
-{
+else {
print ' ';
}
print ''.$langs->trans("LDAPServerPortExample").' ';
@@ -249,8 +247,7 @@ if (!empty($conf->global->LDAP_ADMIN_PASS))
{
print ' '; // je le met en visible pour test
}
-else
-{
+else {
print ' ';
}
print ''.$langs->trans('Password').' (ex: secret) ';
@@ -296,8 +293,7 @@ if (function_exists("ldap_connect"))
print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).' ';
print ' ';
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).' ';
print ' ';
@@ -305,8 +301,7 @@ if (function_exists("ldap_connect"))
print ' ';
}
}
- else
- {
+ else {
print img_picto('', 'warning').' ';
print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").' ';
print ' ';
@@ -320,8 +315,7 @@ if (function_exists("ldap_connect"))
print ''.$langs->trans("LDAPSetupForVersion3").' ';
print ' ';
}
- else
- {
+ else {
print img_picto('', 'info').' ';
print ''.$langs->trans("LDAPSetupForVersion2").' ';
print ' ';
@@ -329,8 +323,7 @@ if (function_exists("ldap_connect"))
$unbind = $ldap->unbind();
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).' ';
print ' ';
diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php
index 834bde4eea5..58eb04e595d 100644
--- a/htdocs/admin/ldap_contacts.php
+++ b/htdocs/admin/ldap_contacts.php
@@ -79,8 +79,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -293,8 +292,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' ';
print ''.$langs->trans("LDAPSynchroOK").' ';
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
@@ -307,8 +305,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info));
print "\n ";
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php
index fb49c947411..a301738db94 100644
--- a/htdocs/admin/ldap_groups.php
+++ b/htdocs/admin/ldap_groups.php
@@ -71,8 +71,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -234,8 +233,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' ';
print ''.$langs->trans("LDAPSynchroOK").' ';
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
@@ -248,8 +246,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info));
print "\n ";
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php
index f6fa74cb79d..eba84afe925 100644
--- a/htdocs/admin/ldap_members.php
+++ b/htdocs/admin/ldap_members.php
@@ -96,8 +96,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -416,8 +415,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' ';
print ''.$langs->trans("LDAPSynchroOK").' ';
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
@@ -430,8 +428,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info));
print "\n ";
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php
index 6628dd4d144..6913c477b38 100644
--- a/htdocs/admin/ldap_members_types.php
+++ b/htdocs/admin/ldap_members_types.php
@@ -69,8 +69,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -216,8 +215,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' ';
print ''.$langs->trans("LDAPSynchroOK").' ';
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
@@ -230,8 +228,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info));
print "\n ";
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index 7781cf45676..d0d3bb50d0d 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -90,8 +90,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -396,8 +395,7 @@ if (function_exists("ldap_connect"))
print img_picto('', 'info').' ';
print ''.$langs->trans("LDAPSynchroOK").' ';
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
@@ -410,8 +408,7 @@ if (function_exists("ldap_connect"))
print nl2br($ldap->dump_content($dn, $info));
print "\n ";
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
@@ -477,8 +474,7 @@ if (function_exists("ldap_connect"))
$liste[$key] = $label;
}
}
- else
- {
+ else {
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
@@ -491,8 +487,7 @@ if (function_exists("ldap_connect"))
print "=> ".count($liste)." records \n";
print "\n ";
}
- else
- {
+ else {
print img_picto('', 'error').' ';
print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php
index 0646c7f6d46..b03067bd581 100644
--- a/htdocs/admin/limits.php
+++ b/htdocs/admin/limits.php
@@ -163,8 +163,7 @@ if ($action == 'edit')
print '';
print ' ';
}
-else
-{
+else {
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
@@ -204,8 +203,7 @@ if (empty($mysoc->country_code))
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print ''.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").' ';
}
-else
-{
+else {
// Show examples
print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
@@ -270,8 +268,7 @@ else
}
}
}
- else
- {
+ else {
// More examples if not specific vat rate found
// This example must be kept for test purpose with current value because value used (2/7, 10/3, and vat 0, 10)
// were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule.
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index 4cd8f4841e5..f6e3c0e63f9 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -64,8 +64,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -81,8 +80,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -119,14 +117,12 @@ if ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -250,8 +246,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -317,8 +312,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -384,8 +378,7 @@ foreach ($dirmodels as $reldir)
print '';
print "";
}
- else
- {
+ else {
print "\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -397,8 +390,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -418,8 +410,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'sending').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -463,8 +454,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php
index 45202de342b..23cd1fd6bba 100644
--- a/htdocs/admin/loan.php
+++ b/htdocs/admin/loan.php
@@ -64,8 +64,7 @@ if ($action == 'update')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -108,8 +107,7 @@ foreach ($list as $key)
{
print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
}
- else
- {
+ else {
print ' ';
}
print '';
diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php
index 921a4a6338c..020c1ef5241 100644
--- a/htdocs/admin/mailing.php
+++ b/htdocs/admin/mailing.php
@@ -66,8 +66,7 @@ if ($action == 'setvalue')
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php
index 05c36128e8d..100b5cf3224 100644
--- a/htdocs/admin/mailman.php
+++ b/htdocs/admin/mailman.php
@@ -66,8 +66,7 @@ if ($action == 'update' || $action == 'add')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -100,8 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');
}
- else
- {
+ else {
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
$mailmanspip = new MailmanSpip($db);
@@ -119,8 +117,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf
$error++;
setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("MailmanCreationSuccess"), null);
}
}
@@ -132,8 +129,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && !empty($conf
$error++;
setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
}
- else
- {
+ else {
setEventMessages($langs->trans("MailmanDeletionSuccess"), null);
}
}
@@ -212,8 +208,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN))
print '';
}
-else
-{
+else {
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
$link = '';
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 5502d44dae0..42ddb907b7d 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -170,8 +170,7 @@ if ($action == 'edit')
jQuery("#smtp_server_mess").show();
jQuery("#smtp_port_mess").show();';
}
- else
- {
+ else {
print '
jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);
jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true);
@@ -287,8 +286,7 @@ if ($action == 'edit')
{
print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE);
}
- else
- {
+ else {
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE];
if (empty($text)) $text = $langs->trans("Undefined");
$htmltext = $langs->trans("ContactSuperAdminForChange");
@@ -305,8 +303,7 @@ if ($action == 'edit')
print ' ';
print ''.$langs->trans("SeeLocalSendMailSetup").' ';
}
- else
- {
+ else {
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '');
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@@ -319,8 +316,7 @@ if ($action == 'edit')
print ' ';
print ''.$langs->trans("SeeLocalSendMailSetup").' ';
}
- else
- {
+ else {
$text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@@ -337,8 +333,7 @@ if ($action == 'edit')
print ' ';
print ''.$langs->trans("SeeLocalSendMailSetup").' ';
}
- else
- {
+ else {
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '');
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
@@ -351,8 +346,7 @@ if ($action == 'edit')
print ' ';
print ''.$langs->trans("SeeLocalSendMailSetup").' ';
}
- else
- {
+ else {
$text = (!empty($mainport) ? $mainport : $smtpport);
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@@ -371,8 +365,7 @@ if ($action == 'edit')
{
print ' ';
}
- else
- {
+ else {
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin');
print ' ';
@@ -392,8 +385,7 @@ if ($action == 'edit')
{
print ' ';
}
- else
- {
+ else {
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin');
print ' ';
@@ -497,8 +489,7 @@ if ($action == 'edit')
print '';
}
-else
-{
+else {
dol_fiche_head($head, 'common', '', -1);
print ''.$langs->trans("EMailsDesc")." \n";
@@ -539,8 +530,7 @@ else
{
print ' '.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").' '.$langs->trans("SeeLocalSendMailSetup").' ';
}
- 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) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').' ';
}
@@ -549,8 +539,7 @@ else
{
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) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').' ';
}
@@ -699,8 +688,7 @@ else
print $conf->global->MAIN_MAIL_AUTOCOPY_TO;
if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
}
- else
- {
+ else {
print ' ';
}
print '';
@@ -722,8 +710,7 @@ else
print ''.$langs->trans("DoTestServerAvailability").' ';
}
}
- else
- {
+ else {
print ''.$langs->trans("DoTestServerAvailability").' ';
}
@@ -795,8 +782,7 @@ else
$mail = new CMailFile('', '', '', '', array(), array(), array(), '', '', 0, '', '', '', '', $trackid, $sendcontext);
$result = $mail->check_server_port($server, $port);
if ($result) print ''.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
';
- else
- {
+ else {
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port);
if ($mail->error) {
diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php
index 84a0d2a0893..98c44f2b503 100644
--- a/htdocs/admin/mails_emailing.php
+++ b/htdocs/admin/mails_emailing.php
@@ -157,8 +157,7 @@ if ($action == 'edit')
jQuery("#smtp_port_mess").show();
';
}
- else
- {
+ else {
print '
jQuery("#MAIN_MAIL_SMTP_SERVER_EMAILING").prop("disabled", true);
jQuery("#MAIN_MAIL_SMTP_PORT_EMAILING").prop("disabled", true);
@@ -237,8 +236,7 @@ if ($action == 'edit')
{
print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING);
}
- else
- {
+ else {
$text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING];
if (empty($text)) $text = $langs->trans("Undefined");
$htmltext = $langs->trans("ContactSuperAdminForChange");
@@ -256,8 +254,7 @@ if ($action == 'edit')
print '';
print $langs->trans("SeeLocalSendMailSetup");
}
- else
- {
+ else {
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '');
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@@ -270,8 +267,7 @@ if ($action == 'edit')
print ' ';
print ''.$langs->trans("SeeLocalSendMailSetup").' ';
}
- else
- {
+ else {
$text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@@ -289,8 +285,7 @@ if ($action == 'edit')
print ' ';
print $langs->trans("SeeLocalSendMailSetup");
}
- else
- {
+ else {
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '');
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
@@ -303,8 +298,7 @@ if ($action == 'edit')
print ' ';
print ''.$langs->trans("SeeLocalSendMailSetup").' ';
}
- else
- {
+ else {
$text = (!empty($mainport) ? $mainport : $smtpport);
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
@@ -323,8 +317,7 @@ if ($action == 'edit')
{
print ' ';
}
- else
- {
+ else {
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin');
print ' ';
@@ -342,8 +335,7 @@ if ($action == 'edit')
{
print ' ';
}
- else
- {
+ else {
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin');
print ' ';
@@ -391,8 +383,7 @@ if ($action == 'edit')
print '';
}
-else
-{
+else {
dol_fiche_head($head, 'common_emailing', '', -1);
print ''.$langs->trans("EMailsDesc")." \n";
@@ -415,8 +406,7 @@ else
{
print ' '.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").' '.$langs->trans("SeeLocalSendMailSetup").' ';
}
- 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 : '').' ';
}
@@ -425,8 +415,7 @@ else
{
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 : '').' ';
}
@@ -507,8 +496,7 @@ else
print ''.$langs->trans("DoTestServerAvailability").' ';
}
}
- else
- {
+ else {
print ''.$langs->trans("DoTestServerAvailability").' ';
}
@@ -539,8 +527,7 @@ else
$result = $mail->check_server_port($server, $port);
if ($result) print ''.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
';
- else
- {
+ else {
$errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port);
if ($mail->error) {
diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php
index 1c50ebf0949..fd5f4e3b1a7 100644
--- a/htdocs/admin/mails_senderprofile_list.php
+++ b/htdocs/admin/mails_senderprofile_list.php
@@ -282,8 +282,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
{
$num = $nbtotalofrecords;
}
-else
-{
+else {
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 37d1f903b4a..1dcc621095c 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -123,8 +123,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES))
$helpsubstitforlines .= $key.' -> '.$val.' ';
}
}
-else
-{
+else {
$tmp = FormMail::getAvailableSubstitKey('formemailwithlines');
$tmp['__(AnyTranslationKey)__'] = 'Translation';
$helpsubstit = $langs->trans("AvailableVariables").': ';
@@ -297,8 +296,7 @@ if (empty($reshook))
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
$_POST = array('id'=>$id); // Clean $_POST array, we keep only id
}
- else
- {
+ else {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
}
@@ -356,8 +354,7 @@ if (empty($reshook))
{
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($db->error(), null, 'errors');
}
}
@@ -377,8 +374,7 @@ if (empty($reshook))
{
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -577,8 +573,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
elseif ($tmpfieldlist == 'joinfiles') {
print ' ';
}
- else
- {
+ else {
if ($context != 'hide') {
// print '';
$okforextended = true;
@@ -587,8 +582,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
$doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
print $doleditor->Create(1);
}
- else
- print ' ';
+ else print ' ';
}
print '';
if ($tmpfieldlist == 'topic') {
@@ -802,8 +796,7 @@ if ($resql)
print "\n";
}
- else
- {
+ else {
$keyforobj = 'type_template';
if (!in_array($obj->$keyforobj, array_keys($elementList)))
{
@@ -989,15 +982,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
print $form->select_dolusers($obj->{$fieldlist[$field]}, 'fk_user', 1, null, 0, '', null, 0, 0, 1, '', 0, '', 'maxwidth200');
}
- else
- {
+ else {
if ($context == 'add') // I am not admin and we show the add form
{
print $user->getNomUrl(1); // Me
$forcedvalue = $user->id;
}
- else
- {
+ else {
if ($obj && !empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0)
{
$fuser = new User($db);
@@ -1005,8 +996,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print $fuser->getNomUrl(1);
$forcedvalue = $fuser->id;
}
- else
- {
+ else {
$forcedvalue = $obj->{$fieldlist[$field]};
}
}
@@ -1024,8 +1014,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]};
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150');
}
- else
- {
+ else {
if (!empty($obj->{$fieldlist[$field]}))
{
print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]});
@@ -1046,8 +1035,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print ' ';
print $obj->{$fieldlist[$field]};
}
- else
- {
+ else {
print $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150 maxwidth100onsmartphone');
}
print '';
@@ -1055,8 +1043,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
elseif ($context == 'edit' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
- else
- {
+ else {
$size = ''; $class = ''; $classtd = '';
if ($fieldlist[$field] == 'code') $class = 'maxwidth100';
if ($fieldlist[$field] == 'label') $class = 'maxwidth100';
@@ -1073,14 +1060,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
print $form->selectyesno($fieldlist[$field], '1', 1);
}
- else
- {
+ else {
//print ' ';
print $form->selectyesno($fieldlist[$field], (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1);
}
}
- else
- {
+ else {
print ' ';
}
print '';
diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php
index 856ad50c28b..b66ab89075f 100644
--- a/htdocs/admin/menus.php
+++ b/htdocs/admin/menus.php
@@ -97,8 +97,7 @@ if ($action == 'update' && !$cancel)
{
$db->commit();
}
- else
- {
+ else {
$error++;
setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors');
$db->rollback();
diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php
index ef58c1042d4..a059a76b40c 100644
--- a/htdocs/admin/menus/edit.php
+++ b/htdocs/admin/menus/edit.php
@@ -103,9 +103,7 @@ if ($action == 'update')
if (is_numeric(GETPOST('menuIdParent', 'alpha')))
{
$menu->fk_menu = GETPOST('menuIdParent', 'alpha');
- }
- else
- {
+ } else {
if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0;
else $menu->fk_menu = -1;
$menu->fk_mainmenu = $mainmenu;
@@ -116,14 +114,10 @@ if ($action == 'update')
if ($result > 0)
{
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
- }
- else
- {
+ } else {
setEventMessages($menu->error, $menu->errors, 'errors');
}
- }
- else
- {
+ } else {
setEventMessages($menu->error, $menu->errors, 'errors');
}
$action = "edit";
@@ -131,8 +125,7 @@ if ($action == 'update')
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
exit;
}
- else
- {
+ else {
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
exit;
}
@@ -222,8 +215,7 @@ if ($action == 'add')
{
$menu->fk_menu = GETPOST('menuId', 'alpha', 3);
}
- else
- {
+ else {
if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu = 0;
else $menu->fk_menu = -1;
$menu->fk_mainmenu = $mainmenu;
@@ -236,8 +228,7 @@ if ($action == 'add')
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09'));
exit;
}
- else
- {
+ else {
$action = 'create';
setEventMessages($menu->error, $menu->errors, 'errors');
}
@@ -261,8 +252,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
llxFooter();
exit;
}
- else
- {
+ else {
$this->db->rollback();
$reload = 0;
@@ -359,8 +349,7 @@ if ($action == 'create')
print $langs->trans('Left');
print ' ';
}
- else
- {
+ else {
print '';
print ' ';
print ''.$langs->trans('Top').' ';
@@ -382,8 +371,7 @@ if ($action == 'create')
{
print ''.$parent_rowid.' ';
}
- else
- {
+ else {
print ' ';
}
print ''.$langs->trans('DetailMenuIdParent');
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index 97f0246ac88..f27968d462d 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -192,8 +192,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler);
exit;
}
- else
- {
+ else {
$db->rollback();
$reload = 0;
@@ -409,8 +408,7 @@ if ($conf->use_javascript_ajax)
print '';
}
-else
-{
+else {
$langs->load("errors");
setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors');
}
diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php
index ed35f48d90e..145ec566057 100644
--- a/htdocs/admin/menus/other.php
+++ b/htdocs/admin/menus/other.php
@@ -95,8 +95,7 @@ if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
{
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
-else
-{
+else {
print ''.img_picto($langs->trans("Enabled"), 'switch_on').' ';
}
print " ";
diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php
index d5bf12f1061..7b64dd08bd0 100644
--- a/htdocs/admin/modulehelp.php
+++ b/htdocs/admin/modulehelp.php
@@ -105,8 +105,7 @@ foreach ($modulesdir as $dir)
continue;
}
- try
- {
+ try {
$res = include_once $dir.$file;
if (class_exists($modName))
{
@@ -141,8 +140,7 @@ foreach ($modulesdir as $dir)
{
$arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher;
}
- else
- {
+ else {
$arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers");
}
}
@@ -188,8 +186,7 @@ foreach ($modulesdir as $dir)
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
}
}
- else
- {
+ else {
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file) ";
}
}
@@ -202,8 +199,7 @@ foreach ($modulesdir as $dir)
}
closedir($handle);
}
- else
- {
+ else {
dol_syslog("htdocs/admin/modulehelp.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
}
}
@@ -332,8 +328,7 @@ if ($mode == 'desc')
$text .= $textexternal;
$text .= ' ';
}
- else
- {
+ else {
$text .= ''.$langs->trans("Origin").': '.$langs->trans("Core").' ';
}
@@ -450,8 +445,7 @@ if ($mode == 'feature')
{
$yesno = 'Yes';
}
- else
- {
+ else {
$yesno = 'No';
}
require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index c0f1991835b..dba149a2bb0 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -126,8 +126,7 @@ if ($action == 'install')
setEventMessages($langs->trans("ErrorModuleFileRequired"), null, 'warnings');
$error++;
}
- else
- {
+ else {
if (!$error && !preg_match('/\.zip$/i', $original_file))
{
$langs->load("errors");
@@ -174,8 +173,7 @@ if ($action == 'install')
setEventMessages($langs->trans($result['error'], $original_file), null, 'errors');
$error++;
}
- else
- {
+ else {
// Now we move the dir of the module
$modulename = preg_replace('/module_/', '', $original_file);
$modulename = preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename);
@@ -231,8 +229,7 @@ if ($action == 'install')
}
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors');
$error++;
}
@@ -248,8 +245,7 @@ if ($action == 'set' && $user->admin)
{
$resarray = activateModule($value);
if (!empty($resarray['errors'])) setEventMessages('', $resarray['errors'], 'errors');
- else
- {
+ else {
//var_dump($resarray);exit;
if ($resarray['nbperms'] > 0)
{
@@ -341,8 +337,7 @@ foreach ($modulesdir as $dir)
continue;
}
- try
- {
+ try {
$res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
if (class_exists($modName))
{
@@ -376,8 +371,7 @@ foreach ($modulesdir as $dir)
{
$arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher;
}
- else
- {
+ else {
$arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers");
}
}
@@ -438,8 +432,7 @@ foreach ($modulesdir as $dir)
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
}
}
- else
- {
+ else {
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file) ";
}
}
@@ -452,8 +445,7 @@ foreach ($modulesdir as $dir)
}
closedir($handle);
}
- else
- {
+ else {
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
}
}
@@ -716,8 +708,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
}
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
}
- else
- {
+ else {
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
$codeenabledisable .= 'numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">';
$codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on');
@@ -752,15 +743,13 @@ if ($mode == 'common' || $mode == 'commonkanban')
$codetoconfig .= ' '.img_picto(ucfirst($page), "setup").' ';
// print ''.ucfirst($page).' ';
}
- else
- {
+ else {
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
{
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
$codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').' ';
}
- else
- {
+ else {
$urltouse = $urlpage;
$codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').' ';
}
@@ -771,17 +760,15 @@ if ($mode == 'common' || $mode == 'commonkanban')
{
$codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').' ';
}
- else
- {
+ else {
$codetoconfig .= ''.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"', false, 0, 0, '', 'fa-15').' ';
}
}
- else
- {
+ else {
$codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15');
}
}
- else // Module not yet activated
+ else // Module not yet activated
{
// Set $codeenabledisable
if (!empty($objMod->always_enabled))
@@ -792,8 +779,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
{
$codeenabledisable .= $langs->trans("Disabled");
}
- else
- {
+ else {
// Module qualified for activation
$warningmessage = '';
if (!empty($arrayofwarnings[$modName]))
@@ -857,8 +843,7 @@ if ($mode == 'common' || $mode == 'commonkanban')
if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"', 1);
else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly"');
}
- else
- {
+ else {
print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly"');
}
print ' '.$objMod->getName().' ';
@@ -1028,8 +1013,7 @@ if ($mode == 'deploy')
$message = info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
$allowfromweb = -1;
}
- else
- {
+ else {
if ($dirins_ok)
{
if (!is_writable(dol_osencode($dirins)))
@@ -1039,15 +1023,13 @@ if ($mode == 'deploy')
$allowfromweb = 0;
}
}
- else
- {
+ else {
$message = info_admin($langs->trans("NotExistsDirect", $dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
$allowfromweb = 0;
}
}
}
- else
- {
+ else {
$message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.'/installmodules.lock'));
$allowfromweb = 0;
}
@@ -1068,8 +1050,7 @@ if ($mode == 'deploy')
{
//print $langs->trans("ThisIsProcessToFollow").' ';
}
- else
- {
+ else {
print $langs->trans("ThisIsAlternativeProcessToFollow").' ';
print ''.$langs->trans("StepNb", 1).' : ';
print $langs->trans("FindPackageFromWebSite", $fullurl).' ';
@@ -1150,8 +1131,7 @@ if ($mode == 'deploy')
print info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow, $maxphptoshowparam), 1);
}
}
- else
- {
+ else {
print ' ('.$langs->trans("UploadDisabled").')';
}
@@ -1162,8 +1142,7 @@ if ($mode == 'deploy')
print '';
}
- else
- {
+ else {
print $langs->trans("UnpackPackageInModulesRoot", $dirins).' ';
print ''.$langs->trans("StepNb", 4).' : ';
print $langs->trans("SetupIsReadyForUse").' ';
diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php
index 9c59b5cf6da..ddf55993fd7 100644
--- a/htdocs/admin/mrp.php
+++ b/htdocs/admin/mrp.php
@@ -59,8 +59,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -97,14 +96,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mrp&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -162,8 +159,7 @@ elseif ($action == 'set_MRP_MO_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -180,8 +176,7 @@ elseif ($action == 'set_MRP_MO_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -263,8 +258,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -329,8 +323,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -400,8 +393,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -413,8 +405,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -443,8 +434,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'bill').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -490,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php
index 4ba581398ee..1b912b27b5e 100644
--- a/htdocs/admin/multicurrency.php
+++ b/htdocs/admin/multicurrency.php
@@ -54,8 +54,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -67,8 +66,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -146,8 +144,7 @@ elseif ($action == 'setapilayer')
dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha'));
//dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha'));
}
- else
- {
+ else {
$result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
if ($result > 0) {
setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs");
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index ba92aa1ec21..859d36b7c36 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -85,8 +85,7 @@ if ($action == 'settemplates')
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
@@ -107,8 +106,7 @@ if ($action == 'setvalue' && $user->admin)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
@@ -161,8 +159,7 @@ if ($action == 'setfixednotif' && $user->admin)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php
index 785a77ac043..85f9ebf0409 100644
--- a/htdocs/admin/oauth.php
+++ b/htdocs/admin/oauth.php
@@ -120,8 +120,7 @@ foreach ($list as $key)
print ' ';
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 d8c65f9a2c5..f0d3c530b71 100644
--- a/htdocs/admin/oauthlogintokens.php
+++ b/htdocs/admin/oauthlogintokens.php
@@ -79,8 +79,7 @@ if ($action == 'setconst' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null);
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -99,8 +98,7 @@ if ($action == 'setvalue' && $user->admin)
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null);
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -179,8 +177,7 @@ if ($mode == 'setup' && $user->admin)
$urltodelete = '';
$urltocheckperms = '';
}
- else
- {
+ else {
$urltorenew = '';
$urltodelete = '';
$urltocheckperms = '';
@@ -194,8 +191,7 @@ if ($mode == 'setup' && $user->admin)
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
// Dolibarr storage
$storage = new DoliStorage($db, $conf);
- try
- {
+ try {
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
}
catch (Exception $e)
@@ -226,8 +222,7 @@ if ($mode == 'setup' && $user->admin)
{
$expiredat = $langs->trans("Unknown");
}
- else
- {
+ else {
$expiredat = dol_print_date($endoflife, "dayhour");
}
}
diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php
index a5b494b62e2..2873cf5d15f 100644
--- a/htdocs/admin/payment.php
+++ b/htdocs/admin/payment.php
@@ -57,8 +57,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -184,8 +183,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 496a32923f7..ec4015f6e98 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -190,8 +190,7 @@ for ($i = 1; $i <= 6; $i++)
$pid = $langs->transcountry("ProfId".$i, $mysoc->country_code);
if ($pid == '-') $pid = false;
}
- else
- {
+ else {
$pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).' ';
}
if ($pid)
diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php
index 0486edebeec..7dcaf0fba47 100644
--- a/htdocs/admin/perms.php
+++ b/htdocs/admin/perms.php
@@ -230,8 +230,7 @@ if ($result)
print img_picto($langs->trans("Active"), 'tick');
print '';
}
- else
- {
+ else {
print '';
print ''.img_edit_add().' ';
print ' ';
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index e9795304ad3..b33b2396aa2 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -101,8 +101,7 @@ if ($action == "set")
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index 73703829b8c..f2c748b4ce2 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -64,8 +64,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -101,14 +100,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -127,8 +124,7 @@ elseif ($action == 'setribchq')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -143,8 +139,7 @@ elseif ($action == 'set_PROPALE_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -160,8 +155,7 @@ elseif ($action == 'set_PROPOSAL_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -175,8 +169,7 @@ elseif ($action == 'setdefaultduration')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -191,8 +184,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -311,8 +303,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -377,8 +368,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -449,8 +439,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print "\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -462,8 +451,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -497,8 +485,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'bill').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -572,14 +559,12 @@ if (empty($conf->facture->enabled))
}
print "";
}
- else
- {
+ else {
print "".$langs->trans("NoActiveBankAccountDefined")." ";
}
}
}
- else
- {
+ else {
print ''.$langs->trans("BankModuleNotActive").' ';
}
}
@@ -686,8 +671,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index 8730f148c07..dc6aa5da33b 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -90,8 +90,7 @@ if ($action == 'addprinter' && $user->admin) {
$db->commit();
setEventMessages($langs->trans("PrinterAdded", $printername), null);
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
@@ -116,8 +115,7 @@ if ($action == 'deleteprinter' && $user->admin) {
$db->commit();
setEventMessages($langs->trans("PrinterDeleted", $printername), null);
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db);
}
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index 312038d3fcc..68f8f0e62ee 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -72,8 +72,7 @@ if ($action == 'updateMask')
{
if ($res > 0)
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- else
- setEventMessages($langs->trans("Error"), null, 'errors');
+ else setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -133,14 +132,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=reception&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -264,8 +261,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -332,8 +328,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -402,8 +397,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -415,8 +409,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -447,8 +440,7 @@ foreach ($dirmodels as $reldir)
{
print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php
index 3efdd05bdc7..04ff3861c7f 100644
--- a/htdocs/admin/resource.php
+++ b/htdocs/admin/resource.php
@@ -92,8 +92,7 @@ if (empty($conf->use_javascript_ajax))
print $langs->trans("NotAvailableWhenAjaxDisabled");
print '';
}
-else
-{
+else {
print '';
$arrval = array(
'0'=>$langs->trans("No"),
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index d9d61673c5e..161b521337b 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -46,8 +46,7 @@ if ($action == 'setgeneraterule')
{
dol_print_error($db);
}
- else
- {
+ else {
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
@@ -102,8 +101,7 @@ if ($action == 'activate_encrypt')
header("Location: security.php");
exit;
}
- else
- {
+ else {
$db->rollback();
dol_print_error($db, '');
}
@@ -132,8 +130,7 @@ if ($action == 'activate_encryptdbpassconf')
header("Location: security.php");
exit;
}
- else
- {
+ else {
setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings');
}
}
@@ -149,8 +146,7 @@ elseif ($action == 'disable_encryptdbpassconf')
header("Location: security.php");
exit;
}
- else
- {
+ else {
setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
}
}
@@ -278,8 +274,7 @@ foreach ($arrayhandler as $key => $module)
{
print img_picto('', 'tick');
}
- else
- {
+ else {
print ''.$langs->trans("Activate").' ';
}
print " \n";
@@ -436,8 +431,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED))
//Do not allow "disable encryption" as passwords cannot be decrypted
print ''.$langs->trans("Disable").' ';
}
- else
- {
+ else {
print '-';
}
print "";
@@ -463,8 +457,7 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass))
$langs->load("errors");
print img_warning($langs->trans("WarningPassIsEmpty"));
}
-else
-{
+else {
if (empty($dolibarr_main_db_encrypted_pass))
{
print ''.$langs->trans("Activate").' ';
@@ -516,8 +509,7 @@ if (GETPOST('info', 'int') > 0)
{
print $langs->trans("Note: The function password_hash exists on your PHP")." \n";
}
- else
- {
+ else {
print $langs->trans("Note: The function password_hash does not exists on your PHP")." \n";
}
print 'MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO." \n";
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index f642cd64182..b6674f00c5c 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -51,8 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
} elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
@@ -62,8 +61,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -119,20 +117,17 @@ if (function_exists("imagecreatefrompng"))
{
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA');
}
- else
- {
+ else {
if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
{
print ''.img_picto($langs->trans("Disabled"), 'off').' ';
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
}
-else
-{
+else {
$desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
print $desc;
}
@@ -146,14 +141,12 @@ if (!empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS');
}
-else
-{
+else {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
{
print ''.img_picto($langs->trans("Disabled"), 'off').' ';
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index 09cc0debfd5..0745203f365 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -123,8 +123,7 @@ if ($action == 'send' && !$_POST['cancel'])
setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs');
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("ResultKo"), null, 'errors');
setEventMessages($smsfile->error, $smsfile->errors, 'errors');
}
@@ -206,8 +205,7 @@ if ($action == 'edit')
print '';
print ' ';
}
-else
-{
+else {
if (!count($listofmethods)) print ''.$langs->trans("NoSmsEngine", '
DoliStore ').'
';
print '';
@@ -265,8 +263,7 @@ else
{
print ''.$langs->trans("DoTestSend").' ';
}
- else
- {
+ else {
print ''.$langs->trans("DoTestSend").' ';
}
print '';
diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php
index d2a92aed9e8..fd4329b7023 100644
--- a/htdocs/admin/socialnetworks.php
+++ b/htdocs/admin/socialnetworks.php
@@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php
index 2ed43e97efd..6c1d1837ea8 100644
--- a/htdocs/admin/spip.php
+++ b/htdocs/admin/spip.php
@@ -74,8 +74,7 @@ if ($action == 'update' || $action == 'add')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -154,8 +153,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP))
print '';
}
-else
-{
+else {
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
$link = '';
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index 43e610c3052..d3b9061eecc 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -49,8 +49,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -63,8 +62,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -120,8 +118,7 @@ if (!empty($conf->facture->enabled))
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
}
}
-else
-{
+else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name"));
}
print "\n\n";
@@ -140,8 +137,7 @@ if (!empty($conf->commande->enabled))
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
}
}
-else
-{
+else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name"));
}
print "\n\n";
@@ -162,8 +158,7 @@ if (!empty($conf->expedition->enabled))
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
}
}
-else
-{
+else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
}
print "\n\n";
@@ -182,8 +177,7 @@ if (!empty($conf->expedition->enabled))
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
}
}
-else
-{
+else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
}
print "\n\n";
@@ -222,8 +216,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
}
}
-else
-{
+else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
}
print "\n\n";
@@ -243,8 +236,7 @@ if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUP
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
}
}
-else
-{
+else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
}
print "\n\n";
@@ -280,8 +272,7 @@ if (!empty($conf->reception->enabled))
print "\n\n";
$found++;
}
-else
-{
+else {
print '';
print ''.$langs->trans("ReStockOnDispatchOrder").' ';
print '';
@@ -294,8 +285,7 @@ else
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
}
}
- else
- {
+ else {
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
}
print " \n \n";
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 977b99d0c99..c52f4296429 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -71,8 +71,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -110,14 +109,12 @@ if ($action == 'specimen') // For invoices
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -186,8 +183,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -273,8 +269,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print ' '.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -341,8 +336,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -410,8 +404,7 @@ foreach ($dirmodels as $reldir)
}*/
print "";
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -425,8 +418,7 @@ foreach ($dirmodels as $reldir)
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -488,8 +480,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index db9b3e257f6..f282ee8d7ca 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -69,8 +69,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -108,14 +107,12 @@ elseif ($action == 'specimen') // For orders
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -197,8 +194,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
// Insert
$newmodule->insert_permissions(1);
}
- else
- {
+ else {
// Remove all rights with Permission1190
$newmodule->delete_permissions();
@@ -218,8 +214,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -305,8 +300,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -371,8 +365,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -430,14 +423,12 @@ foreach ($dirmodels as $reldir)
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
}
- else
- {
+ else {
print img_picto($langs->trans("Enabled"), 'switch_on');
}
print "";
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -449,8 +440,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -554,8 +544,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
@@ -573,8 +562,7 @@ if ($conf->reception->enabled)
{
print ''.$langs->trans("FeatureNotAvailableWithReceptionModule").' ';
}
-else
-{
+else {
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
} else {
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index 5d7a0d0b8d5..1c4cfd5905e 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -58,8 +58,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}elseif ($action == 'setmod')
@@ -132,14 +131,12 @@ elseif ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_payment&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -207,8 +204,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -283,8 +279,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -399,8 +394,7 @@ foreach ($dirmodels as $reldir)
}*/
print "";
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -414,8 +408,7 @@ foreach ($dirmodels as $reldir)
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index c1007623a54..bb3454de4f7 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -61,8 +61,7 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -99,14 +98,12 @@ if ($action == 'specimen')
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
return;
}
- else
- {
+ else {
setEventMessages($module->error, null, 'errors');
dol_syslog($module->error, LOG_ERR);
}
}
- else
- {
+ else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -123,8 +120,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -141,8 +137,7 @@ if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -157,8 +152,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -279,8 +273,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Activated"), 'switch_on');
}
- else
- {
+ else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -344,8 +337,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -415,8 +407,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print "\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -428,8 +419,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -463,8 +453,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'bill').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -512,8 +501,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '';
}
-else
-{
+else {
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
print $doleditor->Create();
@@ -544,21 +532,18 @@ if ($conf->banque->enabled)
{
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
}
- else
- {
+ else {
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL))
{
print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Enabled"), 'switch_on').' ';
}
}
print '';
}
-else
-{
+else {
print '';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').' ';
}
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index 16b273cd6db..44143afb270 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -127,8 +127,7 @@ if ($action == 'set')
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($error, $errors, 'errors');
}
@@ -156,8 +155,7 @@ if ($action == 'setlevel')
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php
index 3d0dddd6d10..db7559de17a 100644
--- a/htdocs/admin/system/about.php
+++ b/htdocs/admin/system/about.php
@@ -201,8 +201,7 @@ if ($showpromotemessage)
print $langs->trans("ExampleOfNewsMessageForMajorRelease", DOL_VERSION, DOL_VERSION);
print '';
}
- else
- {
+ else {
print $langs->trans("TitleExampleForMaintenanceRelease").': ';
print '
';
@@ -326,8 +321,7 @@ if (!$error && $xml)
$out .= ' '."\n";
$out .= "\n";
}
- else
- {
+ else {
$out .= ''.$langs->trans("None").' ';
}
$out .= '
';
@@ -381,8 +375,7 @@ if (!$error && $xml)
$out .= ' '."\n";
$out .= "\n";
}
- else
- {
+ else {
$out .= ''.$langs->trans("None").' ';
}
$out .= '
';
@@ -394,13 +387,11 @@ if (!$error && $xml)
{
setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings');
}
}
- else
- {
+ else {
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
$error++;
}
@@ -434,15 +425,13 @@ if (!$error && $xml)
$resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
$outcurrentchecksum = $checksumget.' - '.$langs->trans("FileIntegrityIsOkButFilesWereAdded").' ';
}
- else
- {
+ else {
$resultcode = 'ok';
$resultcomment = 'Success';
$outcurrentchecksum = ''.$checksumget.' ';
}
}
- else
- {
+ else {
$resultcode = 'error';
$resultcomment = 'Error';
$outcurrentchecksum = ''.$checksumget.' ';
diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php
index 61de00287e9..786b8b7306c 100644
--- a/htdocs/admin/system/modules.php
+++ b/htdocs/admin/system/modules.php
@@ -70,8 +70,7 @@ foreach ($modulesdir as $dir)
// File duplicate
print "Warning duplicate file found : ".$file." (Found ".$dir.$file.", already found ".$modules_fullpath[$file].") ";
}
- else
- {
+ else {
// File to load
$res = include_once $dir.$file;
if (class_exists($modName))
@@ -90,8 +89,7 @@ foreach ($modulesdir as $dir)
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
}
}
- else
- {
+ else {
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file) ";
}
}
@@ -125,8 +123,7 @@ foreach ($sortorder as $numero=>$name)
if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1);
else print img_object($alt, $picto[$numero], 'width="14px"');
}
- else
- {
+ else {
print img_object($alt, $picto[$numero], 'width="14px"');
}
print ' '.$modules[$numero]->getName();
diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php
index dd77c41a673..2c6e20f0d22 100644
--- a/htdocs/admin/system/perf.php
+++ b/htdocs/admin/system/perf.php
@@ -63,8 +63,7 @@ print ' ';
print ''.$langs->trans("XDebug").' : ';
$test = !function_exists('xdebug_is_enabled');
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
-else
-{
+else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
print ' - '.$langs->trans("MoreInformation").' XDebug admin page ';
}
@@ -75,8 +74,7 @@ print ' ';
print ''.$langs->trans("Syslog").' : ';
$test = empty($conf->syslog->enabled);
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
-else
-{
+else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog"));
//print ' '.$langs->trans("MoreInformation").' XDebug admin page ';
}
@@ -87,8 +85,7 @@ print ' ';
print ''.$langs->trans("DebugBar").' : ';
$test = empty($conf->debugbar->enabled);
if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
-else
-{
+else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
//print ' '.$langs->trans("MoreInformation").' XDebug admin page ';
}
@@ -105,8 +102,7 @@ if ($test)
print img_picto('', 'tick.png').' '.$langs->trans("MemcachedAvailableAndSetup");
print ' '.$langs->trans("MoreInformation").' Memcached module admin page ';
}
- else
- {
+ else {
print img_picto('', 'warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup");
print ' Memcached module admin page ';
}
@@ -148,8 +144,7 @@ if (!$foundcache && $test)
$foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("APCInstalled");
}
- else
- {
+ else {
print img_picto('', 'warning').' '.$langs->trans("APCCacheInstalledButDisabled");
}
}
@@ -163,8 +158,7 @@ if (ini_get('opcache.preload'))
print ''.$langs->trans("PreloadOPCode").' : ';
print ini_get('opcache.preload');
}
-else
-{
+else {
print ' ';
print ''.$langs->trans("PreloadOPCode").' : ';
print $langs->trans("No");
@@ -469,8 +463,7 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{
print img_picto('', 'tick.png').' '.$langs->trans("YouUseBestDriver", $conf->db->type);
}
- else
- {
+ else {
print img_picto('', 'warning.png').' '.$langs->trans("YouDoNotUseBestDriver", $conf->db->type, 'mysqli');
}
print ' ';
@@ -496,13 +489,11 @@ if ($resql)
{
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
}
- else
- {
+ else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
}
}
- else
- {
+ else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
}
print ' ';
@@ -526,13 +517,11 @@ if ($resql)
{
print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
}
- else
- {
+ else {
print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
}
}
- else
- {
+ else {
print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
}
print ' ';
@@ -546,8 +535,7 @@ if (!in_array($conf->browser->name, array('chrome', 'opera', 'safari', 'firefox'
{
print img_picto('', 'warning.png').' '.$langs->trans("BrowserIsKO", $conf->browser->name);
}
-else
-{
+else {
print img_picto('', 'tick.png').' '.$langs->trans("BrowserIsOK", $conf->browser->name);
}
print ' ';
diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php
index 04439d11710..8015f16a572 100644
--- a/htdocs/admin/system/phpinfo.php
+++ b/htdocs/admin/system/phpinfo.php
@@ -90,8 +90,7 @@ elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0)
{
print ' '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning));
}
-else
-{
+else {
print ' '.versiontostring(versionphparray());
}
@@ -103,8 +102,7 @@ if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["main
print ' '.$langs->trans("PHPSupportPOSTGETKo");
print ' ('.$langs->trans("Recheck").' )';
}
-else
-{
+else {
print ' '.$langs->trans("PHPSupportPOSTGETOk");
}
@@ -115,8 +113,7 @@ if (!function_exists("session_id"))
{
print ' '.$langs->trans("ErrorPHPDoesNotSupportSessions");
}
-else
-{
+else {
print ' '.$langs->trans("PHPSupportSessions");
}
@@ -127,8 +124,7 @@ if (!function_exists("utf8_encode"))
{
print ' '.$langs->trans("ErrorPHPDoesNotSupportUTF8");
}
-else
-{
+else {
print ' '.$langs->trans("PHPSupportUTF8");
}
@@ -229,8 +225,7 @@ foreach ($phparray as $key => $value)
print '';
print '';
}
- else
- {
+ else {
print '';
print ''.$keyparam.' ';
$i = 0;
@@ -346,8 +341,7 @@ function getTableColumn($name, array $list)
{
$html .= ' ';
}
- else
- {
+ else {
$html .= ' ';
}
@@ -382,8 +376,7 @@ function getTableColumnFunction(array $functions)
{
$html .= ' ';
}
- else
- {
+ else {
$html .= ' ';
}
diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php
index 5e4e9eff82f..3358fb980fe 100644
--- a/htdocs/admin/system/xdebug.php
+++ b/htdocs/admin/system/xdebug.php
@@ -109,16 +109,14 @@ xdebug.auto_trace=0
Allow Remote debug=yes or prompt '."\n";
print " \n";
}
- else
- {
+ else {
print socket_strerror(socket_last_error());
echo "Failed to connect to address=".$address." port=".$port." \n";
echo "There is no Remote debug server at this address.\n";
}
socket_close($socket);
}
-else
-{
+else {
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
}
diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php
index f9bb8f39641..1999fbab8f0 100644
--- a/htdocs/admin/taxes.php
+++ b/htdocs/admin/taxes.php
@@ -131,8 +131,7 @@ if (empty($mysoc->tva_assuj))
{
print $langs->trans("YourCompanyDoesNotUseVAT").' ';
}
-else
-{
+else {
print '
";
}
-else
-{
+else {
print $langs->trans("NoSessionListWithThisHandler");
}
@@ -188,8 +187,7 @@ if (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
{
print ''.$langs->trans("LockNewSessions").' ';
}
-else
-{
+else {
print ''.$langs->trans("UnlockNewSessions").' ';
}
diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php
index 260b4afe2d0..f06e67aa676 100644
--- a/htdocs/admin/tools/update.php
+++ b/htdocs/admin/tools/update.php
@@ -99,13 +99,11 @@ if (function_exists('curl_init'))
// Show version
print $langs->trans("LastStableVersion").' : '.(($version != '0.0') ? $version : $langs->trans("Unknown")).' ';
}
- else
- {
+ else {
print $langs->trans("LastStableVersion").' : '.$langs->trans("UpdateServerOffline").' ';
}
}
- else
- {
+ else {
print $langs->trans("LastStableVersion").' : '.$langs->trans("Check").' ';
}
}
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index c17c2bdcee6..2f89e3cd300 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -106,15 +106,13 @@ if ($action == 'update')
$transkey = "";
$transvalue = "";
}
- else
- {
+ else {
$db->rollback();
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
setEventMessages($langs->trans("WarningAnEntryAlreadyExistForTransKey"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($db->lasterror(), null, 'errors');
}
$action = '';
@@ -155,15 +153,13 @@ if ($action == 'add')
$transkey = "";
$transvalue = "";
}
- else
- {
+ else {
$db->rollback();
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
setEventMessages($langs->trans("WarningAnEntryAlreadyExistForTransKey"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($db->lasterror(), null, 'errors');
}
$action = '';
@@ -180,8 +176,7 @@ if ($action == 'delete')
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -211,8 +206,7 @@ if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
$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');
@@ -349,8 +343,7 @@ if ($mode == 'overwrite')
{
print ' ';
}
- else
- {
+ else {
print dol_escape_htmltag($obj->transvalue);
}
print '';
@@ -363,8 +356,7 @@ if ($mode == 'overwrite')
print ' ';
print ' ';
}
- else
- {
+ else {
print ' '.img_edit().' ';
print ' ';
print ''.img_delete().' ';
@@ -408,8 +400,7 @@ if ($mode == 'searchkey')
{
setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings');
}
- else
- {
+ else {
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
$i = 0;
foreach ($modulesdir as $keydir => $tmpsearchdir)
@@ -553,8 +544,7 @@ if ($mode == 'searchkey')
print ' '.img_picto('FixOnTransifex', 'globe').' ';
}
}
- else
- {
+ else {
$htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key);
print $form->textwithpicto('', $htmltext, 1, 'warning');
}
diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php
index 60cbadcdd3a..ad8e5f6876d 100644
--- a/htdocs/admin/user.php
+++ b/htdocs/admin/user.php
@@ -93,8 +93,7 @@ elseif (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -107,8 +106,7 @@ elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -122,8 +120,7 @@ elseif ($action == 'sethideinactiveuser')
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -164,14 +161,12 @@ if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('USER_MAIL_REQUIRED');
}
-else
-{
+else {
if (empty($conf->global->USER_MAIL_REQUIRED))
{
print ''.img_picto($langs->trans("Disabled"), 'off').' ';
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
@@ -188,14 +183,12 @@ if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX');
}
-else
-{
+else {
if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX))
{
print ''.img_picto($langs->trans("Disabled"), 'off').' ';
}
- else
- {
+ else {
print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
@@ -225,8 +218,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -295,8 +287,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -308,8 +299,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -336,8 +326,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'contract').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php
index 4f556ff19b3..2b3d9e680ba 100644
--- a/htdocs/admin/usergroup.php
+++ b/htdocs/admin/usergroup.php
@@ -90,8 +90,7 @@ elseif (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -104,8 +103,7 @@ elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -147,8 +145,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -217,8 +214,7 @@ foreach ($dirmodels as $reldir)
print '';
print '';
}
- else
- {
+ else {
print ''."\n";
print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
@@ -230,8 +226,7 @@ foreach ($dirmodels as $reldir)
{
print img_picto($langs->trans("Default"), 'on');
}
- else
- {
+ else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -258,8 +253,7 @@ foreach ($dirmodels as $reldir)
{
print ''.img_object($langs->trans("Preview"), 'contract').' ';
}
- else
- {
+ else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php
index dd7fd353ea2..c2ee5e2677c 100644
--- a/htdocs/admin/website.php
+++ b/htdocs/admin/website.php
@@ -213,8 +213,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
unset($_POST); // Clean $_POST array, we keep only
}
- else
- {
+ else {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
}
@@ -274,8 +273,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
$error++;
setEventMessages($langs->trans('ErrorDirAlreadyExists', $destfile), null, 'errors');
}
- else
- {
+ else {
@rename($srcfile, $destfile);
// We must now rename $website->ref into $newname inside files
@@ -288,8 +286,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
}
}
}
- else
- {
+ else {
$error++;
setEventMessages($db->lasterror(), null, 'errors');
}
@@ -298,8 +295,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
{
$db->commit();
}
- else
- {
+ else {
$db->rollback();
}
}
@@ -338,8 +334,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -349,8 +344,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
dol_delete_dir_recursive($conf->website->dir_output.'/'.$website->ref);
}
}
- else
- {
+ else {
dol_print_error($db, 'Failed to load website with id '.$rowid);
}
}
@@ -587,8 +581,7 @@ if ($id)
print ' ';
print ' ';
}
- else
- {
+ else {
$tmpaction = 'view';
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewWebsiteFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
@@ -680,8 +673,7 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldname)) {
print ' ';
}
- else
- {
+ else {
print '';
$size = '';
if ($fieldlist[$field] == 'code') $size = 'size="8" ';
diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php
index 7d16aa3963b..828ebf6dca9 100644
--- a/htdocs/admin/website_options.php
+++ b/htdocs/admin/website_options.php
@@ -122,8 +122,7 @@ if ($action == 'edit')
print '';
print ' ';
}
-else
-{
+else {
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php
index 99185cce733..96413b21c19 100644
--- a/htdocs/admin/workflow.php
+++ b/htdocs/admin/workflow.php
@@ -144,8 +144,7 @@ foreach ($workflowcodes as $key => $params)
if ($reg[1] == 'supplier_order') print ' - '.$langs->trans('SupplierOrder');
if ($reg[1] == 'reception') print ' - '.$langs->trans('Reception');
}
- else
- {
+ else {
print $langs->trans("Description");
}
print '';
@@ -167,16 +166,14 @@ foreach ($workflowcodes as $key => $params)
{
print ajax_constantonoff($key);
}
- else
- {
+ else {
if (!empty($conf->global->$key))
{
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/api/admin/index.php b/htdocs/api/admin/index.php
index d0a0e79c855..25481ccb39d 100644
--- a/htdocs/api/admin/index.php
+++ b/htdocs/api/admin/index.php
@@ -55,8 +55,7 @@ if ($action == 'setproductionmode')
$error++;
}
}
- else
- {
+ else {
// Delete the cache file otherwise it does not update
$result = dol_delete_file($conf->api->dir_temp.'/routes.php');
if ($result < 0)
@@ -72,8 +71,7 @@ if ($action == 'setproductionmode')
exit;
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -120,8 +118,7 @@ if ($production_mode)
print img_picto($langs->trans("Activated"), 'switch_on');
print '';
}
-else
-{
+else {
print '';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
@@ -166,8 +163,7 @@ if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/e
$url = DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
print img_picto('', 'globe').' '.$url." \n";
}
-else
-{
+else {
print $langs->trans("NotAvailableWithThisDistribution");
}
diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php
index 5e051420748..fa96788f585 100644
--- a/htdocs/api/class/api.class.php
+++ b/htdocs/api/class/api.class.php
@@ -318,8 +318,7 @@ class DolibarrApi
{
$tmpescaped = "'".$db->escape($regbis[1])."'";
}
- else
- {
+ else {
$tmpescaped = $db->escape($tmpescaped);
}
return $db->escape($tmp[0]).' '.strtoupper($db->escape($tmp[1]))." ".$tmpescaped;
diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php
index 339ddfd2ad6..e0551cf07d9 100644
--- a/htdocs/api/class/api_access.class.php
+++ b/htdocs/api/class/api_access.class.php
@@ -158,8 +158,7 @@ class DolibarrApiAccess implements iAuthenticate
static::$role = 'admin';
}
}
- else
- {
+ else {
throw new RestException(401, "Failed to login to API. No parameter 'HTTP_DOLAPIKEY' on HTTP header (and no parameter DOLAPIKEY in URL).");
}
diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php
index 74aeec42dc1..0a9b8b63e7b 100644
--- a/htdocs/api/class/api_login.class.php
+++ b/htdocs/api/class/api_login.class.php
@@ -123,8 +123,7 @@ class Login
throw new RestException(500, 'Error when updating api_key for user :'.$this->db->lasterror());
}
}
- else
- {
+ else {
$token = $tmpuser->api_key;
}
diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php
index fd6432b553f..e5bf7a00eea 100644
--- a/htdocs/api/class/api_setup.class.php
+++ b/htdocs/api/class/api_setup.class.php
@@ -879,8 +879,7 @@ class Setup extends DolibarrApi
}
}
}
- else
- {
+ else {
throw new RestException(503, 'Error when retrieving list of extra fields : '.$this->db->lasterror());
}
@@ -1485,13 +1484,11 @@ class Setup extends DolibarrApi
{
$xml = simplexml_load_file($xmlfile);
}
- else
- {
+ else {
throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile);
}
}
- else
- {
+ else {
$xmlarray = getURLContent($xmlremote);
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
@@ -1501,8 +1498,7 @@ class Setup extends DolibarrApi
//print "xmlfilestart".$xmlfile."endxmlfile";
$xml = simplexml_load_string($xmlfile);
}
- else
- {
+ else {
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
throw new RestException(500, $errormsg);
}
@@ -1610,8 +1606,7 @@ class Setup extends DolibarrApi
$out .= "\n";
}
}
- else
- {
+ else {
$out .= ''.$langs->trans("None").' ';
}
$out .= '
';
@@ -1660,8 +1655,7 @@ class Setup extends DolibarrApi
$out .= ' '."\n";
$out .= "\n";
}
- else
- {
+ else {
$out .= ''.$langs->trans("None").' ';
}
$out .= '';
@@ -1710,8 +1704,7 @@ class Setup extends DolibarrApi
$out .= ' '."\n";
$out .= "\n";
}
- else
- {
+ else {
$out .= ''.$langs->trans("None").' ';
}
$out .= '';
@@ -1723,13 +1716,11 @@ class Setup extends DolibarrApi
{
//setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
}
- else
- {
+ else {
//setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings');
}
}
- else
- {
+ else {
throw new RestException(500, 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile);
}
@@ -1752,16 +1743,14 @@ class Setup extends DolibarrApi
//$outcurrentchecksum = $checksumget.' - '.$langs->trans("FileIntegrityIsOkButFilesWereAdded").' ';
$outcurrentchecksum = $checksumget;
}
- else
- {
+ else {
$resultcode = 'ok';
$resultcomment = 'Success';
//$outcurrentchecksum = ''.$checksumget.' ';
$outcurrentchecksum = $checksumget;
}
}
- else
- {
+ else {
$resultcode = 'error';
$resultcomment = 'Error';
//$outcurrentchecksum = ''.$checksumget.' ';
diff --git a/htdocs/api/index.php b/htdocs/api/index.php
index c5edbc74d66..fca0e027081 100644
--- a/htdocs/api/index.php
+++ b/htdocs/api/index.php
@@ -208,8 +208,7 @@ if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $
//dol_syslog("Found API by index.php: classname=".$classname." for module ".$dir." into ".$dir_part.$file_searched);
$listofapis[strtolower($classname)] = $classname;
}
- else
- {
+ else {
dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING);
}
}
diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php
index 752d569c7d1..12f5fb1fbc7 100644
--- a/htdocs/asset/admin/setup.php
+++ b/htdocs/asset/admin/setup.php
@@ -88,8 +88,7 @@ if ($action == 'edit')
print '';
print ' ';
}
-else
-{
+else {
print '';
print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php
index 110d662c9e8..fc42f0b00d6 100644
--- a/htdocs/asset/card.php
+++ b/htdocs/asset/card.php
@@ -315,8 +315,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print 'id.'&action=edit">'.$langs->trans("Modify").' '."\n";
}
- else
- {
+ else {
print ''.$langs->trans('Modify').' '."\n";
}
@@ -324,8 +323,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print 'id.'&action=delete">'.$langs->trans('Delete').' '."\n";
}
- else
- {
+ else {
print ''.$langs->trans('Delete').' '."\n";
}
}
diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php
index 7c9d91d79e7..1570fe438ad 100644
--- a/htdocs/asset/class/asset.class.php
+++ b/htdocs/asset/class/asset.class.php
@@ -470,8 +470,7 @@ class Asset extends CommonObject
$this->db->free($result);
}
- else
- {
+ else {
dol_print_error($this->db);
}
}
diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php
index bfb0c7d073a..2e275ae1e65 100644
--- a/htdocs/asset/class/asset_type.class.php
+++ b/htdocs/asset/class/asset_type.class.php
@@ -155,15 +155,13 @@ class AssetType extends CommonObject
$this->db->commit();
return $this->id;
}
- else
- {
+ else {
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
@@ -224,15 +222,13 @@ class AssetType extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -$error;
}
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
@@ -264,8 +260,7 @@ class AssetType extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -304,8 +299,7 @@ class AssetType extends CommonObject
return 1;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -345,8 +339,7 @@ class AssetType extends CommonObject
}
}
}
- else
- {
+ else {
print $this->db->error();
}
return $assettypes;
@@ -401,8 +394,7 @@ class AssetType extends CommonObject
return $ret;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php
index 4724173cd19..9b5294605ba 100644
--- a/htdocs/asset/document.php
+++ b/htdocs/asset/document.php
@@ -145,8 +145,7 @@ if ($object->id)
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
}
-else
-{
+else {
accessforbidden('', 0, 1);
}
diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php
index 39fd0e0761d..da2a4d80b27 100644
--- a/htdocs/asset/list.php
+++ b/htdocs/asset/list.php
@@ -254,8 +254,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
{
$num = $nbtotalofrecords;
}
-else
-{
+else {
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php
index 8df5ffe8c40..f9931a927b4 100644
--- a/htdocs/asset/type.php
+++ b/htdocs/asset/type.php
@@ -129,14 +129,12 @@ if ($action == 'add' && $user->rights->asset->write)
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create';
}
}
- else
- {
+ else {
$action = 'create';
}
}
@@ -163,8 +161,7 @@ if ($action == 'update' && $user->rights->asset->write)
{
setEventMessages($langs->trans("AssetsTypeModified"), null, 'mesgs');
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -183,8 +180,7 @@ if ($action == 'confirm_delete' && $user->rights->asset->write)
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
setEventMessages($langs->trans("AssetsTypeCanNotBeDeleted"), null, 'errors');
$action = '';
}
@@ -308,8 +304,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
if ($user->rights->asset->write)
print 'rowid.'">'.img_edit().' ';
- else
- print ' ';
+ else print ' ';
print "";
$i++;
}
@@ -318,8 +313,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print '';
}
- else
- {
+ else {
dol_print_error($db);
}
}
diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php
index fd27abb6ceb..29cd34db6a8 100644
--- a/htdocs/asterisk/cidlookup.php
+++ b/htdocs/asterisk/cidlookup.php
@@ -68,8 +68,7 @@ if ($resql)
}
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db, 'Error');
$found = 'Error';
}
diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php
index 5facd5d1bbf..9f360294fc9 100644
--- a/htdocs/asterisk/wrapper.php
+++ b/htdocs/asterisk/wrapper.php
@@ -138,8 +138,7 @@ if ($resql)
}
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db, 'Error');
$found = 'Error';
}
@@ -165,8 +164,7 @@ if (!empty($number))
dol_syslog($txt, LOG_ERR);
print '
'."\n";
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index d2afa5e6871..f77b50924e2 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -110,14 +110,12 @@ if ($action == 'initbarcodeproducts')
{
setEventMessages($langs->trans("AllBarcodeReset"), null, 'mesgs');
}
- else
- {
+ else {
$error++;
dol_print_error($db);
}
}
- else
- {
+ else {
$sql = "SELECT rowid, ref, fk_product_type";
$sql .= " FROM ".MAIN_DB_PREFIX."product";
$sql .= " WHERE barcode IS NULL or barcode = ''";
@@ -151,8 +149,7 @@ if ($action == 'initbarcodeproducts')
$i++;
}
}
- else
- {
+ else {
$error++;
dol_print_error($db);
}
@@ -168,8 +165,7 @@ if ($action == 'initbarcodeproducts')
//$db->rollback();
$db->commit();
}
- else
- {
+ else {
$db->rollback();
}
}
@@ -295,8 +291,7 @@ if ($conf->product->enabled || $conf->product->service)
print ''.(isset($modBarCodeProduct->name) ? $modBarCodeProduct->name : $modBarCodeProduct->nom).' - '.$langs->trans("NextValue").': '.$modBarCodeProduct->getNextValue($objproduct).' ';
$disabled = 0;
}
- else
- {
+ else {
$disabled = 1;
$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
print ''.$langs->trans("NoBarcodeNumberingTemplateDefined").' ('.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").' ) ';
diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index 5cd988a5bed..7c692998723 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -162,8 +162,7 @@ if ($action == 'builddoc')
setEventMessages($module->error, null, 'errors');
}
}
- else
- {
+ else {
$error++;
setEventMessages("Error, encoding ".$encoding." is not supported by encoder ".$generator.'. You must choose another barcode type or install a barcode generation engine that support '.$encoding, null, 'errors');
}
diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php
index 1ef35942d1e..0a649a380cf 100644
--- a/htdocs/blockedlog/admin/blockedlog.php
+++ b/htdocs/blockedlog/admin/blockedlog.php
@@ -52,8 +52,7 @@ if (preg_match('/set_(.*)/', $action, $reg))
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -66,8 +65,7 @@ if (preg_match('/del_(.*)/', $action, $reg))
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php
index 66cc3b44848..10b14a29039 100644
--- a/htdocs/blockedlog/admin/blockedlog_list.php
+++ b/htdocs/blockedlog/admin/blockedlog_list.php
@@ -134,14 +134,12 @@ if ($action === 'downloadblockchain') {
$previoushash = $block_static->getPreviousHash(0, $obj->rowid);
$firstid = $obj->rowid;
}
- else
- { // If not data found for filter, we do not need previoushash neither firstid
+ else { // If not data found for filter, we do not need previoushash neither firstid
$previoushash = 'nodata';
$firstid = '';
}
}
- else
- {
+ else {
$error++;
setEventMessages($db->lasterror, null, 'errors');
}
@@ -212,8 +210,7 @@ if ($action === 'downloadblockchain') {
if ($loweridinerror > 0) $statusofrecordnote = 'ValidButFoundAPreviousKO';
else $statusofrecordnote = '';
}
- else
- {
+ else {
$statusofrecord = 'KO';
$statusofrecordnote = 'LineCorruptedOrNotMatchingPreviousOne';
$loweridinerror = $obj->rowid;
@@ -246,8 +243,7 @@ if ($action === 'downloadblockchain') {
exit;
}
- else
- {
+ else {
setEventMessages($db->lasterror, null, 'errors');
}
}
@@ -264,8 +260,7 @@ if (GETPOST('withtab', 'alpha'))
{
$title = $langs->trans("ModuleSetup").' '.$langs->trans('BlockedLog');
}
-else
-{
+else {
$title = $langs->trans("BrowseBlockedLog");
}
@@ -280,8 +275,7 @@ if (!is_array($blocks))
{
setEventMessages($langs->trans("TooManyRecordToScanRestrictFilters", $MAXLINES), null, 'errors');
}
- else
- {
+ else {
dol_print_error($block_static->db, $block_static->error, $block_static->errors);
exit;
}
@@ -441,8 +435,7 @@ if (!empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) {
// TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests
// to find the $loweridinerror.
}
-else
-{
+else {
// This is version that optimize the memory (but will not report errors that are outside the filter range)
$loweridinerror = 0;
$checkresult = array();
@@ -511,8 +504,7 @@ if (is_array($blocks))
if ($checkresult[$block->id]) print img_picto($langs->trans('OkCheckFingerprintValidityButChainIsKo'), 'statut4');
else print img_picto($langs->trans('KoCheckFingerprintValidity'), 'statut8');
}
- else
- {
+ else {
print img_picto($langs->trans('OkCheckFingerprintValidity'), 'statut4');
}
diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php
index eaf1b17ed08..e2d588f1798 100644
--- a/htdocs/blockedlog/ajax/block-info.php
+++ b/htdocs/blockedlog/ajax/block-info.php
@@ -95,8 +95,7 @@ function formatObject($objtoshow, $prefix)
var_dump($val);*/
$s .= dol_print_date($val, 'dayhour');
}
- else
- {
+ else {
$s .= $val;
}
$s .= '';
diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php
index 234aeceb2a6..95106bba4d2 100644
--- a/htdocs/blockedlog/class/authority.class.php
+++ b/htdocs/blockedlog/class/authority.class.php
@@ -180,14 +180,12 @@ class BlockedLogAuthority
return 1;
}
- else
- {
+ else {
$this->error = $langs->trans("RecordNotFound");
return 0;
}
}
- else
- {
+ else {
$this->error = $this->db->error();
return -1;
}
@@ -233,14 +231,12 @@ class BlockedLogAuthority
return $this->id;
}
- else
- {
+ else {
$this->db->rollback();
return -2;
}
}
- else
- {
+ else {
$this->error = $this->db->error();
$this->db->rollback();
return -1;
@@ -277,8 +273,7 @@ class BlockedLogAuthority
return 1;
}
- else
- {
+ else {
$this->error = $this->db->error();
$this->db->rollback();
return -1;
diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php
index be017f22600..0226486116b 100644
--- a/htdocs/blockedlog/class/blockedlog.class.php
+++ b/htdocs/blockedlog/class/blockedlog.class.php
@@ -303,8 +303,7 @@ class BlockedLog
if ($this->signature == '0000000000') {
return 'System to track events into unalterable logs were disabled after some recording were done. We saved a special Fingerprint to track the chain as broken. ';
}
- else
- {
+ else {
return 'System to track events into unalterable logs were disabled. This is possible because no record were done yet. ';
}
}
@@ -640,7 +639,7 @@ class BlockedLog
if (!empty($object->newref)) $this->object_data->ref = $object->newref;
}
- else // Generic case
+ else // Generic case
{
foreach ($object as $key=>$value)
{
@@ -714,14 +713,12 @@ class BlockedLog
return 1;
}
- else
- {
+ else {
$this->error = $langs->trans("RecordNotFound");
return 0;
}
}
- else
- {
+ else {
$this->error = $this->db->error();
return -1;
}
@@ -865,14 +862,12 @@ class BlockedLog
return $this->id;
}
- else
- {
+ else {
$this->db->rollback();
return -2;
}
}
- else
- {
+ else {
$this->error = $this->db->error();
$this->db->rollback();
return -1;
@@ -954,8 +949,7 @@ class BlockedLog
$previoussignature = $obj->signature;
}
}
- else
- {
+ else {
dol_print_error($this->db);
exit;
}
diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php
index a5b66b9886f..68c09977cbd 100644
--- a/htdocs/bom/bom_agenda.php
+++ b/htdocs/bom/bom_agenda.php
@@ -46,8 +46,7 @@ if (GETPOST('actioncode', 'array'))
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label = GETPOST('search_agenda_label');
@@ -217,8 +216,7 @@ if ($object->id > 0)
{
print ''.$langs->trans("AddAction").' ';
}
- else
- {
+ else {
print ''.$langs->trans("AddAction").' ';
}
}
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 48e9c9d965a..f0f4a2f7b7d 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -177,8 +177,7 @@ if (empty($reshook))
setEventMessages($bomline->error, $bomline->errors, 'errors');
$action = '';
}
- else
- {
+ else {
unset($_POST['idprod']);
unset($_POST['qty']);
unset($_POST['qty_frozen']);
@@ -217,8 +216,7 @@ if (empty($reshook))
setEventMessages($bomline->error, $bomline->errors, 'errors');
$action = '';
}
- else
- {
+ else {
unset($_POST['idprod']);
unset($_POST['qty']);
unset($_POST['qty_frozen']);
@@ -621,8 +619,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print 'id.'&action=edit">'.$langs->trans("Modify").' '."\n";
}
- else
- {
+ else {
print ''.$langs->trans('Modify').' '."\n";
}
}
@@ -636,8 +633,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print ''.$langs->trans("Validate").' ';
}
- else
- {
+ else {
$langs->load("errors");
print ''.$langs->trans("Validate").' ';
}
@@ -689,8 +685,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print 'id.'&action=delete">'.$langs->trans('Delete').' '."\n";
}
- else
- {
+ else {
print ''.$langs->trans('Delete').' '."\n";
}
}
diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php
index a7dca41fff6..0a68c799171 100644
--- a/htdocs/bom/bom_document.php
+++ b/htdocs/bom/bom_document.php
@@ -142,8 +142,7 @@ if ($object->id)
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
}
-else
-{
+else {
accessforbidden('', 0, 1);
}
diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php
index e2bafbecb48..2159564aeed 100644
--- a/htdocs/bom/bom_list.php
+++ b/htdocs/bom/bom_list.php
@@ -199,8 +199,7 @@ if (empty($reshook))
}
else $nbok++;
}
- else
- {
+ else {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
break;
@@ -213,8 +212,7 @@ if (empty($reshook))
else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
$db->commit();
}
- else
- {
+ else {
$db->rollback();
}
//var_dump($listofobjectthirdparties);exit;
@@ -254,8 +252,7 @@ if (empty($reshook))
}
else $nbok++;
}
- else
- {
+ else {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
break;
@@ -268,8 +265,7 @@ if (empty($reshook))
else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
$db->commit();
}
- else
- {
+ else {
$db->rollback();
}
//var_dump($listofobjectthirdparties);exit;
@@ -365,8 +361,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
{
$num = $nbtotalofrecords;
}
-else
-{
+else {
if ($limit) $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php
index d21d82b5ca9..995f2c29f3a 100644
--- a/htdocs/bom/class/api_boms.class.php
+++ b/htdocs/bom/class/api_boms.class.php
@@ -229,8 +229,7 @@ class Boms extends DolibarrApi
{
return $this->get($id);
}
- else
- {
+ else {
throw new RestException(500, $this->bom->error);
}
}
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index 3e522b3c11f..c3e7faede2c 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -514,15 +514,13 @@ class BOM extends CommonObject
{
return $numref;
}
- else
- {
+ else {
$this->error = $obj->error;
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
return "";
}
}
- else
- {
+ else {
print $langs->trans("Error")." ".$langs->trans("Error_BOM_ADDON_NotDefined");
return "";
}
@@ -568,8 +566,7 @@ class BOM extends CommonObject
$this->fetch_product();
$num = $this->getNextNumRef($this->product);
}
- else
- {
+ else {
$num = $this->ref;
}
$this->newref = dol_sanitizeFileName($num);
@@ -651,8 +648,7 @@ class BOM extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
return -1;
}
@@ -896,8 +892,7 @@ class BOM extends CommonObject
$this->db->free($result);
}
- else
- {
+ else {
dol_print_error($this->db);
}
}
@@ -920,8 +915,7 @@ class BOM extends CommonObject
$this->errors = $this->errors;
return $result;
}
- else
- {
+ else {
$this->lines = $result;
return $this->lines;
}
@@ -1429,8 +1423,7 @@ class BOMLine extends CommonObjectLine
$this->db->free($result);
}
- else
- {
+ else {
dol_print_error($this->db);
}
}
diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php
index eeffb625381..1019911b89f 100644
--- a/htdocs/bom/tpl/objectline_create.tpl.php
+++ b/htdocs/bom/tpl/objectline_create.tpl.php
@@ -100,8 +100,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled))
// hide products in closed warehouse, but show products for internal transfer
$form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
}
- else
- {
+ else {
$form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
}
diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php
index bc0c0c37fc2..60e4a1b9756 100644
--- a/htdocs/bookmarks/admin/bookmark.php
+++ b/htdocs/bookmarks/admin/bookmark.php
@@ -45,8 +45,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/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php
index 93283cab815..10452ddbd05 100644
--- a/htdocs/bookmarks/bookmarks.lib.php
+++ b/htdocs/bookmarks/bookmarks.lib.php
@@ -42,8 +42,7 @@ function printDropdownBookmarksList()
{
$url .= (dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '');
}
- else
- {
+ else {
global $sortfield, $sortorder;
$tmpurl = '';
// No urlencode, all param $url will be urlencoded later
@@ -123,8 +122,7 @@ function printDropdownBookmarksList()
$searchForm .= '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php
index 385dd506031..28ce42b6b70 100644
--- a/htdocs/bookmarks/card.php
+++ b/htdocs/bookmarks/card.php
@@ -101,22 +101,19 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
header("Location: ".$backtopage);
exit;
}
- else
- {
+ else {
if ($object->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
$action = $invertedaction;
}
}
- else
- {
+ else {
$action = $invertedaction;
}
}
@@ -266,8 +263,7 @@ if ($id > 0 && !preg_match('/^add/i', $action))
$liste = array(1=>$langs->trans("OpenANewWindow"), 0=>$langs->trans("ReplaceWindow"));
print $form->selectarray('target', $liste, isset($_POST["target"]) ? $_POST["target"] : $object->target);
}
- else
- {
+ else {
if ($object->target == 0) print $langs->trans("ReplaceWindow");
if ($object->target == 1) print $langs->trans("OpenANewWindow");
}
@@ -278,16 +274,14 @@ if ($id > 0 && !preg_match('/^add/i', $action))
{
print img_picto('', 'user').' '.$form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
}
- else
- {
+ else {
if ($object->fk_user > 0)
{
$fuser = new User($db);
$fuser->fetch($object->fk_user);
print $fuser->getNomUrl(1);
}
- else
- {
+ else {
print $langs->trans("Public");
}
}
diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php
index 2667208fc44..3a00d38eedc 100644
--- a/htdocs/bookmarks/class/bookmark.class.php
+++ b/htdocs/bookmarks/class/bookmark.class.php
@@ -128,8 +128,7 @@ class Bookmark extends CommonObject
$this->db->free($resql);
return $this->id;
}
- else
- {
+ else {
dol_print_error($this->db);
return -1;
}
@@ -175,16 +174,14 @@ class Bookmark extends CommonObject
$this->db->commit();
return $id;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
$this->errno = $this->db->lasterrno();
$this->db->rollback();
return -2;
}
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
$this->errno = $this->db->lasterrno();
$this->db->rollback();
@@ -219,8 +216,7 @@ class Bookmark extends CommonObject
{
return 1;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -243,8 +239,7 @@ class Bookmark extends CommonObject
{
return 1;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index 5dd1718b263..ad944d93208 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -73,8 +73,7 @@ if ($action == 'delete')
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -116,8 +115,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
{
$num = $nbtotalofrecords;
}
-else
-{
+else {
$sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
@@ -231,8 +229,7 @@ while ($i < min($num, $limit))
$tmpuser = $cacheOfUsers[$obj->fk_user];
print $tmpuser->getNomUrl(1);
}
- else
- {
+ else {
print $langs->trans("Public");
}
print "\n";
@@ -253,8 +250,7 @@ while ($i < min($num, $limit))
{
print 'rowid.'">'.img_delete().' ';
}
- else
- {
+ else {
print " ";
}
print "";
diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php
index 7c72858387a..9542d0f2b48 100644
--- a/htdocs/cashdesk/admin/cashdesk.php
+++ b/htdocs/cashdesk/admin/cashdesk.php
@@ -69,8 +69,7 @@ if (GETPOST('action', 'alpha') == 'set')
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
- else
- {
+ else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
@@ -150,8 +149,7 @@ if (!empty($conf->stock->enabled))
if (empty($conf->productbatch->enabled)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK', $conf->global->CASHDESK_NO_DECREASE_STOCK, 1);
}
- else
- {
+ else {
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", 1, 'chaine', 0, '', $conf->entity);
}
@@ -170,8 +168,7 @@ if (!empty($conf->stock->enabled))
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE, 'CASHDESK_ID_WAREHOUSE', '', 1, $disabled);
print ' ('.$langs->trans("Create").') ';
}
- else
- {
+ else {
print ''.$langs->trans("StockDecreaseForPointOfSaleDisabled").' ';
}
print '';
diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php
index 41ba5ffcb39..bfad032c0b5 100644
--- a/htdocs/cashdesk/affContenu.php
+++ b/htdocs/cashdesk/affContenu.php
@@ -37,8 +37,7 @@ if (isset($_SESSION['serObjFacturation']))
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset($_SESSION['serObjFacturation']);
}
-else
-{
+else {
// ... sinon, c'est une nouvelle vente
$obj_facturation = new Facturation();
}
@@ -73,8 +72,7 @@ if (in_array(
{
include $page.'.php';
}
-else
-{
+else {
dol_print_error('', 'menu param '.$page.' is not inside allowed list');
}
diff --git a/htdocs/cashdesk/class/Auth.class.php b/htdocs/cashdesk/class/Auth.class.php
index 164d229cf8d..f5de48aa3cb 100644
--- a/htdocs/cashdesk/class/Auth.class.php
+++ b/htdocs/cashdesk/class/Auth.class.php
@@ -130,8 +130,7 @@ class Auth
$this->passwd($aPasswd);
$ret = 0;
}
- else
- {
+ else {
$ret = -1;
}
}
diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php
index 10573f9d917..a3c4f7e0a48 100644
--- a/htdocs/cashdesk/class/Facturation.class.php
+++ b/htdocs/cashdesk/class/Facturation.class.php
@@ -299,8 +299,7 @@ class Facturation
{
$this->id = null;
}
- else
- {
+ else {
$this->id = $aId;
}
}
@@ -322,8 +321,7 @@ class Facturation
{
$this->ref = null;
}
- else
- {
+ else {
$this->ref = $aRef;
}
}
@@ -344,8 +342,7 @@ class Facturation
{
$this->qte = null;
}
- else
- {
+ else {
$this->qte = $aQte;
}
}
@@ -367,8 +364,7 @@ class Facturation
{
$this->stock = null;
}
- else
- {
+ else {
$this->stock = $aStock;
}
}
@@ -390,8 +386,7 @@ class Facturation
{
$this->remise_percent = null;
}
- else
- {
+ else {
$this->remise_percent = $aRemisePercent;
}
}
@@ -587,8 +582,7 @@ class Facturation
{
$this->prix_total_ttc = null;
}
- else
- {
+ else {
$this->prix_total_ttc = $aTotalTtc;
}
}
diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php
index 3c4a4dd6c7a..fd49ad952b4 100644
--- a/htdocs/cashdesk/facturation.php
+++ b/htdocs/cashdesk/facturation.php
@@ -81,8 +81,7 @@ if (GETPOST('filtre', 'alpha')) {
}
$db->free($resql);
}
- else
- {
+ else {
dol_print_error($db);
}
$tab_designations = $ret;
@@ -116,8 +115,7 @@ if (GETPOST('filtre', 'alpha')) {
}
$db->free($resql);
}
- else
- {
+ else {
dol_print_error($db);
}
$tab_designations = $ret;
@@ -131,8 +129,7 @@ if ($nbr_enreg > 1)
{
$top_liste_produits = '----- '.$conf_taille_listes.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';
}
- else
- {
+ else {
$top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';
}
}
@@ -140,8 +137,7 @@ elseif ($nbr_enreg == 1)
{
$top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound").' -----';
}
-else
-{
+else {
$top_liste_produits = '----- '.$langs->transnoentitiesnoconv("NoProductFound").' -----';
}
diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php
index 98ed2bf0173..0235c3dd788 100644
--- a/htdocs/cashdesk/facturation_dhtml.php
+++ b/htdocs/cashdesk/facturation_dhtml.php
@@ -56,8 +56,7 @@ if (dol_strlen($search) >= 0) // If search criteria is on char length at least
if (!empty($conf->barcode->enabled)) $sql .= " OR p.barcode LIKE '".$db->escape($search)."%'";
$sql .= ")";
}
- else
- {
+ else {
$sql .= " AND (p.ref LIKE '%".$db->escape($search)."%' OR p.label LIKE '%".$db->escape($search)."%'";
if (!empty($conf->barcode->enabled)) $sql .= " OR p.barcode LIKE '%".$db->escape($search)."%'";
$sql .= ")";
@@ -99,8 +98,7 @@ if (dol_strlen($search) >= 0) // If search criteria is on char length at least
print $resultat;
}
- else
- {
+ else {
$langs->load("cashdesk");
print '';
diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php
index 6a7a9bae366..c92f1e31366 100644
--- a/htdocs/cashdesk/facturation_verif.php
+++ b/htdocs/cashdesk/facturation_verif.php
@@ -124,8 +124,7 @@ switch ($action)
if (empty($tva_tx)) $tva_npr = 0;
}
}
- else
- {
+ else {
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
}
}
@@ -170,27 +169,23 @@ switch ($action)
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&filtre='.$filtre;
}
- else
- {
+ else {
$obj_facturation->raz();
if ($_POST['hdnSource'] == 'REF')
{
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&filtre='.$_POST['txtRef'];
}
- else
- {
+ else {
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation';
}
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
- else
- {
+ else {
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation';
}
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index 6c74b268ec9..4038b130d63 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -76,8 +76,7 @@ if (!empty($mysoc->logo_small))
{
print ' ';
}
-else
-{
+else {
print ''.$mysoc->name.'
';
}
?>
@@ -204,8 +203,7 @@ if ($_GET['err'] < 0)
echo (' document.getElementById(\'frmLogin\').pwdPassword.focus();');
echo ('');
}
-else
-{
+else {
echo ('');
diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php
index 251b3f2e997..0545c149dfa 100644
--- a/htdocs/cashdesk/index_verif.php
+++ b/htdocs/cashdesk/index_verif.php
@@ -117,13 +117,11 @@ if ($retour >= 0)
header('Location: '.DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&id=NOUV');
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
-else
-{
+else {
// Load translation files required by the page
$langs->loadLangs(array("other", "errors"));
$retour = $langs->trans("ErrorBadLoginPassword");
diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php
index 6fffbd3ed52..bd73954f6a0 100644
--- a/htdocs/cashdesk/tpl/liste_articles.tpl.php
+++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php
@@ -49,8 +49,7 @@ $tab = (!empty($_SESSION['poscart']) ? $_SESSION['poscart'] : array());
$tab_size = count($tab);
if ($tab_size <= 0) print ''.$langs->trans("NoArticle").'
';
-else
-{
+else {
for ($i = 0; $i < $tab_size; $i++)
{
echo (''."\n");
diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php
index 3b38aba3159..d60d370172d 100644
--- a/htdocs/cashdesk/tpl/validation1.tpl.php
+++ b/htdocs/cashdesk/tpl/validation1.tpl.php
@@ -41,8 +41,7 @@ $langs->loadLangs(array("main", "bills", "banks"));
if ($obj_facturation->montantTva()) {
echo ('
'.$langs->trans("VAT").' '.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).' ');
}
-else
-{
+else {
echo ('
'.$langs->trans("VAT").' '.$langs->trans("NoVAT").' ');
}
?>
diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php
index bc67350bbf1..a7a938fd828 100644
--- a/htdocs/cashdesk/validation_verif.php
+++ b/htdocs/cashdesk/validation_verif.php
@@ -97,8 +97,7 @@ switch ($action)
$obj_facturation->montantRendu($encaisse - $total);
}
- else
- {
+ else {
//$txtDatePaiement=$_POST['txtDatePaiement'];
$datePaiement = dol_mktime(0, 0, 0, $_POST['txtDatePaiementmonth'], $_POST['txtDatePaiementday'], $_POST['txtDatePaiementyear']);
$txtDatePaiement = dol_print_date($datePaiement, 'dayrfc');
@@ -253,16 +252,14 @@ switch ($action)
}
}
}
- else
- {
+ else {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
$id = $invoice->id;
}
- else
- {
+ else {
$resultcreate = $invoice->create($user, 0, 0);
if ($resultcreate > 0)
{
@@ -331,14 +328,12 @@ switch ($action)
}
}
}
- else
- {
+ else {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
}
- else
- {
+ else {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
@@ -350,8 +345,7 @@ switch ($action)
$db->commit();
$redirection = 'affIndex.php?menutpl=validation_ok&facid='.$id; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr
}
- else
- {
+ else {
$db->rollback();
$redirection = 'affIndex.php?facid='.$id.'&error=1&mesg=ErrorFailedToCreateInvoice'; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr
}
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 716e02ae678..8a4018a5458 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -173,8 +173,7 @@ if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes')
{
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
}
- else
- {
+ else {
if ($id > 0) {
//$object->fetch($id);
if (!empty($object->socpeopleassigned)) {
@@ -243,8 +242,7 @@ if (empty($reshook) && $action == 'add')
$action = 'create';
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
- else
- {
+ else {
$object->type_code = GETPOST('actioncode', 'aZ09');
}
@@ -263,8 +261,7 @@ if (empty($reshook) && $action == 'add')
{
$object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs));
}
- else
- {
+ else {
if ($langs->trans("Action".$object->type_code) != "Action".$object->type_code)
{
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
@@ -394,14 +391,12 @@ if (empty($reshook) && $action == 'add')
{
header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : ''));
}
- else
- {
+ else {
header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : ''));
}
exit;
}
- else
- {
+ else {
// If error
$db->rollback();
$langs->load("errors");
@@ -410,8 +405,7 @@ if (empty($reshook) && $action == 'add')
$action = 'create'; $donotclearsession = 1;
}
}
- else
- {
+ else {
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create'; $donotclearsession = 1;
@@ -517,8 +511,7 @@ if (empty($reshook) && $action == 'update')
$action = 'edit';
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
- else
- {
+ else {
$result = $cactioncomm->fetch(GETPOST('actioncode', 'aZ09'));
}
if (empty($object->userownerid))
@@ -607,8 +600,7 @@ if (empty($reshook) && $action == 'update')
$db->commit();
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
@@ -646,8 +638,7 @@ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes
header("Location: index.php");
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -756,8 +747,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate')
header("Location: ".$backtopage);
exit;
}
- else
- {
+ else {
$action = '';
}
}
@@ -957,8 +947,7 @@ if ($action == 'create')
$percent = -1;
if (isset($_GET['status']) || isset($_POST['status'])) $percent = GETPOST('status');
elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent = GETPOST('percentage');
- else
- {
+ else {
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent = '0';
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent = 100;
}
@@ -981,8 +970,7 @@ if ($action == 'create')
$listofuserid[$user->id]['transparency'] = GETPOSTISSET('transparency') ?GETPOST('transparency', 'alpha') : 1; // 1 by default at first init
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -1035,8 +1023,7 @@ if ($action == 'create')
print $societe->getNomUrl(1);
print '
';
}
- else
- {
+ else {
$events = array();
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company
@@ -1266,8 +1253,7 @@ if ($id > 0)
{
$formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ?GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto");
}
- else
- {
+ else {
print '
'.$langs->trans("Action".$object->type_code);
}
print '';
@@ -1398,8 +1384,7 @@ if ($id > 0)
}
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -1523,8 +1508,7 @@ if ($id > 0)
print '';
}
- else
- {
+ else {
print '
';
print dolGetElementUrl($object->fk_element, $object->elementtype, 1);
print ' ';
@@ -1564,8 +1548,7 @@ if ($id > 0)
print '';
}
- else
- {
+ else {
dol_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action');
@@ -1709,8 +1692,7 @@ if ($id > 0)
}
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -1797,8 +1779,7 @@ if ($id > 0)
}
}
}
- else
- {
+ else {
print ''.$langs->trans("None").' ';
}
print ' ';
@@ -1856,8 +1837,7 @@ if ($id > 0)
{
print '
';
}
- else
- {
+ else {
print '
';
}
@@ -1866,8 +1846,7 @@ if ($id > 0)
{
print '
';
}
- else
- {
+ else {
print '
';
}
@@ -1876,8 +1855,7 @@ if ($id > 0)
{
print '
';
}
- else
- {
+ else {
print '
';
}
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 3c060ffdc39..2c21f311e5d 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -423,8 +423,7 @@ class ActionComm extends CommonObject
$this->error = 'Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
return -1;
}
- else
- {
+ else {
$this->error = $cactioncomm->error;
return -1;
}
@@ -579,14 +578,12 @@ class ActionComm extends CommonObject
$this->db->commit();
return $this->id;
}
- else
- {
+ else {
$this->db->rollback();
return -1;
}
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -651,8 +648,7 @@ class ActionComm extends CommonObject
$this->db->commit();
return $this->id;
}
- else
- {
+ else {
$this->db->rollback();
return -1;
}
@@ -767,8 +763,7 @@ class ActionComm extends CommonObject
}
$this->db->free($resql);
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -814,8 +809,7 @@ class ActionComm extends CommonObject
return 1;
}
- else
- {
+ else {
dol_print_error($this->db);
return -1;
}
@@ -869,8 +863,7 @@ class ActionComm extends CommonObject
return 1;
}
- else
- {
+ else {
dol_print_error($this->db);
return -1;
}
@@ -953,14 +946,12 @@ class ActionComm extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
return -2;
}
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -1107,15 +1098,13 @@ class ActionComm extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
dol_syslog(get_class($this)."::update ".join(',', $this->errors), LOG_ERR);
return -2;
}
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -1175,8 +1164,7 @@ class ActionComm extends CommonObject
$db->free($resql);
return $resarray;
}
- else
- {
+ else {
return $db->lasterror();
}
}
@@ -1236,8 +1224,7 @@ class ActionComm extends CommonObject
if (empty($load_state_board)) return $response;
else return 1;
}
- else
- {
+ else {
dol_print_error($this->db);
$this->error = $this->db->error();
return -1;
@@ -1288,8 +1275,7 @@ class ActionComm extends CommonObject
}
$this->db->free($result);
}
- else
- {
+ else {
dol_print_error($this->db);
}
}
@@ -1426,8 +1412,7 @@ class ActionComm extends CommonObject
$url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id;
elseif ($option == 'holiday')
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
- else
- $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
+ else $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
@@ -1451,8 +1436,7 @@ class ActionComm extends CommonObject
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle = $labeltype;
$libelleshort = '';
}
- else
- {
+ else {
$libelle = (empty($this->libelle) ? $label : $this->libelle.(($label && $label != $this->libelle) ? ' '.$label : ''));
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle = $labeltype;
if ($maxlength < 0) $libelleshort = $this->ref;
@@ -1694,8 +1678,7 @@ class ActionComm extends CommonObject
$dateend = $this->db->jdate($obj->datep2)
- (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
}
- else
- {
+ else {
// use start date as fall-back to avoid import erros on empty end date
$dateend = $datestart;
}
@@ -1752,8 +1735,7 @@ class ActionComm extends CommonObject
$eventarray = $hookmanager->resArray;
}
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -1794,8 +1776,7 @@ class ActionComm extends CommonObject
$timestampStart = dol_stringtotime($obj->date_start." 12:00:00", 0);
$timestampEnd = dol_stringtotime($obj->date_end." 23:59:59", 0);
}
- else
- {
+ else {
$event['fulldayevent'] = true;
$timestampStart = dol_stringtotime($obj->date_start." 00:00:00", 0);
@@ -1830,8 +1811,7 @@ class ActionComm extends CommonObject
// 2 = leave wait for approval
$event['summary'] = $title." - ".$obj->lastname." (wait for approval)";
}
- else
- {
+ else {
// 3 = leave approved
$event['summary'] = $title." - ".$obj->lastname;
}
@@ -1857,8 +1837,7 @@ class ActionComm extends CommonObject
$desc = $more;
$desc .= ' ('.$mysoc->name.' - built by Dolibarr)';
}
- else
- {
+ else {
$title = 'Dolibarr actions '.$mysoc->name;
$desc = $langs->transnoentities('ListOfActions');
$desc .= ' ('.$mysoc->name.' - built by Dolibarr)';
@@ -1876,16 +1855,14 @@ class ActionComm extends CommonObject
if ($result >= 0)
{
if (dol_move($outputfiletmp, $outputfile, 0, 1)) $result = 1;
- else
- {
+ else {
$this->error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;
dol_syslog(get_class($this)."::build_exportfile ".$this->error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$result = -1;
}
}
- else
- {
+ else {
dol_syslog(get_class($this)."::build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index c8041c4ea16..d3e4f93b5f7 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -105,14 +105,12 @@ class CActionComm
$this->db->free($resql);
return 1;
}
- else
- {
+ else {
$this->db->free($resql);
return 0;
}
}
- else
- {
+ else {
$this->error = $this->db->error();
return -1;
}
@@ -209,8 +207,7 @@ class CActionComm
if ($idorcode == 'code') $this->liste_array = $repcode;
return $this->liste_array;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php
index e985b8ea09e..2b74c4793d9 100644
--- a/htdocs/comm/action/class/ical.class.php
+++ b/htdocs/comm/action/class/ical.class.php
@@ -187,8 +187,7 @@ class ICal
$tmpkey = $key;
$tmpvalue = $tmpvalue.preg_replace('/=$/', "", $value); // We must wait to have next line to have complete message
}
- else
- {
+ else {
$value = quotedPrintDecode(preg_replace('/^ENCODING=QUOTED-PRINTABLE:/i', '', $tmpvalue.$value));
}
} //$value=quotedPrintDecode($tmpvalue.$value);
@@ -237,8 +236,7 @@ class ICal
{
list($key, $value) = array($key, $value);
}
- else
- {
+ else {
list($key, $value) = $this->ical_dt_date($key, $value);
}
}
@@ -378,8 +376,7 @@ class ICal
usort($temp, array(&$this, "ical_dtstart_compare"));
return $temp;
}
- else
- {
+ else {
return false;
}
}
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 9e770f70a93..3bd141ca964 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -216,8 +216,7 @@ if ($object->id > 0)
}
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -264,8 +263,7 @@ if ($object->id > 0)
$param = '&id='.$object->id;
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
}
-else
-{
+else {
print $langs->trans("ErrorUnknown");
}
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index b480586bc6a..7b45b3f6ceb 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -96,8 +96,7 @@ if (GETPOST('search_actioncode', 'array'))
$actioncode = GETPOST('search_actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -466,7 +465,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$s = $hookmanager->resPrint;
}
}
-else // If javascript off
+else // If javascript off
{
$newparam = $param; // newparam is for birthday links
$newparam = preg_replace('/showbirthday=[0-1]/i', 'showbirthday='.(empty($showbirthday) ? 1 : 0), $newparam);
@@ -512,24 +511,20 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND ca.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND ca.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if (is_array($actioncode))
{
$sql .= " AND ca.code IN ('".implode("','", $actioncode)."')";
}
- else
- {
+ else {
$sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -554,8 +549,7 @@ if ($action == 'show_day')
$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
$sql .= ')';
}
-else
-{
+else {
// To limit array
$sql .= " AND (";
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7))."'"; // Start 7 days before
@@ -652,8 +646,7 @@ if ($resql)
{
// This record is out of visible range
}
- else
- {
+ else {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar = $firstdaytoshow;
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar = ($lastdaytoshow - 1);
@@ -666,8 +659,7 @@ if ($resql)
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
';
$eventarray[$daykey][] = $event;
@@ -684,8 +676,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -702,8 +693,7 @@ if ($showbirthday)
$sql .= ' AND MONTH(birthday) = '.$month;
$sql .= ' AND DAY(birthday) = '.$day;
}
- else
- {
+ else {
$sql .= ' AND MONTH(birthday) = '.$month;
}
$sql .= ' ORDER BY birthday';
@@ -741,8 +731,7 @@ if ($showbirthday)
$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
if ($daykey > $event->date_end_in_calendar) $loop = false;
@@ -751,8 +740,7 @@ if ($showbirthday)
$i++;
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -822,8 +810,7 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
{
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
}
- else
- {
+ else {
$event->label = $obj->lastname;
}
@@ -832,8 +819,7 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
$jour = date('d', $event->date_start_in_calendar);
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
@@ -903,8 +889,7 @@ if (count($listofextcals))
// datecurstart and datecurend are now GMT date
//var_dump($datecurstart); var_dump($datecurend); exit;
}
- else
- {
+ else {
// Not a recongized record
dol_syslog("Found a not recognized repeatable record with unknown date start", LOG_ERR);
continue;
@@ -929,8 +914,7 @@ if (count($listofextcals))
$newevent['DTSTART;VALUE=DATE'] = dol_print_date($datecurstart, '%Y%m%d');
$newevent['DTEND;VALUE=DATE'] = dol_print_date($datecurend + 1, '%Y%m%d');
}
- else
- {
+ else {
$newevent['DTSTART'] = $datecurstart;
$newevent['DTEND'] = $datecurend;
}
@@ -1067,8 +1051,7 @@ if (count($listofextcals))
//print 'x'.$datestart.'-'.$dateend;exit;
// This record is out of visible range
}
- else
- {
+ else {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar = $firstdaytoshow;
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar = ($lastdaytoshow - 1);
@@ -1083,8 +1066,7 @@ if (count($listofextcals))
// daykey must be date that represent day box in calendar so must be a user time
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, true, 0);
- do
- {
+ do {
//if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24; $daykeygmt += 60 * 60 * 24; // Add one day
@@ -1201,8 +1183,7 @@ if (empty($action) || $action == 'show_month') // View by month
echo " \n";
}
/* Show days after the current month (next month) */
- else
- {
+ else {
$style = 'cal_other_month';
if ($iter_day == 6) $style .= ' cal_other_month_right';
echo '
';
@@ -1275,7 +1256,7 @@ elseif ($action == 'show_week') // View by week
echo ' ';
echo ' ';
}
-else // View by day
+else // View by day
{
$newparam = $param; // newparam is for birthday links
$newparam = preg_replace('/action=show_month&?/i', '', $newparam);
@@ -1350,8 +1331,7 @@ else // View by day
print '';
}
- else
- {
+ else {
print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0);
@@ -1490,8 +1470,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unmovable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
- else
- {
+ else {
$numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1);
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
@@ -1516,8 +1495,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
$colorindex = $colorindexused[$idusertouse]; // Color already assigned to this user
}
- else
- {
+ else {
$colorindex = $nextindextouse;
$colorindexused[$idusertouse] = $colorindex;
if (!empty($theme_datacolor[$nextindextouse + 1])) $nextindextouse++; // Prepare to use next color
@@ -1580,8 +1558,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
print 'border: 2px solid #'.$colortouse.';';
}
- else
- {
+ else {
print 'background: #'.$colortouse.';';
print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($colortouse, -3).'), to(#'.dol_color_minus($colortouse, -1).'));';
}
@@ -1649,8 +1626,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange .= dol_print_date($event->date_end_in_calendar, '%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
}
}
- else
- {
+ else {
if ($showinfo)
{
print $langs->trans("EventOnFullDay")." \n";
@@ -1755,8 +1731,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '
'."\n";
$i++;
}
- else
- {
+ else {
print 'global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -279,24 +278,20 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND c.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND c.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'";
- else
- {
+ else {
if (is_array($actioncode))
{
$sql .= " AND c.code IN ('".implode("','", $actioncode)."')";
}
- else
- {
+ else {
$sql .= " AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -699,8 +694,7 @@ if ($resql)
$contactstatic->country_id = $obj->country_id;
print $contactstatic->getNomUrl(1, '', 0);
}
- else
- {
+ else {
print " ";
}
print ' ';
@@ -751,8 +745,7 @@ if ($resql)
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index 6dfbc6c7f9c..bc859ba6d2d 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -94,8 +94,7 @@ if (GETPOST('actioncode', 'array'))
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -372,18 +371,15 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND ca.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND ca.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
$sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -407,8 +403,7 @@ if ($action == 'show_day')
$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
$sql .= ')';
}
-else
-{
+else {
// To limit array
$sql .= " AND (";
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, 1, 1, $year) - (60 * 60 * 24 * 7))."'"; // Start 7 days before
@@ -491,8 +486,7 @@ if ($resql)
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
}
- else
- {
+ else {
$event->date_start_in_calendar = $datep;
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
@@ -510,8 +504,7 @@ if ($resql)
// This record is out of visible range
unset($event);
}
- else
- {
+ else {
//print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'
'."\n";
$event->fetch_userassigned(); // This load $event->userassigned
@@ -527,8 +520,7 @@ if ($resql)
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
';
$eventarray[$daykey][] = $event;
@@ -545,8 +537,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -827,8 +818,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unsortable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
- else
- {
+ else {
$numother++; $cssclass = 'family_other';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color = $event->type_color;
}
@@ -841,8 +831,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
{
$colorindex = $colorindexused[$idusertouse]; // Color already assigned to this user
}
- else
- {
+ else {
$colorindex = $nextindextouse;
$colorindexused[$idusertouse] = $colorindex;
if (!empty($theme_datacolor[$nextindextouse + 1])) $nextindextouse++; // Prepare to use next color
@@ -961,8 +950,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
}
}
}
- else
- {
+ else {
$busy = $event->transparency;
$cases1[$h][$event->id]['busy'] = $busy;
$cases2[$h][$event->id]['busy'] = $busy;
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index f2cce5c8023..da5020cef39 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -95,8 +95,7 @@ if (GETPOST('search_actioncode', 'array'))
$actioncode = GETPOST('search_actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -431,24 +430,20 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND ca.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND ca.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if (is_array($actioncode))
{
$sql .= " AND ca.code IN ('".implode("','", $actioncode)."')";
}
- else
- {
+ else {
$sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -473,8 +468,7 @@ if ($action == 'show_day')
$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
$sql .= ')';
}
-else
-{
+else {
// To limit array
$sql .= " AND (";
$sql .= " (a.datep BETWEEN '".$db->idate($firstdaytoshow - (60 * 60 * 24 * 2))."'"; // Start 2 day before $firstdaytoshow
@@ -558,8 +552,7 @@ if ($resql)
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
}
- else
- {
+ else {
$event->date_start_in_calendar = $datep;
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
@@ -577,8 +570,7 @@ if ($resql)
// This record is out of visible range
unset($event);
}
- else
- {
+ else {
//print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'
'."\n";
$event->fetch_userassigned(); // This load $event->userassigned
@@ -594,8 +586,7 @@ if ($resql)
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
';
$eventarray[$daykey][] = $event;
@@ -613,8 +604,7 @@ if ($resql)
}
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
@@ -721,8 +711,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
}
}
/* Use this list to have for all users */
- else
- {
+ else {
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
if ($usergroup > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
@@ -1011,8 +1000,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unsortable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
- else
- {
+ else {
$numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1);
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
@@ -1039,8 +1027,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{
$colorindex = $colorindexused[$idusertouse]; // Color already assigned to this user
}
- else
- {
+ else {
$colorindex = $nextindextouse;
$colorindexused[$idusertouse] = $colorindex;
if (!empty($theme_datacolor[$nextindextouse + 1])) $nextindextouse++; // Prepare to use next color
@@ -1159,8 +1146,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
}
}
- else
- {
+ else {
$busy = $event->transparency;
$cases1[$h][$event->id]['busy'] = $busy;
$cases2[$h][$event->id]['busy'] = $busy;
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index 82477d307fc..c3192f2286e 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -203,8 +203,7 @@ if ($resql)
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 4ff16cd7c03..17eae67eb2e 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -331,8 +331,7 @@ if ($object->id > 0)
{
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 1);
}
- else
- {
+ else {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'none');
}
print "";
@@ -350,8 +349,7 @@ if ($object->id > 0)
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
}
- else
- {
+ else {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'none');
}
print "";
@@ -371,8 +369,7 @@ if ($object->id > 0)
{
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'fk_account', 1);
}
- else
- {
+ else {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'none');
}
print "";
@@ -479,8 +476,7 @@ if ($object->id > 0)
{
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1);
}
- else
- {
+ else {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->shipping_method_id, 'none');
}
print "";
@@ -518,8 +514,7 @@ if ($object->id > 0)
$adh->ref = $adh->getFullName($langs);
print $adh->getNomUrl(1);
}
- else
- {
+ else {
print '
'.$langs->trans("ThirdpartyNotLinkedToMember").' ';
}
print '';
@@ -547,8 +542,7 @@ if ($object->id > 0)
{
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_prospectlevel, 'prospect_level_id', 1);
}
- else
- {
+ else {
print $object->getLibProspLevel();
}
print "";
@@ -732,8 +726,7 @@ if ($object->id > 0)
print '
';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -818,8 +811,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -961,8 +953,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1022,8 +1013,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1093,14 +1083,12 @@ if ($object->id > 0)
{
print ''.dol_print_date($db->jdate($objp->date_last_gen), 'day').' ';
}
- else
- {
+ else {
if ($objp->dc > 0)
{
print ''.dol_print_date($db->jdate($objp->dc), 'day').' ';
}
- else
- {
+ else {
print '!!! ';
}
}
@@ -1130,8 +1118,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1195,8 +1182,7 @@ if ($object->id > 0)
{
print ''.dol_print_date($db->jdate($objp->df), 'day').' ';
}
- else
- {
+ else {
print '!!! ';
}
print '';
@@ -1222,8 +1208,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1289,8 +1274,7 @@ if ($object->id > 0)
{
print '';
}
- else
- {
+ else {
$langs->load("bills");
$langs->load("orders");
@@ -1317,8 +1301,7 @@ if ($object->id > 0)
{
print '';
}
- else
- {
+ else {
print '';
}
}
@@ -1343,8 +1326,7 @@ if ($object->id > 0)
show_actions_done($conf, $langs, $db, $object);
}
}
-else
-{
+else {
$langs->load("errors");
print $langs->trans('ErrorRecordNotFound');
}
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index 8c9a63d97e2..da7248dbecb 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -171,8 +171,7 @@ if ($resql)
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index af5b4ac41a5..99eddda9cad 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -215,16 +215,14 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
print ' '.$langs->trans("Total").' '.price($total)." ";
}
}
- else
- {
+ else {
print ''.$langs->trans("NoProposal").' ';
}
print " ";
$db->free($resql);
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -303,16 +301,14 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
print ''.$langs->trans("Total").' '.price($total)." ";
}
}
- else
- {
+ else {
print ''.$langs->trans("NoProposal").' ';
}
print " ";
$db->free($resql);
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -395,8 +391,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
print ''.$langs->trans("Total").' '.price($total)." ";
}
}
- else
- {
+ else {
print ''.$langs->trans("NoOrder").' ';
}
print "";
@@ -404,8 +399,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
$db->free($resql);
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -488,8 +482,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
print ''.$langs->trans("Total").' '.price($total)." ";
}
}
- else
- {
+ else {
print ''.$langs->trans("NoSupplierOrder").' ';
}
print "";
@@ -571,8 +564,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
$db->free($resql);
}
- else
- {
+ else {
print ''.$langs->trans("None").' ';
}
print "";
@@ -630,8 +622,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$i++;
}
}
- else
- {
+ else {
print ''.$langs->trans("None").' ';
}
print '';
@@ -718,8 +709,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TOD
print " ";
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -826,8 +816,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
print " ";
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -934,8 +923,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
print " ";
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php
index d4db9fc6ea9..d16c3e9e7da 100644
--- a/htdocs/comm/mailing/advtargetemailing.php
+++ b/htdocs/comm/mailing/advtargetemailing.php
@@ -88,8 +88,7 @@ if ($result < 0)
{
setEventMessages($advTarget->error, $advTarget->errors, 'errors');
}
-else
-{
+else {
if (!empty($advTarget->id)) {
$array_query = json_decode($advTarget->filtervalue, true);
}
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index e3cb5a9ad97..1e7f5fa6385 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -94,16 +94,14 @@ if (empty($reshook))
{
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
}
- else
- {
+ else {
$result = $object->createFromClone($user, $object->id, GETPOST("clone_content", 'alpha'), GETPOST("clone_receivers", 'alpha'));
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -126,8 +124,7 @@ if (empty($reshook))
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings');
$action = '';
}
- else
- {
+ else {
$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing');
if ($object->statut == 0)
@@ -236,8 +233,7 @@ if (empty($reshook))
$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
$substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
}
- else
- {
+ else {
$substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$obj->source_id, 2);
$substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'order'.$obj->source_id, 2);
$substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'invoice'.$obj->source_id, 2);
@@ -317,8 +313,7 @@ if (empty($reshook))
{
dol_print_error($db);
}
- else
- {
+ else {
//if cheack read is use then update prospect contact status
if (strpos($message, '__CHECK_READ__') !== false)
{
@@ -351,8 +346,7 @@ if (empty($reshook))
//test if CHECK READ change statut prospect contact
}
- else
- {
+ else {
// Mail failed
$nbko++;
@@ -370,8 +364,7 @@ if (empty($reshook))
$i++;
}
}
- else
- {
+ else {
setEventMessages($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"), null, 'mesgs');
}
@@ -382,15 +375,13 @@ if (empty($reshook))
if ($nbok > 0) setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs');
else setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs');
}
- else
- {
+ else {
if ($nbok >= $num)
{
$statut = 3; // Send to everybody
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs');
}
- else
- {
+ else {
$statut = 2; // Status 'sent partially' (because not send to everybody)
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs');
}
@@ -404,8 +395,7 @@ if (empty($reshook))
dol_print_error($db);
}
}
- else
- {
+ else {
dol_syslog($db->error());
dol_print_error($db);
}
@@ -473,8 +463,7 @@ if (empty($reshook))
setEventMessages($langs->trans("MailSuccessfulySent", $mailfile->getValidAddress($object->email_from, 2), $mailfile->getValidAddress($object->sendto, 2)), null, 'mesgs');
$action = '';
}
- else
- {
+ else {
setEventMessages($langs->trans("ResultKo").' '.$mailfile->error.' '.$result, null, 'errors');
$action = 'test';
}
@@ -612,8 +601,7 @@ if (empty($reshook))
setEventMessages($mesg, $mesgs, 'errors');
$action = "edit";
}
- else
- {
+ else {
$action = "edit";
}
}
@@ -628,8 +616,7 @@ if (empty($reshook))
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -646,13 +633,11 @@ if (empty($reshook))
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -676,14 +661,12 @@ if (empty($reshook))
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -784,8 +767,7 @@ if ($action == 'create')
print '';
}
-else
-{
+else {
if ($object->id > 0)
{
$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing');
@@ -856,8 +838,7 @@ else
}
$_GET["action"] = '';
}
- else
- {
+ else {
if (!empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (!empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
@@ -940,8 +921,7 @@ else
{
$text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
}
- else
- {
+ else {
$text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
@@ -950,8 +930,7 @@ else
{
print $form->textwithpicto($nbemail, $text, 1, 'warning');
}
- else
- {
+ else {
print $nbemail;
}
}
@@ -999,8 +978,7 @@ else
{
print ''.$langs->trans("EditWithEditor").' ';
}
- else
- {
+ else {
print ''.$langs->trans("EditWithTextEditor").' ';
}
@@ -1013,8 +991,7 @@ else
{
print ''.$langs->trans("TestMailing").' ';
}
- else
- {
+ else {
print ''.$langs->trans("TestMailing").' ';
}
@@ -1028,8 +1005,7 @@ else
{
print ''.$langs->trans("ValidMailing").' ';
}
- else
- {
+ else {
print ''.$langs->trans("ValidMailing").' ';
}
}
@@ -1044,8 +1020,7 @@ else
{
print ''.$langs->trans("SendMailing").' ';
}
- else
- {
+ else {
print ''.$langs->trans("SendMailing").' ';
}
}
@@ -1061,8 +1036,7 @@ else
{
print ''.$langs->trans("ResetMailing").' ';
}
- else
- {
+ else {
print ''.$langs->trans("ResetMailing").' ';
}
}
@@ -1073,8 +1047,7 @@ else
{
print ''.$langs->trans("DeleteMailing").' ';
}
- else
- {
+ else {
print ''.$langs->trans("DeleteMailing").' ';
}
}
@@ -1154,8 +1127,7 @@ else
print ' ';
}
}
- else
- {
+ else {
print ''.$langs->trans("NoAttachedFiles").' ';
}
print '';
@@ -1182,8 +1154,7 @@ else
dol_fiche_end();
}
- else
- {
+ else {
/*
* Mailing en mode edition (CKeditor or HTML source)
*/
@@ -1230,8 +1201,7 @@ else
{
$text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
}
- else
- {
+ else {
$text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
@@ -1240,8 +1210,7 @@ else
{
print $form->textwithpicto($nbemail, $text, 1, 'warning');
}
- else
- {
+ else {
print $nbemail;
}
}
@@ -1316,8 +1285,7 @@ else
$out .= ' ';
}
}
- else
- {
+ else {
$out .= $langs->trans("NoAttachedFiles").' ';
}
// Add link to add file
@@ -1367,8 +1335,7 @@ else
print ' ';
}
}
- else
- {
+ else {
dol_print_error($db, $object->error);
}
}
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index d8d9873b88b..e89a645cf20 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -161,8 +161,7 @@ if (GETPOST('exportcsv', 'int'))
exit;
}
- else
- {
+ else {
dol_print_error($db);
}
exit;
@@ -182,14 +181,12 @@ if ($action == 'delete')
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
- else
- {
+ else {
header("Location: list.php");
exit;
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -294,8 +291,7 @@ if ($object->fetch($id) >= 0)
{
$text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
}
- else
- {
+ else {
$text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
@@ -304,8 +300,7 @@ if ($object->fetch($id) >= 0)
{
print $form->textwithpicto($nbemail, $text, 1, 'warning');
}
- else
- {
+ else {
print $nbemail;
}
}
@@ -406,8 +401,7 @@ if ($object->fetch($id) >= 0)
print '