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;
}