$action = ''; } // Validation de l'ajout if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) { $object->fetch($id); $current_lang = $langs->getDefaultLang(); // update de l'objet if ($_POST["forcelangprod"] == $current_lang) { $object->label = $_POST["libelle"]; $object->description = dol_htmlcleanlastbr($_POST["desc"]); } else { $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"]; $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); } // sauvegarde en base if ($object->setMultiLangs() > 0) { $action = ''; } else { $action = 'add'; setEventMessage($object->error, 'errors'); } } // Validation de l'edition if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) { $object->fetch($id); $current_lang = $langs->getDefaultLang(); foreach ($object->multilangs as $key => $value) { if ($key == $current_lang) { $object->label = $_POST["libelle-" . $key]; $object->description = dol_htmlcleanlastbr($_POST["desc-" . $key]); } else {
$action = ''; } // Validation de l'ajout if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) { $object->fetch($id); $current_lang = $langs->getDefaultLang(); // update de l'objet if ($_POST["forcelangprod"] == $current_lang) { $object->label = $_POST["libelle"]; $object->description = dol_htmlcleanlastbr($_POST["desc"]); } else { $object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"]; $object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]); } // sauvegarde en base if ($object->setMultiLangs($user) > 0) { $action = ''; } else { $action = 'add'; setEventMessages($object->error, $object->errors, 'errors'); } } // Validation de l'edition if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->categorie->creer) { $object->fetch($id); $current_lang = $langs->getDefaultLang(); foreach ($object->multilangs as $key => $value) { if ($key == $current_lang) { $object->label = $_POST["libelle-" . $key]; $object->description = dol_htmlcleanlastbr($_POST["desc-" . $key]); } else {