$msgNo = null;
if ($del) {
    // Supression des plages
    $obj->load();
    while ($repeat > 0) {
        if (!$obj->_id) {
            CAppUI::setMsg("Plage non trouvée", UI_MSG_ERROR);
        } else {
            if ($msg = $obj->delete()) {
                CAppUI::setMsg("Plage non supprimée", UI_MSG_ERROR);
                CAppUI::setMsg("Plage du {$obj->date}: {$msg}", UI_MSG_ERROR);
            } else {
                CAppUI::setMsg("Plage supprimée", UI_MSG_OK);
            }
        }
        $repeat -= $obj->becomeNext();
    }
    $_SESSION["dPbloc"]["id"] = null;
} else {
    //Modification des plages
    if ($obj->_id != 0) {
        $oldObj = new CPlageOp();
        $oldObj->load($obj->_id);
        $salle_id = $oldObj->salle_id;
        $chir_id = $oldObj->chir_id;
        $spec_id = $oldObj->spec_id;
        $secondary_function_id = $oldObj->secondary_function_id;
        while ($repeat > 0) {
            if ($obj->_id) {
                if ($msg = $obj->store()) {
                    CAppUI::setMsg("Plage non mise à jour", UI_MSG_ERROR);