function make_display() { global $msg, $dbh, $charset; $display = ""; $submit = "<input type='submit' class='bouton' name='soumission' id='soumission' value='" . $msg['demandes_valid_progression'] . "'/>"; $action = new demandes_actions($this->idobjet); switch ($this->champ_entree) { case 'selector': $display = "\n\t\t\t\t<form method='post'>" . $action->getStatutSelector($action->statut_action, true) . $submit . "</form>"; break; default: $display = "<label id='" . $this->id_element . "' />" . htmlentities($action->statut_action, ENT_QUOTES, $charset) . "</label>"; break; } $this->display = $display; }
static function change_read($action, $side = "_gestion") { global $dbh; $read = demandes_actions::read($action, $side); $value = ""; if ($read) { $value = 1; } else { $value = 0; } $query = "UPDATE demandes_actions SET actions_read" . $side . "=" . $value . " WHERE id_action=" . $action->id_action; if (pmb_mysql_query($query, $dbh)) { return true; } else { return false; } }
function show_consult_form() { global $form_consult_dmde, $charset, $msg, $dbh; $form_consult_dmde = str_replace('!!form_title!!', htmlentities($this->titre_demande, ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!sujet_dmde!!', htmlentities($this->sujet_demande, ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!etat_dmde!!', htmlentities($this->workflow->getStateCommentById($this->etat_demande), ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!date_dmde!!', htmlentities(formatdate($this->date_demande), ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!date_butoir_dmde!!', htmlentities(formatdate($this->deadline_demande), ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!date_prevue_dmde!!', htmlentities(formatdate($this->date_prevue), ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!progression_dmde!!', htmlentities($this->progression . '%', ENT_QUOTES, $charset), $form_consult_dmde); for ($i = 0; $i < sizeof($this->users); $i++) { if ($i == sizeof($this->users) - 1) { $users .= htmlentities($this->users[$i]['nom'], ENT_QUOTES, $charset); } else { $users .= htmlentities($this->users[$i]['nom'], ENT_QUOTES, $charset) . " / "; } } $carac_empr = $this->getCaracEmpr($this->num_demandeur); $nom = $carac_empr['nom']; $cb = $carac_empr['empr_cb']; $nom_emprunteur = ""; if (SESSrights & CIRCULATION_AUTH) { $nom_emprunteur = "<a href=\"circ.php?categ=pret&form_cb={$cb}\" >" . htmlentities($nom, ENT_QUOTES, $charset) . "</a>"; } $form_consult_dmde = str_replace('!!demandeur!!', $nom_emprunteur ? $nom_emprunteur : $nom, $form_consult_dmde); $form_consult_dmde = str_replace('!!attribution!!', $users, $form_consult_dmde); $form_consult_dmde = str_replace('!!iddemande!!', $this->id_demande, $form_consult_dmde); $form_consult_dmde = str_replace('!!theme_dmde!!', htmlentities($this->theme_libelle, ENT_QUOTES, $charset), $form_consult_dmde); $form_consult_dmde = str_replace('!!type_dmde!!', htmlentities($this->type_libelle, ENT_QUOTES, $charset), $form_consult_dmde); //afficher la liste des boutons de changement d'état if ($this->etat_demande && $this->users) { $states = $this->workflow->getStateList($this->etat_demande); $states_btn = $this->getDisplayStateBtn($states); $form_consult_dmde = str_replace('!!btn_etat!!', $states_btn, $form_consult_dmde); } else { $form_consult_dmde = str_replace('!!btn_etat!!', "", $form_consult_dmde); } $notice = "<a onclick=\"show_notice('" . $this->num_notice . "')\" href='#'><img border='0' align='top' src='./images/search.gif' alt='" . htmlentities($msg['demandes_see_notice'], ENT_QUOTES, $charset) . "' title='" . htmlentities($msg['demandes_see_notice'], ENT_QUOTES, $charset) . "' /></a>"; $form_consult_dmde = str_replace('!!icone!!', $notice, $form_consult_dmde); if ($this->users) { $req = "select count(1) as nb from demandes join demandes_actions on id_demande=num_demande join explnum_doc_actions on num_action=id_action where id_demande='" . $this->id_demande . "'"; $res = mysql_query($req, $dbh); $docnum = mysql_fetch_object($res); if ($docnum->nb) { $btn_attach = " <input type='submit' class='bouton' value='" . $msg['demandes_attach_docnum'] . "' onClick='this.form.act.value=\"attach\" ; ' />"; } else { $btn_attach = ""; } $btn_notices = "<input type='submit' class='bouton' value='" . $msg['demandes_complete_notice'] . "' onClick='this.form.act.value=\"notice\" ; ' />" . $btn_attach . " <input type='submit' class='bouton' value='" . $msg['demandes_generate_rapport'] . "' onClick='this.form.act.value=\"rapport\" ; ' />"; $form_consult_dmde = str_replace('!!btns_notice!!', $btn_notices, $form_consult_dmde); } else { $form_consult_dmde = str_replace('!!btns_notice!!', "", $form_consult_dmde); } print $form_consult_dmde; if ($this->users) { //Liste des actions $actions = new demandes_actions(); $actions->show_list_actions($this->id_demande); } }
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; }
static function change_state($state, $demande) { global $dbh, $demandes_init_workflow, $demandes_default_action, $pmb_type_audit; global $PMBuserid; global $sujet, $idtype, $idstatut; global $date_debut, $date_fin, $detail; global $time_elapsed, $progression, $cout, $iddemande, $ck_prive; if ($demandes_init_workflow === "1" && $PMBuserid) { //La demande est elle attribué à un utilisateur ? $query = 'SELECT 1 FROM demandes_users WHERE num_demande=' . $demande->id_demande; $result = pmb_mysql_query($query, $dbh); if (!pmb_mysql_num_rows($result)) { //si non, on attribue $query = 'INSERT INTO demandes_users SET num_user="******", num_demande="' . $demande->id_demande . '", date_creation="' . date("Y-m-d", time()) . '", users_statut=1'; pmb_mysql_query($query, $dbh); } } $req = "update demandes set etat_demande={$state} where id_demande='" . $demande->id_demande . "'"; pmb_mysql_query($req, $dbh); if ($state == 2 && $demandes_default_action === "1") { $query = "SELECT id_action FROM demandes_actions WHERE num_demande=" . $demande->id_demande; $result = pmb_mysql_query($query, $dbh); if (!pmb_mysql_num_rows($result)) { $action_default = new demandes_actions(); $action_default->num_demande = $demande->id_demande; $action_default->actions_num_user = $PMBuserid; $action_default->date_action = date("Y-m-d", time()); $action_default->deadline_action = date("Y-m-d", time()); if ($action_default->list_statut) { $action_default->statut_action = ""; for ($i = 1; $i <= count($action_default->list_statut); $i++) { if ($action_default->list_statut[$i]['default']) { $action_default->statut_action = $action_default->list_statut[$i]['id']; } } if ($idstatut == "") { reset($action_default->list_statut); $first_statut = current($action_default->list_statut); $action_default->statut_action = $first_statut['id']; } } $action_default->type_action = $demande->first_action; $action_default->sujet_action = $demande->titre_demande; $action_default->detail_action = $demande->sujet_demande; demandes_actions::save($action_default); } } if ($pmb_type_audit) { audit::insert_modif(AUDIT_DEMANDE, $demande->id_demande); } }
if (sizeof($chk)) { for ($i = 0; $i < count($chk); $i++) { $action = new demandes_actions($chk[$i]); demandes_actions::delete($action); } } else { demandes_actions::delete($actions); } $demandes->fetch_data($iddemande, false); $demandes->show_consult_form(); break; case 'add_docnum': $actions->show_docnum_form(); break; case 'save_docnum': demandes_actions::get_docnum_values_from_form($explnum_doc); demandes_actions::save_docnum($actions, $explnum_doc); $actions->fetch_data($actions->id_action, false); $actions->show_consultation_form(); break; case 'suppr_docnum': demandes_actions::delete_docnum($explnum_doc); $actions->fetch_data($actions->id_action, false); $actions->show_consultation_form(); break; case 'modif_docnum': $actions->show_docnum_form(); break; } break; }
<?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':
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: demandes_notes.inc.php,v 1.9 2014-04-02 08:50:38 mhoestlandt Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { 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;
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: actions_ajax.inc.php,v 1.6 2014-04-02 08:50:38 mhoestlandt Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } require_once "{$class_path}/demandes_actions.class.php"; require_once "{$include_path}/templates/demandes_actions.tpl.php"; switch ($quoifaire) { case 'change_read_action': $action = new demandes_actions($id_action, false); demandes_actions::change_read($action, "_gestion"); ajax_http_send_response(demandes_actions::action_majParentEnfant($id_action, $action->num_demande, "_gestion")); break; }
<?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; }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $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) {
<?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;
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_actions.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($iddemande); $demandes_action = new demandes_actions($idaction); $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;