Exemplo n.º 1
0
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;
    global $categ, $quoi, $action, $sub;
    $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!!");
            $myBul->b_notice_show_expl = 0;
            $myBul->make_display();
            //Refait pour avoir la notice de bulletin sans ses exemplaires et ses docnums
            $affichage_expl = get_expl($myBul->expl);
            $cpt_expl = get_expl($myBul->expl, 0, true);
        } else {
            $myBul = new bulletinage($bul_id, 0, '');
            $myBul->b_notice_show_expl = 0;
            $myBul->make_display();
            //Refait pour avoir la notice de bulletin sans ses exemplaires et ses docnums
            $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, $pmb_numero_exemplaire_auto_script, $include_path;
                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 = true;
                    if ($pmb_numero_exemplaire_auto_script) {
                        if (file_exists($include_path . "/{$pmb_numero_exemplaire_auto_script}")) {
                            require_once $include_path . "/{$pmb_numero_exemplaire_auto_script}";
                            if (function_exists('is_checked_by_default')) {
                                $checked = is_checked_by_default(0, $bul_id);
                            }
                        }
                    }
                    if ($checked) {
                        $num_exemplaire_auto .= " checked='checked'";
                    }
                    $num_exemplaire_auto .= " >";
                }
                $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 . "&nbsp;<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>";
        }
        /**
         * TODO : onglets 
         */
        if ($myBul->bull_num_notice) {
            $template_path_records_tabs = "./includes/templates/records/records_elements_tabs.html";
            if (file_exists("./includes/templates/records/records_elements_tabs_subst.html")) {
                $template_path_records_tabs = "./includes/templates/records/records_elements_tabs_subst.html";
            }
            if (file_exists($template_path_records_tabs)) {
                $h2o_record_tabs = new H2o($template_path_records_tabs);
                $records_tabs = new records_tabs(new notice($myBul->bull_num_notice));
                $records_list_ui = $records_tabs->get_record()->get_records_list_ui();
                if ($records_list_ui) {
                    $records_list_ui->set_current_url($pmb_url_base . 'catalog.php?categ=' . $categ . '&bul_id=' . $myBul->bulletin_id . '&sub=' . $sub . '&action=' . $action . '&quoi=' . $quoi);
                }
                $form .= $h2o_record_tabs->render(array('records_tabs' => $records_tabs, 'bulletin_id' => $myBul->bulletin_id));
            }
        }
    }
    return $form;
}
Exemplo n.º 2
0
 if (!$explr_visible_mod && $pmb_droits_explr_localises) {
     $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 {
     global $pmb_numero_exemplaire_auto, $pmb_numero_exemplaire_auto_script;
     //if($pmb_numero_exemplaire_auto>0) $num_exemplaire_auto=" $msg[option_num_auto] <INPUT type=checkbox name='option_num_auto' value='num_auto' checked >";
     if ($pmb_numero_exemplaire_auto == 1 || $pmb_numero_exemplaire_auto == 2) {
         $num_exemplaire_auto = " {$msg['option_num_auto']} <INPUT type=checkbox name='option_num_auto' value='num_auto' ";
         $checked = true;
         if ($pmb_numero_exemplaire_auto_script) {
             if (file_exists($include_path . "/{$pmb_numero_exemplaire_auto_script}")) {
                 require_once $include_path . "/{$pmb_numero_exemplaire_auto_script}";
                 if (function_exists('is_checked_by_default')) {
                     $checked = is_checked_by_default($id, 0);
                 }
             }
         }
         if ($checked) {
             $num_exemplaire_auto .= " checked='checked'";
         }
         $num_exemplaire_auto .= " >";
     }
     $etiquette_expl = "<label class='etiquette' for='form_cb'>{$msg['291']}</label>";
     $btn_ajouter_expl = "<input type='submit' class='bouton' value=' {$msg['expl_ajouter']} ' onClick=\"return test_form(this.form)\">";
     $saisie_num_expl = "<input type='text' class='saisie-20em' name='noex' value=''>" . $num_exemplaire_auto;
 }
 $expl_new = str_replace('!!etiquette!!', $etiquette_expl, $expl_new);
 $expl_new = str_replace('!!saisie_num_expl!!', $saisie_num_expl, $expl_new);
 $expl_new = str_replace('!!btn_ajouter!!', $btn_ajouter_expl, $expl_new);