Пример #1
0
$base_noheader = 1;
$base_nobody = 1;
$base_auth = "CATALOGAGE_AUTH";
require_once "includes/init.inc.php";
require_once "{$class_path}/caddie.class.php";
header("Content-Type: text/html; charset={$charset}");
//si id_notice est présent, il s'agit de l'accès rapide aux paniers (div apparaissant sur mouseOver icone panier)
//sinon, il s'agit de la liste des paniers pour le drag and drop
if ($id_notice) {
    $list_noti = caddie::get_cart_list("NOTI", 1);
    $list_expl = array();
    $list_bull = array();
} else {
    $list_noti = caddie::get_cart_list("NOTI", 0);
    $list_expl = caddie::get_cart_list("EXPL", 0);
    $list_bull = caddie::get_cart_list("BULL", 0);
}
$is_cart = 0;
if ($id_notice) {
    $link = "<a href='#' id='close_cart_div' ><img border='0' align='middle' src='images/close.gif'/></a>";
} else {
    $link = "<a href='#' id='close_cart_pannel' ><img border='0' align='middle' src='images/close.gif'/></a>";
}
print "<div><table width='100%'><tbody><tr><td align='left' width='90%'></td><td align='right'>{$link}</td></tr></tbody></table></div>";
if (count($list_noti)) {
    print "<h3>{$msg['396']}</h3><br />";
    for ($i = 0; $i < count($list_noti); $i++) {
        if ($id_notice) {
            $pannel_cart_link = "javascript:notice_div_caddie(" . $id_notice . "," . $list_noti[$i]["idcaddie"] . ")";
        } else {
            $pannel_cart_link = "catalog.php?categ=caddie&sub=gestion&quoi=panier&action=&object_type=NOTI&idcaddie=" . $list_noti[$i]["idcaddie"] . "&item=0";
Пример #2
0
function aff_paniers($item = 0, $object_type = "NOTI", $lien_origine = "./cart.php?", $action_click = "add_item", $titre = "Cliquez sur le nom d'un panier pour y déposer la notice", $restriction_panier = "", $lien_edition = 0, $lien_suppr = 0, $lien_creation = 1, $nocheck = false, $lien_pointage = 0)
{
    global $msg;
    global $PMBuserid;
    global $charset;
    global $myCart;
    global $action;
    global $baselink;
    if ($lien_edition) {
        $lien_edition_panier_cst = "<input type=button class=bouton value='{$msg['caddie_editer']}' onclick=\"document.location='{$lien_origine}&action=edit_cart&idcaddie=!!idcaddie!!';\" />";
    } else {
        $lien_edition_panier_cst = "";
    }
    $liste = caddie::get_cart_list($restriction_panier);
    print "<script type='text/javascript' src='./javascript/tablist.js'></script>";
    if ($item && $nocheck) {
        print "<form name='print_options' action='{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&item={$item}' method='post'>";
        print "<input type='hidden' id='idcaddie' name='idcaddie' >";
        if ($lien_pointage) {
            print "<input type='hidden' id='idcaddie_selected' name='idcaddie_selected' >";
        }
    }
    if ($item && !$nocheck) {
        print "<form name='print_options' action='{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&item={$item}' method='post'>";
        if ($action != "save_cart") {
            print "<input type='checkbox' name='include_child' >&nbsp;" . $msg["cart_include_child"];
        }
    }
    print "<hr />";
    if ($lien_creation) {
        print "<div class='row'>\n\t\t{$boutons_select}<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&object_type=" . $object_type . "&item={$item}'\" />\n\t\t</div><br>";
    }
    if (sizeof($liste)) {
        print pmb_bidi("<div class='row'><a href='javascript:expandAll()'><img src='./images/expand_all.gif' id='expandall' border='0'></a>\n\t\t<a href='javascript:collapseAll()'><img src='./images/collapse_all.gif' id='collapseall' border='0'></a>{$titre}</div>");
        print confirmation_delete("{$lien_origine}&action=del_cart&object_type=" . $object_type . "&item={$item}&idcaddie=");
        while (list($cle, $valeur) = each($liste)) {
            $rqt_autorisation = explode(" ", $valeur['autorisations']);
            if (array_search($PMBuserid, $rqt_autorisation) !== FALSE || $PMBuserid == 1) {
                $aff_lien = str_replace('!!idcaddie!!', $valeur['idcaddie'], $lien_edition_panier_cst);
                if (!$myCart) {
                    $myCart = new caddie(0);
                }
                $myCart->nb_item = $valeur['nb_item'];
                $myCart->nb_item_pointe = $valeur['nb_item_pointe'];
                $myCart->type = $valeur['type'];
                $print_cart[$myCart->type]["titre"] = "<b>" . $msg["caddie_de_" . $myCart->type] . "</b><br />";
                if (!trim($valeur["caddie_classement"])) {
                    $valeur["caddie_classement"] = classementGen::getDefaultLibelle();
                }
                $parity[$myCart->type] = 1 - $parity[$myCart->type];
                if ($parity[$myCart->type]) {
                    $pair_impair = "even";
                } else {
                    $pair_impair = "odd";
                }
                $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
                if ($item && $action != "save_cart") {
                    $rowPrint = pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} ><td class='classement60'>" . (!$nocheck ? "<input type='checkbox' id='id_" . $valeur['idcaddie'] . "' name='caddie[" . $valeur['idcaddie'] . "]' value='" . $valeur['idcaddie'] . "'>" : "") . "&nbsp;");
                    $link = "{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&idcaddie=" . $valeur['idcaddie'] . "&item={$item}";
                    if (!$nocheck) {
                        $rowPrint .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"id_" . $valeur['idcaddie'] . "\").checked=true;document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                    } else {
                        if ($lien_pointage) {
                            $rowPrint .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"idcaddie\").value=" . $item . ";document.getElementById(\"idcaddie_selected\").value=" . $valeur['idcaddie'] . ";document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                        } else {
                            $rowPrint .= pmb_bidi("<a href='#' onclick='javascript:document.getElementById(\"idcaddie\").value=" . $valeur['idcaddie'] . ";document.forms[\"print_options\"].submit();' /><strong>" . $valeur['name'] . "</strong>");
                        }
                    }
                    if ($valeur['comment']) {
                        $rowPrint .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $rowPrint .= pmb_bidi("</td>\n\t            \t\t" . aff_cart_nb_items_reduit($myCart) . "\n\t            \t\t<td class='classement20'>{$aff_lien}</td>\n\t\t\t\t\t\t</tr>");
                } else {
                    $link = "{$lien_origine}&action={$action_click}&object_type=" . $object_type . "&idcaddie=" . $valeur['idcaddie'] . "&item={$item}";
                    $rowPrint = pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >");
                    $rowPrint .= pmb_bidi("<td class='classement60'><a href='{$link}' /><strong>" . $valeur['name'] . "</strong>");
                    if ($valeur['comment']) {
                        $rowPrint .= pmb_bidi("<br /><small>(" . $valeur['comment'] . ")</small>");
                    }
                    $rowPrint .= pmb_bidi("</a></td>");
                    $rowPrint .= pmb_bidi(aff_cart_nb_items_reduit($myCart));
                    if ($lien_creation) {
                        $classementGen = new classementGen('caddie', $valeur['idcaddie']);
                        $rowPrint .= pmb_bidi("<td class='classement15'>" . $aff_lien . "&nbsp;" . caddie::show_actions($valeur['idcaddie'], $valeur['type']) . "</td>");
                        $rowPrint .= pmb_bidi("<td class='classement5'>" . $classementGen->show_selector($baselink, $PMBuserid) . "</td>");
                    } else {
                        $rowPrint .= pmb_bidi("<td class='classement20'>{$aff_lien}</td>");
                    }
                    $rowPrint .= pmb_bidi("</tr>");
                }
                $print_cart[$myCart->type]["classement_list"][$valeur["caddie_classement"]]["titre"] = stripslashes($valeur["caddie_classement"]);
                $print_cart[$myCart->type]["classement_list"][$valeur["caddie_classement"]]["cart_list"] .= $rowPrint;
            }
        }
        if ($lien_creation) {
            print "<script src='./javascript/classementGen.js' type='text/javascript'></script>";
        }
        //Tri des classements
        foreach ($print_cart as $key => $cart_type) {
            ksort($print_cart[$key]["classement_list"]);
        }
        // affichage des paniers par type
        foreach ($print_cart as $key => $cart_type) {
            //on remplace les clés à cause des accents
            $cart_type["classement_list"] = array_values($cart_type["classement_list"]);
            $contenu = "";
            foreach ($cart_type["classement_list"] as $keyBis => $cart_typeBis) {
                $contenu .= gen_plus($key . $keyBis, $cart_typeBis["titre"], "<table border='0' cellspacing='0' width='100%' class='classementGen_tableau'>" . $cart_typeBis["cart_list"] . "</table>", 1);
            }
            print gen_plus($key, $cart_type["titre"], $contenu, 1);
        }
    } else {
        print $msg[398];
    }
    if (!$nocheck) {
        if ($item && $action != "save_cart") {
            $boutons_select = "<input type='submit' value='" . $msg["print_cart_add"] . "' class='bouton'/>&nbsp;<input type='button' value='" . $msg["print_cancel"] . "' class='bouton' onClick='self.close();'/>&nbsp;";
        }
        if ($lien_creation) {
            print "<div class='row'><hr />\n\t\t\t\t{$boutons_select}<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&object_type=" . $object_type . "&item={$item}'\" />\n\t\t\t\t</div>";
        } else {
            print "<div class='row'><hr />\n\t\t\t\t{$boutons_select}\n\t\t\t\t</div>";
        }
    } else {
        if ($lien_creation) {
            print "<div class='row'><hr />\n\t\t\t{$boutons_select}<input class='bouton' type='button' value=' {$msg['new_cart']} ' onClick=\"document.location='{$lien_origine}&action=new_cart&object_type=" . $object_type . "&item={$item}'\" />\n\t\t\t</div>";
        }
    }
    //if(($item)&&(!$nocheck)) print"</form>";
    if ($item) {
        print "</form>";
    }
}
Пример #3
0
 function form_pour_maj_entrepot($source_id, $sync_form = "sync_form")
 {
     global $quoi_synchro;
     $form = "";
     $form .= "<script>";
     $form .= "\n\t\tfunction unckeckall() {\n\t\t\tfor (i=0, count=document." . $sync_form . ".elements.length; i<count; i++) {\n\t\t\t\tif (document." . $sync_form . ".elements[i].value.substr(0, 21) == 'synchro_noticecaddie_') {\n\t\t\t\t\tdocument." . $sync_form . ".elements[i].checked = false;\n\t\t\t\t}\n\t\t\t\tif (document." . $sync_form . ".elements[i].value.substr(0, 19) == 'synchro_explcaddie_') {\n\t\t\t\t\tdocument." . $sync_form . ".elements[i].checked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction clear_the_radio_button() {\n\t\t\tdocument.getElementById('quoi_synchro_synchro_base').checked = false;\n\t\t}";
     $form .= "</script>";
     $form .= $this->msg["aliga_syncbase"];
     $form .= '<blockquote>';
     $form .= '<input type="radio" onclick="unckeckall();" name="quoi_synchro[]" value="synchro_base" id="quoi_synchro_synchro_base" ' . (!$quoi_synchro || $quoi_synchro['synchro_base'] ? 'checked' : '') . '><label for="quoi_synchro_synchro_base">' . $this->msg["aliga_syncbase"] . '</label>';
     $form .= '</blockquote>';
     $form .= $this->msg["aliga_sync_noticecaddie"];
     $form .= '<blockquote>';
     $caddies = caddie::get_cart_list("NOTI");
     foreach ($caddies as $caddie) {
         $form .= '<input type="checkbox" onclick="clear_the_radio_button()" name="quoi_synchro[]" value="synchro_noticecaddie_' . $caddie["idcaddie"] . '" id="quoi_synchro_synchro_noticecaddie_' . $caddie["idcaddie"] . '" ' . ($quoi_synchro['synchro_noticecaddie_' . $caddie["idcaddie"] . ''] ? 'checked' : '') . '><label for="quoi_synchro_synchro_noticecaddie_' . $caddie["idcaddie"] . '">' . $caddie["name"] . '</label><i> (' . $caddie["nb_item_base"] . ' ' . $this->msg["aliga_caddie_element"] . ')</i><br />';
     }
     $form .= '</blockquote>';
     $form .= $this->msg["aliga_sync_explcaddie"];
     $form .= '<blockquote>';
     $caddies = caddie::get_cart_list("EXPL");
     foreach ($caddies as $caddie) {
         $form .= '<input type="checkbox" onclick="clear_the_radio_button()" name="quoi_synchro[]" value="synchro_explcaddie_' . $caddie["idcaddie"] . '" id="quoi_synchro_synchro_explcaddie_' . $caddie["idcaddie"] . '" ' . ($quoi_synchro['synchro_explcaddie_' . $caddie["idcaddie"] . ''] ? 'checked' : '') . '><label for="quoi_synchro_synchro_explcaddie_' . $caddie["idcaddie"] . '">' . $caddie["name"] . ' <i>(' . $caddie["nb_item_base"] . ' ' . $this->msg["aliga_caddie_element"] . ')</i></label><br />';
     }
     $form .= '</blockquote>';
     $form .= "<br /><br />";
     return $form;
 }