mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix edit of categories
This commit is contained in:
parent
3f7b705674
commit
291a0d46e6
|
|
@ -145,7 +145,7 @@ if ($action == 'add')
|
|||
if ($id > 0)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories');
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
$_GET["id"]=$id; // Force chargement page en mode visu
|
||||
|
|
@ -239,7 +239,7 @@ if ($action == 'update')
|
|||
if ($result >= 0)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories');
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
$_GET["id"]=$_POST["id"]; // Force chargement page en mode visu
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ if (empty($reshook))
|
|||
$action = 'create';
|
||||
} else {
|
||||
// Categories association
|
||||
$contcats = GETPOST( 'contcats', 'array' );
|
||||
$contcats = GETPOST( 'contcats', 'array');
|
||||
$object->setCategories($contcats);
|
||||
}
|
||||
}
|
||||
|
|
@ -383,7 +383,7 @@ if (empty($reshook))
|
|||
$db->query( $sql );
|
||||
|
||||
// Then we add the associated categories
|
||||
$categories = GETPOST( 'contcats', 'array' );
|
||||
$categories = GETPOST( 'contcats', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
$object->old_lastname='';
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ if (empty($reshook))
|
|||
if ($id > 0)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories');
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
|
|
@ -444,7 +444,7 @@ if (empty($reshook))
|
|||
if ($object->update($object->id, $user) > 0)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories');
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
$action = 'view';
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ if (empty($reshook))
|
|||
if (! $error && !empty($object->id) > 0)
|
||||
{
|
||||
// Category association
|
||||
$categories = GETPOST('categories');
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$result=$object->setCategories($categories);
|
||||
if ($result<0) {
|
||||
$langs->load("errors");
|
||||
|
|
@ -282,7 +282,7 @@ if (empty($reshook))
|
|||
else setEventMessages($object->error, $object->errors, 'errors');
|
||||
}else {
|
||||
// Category association
|
||||
$categories = GETPOST('categories');
|
||||
$categories = GETPOST('categories', 'array');
|
||||
$result=$object->setCategories($categories);
|
||||
if ($result < 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ if (empty($reshook))
|
|||
}
|
||||
|
||||
// Customer categories association
|
||||
$custcats = GETPOST( 'custcats', 'array' );
|
||||
$custcats = GETPOST('custcats', 'array');
|
||||
$object->setCategories($custcats, 'customer');
|
||||
|
||||
// Supplier categories association
|
||||
|
|
@ -607,7 +607,7 @@ if (empty($reshook))
|
|||
}
|
||||
|
||||
// Customer categories association
|
||||
$categories = GETPOST( 'custcats', 'array' );
|
||||
$categories = GETPOST('custcats', 'array');
|
||||
$object->setCategories($categories, 'customer');
|
||||
|
||||
// Supplier categories association
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
if (! empty($conf->categorie->enabled)) {
|
||||
// Categories association
|
||||
$usercats = GETPOST( 'usercats', 'array' );
|
||||
$usercats = GETPOST('usercats', 'array');
|
||||
$object->setCategories($usercats);
|
||||
}
|
||||
$db->commit();
|
||||
|
|
@ -478,7 +478,7 @@ if (empty($reshook)) {
|
|||
if (! $error && ! count($object->errors))
|
||||
{
|
||||
// Then we add the associated categories
|
||||
$categories = GETPOST( 'usercats', 'array' );
|
||||
$categories = GETPOST('usercats', 'array');
|
||||
$object->setCategories($categories);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user