Fix scrutinizer
This commit is contained in:
parent
e10051800d
commit
f670f71df9
@ -41,8 +41,8 @@ if (!$user->rights->categorie->lire) accessforbidden();
|
|||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$origin = GETPOST('origin', 'alpha');
|
$origin = GETPOST('origin', 'alpha');
|
||||||
$catorigin = GETPOST('catorigin', 'int');
|
$catorigin = GETPOST('catorigin', 'int');
|
||||||
$type = GETPOST('type', 'alpha');
|
$type = GETPOST('type', 'aZ09');
|
||||||
$urlfrom = GETPOST('urlfrom', 'alpha');
|
$urlfrom = GETPOST('urlfrom', 'alpha');
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
@ -73,6 +73,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard'));
|
$hookmanager->initHooks(array('categorycard'));
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -127,7 +129,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
|||||||
$object->label = $label;
|
$object->label = $label;
|
||||||
$object->color = $color;
|
$object->color = $color;
|
||||||
$object->description = dol_htmlcleanlastbr($description);
|
$object->description = dol_htmlcleanlastbr($description);
|
||||||
$object->socid = ($socid ? $socid : 'null');
|
$object->socid = ($socid > 0 ? $socid : 0);
|
||||||
$object->visible = $visible;
|
$object->visible = $visible;
|
||||||
$object->type = $type;
|
$object->type = $type;
|
||||||
|
|
||||||
|
|||||||
@ -424,17 +424,17 @@ class Categorie extends CommonObject
|
|||||||
$sql .= " fk_user_creat";
|
$sql .= " fk_user_creat";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= (int) $this->fk_parent.",";
|
$sql .= (int) $this->fk_parent.",";
|
||||||
$sql .= "'".$this->db->escape($this->label)."',";
|
$sql .= "'".$this->db->escape($this->label)."', ";
|
||||||
$sql .= "'".$this->db->escape($this->description)."',";
|
$sql .= "'".$this->db->escape($this->description)."', ";
|
||||||
$sql .= "'".$this->db->escape($this->color)."',";
|
$sql .= "'".$this->db->escape($this->color)."', ";
|
||||||
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
|
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
|
||||||
$sql .= ($this->socid != -1 ? $this->socid : 'null').",";
|
$sql .= ($this->socid > 0 ? $this->socid : 'null').", ";
|
||||||
}
|
}
|
||||||
$sql .= "'".$this->db->escape($this->visible)."',";
|
$sql .= "'".$this->db->escape($this->visible)."', ";
|
||||||
$sql .= $this->db->escape($type).",";
|
$sql .= $this->db->escape($type).", ";
|
||||||
$sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').",";
|
$sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').", ";
|
||||||
$sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').",";
|
$sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').", ";
|
||||||
$sql .= (int) $conf->entity.",";
|
$sql .= (int) $conf->entity.", ";
|
||||||
$sql .= "'".$this->db->idate($now)."', ";
|
$sql .= "'".$this->db->idate($now)."', ";
|
||||||
$sql .= (int) $user->id;
|
$sql .= (int) $user->id;
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
@ -516,7 +516,7 @@ class Categorie extends CommonObject
|
|||||||
$sql .= " ref_ext = '".$this->db->escape($this->ref_ext)."',";
|
$sql .= " ref_ext = '".$this->db->escape($this->ref_ext)."',";
|
||||||
$sql .= " color = '".$this->db->escape($this->color)."'";
|
$sql .= " color = '".$this->db->escape($this->color)."'";
|
||||||
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
|
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
|
||||||
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');
|
$sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : 'null');
|
||||||
}
|
}
|
||||||
$sql .= ", visible = ".(int) $this->visible;
|
$sql .= ", visible = ".(int) $this->visible;
|
||||||
$sql .= ", fk_parent = ".(int) $this->fk_parent;
|
$sql .= ", fk_parent = ".(int) $this->fk_parent;
|
||||||
|
|||||||
@ -65,6 +65,8 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('categorycard'));
|
$hookmanager->initHooks(array('categorycard'));
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -81,7 +83,7 @@ if ($action == 'update' && $user->rights->categorie->creer) {
|
|||||||
$object->label = $label;
|
$object->label = $label;
|
||||||
$object->description = dol_htmlcleanlastbr($description);
|
$object->description = dol_htmlcleanlastbr($description);
|
||||||
$object->color = $color;
|
$object->color = $color;
|
||||||
$object->socid = ($socid ? $socid : 'null');
|
$object->socid = ($socid > 0 ? $socid : 0);
|
||||||
$object->visible = $visible;
|
$object->visible = $visible;
|
||||||
$object->fk_parent = $parent != -1 ? $parent : 0;
|
$object->fk_parent = $parent != -1 ? $parent : 0;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user