From 9bfb7a5cbd1639b0b6a67a8befe73725893a720f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 5 Feb 2021 12:08:05 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/compta/bank/bankentries_list.php | 75 +++++++------------ htdocs/salaries/card.php | 16 ++-- htdocs/salaries/class/paymentsalary.class.php | 27 +++---- htdocs/salaries/class/salary.class.php | 23 ++---- htdocs/salaries/list.php | 2 +- htdocs/salaries/paiement_salary.php | 9 +-- htdocs/salaries/payment_salary/card.php | 9 +-- htdocs/salaries/payments.php | 8 +- 8 files changed, 60 insertions(+), 109 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 84fdbf6bbe8..3b84cf625db 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -70,8 +70,7 @@ if ($fielvalue) if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype); } -else -{ +else { if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque'); } @@ -243,15 +242,13 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' } } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("NoRecordSelected"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors'); @@ -288,8 +285,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) { $amount = price2num($_POST["addcredit"]); } - else - { + else { $amount = - price2num($_POST["adddebit"]); } @@ -339,13 +335,11 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : '')); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $action = 'addline'; } } @@ -470,8 +464,7 @@ if ($id > 0 || !empty($ref)) } } } -else -{ +else { llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); } @@ -676,8 +669,7 @@ if ($resql) print $liste; if ($numr <= 0) print ''.$langs->trans("None").''; } - else - { + else { dol_print_error($db); } @@ -794,13 +786,12 @@ if ($resql) { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); } - else // If direct entries is not done using miscellaneous payments + else // If direct entries is not done using miscellaneous payments { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier); } } - else - { + else { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1); } } @@ -1042,8 +1033,7 @@ if ($resql) $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount); } // If sort is asc,asc,asc then total of previous date is balance of line before the next line to show - else - { + else { $balance = $objforbalance->previoustotal; } } @@ -1130,8 +1120,7 @@ if ($resql) $balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc) $balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT'); } - else - { + else { $balancebefore = price2num($balance, 'MT'); // balancebefore = balance of previous line (sort is asc) $balance = price2num($balance + ($sign * $objp->amount), 'MT'); } @@ -1143,8 +1132,7 @@ if ($resql) $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; } - else - { + else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -1280,8 +1268,7 @@ if ($resql) print $bankstatic->getNomUrl(1, ''); print ')'; } - else - { + else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("TransferFrom").' '; @@ -1307,11 +1294,10 @@ if ($resql) elseif ($links[$key]['type'] == 'sc') { } - elseif ($links[$key]['type'] == 'salary') + elseif ($links[$key]['type'] == 'salary') { - } - else - { + } + else { // Show link with label $links[$key]['label'] if (!empty($objp->label) && !empty($links[$key]['label'])) print ' - '; print ''; @@ -1321,8 +1307,7 @@ if ($resql) if ($reg[1] == 'paiement') $reg[1] = 'Payment'; print ' '.$langs->trans($reg[1]); } - else - { + else { print ' '.$links[$key]['label']; } print ''; @@ -1400,8 +1385,7 @@ if ($resql) $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; print $companystatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -1454,13 +1438,11 @@ if ($resql) { print ' '.price($balancebefore).''; } - else - { + else { print ' '.price($balancebefore).''; } } - else - { + else { print '-'; } if (!$i) $totalarray['nbfield']++; @@ -1474,13 +1456,11 @@ if ($resql) { print ' '.price($balance).''; } - else - { + else { print ' '.price($balance).''; } } - else - { + else { print '-'; } if (!$i) $totalarray['nbfield']++; @@ -1527,16 +1507,14 @@ if ($resql) print img_edit(); print ''; } - else - { + else { if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { print ''; print img_edit(); print ''; } - else - { + else { print ''; print img_view(); print ''; @@ -1614,8 +1592,7 @@ if ($resql) print ''; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 449592d5c00..63ddb61e786 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -243,7 +243,7 @@ if ($action == 'add' && empty($cancel)) } } - if(empty($error)) { + if (empty($error)) { if (GETPOST('saveandnew', 'alpha')) { setEventMessages($langs->trans("RecordSaved"), '', 'mesgs'); header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOST('paymenttype', 'az09')) . '&datepday=' . GETPOST("datepday", 'int') . '&datepmonth=' . GETPOST("datepmonth", 'int') . '&datepyear=' . GETPOST("datepyear", 'int')); @@ -253,7 +253,6 @@ if ($action == 'add' && empty($cancel)) exit; } } - } $action = 'create'; @@ -493,14 +492,14 @@ if ($action == 'create') print ''; // Project - if (!empty($conf->projet->enabled)) + if (!empty($conf->projet->enabled)) { - $formproject = new FormProjets($db); + $formproject = new FormProjets($db); - print ''.$langs->trans("Project").''; - $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); - print ''; - } + print ''.$langs->trans("Project").''; + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + print ''; + } // Bank if (!empty($conf->banque->enabled)) @@ -712,7 +711,6 @@ if ($id) print ''.$langs->trans("DateEndPeriod").""; print $form->selectDate($object->dateep, 'dateep', 0, 0, 0, 'dateep', 1); print ""; - } else { print ""; print '' . $langs->trans("DateEndPeriod") . ''; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index cde7f862ca7..70aa1301d50 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -202,8 +202,7 @@ class PaymentSalary extends CommonObject } } } - else - { + else { $error++; } } @@ -218,8 +217,7 @@ class PaymentSalary extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -289,8 +287,7 @@ class PaymentSalary extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -361,8 +358,7 @@ class PaymentSalary extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -417,8 +413,7 @@ class PaymentSalary extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -468,8 +463,7 @@ class PaymentSalary extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -584,8 +578,7 @@ class PaymentSalary extends CommonObject } } } - else - { + else { $this->error = $acc->error; $error++; } @@ -595,8 +588,7 @@ class PaymentSalary extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -620,8 +612,7 @@ class PaymentSalary extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index ad5aed81752..5b2082999f2 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -187,8 +187,7 @@ class Salary extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -270,8 +269,7 @@ class Salary extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -388,7 +386,7 @@ class Salary extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -5; } - /* if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) + /* if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account")); return -6; @@ -472,14 +470,12 @@ class Salary extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -503,8 +499,7 @@ class Salary extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -611,8 +606,7 @@ class Salary extends CommonObject $this->db->free($resql); return $amount; } - else - { + else { return -1; } } @@ -648,8 +642,7 @@ class Salary extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 7054cb7d37d..351c27123d2 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -577,7 +577,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } } -// if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + // if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; // Amount print ''.price($obj->amount).''; diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 6c0ae2066db..81b1c5c42c9 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -143,8 +143,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -285,8 +284,7 @@ if ($action == 'create') { print ''.dol_print_date($objp->dateep, 'day').''."\n"; } - else - { + else { print "!!!\n"; } @@ -307,8 +305,7 @@ if ($action == 'create') print ''; print ''; } - else - { + else { print '-'; } print ""; diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 4d022b6704b..1b879347c09 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -68,8 +68,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->salaries- header("Location: ".DOL_URL_ROOT."/salaries/payments.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -244,8 +243,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -277,8 +275,7 @@ if ($action == '') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index a5b62143d48..baf97014e24 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -105,8 +105,7 @@ elseif ($mysoc->localtax2_assuj == "1") $j = 2; $numlt = 3; } -else -{ +else { $j = 0; $numlt = 0; } @@ -124,7 +123,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON (u.rowid = s.fk_user)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ps.fk_typepaiement = pct.id"; $sql .= " WHERE s.entity IN (".getEntity('user').")"; - /* if ($year > 0) + /* if ($year > 0) { $sql .= " AND (s.datesp between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; $sql .= " OR s.dateep between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."')"; @@ -208,8 +207,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) print "
"; } - else - { + else { dol_print_error($db); } }