Skip to content

Commit

Permalink
Merge pull request #8133 from atm-quentin/6.0
Browse files Browse the repository at this point in the history
FIX unset categorie
  • Loading branch information
eldy committed Feb 8, 2018
2 parents c988d3f + 3f17c92 commit 371b168
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions htdocs/societe/card.php
Expand Up @@ -519,15 +519,16 @@
$error=$object->error; $errors=$object->errors;
}
}



// Customer categories association
$custcats = GETPOST( 'custcats', 'array' );
$object->setCategories($custcats, 'customer');

// Supplier categories association
$suppcats = GETPOST('suppcats', 'array');
$object->setCategories($suppcats, 'supplier');

// Logo/Photo save
$dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
Expand Down Expand Up @@ -634,15 +635,16 @@
{
$error = $object->error; $errors = $object->errors;
}
// Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined)
if(!empty($user->rights->categorie->lire)){
// Customer categories association
$categories = GETPOST( 'custcats', 'array' );
$object->setCategories($categories, 'customer');

// Customer categories association
$categories = GETPOST( 'custcats', 'array' );
$object->setCategories($categories, 'customer');

// Supplier categories association
$categories = GETPOST('suppcats', 'array');
$object->setCategories($categories, 'supplier');

// Supplier categories association
$categories = GETPOST('suppcats', 'array');
$object->setCategories($categories, 'supplier');
}
// Logo/Photo save
$dir = $conf->societe->multidir_output[$object->entity]."/".$object->id."/logos";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
Expand Down

0 comments on commit 371b168

Please sign in to comment.