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 '| '.img_picto_common('', 'treemenu/branchbottom.gif').' | ';
print '';
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 ' ';
}
-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 '';
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 '| '.$langs->trans("ThisCategoryHasNoItems").' | ';
}
print " \n";
@@ -534,8 +527,7 @@ if ($type == Categorie::TYPE_SUPPLIER)
{
dol_print_error($db, $socs->error, $socs->errors);
}
- else
- {
+ else {
print ' | \n";
}
}
- else
- {
+ else {
print '| '.$langs->trans("ThisCategoryHasNoItems").' | ';
}
print " \n";
@@ -595,8 +586,7 @@ if ($type == Categorie::TYPE_CUSTOMER)
{
dol_print_error($db, $socs->error, $socs->errors);
}
- else
- {
+ else {
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 '\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';
}