diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 6b2d432fe46..ca5011849b1 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -71,9 +71,7 @@ if ($action == 'updateall') { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); $db->rollback(); - } - else - { + } else { setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); $db->commit(); } @@ -101,9 +99,7 @@ if ($action == 'update' || $action == 'add') if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -199,9 +195,7 @@ if ($conf->facture->enabled) print ''; print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0); print ''; - } - else - { + } else { print ''; print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name")); print ''; @@ -234,12 +228,12 @@ print '
'; */ $constantes = array( 'ADHERENT_CARD_TYPE', -// 'ADHERENT_CARD_BACKGROUND', + //'ADHERENT_CARD_BACKGROUND', 'ADHERENT_CARD_HEADER_TEXT', 'ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_CARD_FOOTER_TEXT' - ); +); print load_fiche_titre($langs->trans("MembersCards"), '', ''); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index e0675a6124a..f59a27c170b 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -74,9 +74,7 @@ if ($action == 'updateall') { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); $db->rollback(); - } - else - { + } else { setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); $db->commit(); } @@ -102,8 +100,7 @@ if ($action == 'update' || $action == 'add') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index a8cdc06784e..50a7f58e8c5 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -61,16 +61,16 @@ if ($action == 'update') $res = dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT", $editamount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); if ($forcetype < 0) $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); - else $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); + else { + $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); + } if (!$res > 0) $error++; if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -145,9 +145,7 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; -} -else -{ +} else { // Button on, click to disable $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 20d712e6179..f1d83a4b314 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -53,9 +53,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; -} -else -{ +} else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index eeee48e2138..44046d5a26e 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -118,9 +118,7 @@ abstract class ActionsAdherentCardCommon { $this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company_id'] = $objsoc->id; - } - else - { + } else { $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); } @@ -190,9 +188,7 @@ abstract class ActionsAdherentCardCommon $objsoc->fetch($this->object->socid); $this->tpl['company'] = $objsoc->getNomUrl(1); - } - else - { + } else { $this->tpl['company'] = $langs->trans("AdherentNotLinkedToThirdParty"); } @@ -273,9 +269,7 @@ abstract class ActionsAdherentCardCommon $this->object->country_code = $obj->code; $this->object->country = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->libelle; - } - else - { + } else { dol_print_error($this->db); } } diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index 60bb2ecd034..f248256a547 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -105,9 +105,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon $this->tpl['actionstodo'] = show_actions_todo($conf, $langs, $db, $objsoc, $this->object, 1); $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); - } - else - { + } else { // Confirm delete contact if ($action == 'delete' && $user->rights->adherent->supprimer) { diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index c913d6a1b49..7a5880fc317 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -209,9 +209,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans($nuser->error), null, 'errors'); } - } - else - { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -231,9 +229,7 @@ if (empty($reshook)) setEventMessages($langs->trans($company->error), null, 'errors'); setEventMessages($company->error, $company->errors, 'errors'); } - } - else - { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -376,21 +372,15 @@ if (empty($reshook)) if (!dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']) > 0) { setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); - } - else - { + } else { // Create thumbs $object->addThumbs($newfile); } } - } - else - { + } else { setEventMessages("ErrorBadImageFormat", null, 'errors'); } - } - else - { + } else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -412,15 +402,11 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - } - else - { + } else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } - } - else - { + } else { $action = 'edit'; } } @@ -527,8 +513,7 @@ if (empty($reshook)) if (empty($login)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")), null, 'errors'); - } - else { + } else { $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'"; $result = $db->query($sql); if ($result) { @@ -588,9 +573,7 @@ if (empty($reshook)) $rowid = $object->id; $id = $object->id; $action = ''; - } - else - { + } else { $db->rollback(); if ($object->error) { @@ -616,15 +599,11 @@ if (empty($reshook)) { header("Location: ".$backtopage); exit; - } - else - { + } else { header("Location: list.php"); exit; } - } - else - { + } else { $errmesg = $object->error; } } @@ -689,9 +668,7 @@ if (empty($reshook)) } } } - } - else - { + } else { $error++; if ($object->error) { setEventMessages($object->error, $object->errors, 'errors'); @@ -703,9 +680,7 @@ if (empty($reshook)) if (!$error) { $db->commit(); - } - else - { + } else { $db->rollback(); } $action = ''; @@ -770,9 +745,7 @@ if (empty($reshook)) } } } - } - else - { + } else { $error++; if ($object->error) { @@ -857,9 +830,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template -} -else -{ +} else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -1027,9 +998,7 @@ else if ($object->country_id) { print $formcompany->select_state(GETPOST('state_id', 'int') ?GETPOST('state_id', 'int') : $object->state_id, $object->country_code); - } - else - { + } else { print $countrynotdefined; } print ''; @@ -1084,9 +1053,7 @@ else if (!empty($backtopage)) { print ''; - } - else - { + } else { print ''; } print ''; @@ -1123,9 +1090,7 @@ else if ($resql) { $obj = $db->fetch_object($resql); - } - else - { + } else { dol_print_error($db); } $object->country_id = $obj->rowid; @@ -1204,9 +1169,7 @@ else if ($user->rights->adherent->creer) { print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ?GETPOST("typeid", 'int') : $object->typeid)); - } - else - { + } else { print $adht->getNomUrl(1); print ''; } @@ -1334,9 +1297,7 @@ else $company = new Societe($db); $result = $company->fetch($object->socid); print $company->getNomUrl(1); - } - else - { + } else { print $langs->trans("NoThirdPartyAssociatedToMember"); } print ''; @@ -1432,9 +1393,7 @@ else { $companyname = $object->company; if (!empty($fullname)) $companyalias = $fullname; - } - else - { + } else { $companyname = $fullname; if (!empty($object->company)) $companyalias = $object->company; } @@ -1629,8 +1588,7 @@ else { print ''.$langs->trans("Password").''.preg_replace('/./i', '*', $object->pass); if ($object->pass) print preg_replace('/./i', '*', $object->pass); - else - { + else { if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; else print $langs->trans("Hidden"); } @@ -1651,9 +1609,7 @@ else if ($object->hasDelay()) { print " ".img_warning($langs->trans("Late")); } - } - else - { + } else { if ($object->need_subscription == 0) { print $langs->trans("SubscriptionNotNeeded"); @@ -1662,9 +1618,7 @@ else { print $langs->trans("SubscriptionNotRecorded"); if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated - } - else - { + } else { print $langs->trans("SubscriptionNotReceived"); if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } @@ -1691,17 +1645,12 @@ else print ''; print ''; print ''; - } - else - { - if ($object->socid) - { + } else { + if ($object->socid) { $company = new Societe($db); $result = $company->fetch($object->socid); print $company->getNomUrl(1); - } - else - { + } else { print $langs->trans("NoThirdPartyAssociatedToMember"); } } @@ -1716,14 +1665,13 @@ else if ($action == 'editlogin') { $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); - } - else - { + } else { if ($object->user_id) { $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); + } else { + print $langs->trans("NoDolibarrAccess"); } - else print $langs->trans("NoDolibarrAccess"); } print ''; @@ -1803,9 +1751,7 @@ else if ($user->rights->adherent->creer) { print '
'.$langs->trans("Modify")."
"; - } - else - { + } else { print '
'.$langs->trans("Modify").'
'; } @@ -1815,9 +1761,7 @@ else if ($user->rights->adherent->creer) { print '
'.$langs->trans("Validate")."
\n"; - } - else - { + } else { print '
'.$langs->trans("Validate").'
'; } } @@ -1828,9 +1772,7 @@ else if ($user->rights->adherent->creer) { print '
'.$langs->trans("Reenable")."
\n"; - } - else - { + } else { print '
'.$langs->trans("Reenable")."
"; } } @@ -1841,9 +1783,7 @@ else if ($user->rights->adherent->supprimer) { print '
'.$langs->trans("Resiliate")."
\n"; - } - else - { + } else { print '
'.$langs->trans("Resiliate")."
"; } } @@ -1855,9 +1795,7 @@ else { if ($object->statut != -1) print '
'.$langs->trans("CreateDolibarrThirdParty").'
'; else print '
'.$langs->trans("CreateDolibarrThirdParty").'
'; - } - else - { + } else { print '
'.$langs->trans("CreateDolibarrThirdParty")."
"; } } @@ -1869,9 +1807,7 @@ else { if ($object->statut != -1) print '
'.$langs->trans("CreateDolibarrLogin").'
'; else print '
'.$langs->trans("CreateDolibarrLogin").'
'; - } - else - { + } else { print '
'.$langs->trans("CreateDolibarrLogin")."
"; } } @@ -1880,9 +1816,7 @@ else if ($user->rights->adherent->supprimer) { print '
'.$langs->trans("Delete")."
\n"; - } - else - { + } else { print '
'.$langs->trans("Delete")."
"; } diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 86bf523ac51..345542f8cba 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -162,11 +162,9 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) 'photo'=>$objp->photo ); } - } - else - { + } else { $arrayofmembers[] = array( - 'textleft'=>$textleft, + 'textleft'=>$textleft, 'textheader'=>$textheader, 'textfooter'=>$textfooter, 'textright'=>$textright, @@ -226,9 +224,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { dol_print_error('', $result); } - } - else - { + } else { dol_print_error($db); } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 55504a547c2..a7410d87973 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1282,10 +1282,11 @@ class Adherent extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_code; - if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) + if ($langs->trans("Country".$obj->country_code) != "Country".$obj->country_code) { $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code); - else + } else { $this->country = $obj->country; + } $this->phone = $obj->phone; $this->phone_perso = $obj->phone_perso; @@ -2037,12 +2038,13 @@ class Adherent extends CommonObject if ($withpictoimg > -2 && $withpictoimg != 2) { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= ''; - if ($mode == 'login') + if ($mode == 'login') { $result .= dol_trunc($this->login, $maxlen); - elseif ($mode == 'ref') + } elseif ($mode == 'ref') { $result .= $this->id; - else + } else { $result .= $this->getFullName($langs, '', ($mode == 'firstname' ? 2 : -1), $maxlen); + } if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result .= ''; } if ($withpictoimg) $result .= ''; @@ -2803,10 +2805,11 @@ class Adherent extends CommonObject $listofids .= ', ...'; break; } - if (empty($listofids)) + if (empty($listofids)) { $listofids .= ' ['; - else + } else { $listofids .= ', '; + } $listofids .= $idmember; $i++; } @@ -2823,10 +2826,11 @@ class Adherent extends CommonObject $listofids .= ', ...'; break; } - if (empty($listofids)) + if (empty($listofids)) { $listofids .= ' ['; - else + } else { $listofids .= ', '; + } $listofids .= $idmember; $i++; } diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 4af80ab4a63..199bd5e8a51 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -146,9 +146,7 @@ class AdherentType extends CommonObject $this->multilangs["$obj->lang"]["email"] = $obj->email; } return 1; - } - else - { + } else { $this->error = "Error: ".$this->db->lasterror()." - ".$sql; return -1; } @@ -184,9 +182,7 @@ class AdherentType extends CommonObject $sql2 .= " label='".$this->db->escape($this->label)."',"; $sql2 .= " description='".$this->db->escape($this->description)."'"; $sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'"; - } - else - { + } else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; $sql2 .= ")"; $sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',"; @@ -214,9 +210,7 @@ class AdherentType extends CommonObject $sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; $sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'"; - } - else - { + } else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; $sql2 .= ")"; $sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',"; @@ -231,9 +225,7 @@ class AdherentType extends CommonObject return -1; } } - } - else - { + } else { // language is not current language and we didn't provide a multilang description for this language } } @@ -274,9 +266,7 @@ class AdherentType extends CommonObject } // End call triggers return 1; - } - else - { + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR); return -1; @@ -336,16 +326,12 @@ class AdherentType extends CommonObject { $this->db->commit(); return $this->id; - } - else - { + } else { dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } - } - else - { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -418,16 +404,12 @@ class AdherentType extends CommonObject { $this->db->commit(); return 1; - } - else - { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); return -$error; } - } - else - { + } else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -458,9 +440,7 @@ class AdherentType extends CommonObject $this->db->commit(); return 1; - } - else - { + } else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -511,9 +491,7 @@ class AdherentType extends CommonObject } return 1; - } - else - { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -552,9 +530,7 @@ class AdherentType extends CommonObject $i++; } } - } - else - { + } else { print $this->db->error(); } return $adherenttypes; @@ -608,9 +584,7 @@ class AdherentType extends CommonObject $this->members = $ret; return $ret; - } - else - { + } else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 8e2e0d278f0..a5d72f3b78f 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -239,10 +239,8 @@ class Members extends DolibarrApi if ($member->update(DolibarrApiAccess::$user) >= 0) { return $this->get($id); - } - else - { - throw new RestException(500, $member->error); + } else { + throw new RestException(500, $member->error); } } diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index 98cb25b7fc3..c9d12206962 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -207,10 +207,8 @@ class MembersTypes extends DolibarrApi if ($membertype->update(DolibarrApiAccess::$user) >= 0) { return $this->get($id); - } - else - { - throw new RestException(500, $membertype->error); + } else { + throw new RestException(500, $membertype->error); } } diff --git a/htdocs/adherents/class/api_subscriptions.class.php b/htdocs/adherents/class/api_subscriptions.class.php index c9804e5d802..11ac1f17113 100644 --- a/htdocs/adherents/class/api_subscriptions.class.php +++ b/htdocs/adherents/class/api_subscriptions.class.php @@ -196,10 +196,8 @@ class Subscriptions extends DolibarrApi if ($subscription->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); - } - else - { - throw new RestException(500, $subscription->error); + } else { + throw new RestException(500, $subscription->error); } } diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index e512e1152bb..e1ec3bd1753 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -232,14 +232,10 @@ class Subscription extends CommonObject $this->note = $obj->note; $this->fk_bank = $obj->fk_bank; return 1; - } - else - { + } else { return 0; } - } - else - { + } else { $this->error = $this->db->lasterror(); return -1; } @@ -286,9 +282,7 @@ class Subscription extends CommonObject if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail // End call triggers } - } - else - { + } else { $error++; $this->error = $this->db->lasterror(); } @@ -355,28 +349,20 @@ class Subscription extends CommonObject { $this->db->commit(); return 1; - } - else - { + } else { $this->error = $accountline->error; $this->db->rollback(); return -1; } - } - else - { + } else { $this->db->commit(); return 1; } - } - else - { + } else { $this->db->commit(); return 0; } - } - else - { + } else { $error++; $this->error = $this->db->lasterror(); } @@ -488,9 +474,7 @@ class Subscription extends CommonObject } $this->db->free($result); - } - else - { + } else { dol_print_error($this->db); } } diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 05ccf20169c..291b1916e55 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -158,14 +158,10 @@ if ($id > 0) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; print "

"; - } - else - { + } else { dol_print_error($db); } -} -else -{ +} else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index b7aa8da5d14..385e34d6538 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -79,9 +79,7 @@ if ($resql) $i++; } print "
\n"; -} -else -{ +} else { dol_print_error($db); } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 6d069386592..001730d67b1 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -331,9 +331,7 @@ if ($resql) $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); $staticmember->name = $staticmember->thirdparty->name; - } - else - { + } else { $staticmember->name = $obj->company; } $staticmember->ref = $staticmember->getFullName($langs); @@ -349,9 +347,7 @@ if ($resql) } print ""; print "
"; -} -else -{ +} else { dol_print_error($db); } @@ -411,9 +407,7 @@ if ($resql) } print ""; print "
"; -} -else -{ +} else { dol_print_error($db); } diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 6a49f99fbf4..43d6a34fcf9 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -176,9 +176,7 @@ if ($result > 0) { $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).''; - } - else - { + } else { $records = $ldap->getAttribute($dn, $search); //print_r($records); @@ -189,23 +187,17 @@ if ($result > 0) if (!is_array($records)) { print ''.$langs->trans("ErrorFailedToReadLDAP").''; - } - else - { + } else { $result = show_ldap_content($records, 0, $records['count'], true); } - } - else - { + } else { print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')'; } } $ldap->unbind(); $ldap->close(); -} -else -{ +} else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 6cb34192845..72745b54614 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -214,9 +214,7 @@ if (empty($reshook)) if ($result < 0 && !count($tmpmember->errors)) { setEventMessages($tmpmember->error, $tmpmember->errors, 'errors'); - } - else - { + } else { if ($result > 0) $nbclose++; } } @@ -226,9 +224,7 @@ if (empty($reshook)) setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs'); $db->commit(); - } - else - { + } else { $db->rollback(); } } @@ -858,17 +854,13 @@ while ($i < min($num, $limit)) print " ".img_warning($langs->trans("SubscriptionLate").$textlate); } print ''; - } - else - { + } else { print ''; if ($obj->subscription == 'yes') { print $langs->trans("SubscriptionNotReceived"); if ($obj->statut > 0) print " ".img_warning(); - } - else - { + } else { print ' '; } print ''; diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 7927c2e3f00..70c6ab0689b 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -93,9 +93,7 @@ if ($resql) $i++; } $db->free($resql); -} -else -{ +} else { dol_print_error($db); } @@ -106,13 +104,10 @@ dol_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), -1, 'use // Print title -if (!count($data)) -{ +if (!count($data)) { print $langs->trans("NoValidatedMemberYet").'
'; print '
'; -} -else -{ +} else { print $langs->trans("MembersByNature").'
'; print '
'; } diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 5b51008a9a2..bde4d5c949c 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -200,9 +200,7 @@ if ($mode) $i++; } $db->free($resql); - } - else - { + } else { dol_print_error($db); } } @@ -218,15 +216,12 @@ if ($mode && !count($data)) { print $langs->trans("NoValidatedMemberYet").'
'; print '
'; -} -else -{ +} else { if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'
'; elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'
'; elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'
'; elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'
'; //+ - else - { + else { print $langs->trans("MembersStatisticsDesc").'
'; print '
'; print ''.$langs->trans("MembersStatisticsByCountries").'
'; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 47866fc8981..3bf821db04e 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -128,13 +128,11 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights $langs->load("errors"); setEventMessages($company->error, $company->errors, 'errors'); } - else - { + else { $action = 'addsubscription'; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -276,8 +274,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $error++; $action = 'addsubscription'; } - else - { + else { if (!empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') { if ($_POST["subscription"]) @@ -286,8 +283,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! if ($_POST["paymentsave"] != 'invoiceonly' && !$_POST["operation"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); if ($_POST["paymentsave"] != 'invoiceonly' && !($_POST["accountid"] > 0)) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); } - else - { + else { if ($_POST["accountid"]) $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); } if ($errmsg) @@ -323,8 +319,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $error++; setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { // If an invoice was created, it is into $object->invoice } } @@ -333,8 +328,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $db->commit(); } - else - { + else { $db->rollback(); $action = 'addsubscription'; } @@ -403,13 +397,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $errmsg = $object->error; setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs'); } } - else - { + else { setEventMessages($langs->trans("NoEmailSentToMember"), null, 'mesgs'); } } @@ -548,15 +540,13 @@ if ($rowid > 0) print " ".img_warning($langs->trans("Late")); } } - else - { + else { if (!$adht->subscription) { print $langs->trans("SubscriptionNotRecorded"); if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled } - else - { + else { print $langs->trans("SubscriptionNotReceived"); if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled } @@ -587,16 +577,14 @@ if ($rowid > 0) print ''; print ''; } - else - { + else { if ($object->fk_soc) { $company = new Societe($db); $result = $company->fetch($object->fk_soc); print $company->getNomUrl(1); } - else - { + else { print $langs->trans("NoThirdPartyAssociatedToMember"); } } @@ -623,8 +611,7 @@ if ($rowid > 0) { $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); } - else - { + else { if ($object->user_id) { $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); @@ -755,9 +742,7 @@ if ($rowid > 0) $accountstatic->ref = $objp->ref; print $accountstatic->getNomUrl(1); - } - else - { + } else { print ' '; } print ''; @@ -773,9 +758,7 @@ if ($rowid > 0) } print ""; - } - else - { + } else { dol_print_error($db); } } @@ -814,9 +797,7 @@ if ($rowid > 0) if (GETPOST('paymentsave') == 'bankdirect') $bankdirect = 1; if (GETPOST('paymentsave') == 'invoiceonly') $invoiceonly = 1; if (GETPOST('paymentsave') == 'bankviainvoice') $bankviainvoice = 1; - } - else - { + } else { if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $bankviainvoice = 1; elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) $bankdirect = 1; elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) $invoiceonly = 1; @@ -870,9 +851,7 @@ if ($rowid > 0) { $companyname = $object->company; if (!empty($fullname)) $companyalias = $fullname; - } - else - { + } else { $companyname = $fullname; if (!empty($object->company)) $companyalias = $object->company; } @@ -999,8 +978,7 @@ if ($rowid > 0) //if (empty($object->fk_soc)) print ' disabled'; print '> '.$langs->trans("MoreActionInvoiceOnly"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; - else - { + else { print ' ('; if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); print $langs->trans("NoThirdPartyAssociatedToMember"); @@ -1009,8 +987,7 @@ if ($rowid > 0) print ')'; } if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; - if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) - { + if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product @@ -1024,8 +1001,7 @@ if ($rowid > 0) //if (empty($object->fk_soc)) print ' disabled'; print '> '.$langs->trans("MoreActionBankViaInvoice"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; - else - { + else { print ' ('; if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); print $langs->trans("NoThirdPartyAssociatedToMember"); @@ -1083,9 +1059,7 @@ if ($rowid > 0) if (!$object->email) { print $langs->trans("NoEMail"); - } - else - { + } else { $adht = new AdherentType($db); $adht->fetch($object->typeid); @@ -1158,9 +1132,7 @@ if ($rowid > 0) //print ''; //print ''; -} -else -{ +} else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); } diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 02941cb9967..303a4aa7b5a 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -85,9 +85,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance if ($accountline->rappro) { $errmsg = $langs->trans("SubscriptionLinkedToConciliatedTransaction"); - } - else - { + } else { $accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $accountline->amount = $_POST["amount"]; @@ -116,17 +114,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance header("Location: card.php?rowid=".$object->id); exit; - } - else - { + } else { $db->rollback(); if ($object->error) { $errmsg = $object->error; - } - else - { + } else { foreach ($object->errors as $error) { if ($errmsg) $errmsg .= '
'; @@ -135,9 +129,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance } $action = ''; } - } - else - { + } else { $db->rollback(); } } @@ -151,9 +143,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent- { header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent); exit; - } - else - { + } else { $mesg = $adh->error; } } @@ -248,9 +238,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') $bankline = new AccountLine($db); $result = $bankline->fetch($object->fk_bank); print $bankline->getNomUrl(1, 0, 'showall'); - } - else - { + } else { print $langs->trans("NoneF"); } print ''; @@ -355,9 +343,7 @@ if ($rowid && $action != 'edit') $bankline = new AccountLine($db); $result = $bankline->fetch($object->fk_bank); print $bankline->getNomUrl(1, 0, 'showall'); - } - else - { + } else { print $langs->trans("NoneF"); } print ''; @@ -382,9 +368,7 @@ if ($rowid && $action != 'edit') if (!$bankline->rappro) { print '
".$langs->trans("Modify")."
"; - } - else - { + } else { print '
".$langs->trans("Modify")."
"; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e3059ade21e..66d8c6b773a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4047,8 +4047,8 @@ function dol_print_error($db = '', $error = '', $errors = null) } if (empty($dolibarr_main_prod)) print $out; - else // This should not happen, except if there is a bug somewhere. Enabled and check log in such case. - { + else { + // This should not happen, except if there is a bug somewhere. Enabled and check log in such case. print 'This website or feature is currently temporarly not available.

This may be due to a maintenance operation. Current status of operation are on next line...

'."\n"; $langs->load("errors"); print $langs->trans("DolibarrHasDetectedError").'. ';