* @version $Id$ * @access public * @license http://opensource.org/licenses/gpl-3.0.html */ //////////// Check Inclusion de pages //////////// if (!class_exists('auth')){ include_once("../lib/lib_common.php"); ReloadIndex('admin'); } //////////// //////////// Check Droits utilisateur //////////// if (!$l21auth->hasRight('sdi')) ReloadIndex('admin'); //////////// include_once(override('../dashboard/common.php', THEME_ADMIN_PATH)); include_once(override('../level/mysql.inc.php', THEME_ADMIN_PATH)); // we get levels $result=$sql_object->DBSelect(SQL_getLevelsList()); $sdi_object= new sdi; // we get indicators $sdi = $sql_object->DBSelect(SQL_getListSdi2("R")); // Number of records $bdd_nb_sdi = get_unique_indicators($sdi); $bdd_nb_sdi_display = '' .$bdd_nb_sdi['count'] .' ' . _t('sdi','nb_total').'
'. PHP_EOL; include_once('../class/class.tag.php'); // getting tags menu filter $otag = new tag(); $tags =$otag->getTags('indicator', -1, false); footerAddJS('../lib/js/jquery.nestable.js'); $js = ' $("div.dd").nestable({listNodeName: "ul"}).on("change", function() { console.log($(this).prop("id")); var json_text = $("#" + $(this).prop("id")).nestable("serialize"); console.log(json_text); $.get("../admin/_ajax_sort.php", { rub: "'.$rub.'", "sort-table": json_text }, function(data){ console.log(data); // replacing data.class by data["class"] for IE8 bug fix if(data["class"] == "succeed") { alertify.success(data.msg); } else { alertify.error(data.msg); } }, "json"); });'; footerAddInlineJS($js); function display_level($parent, $dep, $array, $rub_link, $sdi) { $html = ""; $prev_dep = 0; $link_sup=$rub_link."&todo=sup&id="; $link_mod=$rub_link."&todo=mod&id="; $link_det=$rub_link."&todo=det&id="; $link_level="index.php?rub=level&todo=det&id="; if (!$dep && !$prev_dep) $html .= "\n\n"; else $html .= "\n"; return $html; } function display_orphans($rub_link, $sdi) { $html = ""; $link_sup=$rub_link."&todo=sup&id="; $link_mod=$rub_link."&todo=mod&id="; $link_det=$rub_link."&todo=det&id="; $level_label = _t('sdi', 'no_associated_level'); $disp_level_name = '' .formatText( _t('sdi', 'no_associated_level'), '2HTML'). ' '; // we prepare indicators if they are attached to current level $sdi_html = ''; if(is_array($sdi)) { for ($j=0; $j < count($sdi); $j++) { if ($sdi[$j]['sdii_level'] == 0) { // getting tags $otag = new tag (); $display_tags = $otag->getTags ( 'indicator', $sdi[$j]['sdii_id'], true, ';' ); $display_types = formatText(mb_ucfirst($GLOBALS['lang']['sdi']['select_type'][$sdi[$j]['sdii_type']]), '2HTML'); ($sdi[$j]['sdii_api_enabled'] == 'Y') ? $api = ' ' : $api =''; ($sdi[$j]['sdii_api_enabled'] == 'N' && !empty($sdi[$j]['sdii_api_url'])) ? $api = ' ' : $api = $api; if($sdi[$j]['sdii_to_dashboard'] == 'Y') $display_strat = formatText(mb_ucfirst(_t('sdi', 'attached_to_dashboard')), '2HTML'); else $display_strat = formatText(mb_ucfirst(_t('sdi', 'not_attached_to_dashboard')), '2HTML'); // we populate lists $sdi_html.="
  • \n"; $sdi_html.= "\t
     
    "; $sdi_html.="\t".cutText(formatText($sdi[$j]['sdii_name'], '2HTML'), 200, 1) ."".$api."\n"; if ($sdi[$j]['sdii_statut']=='D') $sdi_html.=" / "._t('statut','draft').""; if ($sdi[$j]['sdii_to_dashboard']=='Y') $sdi_html.=""._t('sdi','attached_to_dashboard').""; if(!empty($display_tags)) $sdi_html.= " "; if($sdi[$j]['sdii_type'] != 'not-set') $sdi_html.=''.formatText(mb_ucfirst($GLOBALS['lang']['sdi']['select_type'][$sdi[$j]['sdii_type']]), '2HTML').''; $sdi_html.="\t\n"; $sdi_html.="
    \n"; $sdi_html.="
  • \n"; } } if(!empty($sdi_html)) $sdi_html = sprintf("\n", $sdi_html); if(!empty($sdi_html)) $sdi_html = '
    ' . $sdi_html ; $html .= "\n\n"; } return $html; } $filter_menu = getMenuFilter('indicator', $tags); ?>