function get_analysis($pid, $depth) { $q = "\n\t\t\tselect\t\tA.id\n\t\t\t,\t\t\tA.pid\n\t\t\t,\t\t\tA.name\n\t\t\t,\t\t\tA.name\t\tas label\n\t\t\t,\t\t\tA.base\n\t\t\t,\t\t\tA.var_independent\n\t\t\t,\t\t\tA.var_dependent\n\t\t\t,\t\t\tA.var_intervening\n\t\t\t,\t\t\tA.var_mediation\n\t\t\t,\t\t\tA.var_moderation\n\t\t\t,\t\t\tA.channel\n\t\t\t,\t\t\tA.phase\n\t\t\t,\t\t\tA.segmentation\n\t\t\t,\t\t\tA.attribute\n\t\t\t,\t\t\tA.hierarchy\n\t\t\tfrom\t\tanalysis_price\tA\n\t\t\twhere\t\tA.pid\t\t\t= {$pid}\n\t\t\torder by\tA.id\n\t\t"; $rs = Jaring::db_execute($q, null, true); $index = 0; foreach ($rs as &$m) { $id = $m["id"]; if ($index === 0) { $m["isFirst"] = true; } else { $m["isFirst"] = false; } $m["iconCls"] = "group"; $m["index"] = $index++; $m["depth"] = $depth; $c = get_analysis($id, $depth + 1); if (count($c) <= 0) { $m["leaf"] = true; } else { $m["children"] = $c; $m["expandable"] = true; $m["expanded"] = true; $m["loaded"] = true; } } return $rs; }
function get_analysis($pid, $depth) { $q = "\n\t\t\tselect\t\tA.id\n\t\t\t,\t\t\tA.pid\n\t\t\t,\t\t\tA.name\n\t\t\t,\t\t\tA.name\t\tas text\n\t\t\tfrom\t\tanalysis_price\tA\n\t\t\twhere\t\tA.pid\t\t\t= {$pid}\n\t\t\torder by\tA.id\n\t\t"; $rs = Jaring::db_execute($q, null, true); $index = 0; foreach ($rs as &$m) { $id = $m["id"]; if ($index === 0) { $m["isFirst"] = true; } else { $m["isFirst"] = false; } $m["iconCls"] = ""; $m["index"] = $index++; $m["depth"] = $depth; $c = get_analysis($id, $depth + 1); if (count($c) <= 0) { $m["leaf"] = true; } else { $m["children"] = $c; $m["expandable"] = true; $m["expanded"] = true; $m["loaded"] = true; } } return $rs; }
function show_bulletinage_info($bul_id, $lien_cart_ajout = 1, $lien_cart_suppr = 0, $flag_pointe = 0, $lien_pointe = 0) { global $dbh, $msg, $charset; global $base_path; global $liste_script; global $liste_debut; global $liste_fin; global $bul_action_bar; global $bul_cb_form; global $selector_prop; global $url_base_suppr_cart; global $page, $nbr_lignes, $nb_per_page; global $idcaddie; $cart_click_bull = "onClick=\"openPopUp('./cart.php?object_type=BULL&item=!!item!!', 'cart', 600, 700, -2, -2, '{$selector_prop}')\""; //Calcul des variables pour la suppression d'items if ($nb_per_page) { $modulo = $nbr_lignes % $nb_per_page; if ($modulo == 1) { $page_suppr = !$page ? 1 : $page - 1; } else { $page_suppr = $page; } $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0; } $affichage_final = ''; if ($bul_id) { if (SESSrights & CATALOGAGE_AUTH) { $myBul = new bulletinage($bul_id, 0, "./catalog.php?categ=serials&sub=bulletinage&action=explnum_form&bul_id={$bul_id}&explnum_id=!!explnum_id!!"); // lien vers la notice chapeau $link_parent = "<a href=\"./catalog.php?categ=serials\">" . $msg[4010] . "</a>"; $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">"; $link_parent .= "<a href=\"./catalog.php?categ=serials&sub=view&serial_id="; $link_parent .= $myBul->bulletin_notice . "\">" . $myBul->tit1 . '</a>'; $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">"; if ($myBul->bulletin_numero) { $link_bulletin = $myBul->bulletin_numero . " "; } // affichage de la mention de date utile : mention_date si existe, sinon date_date $date_affichee = ''; if ($myBul->mention_date) { $date_affichee = " (" . $myBul->mention_date . ")"; } else { if ($myBul->date_date) { $date_affichee = " [" . formatdate($myBul->date_date) . "]"; } } $link_bulletin .= $date_affichee; $link_parent .= "<a href='./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$bul_id}'>{$link_bulletin}</a>"; $affichage_final .= "<div class='row'><div class='perio-barre'>" . $link_parent . "</div></div>"; if ($lien_cart_ajout) { $cart_link = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_bull}>"; $cart_link = str_replace('!!item!!', $bul_id, $cart_link); $cart_link .= "<span id='BULL_drag_" . $bul_id . "' dragicon=\"{$base_path}/images/icone_drag_notice.png\" dragtext=\"" . htmlentities($link_bulletin, ENT_QUOTES, $charset) . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>"; } else { $cart_link = ""; } if ($lien_cart_suppr) { if ($lien_pointe) { if ($flag_pointe) { $marque_flag = "<img src='images/depointer.png' id='caddie_" . $idcaddie . "_item_" . $bul_id . "' title=\"" . $msg['caddie_item_depointer'] . "\" onClick='del_pointage_item(" . $idcaddie . "," . $bul_id . ");' style='cursor: pointer'/>"; } else { $marque_flag = "<img src='images/pointer.png' id='caddie_" . $idcaddie . "_item_" . $bul_id . "' title=\"" . $msg['caddie_item_pointer'] . "\" onClick='add_pointage_item(" . $idcaddie . "," . $bul_id . ");' style='cursor: pointer'/>"; } } else { if ($flag_pointe) { $marque_flag = "<img src='images/tick.gif'/>"; } else { $marque_flag = ""; } } $cart_link .= "<a href='{$url_base_suppr_cart}&action=del_item&object_type=BULL&item={$bul_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg["caddie_icone_suppr_elt"] . "\" /></a> {$marque_flag}"; } } else { $myBul = new bulletinage($bul_id, 0, ''); $cart_link = ''; } $bul_action_bar = str_replace('!!bul_id!!', $bul_id, $bul_action_bar); $bul_action_bar = str_replace('!!nb_expl!!', sizeof($myBul->expl), $bul_action_bar); $bul_isbd = $myBul->display; $javascript_template = "\n\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n \t\t<img src=\"./images/plus.gif\" class=\"img_plus\" name=\"imEx\" id=\"el!!id!!Img\" title=\"" . $msg['admin_param_detail'] . "\" border=\"0\" onClick=\"expandBase('el!!id!!', true); return false;\" hspace=\"3\" />\n \t\t<span class=\"notice-heada\">!!heada!!</span>\n \t\t<br />\n\t\t</div>\n\t\t<div id=\"el!!id!!Child\" class=\"notice-child\" style=\"margin-bottom:6px;display:none;\">\n \t\t!!ISBD!!\n \t\t</div>"; $aff_expandable = str_replace('!!id!!', $bul_id, $javascript_template); $aff_expandable = str_replace('!!heada!!', $cart_link . " " . $bul_isbd, $aff_expandable); // affichage des exemplaires associés $list_expl = "<div class='exemplaires-perio'>"; $list_expl .= "<h3>" . $msg[4012] . "</h3>"; $list_expl .= "<div class='row'>" . get_expl($myBul->expl) . "</div></div>"; $affichage_final .= $list_expl; // affichage des documents numeriques $aff_expl_num = $myBul->explnum; if ($aff_expl_num) { $list_expl = "<div class='exemplaires-perio'><h3>" . $msg['explnum_docs_associes'] . "</h3>"; $list_expl .= "<div class='row'>" . $aff_expl_num . "</div></div>"; $affichage_final .= $list_expl; } //affichage des dépouillements $liste = get_analysis($bul_id); if ($liste) { $liste_dep = $liste; $liste_dep .= $liste_fin; // inclusion du javascript inline $liste_dep .= $liste_script; } else { $liste_dep .= "<div class='row'>" . htmlentities($msg['bull_no_item'], ENT_QUOTES, $charset) . "</div>"; } $affichage_final .= "\n\t\t\t<div class='depouillements-perio'>\n\t\t\t\t<h3>" . $msg[4013] . "</h3>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t{$liste_dep}\n\t\t\t\t\t</div>\n\t\t\t\t</div>"; // affichage des résas $aff_resa = resa_list(0, $bul_id, 0); if ($aff_resa) { $affichage_final .= "<h3>" . $msg['resas'] . "</h3>" . $aff_resa; } } $aff_expandable = str_replace('!!ISBD!!', $affichage_final, $aff_expandable); return $aff_expandable; }
function show_bulletinage_info_catalogage($bul_id, $show_in_receptions = false) { global $dbh, $msg, $charset, $base_path; global $liste_script; global $liste_debut; global $liste_fin; global $bul_action_bar; global $bul_cb_form; global $cart_click_bull; global $pmb_droits_explr_localises; global $explr_visible_mod; global $flag_no_delete_bulletin; global $pmb_resa_planning; $form = ''; if ($bul_id) { if (!$show_in_receptions) { $myBul = new bulletinage($bul_id, 0, "./catalog.php?categ=serials&sub=bulletinage&action=explnum_form&bul_id={$bul_id}&explnum_id=!!explnum_id!!"); $affichage_expl = get_expl($myBul->expl); $cpt_expl = get_expl($myBul->expl, 0, true); } else { $myBul = new bulletinage($bul_id, 0, ''); $affichage_expl = get_expl($myBul->expl, 1); $cpt_expl = get_expl($myBul->expl, 1, true); } $bul_titre = $myBul->bulletin_titre; $bul_isbd = $myBul->display; $aff_expl_num = $myBul->explnum; $txt_drag = ""; if ($myBul->bulletin_numero) { $txt_drag .= $myBul->bulletin_numero . " "; } if ($myBul->mention_date) { $txt_drag .= " (" . $myBul->mention_date . ") "; } $txt_drag .= "[" . $myBul->aff_date_date . "]"; if (!$show_in_receptions) { // lien vers la notice chapeau $link_parent = "<a href=\"./catalog.php?categ=serials\">"; $link_parent .= $msg[4010] . "</a>"; $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">"; $link_parent .= "<a href=\"./catalog.php?categ=serials&sub=view&serial_id="; $link_parent .= $myBul->bulletin_notice . "\">" . $myBul->tit1 . '</a>'; $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">"; $link_parent .= $txt_drag; if ($bul_titre) { $link_parent .= " : " . htmlentities($bul_titre, ENT_QUOTES, $charset); } $form .= "<div class='row'><div class='perio-barre'>" . $link_parent . "</div></div>"; $cart_link = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_bull}>"; $cart_link = str_replace('!!item!!', $bul_id, $cart_link); $cart_link .= "<span id='BULL_drag_" . $bul_id . "' dragicon=\"{$base_path}/images/icone_drag_notice.png\" dragtext=\"" . htmlentities($txt_drag, ENT_QUOTES, $charset) . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>"; $bul_action_bar = str_replace('!!bul_id!!', $bul_id, $bul_action_bar); $bul_action_bar = str_replace('!!serial_id!!', $myBul->bulletin_notice, $bul_action_bar); $bul_action_bar = str_replace('!!nb_expl!!', sizeof($myBul->expl), $bul_action_bar); global $avis_quoifaire, $valid_id_avis; if ($myBul->bull_num_notice) { $bul_isbd = str_replace('<!-- !!avis_notice!! -->', avis_notice($myBul->bull_num_notice, $avis_quoifaire, $valid_id_avis), $bul_isbd); } if (!$flag_no_delete_bulletin) { $bul_action_bar = str_replace("!!bulletin_delete_button!!", "<input type='button' class='bouton' onclick=\"confirm_bul_delete();\" value='{$msg['63']}' />", $bul_action_bar); } else { $bul_action_bar = str_replace("!!bulletin_delete_button!!", "", $bul_action_bar); } if ($myBul->bull_num_notice) { $form .= $liste_script; } $form .= "\n\t\t\t<div class='bulletins-perio'>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<h2>{$cart_link} {$bul_isbd}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t{$bul_action_bar}\n\t\t\t\t\t</div>\n\t\t\t\t</div>"; // affichage des exemplaires associés $list_expl = "<div class='exemplaires-perio'>"; $list_expl .= "<h3>" . $msg[4012] . " (" . $cpt_expl . ")</h3>"; $list_expl .= "<div class='row'>" . $affichage_expl . "</div></div>"; $form .= $list_expl; if ($aff_expl_num) { $list_expl = "<div class='exemplaires-perio'><h3>" . $msg[explnum_docs_associes] . " (" . $myBul->nbexplnum . ")</h3>"; $list_expl .= "<div class='row'>" . $aff_expl_num . "</div></div>"; $form .= $list_expl; } if (!$explr_visible_mod && $pmb_droits_explr_localises == 1) { $etiquette_expl = ""; $btn_ajouter_expl = ""; $saisie_num_expl = "<div class='colonne10'><img src='./images/error.png' /></div>"; $saisie_num_expl .= "<div class='colonne-suite'><span class='erreur'>" . $msg["err_add_invis_expl"] . "</span></div>"; } else { $etiquette_expl = "<div class='row'>\n\t\t\t\t\t\t\t<label class='etiquette' for='form_cb'>{$msg['291']}</label>\n\t\t\t\t\t\t\t</div>"; $btn_ajouter_expl = "<input type='submit' class='bouton' value=' {$msg['expl_ajouter']} ' onClick=\"return test_form(this.form)\">"; global $pmb_numero_exemplaire_auto; if ($pmb_numero_exemplaire_auto == 1 || $pmb_numero_exemplaire_auto == 3) { $num_exemplaire_auto = " {$msg['option_num_auto']} <INPUT type=checkbox name='option_num_auto' value='num_auto' checked >"; } $saisie_num_expl = "<input type='text' class='saisie-20em' name='noex' value=''>" . $num_exemplaire_auto; } $req = "select * from serialcirc_copy, bulletins where num_serialcirc_copy_bulletin=bulletin_id and bulletin_id= {$bul_id}"; $resultat = pmb_mysql_query($req); $i = 0; if (pmb_mysql_num_rows($resultat)) { $btn_print_ask = "<input type='button' class='bouton' value=' " . $msg["serialcirc_circ_list_reproduction_isdone_bt"] . " ' onClick=\"document.location='./catalog.php?categ=serials&sub=bulletinage&action=copy_isdone&bul_id=" . $bul_id . "';\" />"; } $bul_cb_form = str_replace('!!bul_id!!', $bul_id, $bul_cb_form); $bul_cb_form = str_replace('!!etiquette!!', $etiquette_expl, $bul_cb_form); $bul_cb_form = str_replace('!!saisie_num_expl!!', $saisie_num_expl, $bul_cb_form); $bul_cb_form = str_replace('!!btn_ajouter!!', $btn_ajouter_expl, $bul_cb_form); $bul_cb_form = str_replace('!!btn_print_ask!!', $btn_print_ask, $bul_cb_form); $form .= "<div class='row'>" . $bul_cb_form . "</div>"; // zone d'affichage des dépouillements $liste = get_analysis($bul_id); if ($liste) { $icones_exp .= $liste_debut . " <img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title='" . $msg[400] . "' onClick=\"openPopUp('./cart.php?object_type=BULL&item=" . $bul_id . "&what=DEP', 'cart', 500, 400, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes')\">"; $liste_dep = $liste; $liste_dep .= $liste_fin; // inclusion du javascript inline $liste_dep .= !$myBul->bull_num_notice ? $liste_script : ""; } else { $icones_exp .= ""; $liste_dep .= "<div class='row'>" . $msg['bulletin_no_analysis'] . "</div>"; } $link_new_dep = "<input type='button' class='bouton' value=' {$msg['4021']} ' onClick=\"document.location='./catalog.php?categ=serials&sub=analysis&action=analysis_form&bul_id={$bul_id}&analysis_id=0';\" />"; $form .= "\n\t\t\t\t<div class='depouillements-perio'>\n\t\t\t\t\t<h3>" . $msg[4013] . $icones_exp . " {$link_new_dep}</h3>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t{$liste_dep}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>"; //reservations et previsions $rqt_nt = "select count(*) from exemplaires, bulletins, docs_statut where exemplaires.expl_statut=docs_statut.idstatut and bulletins.bulletin_id=exemplaires.expl_bulletin and pret_flag=1 and bulletins.bulletin_id=" . $bul_id; $result = pmb_mysql_query($rqt_nt, $dbh) or die($rqt_nt . " " . pmb_mysql_error()); $nb_expl_reservables = pmb_mysql_result($result, 0, 0); $aff_resa = resa_list(0, $bul_id, 0); $ouvrir_reserv = "onclick=\"parent.location.href='./circ.php?categ=resa_from_catal&id_bulletin=" . $bul_id . "'; return(false) \""; if ($aff_resa) { $form .= "<b>" . $msg['resas'] . "</b><br />"; if ($nb_expl_reservables) { $form .= "<input type='button' class='bouton' value='" . $msg[351] . "' {$ouvrir_reserv}><br /><br />"; } $form .= $aff_resa . "<br />"; } else { if ($nb_expl_reservables) { $form .= "<b>" . $msg['resas'] . "</b><br /><input type='button' class='bouton' value='" . $msg[351] . "' {$ouvrir_reserv}><br /><br />"; } } if ($pmb_resa_planning) { $aff_resa_planning = planning_list(0, $bul_id, 0); //TODO $ouvrir_reserv = "onclick=\"parent.location.href='" . $base_path . "/circ.php?categ=resa_planning_from_catal&id_bulletin=" . $bul_id . "'; return(false) \""; if ($aff_resa_planning) { $form .= "<b>" . $msg['resas_planning'] . "</b><br />"; if ($nb_expl_reservables) { $form .= "<input type='button' class='bouton' value='" . $msg['resa_planning_add'] . "' {$ouvrir_reserv}><br /><br />"; } $form .= $aff_resa_planning . "<br />"; } else { if ($nb_expl_reservables && !($categ == "resa_planning") && !$id_empr && $nb_expl_reservables) { $form .= "<b>" . $msg['resas_planning'] . "</b><br /><input type='button' class='bouton' value='" . $msg['resa_planning_add'] . "' {$ouvrir_reserv}><br /><br />"; } } } } else { $form .= "<div class='notice-parent' id='_bull_'>\n\t\t\t\t\t\t<img hspace='3' border='0' onclick=\"expandBase('_bull_', true); return false;\" title='" . $msg['plus_detail'] . "' id='_bull_Img' name='imEx' class='img_plus' src='" . $base_path . "/images/minus.gif' />\n\t\t\t\t\t\t<span class='notice-heada'>" . htmlentities($myBul->tit1 . '.' . $txt_drag, ENT_QUOTES, $charset); if ($bul_titre) { $form .= " : " . htmlentities($bul_titre, ENT_QUOTES, $charset); } $form .= "\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style='margin-bottom: 6px; display: none; width: 94%;' class='notice-child' id='_bull_Child'>\n\t\t\t\t\t\t<br /><b>" . htmlentities($msg[4012], ENT_QUOTES, $charset) . "</b>\n\t\t\t\t\t\t{$affichage_expl}\n\t\t\t\t\t\t<br ><b>" . htmlentities($msg['explnum_docs_associes'], ENT_QUOTES, $charset) . "</b>\n\t\t\t\t\t\t{$aff_expl_num};\n\t\t\t\t\t</div>"; } } return $form; }