示例#1
0
 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);
     }
 }
示例#2
0
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: notes_ajax.inc.php,v 1.5 2015-05-20 14:39:30 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$class_path}/demandes_actions.class.php";
require_once "{$class_path}/demandes_notes.class.php";
require_once "{$class_path}/demandes.class.php";
require_once "{$include_path}/templates/demandes_notes.tpl.php";
switch ($quoifaire) {
    case 'show_dialog':
        $action = new demandes_actions($id_action, false);
        ajax_http_send_response(demandes_notes::show_dialog($action->notes, $action->id_action, $action->num_demande, "demandes-show_consult_form", true));
        break;
    case 'change_read_note':
        $tab = json_decode(stripslashes($tab), true);
        $note = new demandes_notes($tab["id_note"], false);
        demandes_notes::change_read($note, "_gestion");
        ajax_http_send_response(demandes_notes::note_majParent($tab["id_note"], $tab["id_action"], $tab["id_demande"], "_gestion"));
        break;
    case 'final_response':
        $tab = json_decode(stripslashes($tab), true);
        $note = new demandes_notes($tab["id_note"], false);
        $f_message = addslashes($note->contenu);
        $demande = new demandes($tab["id_demande"]);
        $demande->save_repfinale($tab["id_note"]);
        ajax_http_send_response(demandes_notes::note_majParent($tab["id_note"], $tab["id_action"], $tab["id_demande"], "_gestion"));
        break;
}
示例#3
0
 static function show_dialog($notes, $num_action, $num_demande, $redirect_to = 'demandes_actions-show_consultation_form')
 {
     global $form_dialog_note, $dbh, $msg, $charset, $id_empr;
     $form_dialog_note = str_replace('!!redirectto!!', $redirect_to, $form_dialog_note);
     $form_dialog_note = str_replace('!!idaction!!', $num_action, $form_dialog_note);
     $form_dialog_note = str_replace('!!iddemande!!', $num_demande, $form_dialog_note);
     $dialog = '';
     if (sizeof($notes)) {
         foreach ($notes as $idNote => $note) {
             //Utilisateur ou lecteur ?
             if ($note->notes_type_user === "1") {
                 $side = 'note_opac';
             } elseif ($note->notes_type_user === "0") {
                 $side = 'note_gest';
             }
             $dialog .= '<div class="' . $side . '" id="note_' . $note->id_note . '">';
             $dialog .= '<div class="btn_note">';
             if ($note->prive) {
                 $dialog .= "<input type='image' src='" . get_url_icon('interdit.gif') . "' alt='" . htmlentities($msg['demandes_note_privacy'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_note_privacy'], ENT_QUOTES, $charset) . "' onclick='return false;'/>";
             }
             if ($note->rapport) {
                 $dialog .= "<input type='image' src='" . get_url_icon('info.gif') . "' alt='" . htmlentities($msg['demandes_note_rapport'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_note_rapport'], ENT_QUOTES, $charset) . "' onclick='return false;'/>";
             }
             if ($note->notes_read_opac) {
                 $dialog .= "<input type='image' src='" . get_url_icon('notification_new.png') . "' alt='" . htmlentities($msg['demandes_note_vue'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_note_vue'], ENT_QUOTES, $charset) . "' onclick='return false;'/>";
             }
             $dialog .= ' </div>';
             $dialog .= "<div>";
             $dialog .= '<div class="entete_note">' . $note->createur_note . ' ' . $msg['381'] . ' ' . formatdate($note->date_note) . '</div>';
             $dialog .= '<p>' . $note->contenu . '</p>';
             $dialog .= '</div>';
             $dialog .= '</div>';
             demandes_notes::note_read($note->id_note, true, "_opac");
         }
         $dialog .= '<a name="fin"></a>';
     }
     // Annulation de l'alerte sur l'action dépliée après lecture des nouvelles notes si c'est la personne à laquelle est affectée l'action qui la lit
     demandes_actions::action_read($num_action, true, "_opac");
     // Mise à jour de la demande dont est issue l'action
     demandes_actions::action_majParentEnfant($num_action, $num_demande, "_opac");
     $form_dialog_note = str_replace('!!dialog!!', $dialog, $form_dialog_note);
     return $form_dialog_note;
 }
        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 change_read($note, $side = "_gestion")
 {
     global $dbh;
     $read = demandes_notes::read($note, $side);
     $value = "";
     if ($read) {
         $value = 1;
     } else {
         $value = 0;
     }
     $query = "UPDATE demandes_notes SET notes_read" . $side . "=" . $value . " WHERE id_note=" . $note->id_note;
     if (pmb_mysql_query($query, $dbh)) {
         return true;
     } else {
         return false;
     }
 }
示例#6
0
 function show_consultation_form()
 {
     global $form_consult_action, $form_see_docnum, $msg, $charset, $pmb_gestion_devise, $dbh;
     $form_consult_action = str_replace('!!form_title!!', htmlentities($this->sujet_action, ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!type_action!!', htmlentities($this->workflow->getTypeCommentById($this->type_action), ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!statut_action!!', htmlentities($this->workflow->getStateCommentById($this->statut_action), ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!detail_action!!', htmlentities($this->detail_action, ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!date_action!!', htmlentities(formatdate($this->date_action), ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!date_butoir_action!!', htmlentities(formatdate($this->deadline_action), ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!time_action!!', htmlentities($this->time_elapsed . $msg['demandes_action_time_unit'], ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!cout_action!!', htmlentities($this->cout, ENT_QUOTES, $charset) . $pmb_gestion_devise, $form_consult_action);
     $form_consult_action = str_replace('!!progression_action!!', htmlentities($this->progression_action, ENT_QUOTES, $charset) . '%', $form_consult_action);
     $form_consult_action = str_replace('!!idaction!!', htmlentities($this->id_action, ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!iddemande!!', htmlentities($this->num_demande, ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!createur!!', htmlentities($this->getCreateur($this->actions_num_user, $this->actions_type_user), ENT_QUOTES, $charset), $form_consult_action);
     $form_consult_action = str_replace('!!prive_action!!', htmlentities($this->prive_action ? $msg[40] : $msg[39], ENT_QUOTES, $charset), $form_consult_action);
     $path = "<a href=./demandes.php?categ=gestion&act=see_dmde&iddemande={$this->num_demande}>" . htmlentities($this->libelle_demande, ENT_QUOTES, $charset) . "</a>";
     $form_consult_action = str_replace('!!path!!', $path, $form_consult_action);
     $act_cancel = "document.location='./demandes.php?categ=gestion&act=see_dmde&iddemande={$this->num_demande}'";
     $form_consult_action = str_replace('!!cancel_action!!', $act_cancel, $form_consult_action);
     print $form_consult_action;
     //Notes
     $notes = new demandes_notes(0, $this->id_action);
     $notes->show_list_notes($this->id_action);
     //Documents Numériques
     $req = "select * from explnum_doc join explnum_doc_actions on num_explnum_doc=id_explnum_doc \n\t\twhere num_action='" . $this->id_action . "'";
     $res = mysql_query($req, $dbh);
     if (mysql_num_rows($res)) {
         $tab_docnum = array();
         while ($docnums = mysql_fetch_array($res)) {
             $tab_docnum[] = $docnums;
         }
         $explnum_doc = new explnum_doc();
         $liste_docnum = $explnum_doc->show_docnum_table($tab_docnum, './demandes.php?categ=action&act=modif_docnum&idaction=' . $this->id_action);
         $form_see_docnum = str_replace('!!list_docnum!!', $liste_docnum, $form_see_docnum);
     } else {
         $form_see_docnum = str_replace('!!list_docnum!!', htmlentities($msg['demandes_action_no_docnum'], ENT_QUOTES, $charset), $form_see_docnum);
     }
     $form_see_docnum = str_replace('!!idaction!!', $this->id_action, $form_see_docnum);
     print $form_see_docnum;
 }
示例#7
0
<?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;
}
}
require_once $base_path . "/classes/demandes.class.php";
require_once $base_path . "/classes/demandes_actions.class.php";
require_once $base_path . "/classes/demandes_notes.class.php";
require_once $base_path . "/includes/templates/demandes.tpl.php";
require_once $base_path . "/includes/templates/demandes_actions.tpl.php";
require_once $base_path . "/includes/templates/demandes_notes.tpl.php";
require_once $base_path . "/includes/mail.inc.php";
switch ($quoifaire) {
    case 'show_list_action':
        $demande = new demandes($id_demande, false);
        ajax_http_send_response(demandes_actions::show_list_actions($demande->actions, $id_demande, 0, false));
        break;
    case 'show_dialog':
        $action = new demandes_actions($id_action, false);
        ajax_http_send_response(demandes_notes::show_dialog($action->notes, $action->id_action, $action->num_demande, "demandes-show_consult_form"));
        break;
}
/*
 * Affiche le formulaire d'ajout d'un action
 */
function show_form($id, $type)
{
    global $dbh, $msg;
    if ($type == 'ask') {
        $title = $msg['demandes_question_form'];
        $btn = $msg['demandes_save_question'];
    } elseif ($type == 'info') {
        $title = $msg['demandes_info_form'];
        $btn = $msg['demandes_save_info'];
    } elseif ($type == 'rdv') {
示例#9
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: demandes_actions.inc.php,v 1.5 2010-08-27 14:25:08 mbertin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/demandes_actions.class.php";
require_once $class_path . "/demandes.class.php";
require_once $class_path . "/demandes_notes.class.php";
require_once $class_path . "/explnum_doc.class.php";
$actions = new demandes_actions($idaction);
$demandes = new demandes($iddemande);
$notes = new demandes_notes($idnote, $idaction);
$explnum_doc = new explnum_doc($iddocnum);
switch ($sub) {
    case 'com':
        switch ($act) {
            case 'close_fil':
                $actions->close_fil();
                break;
        }
        $actions->show_com_form();
        break;
    case 'rdv_plan':
        switch ($act) {
            case 'close_rdv':
                $actions->close_rdv();
                break;
示例#10
0
     $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:
     $demandes->show_list_form();
     break;