diff --git a/htdocs/externalsite/admin/externalsite.php b/htdocs/externalsite/admin/externalsite.php index b1e3dc7fac8..70f235f4a27 100644 --- a/htdocs/externalsite/admin/externalsite.php +++ b/htdocs/externalsite/admin/externalsite.php @@ -60,8 +60,7 @@ if ($action == 'update') $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); } diff --git a/htdocs/externalsite/frames.php b/htdocs/externalsite/frames.php index 3a1b1c04b82..5393f68b640 100644 --- a/htdocs/externalsite/frames.php +++ b/htdocs/externalsite/frames.php @@ -69,8 +69,7 @@ if (!empty($keyforcontent)) $langs->load("errors"); print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent); } - else - { + else { if (preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent)) { print $conf->global->$keyforcontent; @@ -115,8 +114,7 @@ if (!empty($keyforcontent)) print '
'; llxFooter(); } -else -{ +else { if (preg_match('/^\//', $conf->global->EXTERNALSITE_URL) || preg_match('/^http/i', $conf->global->EXTERNALSITE_URL)) { print " @@ -151,8 +149,7 @@ else "; } - else - { + else { llxHeader(); print '
'; print $conf->global->EXTERNALSITE_URL; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index ba98812f1b2..cd24a6bce0c 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -130,15 +130,13 @@ if ($result) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print ''; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 621f93ca247..caba1b87925 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -261,8 +261,7 @@ class Establishment extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -287,8 +286,7 @@ class Establishment extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -389,8 +387,7 @@ class Establishment extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -418,8 +415,7 @@ class Establishment extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 0122e92090f..8199e3bbccc 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") header("Location: ../admin/admin_establishment.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -101,18 +100,15 @@ elseif ($action == 'add') header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $action = 'create'; } } - else - { + else { header("Location: ../admin/admin_establishment.php"); exit; } @@ -148,8 +144,7 @@ elseif ($action == 'update') header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index e31266f755c..1f61b920eb8 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -242,8 +242,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print ''; @@ -315,8 +314,7 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print ''; diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 82c6521e00f..80f30552473 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -119,8 +119,7 @@ if ($action == 'add') header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -167,8 +166,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio else header("Location: ".DOL_URL_ROOT.'/expedition/list.php?restore_lastsearch_values=1'); exit; } - else - { + else { $db->rollback(); } } @@ -262,7 +260,7 @@ $formfile = new FormFile($db); if ($action == 'create') // Create. Seems to no be used { } -else // View +else // View { if ($object->id > 0) { @@ -453,8 +451,7 @@ else // View print ''; print ''; } - else - { + else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -476,8 +473,7 @@ else // View { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -575,8 +571,7 @@ else // View $label = (!empty($product->multilangs[$outputlangs->defaultlang]["label"])) ? $product->multilangs[$outputlangs->defaultlang]["label"] : $object->lines[$i]->product_label; } - else - { + else { $label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : $object->lines[$i]->product_label); } @@ -597,8 +592,7 @@ else // View print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '
'.dol_htmlentitiesbr($object->lines[$i]->description) : ''; } } - else - { + else { print ""; if ($object->lines[$i]->fk_product_type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -675,8 +669,7 @@ else // View { print ''.$langs->trans("Delete").''; } - else - { + else { print ''.$langs->trans("Delete").''; } } @@ -720,14 +713,12 @@ else // View print ''; } - else - { + else { /* Expedition non trouvee */ print "Expedition inexistante ou acces refuse"; } } - else - { + else { /* Expedition non trouvee */ print "Expedition inexistante ou acces refuse"; } diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index acfe8b29d05..4d00c414cb1 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -216,24 +216,21 @@ class Livraison extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->db->rollback(); return -3; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->db->rollback(); return -2; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=".$this->db->lastqueryerror; $this->db->rollback(); @@ -345,15 +342,13 @@ class Livraison extends CommonObject return 1; } - else - { + else { $this->error = 'Delivery with id '.$id.' not found sql='.$sql; dol_syslog(get_class($this).'::fetch Error '.$this->error, LOG_ERR); return -2; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -400,8 +395,7 @@ class Livraison extends CommonObject { $numref = $objMod->livraison_get_num($soc, $this); } - else - { + else { $numref = $this->ref; } $this->newref = dol_sanitizeFileName($numref); @@ -501,16 +495,14 @@ class Livraison extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } } } - else - { + else { $this->error = "Non autorise"; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); return -1; @@ -634,8 +626,7 @@ class Livraison extends CommonObject return 1; } - else - { + else { return 0; } } @@ -705,22 +696,19 @@ class Livraison extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; @@ -991,8 +979,7 @@ class Livraison extends CommonObject { $array[$i]['qty'] = $objSourceLine->qty - $row[1]; } - else - { + else { $array[$i]['qty'] = $objSourceLine->qty; } @@ -1010,8 +997,7 @@ class Livraison extends CommonObject } return $array; } - else - { + else { $this->error = $this->db->error()." - sql=$sqlSourceLine"; return -1; } @@ -1041,14 +1027,12 @@ class Livraison extends CommonObject $this->date_delivery = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 56b12321bb2..266b7d2bc09 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -69,8 +69,7 @@ if (empty($reshook)) { setEventMessages($langs->trans('LoanPaid'), null, 'mesgs'); } - else - { + else { setEventMessages($loan->error, null, 'errors'); } } @@ -86,8 +85,7 @@ if (empty($reshook)) header("Location: index.php"); exit; } - else - { + else { setEventMessages($loan->error, null, 'errors'); } } @@ -154,8 +152,7 @@ if (empty($reshook)) } } } - else - { + else { header("Location: index.php"); exit(); } @@ -177,8 +174,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors'); $action = 'edit'; } - else - { + else { $object->datestart = $datestart; $object->dateend = $dateend; $object->capital = $capital; @@ -202,14 +198,12 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $error++; setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -275,8 +269,7 @@ if ($action == 'create') $form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant print ''; } - else - { + else { print ''.$langs->trans("Account").''; print $langs->trans("NoBankAccountDefined"); print ''; @@ -484,8 +477,7 @@ if ($id > 0) print ''; print ''; } - else - { + else { print ''.$langs->trans("LoanCapital").''.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).''; } @@ -496,8 +488,7 @@ if ($id > 0) print ''; print ''; } - else - { + else { print ''.$langs->trans("Insurance").''.price($object->insurance_amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; } @@ -508,8 +499,7 @@ if ($id > 0) { print $form->selectDate($object->datestart, 'start', 0, 0, 0, 'update', 1, 0); } - else - { + else { print dol_print_date($object->datestart, "day"); } print ""; @@ -521,8 +511,7 @@ if ($id > 0) { print $form->selectDate($object->dateend, 'end', 0, 0, 0, 'update', 1, 0); } - else - { + else { print dol_print_date($object->dateend, "day"); } print ""; @@ -534,8 +523,7 @@ if ($id > 0) { print ''; } - else - { + else { print $object->nbterm; } print ''; @@ -547,8 +535,7 @@ if ($id > 0) { print '%'; } - else - { + else { print price($object->rate).'%'; } print ''; @@ -565,14 +552,12 @@ if ($id > 0) { print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1); } - else - { + else { print ''; } print ''; } - else - { + else { print ''; print $langs->trans("LoanAccountancyCapitalCode"); print ''; @@ -603,14 +588,12 @@ if ($id > 0) { print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1); } - else - { + else { print ''; } print ''; } - else - { + else { print ''; print $langs->trans("LoanAccountancyInsuranceCode"); print ''; @@ -641,14 +624,12 @@ if ($id > 0) { print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1); } - else - { + else { print ''; } print ''; } - else - { + else { print ''; print $langs->trans("LoanAccountancyInterestCode"); print ''; @@ -743,8 +724,7 @@ if ($id > 0) $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -805,8 +785,7 @@ if ($id > 0) } } } - else - { + else { // Loan not found dol_print_error('', $object->error); } diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 1a24eb6be11..d38593c9710 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -161,14 +161,12 @@ class Loan extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->db->free($resql); return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -259,8 +257,7 @@ class Loan extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -330,8 +327,7 @@ class Loan extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -376,8 +372,7 @@ class Loan extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -572,8 +567,7 @@ class Loan extends CommonObject $this->db->free($resql); return $amount; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -619,14 +613,12 @@ class Loan extends CommonObject $this->db->free($result); return 1; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index 3299e810991..8089dc3e176 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -171,8 +171,7 @@ class LoanSchedule extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan"); } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -184,8 +183,7 @@ class LoanSchedule extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->errors[] = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -258,8 +256,7 @@ class LoanSchedule extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -322,8 +319,7 @@ class LoanSchedule extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -364,8 +360,7 @@ class LoanSchedule extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -451,8 +446,7 @@ class LoanSchedule extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index ce152317710..5c50a1fea89 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -166,8 +166,7 @@ class PaymentLoan extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_loan"); } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -179,8 +178,7 @@ class PaymentLoan extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -255,8 +253,7 @@ class PaymentLoan extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -327,8 +324,7 @@ class PaymentLoan extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -380,8 +376,7 @@ class PaymentLoan extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -460,8 +455,7 @@ class PaymentLoan extends CommonObject if ($result <= 0) dol_print_error($this->db); } } - else - { + else { $this->error = $acc->error; $error++; } @@ -471,8 +465,7 @@ class PaymentLoan extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -497,8 +490,7 @@ class PaymentLoan extends CommonObject $this->fk_bank = $id_bank; return 1; } - else - { + else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 6ae646a93a1..93eca8cb7b4 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -159,8 +159,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 3f87f322ccb..5a4b9364555 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -121,8 +121,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit { $num = $nbtotalofrecords; } -else -{ +else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -262,8 +261,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index b739b81ca54..6d912cc7149 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del header("Location: ".DOL_URL_ROOT."/loan/list.php"); exit; } - else - { + else { setEventMessages($payment->error, $payment->errors, 'errors'); $db->rollback(); } @@ -102,8 +101,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->wri header('Location: card.php?id='.$payment->id); exit; } - else - { + else { setEventMessages($payment->error, $payment->errors, 'errors'); $db->rollback(); } @@ -255,8 +253,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -287,8 +284,7 @@ if (empty($action) && !empty($user->rights->loan->delete)) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index ea37a298d49..3ccc6a77b3f 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -170,8 +170,7 @@ if ($action == 'add_payment') header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -291,8 +290,7 @@ if ($action == 'create') { print ''.dol_print_date($loan->datestart, 'day').''; } - else - { + else { print '!!!'; } @@ -307,8 +305,7 @@ if ($action == 'create') { print $langs->trans("LoanCapital").': '; } - else - { + else { print '-'; } print '
'; @@ -316,8 +313,7 @@ if ($action == 'create') { print $langs->trans("Insurance").': '; } - else - { + else { print '-'; } print '
'; @@ -325,8 +321,7 @@ if ($action == 'create') { print $langs->trans("Interest").': '; } - else - { + else { print '-'; } print ""; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 41a221a7e72..dec81411a33 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -291,15 +291,13 @@ class MailmanSpip $mydb->close($result); return 1; } - else - { + else { // nous n'avons pas de reponse => n'existe pas $mydb->close($result); return 0; } } - else - { + else { $this->error = $mydb->lasterror(); $mydb->close(); } @@ -378,8 +376,7 @@ class MailmanSpip } return count($lists); } - else - { + else { $this->error = "ADHERENT_MAILMAN_URL not defined"; return -1; } @@ -452,8 +449,7 @@ class MailmanSpip } return count($lists); } - else - { + else { $this->error = "ADHERENT_MAILMAN_UNSUB_URL not defined"; return -1; } diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 5b6cd01ba97..e174e383993 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -62,8 +61,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -74,8 +72,7 @@ if ($action == 'remises') { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -86,8 +83,7 @@ if ($action == 'typemarges') { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -98,8 +94,7 @@ if ($action == 'contact') { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } - else - { + else { dol_print_error($db); } } @@ -167,14 +162,12 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('DISPLAY_MARGIN_RATES'); } -else -{ +else { if (empty($conf->global->DISPLAY_MARGIN_RATES)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } @@ -190,14 +183,12 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('DISPLAY_MARK_RATES'); } -else -{ +else { if (empty($conf->global->DISPLAY_MARK_RATES)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } @@ -213,14 +204,12 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('ForceBuyingPriceIfNull'); } -else -{ +else { if (empty($conf->global->ForceBuyingPriceIfNull)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index cf1d70db91a..8dfaecc7d41 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -48,8 +48,7 @@ if (!$sortfield) { if ($agentid > 0) $sortfield = "s.nom"; - else - $sortfield = "u.lastname"; + else $sortfield = "u.lastname"; } $startdate = $enddate = ''; @@ -156,16 +155,14 @@ $sql .= " AND sc.fk_soc = f.fk_soc"; $sql .= " AND (d.product_type = 0 OR d.product_type = 1)"; if (!empty($conf->global->AGENT_CONTACT_TYPE)) $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))"; -else - $sql .= " AND sc.fk_user = u.rowid"; +else $sql .= " AND sc.fk_user = u.rowid"; $sql .= " AND f.fk_statut NOT IN (".implode(', ', $invoice_status_except_list).")"; $sql .= ' AND s.entity IN ('.getEntity('societe').')'; $sql .= " AND d.fk_facture = f.rowid"; if ($agentid > 0) { if (!empty($conf->global->AGENT_CONTACT_TYPE)) $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))"; - else - $sql .= " AND sc.fk_user = ".$agentid; + else $sql .= " AND sc.fk_user = ".$agentid; } if (!empty($startdate)) $sql .= " AND f.datef >= '".$db->idate($startdate)."'"; @@ -205,7 +202,7 @@ if ($result) if ($conf->global->MARGIN_TYPE == "1") $labelcostprice = 'BuyingPrice'; - else // value is 'costprice' or 'pmp' + else // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; $moreforfilter = ''; @@ -217,8 +214,7 @@ if ($result) print ''; if ($agentid > 0) print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); - else - print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder); + else print_liste_field_titre("SalesRepresentative", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, '', $sortfield, $sortorder, 'right '); @@ -308,8 +304,7 @@ if ($result) print ""; print '
'; } -else -{ +else { dol_print_error($db); } $db->free($result); diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 337791238ce..83e743e0d68 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -222,7 +222,7 @@ if ($result) { if ($conf->global->MARGIN_TYPE == "1") $labelcostprice = 'BuyingPrice'; - else // value is 'costprice' or 'pmp' + else // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; $moreforfilter = ''; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 3cdd9c3c650..20d2b2a1b52 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -126,8 +126,7 @@ if (!$sortfield) $sortfield = "f.datef"; $sortorder = "DESC"; } - else - { + else { $sortfield = "s.nom"; $sortorder = "ASC"; } @@ -255,7 +254,7 @@ if ($result) if ($conf->global->MARGIN_TYPE == "1") $labelcostprice = 'BuyingPrice'; - else // value is 'costprice' or 'pmp' + else // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; $moreforfilter = ''; @@ -269,8 +268,7 @@ if ($result) print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&socid=".$socid, '', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&socid=".$socid, 'align="center"', $sortfield, $sortorder); } - else - print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder); + else print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "s.nom", "", "&socid=".$socid, '', $sortfield, $sortorder); print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&socid=".$socid, 'align="right"', $sortfield, $sortorder); @@ -298,8 +296,7 @@ if ($result) $marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : ''; } - else - { + else { $marginRate = ($pa != 0) ? (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ? (100 * $marge / $pv) : ''; } @@ -353,8 +350,7 @@ if ($result) print ''; if ($client) print ''; - else - print ''; + else print ''; print $langs->trans('TotalMargin').""; print "".price($cumul_vente, null, null, null, null, $rounding)."\n"; print "".price($cumul_achat, null, null, null, null, $rounding)."\n"; @@ -368,8 +364,7 @@ if ($result) print ""; print '
'; } -else -{ +else { dol_print_error($db); } $db->free($result); diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index 1f1d6def849..41618b174fa 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -128,13 +128,11 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta { $paht_ret = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100); } - else - { + else { $paht_ret = $paht; } } - else - { + else { $paht_ret = $paht; } @@ -147,8 +145,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta // calcul marge if ($pu_ht_remise < 0) $marge = -1 * (abs($pu_ht_remise) - $paht_ret); - else - $marge = $pu_ht_remise - $paht_ret; + else $marge = $pu_ht_remise - $paht_ret; // calcul taux marge if ($paht_ret != 0) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index d4df22475d4..3e2fd804ff6 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -62,8 +62,7 @@ if (!$sortfield) $sortfield = "f.datef"; $sortorder = "DESC"; } - else - { + else { $sortfield = "p.ref"; $sortorder = "ASC"; } @@ -226,7 +225,7 @@ if ($result) //var_dump($conf->global->MARGIN_TYPE); if ($conf->global->MARGIN_TYPE == "1") $labelcostprice = 'BuyingPrice'; - else // value is 'costprice' or 'pmp' + else // value is 'costprice' or 'pmp' $labelcostprice = 'CostPrice'; $moreforfilter = ''; @@ -240,8 +239,7 @@ if ($result) print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", "&id=".$id, '', $sortfield, $sortorder); print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", "&id=".$id, 'align="center"', $sortfield, $sortorder); } - else - { + else { print_liste_field_titre("ProductService", $_SERVER["PHP_SELF"], "p.ref", "", "&id=".$id, '', $sortfield, $sortorder); } print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", "&id=".$id, 'align="right"', $sortfield, $sortorder); @@ -270,8 +268,7 @@ if ($result) $marginRate = ($pa != 0) ?-1 * (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ?-1 * (100 * $marge / $pv) : ''; } - else - { + else { $marginRate = ($pa != 0) ? (100 * $marge / $pa) : ''; $markRate = ($pv != 0) ? (100 * $marge / $pv) : ''; } @@ -298,8 +295,7 @@ if ($result) $text = $product_static->getNomUrl(1); print $text .= ' - '.$objp->label; } - else - { + else { print img_object('', 'product').' '.$langs->trans("NotPredefinedProducts"); } print "\n"; @@ -330,8 +326,7 @@ if ($result) print ''; if ($id > 0) print ''; - else - print ''; + else print ''; print $langs->trans('TotalMargin').""; print "".price(price2num($cumul_vente, 'MT'))."\n"; print "".price(price2num($cumul_achat, 'MT'))."\n"; @@ -345,8 +340,7 @@ if ($result) print ""; print ''; } -else -{ +else { dol_print_error($db); } $db->free($result); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index e68a042ace2..489946e43fe 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -230,8 +230,7 @@ if ($id > 0 || !empty($ref)) $marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : ''; } - else - { + else { $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : ''; } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index ecb8a3ce764..c04537fa99e 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -236,8 +236,7 @@ if ($socid > 0) $marginRate = ($cumul_achat != 0) ?-1 * (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ?-1 * (100 * $totalMargin / $cumul_vente) : ''; } - else - { + else { $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; $markRate = ($cumul_vente != 0) ? (100 * $totalMargin / $cumul_vente) : ''; } @@ -255,8 +254,7 @@ if ($socid > 0) print ' '; print "\n"; } - else - { + else { dol_print_error($db); } print ""; @@ -265,8 +263,7 @@ if ($socid > 0) print '
'; $db->free($result); } -else -{ +else { dol_print_error('', 'Parameter socid not defined'); } diff --git a/htdocs/mrp/ajax/ajax_bom.php b/htdocs/mrp/ajax/ajax_bom.php index 19fea01aa60..d5c1355d361 100644 --- a/htdocs/mrp/ajax/ajax_bom.php +++ b/htdocs/mrp/ajax/ajax_bom.php @@ -50,7 +50,6 @@ if ($result > 0) unset($object->db); echo json_encode($object); } -else -{ +else { echo 'Failed to load category with id='.$idbom; } diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 89e9b25abef..5cf3d5798f8 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -763,15 +763,13 @@ class Mo extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); return ""; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_MRP_MO_ADDON_NotDefined"); return ""; } @@ -817,8 +815,7 @@ class Mo extends CommonObject $this->fetch_product(); $num = $this->getNextNumRef($this->product); } - else - { + else { $num = $this->ref; } $this->newref = $num; @@ -900,8 +897,7 @@ class Mo extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1146,8 +1142,7 @@ class Mo extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -1181,8 +1176,7 @@ class Mo extends CommonObject $this->errors = $this->errors; return $result; } - else - { + else { $this->lines = $result; return $this->lines; } @@ -1329,8 +1323,7 @@ class Mo extends CommonObject $this->tpl['label'] .= $productstatic->getNomUrl(1); //$this->tpl['label'].= ' - '.$productstatic->label; } - else - { + else { // If origin MRP line is not a product, but another MRP // TODO } diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index f0bdc8ba62d..e05a93494f3 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -137,8 +137,7 @@ if ($conf->use_javascript_ajax) print "
"; } - else - { + else { dol_print_error($db); } } @@ -196,8 +195,7 @@ if ($resql) print ""; print "
"; } -else -{ +else { dol_print_error($db); } @@ -249,8 +247,7 @@ if ($resql) print ""; print "
"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index eee839c8a83..5b18f18d1ca 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -49,8 +49,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); @@ -217,8 +216,7 @@ if ($object->id > 0) { print ''.$langs->trans("AddAction").''; } - else - { + else { print ''.$langs->trans("AddAction").''; } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 0e2cc09e811..eda7d0c30ca 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -193,8 +193,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, 0, 0, 0); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -625,8 +624,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans("Modify").''."\n"; } - else - { + else { print ''.$langs->trans('Modify').''."\n"; } } @@ -640,8 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans("Validate").''; } - else - { + else { $langs->load("errors"); print ''.$langs->trans("Validate").''; } @@ -676,8 +673,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans('Delete').''."\n"; } - else - { + else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 48031b6f372..9ed658ab1c1 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -184,8 +184,7 @@ if ($object->id) include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 1); } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 4807c47fb53..9866dabf8e0 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -280,8 +280,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit { $num = $nbtotalofrecords; } -else -{ +else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 2448d43bda7..2ec9f603b84 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -790,8 +790,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; if ($productlot->id > 0) print $productlot->getNomUrl(1); - else - print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement. + else print $productlot->batch; // the id may not be defined if movement was entered when lot was not saved or if lot was removed after movement. print ''; } if (!empty($arrayfields['pl.eatby']['checked'])) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 9f05283345a..6c800446595 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -407,8 +407,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, 0, 0, 0); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -593,8 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.$langs->trans("Validate").''; } - else - { + else { $langs->load("errors"); print ''.$langs->trans("Validate").''; } diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 513c4537358..50bd5d6cdcf 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -410,8 +410,7 @@ class MultiCurrency extends CommonObject $this->rate = $currencyRate; return 1; } - else - { + else { $this->rate = null; $this->errors = $currencyRate->errors; return -1; @@ -533,8 +532,7 @@ class MultiCurrency extends CommonObject $resql = $db->query($sql1.$sql2.$sql3); if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate); - else - { + else { if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE)) { $resql = $db->query($sql1.$sql3); @@ -669,8 +667,7 @@ class MultiCurrency extends CommonObject return 1; } - else - { + else { dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING); setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors'); diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 32dde7ddb3e..1a794ac76d9 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -252,8 +252,7 @@ if ($action == 'edit') $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); $doleditor->Create(0, ''); } -else -{ +else { print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)); } print ''; @@ -309,8 +308,7 @@ print ''; // Expire date print ''.$langs->trans('ExpireDate').''; if ($action == 'edit') print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0); -else -{ +else { print dol_print_date($object->date_fin, 'day'); if ($object->date_fin && $object->date_fin < dol_now() && $object->status == Opensurveysondage::STATUS_VALIDATED) print img_warning($langs->trans("Expired")); } @@ -410,8 +408,7 @@ if ($comments) { print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))."
"; } } -else -{ +else { print $langs->trans("NoCommentYet").'
'; } diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index d9af22ed78e..f7541f2ebe0 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -200,8 +200,7 @@ class Opensurveysondage extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -263,8 +262,7 @@ class Opensurveysondage extends CommonObject $this->date_m = $this->db->jdate($obj->tls); $ret = 1; } - else - { + else { $sondage = ($id ? 'id='.$id : 'sondageid='.$numsurvey); $this->error = 'Fetch no poll found for '.$sondage; dol_syslog($this->error, LOG_ERR); @@ -273,8 +271,7 @@ class Opensurveysondage extends CommonObject $this->db->free($resql); } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $ret = -1; } @@ -343,8 +340,7 @@ class Opensurveysondage extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -409,8 +405,7 @@ class Opensurveysondage extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php index 34e5b666710..2125ac76774 100644 --- a/htdocs/opensurvey/exportcsv.php +++ b/htdocs/opensurvey/exportcsv.php @@ -114,8 +114,7 @@ if ($resql) $input .= 'KO;'; $somme[$k]++; } - else - { + else { $input .= ';'; } } diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 442fc1b539b..918c8e20ef9 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -191,8 +191,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 337ccb3e435..c86c6919f00 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -94,8 +94,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); $error++; } - else - { + else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $resql = $db->query($sql); @@ -262,8 +261,7 @@ if (isset($_POST["ajoutercolonne"]) && $object->format == "D") $adresseadmin = $object->mail_admin; } - else - { + else { $erreur_ajout_date = "yes"; } } @@ -536,8 +534,7 @@ if (GETPOST('ajoutsujet')) print ''; print '

'."\n"; } - else - { + else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); @@ -753,8 +750,7 @@ if ($object->format == "D") print ''."\n"; } } -else -{ +else { // Show titles print ''."\n"; print ''."\n"; @@ -841,8 +837,7 @@ while ($compteur < $num) } } } - else - { + else { //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs if ($compteur == $ligneamodifier) { @@ -869,8 +864,7 @@ while ($compteur < $num) print ''."\n"; } } - else - { + else { for ($i = 0; $i < $nbcolonnes; $i++) { $car = substr($ensemblereponses, $i, 1); @@ -1065,8 +1059,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').($toutsujet[$i] ? ' ('.dol_print_date($toutsujet[$i], '%A').')' : ''); } } - else - { + else { $tmps = explode('@', $toutsujet[$i]); $meilleursujet .= dol_htmlentities($tmps[0]); } diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 17c5bdea251..4254199ec96 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -320,8 +320,7 @@ if (is_integer($_SESSION["mois"]) && $_SESSION["mois"] > 0 && $_SESSION["mois"] { $motmois = dol_print_date(mktime(0, 0, 0, $_SESSION["mois"], 10), '%B'); } -else -{ +else { $motmois = dol_print_date(dol_now(), '%B'); } diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 7bb7861edbe..9752a4c43c4 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -89,8 +89,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre")) $testdate = true; $_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc'); } - else - { + else { $testdate = true; $_SESSION['champdatefin'] = dol_print_date($champdatefin, 'dayrfc'); //$testdate = false; @@ -193,8 +192,7 @@ if (GETPOST('choix_sondage')) print ''; print '
trans("TypeDate") : $langs->trans("TypeClassic")).')">'; } -else -{ +else { // Show image to selecte between date survey or other survey print '
'."\n"; print ' '."\n"; diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 13306deea32..5e21326062c 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -80,8 +80,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 0af8262c54a..94dff45e543 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -80,8 +80,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -96,8 +95,7 @@ if ($action == "setlive") { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -152,8 +150,7 @@ if (empty($conf->global->PAYPAL_API_SANDBOX)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index ab9ba921e16..6da045aaf4f 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -112,8 +112,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYPAL_SECURITY_TOKEN)) { if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + order_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2); @@ -130,8 +129,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYPAL_SECURITY_TOKEN)) { if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2); @@ -148,8 +146,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYPAL_SECURITY_TOKEN)) { if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2); @@ -166,8 +163,7 @@ function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag if (!empty($conf->global->PAYPAL_SECURITY_TOKEN)) { if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN; - else - { + else { $out .= '&securekey='.($mode ? '' : ''); if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + member_ref)"; if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2); @@ -264,8 +260,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, header("Location: ".$payPalURL); exit; } - else - { + else { //Display a user friendly Error on the page using any of the following error information returned by PayPal $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); @@ -276,8 +271,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, { $mesg .= "PayPal can't accept payments for this thirdparty. An address is defined but is not complete (missing State).
Ask system administrator to fix address or to setup Paypal module to accept payments even on not complete addresses (remove option PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS).
\n"; } - else - { + else { $mesg = $langs->trans('SetExpressCheckoutAPICallFailed')."
\n"; $mesg .= $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."
\n"; $mesg .= $langs->trans('ShortErrorMessage').": ".$ErrorShortMsg."
\n"; @@ -352,8 +346,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, { $nvpstr = $nvpstr."&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted } - else - { + else { $nvpstr = $nvpstr."&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory) } $nvpstr = $nvpstr."&SOLUTIONTYPE=".urlencode($solutionType); @@ -597,8 +590,7 @@ function hash_call($methodName, $nvpStr) $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; } - else - { + else { $API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; } @@ -677,8 +669,7 @@ function hash_call($methodName, $nvpStr) //Execute the Error handling module to display errors. } - else - { + else { //closing the curl curl_close($ch); } diff --git a/htdocs/paypal/lib/paypalfunctions.lib.php b/htdocs/paypal/lib/paypalfunctions.lib.php index 8b30e33704d..1c495bdb5ae 100644 --- a/htdocs/paypal/lib/paypalfunctions.lib.php +++ b/htdocs/paypal/lib/paypalfunctions.lib.php @@ -53,8 +53,7 @@ if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha' $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; } -else -{ +else { $API_Endpoint = "https://api-3t.paypal.com/nvp"; $API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; } diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index ab655d790f6..5282684f81f 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -74,8 +74,7 @@ if ($action == 'setconst' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -94,8 +93,7 @@ if ($action == 'setvalue' && $user->admin) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -162,8 +160,7 @@ if ($mode == 'setup' && $user->admin) { print $langs->trans("IsTokenGenerated"); } - else - { + else { print $langs->trans($key['varname']); } print ''; @@ -197,8 +194,7 @@ if ($mode == 'setup' && $user->admin) $tokenobj = null; // Dolibarr storage $storage = new DoliStorage($db, $conf); - try - { + try { $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME_GOOGLE); } catch (Exception $e) @@ -268,14 +264,12 @@ if ($mode == 'config' && $user->admin) { print ajax_constantonoff($printer->active); } - else - { + else { if (empty($conf->global->{$printer->conf})) { print '
'.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 107bcb4e4e3..c8bc07400b5 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -86,8 +86,7 @@ $morehtml .= ''; $morehtml .= ''; if ($mine) $tooltiphelp = $langs->trans("MyTasksDesc"); -else -{ +else { if ($user->rights->projet->all->lire && !$socid) $tooltiphelp = $langs->trans("TasksDesc"); else $tooltiphelp = $langs->trans("TasksPublicDesc"); } @@ -171,8 +170,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } print ''; @@ -228,8 +226,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } print ''; @@ -340,8 +337,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_MONTH)) } $db->free($resql); } - else - { + else { dol_print_error($db); } print ''; @@ -392,8 +388,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_YEAR)) } $db->free($resql); } - else - { + else { dol_print_error($db); } print ''; @@ -581,8 +576,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 1e0c147c82a..61738d29ebf 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -100,8 +100,7 @@ elseif ($search_usertoprocessid > 0) $usertoprocess->fetch($search_usertoprocessid); $search_usertoprocessid = $usertoprocess->id; } -else -{ +else { $usertoprocess = new User($db); } @@ -194,8 +193,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $result = $object->fetch($taskid, $ref); if ($result < 0) $error++; } - else - { + else { setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } @@ -232,8 +230,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') } } } - else - { + else { dol_print_error($db); } } @@ -247,8 +244,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $langs->load("errors"); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -306,8 +302,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac $object->timespent_datehour = dol_mktime(GETPOST($key."hour"), GETPOST($key."min"), 0, $monthofday, $dayofday, $yearofday); $object->timespent_withhour = 1; } - else - { + else { $object->timespent_datehour = dol_mktime(12, 0, 0, $monthofday, $dayofday, $yearofday); } $object->timespent_date = $object->timespent_datehour; @@ -316,8 +311,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac { $result = $object->addTimeSpent($user); } - else - { + else { setEventMessages("ErrorBadDate", null, 'errors'); $error++; break; @@ -340,8 +334,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac exit; } } - else - { + else { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); } } @@ -466,8 +459,7 @@ dol_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, 'task'); // Show description of content print '
'; if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; -else -{ +else { if (empty($usertoprocess->id) || $usertoprocess->id < 0) { if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; @@ -478,8 +470,7 @@ if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
'; } -else -{ +else { print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'
'; } print '
'; @@ -789,8 +780,7 @@ if (count($tasksarray) > 0)
'; } } -else -{ +else { print ''; } print "
'.$langs->trans("CreateSurveyDate").'
'.$langs->trans("NoAssignedTasks").'
"; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index ae4eed48515..b6466e4ad72 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -103,8 +103,7 @@ elseif ($search_usertoprocessid > 0) $usertoprocess->fetch($search_usertoprocessid); $search_usertoprocessid = $usertoprocess->id; } -else -{ +else { $usertoprocess = new User($db); } @@ -150,8 +149,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $result = $object->fetch($taskid, $ref); if ($result < 0) $error++; } - else - { + else { setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } @@ -189,8 +187,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') } } } - else - { + else { dol_print_error($db); } } @@ -204,8 +201,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $langs->load("errors"); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -226,8 +222,7 @@ if ($action == 'addtime' && $user->rights->projet->lire) { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); } - else - { + else { foreach ($timetoadd as $taskid => $value) // Loop on each task { $updateoftaskdone = 0; @@ -389,8 +384,7 @@ dol_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, 'task'); // Show description of content print '
'; if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; -else -{ +else { if (empty($usertoprocess->id) || $usertoprocess->id < 0) { if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; @@ -401,8 +395,7 @@ if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
'; } -else -{ +else { print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'
'; } print '
'; @@ -610,8 +603,7 @@ if (count($tasksarray) > 0) '; } } -else -{ +else { print ''.$langs->trans("NoAssignedTasks").''; } print ""; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 3a5ae388f9f..f2342d15787 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -111,8 +111,7 @@ elseif ($search_usertoprocessid > 0) $usertoprocess->fetch($search_usertoprocessid); $search_usertoprocessid = $usertoprocess->id; } -else -{ +else { $usertoprocess = new User($db); } @@ -206,8 +205,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $result = $object->fetch($taskid, $ref); if ($result < 0) $error++; } - else - { + else { setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } @@ -245,8 +243,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') } } } - else - { + else { dol_print_error($db); } } @@ -260,8 +257,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') $langs->load("errors"); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -282,8 +278,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); } - else - { + else { foreach ($timetoadd as $taskid => $value) // Loop on each task { $updateoftaskdone = 0; @@ -482,8 +477,7 @@ dol_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, 'task'); // Show description of content print '
'; if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; -else -{ +else { if (empty($usertoprocess->id) || $usertoprocess->id < 0) { if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; @@ -494,8 +488,7 @@ if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
'; } -else -{ +else { print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'
'; } print '
'; @@ -838,8 +831,7 @@ if (count($tasksarray) > 0) '; } } -else -{ +else { print ''.$langs->trans("NoAssignedTasks").''; } print ""; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index cfd10d2c1fa..77e96a9a616 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -64,8 +64,7 @@ if ($action == 'updateMask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -83,8 +82,7 @@ if ($action == 'updateMaskTask') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -121,14 +119,12 @@ elseif ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -166,14 +162,12 @@ elseif ($action == 'specimentask') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project_task&file=SPECIMEN.pdf"); return; } - else - { + else { setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } - else - { + else { setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } @@ -385,8 +379,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -405,8 +398,7 @@ foreach ($dirmodels as $reldir) { $htmltooltip .= $nextval.'
'; } - else - { + else { $htmltooltip .= $langs->trans($module->error).'
'; } } @@ -486,8 +478,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { print img_picto($langs->trans("Activated"), 'switch_on'); } - else - { + else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -506,8 +497,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { $htmltooltip .= $nextval.'
'; } - else - { + else { $htmltooltip .= $langs->trans($module->error).'
'; } } @@ -556,8 +546,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -625,8 +614,7 @@ foreach ($dirmodels as $reldir) print ''; print ""; } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -638,8 +626,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -664,8 +651,7 @@ foreach ($dirmodels as $reldir) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -713,8 +699,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) $i++; } } - else - { + else { dol_print_error($db); } @@ -782,8 +767,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''; print ""; } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -795,8 +779,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { print img_picto($langs->trans("Default"), 'on'); } - else - { + else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -821,8 +804,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { print ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -863,8 +845,7 @@ if (!$conf->use_javascript_ajax) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ""; } -else -{ +else { print ''; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c9007dc6d8a..54012b583f1 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -103,8 +103,7 @@ if (empty($reshook)) header("Location: index.php"); exit; } - else - { + else { dol_syslog($object->error, LOG_DEBUG); setEventMessages($langs->trans("CantRemoveProject", $langs->transnoentitiesnoconv("ProjectOverview")), null, 'errors'); } @@ -184,8 +183,7 @@ if (empty($reshook)) $error++; } } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans($object->error), null, 'errors'); $error++; @@ -213,21 +211,18 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location:card.php?id=".$object->id); exit; } } - else - { + else { $db->rollback(); $action = 'create'; } } - else - { + else { $action = 'create'; } } @@ -335,8 +330,7 @@ if (empty($reshook)) $db->rollback(); $action = 'edit'; } - else - { + else { $db->commit(); if (GETPOST('socid', 'int') > 0) $object->fetch_thirdparty(GETPOST('socid', 'int')); @@ -377,8 +371,7 @@ if (empty($reshook)) $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); - else - setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); $action = ''; } } @@ -421,8 +414,7 @@ if (empty($reshook)) header("Location: list.php?restore_lastsearch_values=1"); exit; } - else - { + else { dol_syslog($object->error, LOG_DEBUG); setEventMessages($object->error, $object->errors, 'errors'); } @@ -443,8 +435,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { // Load new object $newobject = new Project($db); $newobject->fetch($result); @@ -704,8 +695,7 @@ if ($action == 'create' && $user->rights->projet->creer) print '     '; print ''; } - else - { + else { print '     '; print ''; } @@ -985,8 +975,7 @@ elseif ($object->id > 0) print ''; } - else - { + else { dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); // Project card @@ -1240,8 +1229,7 @@ elseif ($object->id > 0) { print ''.$langs->trans("Modify").''; } - else - { + else { print ''.$langs->trans('Modify').''; } } @@ -1253,8 +1241,7 @@ elseif ($object->id > 0) { print ''.$langs->trans("Validate").''; } - else - { + else { print ''.$langs->trans('Validate').''; } } @@ -1266,8 +1253,7 @@ elseif ($object->id > 0) { print ''.$langs->trans("Close").''; } - else - { + else { print ''.$langs->trans('Close').''; } } @@ -1279,8 +1265,7 @@ elseif ($object->id > 0) { print ''.$langs->trans("ReOpen").''; } - else - { + else { print ''.$langs->trans('ReOpen').''; } } @@ -1347,8 +1332,7 @@ elseif ($object->id > 0) { print ''.$langs->trans('ToClone').''; } - else - { + else { print ''.$langs->trans('ToClone').''; } } @@ -1360,8 +1344,7 @@ elseif ($object->id > 0) { print ''.$langs->trans("Delete").''; } - else - { + else { print ''.$langs->trans('Delete').''; } } @@ -1419,8 +1402,7 @@ elseif ($object->id > 0) $parameters = array(); $reshook = $hookmanager->executeHooks('mainCardTabAddMore', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } -else -{ +else { print $langs->trans("RecordNotFound"); } diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index f8a076c89ee..77feddb91bd 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -453,8 +453,7 @@ class Projects extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->project->error); } } diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 65060f4d8ff..1a16d9ce199 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -451,8 +451,7 @@ class Tasks extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->task->error); } } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 03aac96db68..8337a625415 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -307,8 +307,7 @@ class Project extends CommonObject // End call triggers } } - else - { + else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); $error++; @@ -334,8 +333,7 @@ class Project extends CommonObject $this->db->commit(); return $ret; } - else - { + else { $this->db->rollback(); return -1; } @@ -442,14 +440,12 @@ class Project extends CommonObject $this->db->commit(); $result = 1; } - else - { + else { $this->db->rollback(); $result = -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; $this->db->rollback(); @@ -457,15 +453,13 @@ class Project extends CommonObject { $result = -4; } - else - { + else { $result = -2; } dol_syslog(get_class($this)."::update error ".$result." ".$this->error, LOG_ERR); } } - else - { + else { dol_syslog(get_class($this)."::update ref null"); $result = -1; } @@ -554,8 +548,7 @@ class Project extends CommonObject return 0; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -606,12 +599,11 @@ class Project extends CommonObject { $sql = 'SELECT l.rowid, l.fk_user_author as fk_user FROM '.MAIN_DB_PREFIX."loan as l WHERE l.entity IN (".getEntity('loan').") AND l.fk_projet IN (".$ids.")"; } - else - { + else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$ids.") AND entity IN (".getEntity($type).")"; } - if($dates > 0 && $type == 'loan'){ + if ($dates > 0 && $type == 'loan'){ $sql .= " AND (dateend > '".$this->db->idate($dates)."' OR dateend IS NULL)"; } elseif ($dates > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table @@ -621,7 +613,7 @@ class Project extends CommonObject $sql .= " AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)"; } - if($datee > 0 && $type == 'loan'){ + if ($datee > 0 && $type == 'loan'){ $sql .= " AND (datestart < '".$this->db->idate($datee)."' OR datestart IS NULL)"; } elseif ($datee > 0 && ($type != 'project_task')) // For table project_taks, we want the filter on date apply on project_time_spent table @@ -655,8 +647,7 @@ class Project extends CommonObject /* Return array even if empty*/ return $elements; } - else - { + else { dol_print_error($this->db); } } @@ -807,8 +798,7 @@ class Project extends CommonObject $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -901,16 +891,14 @@ class Project extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = join(',', $this->errors); dol_syslog(get_class($this)."::setValid ".$this->error, LOG_ERR); return -1; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -961,16 +949,14 @@ class Project extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = join(',', $this->errors); dol_syslog(get_class($this)."::setClose ".$this->error, LOG_ERR); return -1; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -1077,8 +1063,7 @@ class Project extends CommonObject { $url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id; } - else - { + else { $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; } // Add param to save lastsearch_values or not @@ -1199,8 +1184,7 @@ class Project extends CommonObject { $userAccess = 1; } - else - { + else { foreach (array('internal', 'external') as $source) { $userRole = $this->liste_contact(4, $source); @@ -1272,7 +1256,7 @@ class Project extends CommonObject $resql = $this->db->query($sql2); if ($resql) { - while($obj = $this->db->fetch_object($resql)) + while ($obj = $this->db->fetch_object($resql)) { $listofprojectcontacttype[$obj->rowid]=$obj->code; } @@ -1325,8 +1309,7 @@ class Project extends CommonObject return $result; } } - else - { + else { dol_print_error($this->db); } @@ -1434,8 +1417,7 @@ class Project extends CommonObject $clone_project->note_private = ''; $clone_project->note_public = ''; } - else - { + else { $this->db->begin(); $res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES), '_public'); if ($res < 0) @@ -1444,8 +1426,7 @@ class Project extends CommonObject $error++; $this->db->rollback(); } - else - { + else { $this->db->commit(); } @@ -1457,8 +1438,7 @@ class Project extends CommonObject $error++; $this->db->rollback(); } - else - { + else { $this->db->commit(); } } @@ -1482,8 +1462,7 @@ class Project extends CommonObject $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $error++; } - else - { + else { if ($clone_project->error != '') { $this->error .= $clone_project->error; @@ -1515,8 +1494,7 @@ class Project extends CommonObject } } } - else - { + else { $this->error .= $langs->trans('ErrorInternalErrorDetected').':dol_mkdir'; $error++; } @@ -1546,8 +1524,7 @@ class Project extends CommonObject $this->error .= $result_clone->error; $error++; } - else - { + else { $new_task_id = $result_clone; $taskstatic->fetch($tasktoclone->id); @@ -1586,8 +1563,7 @@ class Project extends CommonObject $this->db->commit(); return $clone_project_id; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR); return -1; @@ -1681,8 +1657,7 @@ class Project extends CommonObject $sql .= " SET fk_project=".$this->id; $sql .= " WHERE id=".$elementSelectId; } - else - { + else { $sql .= " SET fk_projet=".$this->id; $sql .= " WHERE rowid=".$elementSelectId; } @@ -1716,8 +1691,7 @@ class Project extends CommonObject { $sql .= " SET fk_project=NULL"; $sql .= " WHERE id=".$elementSelectId; - } else - { + } else { $sql .= " SET ".$projectfield."=NULL"; $sql .= " WHERE rowid=".$elementSelectId; } @@ -1809,8 +1783,7 @@ class Project extends CommonObject $this->weekWorkLoad[$day] = $obj->task_duration; $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration; } - else - { + else { $this->weekWorkLoad[$day] += $obj->task_duration; $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration; } @@ -1820,8 +1793,7 @@ class Project extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -1876,8 +1848,7 @@ class Project extends CommonObject $this->monthWorkLoad[$week_number] = $obj->task_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_task] = $obj->task_duration; } - else - { + else { $this->monthWorkLoad[$week_number] += $obj->task_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_task] += $obj->task_duration; } @@ -1887,8 +1858,7 @@ class Project extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -1958,8 +1928,7 @@ class Project extends CommonObject return $response; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2017,8 +1986,7 @@ class Project extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2085,8 +2053,7 @@ class Project extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 22868e96899..1452b0e919f 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -93,8 +93,7 @@ class ProjectStats extends Stats $row[0] ); } - else - $other += $row[1]; + else $other += $row[1]; $i++; } if ($num > $limit) @@ -282,8 +281,7 @@ class ProjectStats extends Stats $this->lastfetchdate[get_class($this).'_'.__FUNCTION__] = $filedate; } - else - { + else { dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it."); } } @@ -294,8 +292,7 @@ class ProjectStats extends Stats dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate."."); $data = json_decode(file_get_contents($newpathofdestfile), true); } - else - { + else { $year = $startyear; while ($year <= $endyear) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 41f6a76afb2..cc74e565385 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -226,8 +226,7 @@ class Task extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -329,8 +328,7 @@ class Task extends CommonObject return 0; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -440,8 +438,7 @@ class Task extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -544,8 +541,7 @@ class Task extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { //Delete associated link file if ($conf->projet->dir_output) { @@ -590,8 +586,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::hasChildren", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - else - { + else { $obj = $this->db->fetch_object($resql); if ($obj) $ret = $obj->nb; $this->db->free($resql); @@ -601,8 +596,7 @@ class Task extends CommonObject { return $ret; } - else - { + else { return -1; } } @@ -624,8 +618,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::hasTimeSpent", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - else - { + else { $obj = $this->db->fetch_object($resql); if ($obj) $ret = $obj->nb; $this->db->free($resql); @@ -635,8 +628,7 @@ class Task extends CommonObject { return $ret; } - else - { + else { return -1; } } @@ -817,8 +809,7 @@ class Task extends CommonObject $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec2"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2"; } - else - { + else { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid"; if ($includebilltime) { @@ -975,8 +966,7 @@ class Task extends CommonObject } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); } @@ -1055,8 +1045,7 @@ class Task extends CommonObject } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); } @@ -1080,7 +1069,7 @@ class Task extends CommonObject while ($i < $num) { if ($source == 'thirdparty') $contactAlreadySelected[$i] = $tab[$i]['socid']; - else $contactAlreadySelected[$i] = $tab[$i]['id']; + else $contactAlreadySelected[$i] = $tab[$i]['id']; $i++; } return $contactAlreadySelected; @@ -1148,8 +1137,7 @@ class Task extends CommonObject // End call triggers } } - else - { + else { $this->error = $this->db->lasterror(); $ret = -1; } @@ -1185,8 +1173,7 @@ class Task extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); } return $ret; @@ -1247,8 +1234,7 @@ class Task extends CommonObject $this->db->free($resql); } - else - { + else { dol_print_error($this->db); } return $result; @@ -1304,8 +1290,7 @@ class Task extends CommonObject $this->db->free($resql); return $result; } - else - { + else { dol_print_error($this->db); return $result; } @@ -1357,8 +1342,7 @@ class Task extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -1444,8 +1428,7 @@ class Task extends CommonObject $this->db->free($resql); } - else - { + else { dol_print_error($this->db); $this->error = "Error ".$this->db->lasterror(); return -1; @@ -1511,8 +1494,7 @@ class Task extends CommonObject } else $ret = 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); $ret = -1; @@ -1583,8 +1565,7 @@ class Task extends CommonObject { $result = 0; } - else - { + else { $this->error = $this->db->lasterror(); $result = -2; } @@ -1601,8 +1582,7 @@ class Task extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1715,8 +1695,7 @@ class Task extends CommonObject $clone_task->note_private = ''; $clone_task->note_public = ''; } - else - { + else { $this->db->begin(); $res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES), '_public'); if ($res < 0) @@ -1725,8 +1704,7 @@ class Task extends CommonObject $error++; $this->db->rollback(); } - else - { + else { $this->db->commit(); } @@ -1738,8 +1716,7 @@ class Task extends CommonObject $error++; $this->db->rollback(); } - else - { + else { $this->db->commit(); } } @@ -1759,8 +1736,7 @@ class Task extends CommonObject $projectstatic->fetch($project_id); $clone_project_ref = $projectstatic->ref; } - else - { + else { $clone_project_ref = $ori_project_ref; } @@ -1808,8 +1784,7 @@ class Task extends CommonObject $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $error++; } - else - { + else { if ($clone_task->error != '') { $this->error .= $clone_task->error; @@ -1834,8 +1809,7 @@ class Task extends CommonObject $this->db->commit(); return $clone_task_id; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::createFromClone nbError: ".$error." error : ".$this->error, LOG_ERR); return -1; @@ -2039,8 +2013,7 @@ class Task extends CommonObject return $response; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2088,8 +2061,7 @@ class Task extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index 12d6395af66..1ab6189674a 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.class.php @@ -83,8 +83,7 @@ class TaskStats extends Stats $row[0] ); } - else - $other += $row[1]; + else $other += $row[1]; $i++; } if ($num > $limit) diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index d16dca5ceb1..04e306f9dfb 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -123,8 +123,7 @@ print ''; // Visibility print ''; // Date start - end diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 93ced9392c4..fde1563eac2 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -74,15 +74,13 @@ if ($action == 'addcontact' && $user->rights->projet->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -95,8 +93,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } - else - { + else { dol_print_error($db); } } @@ -112,8 +109,7 @@ if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->pr header("Location: contact.php?id=".$object->id); exit; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 9b4c852100d..5b0409d7246 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -158,8 +158,7 @@ if ($object->id > 0) $permtoedit = ($userWrite > 0); include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { dol_print_error('', 'NoRecordFound'); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 23fa6551656..3907259e230 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -528,24 +528,24 @@ $listofreferent = array( // Change rules for benefit calculation if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) { - foreach($listofreferent as $key => $element) { + foreach ($listofreferent as $key => $element) { if ($listofreferent[$key]['margin'] == 'add') { unset($listofreferent[$key]['margin']); } } $newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN); - foreach($newelementforplusmargin as $value) { + foreach ($newelementforplusmargin as $value) { $listofreferent[$value]['margin']='add'; } } if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) { - foreach($listofreferent as $key => $element) { + foreach ($listofreferent as $key => $element) { if ($listofreferent[$key]['margin'] == 'add') { unset($listofreferent[$key]['margin']); } } $newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN); - foreach($newelementforplusmargin as $value) { + foreach ($newelementforplusmargin as $value) { $listofreferent[$value]['margin']='minus'; } } @@ -686,8 +686,7 @@ foreach ($listofreferent as $key => $value) $tmp = $element->getSumOfAmount($elementuser, $dates, $datee); $total_ht_by_line = price2num($tmp['amount'], 'MT'); } - else - { + else { $tmp = $element->getSumOfAmount('', $dates, $datee); $total_ht_by_line = price2num($tmp['amount'], 'MT'); } @@ -953,8 +952,7 @@ foreach ($listofreferent as $key => $value) { if (method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty(); } - else - { + else { $expensereport = new ExpenseReport($db); $expensereport->fetch($element->fk_expensereport); } @@ -1000,8 +998,7 @@ foreach ($listofreferent as $key => $value) { print $expensereport->getNomUrl(1); } - else - { + else { // Show ref with link if ($element instanceof Task) { @@ -1054,8 +1051,7 @@ foreach ($listofreferent as $key => $value) elseif ($tablename == 'supplier_proposal') $date = $element->date_validation; // There is no other date for this elseif ($tablename == 'fichinter') $date = $element->datev; // There is no other date for this elseif ($tablename == 'projet_task') $date = ''; // We show no date. Showing date of beginning of task make user think it is date of time consumed - else - { + else { $date = $element->date; // invoice, ... if (empty($date)) $date = $element->date_contrat; if (empty($date)) $date = $element->datev; @@ -1145,14 +1141,12 @@ foreach ($listofreferent as $key => $value) $warning = $langs->trans("WarningSomeLinesWithNullHourlyRate", $conf->currency); } } - else - { + else { $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); } } elseif ($key == 'loan') $total_ht_by_line = $element->capital; - else - { + else { $total_ht_by_line = $element->total_ht; } @@ -1193,14 +1187,12 @@ foreach ($listofreferent as $key => $value) $defaultvat = get_default_tva($mysoc, $mysoc); $total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT'); } - else - { + else { $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); } } elseif ($key == 'loan') $total_ttc_by_line = $element->capital - $element->getSumPayment(); - else - { + else { $total_ttc_by_line = $element->total_ttc; } @@ -1248,8 +1240,7 @@ foreach ($listofreferent as $key => $value) { print $element->getLibStatut(3); } - else - { + else { print $element->getLibStatut(5); } print ''; @@ -1324,8 +1315,7 @@ foreach ($listofreferent as $key => $value) print ''; print ''; } - else - { + else { if (!is_array($elementarray)) // error { print $elementarray; diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php index babacbd27bf..5f88db6344d 100644 --- a/htdocs/projet/ganttchart.inc.php +++ b/htdocs/projet/ganttchart.inc.php @@ -196,8 +196,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje { $parent = '-'.$project_id; } - else - { + else { $parent = $task["task_parent_alternate_id"]; //$parent = $task["task_parent"]; } @@ -209,8 +208,7 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje //$link=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]); $link = ''; } - else - { + else { $link = DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"]; } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 314f945e604..2cecf9c85ba 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -380,14 +380,12 @@ if (count($tasksarray) > 0) print ''; } - else - { + else { $langs->load("admin"); print $langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled"); } } -else -{ +else { print '
'.$langs->trans("NoTasks").'
'; } diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 8d0e7bb1e02..90f172f2fe2 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -99,8 +99,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) print "
"; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index f9cab81f43c..261b7529907 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -89,8 +89,7 @@ $morehtml .= 'rights->projet->all->lire) && !$socid) $tooltiphelp = $langs->trans("ProjectsDesc"); else $tooltiphelp = $langs->trans("ProjectsPublicDesc"); } @@ -328,8 +327,7 @@ if ($resql) print $companystatic->getNomUrl(1); } - else - { + else { print $langs->trans("OthersNotLinkedToThirdParty"); } print ''; @@ -354,8 +352,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } print "
'.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); -else - print $langs->trans('PrivateProject'); +else print $langs->trans('PrivateProject'); print '
 
"; diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 0058a5a94dd..772188ec261 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -53,8 +53,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 43d0e0b7f7f..98d9d49fd8e 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -234,8 +234,7 @@ if (empty($reshook)) setEventMessages($langs->trans("DontHaveTheValidateStatus", $objecttmp->ref), null, 'warnings'); } } - else - { + else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -248,8 +247,7 @@ if (empty($reshook)) else setEventMessages($langs->trans("RecordsClosed", $nbok), null, 'mesgs'); $db->commit(); } - else - { + else { $db->rollback(); } } @@ -459,8 +457,7 @@ print ''; // Show description of content $texthelp = ''; if ($search_project_user == $user->id) $texthelp .= $langs->trans("MyProjectsDesc"); -else -{ +else { if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("ProjectsDesc"); else $texthelp .= $langs->trans("ProjectsPublicDesc"); } @@ -753,8 +750,7 @@ while ($i < min($num, $limit)) { print $socstatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -795,8 +791,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } - else - { + else { print ' '; } print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index ebc6a7dc556..c70a9b042d5 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -274,16 +274,14 @@ if ($action == 'createtask' && $user->rights->projet->creer) { $result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal'); } - else - { + else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("projects"); setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings'); $duplicate_code_error = true; } - else - { + else { setEventMessages($task->error, $task->errors, 'errors'); } $action = 'create'; @@ -306,8 +304,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) $id = $projectid; } } - else - { + else { if (!empty($backtopage)) { header("Location: ".$backtopage); @@ -508,8 +505,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print $langs->trans("WarningProjectClosed"); print ''; } - else - { + else { print '
'; print ''; print ''; @@ -537,8 +533,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third { print (GETPOSTISSET("ref") ?GETPOST("ref", 'alpha') : $defaultref); } - else - { + else { print $defaultref; } print ''; @@ -559,8 +554,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third { print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); } - else - { + else { print $langs->trans("NoUserAssignedToTheProject"); } print ''; @@ -812,8 +806,7 @@ elseif ($id > 0 || !empty($ref)) $j = 0; $level = 0; $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields); } - else - { + else { $colspan = 10; if ($object->usage_bill_time) $colspan += 2; print ''.$langs->trans("NoTasks").''; @@ -837,8 +830,7 @@ elseif ($id > 0 || !empty($ref)) cleanCorruptedTree($db, 'projet_task', 'fk_task_parent'); } } - else - { + else { if ($nboftaskshown < count($tasksarray) && !GETPOST('search_user_id', 'int')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 82b4d8fdc10..905a6adedbf 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -75,8 +75,7 @@ if (!empty($project_ref) && !empty($withproject)) { $id = $objectsarray[0]->id; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); } } diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 415859127db..303ee19425a 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -69,8 +69,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) { dol_print_error($db, $projectstatic->error, $projectstatic->errors); } - else - { + else { $contactsofproject = $projectstatic->getListContactId('internal'); foreach ($contactsofproject as $key => $val) { @@ -78,8 +77,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) } } } - else - { + else { $result = $object->add_contact($idfortaskuser, GETPOST("type"), GETPOST("source")); } } @@ -89,15 +87,13 @@ if ($action == 'addcontact' && $user->rights->projet->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : '')); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -110,8 +106,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -127,8 +122,7 @@ if ($action == 'deleteline' && $user->rights->projet->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject ? '&withproject=1' : '')); exit; } - else - { + else { dol_print_error($db); } } @@ -143,8 +137,7 @@ if (!empty($project_ref) && !empty($withproject)) { $id = $tasksarray[0]->id; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); exit; } @@ -546,8 +539,7 @@ if ($id > 0 || !empty($ref)) } print ""; } - else - { + else { print "ErrorRecordNotFound"; } } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index bd4335f747f..80183db3d60 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -80,8 +80,7 @@ if (!empty($project_ref) && !empty($withproject)) $id = $tasksarray[0]->id; $object->fetch($id); } - else - { + else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); exit; } @@ -104,8 +103,7 @@ if ($id > 0 || !empty($ref)) $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } - else - { + else { dol_print_error($db); } } @@ -319,8 +317,7 @@ if ($object->id > 0) $relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { header('Location: index.php'); exit; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 0aefa412571..c25546bccbf 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -437,8 +437,7 @@ print ''; // Show description of content $texthelp = ''; if ($search_task_user == $user->id) $texthelp .= $langs->trans("MyTasksDesc"); -else -{ +else { if ($user->rights->projet->all->lire && !$socid) $texthelp .= $langs->trans("TasksOnProjectsDesc"); else $texthelp .= $langs->trans("TasksOnProjectsPublicDesc"); } @@ -754,8 +753,7 @@ while ($i < min($num, $limit)) $socstatic->name = $obj->name; print $socstatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -857,8 +855,7 @@ while ($i < min($num, $limit)) $totalarray['val']['t.tobill'] += $obj->tobill; $totalarray['totaltobill'] += $obj->tobill; } - else - { + else { print ''.$langs->trans("NA").''; } print ''; @@ -876,8 +873,7 @@ while ($i < min($num, $limit)) $totalarray['val']['t.billed'] += $obj->billed; $totalarray['totalbilled'] += $obj->billed; } - else - { + else { print ''.$langs->trans("NA").''; } print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 4967257570e..737346570f4 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -58,8 +58,7 @@ if ($id > 0 || !empty($ref)) $object->project = clone $projectstatic; } - else - { + else { dol_print_error($db); } } @@ -76,8 +75,7 @@ if (!empty($project_ref) && !empty($withproject)) $id = $tasksarray[0]->id; $object->fetch($id); } - else - { + else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); } } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index da15a73f66f..93f3ca3b01e 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -114,8 +114,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->projet->creer) } } } - else - { + else { $action = 'edit'; } } @@ -132,8 +131,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->s header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : '')); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -150,8 +148,7 @@ if (!empty($project_ref) && !empty($withproject)) { $id = $tasksarray[0]->id; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode) ? '' : '&mode='.$mode)); } } @@ -463,8 +460,7 @@ if ($id > 0 || !empty($ref)) print '
'; } - else - { + else { /* * Fiche tache en mode visu */ @@ -606,8 +602,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans('Modify').''; } - else - { + else { print ''.$langs->trans('Modify').''; } @@ -618,13 +613,11 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } - else - { + else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 78f5039fe8a..95c50b9b62d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -155,16 +155,14 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) { $object->fetch($id, $ref); } - else - { + else { if (!GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors'); $action = 'createtime'; $error++; } - else - { + else { $object->fetch(GETPOST('taskid', 'int')); } } @@ -179,8 +177,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) $action = 'createtime'; $error++; } - else - { + else { $object->timespent_note = $_POST["timespent_note"]; if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value $object->timespent_duration = $_POST["timespent_durationhour"] * 60 * 60; // We store duration in seconds @@ -190,8 +187,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); $object->timespent_withhour = 1; } - else - { + else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); } $object->timespent_fk_user = $_POST["userid"]; @@ -200,16 +196,14 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } } } } - else - { + else { if (empty($id)) $action = 'createtime'; else $action = 'createtime'; } @@ -245,8 +239,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel $object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_withhour = 1; } - else - { + else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); } $object->timespent_fk_user = $_POST["userid_line"]; @@ -255,14 +248,12 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } } - else - { + else { $object->fetch($id, $ref); // TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids)) @@ -276,8 +267,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel $object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); $object->timespent_withhour = 1; } - else - { + else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); } $object->timespent_fk_user = $_POST["userid_line"]; @@ -287,15 +277,13 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } } } - else - { + else { $action = ''; } } @@ -313,8 +301,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->l $error++; $action = ''; } - else - { + else { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } } @@ -329,8 +316,7 @@ if (!empty($project_ref) && !empty($withproject)) { $id = $tasksarray[0]->id; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); exit; } @@ -368,8 +354,7 @@ if ($action == 'confirm_generateinvoice') { setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); } - else - { + else { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -408,8 +393,7 @@ if ($action == 'confirm_generateinvoice') $localtax1 = $dataforprice['localtax1']; $localtax2 = $dataforprice['localtax2']; } - else - { + else { $pu_ht = 0; $txtva = get_default_tva($mysoc, $projectstatic->thirdparty); $localtax1 = get_default_localtax($mysoc, $projectstatic->thirdparty, 1); @@ -570,8 +554,7 @@ if ($action == 'confirm_generateinvoice') $db->commit(); } - else - { + else { $db->rollback(); } } @@ -760,14 +743,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime'.$param.'&backtopage='.urlencode($backtourl); } - else // We are on tab 'Time Spent' of task + else // We are on tab 'Time Spent' of task { $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($backtourl); } } - else - { + else { $linktocreatetimeBtnStatus = -2; $linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject"); } @@ -1070,8 +1052,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $num = $nbtotalofrecords; } - else - { + else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); @@ -1094,8 +1075,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $linktocreatetime, '', $limit); } - else - { + else { print ''."\n"; $title = $langs->trans("ListTaskTimeForTask"); @@ -1112,8 +1092,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -1172,8 +1151,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($projectstatic->public) $contactsofproject = array(); print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); } - else - { + else { if ($nboftasks) { print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); } @@ -1335,8 +1313,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0); } - else - { + else { print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day')); } print ''; @@ -1353,8 +1330,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $formproject->selectTasks(-1, GETPOST('taskid', 'int') ?GETPOST('taskid', 'int') : $task_time->fk_task, 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, ''); } - else - { + else { $tasktmp->id = $task_time->fk_task; $tasktmp->ref = $task_time->ref; $tasktmp->label = $task_time->label; @@ -1395,8 +1371,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } } - else - { + else { $userstatic->id = $task_time->fk_user; $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; @@ -1416,8 +1391,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; } - else - { + else { print dol_nl2br($task_time->note); } print ''; @@ -1437,8 +1411,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text'); } - else - { + else { print convertSecondToTime($task_time->task_duration, 'allhourmin'); } print ''; @@ -1479,13 +1452,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print $tmpinvoice->getNomUrl(1); } } - else - { + else { print $langs->trans("No"); } } - else - { + else { print ''.$langs->trans("NA").''; } } @@ -1569,8 +1540,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0); } - else - { + else { print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day')); } print ''; @@ -1619,8 +1589,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } } - else - { + else { $userstatic->id = $task_time->fk_user; $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; @@ -1639,8 +1608,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; } - else - { + else { print dol_nl2br($task_time->note); } print ''; @@ -1659,8 +1627,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text'); } - else - { + else { print convertSecondToTime($task_time->task_duration, 'allhourmin'); } print ''; @@ -1717,8 +1684,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 1, 1, 2, "timespent_date", 1, 0); } - else - { + else { print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day')); } print ''; @@ -1767,8 +1733,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); } } - else - { + else { $userstatic->id = $task_time->fk_user; $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; @@ -1787,8 +1752,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; } - else - { + else { print dol_nl2br($task_time->note); } print ''; @@ -1807,8 +1771,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print $form->select_duration('new_duration_2', 0, 0, 'text'); } - else - { + else { print convertSecondToTime($task_time->task_duration, 'allhourmin'); } print ''; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index a7eef6c2ede..ff8611ee0a4 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -189,8 +189,7 @@ if ($format == 'ical' || $format == 'vcal') //header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); exit; } - else - { + else { print 'Error '.$agenda->error; exit; @@ -227,8 +226,7 @@ if ($format == 'rss') // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); exit; } - else - { + else { print 'Error '.$agenda->error; exit; diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 1cfe1d4b0b3..13419207e07 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -91,8 +91,7 @@ if ($result < 0) dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); exit; } -else -{ +else { if (empty($user->id)) { echo " User login:".$userlogin." do not exists"; @@ -168,8 +167,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); exit(-1); } - else - { + else { if ($result == 0) { echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n"; @@ -207,8 +205,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) dol_syslog("cron_run_jobs.php::run_jobs Error".$cronjob->error, LOG_ERR); $nbofjobslaunchedko++; } - else - { + else { $nbofjobslaunchedok++; } @@ -226,8 +223,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) echo " - reprogrammed\n"; } - else - { + else { echo " - not qualified\n"; dol_syslog("cron_run_jobs.php job not qualified line->datenextrun:".dol_print_date($line->datenextrun, 'dayhourrfc')." line->datestart:".dol_print_date($line->datestart, 'dayhourrfc')." line->dateend:".dol_print_date($line->dateend, 'dayhourrfc')." now:".dol_print_date($now, 'dayhourrfc')); @@ -238,8 +234,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) echo "Result: ".($nbofjobs)." jobs - ".($nbofjobslaunchedok + $nbofjobslaunchedko)." launched = ".$nbofjobslaunchedok." OK + ".$nbofjobslaunchedko." KO"; } -else -{ +else { echo "Result: No active jobs found."; } diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index f0caf948770..7e4f1b1b0d7 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -144,8 +144,7 @@ foreach ($modulesdir as $dir) if ($modName) { - try - { + try { include_once $dir.$file; $objMod = new $modName($db); @@ -153,8 +152,7 @@ foreach ($modulesdir as $dir) { $j = $objMod->numero; } - else - { + else { $j = 1000 + $i; } @@ -381,8 +379,7 @@ foreach ($demoprofiles as $profilearray) print "\n".''; print ''; } - else - { + else { $modulo = ($j % $nbcolsmod); //if ($modulo == 0) print ''; print ''; @@ -435,8 +432,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIEN print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } } diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index c92108d7723..045f726fe1d 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -88,8 +88,7 @@ if ($resql) { print "".dolGetFirstLastname($objp->firstname, $objp->lastname)." ".$objp->societe."\n"; } - else - { + else { print "Anonyme Anonyme\n"; } print "".dol_print_date($db->jdate($objp->datedon))."\n"; @@ -99,13 +98,11 @@ if ($resql) } print ""; } - else - { + else { print "Aucun don publique"; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 7f788a84671..71e28c94da8 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -391,8 +391,7 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } @@ -408,8 +407,7 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } @@ -425,8 +423,7 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } @@ -442,14 +439,12 @@ if ($action == 'add') { $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$adh->ref, 2)); } - else - { + else { $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } } } - else - { + else { dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); exit; } @@ -458,8 +453,7 @@ if ($action == 'add') if (!empty($entity)) $urlback .= '&entity='.$entity; dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback); } - else - { + else { $error++; $errmsg .= join('
', $adh->errors); } @@ -472,8 +466,7 @@ if ($action == 'add') Header("Location: ".$urlback); exit; } - else - { + else { $db->rollback(); } } @@ -575,8 +568,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty); print ''."\n"; } -else -{ +else { $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); print ''; } @@ -589,8 +581,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print ''."\n"; } -else -{ +else { print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; print ''; } @@ -733,8 +724,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) { print ''; } - else - { + else { print ''; print ''; } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 04fe1f75fca..a955c9605f2 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -85,8 +85,7 @@ if ($id > 0) { print $langs->trans("ErrorThisMemberIsNotPublic"); } - else - { + else { print ''; print '\n"; diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 459926707b8..1a885ed3596 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -153,8 +153,7 @@ if ($result) print $form->showphoto('memberphoto', $objp, 64); print ''."\n"; } - else - { + else { print "\n"; } print ""; @@ -162,8 +161,7 @@ if ($result) } print "
'.$langs->trans("Type").''.$object->type."
 
"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index 626aba2cd32..b3b362fa6b2 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.php @@ -39,8 +39,7 @@ if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml' print 'Sorry, it seems your internet connexion is off.
'; print 'You need to be connected to network to use this software.
'; } -else -{ +else { $langs->load("error"); $langs->load("other"); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 2378728a8d3..20b029f960d 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -236,8 +236,7 @@ if ($source == 'proposal') $mesg = $proposal->error; $error++; } - else - { + else { $result = $proposal->fetch_thirdparty($proposal->socid); } @@ -277,13 +276,11 @@ if ($action != 'dosign') if ($found && !$error) // We are in a management option and no error { } - else - { + else { dol_print_error_email('ERRORNEWONLINESIGN'); } } -else -{ +else { // Print } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index d0ce716bb7d..f26d31c483d 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -133,8 +133,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout setEventMessages($langs->trans("VoteNameAlreadyExists"), null, 'errors'); $error++; } - else - { + else { $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses)'; $sql .= " VALUES ('".$db->escape($nom)."', '".$db->escape($numsondage)."','".$db->escape($nouveauchoix)."')"; $resql = $db->query($sql); @@ -173,8 +172,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout else dol_print_error($db); } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } } @@ -392,8 +390,7 @@ if ($object->format == "D") print ''."\n"; } } -else -{ +else { //display of survey topics print ''."\n"; print ''."\n"; @@ -481,8 +478,7 @@ while ($compteur < $num) } } } - else - { + else { //sinon on remplace les choix de l'utilisateur par une ligne de checkbox pour recuperer de nouvelles valeurs if ($compteur == $ligneamodifier) { @@ -509,8 +505,7 @@ while ($compteur < $num) print ''."\n"; } } - else - { + else { for ($i = 0; $i < $nbcolonnes; $i++) { $car = substr($ensemblereponses, $i, 1); @@ -695,8 +690,7 @@ if ($object->allow_spy) { $meilleursujet .= dol_print_date($toutsujet[$i], 'daytext').' ('.dol_print_date($toutsujet[$i], '%A').')'; } } - else - { + else { $tmps = explode('@', $toutsujet[$i]); $meilleursujet .= dol_htmlentities($tmps[0]); } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index ea7fd71c9e6..b82dcc3360b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -211,8 +211,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } - else - { + else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } if ($SECUREKEY != $token) @@ -371,8 +370,7 @@ if ($action == 'dopayment') if ($paymentmethod == 'stripe') { if (GETPOST('newamount', 'alpha')) $amount = price2num(GETPOST('newamount', 'alpha'), 'MT'); - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $action = ''; } @@ -469,8 +467,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) setEventMessages('Failed to create card record', null, 'errors'); $action = ''; } - else - { + else { if (!empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; if (!empty($dol_id)) $metadata["dol_id"] = $dol_id; if (!empty($dol_type)) $metadata["dol_type"] = $dol_type; @@ -497,8 +494,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) } } } - else - { + else { $vatcleaned = $vatnumber ? $vatnumber : null; /*$taxinfo = array('type'=>'vat'); @@ -670,8 +666,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) setEventMessages($paymentintent->status, null, 'errors'); $action = ''; } - else - { + else { // TODO We can alse record the payment mode into llx_societe_rib with stripe $paymentintent->payment_method // Note that with other old Stripe architecture (using Charge API), the payment mode was not recorded, so it is not mandatory to do it here. //dol_syslog("Create payment_method for ".$paymentintent->payment_method, LOG_DEBUG, 0, '_stripe'); @@ -701,8 +696,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) header("Location: ".$urlko); exit; } - else - { + else { header("Location: ".$urlok); exit; } @@ -914,8 +908,7 @@ if ($source == 'order') $mesg = $order->error; $error++; } - else - { + else { $result = $order->fetch_thirdparty($order->socid); } $object = $order; @@ -1009,8 +1002,7 @@ if ($source == 'order') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($order->thirdparty)) print ''."\n"; @@ -1037,8 +1029,7 @@ if ($source == 'invoice') $mesg = $invoice->error; $error++; } - else - { + else { $result = $invoice->fetch_thirdparty($invoice->socid); } $object = $invoice; @@ -1103,8 +1094,7 @@ if ($source == 'invoice') print ''; } } - else - { + else { print ''.price($object->total_ttc, 1, $langs).''; } // Currency @@ -1139,8 +1129,7 @@ if ($source == 'invoice') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($invoice->thirdparty)) print ''."\n"; @@ -1168,8 +1157,7 @@ if ($source == 'contractline') $mesg = $contractline->error; $error++; } - else - { + else { if ($contractline->fk_contrat > 0) { $result = $contract->fetch($contractline->fk_contrat); @@ -1177,14 +1165,12 @@ if ($source == 'contractline') { $result = $contract->fetch_thirdparty($contract->socid); } - else - { + else { $mesg = $contract->error; $error++; } } - else - { + else { $mesg = 'ErrorRecordNotFound'; $error++; } @@ -1207,8 +1193,7 @@ if ($source == 'contractline') $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; $price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level]; } - else - { + else { $pu_ht = $product->price; $pu_ttc = $product->price_ttc; $price_base_type = $product->price_base_type; @@ -1294,8 +1279,7 @@ if ($source == 'contractline') { $dur = array("h"=>$langs->trans("Hours"), "d"=>$langs->trans("DurationDays"), "w"=>$langs->trans("DurationWeeks"), "m"=>$langs->trans("DurationMonths"), "y"=>$langs->trans("DurationYears")); } - else - { + else { $dur = array("h"=>$langs->trans("Hour"), "d"=>$langs->trans("DurationDay"), "w"=>$langs->trans("DurationWeek"), "m"=>$langs->trans("DurationMonth"), "y"=>$langs->trans("DurationYear")); } $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; @@ -1352,8 +1336,7 @@ if ($source == 'contractline') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($contract->thirdparty)) print ''."\n"; @@ -1380,8 +1363,7 @@ if ($source == 'membersubscription') $mesg = $member->error; $error++; } - else - { + else { $member->fetch_thirdparty(); $subscription = new Subscription($db); } @@ -1523,8 +1505,7 @@ if ($source == 'membersubscription') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($member->thirdparty)) print ''."\n"; @@ -1549,8 +1530,7 @@ if ($source == 'donation') $mesg = $don->error; $error++; } - else - { + else { $don->fetch_thirdparty(); } $object = $don; @@ -1668,8 +1648,7 @@ if ($source == 'donation') print ''."\n"; print ''."\n"; } - else - { + else { print ''."\n"; } if (is_object($don->thirdparty)) print ''."\n"; @@ -1705,8 +1684,7 @@ if ($action != 'dopayment') { print '

'.$langs->trans("DonationPaid").''; } - else - { + else { // Membership can be paid and we still allow to make renewal if ($source == 'membersubscription' && $object->datefin > dol_now()) { @@ -1796,13 +1774,11 @@ if ($action != 'dopayment') } } } - else - { + else { dol_print_error_email('ERRORNEWPAYMENT'); } } -else -{ +else { // Print } @@ -1940,8 +1916,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { print '
'.$langs->trans("Error").'
'; } - else - { + else { print ''; //$_SESSION["paymentintent_id"] = $paymentintent->id; } @@ -1956,8 +1931,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment $langs->load("errors"); print info_admin($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Stripe")), 0, 0, 'error'); } - else - { + else { print ''; print ''."\n"; print ''."\n"; @@ -2173,7 +2147,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment // Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off @@ -2241,7 +2215,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment }); /* Use 3DS source */ diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index a3f6d733fcb..a261c6101a0 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -78,8 +78,7 @@ if (empty($paymentmethod)) dol_print_error(null, 'The back url does not contains a parameter fulltag that should help us to find the payment method used'); exit; } -else -{ +else { dol_syslog("paymentmethod=".$paymentmethod); } @@ -187,8 +186,7 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } - else - { + else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index b1d6c149a51..a1d562b8690 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -222,8 +222,7 @@ if (!empty($conf->paypal->enabled)) // Nothing to do dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment'); } - else - { + else { dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment'); } @@ -251,8 +250,7 @@ if (!empty($conf->paypal->enabled)) $ispaymentok = true; } - else - { + else { dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING, 0, '_payment'); //Display a user friendly Error on the page using any of the following error information returned by PayPal @@ -262,13 +260,11 @@ if (!empty($conf->paypal->enabled)) $ErrorSeverityCode = urldecode($resArray2["L_SEVERITYCODE0"]); } } - else - { + else { dol_print_error('', 'Session expired'); } } - else - { + else { dol_print_error('', '$PAYPALTOKEN not defined'); } } @@ -420,8 +416,7 @@ if ($ispaymentok) $postactionmessages[] = $errmsg; $ispostactionok = -1; } - else - { + else { $postactionmessages[] = 'Subscription created'; $ispostactionok = 1; } @@ -443,8 +438,7 @@ if ($ispaymentok) $postactionmessages = array_merge($postactionmessages, $object->errors); $ispostactionok = -1; } - else - { + else { if ($option == 'bankviainvoice') { $postactionmessages[] = 'Invoice, payment and bank record created'; @@ -523,8 +517,7 @@ if ($ispaymentok) { $db->commit(); } - else - { + else { $db->rollback(); } @@ -590,8 +583,7 @@ if ($ispaymentok) $postactionmessages[] = $errmsg; $ispostactionok = -1; } - else - { + else { if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; else $postactionmessages[] = 'Email sent to member (without any attached document)'; @@ -600,14 +592,12 @@ if ($ispaymentok) } } } - else - { + else { $postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'].'. May be payment was already recorded.'; $ispostactionok = -1; } } - else - { + else { $postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found'; $ispostactionok = -1; } @@ -648,8 +638,7 @@ if ($ispaymentok) { $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id } - else - { + else { $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; @@ -672,8 +661,7 @@ if ($ispaymentok) $ispostactionok = -1; $error++; } - else - { + else { $postactionmessages[] = 'Payment created'; $ispostactionok = 1; } @@ -697,14 +685,12 @@ if ($ispaymentok) $ispostactionok = -1; $error++; } - else - { + else { $postactionmessages[] = 'Bank transaction of payment created'; $ispostactionok = 1; } } - else - { + else { $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; $ispostactionok = -1; $error++; @@ -715,25 +701,21 @@ if ($ispaymentok) { $db->commit(); } - else - { + else { $db->rollback(); } } - else - { + else { $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'].'. May be payment was already recorded.'; $ispostactionok = -1; } } - else - { + else { $postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found'; $ispostactionok = -1; } } - else - { + else { // Nothing done } } @@ -811,8 +793,7 @@ if ($ispaymentok) //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."
\n"; $content .= $companylangs->trans("Link").': '.$url.''."
\n"; } - else - { + else { $content .= $companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."
\n"; } $content .= $companylangs->transnoentities("PostActionAfterPayment").' : '; @@ -825,8 +806,7 @@ if ($ispaymentok) { $content .= $companylangs->transnoentitiesnoconv("None"); } - else - { + else { $topic .= ($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')'); $content .= ''.$companylangs->transnoentitiesnoconv("Error").''; } @@ -865,15 +845,13 @@ if ($ispaymentok) dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); //dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0); } - else - { + else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); //dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0); } } } -else -{ +else { // Get on url call $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; $payerID = empty($PAYPALPAYERID) ? $_SESSION['payerID'] : $PAYPALPAYERID; @@ -952,8 +930,7 @@ else { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } - else - { + else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } diff --git a/htdocs/public/stripe/confirm_payment.php b/htdocs/public/stripe/confirm_payment.php index 9a45a2cbeec..9c6346842c8 100644 --- a/htdocs/public/stripe/confirm_payment.php +++ b/htdocs/public/stripe/confirm_payment.php @@ -49,8 +49,7 @@ if (isset($_GET['connect'])) $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -63,8 +62,7 @@ else { $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; $servicestatus = 1; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 4291cb6f834..e3cc21b327b 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -49,8 +49,7 @@ if (isset($_GET['connect'])) $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -63,8 +62,7 @@ else { $service = 'StripeTest'; $servicestatus = 0; } - else - { + else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; $servicestatus = 1; @@ -189,8 +187,7 @@ if ($event->type == 'payout.created') { http_response_code(200); // PHP 5.4 or greater return 1; } - else - { + else { $error++; http_response_code(500); // PHP 5.4 or greater return -1; @@ -270,8 +267,7 @@ elseif ($event->type == 'payout.paid') { http_response_code(200); // PHP 5.4 or greater return 1; } - else - { + else { $error++; http_response_code(500); // PHP 5.4 or greater return -1; @@ -344,8 +340,7 @@ elseif ($event->type == 'payment_method.attached') { { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -381,8 +376,7 @@ elseif ($event->type == 'payment_method.updated') { { $db->commit(); } - else - { + else { $db->rollback(); } } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index c326b4a6bd2..cbe88b006d4 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -46,8 +46,7 @@ if (empty($usedolheader)) trans('TicketMessagesList'), '', 'object_conversation'); $object->viewTicketMessages(false, true, $object->dao); } - else - { + else { print ''; } } else { diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php index 95f2efa492a..2f18de010a0 100644 --- a/htdocs/public/website/index.php +++ b/htdocs/public/website/index.php @@ -106,8 +106,7 @@ if (empty($pageid)) } } } - else - { + else { if ($object->fk_default_home > 0) { $result = $objectpage->fetch($object->fk_default_home); @@ -165,8 +164,7 @@ if ($pageid == 'css') // No more used ? header('Cache-Control: no-cache'); $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/styles.css.php'; } -else -{ +else { $original_file = $dolibarr_main_data_root.'/website/'.$websitekey.'/page'.$pageid.'.tpl.php'; } diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php index ce416bdd7b6..24125178f5d 100644 --- a/htdocs/public/website/styles.css.php +++ b/htdocs/public/website/styles.css.php @@ -78,8 +78,7 @@ if (empty($pageid)) $object->fetch($websiteid); $website = $object->ref; } - else - { + else { $object->fetch(0, $website); } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3d8547f9322..2ada4b1c447 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -233,8 +233,7 @@ if (empty($reshook)) if ($object->origin == "supplierorder") $classname = 'CommandeFournisseur'; - else - $classname = ucfirst($object->origin); + else $classname = ucfirst($object->origin); $objectsrc = new $classname($db); $objectsrc->fetch($object->origin_id); @@ -354,8 +353,7 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToReceive").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; } @@ -366,8 +364,7 @@ if (empty($reshook)) header("Location: card.php?id=".$object->id); exit; } - else - { + else { $db->rollback(); $_GET["commande_id"] = GETPOST('commande_id', 'int'); $action = 'create'; @@ -388,8 +385,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans($object->error), null, 'errors'); } - else - { + else { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -418,8 +414,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/reception/index.php'); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -567,8 +562,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit(); } - else - { + else { setEventMessages($line->error, $line->errors, 'errors'); } } @@ -667,8 +661,7 @@ if (empty($reshook)) $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1049,8 +1042,7 @@ if ($action == 'create') print ''; } - else - { + else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1089,8 +1081,7 @@ if ($action == 'create') { $quantityToBeDelivered = 0; } - else - { + else { $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; } $warehouse_id = $dispatchLines[$indiceAsked]['ent']; @@ -1131,8 +1122,7 @@ if ($action == 'create') print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0, 0, $line->fk_product, '', 1); } } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1195,8 +1185,7 @@ if ($action == 'create') print '
'; } - else - { + else { dol_print_error($db); } } @@ -1247,8 +1236,7 @@ elseif ($id || $ref) { $numref = $object->getNextNumRef($soc); } - else - { + else { $numref = $object->ref; } @@ -1413,8 +1401,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -1437,8 +1424,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -1472,8 +1458,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueHeight; print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; } @@ -1551,8 +1536,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey @@ -1585,8 +1569,7 @@ elseif ($id || $ref) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -1640,8 +1623,7 @@ elseif ($id || $ref) { print $langs->trans("QtyToReceive").' - '; } - else - { + else { print $langs->trans("QtyReceived").' - '; } if (!empty($conf->stock->enabled)) @@ -1654,14 +1636,12 @@ elseif ($id || $ref) } print ''; } - else - { + else { if ($object->statut <= 1) { print ''.$langs->trans("QtyToReceive").''; } - else - { + else { print ''.$langs->trans("QtyReceived").''; } if (!empty($conf->stock->enabled)) @@ -1769,8 +1749,7 @@ elseif ($id || $ref) $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->label; } - else - $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label); + else $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label); print ''; @@ -1785,8 +1764,7 @@ elseif ($id || $ref) } print "\n"; } - else - { + else { print ""; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1806,8 +1784,7 @@ elseif ($id || $ref) { print ''; } - else - { + else { print ''.$lines[$i]->comment.''; } @@ -1873,8 +1850,7 @@ elseif ($id || $ref) } print ''; } - else - { + else { print ''; print ''; // Qty to receive or received @@ -1888,8 +1864,7 @@ elseif ($id || $ref) } print ''; } - else - { + else { // Qty to receive or received print ''.$lines[$i]->qty.''; @@ -1926,8 +1901,7 @@ elseif ($id || $ref) print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); } - else - { + else { print $langs->trans("NA"); } print ''; @@ -1988,8 +1962,7 @@ elseif ($id || $ref) { print $line->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); } - else - { + else { print $line->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); } } @@ -2027,8 +2000,7 @@ elseif ($id || $ref) { print ''.$langs->trans("Validate").''; } - else - { + else { print ''.$langs->trans("Validate").''; } } @@ -2045,8 +2017,7 @@ elseif ($id || $ref) { print ''.$langs->trans("ClassifyUnbilled").''; } - else - { + else { print ''.$langs->trans("ReOpen").''; } } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index a95d6217c1c..111846347be 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -179,14 +179,12 @@ class Reception extends CommonObject { return $numref; } - else - { + else { dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error); return ""; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_RECEPTION_ADDON_NUMBER_NotDefined"); return ""; } @@ -325,8 +323,7 @@ class Reception extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -336,16 +333,14 @@ class Reception extends CommonObject return -1 * $error; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $error++; $this->error = $this->db->error()." - sql=$sql"; $this->db->rollback(); @@ -473,15 +468,13 @@ class Reception extends CommonObject return 1; } - else - { + else { dol_syslog(get_class($this).'::Fetch no reception found', LOG_ERR); $this->error = 'Delivery with id '.$id.' not found'; return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -602,8 +595,7 @@ class Reception extends CommonObject break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. @@ -618,8 +610,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; @@ -694,8 +685,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR); @@ -867,8 +857,7 @@ class Reception extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -922,8 +911,7 @@ class Reception extends CommonObject $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed } } - else - { + else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -1000,35 +988,30 @@ class Reception extends CommonObject return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } } - else - { + else { $this->db->rollback(); return -1; } @@ -1274,14 +1257,12 @@ class Reception extends CommonObject $this->date_delivery = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } @@ -1365,8 +1346,7 @@ class Reception extends CommonObject $sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')"; $resql = $this->db->query($sql); } - else - { + else { $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql .= " code='".$this->db->escape($this->update['code'])."'"; $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'"; @@ -1442,8 +1422,7 @@ class Reception extends CommonObject $url = str_replace('{TRACKID}', $value, $tracking); $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); } - else - { + else { $this->tracking_url = $value; } } @@ -1545,8 +1524,7 @@ class Reception extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1560,8 +1538,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1576,8 +1553,7 @@ class Reception extends CommonObject } } } - else - { + else { dol_print_error($this->db); $error++; } @@ -1587,8 +1563,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1633,8 +1608,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1710,8 +1684,7 @@ class Reception extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1724,8 +1697,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1755,8 +1727,7 @@ class Reception extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1846,8 +1817,7 @@ class Reception extends CommonObject break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -1860,8 +1830,7 @@ class Reception extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -1912,8 +1881,7 @@ class Reception extends CommonObject return -1; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index b2d30bf7c7f..b5e526bb1b3 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -91,8 +91,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index c6cfcd5264c..c753cf3e873 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -279,15 +279,13 @@ if (empty($reshook)) $result = $object->insert_discount($discountid); //$result=$discount->link_to_invoice($lineid,$id); } - else - { + else { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; break; } } - else - { + else { // Positive line $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Date start @@ -335,8 +333,7 @@ if (empty($reshook)) { $lineid = $result; } - else - { + else { $lineid = 0; $error++; break; @@ -391,8 +388,7 @@ if (empty($reshook)) $db->commit(); setEventMessage($langs->trans('BillCreated', $nb_bills_created)); } - else - { + else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -585,8 +581,7 @@ if ($resql) print $form->selectyesno('validate_invoices', 0, 1, 1); print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; } - else - { + else { print $form->selectyesno('validate_invoices', 0, 1); } print ''; @@ -937,8 +932,7 @@ if ($resql) print ''; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index e7e8ef7e090..4a0bcb4fd04 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -78,8 +78,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/receptionsnbinyear-'.$year.'.png'; } diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 1035d17d5f9..fa99e4610d5 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -49,8 +49,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index b403c0516f9..9f2a044525d 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -100,8 +100,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $action = 'create'; } - else - { + else { $object->ref = $ref; $object->description = $description; $object->fk_code_type_resource = $fk_code_type_resource; @@ -119,16 +118,14 @@ if (empty($reshook)) Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { // Creation KO setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } } } - else - { + else { Header("Location: list.php"); exit; } @@ -166,14 +163,12 @@ if (empty($reshook)) Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } @@ -198,13 +193,11 @@ if (empty($reshook)) Header('Location: '.DOL_URL_ROOT.'/resource/list.php'); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -228,8 +221,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) print load_fiche_titre($title, '', 'object_resource'); dol_fiche_head(''); } - else - { + else { $head = resource_prepare_head($object); dol_fiche_head($head, 'resource', $title, -1, 'resource'); } @@ -292,8 +284,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) print ''; } - else - { + else { $formconfirm = ''; // Confirm deleting resource line diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 1b4223e1fff..41c0db7ec15 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -165,8 +165,7 @@ class Dolresource extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -224,8 +223,7 @@ class Dolresource extends CommonObject return $this->id; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; @@ -330,8 +328,7 @@ class Dolresource extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -389,8 +386,7 @@ class Dolresource extends CommonObject return $this->id; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -428,8 +424,7 @@ class Dolresource extends CommonObject $error++; } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -476,8 +471,7 @@ class Dolresource extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -568,8 +562,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -646,8 +639,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -725,8 +717,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -817,8 +808,7 @@ class Dolresource extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -925,8 +915,7 @@ class Dolresource extends CommonObject } return $num; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 4836ed1a0f1..3eeebeaee45 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -127,8 +127,7 @@ class FormResource { $out .= ''; } - else - { + else { $out .= ''; } @@ -147,8 +146,7 @@ class FormResource $out .= ''; } } - else - { + else { dol_print_error($this->db); } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index cbc94c2e843..dc916aa5f77 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -63,8 +63,7 @@ if ($action == 'addcontact' && $user->rights->resource->write) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index d0d4e2300d8..0e6b20923b5 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -137,8 +137,7 @@ if ($object->id > 0) include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 1ce3957071a..8e353b59788 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -98,8 +98,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Resource")), null, 'errors'); $action = ''; } - else - { + else { $objstat = fetchObjectByElement($element_id, $element, $element_ref); $objstat->element = $element; // For externals module, we need to keep @xx @@ -266,8 +265,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -298,8 +296,7 @@ if ($ret == -1) { if (!$ret) { print '
'.$langs->trans('NoResourceInDatabase').'
'; } -else -{ +else { // Confirmation suppression resource line if ($action == 'delete_resource') { @@ -412,8 +409,7 @@ else } $_SESSION['assignedtouser'] = json_encode($listofuserid); } - else - { + else { if (!empty($_SESSION['assignedtouser'])) { $listofuserid = json_decode($_SESSION['assignedtouser'], true); @@ -601,8 +597,7 @@ else { $tpl = dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_add.tpl.php'); } - else - { + else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/resource_add.tpl.php'; } if (empty($conf->file->strict_mode)) { @@ -621,8 +616,7 @@ else { $tpl = dol_buildpath($reldir.'/resource_'.$element_prop['element'].'_view.tpl.php'); } - else - { + else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/resource_view.tpl.php'; } if (empty($conf->file->strict_mode)) { diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 033d49ae8c8..4f94c6c3e17 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -282,8 +282,7 @@ if ($ret) print ''; } } -else -{ +else { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } print ''.$langs->trans("NoRecordFound").''; diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index 29e3c325ee0..b1f1f627a99 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -63,8 +63,7 @@ if ($action == 'update') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -115,8 +114,7 @@ foreach ($list as $key) { print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); } - else - { + else { print ''; } print ''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ade8924b0d0..d7b71edbf0b 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -159,8 +159,7 @@ if ($action == 'add' && empty($cancel)) exit; } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -194,21 +193,18 @@ if ($action == 'delete') header("Location: ".DOL_URL_ROOT.'/salaries/list.php'); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); } } @@ -494,13 +490,11 @@ if ($id) { print ''; } - else - { + else { print ''; } } - else - { + else { print ''; } print ""; diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 82cdf3c80ce..9fddd59ce51 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -183,8 +183,7 @@ class PaymentSalary extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -264,8 +263,7 @@ class PaymentSalary extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -481,8 +479,7 @@ class PaymentSalary extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $error++; } @@ -532,14 +529,12 @@ class PaymentSalary extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -563,8 +558,7 @@ class PaymentSalary extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -676,8 +670,7 @@ class PaymentSalary extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index ff709816d18..0e6a1bccba0 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -129,8 +129,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index fd6e7a3ec95..b06ad2348e4 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -68,8 +68,7 @@ if (!GETPOST('typeid', 'int')) if ($part[0] == 's.fk_typepayment') $typeid = $part[1]; } } -else -{ +else { $typeid = GETPOST('typeid', 'int'); } @@ -318,8 +317,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index fb6663be951..307b903787e 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -54,8 +54,7 @@ if ($action == 'setcodeclient') header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -67,8 +66,7 @@ if ($action == 'setcodecompta') header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -84,8 +82,7 @@ if ($action == 'updateoptions') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -99,8 +96,7 @@ if ($action == 'updateoptions') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -114,8 +110,7 @@ if ($action == 'updateoptions') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -178,8 +173,7 @@ if ($action == 'setdoc') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -193,8 +187,7 @@ if ($action == "setaddrefinlist") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -208,8 +201,7 @@ if ($action == "setaddadressinlist") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -223,8 +215,7 @@ if ($action == "setaskforshippingmet") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -238,8 +229,7 @@ if ($action == "setdisableprospectcustomer") { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -255,8 +245,7 @@ if ($action == 'setprofid') //header("Location: ".$_SERVER["PHP_SELF"]); //exit; } - else - { + else { dol_print_error($db); } } @@ -272,8 +261,7 @@ if ($action == 'setprofidmandatory') //header("Location: ".$_SERVER["PHP_SELF"]); //exit; } - else - { + else { dol_print_error($db); } } @@ -289,8 +277,7 @@ if ($action == 'setprofidinvoicemandatory') //header("Location: ".$_SERVER["PHP_SELF"]); //exit; } - else - { + else { dol_print_error($db); } } @@ -305,8 +292,7 @@ if ($action == 'sethideinactivethirdparty') header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -318,8 +304,7 @@ if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -412,8 +397,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) print img_picto($langs->trans("Activated"), 'switch_on'); print "\n"; } - else - { + else { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print ''; if (!$disabled) print ''; @@ -498,8 +482,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -538,8 +521,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -608,16 +590,14 @@ foreach ($dirsociete as $dirroot) //} print ""; } - else - { + else { if (versioncompare($module->phpmin, versionphparray()) > 0) { print "\n"; print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", join('.', $module->phpmin))), 'switch_off'); print ""; } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -644,8 +624,7 @@ foreach ($dirsociete as $dirroot) { $linkspec = ''.img_object($langs->trans("Preview"), 'bill').''; } - else - { + else { $linkspec = img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print $linkspec; @@ -715,8 +694,7 @@ foreach ($profid as $key => $val) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -728,8 +706,7 @@ foreach ($profid as $key => $val) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -741,8 +718,7 @@ foreach ($profid as $key => $val) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } - else - { + else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; @@ -784,8 +760,7 @@ if (!$conf->use_javascript_ajax) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ""; } -else -{ +else { print ''; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', @@ -808,8 +783,7 @@ if (!$conf->use_javascript_ajax) print $langs->trans("NotAvailableWhenAjaxDisabled"); print ""; } -else -{ +else { print ''; $arrval = array('0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', @@ -834,8 +808,7 @@ if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -851,8 +824,7 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -870,8 +842,7 @@ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } @@ -888,8 +859,7 @@ if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } -else -{ +else { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index dba483c52eb..4142231261d 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -39,8 +39,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 4fe737ca31c..1622b81384d 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -68,8 +68,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) echo json_encode($outjson); } -else -{ +else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $langs->load("companies"); diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index dcf0b1a4483..0558d7d31c8 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -72,8 +72,7 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) $sql .= " OR code_client LIKE '".$db->escape($socid)."%'"; $sql .= " OR code_fournisseur LIKE '".$db->escape($socid)."%'"; } - else - { + else { $sql .= "nom LIKE '%".$db->escape($socid)."%'"; $sql .= " OR code_client LIKE '%".$db->escape($socid)."%'"; $sql .= " OR code_fournisseur LIKE '%".$db->escape($socid)."%'"; @@ -101,12 +100,10 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) echo json_encode($return_arr); } - else - { + else { echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); } } -else -{ +else { echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 70ac0577cb9..0cd103a2855 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -259,8 +259,7 @@ abstract class ActionsCardCommon } } } - else - { + else { $head = societe_prepare_head($this->object); $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company'); @@ -335,8 +334,7 @@ abstract class ActionsCardCommon $adh->ref = $adh->getFullName($langs); $this->tpl['linked_member'] = $adh->getNomUrl(1); } - else - { + else { $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember"); } } diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 0601760e34a..348163195d9 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -135,18 +135,15 @@ class ActionsCardCompany extends ActionsCardCommon $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } - else - { + else { $this->tpl['tva_intra'] = $s; } } - else - { + else { // Confirm delete third party if ($action == 'delete') { @@ -174,18 +171,15 @@ class ActionsCardCompany extends ActionsCardCommon $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } - else - { + else { $this->tpl['tva_intra'] = $s; } } - else - { + else { $this->tpl['tva_intra'] = ' '; } @@ -197,8 +191,7 @@ class ActionsCardCompany extends ActionsCardCommon $this->tpl['parent_company'] = $socm->getNomUrl(1).' '.($socm->code_client ? "(".$socm->code_client.")" : ""); $this->tpl['parent_company'] .= ($socm->town ? ' - '.$socm->town : ''); } - else - { + else { $this->tpl['parent_company'] = $langs->trans("NoParentCompany"); } } diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 9f236c8015e..6a93ac3e939 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -111,8 +111,7 @@ class ActionsCardIndividual extends ActionsCardCommon { $this->tpl['select_civility'] = $formcompany->select_civility(GETPOST('civility_id')); } - else - { + else { // Confirm delete third party if ($action == 'delete' || $conf->use_javascript_ajax) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 681d4a37fc9..77299e3ee89 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -137,8 +137,7 @@ if (empty($reshook)) $langs->load('errors'); setEventMessages($langs->trans('ErrorThirdPartyIdIsMandatory', $langs->transnoentitiesnoconv('MergeOriginThirdparty')), null, 'errors'); } - else - { + else { if (!$error && $soc_origin->fetch($soc_origin_id) < 1) { setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors'); @@ -302,8 +301,7 @@ if (empty($reshook)) setEventMessages($langs->trans('ThirdpartiesMergeSuccess'), null, 'mesgs'); $db->commit(); } - else - { + else { $langs->load("errors"); setEventMessages($langs->trans('ErrorsThirdpartyMerge'), null, 'errors'); $db->rollback(); @@ -404,8 +402,7 @@ if (empty($reshook)) $object->name_bis = GETPOST('name', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); } - else - { + else { $object->name = GETPOST('name', 'alpha'); } $object->entity = (GETPOSTISSET('entity') ?GETPOST('entity', 'int') : $conf->entity); @@ -609,16 +606,14 @@ if (empty($reshook)) { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { // Create thumbs $object->addThumbs($newfile); } } } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -632,8 +627,7 @@ if (empty($reshook)) } // Gestion du logo de la société } - else - { + else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case { $duplicate_code_error = true; @@ -656,8 +650,7 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { $url = $_SERVER["PHP_SELF"]."?socid=".$object->id; // Old method if (($object->client == 1 || $object->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $url = DOL_URL_ROOT."/comm/card.php?socid=".$object->id; elseif ($object->fournisseur == 1) $url = DOL_URL_ROOT."/fourn/card.php?socid=".$object->id; @@ -666,8 +659,7 @@ if (empty($reshook)) exit; } } - else - { + else { $db->rollback(); $action = 'create'; } @@ -684,8 +676,7 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } @@ -760,8 +751,7 @@ if (empty($reshook)) { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { // Create thumbs $object->addThumbs($newfile); @@ -777,13 +767,11 @@ if (empty($reshook)) } } } - else - { + else { $errors[] = "ErrorBadImageFormat"; } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -818,21 +806,18 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); exit; } } - else - { + else { $object->id = $socid; $action = "edit"; } } } - else - { + else { $action = ($action == 'add' ? 'create' : 'edit'); } } @@ -849,8 +834,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT."/societe/list.php?restore_lastsearch_values=1&delsoc=".urlencode($object->name)); exit; } - else - { + else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -920,8 +904,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -1062,8 +1045,7 @@ else { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { // Create thumbs $object->addThumbs($newfile); } @@ -1205,8 +1187,7 @@ else { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; } - else - { + else { print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; @@ -1342,8 +1323,7 @@ else { print ''.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } - else - { + else { print ''.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } @@ -1432,8 +1412,7 @@ else $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $s .= 'country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } @@ -1485,8 +1464,7 @@ else { print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); } - else - { + else { print $countrynotdefined; } print ''; @@ -1579,8 +1557,7 @@ else print '     '; print ''; } - else - { + else { print '     '; print ''; } @@ -1837,8 +1814,7 @@ else print ''; print $object->prefix_comm; } - else - { + else { print ''; } print ''; @@ -1864,8 +1840,7 @@ else { print ''; } - else - { + else { print $object->code_client; print ''; } @@ -1905,8 +1880,7 @@ else { print ''; } - else - { + else { print $object->code_fournisseur; print ''; } @@ -1962,8 +1936,7 @@ else { print ''.$form->editfieldkey('Region-State', 'state_id', '', $object, 0).''; } - else - { + else { print ''.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } @@ -2099,8 +2072,7 @@ else $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } @@ -2243,8 +2215,7 @@ else print ''; } } - else - { + else { /* * View */ @@ -2406,8 +2377,7 @@ else $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); print ''; } - else - { + else { print ''.$object->localtax1_value.''; } print ''; @@ -2500,15 +2470,13 @@ else $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } - else - { + else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } print $s; } - else - { + else { print ' '; } print ''; @@ -2586,8 +2554,7 @@ else { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?socid='.$object->id); } print ''; @@ -2621,8 +2588,7 @@ else { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'editparentcompany', 's.rowid <> '.$object->id, 1); } - else - { + else { $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->parent, 'none', 's.rowid <> '.$object->id, 1); } print ''; @@ -2645,8 +2611,7 @@ else $adh->ref = $adh->getFullName($langs); print $adh->getNomUrl(1); } - else - { + else { print ''.$langs->trans("ThirdpartyNotLinkedToMember").''; } print ''; @@ -2696,8 +2661,7 @@ else $langs->load("mails"); print ''.$langs->trans('SendMail').''; } - else - { + else { $langs->load("mails"); print ''.$langs->trans('SendMail').''; } @@ -2729,8 +2693,7 @@ else { print ''.$langs->trans('Delete').''."\n"; } - else - { + else { print ''.$langs->trans('Delete').''."\n"; } } diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 91d0fe9bb1a..99e18f036aa 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -50,8 +50,7 @@ if (!$vatNumber) print '
'; print ''.$langs->transnoentities("ErrorFieldRequired", $langs->trans("VATIntraShort")).'
'; } -else -{ +else { $vatNumber = preg_replace('/\^\w/', '', $vatNumber); $vatNumber = str_replace(array(' ', '.'), '', $vatNumber); $countryCode = substr($vatNumber, 0, 2); @@ -127,8 +126,7 @@ else print $langs->trans("ValueIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; //$messagetoshow=$soapclient->response; } - else - { + else { // Syntaxe ok if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'
'; print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("Yes").'
'; @@ -137,8 +135,7 @@ else { print ''.$langs->trans("ErrorVATCheckMS_UNAVAILABLE", $countryCode).'
'; } - else - { + else { if (!empty($result['valid']) && ($result['valid'] == 1 || $result['valid'] == 'true')) { print ''.$langs->trans("Yes").''; @@ -146,8 +143,7 @@ else print $langs->trans("Name").': '.$result['name'].'
'; print $langs->trans("Address").': '.$result['address'].'
'; } - else - { + else { print ''.$langs->trans("No").''; print '
'."\n"; } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index c50a746c444..3ec6243a2c7 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -467,8 +467,7 @@ class Thirdparties extends DolibarrApi throw new RestException(500, 'Error failed to merged thirdparty '.$this->companytoremove->id.' into '.$id.'. Enable and read log file for more information.'); } - else - { + else { $db->commit(); } @@ -1313,8 +1312,7 @@ class Thirdparties extends DolibarrApi $i++; } } - else - { + else { throw new RestException(404, 'Bank account not found'); } @@ -1331,8 +1329,7 @@ class Thirdparties extends DolibarrApi { return array("success" => $result); } - else - { + else { throw new RestException(500); } } diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 06c56b027cd..803d0ddebe3 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -84,8 +84,7 @@ class Client extends Societe $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 7211802721e..00737c04504 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -112,19 +112,16 @@ class CompanyBankAccount extends Account { return 1; } - else - { + else { return 0; } } - else - { + else { return 1; } } } - else - { + else { print $this->db->error(); return 0; } @@ -167,8 +164,7 @@ class CompanyBankAccount extends Account } if (trim($this->label) != '') $sql .= ",label = '".$this->db->escape($this->label)."'"; - else - $sql .= ",label = NULL"; + else $sql .= ",label = NULL"; $sql .= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); @@ -184,18 +180,15 @@ class CompanyBankAccount extends Account { return 1; } - else - { + else { return -1; } } - else - { + else { return 1; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -259,8 +252,7 @@ class CompanyBankAccount extends Account return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -308,8 +300,7 @@ class CompanyBankAccount extends Account $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -355,8 +346,7 @@ class CompanyBankAccount extends Account { return 0; } - else - { + else { $obj = $this->db->fetch_object($result1); $this->db->begin(); @@ -377,15 +367,13 @@ class CompanyBankAccount extends Account $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return 1; } } } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 5ba268f6687..ca75b904b11 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -440,8 +440,7 @@ class CompanyPaymentMode extends CommonObject { return 0; } - else - { + else { $obj = $this->db->fetch_object($result1); $type = ''; @@ -467,15 +466,13 @@ class CompanyPaymentMode extends CommonObject $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return 1; } } } - else - { + else { dol_print_error($this->db); return -1; } @@ -566,8 +563,7 @@ class CompanyPaymentMode extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index de65e05d41e..e2b24577bf9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -827,22 +827,19 @@ class Societe extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { dol_syslog(get_class($this)."::Create echec update ".$this->error." ".join(',', $this->errors), LOG_ERR); $this->db->rollback(); return -4; } } - else - { + else { if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $langs->trans("ErrorCompanyNameAlreadyExists", $this->name); // duplicate on a field (code or profid or ...) $result = -1; } - else - { + else { $this->error = $this->db->lasterror(); $result = -2; } @@ -850,8 +847,7 @@ class Societe extends CommonObject return $result; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::Create fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1007,8 +1003,7 @@ class Societe extends CommonObject } } } - else - { + else { //var_dump($conf->global->SOCIETE_EMAIL_UNIQUE); //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') @@ -1337,8 +1332,7 @@ class Societe extends CommonObject unset($this->state); } } - else - { + else { unset($this->country_code); // We clean this, in the doubt, because it may have been changed after an update of country_id unset($this->country); unset($this->state_code); @@ -1425,22 +1419,19 @@ class Societe extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // Doublon $this->error = $langs->trans("ErrorDuplicateField"); $result = -1; } - else - { + else { $this->error = $this->db->lasterror(); $result = -2; } @@ -1448,8 +1439,7 @@ class Societe extends CommonObject return $result; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::Update fails verify ".join(',', $this->errors), LOG_WARNING); return -3; @@ -1675,15 +1665,13 @@ class Societe extends CommonObject // fetch optionals attributes and labels $this->fetch_optionals(); } - else - { + else { $result = 0; } $this->db->free($resql); } - else - { + else { $this->error = $this->db->lasterror(); $result = -3; } @@ -1822,8 +1810,7 @@ class Societe extends CommonObject return 1; } - else - { + else { dol_syslog($this->error, LOG_ERR); $this->db->rollback(); return -1; @@ -2051,8 +2038,7 @@ class Societe extends CommonObject { return $result; } - else - { + else { $this->error = $discount->error; return -3; } @@ -2079,8 +2065,7 @@ class Societe extends CommonObject { return $result; } - else - { + else { $this->error = $discountstatic->error; return -1; } @@ -2108,8 +2093,7 @@ class Societe extends CommonObject $sql .= " AND ug.entity = ".$conf->entity.")"; $sql .= " OR u.admin = 1)"; } - else - $sql .= " WHERE entity in (0, ".$conf->entity.")"; + else $sql .= " WHERE entity in (0, ".$conf->entity.")"; $sql .= " AND u.rowid = sc.fk_user AND sc.fk_soc = ".$this->id; @@ -2136,8 +2120,7 @@ class Societe extends CommonObject $reparray[$i]['login'] = $obj->login; $reparray[$i]['photo'] = $obj->photo; } - else - { + else { $reparray[] = $obj->rowid; } $i++; @@ -2249,8 +2232,7 @@ class Societe extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2335,8 +2317,7 @@ class Societe extends CommonObject { $name = $code.' '.$name; } - else - { + else { $name = $code; } } @@ -2629,8 +2610,7 @@ class Societe extends CommonObject { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname, $obj->lastname)).($obj->poste ? " - ".$obj->poste : "").(($mode != 'poste' && $property) ? " ".$sepa.$property.$sepb : ''); } - else - { + else { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname, $obj->lastname)).(($mode != 'poste' && $property) ? " ".$sepa.$property.$sepb : ''); } } @@ -2638,8 +2618,7 @@ class Societe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } return $contact_property; @@ -2673,8 +2652,7 @@ class Societe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } return $contacts; @@ -2710,8 +2688,7 @@ class Societe extends CommonObject } } } - else - { + else { dol_print_error($this->db); } return $contacts; @@ -2750,8 +2727,7 @@ class Societe extends CommonObject } return $contact_property; } - else - { + else { dol_print_error($this->db); } } @@ -2918,8 +2894,7 @@ class Societe extends CommonObject if ($mod->code_modifiable) return 1; // A mettre en dernier return 0; } - else - { + else { return 0; } } @@ -2954,8 +2929,7 @@ class Societe extends CommonObject if ($mod->code_modifiable) return 1; // A mettre en dernier return 0; } - else - { + else { return 0; } } @@ -2992,8 +2966,7 @@ class Societe extends CommonObject $result = $mod->verif($this->db, $this->code_client, $this, 0); return $result; } - else - { + else { return 0; } } @@ -3029,8 +3002,7 @@ class Societe extends CommonObject $result = $mod->verif($this->db, $this->code_fournisseur, $this, 1); return $result; } - else - { + else { return 0; } } @@ -3072,14 +3044,12 @@ class Societe extends CommonObject return $result; } - else - { + else { $this->error = 'ErrorAccountancyCodeNotDefined'; return -1; } } - else - { + else { if ($type == 'customer') $this->code_compta = ''; elseif ($type == 'supplier') $this->code_compta_fournisseur = ''; @@ -3109,8 +3079,7 @@ class Societe extends CommonObject $this->parent = $id; return 1; } - else - { + else { return -1; } } @@ -3205,8 +3174,7 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); $count = $obj->idprof; } - else - { + else { $count = 0; print $this->db->error(); } @@ -3306,8 +3274,7 @@ class Societe extends CommonObject if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string)) if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1)) return 1; - else - return -1; + else return -1; //algorithm checking type code CIF $sum = $num[2] + $num[4] + $num[6]; @@ -3319,29 +3286,25 @@ class Societe extends CommonObject if (preg_match('/^[KLM]{1}/', $string)) if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1)) return 1; - else - return -1; + else return -1; //Check CIF if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string)) if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1)) return 2; - else - return -2; + else return -2; //Check NIE T if (preg_match('/^[T]{1}/', $string)) if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string)) return 3; - else - return -3; + else return -3; //Check NIE XYZ if (preg_match('/^[XYZ]{1}/', $string)) if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X', 'Y', 'Z'), array('0', '1', '2'), $string), 0, 8) % 23, 1)) return 3; - else - return -3; + else return -3; //Can not be verified return -4; @@ -3440,8 +3403,7 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); $count = $obj->numproj; } - else - { + else { $count = 0; print $this->db->error(); } @@ -3491,8 +3453,7 @@ class Societe extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -3558,8 +3519,7 @@ class Societe extends CommonObject } return 0; } - else - { + else { return -1; } } @@ -3581,8 +3541,7 @@ class Societe extends CommonObject if ($resql = $this->db->query($sql)) return 0; } - else - { + else { return 0; } return -1; @@ -3645,16 +3604,14 @@ class Societe extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; } } - else - { + else { // $this->error deja positionne dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".join(',', $this->errors), LOG_ERR); @@ -3696,7 +3653,7 @@ class Societe extends CommonObject $country_code = $tmp[1]; $country_label = $tmp[2]; } - else // For backward compatibility + else // For backward compatibility { dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -3721,7 +3678,7 @@ class Societe extends CommonObject $state_code = $tmp[1]; $state_label = $tmp[2]; } - else // For backward compatibility + else // For backward compatibility { dol_syslog("Your state setup use an old syntax. Reedit it using setup area.", LOG_ERR); include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -3904,8 +3861,7 @@ class Societe extends CommonObject $obj = $this->db->fetch_object($resql); return (($obj->nb > 0) ?true:false); } - else - { + else { $this->error = $this->db->lasterror(); return false; } @@ -3991,8 +3947,7 @@ class Societe extends CommonObject elseif ($status == '1' || $status == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1).' '.$langs->trans("StatusProspect1"); elseif ($status == '2' || $status == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2).' '.$langs->trans("StatusProspect2"); elseif ($status == '3' || $status == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3).' '.$langs->trans("StatusProspect3"); - else - { + else { return img_action(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label, 0).' '.(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label); } } @@ -4003,8 +3958,7 @@ class Societe extends CommonObject elseif ($status == '1' || $status == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1); elseif ($status == '2' || $status == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2); elseif ($status == '3' || $status == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3); - else - { + else { return img_action(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label, 0); } } @@ -4015,8 +3969,7 @@ class Societe extends CommonObject elseif ($status == '1' || $status == 'ST_TODO') return img_action($langs->trans("StatusProspect1"), 1).' '.$langs->trans("StatusProspect1"); elseif ($status == '2' || $status == 'ST_PEND') return img_action($langs->trans("StatusProspect2"), 2).' '.$langs->trans("StatusProspect2"); elseif ($status == '3' || $status == 'ST_DONE') return img_action($langs->trans("StatusProspect3"), 3).' '.$langs->trans("StatusProspect3"); - else - { + else { return img_action(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label, 0).' '.(($langs->trans("StatusProspect".$status) != "StatusProspect".$status) ? $langs->trans("StatusProspect".$status) : $label); } } @@ -4074,8 +4027,7 @@ class Societe extends CommonObject } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } - else - return array(); + else return array(); } /** @@ -4114,8 +4066,7 @@ class Societe extends CommonObject } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } - else - return array(); + else return array(); } /** @@ -4157,8 +4108,7 @@ class Societe extends CommonObject require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $tmpobject = new FactureFournisseur($this->db); } - else - { + else { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $tmpobject = new Facture($this->db); } @@ -4194,8 +4144,7 @@ class Societe extends CommonObject } return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax); // 'opened' is 'incl taxes' } - else - { + else { return array(); } } @@ -4255,8 +4204,7 @@ class Societe extends CommonObject if (!$result) dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); $result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } - else - { + else { // Positionne le modele sur le nom du modele a utiliser if (!dol_strlen($modele)) { @@ -4264,8 +4212,7 @@ class Societe extends CommonObject { $modele = $conf->global->COMPANY_ADDON_PDF; } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_COMPANY_ADDON_PDF_NotDefined"); return 0; } diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 98bdeffa637..1f99e9bae8a 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -557,8 +557,7 @@ class SocieteAccount extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index ad7383d81af..2660625bd1c 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -428,8 +428,7 @@ if ($sql_select) { print $documentstaticline->getLibStatut(2); } - else - { + else { print $documentstatic->getLibStatut(2); } print ''; @@ -472,8 +471,7 @@ if ($sql_select) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - { + else { $label = $objp->product_label; } @@ -522,14 +520,12 @@ if ($sql_select) // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } - else - { + else { echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } } - else - { + else { if ($objp->fk_product > 0) { echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index d082ae6baa5..9f3751fd5b2 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -167,8 +167,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { accessforbidden('', 0, 0); } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 0000494a3fe..c62ec602ecd 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -120,8 +120,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + print $dolgraph->show(); print ''."\n"; } -else -{ +else { if (!empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = ""; @@ -186,8 +185,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA { $dataseries[] = array($obj->label, round($obj->nb)); } - else - { + else { $rest += $obj->nb; } $total += $obj->nb; @@ -207,8 +205,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA $dolgraph->draw('idgraphcateg'); print $dolgraph->show(); } - else - { + else { while ($i < $num) { $obj = $db->fetch_object($result); @@ -335,8 +332,7 @@ if ($result) print "\n"; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1df7c38d6c5..cb94da91e2f 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1050,8 +1050,7 @@ while ($i < min($num, $limit)) { print $obj->name; } - else - { + else { print $companystatic->getNomUrl(1, '', 100, 0, 1); } print "\n"; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 2e3e3ec4532..48a31085eb4 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -123,8 +123,7 @@ if ($object->id > 0) dol_fiche_end(); } -else -{ +else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 191f9c4bb2c..0650261cefc 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -105,8 +105,7 @@ if (empty($reshook)) dol_print_error($db); } } - else - { + else { dol_print_error($db); } @@ -114,8 +113,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -264,8 +262,7 @@ if ($result > 0) print ''; print ''; } - else - { + else { print ''; print $langs->trans("YouMustCreateContactFirst"); print ''; @@ -294,8 +291,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -334,8 +330,7 @@ if ($result > 0) { print ' <'.$obj->email.'>'; } - else - { + else { $langs->load("errors"); print '   '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email); } @@ -444,8 +439,7 @@ if ($result > 0) { $num = $db->num_rows($resql); } - else - { + else { dol_print_error($db); } @@ -494,8 +488,7 @@ if ($result > 0) print $contactstatic->getNomUrl(1); print $obj->email ? ' <'.$obj->email.'>' : $langs->trans("NoMail"); } - else - { + else { print $obj->email; } print ''; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6385346ce5d..2d5e0612959 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -176,8 +176,7 @@ if (empty($reshook)) { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } - else - { + else { // If this account is the default bank account, we disable others if ($companybankaccount->default_rib) { @@ -231,8 +230,7 @@ if (empty($reshook)) { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } - else - { + else { // If this account is the default bank account, we disable others if ($companypaymentmode->default_rib) { @@ -339,8 +337,7 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { $db->rollback(); } } @@ -408,8 +405,7 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { $db->rollback(); } } @@ -425,8 +421,7 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { setEventMessages($db->lasterror, null, 'errors'); } } @@ -452,13 +447,11 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } } - else - { + else { setEventMessages($companypaymentmode->error, $companypaymentmode->errors, 'errors'); } } @@ -474,13 +467,11 @@ if (empty($reshook)) header('Location: '.$url); exit; } - else - { + else { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } } - else - { + else { setEventMessages($companybankaccount->error, $companybankaccount->errors, 'errors'); } } @@ -516,8 +507,7 @@ if (empty($reshook)) $error++; setEventMessages('ThisThirdpartyIsNotACustomer', null, 'errors'); } - else - { + else { // Creation of Stripe customer + update of societe_account $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus, 1); if (!$cu) @@ -525,8 +515,7 @@ if (empty($reshook)) $error++; setEventMessages($stripe->error, $stripe->errors, 'errors'); } - else - { + else { $stripecu = $cu->id; } } @@ -541,8 +530,7 @@ if (empty($reshook)) $error++; setEventMessages('ThisPaymentModeIsNotACard', null, 'errors'); } - else - { + else { // Get the Stripe customer $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); if (!$cu) @@ -613,8 +601,7 @@ if (empty($reshook)) $stripecu = $newcu; $db->commit(); } - else - { + else { $db->rollback(); } } @@ -670,8 +657,7 @@ if (empty($reshook)) $stripesupplieracc = $newsup; $db->commit(); } - else - { + else { $db->rollback(); } } @@ -699,8 +685,7 @@ if (empty($reshook)) { $cu->invoice_settings->default_payment_method = (string) $source; // New } - else - { + else { $cu->default_source = (string) $source; // Old } $result = $cu->save(); @@ -726,8 +711,7 @@ if (empty($reshook)) $payment_method->detach(); } } - else - { + else { $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); $card = $cu->sources->retrieve("$source"); if ($card) { @@ -783,8 +767,7 @@ if (!$id) $companybankaccount->fetch(0, $object->id); $companypaymentmode->fetch(0, null, $object->id, 'card'); } -else -{ +else { $companybankaccount->fetch($id); $companypaymentmode->fetch($id); } @@ -976,8 +959,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' { $listofsources = $customerstripe->sources->data; } - else - { + else { $service = 'StripeTest'; $servicestatus = 0; if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 6d69e692a96..2f0595cf15d 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -467,8 +467,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ""; } - else - { + else { print $langs->trans('None'); } @@ -476,8 +475,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print "\n
\n"; } - else - { + else { // View mode /* ************************************************************************** */ @@ -591,8 +589,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print "\n"; } } - else - { + else { $colspan = 9; if ($user->rights->produit->supprimer || $user->rights->service->supprimer) $colspan += 1; print ''.$langs->trans('None').''; diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 5ff86ff0064..e25b5c5e606 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -79,15 +79,13 @@ if ($action == 'addcontact' && $user->rights->societe->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; } - else - { + else { $mesg = '
'.$object->error.'
'; } } @@ -100,8 +98,7 @@ elseif ($action == 'swapstatut' && $user->rights->societe->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -328,16 +325,14 @@ if ($id > 0 || !empty($ref)) } print ''; } - else - { + else { print ''; if ($objp->subscription == 'yes') { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) print " ".img_warning(); } - else - { + else { print ' '; } print ''; @@ -351,8 +346,7 @@ if ($id > 0 || !empty($ref)) } } } - else - { + else { // Contrat non trouve print "ErrorRecordNotFound"; }