示例#1
0
 static function save(&$action)
 {
     global $dbh, $pmb_type_audit;
     if ($action->id_action) {
         //MODIFICATION
         $query = "UPDATE demandes_actions SET\n\t\t\tsujet_action='" . $action->sujet_action . "',\n\t\t\ttype_action='" . $action->type_action . "',\n\t\t\tstatut_action='" . $action->statut_action . "',\n\t\t\tdetail_action='" . $action->detail_action . "',\n\t\t\tdate_action='" . $action->date_action . "',\n\t\t\tdeadline_action='" . $action->deadline_action . "',\n\t\t\ttemps_passe='" . $action->time_elapsed . "',\n\t\t\tcout='" . $action->cout . "',\n\t\t\tprogression_action='" . $action->progression_action . "',\n\t\t\tprive_action='" . $action->prive_action . "',\n\t\t\tnum_demande='" . $action->num_demande . "',\n\t\t\tactions_read_gestion='1',\n\t\t\tactions_read_opac='1' \n\t\t\tWHERE id_action='" . $action->id_action . "'";
         pmb_mysql_query($query, $dbh);
         //audit
         if ($pmb_type_audit) {
             audit::insert_modif(AUDIT_ACTION, $action->id_action);
         }
     } else {
         //CREATION
         $query = "INSERT INTO demandes_actions SET\n\t\t\tsujet_action='" . $action->sujet_action . "',\n\t\t\ttype_action='" . $action->type_action . "',\n\t\t\tstatut_action='" . $action->statut_action . "',\n\t\t\tdetail_action='" . $action->detail_action . "',\n\t\t\tdate_action='" . $action->date_action . "',\n\t\t\tdeadline_action='" . $action->deadline_action . "',\n\t\t\ttemps_passe='" . $action->time_elapsed . "',\n\t\t\tcout='" . $action->cout . "',\n\t\t\tprogression_action='" . $action->progression_action . "',\n\t\t\tprive_action='" . $action->prive_action . "',\n\t\t\tnum_demande='" . $action->num_demande . "',\n\t\t\tactions_num_user='******',\n\t\t\tactions_type_user='******',\n\t\t\tactions_read_gestion='1',\n\t\t\tactions_read_opac='1'\n\t\t\t";
         pmb_mysql_query($query, $dbh);
         $action->id_action = pmb_mysql_insert_id($dbh);
         // audit
         if ($pmb_type_audit) {
             audit::insert_modif(AUDIT_ACTION, $action->id_action);
         }
         //Création d'une note automatiquement
         if ($action->detail_action && $action->detail_action !== "") {
             $note = new demandes_notes();
             $note->num_action = $action->id_action;
             $note->date_note = date("Y-m-d h:i:s", time());
             $note->rapport = 0;
             $note->contenu = $action->detail_action;
             $note->notes_num_user = $action->actions_num_user;
             $note->notes_type_user = $action->actions_type_user;
             demandes_notes::save($note);
         }
     }
 }
示例#2
0
 case 'save_action':
     $actions->save();
     $actions->show_consultation_form();
     break;
 case 'modif':
     $actions->show_modif_form();
     break;
 case 'see':
     $actions->show_consultation_form();
     break;
 case 'suppr_action':
     $actions->delete();
     $demandes->show_consult_form();
     break;
 case 'save_note':
     $notes->save();
     $actions->show_consultation_form();
     break;
 case 'suppr_note':
     $notes->delete();
     $actions->show_consultation_form();
     break;
 case 'add_docnum':
     $actions->show_docnum_form();
     break;
 case 'save_docnum':
     if ($f_url) {
         $explnum_doc->explnum_doc_url = stripslashes($f_url);
         $explnum_doc->explnum_doc_mime = 'URL';
         $explnum_doc->explnum_doc_nomfichier = stripslashes($f_nom ? $f_nom : $f_url);
         $explnum_doc->save();
        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;
}
     demandes::get_values_from_form($demandes);
     demandes::save($demandes);
     $demandes->fetch_data($demandes->id_demande, false);
     $demandes->show_consult_form();
     break;
 case 'add_demande':
     $demandes->show_modif_form();
     break;
 case 'add_action':
     $demandes_action->type_action = $type_action;
     $demandes_action->num_demande = $iddemande;
     $demandes_action->show_modif_form();
     break;
 case 'add_note':
     demandes_notes::get_values_from_form($demande_note);
     demandes_notes::save($demande_note);
     demandes_notes::note_majParent($demande_note->id_note, $demande_note->num_action, $demandes_action->num_demande, "_gestion");
     demandes_notes::note_majParent($demande_note->id_note, $demande_note->num_action, $demandes_action->num_demande, "_opac");
     $demandes_action->fetch_data($demande_note->num_action, false);
     $demandes->show_consult_form($demande_note->num_action);
     break;
 case 'open_action':
     $demandes_action->fetch_data($demandes_action->id_action, false);
     $demandes_action->show_consultation_form();
     break;
 case 'open_demande':
     $demandes->fetch_data($demandes->id_demande, false);
     $demandes->show_consult_form($last_modified);
     break;
 case 'see_demandes':
 default: