Source for file display.php
Documentation is available at display.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
include_once(themePath('../dashboard/' . SQL . '.inc.php'));
* affichage du tableau de bord
* @param integer $id_filter
$result_sdi = $GLOBALS['sql_object'] -> DBSelect(SQL_getListSdi("P", $valueparam = 0));
for ($i = 0;$i < count($result);$i++ ) {
if ($result[$i]['sdtheme_id'] != $current_sdtheme && $current_sdtheme <> '') {
if ($result[$i]['sdtheme_id'] != $current_sdtheme) {
$current_sdtheme = $result[$i]['sdtheme_id'];
$listing .= "<h2 id=\"h2_". $a. "\" class=\"dashboard\">" . formatText($result[$i]['sdtheme_name'], '2HTML') . "</h2>". END_LINE;
$listing .= '<table cellspacing="0" cellpadding="5" class="table_dashboard" summary="'. sprintf(_t('dashboard','list_public_summary'), formatText($result[$i]['sdtheme_name'], '2HTML')). '">' . END_LINE;
$listing .= '<td>'. _t('dashboard','graphic_value'). '</td>' . END_LINE;
//$listing .= '<td>'._t('dashboard','numeric_value').'</td>' . END_LINE;
$listing .= '<td>'. _t('dashboard','tendencies_value'). '</td>' . END_LINE;
$listing .= '<td>'. _t('dashboard','label_value'). '</td>' . END_LINE;
for ($j = 0;$j < count($result_sdi);$j++ ) {
if ($result[$i]['theme_id'] == $result_sdi[$j]['sdii_theme']) {
$link_det_sdi= array('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id'=> $result_sdi[$j]['sdii_id'], 'parentid'=> $id_filter, 'name' => $result_sdi[$j]['sdii_name']);
$aff_bare = getRuler($id_filter, $filter, $result_sdi[$j]['sdii_id'], $result_sdi[$j]['sdii_max_value'], $result_sdi[$j]['sdii_min_value'], $result_sdi[$j]['sdii_threshold_value'], $result_sdi[$j]['sdii_unit'], $result_sdi[$j]['sdii_threshold_relative'], $link_det_sdi);
$listing .= "<td><a href=\"" . HrefMaker($link_det_sdi) . "\" title=\"" . formatText($result_sdi[$j]['sdii_name'], '2ATT') . "\">" . formatText(cutText($result_sdi[$j]['sdii_name'], 53), '2HTML') . "</a></td>" . END_LINE;
* traitement de la valeur d'un IDD pour valeur du curseur en CSS
* @param $threshold_value
* @param $threshold_relative
function getPositionfromValue ($value, $max_value, $min_value, $threshold_value, $threshold_relative)
if ($max_value == 0) $max_value = 0.000001;
if ($min_value == 0) $min_value = 0.000001;
if ($threshold_relative == 'Y') {
$unitup = 50 / ($max_value - $threshold_value);
$unitdown = 50 / ($threshold_value - $min_value);
if ($value > $threshold_value) $result = 50 + (($value - $threshold_value) * $unitup);
else $result = 50 - (($threshold_value - $value) * $unitdown);
if(($max_value - $threshold_value) <> 0) $unitdown = 50 / ($max_value - $threshold_value);
if(($threshold_value - $min_value) <> 0) $unitup = 50 / ($threshold_value - $min_value);
if ($value > $threshold_value) $result = 50 - (($value - $threshold_value) * $unitdown);
else $result = 50 + (($threshold_value - $value) * $unitup);
* affichage du curseur et compteur pour un IDD
* @param integer $scale_id
* @param $threshold_value
* @param $threshold_relative
function getRuler($scale_id = 1, $filter, $id, $max_value, $min_value, $threshold_value, $unit, $threshold_relative, $link_det_sdi)
$result_value = $GLOBALS['sql_object'] -> DBSelect(SQL_getAllValue("SCD", $scale_id, $id));
if ($result_value <> false) {
$value_cursor1 = getPositionfromValue ($result_value[0]['sdiv_value'], $max_value, $min_value, $threshold_value, $threshold_relative);
$value_cursor = 116 - $value_cursor1;
} else $value_cursor1 = "";
if ($result_value == false) {
$listing = "<td><img src=\"". THEME_ADMIN_PATH. "images/barre_gris.gif\" title=\"". _t('dashboard','novalue'). "\" alt=\"". _t('dashboard','novalue'). "\" class=\"no-value tmargin\"/></td>" . END_LINE;
$listing .= "<td style=\"width:15px\"> </td>" . END_LINE;
//$listing .= "<td> </td>" . END_LINE;
$listing = "<td style=\"width:130px\"><div class=\"indicator-info-container\"><a href=\"" . HrefMaker($link_det_sdi) . "\" class=\"ruler\" title=\"" . formatText($result_value[0]['sdiv_value'], '2ATT') . " " . $unit . "\"><img src=\"" . THEME_ADMIN_PATH. "images/barre.gif\" alt=\"". formatText(_t('dashboard','value'). " : ". $result_value[0]['sdiv_value']. " ". $unit.
"\n ". _t('sdi','min_value'). " : ". $min_value. " ". $unit.
"\n ". _t('sdi','max_value'). " : ". $max_value. " ". $unit.
"\n ". _t('sdi','threshold_value'). " : ". $threshold_value. " ". $unit, '2ATT').
"\" class=\"tmargin\" /></a>".
"<div class=\"indicator-info\"><p>". ucfirst(_t('dashboard','value')). " : <strong>". $result_value[0]['sdiv_value']. " ". $unit. "</strong></p>".
"<p>". ucfirst(_t('sdi','min_value')). " : <strong>". $min_value. " ". $unit. "</strong></p>".
"<p>". ucfirst(_t('sdi','max_value')). " : <strong>". $max_value. " ". $unit. "</strong></p>".
"<p>". ucfirst(_t('sdi','threshold_value')). " : <strong>". $threshold_value. " ". $unit. "</strong></p>".
$listing .= "<img src=\"" . THEME_ADMIN_PATH. "images/cursor.gif\" title=\"" . $result_value[0]['sdiv_value'] . " " . $unit . "\" class=\"cursor\" style=\"left:-" . $value_cursor . "px;\" alt=\"". _t('dashboard','barre'). "\"/></td>" . END_LINE;
if (isset ($result_value[1]['sdiv_value'])) {
if ($result_value[0]['sdiv_value'] >= $result_value[1]['sdiv_value']) $listing .= "<td><img src=\"" . THEME_ADMIN_PATH. "images/ico_asc.gif\" class=\"img_desc\" alt=\"". formatText(_t('dashboard','value_tendance'). ' : '. _t('dashboard','tendance_asc'), '2ATT'). "\" /></td>" . END_LINE;
else $listing .= "<td><img src=\"" . THEME_ADMIN_PATH. "images/ico_desc.gif\" class=\"img_desc\" alt=\"". _t('dashboard','value_tendance'). ' : '. _t('dashboard','tendance_desc'). "\" /></td>" . END_LINE;
} else $listing .= "<td style=\"width:15px\"> </td>" . END_LINE;
//$listing .= "<td><span class=\"value\"> (" . (int)$result_value[0]['sdiv_value'] . ")</span></td>" . END_LINE;
* affichage d'un indicateur et infos résumé
* affichage d'un indicateur et toutes ses infos
* DisplayOneSdievaluation()
* affichage d'un indicateur et toutes ses infos
* DisplayOneSdiprovider()
* affichage d'un indicateur et toutes ses infos
* afficahge de l'ensemble des valeurs publiques d'un IDD
$result_value = $GLOBALS['sql_object'] -> DBSelect(SQL_getAllValue("SCD", $scale_id, $sdi_id));
$content = '<div id="indicator-value" class="internal-content">' . END_LINE;
$content .= '<h2>'. _t('dashboard','historic'). '</h2>' . END_LINE;
$content .= '<div id="indicator-threshold">'. _t('sdi','threshold_value'). ' : <span>'. $result_sdi_value[0]['sdii_threshold_value']. ' '. $result_sdi_value[0]['sdii_unit']. '</span></div>' . END_LINE;
if ($result_value <> false) {
if (count($result_value) > 2) {
$content .= '<h3>'. _t('dashboard','rep_graph'). ' </h3>' . END_LINE;
$content .= "<img src=\"../dashboard/graph.php?id=" . $sdi_id . "&scale_id=" . $scale_id . "\" id=\"imggraph\" class=\"graph\" alt=\"". formatText(_t('dashboard','rep_graph'), '2ATT'). "\"/>" . END_LINE;
$content .= '<h3>'. _t('dashboard','value'). '</h3>' . END_LINE;
$content .= '<table cellspacing="0" cellpadding="5" class="table_dashboard_det" summary="'. _t('dashboard','all_values_summary'). '">' . END_LINE;
$content .= "<td>". _t('dashboard','date'). "</td>" . END_LINE;
$content .= "<td>". _t('dashboard','value'). " (". $result_sdi_value[0]['sdii_unit']. ")</td>" . END_LINE;
$content .= "<td>". _t('dashboard','comment'). "</td>" . END_LINE;
for ($i = 0;$i < count($result_value);$i++ ) {
if(!empty($result_value[$i]['sdiv_comment']) && $result_value[$i]['sdiv_comment_display']== 'Y') {
$comment = '<div class="valuecomment">';
$comment .= '<div class="cont"><strong>'. ucfirst(_t('dashboard', 'comment')). ' :</strong> '. $result_value[$i]['sdiv_comment']. '</div>';
$content .= "<td>" . formatText($result_value[$i]['date_p'], '2HTML') . "</td>" . END_LINE;
$content .= "<td>" . formatText($result_value[$i]['sdiv_value'], '2HTML') . "</td>" . END_LINE;
$content .= "<td>". $comment. "</td>\n";
* affichage nom d'un indicateur
$link_self= array('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id' => $sdi_id, 'parentid' => $_REQUEST['parentid']);
$data_scale = $GLOBALS['sql_object'] -> DBSelect(SQL_getonescale($scale_id));
$sdi_name = formatText($data_sdi[0]['sdii_name'], '2HTML');
$sdi_description = formatText($data_sdi[0]['sdii_description'], '2HTML');
$scale_name = formatText(cutText($data_scale[0]['scale_denomination'], 150), '2HTML');
$content = '<div id="indicator-main">' . END_LINE;
$content .= '<h1>' . $sdi_name . '</h1>' . END_LINE;
$content .= '<p class="permalink">'. END_LINE;
$content .= '<div id="indicator-desc" class="body">' . $sdi_description . '</div>' . END_LINE;
$content .= '<p class="scale"> échelle : <span>' . $scale_name . '</span></p>' . END_LINE;
* récupération des infos générales d'un indicateur
$sdi_name = formatText($data[0]['sdii_name'], '2HTML');
$sdi_description = formatText($data[0]['sdii_description'], '2HTML');
$sdi_comment = formatText($data[0]['sdii_comment'], '2HTML');
$sdi_goal = formatText($data[0]['sdii_goal'], '2HTML');
$sdi_consulting = formatText($data[0]['sdii_consulting'], '2HTML');
$content = '<div id="indicator-info" class="internal-content">' . END_LINE;
$content .= '<h2>'. _t('dashboard','det_sdi2'). '</h2>' . END_LINE;
$content .= '<h3> '. _t('sdi','goal_public'). ' </h3>' . END_LINE;
$content .= '<div id="indicator-goal" class="body">' . $sdi_goal . '</div>' . END_LINE;
$content .= '<h3>'. _t('sdi','consulting_public'). '</h3>' . END_LINE;
$content .= '<div id="indicator-advices" class="body">' . $sdi_consulting . '</div>' . END_LINE;
* récupération des réglementations d'un indicateur
$result_r = $GLOBALS['sql_object'] -> DBSelect(SQL_getRules($sdi_id, $GLOBALS['sql_object'], - 1));
$r_title = formatText($result_r[0]['sdir_title'], '2HTML');
$r_body = formatText($result_r[0]['sdir_body'], '2HTML');
if(!empty($result_r[0]['sdir_referer_uri'])) {
$url = "<a href=\"" . formatText($result_r[0]['sdir_referer_uri'], '2HTML') . "\" title=\"" . formatText($result_r[0]['sdir_mask_uri'], '2ATT') . "\">" . formatText($result_r[0]['sdir_mask_uri'], '2HTML') . "</a>";
$content = '<div id="indicator-rules" class="internal-content">' . END_LINE;
$content .= '<h2>'. _t('sdi','r_body'). '</h2>' . END_LINE;
if ($result_r[0]['sdir_title'] == "") {
$content .= "<p class=\"info\">". _t('divers','nodata'). " </p>" . END_LINE;
$content .= "<h3>" . $r_title . "</h3>" . END_LINE;
$content .= "<div class=\"body\">" . $r_body . "</div>" . END_LINE;
$content .= "<p>" . $url . "</p>" . END_LINE;
* récupération des critères d'évaluation d'un indicateur
$result_e = $GLOBALS['sql_object'] -> DBSelect(SQL_getEvaluation($sdi_id, $GLOBALS['sql_object'], - 1));
$content = '<div id="indicator-evaluation" class="internal-content">' . END_LINE;
$content .= '<h2>'. _t('sdi','e_title'). '</h2>' . END_LINE;
$content .= '<table cellspacing="0" cellpadding="5" class="table_dashboard_det" summary="'. _t('dashboard','evaluation_values_summary'). '">' . END_LINE;
$content .= "<td>". _t('sdi','e_scale_compare'). "</td>" . END_LINE;
$content .= "<td>". _t('sdi','e_fiability'). "</td>" . END_LINE;
$content .= "<td>". _t('sdi','e_accessibility'). "</td>" . END_LINE;
$content .= "<td>". _t('sdi','e_lisibility'). "</td>" . END_LINE;
$content .= "<td>". _t('sdi','e_relevance'). "</td>" . END_LINE;
$content .= "<td>". _t('sdi','e_global_performance'). "</td>" . END_LINE;
$content .= "<td>" . $result_e[0]['sdie_scale_compare'] . "</td>" . END_LINE;
$content .= "<td>" . $result_e[0]['sdie_fiability'] . "</td>" . END_LINE;
$content .= "<td>" . $result_e[0]['sdie_accessibility'] . "</td>" . END_LINE;
$content .= "<td>" . $result_e[0]['sdie_lisibility'] . "</td>" . END_LINE;
$content .= "<td>" . $result_e[0]['sdie_relevance'] . "</td>" . END_LINE;
$content .= "<td>" . $result_e[0]['sdie_global_performance'] . "</td>" . END_LINE;
* récupération des infos du fournisseurs d'un indicateur
$result_p = $GLOBALS['sql_object'] -> DBSelect(SQL_getProvider($sdi_id, $GLOBALS['sql_object'], - 1));
$p_name = formatText($result_p[0]['sdip_name'], '2HTML');
$p_description = formatText($result_p[0]['sdip_description'], '2HTML');
$content = '<div id="indicator-provider" class="internal-content">' . END_LINE;
$content .= '<h2>'. _t('sdi','p_title'). '</h2>' . END_LINE;
if ($result_p[0]['sdip_name'] == "") {
$content .= "<p class=\"info\">". _t('divers','nodata'). " </p>" . END_LINE;
$content .= '<p>' . $p_name . '</p>' . END_LINE;
$content .= '<div class="body">' . $p_description . '</div>' . END_LINE;
* return a link to switch display mode
* @todo remove or use to display tabular data
$link_aff_classic = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard']['linkvalue'], 'id' => $scale_id));
$link_aff_young = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-anim']['linkvalue'], 'id' => $scale_id));
$content = '<div id="indicator-mode" class="switcher">' . END_LINE;
$content .= '<span>'. _t('dashboard','mode_aff'). ' : </span>';
$content .= '<span>'. _t('dashboard','mode_aff_class'). '</span> ' . END_LINE;
else $content .= '<a href="' . $link_aff_classic . '" title="'. formatText(_t('dashboard','mode_aff_class'), '2ATT'). '" >'. _t('dashboard','mode_aff_class'). '</a> ' . END_LINE;
$content .= '<span>'. _t('dashboard','mode_aff_young'). '</span> ' . END_LINE;
else $content .= '<a href="' . $link_aff_young . '" title="'. formatText(_t('dashboard','mode_aff_young'), '2ATT'). '" >'. _t('dashboard','mode_aff_young'). '</a> ' . END_LINE;
* getDashboardNavigation()
* Return a string with the internal navigation
$link_aff_info = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id' => $sdi_id, 'parentid' => $scale_id, 'name' => $data[0]['sdii_name']));
$link_aff_rules = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-rules']['linkvalue'], 'id' => $sdi_id, 'parentid' => $scale_id, 'name' => $data[0]['sdii_name']));
$link_aff_provider = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-provider']['linkvalue'],'id' => $sdi_id, 'parentid' => $scale_id, 'name' => $data[0]['sdii_name']));
$link_aff_evaluation = HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-assessment']['linkvalue'], 'id' => $sdi_id, 'parentid' => $scale_id, 'name' => $data[0]['sdii_name']));
$content = "<div class=\"internal-nav\" id=\"indicator-nav\">". END_LINE;
$content .= '<a href="' . $link_aff_info . '" title="'. formatText(_t('dashboard','mode_aff_info'), '2ATT'). '" >'. _t('dashboard','mode_aff_info'). '</a> ' . END_LINE;
$content .= '<a href="' . $link_aff_rules . '" title="'. formatText(_t('dashboard','mode_aff_rules'), '2ATT'). '">'. _t('dashboard','mode_aff_rules'). '</a> ' . END_LINE;
$content .= '<a href="' . $link_aff_provider . '" title="'. _t('dashboard','mode_aff_provider'). '">'. _t('dashboard','mode_aff_provider'). '</a> ' . END_LINE;
$content .= '<a href="' . $link_aff_evaluation . '" title="'. formatText(_t('dashboard','mode_aff_evaluation'), '2ATT'). '">'. _t('dashboard','mode_aff_evaluation'). '</a> ' . END_LINE;
|