show_statut($dbh); break; case 'add': if (empty($form_gestion_libelle)) { statut_form(); } else { show_statut($dbh); } break; case 'modif': if ($id) { $requete = "SELECT id_notice_statut, gestion_libelle, opac_libelle, notice_visible_opac, notice_visible_gestion, expl_visible_opac, class_html, notice_visible_opac_abon, expl_visible_opac_abon, explnum_visible_opac, explnum_visible_opac_abon FROM notice_statut WHERE id_notice_statut='{$id}'"; $res = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($res)) { $row = pmb_mysql_fetch_object($res); statut_form($row->id_notice_statut, $row->gestion_libelle, $row->opac_libelle, $row->notice_visible_opac, $row->notice_visible_gestion, $row->expl_visible_opac, $row->class_html, $row->notice_visible_opac_abon, $row->expl_visible_opac_abon, $row->explnum_visible_opac, $row->explnum_visible_opac_abon); } else { show_statut($dbh); } } else { show_statut($dbh); } break; case 'del': if ($id && $id != 1 && $id != 2) { $total = 0; $total = pmb_mysql_result(pmb_mysql_query("select count(1) from notices where statut ='" . $id . "' ", $dbh), 0, 0); if ($total == 0) { $requete = "DELETE FROM notice_statut WHERE id_notice_statut='{$id}' "; $res = pmb_mysql_query($requete, $dbh); $requete = "OPTIMIZE TABLE notice_statut ";
show_statut($dbh); break; case 'add': if (empty($form_gestion_libelle)) { statut_form(); } else { show_statut($dbh); } break; case 'modif': if ($id) { $requete = "SELECT id_explnum_statut, gestion_libelle, opac_libelle, explnum_visible_opac, explnum_consult_opac, explnum_download_opac, class_html, explnum_visible_opac_abon, explnum_consult_opac_abon, explnum_download_opac_abon FROM explnum_statut WHERE id_explnum_statut='{$id}'"; $res = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($res)) { $row = pmb_mysql_fetch_object($res); statut_form($row->id_explnum_statut, $row->gestion_libelle, $row->opac_libelle, $row->explnum_visible_opac, $row->explnum_consult_opac, $row->explnum_download_opac, $row->class_html, $row->explnum_visible_opac_abon, $row->explnum_consult_opac_abon, $row->explnum_download_opac_abon); } else { show_statut($dbh); } } else { show_statut($dbh); } break; case 'del': if ($id && $id != 1) { $total = 0; $total = pmb_mysql_result(pmb_mysql_query("select count(1) from explnum where explnum_docnum_statut ='" . $id . "' ", $dbh), 0, 0); if ($total == 0) { $requete = "DELETE FROM explnum_statut WHERE id_explnum_statut='{$id}' "; $res = pmb_mysql_query($requete, $dbh); $requete = "OPTIMIZE TABLE explnum_statut ";
show_statut($dbh); break; case 'add': if (empty($form_gestion_libelle)) { statut_form(); } else { show_statut($dbh); } break; case 'modif': if ($id) { $requete = "SELECT * FROM arch_statut WHERE archstatut_id='{$id}'"; $res = mysql_query($requete, $dbh); if (mysql_num_rows($res)) { $row = mysql_fetch_object($res); statut_form($row->archstatut_id, $row->archstatut_gestion_libelle, $row->archstatut_opac_libelle, $row->archstatut_visible_opac, $row->archstatut_visible_gestion, $row->archstatut_class_html, $row->archstatut_visible_opac_abon); } else { show_statut($dbh); } } else { show_statut($dbh); } break; case 'del': if ($id) { $total = 0; $total = mysql_result(mysql_query("select count(1) from collections_state where collstate_statut ='" . $id . "' ", $dbh), 0, 0); if ($total == 0) { $requete = "DELETE FROM arch_statut WHERE archstatut_id='{$id}' "; $res = mysql_query($requete, $dbh); $requete = "OPTIMIZE TABLE arch_statut ";
show_statut($dbh); break; case 'add': if (empty($form_libelle) && empty($form_pret)) { statut_form(); } else { show_statut($dbh); } break; case 'modif': if ($id) { $requete = "SELECT * FROM docs_statut WHERE idstatut={$id} LIMIT 1 "; $res = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($res)) { $row = pmb_mysql_fetch_object($res); statut_form($row->statut_libelle, $row->pret_flag, $row->transfert_flag, $row->statusdoc_codage_import, $row->statusdoc_owner, $id, $row->statut_libelle_opac, $row->statut_visible_opac, $row->statut_allow_resa); } else { show_statut($dbh); } } else { show_statut($dbh); } break; case 'del': if ($id) { $total_serialcirc = 0; $total_serialcirc = pmb_mysql_result(pmb_mysql_query("select count(1) from serialcirc where serialcirc_expl_statut_circ='" . $id . "' or serialcirc_expl_statut_circ_after='" . $id . "'", $dbh), 0, 0); if ($total_serialcirc > 0) { error_message($msg[294], $msg["admin_docs_statut_serialcirc_delete_forbidden"], 1, 'admin.php?categ=docs&sub=statut&action='); } else { $total = 0;
show_statut($dbh); break; case 'add': if (empty($form_libelle)) { statut_form(); } else { show_statut($dbh); } break; case 'modif': if ($id) { $requete = "SELECT idstatut, statut_libelle, allow_loan, allow_loan_hist, allow_book, allow_opac, allow_dsi, allow_dsi_priv, allow_sugg, allow_liste_lecture, allow_dema, allow_prol, allow_avis, allow_tag, allow_pwd, allow_self_checkout, allow_self_checkin, allow_serialcirc, allow_scan_request FROM empr_statut WHERE idstatut={$id} "; $res = pmb_mysql_query($requete, $dbh); if (pmb_mysql_num_rows($res)) { $row = pmb_mysql_fetch_object($res); statut_form($row->statut_libelle, $row->allow_loan, $row->allow_loan_hist, $row->allow_book, $row->allow_opac, $row->allow_dsi, $row->allow_dsi_priv, $row->allow_sugg, $row->allow_liste_lecture, $row->allow_dema, $row->allow_prol, $row->allow_avis, $row->allow_tag, $row->allow_pwd, $row->allow_self_checkout, $row->allow_self_checkin, $row->allow_serialcirc, $row->allow_scan_request, $id); } else { show_statut($dbh); } } else { show_statut($dbh); } break; case 'del': if ($id > 2) { $total = 0; $total = pmb_mysql_result(pmb_mysql_query("select count(1) from empr where empr_statut ='" . $id . "' ", $dbh), 0, 0); if ($total == 0) { $requete = "DELETE FROM empr_statut WHERE idstatut={$id} "; $res = pmb_mysql_query($requete, $dbh); show_statut($dbh);
} break; case 'add': if (empty($libelle)) { statut_form(); } else { show_statut($dbh); } break; case 'modif': if ($id) { $requete = "SELECT libelle, duree, unite, retard_periodicite, seuil_periodicite,consultation_duration FROM abts_periodicites WHERE periodicite_id='{$id}'"; $res = mysql_query($requete, $dbh); if (mysql_num_rows($res)) { $row = mysql_fetch_object($res); statut_form($id, $row->libelle, $row->duree, $row->unite, $row->seuil_periodicite, $row->retard_periodicite, $row->consultation_duration); } } else { show_statut($dbh); } break; case 'del': if ($id) { $total = 0; $total = mysql_result(mysql_query("select count(1) from abts_modeles where num_periodicite ='" . $id . "' ", $dbh), 0, 0); if ($total == 0) { $requete = "DELETE FROM abts_periodicites WHERE periodicite_id='{$id}' "; $res = mysql_query($requete, $dbh); $requete = "OPTIMIZE TABLE abts_periodicites "; $res = mysql_query($requete, $dbh); show_statut($dbh);