$id_rubrique_new); foreach ($ids as $id) { if (autoriser('modifier', $objet, $id)) { if ($err = objet_modifier($objet, $id, $modifs)) { $errors["$objet-$id"] = $err; } else { $success["$objet-$id"] = true; } } else { $errors["$objet-$id"] = _T('plan:erreur_autorisation_insuffisante') . ' ' . _T('plan:erreur_deplacement_impossible'); } } // dans certains cas… on ne reçoit pas d'erreur… et pourtant ! if (!$errors) { // on verifie qu'il n'y a plus d'objets à l'ancien emplacement $ids = sql_allfetsel( $_id_table, $table, array(sql_in($_id_table, $ids), $champ . '=' . sql_quote($id_rubrique_old)) ); $ids = array_map('array_shift', $ids); if ($ids) { foreach ($ids as $id) { $errors["$objet-$id"] = _T('plan:erreur_deplacement'); unset($success["$objet-$id"]); } } } return plan_json_envoi(array( 'done' => true, 'success' => $success, 'errors' => $errors, )); } function plan_json_envoi($data) { header('Content-Type: application/json; charset=' . $GLOBALS['meta']['charset']); echo json_encode($data); } function plan_json_erreur($msg) { return plan_json_envoi(array( 'done' => false, 'success' => array(), 'errors' => array($msg) )); }