Source for file list.php
Documentation is available at list.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
//////////// Check Droits utilisateur ////////////
if (!$l21auth->hasRight('dashboard')) ReloadIndex('admin');
include_once("../lib/input_helpers.php");
include_once("../dashboard/common.php");
$result= $sql_object->DBSelect($req_list_theme);
//$result_sdi=$sdi_object->GetListSdi($filter="R", $valueparam=0, $sql_object);
$result_sdi = $sql_object -> DBSelect($req_sdi);
//$link_sup=$rub_link."&todo=sup&id=";
$link_list_scale= $rub_link. "&todo=list&scale_id=";
if (!isset ($_GET['scale_id']) && !isset ($_POST['scale_id'])) {
if (isset ($_POST['scale_id'])) $scale_id = $_POST['scale_id'];
if (isset ($_GET['scale_id'])) $scale_id = $_GET['scale_id'];
function getIndicators($themes, $indicators, $scale_id, $status, $sql_object) {
if($status== 'all') $test = true;
if($status== 'attached') $test= 'Y';
if($status== 'not-attached') $test= 'N';
$link_add= $rub_link. "&todo=add&id=";
$link_det= $rub_link. "&todo=det&id=";
$a = array(); // to not display twice an indicator
for ($i= 0;$i< count($themes);$i++ ){
if ($themes[$i]['sdtheme_id'] != $current_sdtheme && $current_sdtheme <> '') {
$listing.= "</ul>\n</div>\n";
if ($themes[$i]['sdtheme_id'] != $current_sdtheme) {
$current_sdtheme = $themes[$i]['sdtheme_id'];
$listing.= "<h3><a href=\"\">". formatText($themes[$i]['sdtheme_name'], '2HTML'). "</a></h3>";
$listing.= "<div class=\"contboxgray\">\n";
for ($j= 0;$j< count($indicators);$j++ ) {
if ($themes[$i]['theme_id'] == $indicators[$j]['sdii_theme']) {
// setting $threshold_value
// By default initial value
$threshold_value = $indicators[$j]['sdii_threshold_value'];
// if set, we get the latest for the given scale
if(isset ($r[0]['sdiv_value']) && !is_null($r[0]['sdiv_threshold'])) {
$threshold_value = $r[0]['sdiv_threshold'];
if ($status == 'all' && $indicators[$j]['sdii_to_dashboard']== 'N') {
$cssclass= ' not-attached';
if ($indicators[$j]['sdii_to_dashboard'] == $test && !in_array($indicators[$j]['sdii_id'], $a)) {
$listing.= "\t<li class=\"li2". $cssclass. "\">\n";
$listing.= getViz($sql_object, $scale_id, $indicators[$j], $threshold_value);
$listing.= "\t<div class=\"dashboard-indicator-label\">\n";
$listing.= "\t\t<a href=\"". $link_det. $indicators[$j]['sdii_id']. "&scale_id=". $scale_id. "\" title=\"". formatText($indicators[$j]['sdii_name'], '2HTML'). "\" class=\"indic-name\">". formatTextli($indicators[$j]['sdii_name']). "</a>\n";
if ($indicators[$j]['sdii_statut']== 'D') $listing.= "<span class=\"state\">". _t('statut','draft'). "</span>\n";
$listing.= "\t\t<a href=\"". $link_add. $indicators[$j]['sdii_id']. "&scale_id=". $scale_id. "\" class=\"ico_add\" title=\"". _t('dashboard','add'). "\"><i class=\"icon-plus-circled\"></i><span>". _t('dashboard','add'). "</span></a>\n";
array_push($a, $indicators[$j]['sdii_id']); // we add the id into array for not displaying it twice
$listing.= "</ul>\n</div>\n";
//affichage selectbox échelle
$resultscale = $sql_object -> DBSelect($req_list_scale);
$scale_selectbox= "<h2>". formatText($resultscale2[0]['scale_denomination'], '2HTML'). "</h2>";
$scale_selectbox.= "<div class=\"filterselect\">";
$scale_selectbox.= ScaleSelectBox($resultscale, "scale", $scale_id, $link_list_scale);
$scale_selectbox.= "</div>\n";
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home'); ?></a></li>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>" class="chemin_rub"> <?php echo _t('menu','dashboard');?> </a></li>
<li><span> <?php echo _t('dashboard','list'); ?> </span></li>
include_once(THEME_ADMIN_PATH. "quickicons.php");
// including sparkline code
footerAddInlineJS("$('.inlinebar').sparkline('html', {type: 'bar', barColor: '#8DA8CB'} );");
<script type="text/javascript">
$(document).ready(function() {
if (elem.children().length == 0) {
elem.append(" <?php echo _t('divers', 'nodata'); ?>");
activate: function( event, ui ) {
$.sparkline_display_visible();
$(".dashboard-indicator-gauge .cursor").removeAttr("title");
$(this).next().fadeIn('fast');
<div class="contentcontainer">
<?php include_once(override($dir. '/menurub.php', THEME_ADMIN_PATH)); ?>
<?php echo $scale_selectbox; ?>
<br style="clear: both" />
<li><a href="#tabs-1"> <?php echo _t('dashboard', 'tab-attached'); ?></a></li>
<li><a href="#tabs-2"> <?php echo _t('dashboard', 'tab-not-attached'); ?></a></li>
<li><a href="#tabs-3"> <?php echo _t('dashboard', 'tab-all'); ?></a></li>
<?php echo getIndicators($result, $result_sdi, $scale_id, 'attached', $sql_object); ?>
<?php echo getIndicators($result, $result_sdi, $scale_id, 'not-attached', $sql_object); ?>
<?php echo getIndicators($result, $result_sdi, $scale_id, 'all', $sql_object); ?>
<?php include_once(override($dir. '/help.php', THEME_ADMIN_PATH)); ?>
|