예제 #1
0
 function fetch_data()
 {
     global $dbh;
     $this->selected_list = array();
     $req = "SELECT * FROM opac_filters where opac_filter_view_num=" . $this->id_vue . " and  opac_filter_path='" . $this->path . "' ";
     $myQuery = pmb_mysql_query($req, $dbh);
     if (pmb_mysql_num_rows($myQuery)) {
         $r = pmb_mysql_fetch_object($myQuery);
         $param = unserialize($r->opac_filter_param);
         $this->selected_list = $param["selected"];
     }
     $this->liste_item = array();
     $liste_item = etagere::get_etagere_list();
     $i = 0;
     foreach ($liste_item as $valeur) {
         $this->liste_item[$i] = new stdClass();
         $this->liste_item[$i]->id = $valeur['idetagere'];
         $this->liste_item[$i]->name = $valeur['name'];
         $this->liste_item[$i]->comment = $valeur['comment'];
         if (in_array($valeur['idetagere'], $this->selected_list)) {
             $this->liste_item[$i]->selected = 1;
         } else {
             $this->liste_item[$i]->selected = 0;
         }
         $i++;
     }
 }
예제 #2
0
function aff_etagere($action, $bouton_ajout = 1)
{
    global $msg;
    global $PMBuserid;
    global $charset, $opac_url_base;
    $liste = etagere::get_etagere_list();
    if (sizeof($liste)) {
        print "<table>";
        print "<tr><th>" . $msg['etagere_name'] . "</th><th>" . $msg["etagere_cart_count"] . "</th><th>" . $msg['etagere_visible_date'] . "</th><th>" . $msg['etagere_visible_accueil'] . "</th></tr>";
        $parity = 1;
        while (list($cle, $valeur) = each($liste)) {
            $rqt_autorisation = explode(" ", $valeur['autorisations']);
            if (array_search($PMBuserid, $rqt_autorisation) !== FALSE || $PMBuserid == 1) {
                $link = "./catalog.php?categ=etagere&sub={$action}&action=edit_etagere&idetagere=" . $valeur['idetagere'];
                if ($parity % 2) {
                    $pair_impair = "even";
                } else {
                    $pair_impair = "odd";
                }
                $parity += 1;
                $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
                $td_javascript_click = " onmousedown=\"document.location='{$link}';\" ";
                print pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >\n           \t\t\t<td {$td_javascript_click} style='cursor: pointer'><strong>" . $valeur['name'] . "</strong>");
                if ($valeur['comment']) {
                    print pmb_bidi(" (" . $valeur['comment'] . ")");
                }
                print "</td><td {$td_javascript_click} style='cursor: pointer'>";
                print $valeur['nb_paniers'];
                print "</td><td {$td_javascript_click} style='cursor: pointer'>";
                if ($valeur['validite']) {
                    print $msg['etagere_visible_date_all'];
                } else {
                    print $msg['etagere_visible_date_du'] . " " . $valeur['validite_date_deb_f'] . " " . $msg['etagere_visible_date_fin'] . " " . $valeur['validite_date_fin_f'];
                }
                print "</td><td>";
                if ($valeur['visible_accueil']) {
                    print "X<br /><a href='" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "' target=_blank>" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "</a>";
                } else {
                    print "<br /><a href='" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "' target=_blank>" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "</a>";
                }
                print "</td>\n\t\t\t</tr>";
            }
        }
        print "</table>";
    } else {
        print $msg['etagere_no_etagere'];
    }
    if ($bouton_ajout) {
        print "<div class='row'>\n\t<input class='bouton' type='button' value=' {$msg['etagere_new_etagere']} ' onClick=\"document.location='./catalog.php?categ=etagere&sub=gestion&action=new_etagere'\" />\n\t</div>";
    }
}
예제 #3
0
파일: etagere.inc.php 프로젝트: hogsim/PMB
function aff_etagere($action, $bouton_ajout = 1)
{
    global $msg;
    global $PMBuserid;
    global $charset, $opac_url_base;
    $liste = etagere::get_etagere_list();
    if (sizeof($liste)) {
        if ($action == "edit_etagere") {
            print "<script src='./javascript/classementGen.js' type='text/javascript'></script>";
            print "<div class='hmenu'>\n\t\t\t\t\t<span><a href='catalog.php?categ=etagere&sub=classementGen'>" . $msg["classementGen_list_libelle"] . "</a></span>\n\t\t\t\t</div><hr>";
            if ($bouton_ajout) {
                print "<div class='row'>\n\t\t\t\t<input class='bouton' type='button' value=' " . $msg["etagere_new_etagere"] . " ' onClick=\"document.location='./catalog.php?categ=etagere&sub=gestion&action=new_etagere'\" />\n\t\t\t\t</div><br>";
            }
        }
        print pmb_bidi("<div class='row'><a href='javascript:expandAll()'><img src='./images/expand_all.gif' id='expandall' border='0'></a>\n\t\t\t<a href='javascript:collapseAll()'><img src='./images/collapse_all.gif' id='collapseall' border='0'></a></div>");
        $parity = 1;
        $arrayRows = array();
        while (list($cle, $valeur) = each($liste)) {
            $rqt_autorisation = explode(" ", $valeur['autorisations']);
            if (array_search($PMBuserid, $rqt_autorisation) !== FALSE || $PMBuserid == 1) {
                $classementRow = $valeur['etagere_classement'];
                if (!trim($classementRow)) {
                    $classementRow = classementGen::getDefaultLibelle();
                }
                $baselink = "./catalog.php?categ=etagere";
                $link = $baselink . "&sub={$action}&action=edit_etagere&idetagere=" . $valeur['idetagere'];
                if ($parity % 2) {
                    $pair_impair = "even";
                } else {
                    $pair_impair = "odd";
                }
                $parity += 1;
                $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" ";
                $td_javascript_click = " onmousedown=\"document.location='{$link}';\" ";
                $rowPrint = pmb_bidi("<tr class='{$pair_impair}' {$tr_javascript} >");
                $rowPrint .= pmb_bidi("<td {$td_javascript_click} style='cursor: pointer'><strong>" . $valeur['name'] . "</strong>" . ($valeur['comment'] ? " (" . $valeur['comment'] . ")" : "") . "</td>");
                $rowPrint .= pmb_bidi("<td {$td_javascript_click} style='cursor: pointer'>" . $valeur['nb_paniers'] . "</td>");
                $rowPrint .= pmb_bidi("<td {$td_javascript_click} style='cursor: pointer'>" . ($valeur['validite'] ? $msg['etagere_visible_date_all'] : $msg['etagere_visible_date_du'] . " " . $valeur['validite_date_deb_f'] . " " . $msg['etagere_visible_date_fin'] . " " . $valeur['validite_date_fin_f']) . "</td>");
                $rowPrint .= pmb_bidi("<td>" . ($valeur['visible_accueil'] ? "X" : "") . "<br /><a href='" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "' target=_blank>" . $opac_url_base . "index.php?lvl=etagere_see&id=" . $valeur['idetagere'] . "</a></td>");
                if ($action == "edit_etagere") {
                    $classementGen = new classementGen('etagere', $valeur['idetagere']);
                    $rowPrint .= pmb_bidi("<td>" . $classementGen->show_selector($baselink, $PMBuserid) . "</td>");
                }
                $rowPrint .= pmb_bidi("</tr>");
                $arrayRows[$classementRow]["title"] = stripslashes($classementRow);
                $arrayRows[$classementRow]["etagere_list"] .= $rowPrint;
            }
        }
        //on trie
        ksort($arrayRows);
        //on remplace les clés à cause des accents
        $arrayRows = array_values($arrayRows);
        foreach ($arrayRows as $key => $type) {
            if ($action == "edit_etagere") {
                print gen_plus($key, $type["title"], "<table class='classementGen_tableau'><tr><th class='classement40'>" . $msg['etagere_name'] . "</th><th class='classement10'>" . $msg["etagere_cart_count"] . "</th><th class='classement10'>" . $msg['etagere_visible_date'] . "</th><th class='classement35'>" . $msg['etagere_visible_accueil'] . "</th><th class='classement5'>&nbsp;</th></tr>" . $type["etagere_list"] . "</table>", 1);
            } else {
                print gen_plus($key, $type["title"], "<table class='classementGen_tableau'><tr><th class='classement40'>" . $msg['etagere_name'] . "</th><th class='classement10'>" . $msg["etagere_cart_count"] . "</th><th class='classement10'>" . $msg['etagere_visible_date'] . "</th><th class='classement40'>" . $msg['etagere_visible_accueil'] . "</th></tr>" . $type["etagere_list"] . "</table>", 1);
            }
        }
    } else {
        print $msg['etagere_no_etagere'];
    }
    if ($bouton_ajout) {
        print "<div class='row'>\n\t<input class='bouton' type='button' value=' " . $msg["etagere_new_etagere"] . " ' onClick=\"document.location='./catalog.php?categ=etagere&sub=gestion&action=new_etagere'\" />\n\t</div>";
    }
}
예제 #4
0
 function get_config_form()
 {
     global $charset, $dbh, $pmb_url_base;
     $result = parent::get_config_form();
     //on attributs/initialise certaines valeurs par défaut
     if (!$this->config['activeTabs']) {
         $this->config['activeTabs'] = array();
     }
     if (!$this->config['shelf_nbResultsByPage']) {
         $this->config['shelf_nbResultsByPage'] = 20;
     }
     if (!$this->config['search_nbResultsByPage']) {
         $this->config['search_nbResultsByPage'] = 20;
     }
     if (!$this->config['bulletinsList_nbResultsByPage']) {
         $this->config['bulletinsList_nbResultsByPage'] = 10;
     }
     if (!$this->config['analysisList_nbResultsByPage']) {
         $this->config['analysisList_nbResultsByPage'] = 10;
     }
     //Adresse d'utilisation
     $result .= "<div class=row><label class='etiquette' for='api_exported_functions'>" . $this->msg['mobile_service_endpoint'] . "</label><br />";
     if ($this->id) {
         $result .= "<a target='_blank' href='" . $pmb_url_base . "ws/connector_out.php?source_id=" . $this->id . "'>" . $pmb_url_base . "ws/connector_out.php?source_id=" . $this->id . "</a>";
     } else {
         $result .= $this->msg["mobile_service_endpoint_unrecorded"];
     }
     $result .= "</div>";
     //Connecteur dédié
     $connecteurs = new connecteurs_out();
     foreach ($connecteurs->connectors as $conn) {
         if ($conn->name == 'JSON-RPC') {
             $sources = $conn->sources;
         }
     }
     //on génère l'affichage du sélecteur
     $proxyIsInList = false;
     if (sizeof($sources) == 0) {
         $selectWS = $this->msg['mobile_admin_error_proxy'];
     } else {
         $selectWS = "<select name='proxyUrl'>";
         foreach ($sources as $source) {
             if ($this->config['proxyUrl'] == $pmb_url_base . "ws/connector_out.php?source_id=" . $source->id) {
                 $proxyIsInList = true;
             }
             $selectWS .= "<option value='" . $pmb_url_base . "ws/connector_out.php?source_id=" . $source->id . "'" . ($this->config['proxyUrl'] == $pmb_url_base . "ws/connector_out.php?source_id=" . $source->id ? " selected" : "") . ">" . $source->name . "</option>";
         }
         $selectWS .= "</select>";
     }
     //maintenant l'entrée manuelle...
     $writeWS = "<input type='text' id='proxyUrl' name='proxyUrl' value='" . $this->config['proxyUrl'] . "' />";
     $result .= "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='proxyUrl'>" . $this->msg['mobile_admin_proxyUrl'] . "</label><br />\n\t\t\t" . $this->msg['mobile_admin_pickWSInList_yes'] . "\n\t\t\t&nbsp;<input type='radio' name='pickWSInList' value='yes' " . ($proxyIsInList == true ? "checked='checked'" : "") . " onchange='switchWSMethod();'/>\n\t\t\t&nbsp;" . $this->msg['mobile_admin_pickWSInList_no'] . "\t\t\t\n\t\t\t&nbsp;<input type='radio' name='pickWSInList' value='no' " . ($proxyIsInList == true ? "" : "checked='checked'") . " onchange='switchWSMethod();' /><br /><br />\n\t\t\t<div id='selectWS'></div>\n\t\t\t";
     $result .= "\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     //Onglets dispo dans l'appli
     $result .= "\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' >" . $this->msg['mobile_admin_tabs_title'] . "</label><br />\n\t\t\t<div class='notice-child'>\n\t\t\t<table class='quadrille'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th style='text-align:right;'>" . $this->msg['mobile_admin_form_tabs_label'] . "</th>\n\t\t\t\t\t<th style='text-align:center;' >" . $this->msg['mobile_admin_form_tabs_valid'] . "</th>\n\t\t\t\t\t<th style='text-align:center;'>" . $this->msg['mobile_admin_firstTab'] . "</th>\n\t\t\t\t\t<th style='text-align:left;'>" . $this->msg['mobile_admin_form_tabs_desc'] . "</th>\n\t\t\t\t\t\n\t\t\t\t</tr>";
     $i = 0;
     $first_onglet_check = false;
     foreach ($this->onglets as $onglet => $value) {
         $check_first_onglet = "";
         if ($this->config['firstTab'] && $this->config['activeTabs'][$this->config['firstTab']]) {
             if ($this->config['firstTab'] === $onglet) {
                 $check_first_onglet = " checked ";
                 $first_onglet_check = true;
             }
         } elseif (!$first_onglet_check) {
             $check_first_onglet = " checked ";
         }
         $result .= "\n\t\t\t\t<tr >\n\t\t\t\t\t<td style='text-align:right;'>" . $value['label'] . "</td>\n\t\t\t\t\t<td style='text-align:center;'>\n\t\t\t\t\t\t" . $this->msg['mobile_admin_form_tabs_yes'] . "&nbsp;\n\t\t\t\t\t\t<input type='radio' id='tab_" . $onglet . "_ok' name='{$onglet}' value='1'" . ($this->config['activeTabs'][$onglet] == 1 ? " checked " : " ") . "onchange='checkParam(\"{$onglet}\",false);' />&nbsp;\n\t\t\t\t\t\t" . $this->msg['mobile_admin_form_tabs_no'] . "&nbsp;\n\t\t\t\t\t\t<input type='radio' id='tab_" . $onglet . "_ko' name='{$onglet}' value='0' " . ($this->config['activeTabs'][$onglet] == 0 ? " checked " : " ") . "onchange='checkParam(\"{$onglet}\",false);' />\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style='text-align:center;'>\n\t\t\t\t\t\t<input type='radio' id='firstTab_{$onglet}' name='firstTab' value='{$onglet}' " . $check_first_onglet . "/>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style='text-align:left;'>" . $value['desc'] . "</td>\n\t\t\t\t</tr>";
         $i++;
     }
     $result .= "\n\t\t\t</table>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     //param pour l'onglet 'Accueil'
     $form_infoPage = "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='firstInfoPage'>" . $this->msg['mobile_admin_firstInfoPage'] . "</label><br />";
     $requete = "select id_infopage as id, title_infopage as title from infopages where valid_infopage = 1 order by title DESC";
     $res = mysql_query($requete);
     if (mysql_num_rows($res)) {
         $form_infoPage .= "\n\t\t\t<select id ='firstInfoPage' name='firstInfoPage'>";
         while ($infopage = mysql_fetch_object($res)) {
             $form_infoPage .= "\n\t\t\t\t<option value='" . $infopage->id . "'" . ($this->config["firstInfoPage"] == $infopage->id ? " selected" : "") . ">" . $infopage->title . "</option>";
         }
         $form_infoPage .= "\n\t\t\t</select>";
     } else {
         $form_infoPage .= $this->msg['mobile_admin_error_infopage'];
     }
     $form_infoPage .= "\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>\n\t\t";
     $result .= gen_plus("form_infoPage", $this->msg['mobile_admin_form_infoPagesTitle'], $form_infoPage) . "<div class='row'>&nbsp;</div>";
     //param pour l'onglet 'Etagère coup de coeur'
     $form_shelf .= "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='heartShelf'>" . $this->msg['mobile_admin_heatShelf'] . "</label><br />";
     $etageres = etagere::get_etagere_list();
     $etagere_valid = false;
     $select = "\n\t\t\t<select id='heartShelf' name='heartShelf'>";
     foreach ($etageres as $etagere) {
         if ($etagere['validite'] == 1 && $etagere['visible_accueil'] == 1) {
             $select .= "\n\t\t\t\t<option value='" . $etagere['idetagere'] . "'" . ($this->config['heartShelf'] == $etagere['idetagere'] ? " selected" : "") . ">" . $etagere['name'] . "</option>";
             $etagere_valid = true;
         }
     }
     $select .= "\n\t\t\t</select>";
     if ($etagere_valid == true) {
         $form_shelf .= $select;
     } else {
         $form_shelf .= $this->msg['mobile_admin_error_etageres'];
     }
     $form_shelf .= "\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='shelf_nbResultsByPage'>" . $this->msg['mobile_admin_nbResultsByPage'] . "</label><br />\n\t\t\t<input type='text' id='shelf_nbResultsByPage' name='shelf_nbResultsByPage' value='" . $this->config['shelf_nbResultsByPage'] . "' />\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     $result .= gen_plus("form_shelf", $this->msg['mobile_admin_form_shelfTitle'], $form_shelf) . "<div class='row'>&nbsp;</div>";
     //param pour l'onglet 'Recherche Simple'
     $form_search = "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='search_nbResultsByPage'>" . $this->msg['mobile_admin_nbResultsByPage'] . "</label><br />\n\t\t\t<input type='text' id='search_nbResultsByPage' name='search_nbResultsByPage' value='" . $this->config['search_nbResultsByPage'] . "' />\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='allowTypDocFilter'>" . $this->msg["mobile_admin_form_search_allowSearchByTypeDoc"] . "</label><br />\n\t\t\t" . $this->msg['mobile_admin_form_search_allowSearchByTypeDoc_yes'] . "&nbsp;<input type='radio' id='allowTypDocFilter_yes' name='allowTypDocFilter' value='1' " . ($this->config["allowTypDocFilter"] == 1 ? " checked " : " ") . " />&nbsp;\n\t\t\t" . $this->msg['mobile_admin_form_search_allowSearchByTypeDoc_no'] . "&nbsp;<input type='radio' id='allowTypDocFilter_no' name='allowTypDocFilter' value='0' " . ($this->config["allowTypDocFilter"] == 0 ? " checked " : " ") . "/>\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     $result .= gen_plus("form_search", $this->msg['mobile_admin_form_searchTitle'], $form_search) . "<div class='row'>&nbsp;</div>";
     //param pour Mon Compte
     $form_myAccount = "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>&nbsp;</div>";
     $result .= gen_plus("form_myAccount", $this->msg['mobile_admin_form_myAccountTitle'], $form_myAccount) . "<div class='row'>&nbsp;</div>";
     //param pour Pret Autonome
     $form_selfCheck = "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='allowCheckIn'>" . $this->msg["mobile_admin_form_selfCheck_allowCheckIn"] . "</label><br />\n\t\t\t" . $this->msg['mobile_admin_form_selfCheck_allowCheckIn_yes'] . "&nbsp;<input type='radio' id='allowCheckIn_yes' name='allowCheckIn' value='1' " . ($this->config["allowCheckIn"] == 1 ? " checked " : " ") . " />&nbsp;\n\t\t\t" . $this->msg['mobile_admin_form_selfCheck_allowCheckIn_no'] . "&nbsp;<input type='radio' id='allowCheckIn_no' name='allowCheckIn' value='0' " . ($this->config["allowCheckIn"] == 0 ? " checked " : " ") . "/>\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     $result .= gen_plus("form_selfCheck", $this->msg['mobile_admin_form_selfCheckTitle'], $form_selfCheck) . "<div class='row'>&nbsp;</div>";
     //param d'affichage général
     $param_gen = "\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='bulletinsList_nbResultsByPage'>" . $this->msg['mobile_admin_form_bulletinsList_nbResultsByPage'] . "</label><br />\n\t\t\t<input type='text' id='bulletinsList_nbResultsByPage' name='bulletinsList_nbResultsByPage' value='" . $this->config['bulletinsList_nbResultsByPage'] . "' />\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='analysisList_nbResultsByPage'>" . $this->msg['mobile_admin_form_analysisList_nbResultsByPage'] . "</label><br />\n\t\t\t<input type='text' id='analysisList_nbResultsByPage' name='analysisList_nbResultsByPage' value='" . $this->config['analysisList_nbResultsByPage'] . "' />\n\t\t</div>\n\t\t<div class='row'>&nbsp;</div>";
     $result .= gen_plus("paramGen", $this->msg['mobile_admin_form_paramsGen'], $param_gen) . "<div class='row'>&nbsp;</div>";
     $result .= "\n\t\t<script type='text/javascript' src='javascript/tablist.js'></script>\n\t\t<script type='text/javascript'>\n\t\t\t// on génère une fonction d'initialisation\n\t\t\tfunction init(){";
     foreach ($this->onglets as $onglet => $value) {
         $result .= "\n\t\t\t\tswitchWSMethod();\n\t\t\t\tcheckParam('{$onglet}');\n\t\t\t\texpandBase('paramGen',true);\n\t\t\t";
     }
     $result .= "\n\t\t\t}\n\n\t\t\tonload = init;\n\n\t\t\tfunction switchWSMethod(){\n\t\t\t\tif(document.form_connectorout.pickWSInList[0].checked){\n\t\t\t\t\tvar pickWSInList = document.form_connectorout.pickWSInList[0].value\n\t\t\t\t}else{\n\t\t\t\t\tvar pickWSInList = document.form_connectorout.pickWSInList[1].value\t\n\t\t\t\t}\n\t\t\t\tif (pickWSInList == 'yes'){\n\t\t\t\t\tdocument.getElementById('selectWS').innerHTML = \"{$selectWS}\";\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById('selectWS').innerHTML = \"{$writeWS}\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// on s'assure que l'application dispose bien d'une première page à la soumission du formulaire...\n\t\t\tdocument.forms['form_connectorout'].onsubmit = function(){\n\t\t\t\tfor(var i=0 ; i<document.forms['form_connectorout'].firstTab.length ; i++){\n\t\t\t\t\tif(document.forms['form_connectorout'].firstTab[i].checked == true)\n\t\t\t\t\treturn true;\n\t\t\t\t}";
     foreach ($this->onglets as $onglet => $value) {
         $result .= "\n\t\t\t\tif(document.getElementById('tab_'+'{$onglet}'+'_ok').checked == true){\n\t\t\t\t\tdocument.getElementById('firstTab_{$onglet}').checked = true;\n\t\t\t\t\treturn true;\n\t\t\t\t}";
     }
     $result .= "\t\n\t\t\t\talert('" . $this->msg['mobile_admin_form_needOneTab'] . "');\n\t\t\t\treturn false;\t\t\t\n\t\t\t}\n\n\t\t\tfunction checkParam(onglet){\n\t\t\t\tif(document.getElementById('tab_'+onglet+'_ok').checked == true){\n\t\t\t\t\tswitchParamValue('firstTab_'+onglet,'disabled','active');\n\t\t\t\t\tif(document.getElementById('form_'+onglet+'Child').style.display == 'none')\n\t\t\t\t\t\texpandBase('form_'+onglet,true);\n\t\t\t\t\tswitchParamsValues(onglet,'active');\n\t\t\t\t}else{\n\t\t\t\t\tswitchParamValue('firstTab_'+onglet,'disabled','inactive');\n\t\t\t\t\tdocument.getElementById('firstTab_'+onglet).checked = false;\n\t\t\t\t\tif(document.getElementById('form_'+onglet+'Child').style.display == 'block')\n\t\t\t\t\t\texpandBase('form_'+onglet,true);\n\t\t\t\t\tswitchParamsValues(onglet,'inactive');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction switchParamsValues(onglet,state){\n\t\t\t\tswitch (onglet){\n\t\t\t\t\tcase 'infoPage' :\n\t\t\t\t\t\tswitchParamValue('firstInfoPage','disabled',state);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'selfCheck' :\n\t\t\t\t\t\tswitchParamValue('allowCheckIn_yes','disabled',state);\n\t\t\t\t\t\tif(document.getElementById('allowCheckIn_yes').checked ==true)\n\t\t\t\t\t\t\tswitchParamValue('allowCheckIn_yes','checked',state);\n\t\t\t\t\t\tswitchParamValue('allowCheckIn_no','disabled',state);\n\t\t\t\t\t\tif(document.getElementById('allowCheckIn_no').checked ==true)\n\t\t\t\t\t\t\tswitchParamValue('allowCheckIn_no','checked',state);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'myAccount' :\n\t\t\t\t\t\tswitchParamValue('tab_selfCheck_ok','disabled',state);\n\t\t\t\t\t\tif(state == 'inactive')\n\t\t\t\t\t\t\tswitchParamValue('tab_selfCheck_ko','checked','active');\n\t\t\t\t\t\tcheckParam('selfCheck');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'search' :\n\t\t\t\t\t\tswitchParamValue('search_nbResultsByPage','disabled',state);\n\t\t\t\t\t\tswitchParamValue('allowTypDocFilter_yes','disabled',state);\n\t\t\t\t\t\tswitchParamValue('allowTypDocFilter_no','disabled',state);\n\t\t\t\t\t\tif(document.getElementById('allowTypDocFilter_no').checked ==true)\n\t\t\t\t\t\t\tswitchParamValue('allowTypDocFilter_no','checked',state);\n\t\t\t\t\t\tif(document.getElementById('allowTypDocFilter_yes').checked ==true)\n\t\t\t\t\t\t\tswitchParamValue('allowTypDocFilter_yes','checked',state);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'shelf':\n\t\t\t\t\t\tswitchParamValue('heartShelf','disabled',state);\n\t\t\t\t\t\tswitchParamValue('shelf_nbResultsByPage','disabled',state);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\tfunction switchParamValue(id,param,state){\n\t\t\t\tvar newState = false;\n\t\t\t\tif(state == 'active'){\n\t\t\t\t\tswitch(param){\n\t\t\t\t\t\tcase 'disabled' :\n\t\t\t\t\t\t\tnewState = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'checked' :\n\t\t\t\t\t\t\tnewState = true;\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}else if(state == 'inactive'){\n\t\t\t\t\tswitch(param){\n\t\t\t\t\t\tcase 'disabled' :\n\t\t\t\t\t\t\tnewState = true;\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'checked' :\n\t\t\t\t\t\t\tnewState = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tdocument.getElementById(id)[param] = newState;\n\t\t\t}\n\t\t</script>";
     return $result;
 }
예제 #5
0
     }
     $myEtagere->autorisations = $autorisations;
     $myEtagere->name = $form_etagere_name;
     $myEtagere->comment = $form_etagere_comment;
     $myEtagere->validite = $form_visible_all;
     $myEtagere->validite_date_deb_f = $form_visible_deb;
     $myEtagere->validite_date_fin_f = $form_visible_fin;
     $myEtagere->validite_date_deb = extraitdate($form_visible_deb);
     $myEtagere->validite_date_fin = extraitdate($form_visible_fin);
     $myEtagere->visible_accueil = $form_visible_accueil;
     $myEtagere->tri = $tri;
     $myEtagere->save_etagere();
     aff_etagere("edit_etagere", 1);
     break;
 case 'valid_new_etagere':
     $myEtagere = new etagere(0);
     $myEtagere->create_etagere();
     if (is_array($etagere_autorisations)) {
         $autorisations = implode(" ", $etagere_autorisations);
     } else {
         $autorisations = "1";
     }
     $myEtagere->autorisations = $autorisations;
     $myEtagere->name = $form_etagere_name;
     $myEtagere->comment = $form_etagere_comment;
     $myEtagere->validite = $form_visible_all;
     $myEtagere->validite_date_deb_f = $form_visible_deb;
     $myEtagere->validite_date_fin_f = $form_visible_fin;
     $myEtagere->validite_date_deb = extraitdate($form_visible_deb);
     $myEtagere->validite_date_fin = extraitdate($form_visible_fin);
     $myEtagere->visible_accueil = $form_visible_accueil;
예제 #6
0
// +-------------------------------------------------+
// $Id: constitution.inc.php,v 1.6 2007-03-10 09:03:18 touraine37 Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
if (!verif_droit_etagere($idetagere)) {
    $action = "aucune";
}
switch ($action) {
    case 'edit_etagere':
        $myEtagere = new etagere($idetagere);
        $etagere_constitution_form = str_replace('!!formulaire_titre!!', $msg['etagere_constitution_de'] . " " . $myEtagere->name, $etagere_constitution_form);
        $etagere_constitution_form = str_replace('!!idetagere!!', $idetagere, $etagere_constitution_form);
        $etagere_constitution_form = str_replace('!!constitution!!', $myEtagere->constitution(1), $etagere_constitution_form);
        print pmb_bidi($etagere_constitution_form);
        break;
    case 'save_etagere':
        $myEtagere = new etagere($idetagere);
        // suppression
        $rqt = "delete from etagere_caddie where etagere_id='" . $idetagere . "' ";
        $res = mysql_query($rqt, $dbh);
        for ($i = 0; $i < sizeof($idcaddie); $i++) {
            if (verif_droit_caddie($idcaddie[$i])) {
                $myEtagere->add_panier($idcaddie[$i]);
            }
        }
        aff_etagere("constitution", 0);
        break;
    default:
        aff_etagere("constitution", 0);
}