<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: demandes_actions.inc.php,v 1.15 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.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;
示例#2
0
 static function change_read($demande, $side = "_opac")
 {
     global $dbh;
     $read = demandes::read($demande, $side);
     $value = "";
     if ($read) {
         $value = 1;
     } else {
         $value = 0;
     }
     $query = "UPDATE demandes SET dmde_read" . $side . "=" . $value . " WHERE id_demande=" . $demande->id_demande;
     if (pmb_mysql_query($query, $dbh)) {
         return true;
     } else {
         return false;
     }
 }
示例#3
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;
}
示例#4
0
 static function dmde_propageLu($id_demande, $side = "_gestion")
 {
     global $dbh;
     if ($id_demande) {
         $dmde = new demandes($id_demande);
         $read = demandes::read($dmde, $side);
         if ($read) {
             $query1 = "UPDATE demandes_actions SET actions_read" . $side . "=0 WHERE num_demande=" . $id_demande;
             $result1 = pmb_mysql_query($query1, $dbh);
             $query2 = "SELECT id_action FROM demandes_actions WHERE num_demande=" . $id_demande;
             $result2 = pmb_mysql_query($query2, $dbh);
             if (pmb_mysql_num_rows($result2)) {
                 while ($action = pmb_mysql_fetch_object($result2)) {
                     $query3 = "UPDATE demandes_notes SET notes_read" . $side . "=0 WHERE num_action=" . $action->id_action;
                     pmb_mysql_query($query3, $dbh);
                 }
             }
             return "lu";
         } else {
             return "nonlu";
         }
     }
 }
    die("no access");
}
require_once $class_path . "/demandes.class.php";
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':
        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($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();
示例#6
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: demandes.inc.php,v 1.3 2009-10-13 07:29:33 kantin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/demandes.class.php";
require_once $class_path . "/demandes_actions.class.php";
require_once $class_path . "/rapport.class.php";
require_once $base_path . "/demandes/export_format/report_to_rtf.class.php";
$demande = new demandes($iddemande);
$actions = new demandes_actions($idaction);
$rap = new rapport_demandes($iddemande);
switch ($act) {
    case 'new':
        $demande->show_modif_form();
        break;
    case 'save':
        $demande->save();
        $demande->show_consult_form();
        break;
    case 'modif':
        $demande->show_modif_form();
        break;
    case 'suppr_noti':
        $demande->suppr_notice_form();
        break;
    case 'suppr':
示例#7
0
     break;
 case 'see_dmde':
     $demande->show_consult_form();
     break;
 case 'save_action':
     $actions->save();
     $demande->show_consult_form();
     break;
 case 'change_state':
     if (sizeof($chk)) {
         for ($i = 0; $i < count($chk); $i++) {
             $dde = new demandes($chk[$i]);
             demandes::change_state($state, $dde);
         }
     } else {
         demandes::change_state($state, $demande);
         $demande->fetch_data($iddemande);
     }
     $demande->show_consult_form();
     break;
 case 'attach':
     $demande->show_docnum_to_attach();
     break;
 case 'save_attach':
     $demande->attach_docnum();
     $demande->show_consult_form();
     break;
 case 'notice':
     $demande->show_notice_form();
     break;
 case 'upd_notice':
示例#8
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: liste_demande.inc.php,v 1.1 2009-10-01 13:29:24 kantin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $base_path . '/includes/templates/demandes.tpl.php';
require_once $base_path . '/classes/demandes.class.php';
require_once $base_path . '/classes/demandes_action.class.php';
print "<script type='text/javascript' src='./includes/javascript/http_request.js'></script>\n<script type='text/javascript' src='./includes/javascript/demandes.js'></script>";
$demandes = new demandes();
$demandes_action = new demandes_action($iddemande);
switch ($sub) {
    case 'see_action':
        print $demandes_action->show_list_actions();
        break;
    default:
        $demandes->show_list($idetat);
        break;
}
 public static function get_display_demand($notice_id)
 {
     global $msg, $include_path, $form_modif_demande, $form_linked_record, $demandes_active, $opac_demandes_allow_from_record;
     if ($demandes_active && $opac_demandes_allow_from_record && $_SESSION['id_empr_session']) {
         $record_datas = static::get_record_datas($notice_id);
         $demande = new demandes();
         $themes = new demandes_themes('demandes_theme', 'id_theme', 'libelle_theme', $demande->theme_demande);
         $types = new demandes_types('demandes_type', 'id_type', 'libelle_type', $demande->type_demande);
         $f_modif_demande = $form_modif_demande;
         $f_modif_demande = str_replace('!!form_title!!', htmlentities($msg['demandes_creation'], ENT_QUOTES, $charset), $f_modif_demande);
         $f_modif_demande = str_replace('!!sujet!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!progression!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!empr_txt!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!idempr!!', $_SESSION['id_empr_session'], $f_modif_demande);
         $f_modif_demande = str_replace('!!iduser!!', "", $f_modif_demande);
         $f_modif_demande = str_replace('!!titre!!', '', $f_modif_demande);
         $etat = $demande->getStateValue();
         $f_modif_demande = str_replace('!!idetat!!', $etat['id'], $f_modif_demande);
         $f_modif_demande = str_replace('!!value_etat!!', $etat['comment'], $f_modif_demande);
         $f_modif_demande = str_replace('!!select_theme!!', $themes->getListSelector(), $f_modif_demande);
         $f_modif_demande = str_replace('!!select_type!!', $types->getListSelector(), $f_modif_demande);
         $date = formatdate(today());
         $date_debut = date("Y-m-d", time());
         $date_dmde = "<input type='button' class='bouton' id='date_debut_btn' name='date_debut_btn' value='!!date_debut_btn!!'\n\t\t\t\t\tonClick=\"openPopUp('./select.php?what=calendrier&caller=modif_dmde&date_caller=!!date_debut!!&param1=date_debut&param2=date_debut_btn&auto_submit=NO&date_anterieure=YES', 'date_debut', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"/>";
         $f_modif_demande = str_replace('!!date_demande!!', $date_dmde, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_fin_btn!!', $date, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_debut_btn!!', $date, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_debut!!', $date_debut, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_fin!!', $date_debut, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_prevue!!', $date_debut, $f_modif_demande);
         $f_modif_demande = str_replace('!!date_prevue_btn!!', $date, $f_modif_demande);
         $f_modif_demande = str_replace('!!iddemande!!', '', $f_modif_demande);
         $f_modif_demande = str_replace('!!form_linked_record!!', $form_linked_record, $f_modif_demande);
         $f_modif_demande = str_replace('!!linked_record!!', $record_datas->get_tit1(), $f_modif_demande);
         $f_modif_demande = str_replace("!!linked_record_id!!", $notice_id, $f_modif_demande);
         $f_modif_demande = str_replace("!!linked_record_link!!", $record_datas->get_permalink(), $f_modif_demande);
         $act_cancel = "demandDialog_" . $notice_id . ".hide();";
         $act_form = "./empr.php?tab=request&lvl=list_dmde&sub=save_demande";
         $f_modif_demande = str_replace('!!form_action!!', $act_form, $f_modif_demande);
         $f_modif_demande = str_replace('!!cancel_action!!', $act_cancel, $f_modif_demande);
         // Requires et début de formulaire
         $html = "\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\trequire(['dojo/parser', 'dijit/Dialog']);\n\t\t\t\t\t\tdocument.body.setAttribute('class', 'tundra');\n\t\t\t\t\t</script>\n\t\t\t\t\t<div data-dojo-type='dijit/Dialog' data-dojo-id='demandDialog_" . $notice_id . "' title='" . $msg['do_demande_on_record'] . "' style='display:none;width:75%;'>\n\t\t\t\t\t\t" . $f_modif_demande . "\n\t\t\t\t\t</div>\n\t\t\t\t\t<a href='#' onClick='demandDialog_" . $notice_id . ".show();return false;'>\n\t\t\t\t\t\t" . $msg['do_demande_on_record'] . "\n\t\t\t\t\t</a>";
         return $html;
     }
     return "";
 }
示例#10
0
         suggestions::delete($id_sug);
     }
     print "</div>";
     break;
 case 'private_list':
 case 'public_list':
 case 'demande_list':
     print "<div id='empr-list'>\n";
     require_once $base_path . '/empr/liste_lecture.inc.php';
     print "</div>";
     break;
 case 'list_dmde':
     print "<div id='empr-dema'>\n";
     if ($allow_dema) {
         require_once $class_path . "/demandes.class.php";
         $tmp = demandes::get_first_tab();
         if ($tmp && !$sub) {
             $sub = $tmp;
         }
         require_once $base_path . '/empr/liste_demande.inc.php';
     } else {
         print $msg[empr_no_allow_dema];
     }
     print "</div>";
     break;
 case 'pret':
     print "<div id='empr-sugg'>\n";
     print "<h3><span>" . $msg["empr_checkout_title"] . "</span></h3>";
     require_once $base_path . '/empr/self_checkout.inc.php';
     print "</div>";
     break;
示例#11
0
// $Id: demandes_ajax.inc.php,v 1.9 2015-05-20 14:39:30 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$class_path}/mono_display.class.php";
require_once "{$class_path}/demandes.class.php";
require_once "{$include_path}/templates/demandes_actions.tpl.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, true));
        break;
    case 'show_notice':
        show_notice($idnotice);
        break;
    case 'change_read_dmde':
        $demande = new demandes($id_demande, false);
        demandes::change_read($demande);
        ajax_http_send_response(demandes::dmde_propageLu($id_demande));
        break;
}
/*
 * Affichage de la notice
 */
function show_notice($idnotice)
{
    $isbd = new mono_display($idnotice, 6, '', 1, '', '', '', 1);
    $html = "<div class='row' style='padding-top: 8px;'>" . $isbd->aff_statut . "<h1 style='display: inline;'>" . $isbd->header . "</h1></div>";
    $html .= "<div class='row'>" . $isbd->isbd . "</div>";
    print ajax_http_send_response($html);
}
示例#12
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: demandes_liste.inc.php,v 1.3 2010-02-08 11:28:12 kantin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/demandes.class.php";
$demande = new demandes($iddemande);
switch ($act) {
    case 'new':
        $demande->show_modif_form();
        break;
    case 'save':
        $demande->save();
        $demande->show_list_form();
        break;
    case 'search':
        $demande->show_list_form();
        break;
    case 'suppr':
        $demande->delete();
        $demande->show_list_form();
        break;
    case 'suppr_noti':
        $demande->suppr_notice_form();
        break;
    case 'change_state':
        $demande->change_state($state);
示例#13
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;
示例#14
0
 static function note_majParent($id_note, $id_action, $id_demande, $side = "_opac")
 {
     global $dbh;
     $ok = false;
     if ($id_note) {
         $select = "SELECT notes_read" . $side . " FROM demandes_notes WHERE id_note=" . $id_note;
         $result = pmb_mysql_query($select, $dbh);
         $read = pmb_mysql_result($result, 0, 0);
         if ($read == 1) {
             if (demandes_actions::action_read($id_action, false, $side) && demandes::demande_read($id_demande, false, $side)) {
                 $ok = true;
             }
         } else {
             // maj action : controle s'il existe des notes non lues pour l'action en cours
             $query = "SELECT notes_read" . $side . " FROM demandes_notes WHERE num_action=" . $id_action . " AND id_note!=" . $id_note . " AND notes_read" . $side . "=1";
             $result = pmb_mysql_query($query, $dbh);
             if (pmb_mysql_num_rows($result)) {
                 $ok = demandes_actions::action_read($id_action, false, $side);
             } else {
                 $ok = demandes_actions::action_read($id_action, true, $side);
             }
             // maj demande : controle s'il existe des actions non lues pour la demande en cours
             if ($ok) {
                 $query = "SELECT actions_read" . $side . " FROM demandes_actions WHERE num_demande=" . $id_demande . " AND id_action!=" . $id_action . " AND actions_read" . $side . "=1";
                 $result = pmb_mysql_query($query, $dbh);
                 if (pmb_mysql_num_rows($result)) {
                     $ok = demandes::demande_read($id_demande, false, $side);
                 } else {
                     $ok = demandes::demande_read($id_demande, true, $side);
                 }
             }
         }
     }
     return $ok;
 }
示例#15
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: make_demande.inc.php,v 1.2 2009-10-05 08:25:14 kantin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $base_path . '/includes/templates/demandes.tpl.php';
require_once $base_path . '/classes/demandes.class.php';
$demandes = new demandes();
switch ($act) {
    case 'save':
        $demandes->save();
        print "<div class='save_msg'>" . $msg['demandes_save_msg'] . "</div>";
        $demandes->show_list();
        break;
    default:
        $demandes->show_form();
        break;
}
示例#16
0
 static function action_majParentEnfant($id_action, $id_demande, $side = "_gestion")
 {
     global $dbh;
     $ok = false;
     if ($id_action) {
         $select = "SELECT actions_read" . $side . " FROM demandes_actions WHERE id_action=" . $id_action;
         $result = pmb_mysql_query($select, $dbh);
         $read = pmb_mysql_result($result, 0, 0);
         if ($read == 1) {
             if (demandes::demande_read($id_demande, false)) {
                 $ok = true;
             }
         } else {
             // maj notes : si l'action est lue, on met à 0 toutes les notes
             $query = "UPDATE demandes_notes SET notes_read" . $side . " = 0 WHERE num_action=" . $id_action;
             if (pmb_mysql_query($query, $dbh)) {
                 // maj demande : controle s'il existe des actions non lues pour la demande en cours
                 $query = "SELECT actions_read" . $side . " FROM demandes_actions WHERE num_demande=" . $id_demande . " AND id_action != " . $id_action . " AND actions_read" . $side . "=1";
                 $result = pmb_mysql_query($query, $dbh);
                 if (pmb_mysql_num_rows($result)) {
                     $ok = demandes::demande_read($id_demande, false, $side);
                 } else {
                     $ok = demandes::demande_read($id_demande, true, $side);
                 }
             }
         }
     }
     return $ok;
 }
示例#17
0
$demande_note = new demandes_notes($idnote, $idaction);
switch ($sub) {
    case 'save_action':
        demandes_actions::get_values_from_form($demandes_action);
        foreach ($demandes->allowed_actions as $key => $value) {
            if ($value['active'] && $demandes_action->type_action == $value['id']) {
                demandes_actions::save($demandes_action);
            }
        }
        demandes::dmde_majRead($demandes_action->num_demande, "_opac");
        $demandes->fetch_data($demandes_action->num_demande, false);
        $demandes->show_consult_form($demandes_action->id_action);
        break;
    case 'save_demande':
        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");