diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 6dd313692db..017de5cd1e6 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -48,8 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages($db->lasterror(), null, 'errors'); } } @@ -62,8 +61,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages($db->lasterror(), null, 'errors'); } } @@ -108,14 +106,12 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('CATEGORIE_RECURSIV_ADD'); } -else -{ +else { if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else - { + else { print ''.img_picto($langs->trans("Enabled"), 'on').''; } } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 67adacb5aae..a91a3df7827 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -119,8 +119,7 @@ if ($action == 'add' && $user->rights->categorie->creer) header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); exit; } @@ -156,8 +155,7 @@ if ($action == 'add' && $user->rights->categorie->creer) $action = 'confirmed'; $_POST["addcat"] = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index d6eff682908..205e38f3e5e 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -244,8 +244,7 @@ class Categories extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->category->error); } } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index dc451855c0a..d8f5ef4eeeb 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -321,8 +321,7 @@ class Categorie extends CommonObject { $sql .= " WHERE ref_ext LIKE '".$this->db->escape($ref_ext)."'"; } - else - { + else { $sql .= " WHERE label = '".$this->db->escape($label)."' AND entity IN (".getEntity('category').")"; if (!is_null($type)) $sql .= " AND type = ".$this->db->escape($type); } @@ -362,13 +361,11 @@ class Categorie extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -483,20 +480,17 @@ class Categorie extends CommonObject $this->db->commit(); return $id; } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -574,8 +568,7 @@ class Categorie extends CommonObject return 1; } - else - { + else { $this->db->rollback(); dol_print_error($this->db); return -1; @@ -661,8 +654,7 @@ class Categorie extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -722,8 +714,7 @@ class Categorie extends CommonObject } } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -748,22 +739,19 @@ class Categorie extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $this->db->lasterrno(); return -3; } - else - { + else { $this->error = $this->db->lasterror(); } return -1; @@ -815,14 +803,12 @@ class Categorie extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -874,8 +860,7 @@ class Categorie extends CommonObject { $objs[] = $rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])]; } - else - { + else { $obj = new $this->MAP_OBJ_CLASS[$type]($this->db); $obj->fetch($rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])]); $objs[] = $obj; @@ -883,8 +868,7 @@ class Categorie extends CommonObject } return $objs; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -1046,8 +1030,7 @@ class Categorie extends CommonObject } return $cats; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1080,8 +1063,7 @@ class Categorie extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1124,8 +1106,7 @@ class Categorie extends CommonObject { $markafterid = array($markafterid); } - else - { + else { $markafterid = array(); } } @@ -1166,8 +1147,7 @@ class Categorie extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -1312,8 +1292,7 @@ class Categorie extends CommonObject } return $cats; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1376,8 +1355,7 @@ class Categorie extends CommonObject dol_syslog(get_class($this)."::already_exists no category with same name=".$this->label." and same parent ".$this->fk_parent." than category id=".$this->id, LOG_DEBUG); return 0; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1430,8 +1408,7 @@ class Categorie extends CommonObject $linkend = ''; $w[] = $link.($addpicto ? img_object('', 'category', 'class="paddingright"') : '').$cat->label.$linkend; } - else - { + else { $w[] = "".($addpicto ? img_object('', 'category') : '').$cat->label.""; } } @@ -1473,8 +1450,7 @@ class Categorie extends CommonObject } return $parents; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1554,14 +1530,12 @@ class Categorie extends CommonObject } } } - else - { + else { dol_print_error($this->db); return -1; } } - else - { + else { $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as ct, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id." AND c.type = ".$this->MAP_ID[$type]; @@ -1583,8 +1557,7 @@ class Categorie extends CommonObject } } } - else - { + else { dol_print_error($this->db); return -1; } @@ -1632,8 +1605,7 @@ class Categorie extends CommonObject $nom = '%'.str_replace('*', '%', $nom).'%'; if (!$case) $sql .= " AND label LIKE '".$this->db->escape($nom)."'"; - else - $sql .= " AND label LIKE BINARY '".$this->db->escape($nom)."'"; + else $sql .= " AND label LIKE BINARY '".$this->db->escape($nom)."'"; } if ($id) { @@ -1652,8 +1624,7 @@ class Categorie extends CommonObject return $cats; } - else - { + else { $this->error = $this->db->error().' sql='.$sql; return -1; } @@ -1879,8 +1850,7 @@ class Categorie extends CommonObject $sql2 .= " description='".$this->db->escape($this->description)."'"; $sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'"; } - else - { + else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)"; $sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->label); $sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')"; @@ -1901,8 +1871,7 @@ class Categorie extends CommonObject $sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; $sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'"; } - else - { + else { $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)"; $sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->multilangs["$key"]["label"]); $sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')"; @@ -1961,8 +1930,7 @@ class Categorie extends CommonObject } return 1; } - else - { + else { $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; return -1; } @@ -2067,8 +2035,7 @@ class Categorie extends CommonObject { return " AND (".implode(' AND ', $searchCategorySqlList).")"; } - else - { + else { return ""; } } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 48bd82b9326..dfd8f01f381 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -90,8 +90,7 @@ if ($action == 'update' && $user->rights->categorie->creer) if ($parent != "-1") $object->fk_parent = $parent; - else - $object->fk_parent = ""; + else $object->fk_parent = ""; if (empty($object->label)) @@ -110,13 +109,11 @@ if ($action == 'update' && $user->rights->categorie->creer) header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index b36101750f2..d88e1a0ff8c 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -54,7 +54,7 @@ $typetext = $type; if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea'); elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea'); elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea'); -else $title = $langs->trans(ucfirst($type).'sCategoriesArea'); +else $title = $langs->trans(ucfirst($type).'sCategoriesArea'); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); @@ -207,8 +207,7 @@ if ($nbofentries > 0) tree_recur($data, $data[0], 0); print ''; } -else -{ +else { print ''; print ''; print ''; print ''; } -else -{ +else { $categstatic = new Categorie($db); $fulltree = $categstatic->get_full_arbo($type, $object->id, 1); @@ -408,8 +404,7 @@ else print ''; print ''; } - else - { + else { print ''; print '\n"; } } - else - { + else { print ''; } print "
'.img_picto_common('', 'treemenu/branchbottom.gif').''; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 07e5d56d268..7443bc5b532 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -180,8 +180,7 @@ if ($object->id) print ''; print $langs->trans("AddPhoto").''; } - else - { + else { print ''; print $langs->trans("AddPhoto").''; } @@ -232,8 +231,7 @@ if ($object->id) { $filename = $obj['photo_vignette']; } - else - { + else { $filename = $obj['photo']; } @@ -281,8 +279,7 @@ if ($object->id) } } } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 803b4ae34ab..921a1f12061 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -162,8 +162,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -181,14 +180,12 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' { setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs'); } - else - { + else { if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -337,8 +334,7 @@ elseif (count($cats) < 1) print ''.$langs->trans("NoSubCat").'
'; print ''; @@ -451,8 +446,7 @@ if ($type == Categorie::TYPE_PRODUCT) { dol_print_error($db, $prods->error, $prods->errors); } - else - { + else { // Form to add record into a category $showclassifyform = 1; if ($showclassifyform) @@ -515,8 +509,7 @@ if ($type == Categorie::TYPE_PRODUCT) print "\n"; } } - else - { + else { print ''; } print "
'.$langs->trans("ThisCategoryHasNoItems").'
\n"; @@ -534,8 +527,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { dol_print_error($db, $socs->error, $socs->errors); } - else - { + else { print '
'; print ''; print ''; @@ -576,8 +568,7 @@ if ($type == Categorie::TYPE_SUPPLIER) print "
'.$langs->trans("ThisCategoryHasNoItems").'
\n"; @@ -595,8 +586,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { dol_print_error($db, $socs->error, $socs->errors); } - else - { + else { print ''; print ''; print ''; @@ -636,8 +626,7 @@ if ($type == Categorie::TYPE_CUSTOMER) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -658,8 +647,7 @@ if ($type == Categorie::TYPE_MEMBER) { dol_print_error($db, $prods->error, $prods->errors); } - else - { + else { print ''; print ''; print ''; @@ -701,8 +689,7 @@ if ($type == Categorie::TYPE_MEMBER) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -721,8 +708,7 @@ if ($type == Categorie::TYPE_CONTACT) { dol_print_error($db, $contacts->error, $contacts->errors); } - else - { + else { print ''; print ''; print ''; @@ -765,8 +751,7 @@ if ($type == Categorie::TYPE_CONTACT) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -787,8 +772,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { dol_print_error($db, $accounts->error, $accounts->errors); } - else - { + else { print ''; print ''; print ''; @@ -829,8 +813,7 @@ if ($type == Categorie::TYPE_ACCOUNT) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -851,8 +834,7 @@ if ($type == Categorie::TYPE_PROJECT) { dol_print_error($db, $object->error, $object->errors); } - else - { + else { print ''; print ''; print ''; @@ -894,8 +876,7 @@ if ($type == Categorie::TYPE_PROJECT) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -914,8 +895,7 @@ if ($type == Categorie::TYPE_USER) { dol_print_error($db, $object->error, $object->errors); } - else - { + else { print ''; print ''; print ''; @@ -954,8 +934,7 @@ if ($type == Categorie::TYPE_USER) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; @@ -977,8 +956,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { dol_print_error($db, $object->error, $object->errors); } - else - { + else { print ''; print ''; print ''; @@ -1020,8 +998,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) print "\n"; } } - else - { + else { print ''.$langs->trans("ThisCategoryHasNoItems").''; } print "\n"; diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index c570e12ba31..f6344f4ebf0 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -95,8 +95,7 @@ if ($action == 'add') setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs'); $action = ''; } - else - { + else { $db->rollback(); } @@ -130,13 +129,11 @@ if ($action == 'delete') header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); exit; } - else - { + else { $db->rollback(); } } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index e8e7fa4f5b9..514d79dcd77 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -71,14 +71,12 @@ if ($action == 'specimen') header("Location: ".DOL_URL_ROOT."/document.php?modulepart=donation&file=SPECIMEN.html"); 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); } @@ -130,8 +128,7 @@ if ($action == 'set_DONATION_ACCOUNTINGACCOUNT') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -148,8 +145,7 @@ if ($action == 'set_DONATION_MESSAGE') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -165,8 +161,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -179,8 +174,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { dol_print_error($db); } } @@ -223,8 +217,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -276,15 +269,13 @@ if (is_resource($handle)) print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; print ''; } } - else - { + else { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; @@ -297,8 +288,7 @@ if (is_resource($handle)) print img_picto($langs->trans("Default"), 'on'); print ''; } - else - { + else { print ""; print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; print ''; @@ -371,8 +361,7 @@ if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); } -else -{ +else { print ''; } print ''; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 505d2fbed29..7af11d46ebf 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -181,8 +181,7 @@ if ($action == 'add') header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -196,8 +195,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights- header("Location: index.php"); exit; } - else - { + else { dol_syslog($object->error, LOG_DEBUG); setEventMessages($object->error, $object->errors, 'errors'); } @@ -355,8 +353,7 @@ if ($action == 'create') print ')'; print ''; } - else - { + else { print ''; print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer informations. Note, this clear other input @@ -520,8 +517,7 @@ if (!empty($id) && $action == 'edit') { print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).''; } - else - { + else { print ''.$langs->trans("Amount").''; print price($object->amount, 0, $langs, 0, 0, -1, $conf->currency); print ''; @@ -777,8 +773,7 @@ if (!empty($id) && $action != 'edit') print ""; $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -815,8 +810,7 @@ if (!empty($id) && $action != 'edit') { print '
'.$langs->trans('DoPayment').'
'; } - else - { + else { print '
'.$langs->trans('DoPayment').'
'; } } @@ -834,13 +828,11 @@ if (!empty($id) && $action != 'edit') { print '
'.$langs->trans("Delete")."
"; } - else - { + else { print '
'.$langs->trans("Delete")."
"; } } - else - { + else { print '
'.$langs->trans("Delete")."
"; } diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 872e2009b9b..69bd1e58042 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -231,8 +231,7 @@ class Donations extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->don->error); } } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 59c293e6386..f80feff1869 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -315,8 +315,7 @@ class Don extends CommonObject $error_string[] = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Amount')); $err++; } - else - { + else { if ($this->amount < $minimum && $minimum > 0) { $error_string[] = $langs->trans('MinimumAmount', $langs->transnoentitiesnoconv('$minimum')); @@ -330,8 +329,7 @@ class Don extends CommonObject $this->errors = $error_string; return 0; } - else - { + else { return 1; } } @@ -423,8 +421,7 @@ class Don extends CommonObject // End call triggers } } - else - { + else { $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); $error++; @@ -453,8 +450,7 @@ class Don extends CommonObject $this->db->commit(); return $ret; } - else - { + else { $this->db->rollback(); return -1; } @@ -534,14 +530,12 @@ class Don 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(); @@ -613,8 +607,7 @@ class Don extends CommonObject $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -709,8 +702,7 @@ class Don extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -762,8 +754,7 @@ class Don extends CommonObject } } } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -773,8 +764,7 @@ class Don extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -805,13 +795,11 @@ class Don extends CommonObject { return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -836,13 +824,11 @@ class Don extends CommonObject { return 1; } - else - { + else { return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -905,8 +891,7 @@ class Don extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -991,8 +976,7 @@ class Don extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -1089,16 +1073,14 @@ class Don extends CommonObject dol_delete_preview($object); return 1; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_syslog("Erreur dans don_create"); dol_print_error($this->db, $obj->error); return 0; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 64644d18971..416884c3a24 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -168,8 +168,7 @@ class PaymentDonation extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_donation"); $this->ref = $this->id; } - else - { + else { $error++; } } @@ -189,8 +188,7 @@ class PaymentDonation extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -259,8 +257,7 @@ class PaymentDonation extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -342,8 +339,7 @@ class PaymentDonation extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -412,8 +408,7 @@ class PaymentDonation extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -467,8 +462,7 @@ class PaymentDonation extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -593,8 +587,7 @@ class PaymentDonation extends CommonObject } } } - else - { + else { $this->error = $acc->error; $error++; } @@ -604,8 +597,7 @@ class PaymentDonation extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -629,8 +621,7 @@ class PaymentDonation extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/don/document.php b/htdocs/don/document.php index f2994b95577..98884af9c6f 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -187,8 +187,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/don/list.php b/htdocs/don/list.php index 65ec24b1458..8c5ad9a36e0 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -284,8 +284,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index e1784dc4b8b..57d5fe160a0 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -64,8 +64,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp header("Location: ".DOL_URL_ROOT."/don/index.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -102,8 +101,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->cree header('Location: card.php?id='.$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -254,8 +252,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -290,8 +287,7 @@ if (empty($action)) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index b3ab7e2d360..162193dc51d 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -138,8 +138,7 @@ if ($action == 'add_payment') header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -261,8 +260,7 @@ if ($action == 'create') $namef = "amount_".$objp->id; print ''; } - else - { + else { print '-'; } print ""; diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 46b0d93d564..247656dc2ad 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -76,8 +76,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; }