function do_sources() { global $charset, $source, $dbh, $msg; $r = ""; if (!$source) { $source = array(); } //Recherche des sources $requete = "SELECT connectors_categ_sources.num_categ, connectors_sources.source_id, connectors_categ.connectors_categ_name as categ_name, connectors_categ.opac_expanded, connectors_sources.name, connectors_sources.comment, connectors_sources.repository, connectors_sources.opac_allowed,connectors_sources.opac_selected, source_sync.cancel FROM connectors_sources LEFT JOIN connectors_categ_sources ON (connectors_categ_sources.num_source = connectors_sources.source_id) LEFT JOIN connectors_categ ON (connectors_categ.connectors_categ_id = connectors_categ_sources.num_categ) LEFT JOIN source_sync ON (connectors_sources.source_id = source_sync.source_id AND connectors_sources.repository=2) WHERE connectors_sources.opac_allowed=1 ORDER BY connectors_categ_sources.num_categ DESC, connectors_sources.name"; $resultat = mysql_query($requete, $dbh); if ($source) { $_SESSION["checked_sources"] = $source; } if ($_SESSION["checked_sources"] && !$source) { $source = $_SESSION["checked_sources"]; } //gen_plus_form("zsources",$msg["connecteurs_source_label"],"<!--!!sources!!-->",true) $old_categ = 0; $count = 0; $paquets_de_sources = array(); $paquets_de_source = array(); while ($srce = mysql_fetch_object($resultat)) { if ($old_categ !== $srce->num_categ) { //$msg["connecteurs_source_label"] if ($paquets_de_source) { $paquets_de_sources[] = $paquets_de_source; } $paquets_de_source = array(); $paquets_de_source["id"] = $srce->num_categ; $paquets_de_source["name"] = $srce->categ_name ? $srce->categ_name : $msg["source_no_category"]; $paquets_de_source["opac_expanded"] = $srce->opac_expanded ? true : false; // gen_plus_form("zsources".$count, $srce->categ_name ,"sdfsdfsdfsdf",true); $count++; $old_categ = $srce->num_categ; } $paquets_de_source["content"] .= "<div style='width:30%; float:left'>\n\t\t\t\t<input type='checkbox' " . ($srce->cancel == 2 ? 'DISABLED' : "") . " name='source[]' value='" . $srce->source_id . "' id='source_" . $srce->source_id . "_" . $count . "' onclick='change_source_checkbox(source_" . $srce->source_id . "_" . $count . ", " . $srce->source_id . ");'"; if (array_search($srce->source_id, $source) !== false) { $paquets_de_source["content"] .= " checked"; } else { if (!count($source) && $srce->opac_selected) { $paquets_de_source["content"] .= " checked"; } } $paquets_de_source["content"] .= "/>" . ($srce->cancel == 2 ? "<s>" : "") . "<label for='source_" . $srce->source_id . "_" . $count . "'><img src='images/" . ($srce->repository == 1 ? "entrepot.png" : "globe.gif") . "'/> " . htmlentities($srce->name . ($srce->comment ? " : " . $srce->comment : ""), ENT_QUOTES, $charset) . ($srce->cancel == 2 ? "</s> <i>(" . $msg["source_blocked"] . ")</i>" : "") . "</label>\n\t\t\t</div><div class='row'></div>"; } if ($paquets_de_source) { $paquets_de_sources[] = $paquets_de_source; } foreach ($paquets_de_sources as $paquets_de_source) { $r .= gen_plus_form("zsources" . $paquets_de_source["id"], $paquets_de_source["name"], $paquets_de_source["content"], $paquets_de_source["opac_expanded"]) . "\n\n"; } return $r; }
function gen_tpl_abt_modele($id, $titre, $num, $vol, $tome, $delais, $delais_critique, $change_statut_id) { global $dbh; global $msg; $requete = "select * from abts_modeles where modele_id='{$id}'"; $resultat = mysql_query($requete, $dbh); if ($r_a = mysql_fetch_object($resultat)) { $tom_actif = $r_a->tom_actif; $vol_actif = $r_a->vol_actif; $num_depart = $r_a->num_depart; $vol_depart = $r_a->vol_depart; $tom_depart = $r_a->tom_depart; } if (!$num) { $num = $num_depart; } if (!$vol) { $vol = $vol_depart; } if (!$tome) { $tome = $tom_depart; } $contenu = "\n\t\t<div class='row'>\n\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_periodique_numero_depart"] . "</label>\n\t\t</div>\t\n\t\t<div class='row'>\n\t\t\t<input type='text' size='4' name='num[{$id}]' id='num[{$id}]' value='{$num}'/>\t\t\n\t\t</div>\n\t\t"; if ($vol_actif) { $contenu .= "\t\t\n\t\t<div class='colonne2'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_volume_numero_depart"] . "</label>\n\t\t\t</div>\t\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='vol[{$id}]' id='vol[{$id}]' value='{$vol}'/>\t\n\t\t\t</div>\n\t\t</div>\n\t\t"; } if ($tom_actif) { $contenu .= "\n\t\t<div class='colonne_suite'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_tome_numero_depart"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='tome[{$id}]' id='tome' value='{$tome}'/>\n\t\t\t</div>\n\t\t</div>\n\t\t"; } $contenu .= "\n\t\t<div class='row'></div>\n\t\t<div class='colonne2'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_delais_avant_retard"] . "</label>\n\t\t\t</div>\t\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='delais[{$id}]' id='delais[{$id}]' value='{$delais}'/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='colonne_suite'>\n\t\t\t<div class='row'>\n\t\t\t\t<label for='num_periodicite' class='etiquette'>" . $msg["abonnements_delais_critique"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<input type='text' size='4' name='delais_critique[{$id}]' id='delais_critique[{$id}]' value='{$delais_critique}'/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'></div>\n\t\t"; // select !!change_statut!! $statut_form = str_replace('!!statut_check!!', "<input type='checkbox' checked value='1' name='change_statut_check[" . $id . "]' id='change_statut[" . $id . "]_check' onclick=\"gere_statut('change_statut[" . $id . "]');\"/>", $msg['catalog_change_statut_form']); $statut_form = str_replace('!!statut_list!!', do_selector('docs_statut', "change_statut[" . $id . "]", $change_statut_id), $statut_form); $contenu .= "\n\t\t<div class='row'> </div>\n\t\t<div class='row'>\n\t\t\t{$statut_form}\n\t\t</div>\n\t\t"; return gen_plus_form($id, $titre, $contenu); }
function getContenuForm() { global $dbh, $base_path, $msg; $req = "select id_action, sujet_action, date_action, statut_action, progression_action, detail_action, num_demande, type_action as type, actions_num_user, actions_type_user, actions_read\n\t\t\tfrom demandes_actions \n\t\t\tjoin demandes on num_demande=id_demande\n\t\t\twhere num_demande='" . $this->num_demande . "' and prive_action=0 order by date_action, id_action desc"; $res = mysql_query($req, $dbh); $liste = ""; $marc_table = new marc_list("type_actions"); $liste_type = $marc_table->table; if (mysql_num_rows($res)) { while ($action = mysql_fetch_object($res)) { $btn_add_msg = $msg['demandes_add_note']; switch ($action->type) { case '1': $image_type = "<img src=\"{$base_path}/images/comments.png\" style=\"vertical-align:middle;\" alt='" . $liste_type[$action->type] . "' title='" . $liste_type[$action->type] . "' />"; $btn_add_msg = $msg['demandes_add_answer']; break; case '2': $image_type = "<img src=\"{$base_path}/images/magnifier.png\" style=\"vertical-align:middle;\" alt='" . $liste_type[$action->type] . "' title='" . $liste_type[$action->type] . "' />"; break; case '3': $image_type = "<img src=\"{$base_path}/images/information.png\" style=\"vertical-align:middle;\" alt='" . $liste_type[$action->type] . "' title='" . $liste_type[$action->type] . "' />"; break; case '4': $image_type = "<img src=\"{$base_path}/images/date.png\" style=\"vertical-align:middle;\" alt='" . $liste_type[$action->type] . "' title='" . $liste_type[$action->type] . "' />"; break; } $img_new = ""; if ($action->actions_read) { $img_new = "<img src=\"{$base_path}/images/asterisk_yellow.png\" style=\"width:12px;vertical-align:middle;\" alt='" . $msg['demandes_actions_new'] . "' title='" . $msg['demandes_actions_new'] . "' />"; } $content = "<br />\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t<div style='width:50%' class='left'>" . $msg['demandes_action_detail'] . " : </div>\n\t\t\t\t\t\t<div style='width:50%' class='right'>" . $action->detail_action . "</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t<div style='width:50%' class='left'>" . $msg['demandes_action_progression'] . " : </div>\n\t\t\t\t\t\t<div style='width:50%;background-color:#F3F3F3;position:relative;left:0px;top:0px;' class='right'> <img src=\"{$base_path}/images/jauge.png\" height='15px' width=\"" . $action->progression_action . "%\" />\n\t\t\t\t\t\t<span style='position:absolute;left:50%;top:0%;'><b>" . $action->progression_action . "%</b></span></div>\n\t\t\t\t\t</div>" . $this->show_list_notes($action->id_action) . "\n\t\t\t\t\t<br />"; $docnum_display = new explnum_affichage(array(0 => $action->id_action), DOCNUM_DMDE); if ($docnum_display->display) { $content .= $msg['explnum'] . " : " . $docnum_display->display; } if ($action->statut_action != 3) { $content .= "<div class='row'>\t\t\t\t\t\t\n\t\t\t\t\t\t<input class='bouton' type='button' name='add_note' id='add_note' value='" . $btn_add_msg . "' onclick=\"addnote(" . $action->id_action . ",0," . $this->num_demande . ");\" />\n\t\t\t\t\t</div>"; } $createur = $this->getCreateur($action->actions_num_user, $action->actions_type_user); $liste .= gen_plus_form("act_" . $action->id_action, $img_new . " " . $image_type . " [" . formatdate($action->date_action) . "] " . $action->sujet_action . ($createur ? " <i>" . sprintf($msg["demandes_action_by"], $createur) . "</i>" : ""), $content); $content = ""; } } else { $liste = "<div class='row'>" . $msg['demandes_no_action'] . "</div>"; } $req_up = "update demandes_actions set actions_read='0' where num_demande='" . $this->num_demande . "'"; mysql_query($req_up, $dbh); return $liste; }