demandes_notes::save($notes);
        demandes_notes::note_majParent($notes->id_note, $notes->num_action, $actions->num_demande, "_gestion");
        demandes_notes::note_majParent($notes->id_note, $notes->num_action, $actions->num_demande, "_opac");
        $actions->fetch_data($notes->num_action, false);
        if ($redirectto == "demandes-show_consult_form") {
            $demande = new demandes($actions->num_demande);
            $demande->show_consult_form($notes->num_action);
        } else {
            $actions->show_consultation_form();
        }
        break;
    case 'reponse':
        $notes->show_modif_form(true);
        break;
    case 'save_note':
        demandes_notes::get_values_from_form($notes);
        demandes_notes::save($notes);
        demandes_notes::note_majParent($notes->id_note, $notes->num_action, $actions->num_demande, "_gestion");
        demandes_notes::note_majParent($notes->id_note, $notes->num_action, $actions->num_demande, "_opac");
        $actions->fetch_data($idaction, false);
        $actions->show_consultation_form();
        break;
    case 'modif_note':
        $notes->show_modif_form();
        break;
    case 'suppr_note':
        demandes_notes::delete($notes);
        $actions->fetch_data($idaction, false);
        $actions->show_consultation_form();
        break;
}
 static function delete(demandes_actions $action)
 {
     global $dbh, $chk;
     if ($action->id_action) {
         $action->fetch_data($action->id_action, false);
         if (sizeof($action->notes)) {
             foreach ($action->notes as $note) {
                 demandes_notes::delete($note);
             }
         }
         $req = "delete from demandes_actions where id_action='" . $action->id_action . "'";
         pmb_mysql_query($req, $dbh);
         $q = "delete ed,eda from explnum_doc ed join explnum_doc_actions eda on ed.id_explnum_doc=eda.num_explnum_doc where eda.num_action={$action->id_action}";
         pmb_mysql_query($q, $dbh);
         audit::delete_audit(AUDIT_ACTION, $action->id_action);
     }
 }
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: demandes_notes.inc.php,v 1.2 2010-02-23 16:27:22 kantin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/demandes_notes.class.php";
require_once $class_path . "/demandes_actions.class.php";
$notes = new demandes_notes($idnote, $idaction);
$actions = new demandes_actions($idaction);
switch ($act) {
    case 'add_note':
        $notes->show_modif_form();
        break;
    case 'reponse':
        $notes->show_modif_form(true);
        break;
    case 'modif_note':
        $notes->show_modif_form();
        break;
    case 'suppr_note':
        $notes->delete();
        $actions->show_consultation_form();
        break;
}