linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file display.php

Documentation is available at display.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage dashboard
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. include_once(override('../dashboard/' SQL '.inc.php'));
  12. include_once('../dashboard/common.php');
  13. /**
  14.  * DisplayListValuesByThemes()
  15.  * affichage du tableau de bord
  16.  * @param integer $id_filter 
  17.  * @param integer $filter 
  18.  * @return 
  19.  ***/
  20.  
  21. if(!function_exists('DisplayListValuesByThemes')) {
  22.  
  23.     function DisplayListValuesByThemes($id_filter = -1$filter = -1)
  24.     {
  25.         $result $GLOBALS['sql_object'-> DBSelect(SQL_getListtheme());
  26.         $result_sdi $GLOBALS['sql_object'-> DBSelect(SQL_getListSdi("P"$valueparam 0));
  27.         $listing "";
  28.         
  29.         $a array()// to not display twice an indicator
  30.  
  31.         $current_sdtheme '';
  32.  
  33.         for ($i 0;$i count($result);$i++{
  34.             if ($result[$i]['sdtheme_id'!= $current_sdtheme && $current_sdtheme <> ''{
  35.                 $listing .= "</tbody>" END_LINE;
  36.                 $listing .= "</table>" END_LINE;
  37.             }
  38.             if ($result[$i]['sdtheme_id'!= $current_sdtheme{
  39.  
  40.                 $current_sdtheme $result[$i]['sdtheme_id'];
  41.                 $listing .= "<h2 class=\"dashboard theme-".$current_sdtheme."\">" formatText($result[$i]['sdtheme_name']'2HTML'"</h2>".END_LINE;
  42.                 $listing .= '<table cellspacing="0" cellpadding="5" class="table_dashboard" summary="'.sprintf(_t('dashboard','list_public_summary')formatText($result[$i]['sdtheme_name']'2HTML')).'">' END_LINE;
  43.                 $listing .= '<thead>' END_LINE;
  44.                 $listing .= '<tr>' END_LINE;
  45.                 $listing .= '<td style="width:250px">'.mb_ucfirst(_t('dashboard','graphic_value')).'</td>' END_LINE;
  46.                 $listing .= '<td>'.mb_ucfirst(_t('dashboard','label_value')).'</td>' END_LINE;
  47.                 $listing .= '</tr>' END_LINE;
  48.                 $listing .= '</thead>' END_LINE;
  49.                 $listing .= '<tbody>' END_LINE;
  50.                  
  51.             }
  52.             for ($j 0;$j count($result_sdi);$j++{
  53.                 if ($result[$i]['theme_id'== $result_sdi[$j]['sdii_theme']{
  54.                     
  55.                     // we display the value only if attached to dashboard
  56.                     // and if not yet displayed
  57.                     if ($result_sdi[$j]['sdii_to_dashboard']=='Y' && !in_array($result_sdi[$j]['sdii_id']$a)) {
  58.                         // setting $threshold_value
  59.                         // By default initial value
  60.                         $threshold_value $result_sdi[$j]['sdii_threshold_value'];
  61.                         // if set, we get the latest for the given scale
  62.                         $r $GLOBALS['sql_object'-> DBSelect(SQL_getlastInsertByPublicationDate($result_sdi[$j]['sdii_id']$id_filter));
  63.                         if(isset($r[0]['sdiv_value']&& !is_null($r[0]['sdiv_threshold'])) {
  64.                             $threshold_value $r[0]['sdiv_threshold'];
  65.                         }
  66.                          
  67.                         $link_det_sdiarray('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id'=>$result_sdi[$j]['sdii_id']'parentid'=> $id_filter'name' => $result_sdi[$j]['sdii_name']);
  68.                         $listing .= "<tr>" END_LINE;
  69.                         $listing .= "<td>";
  70.                         $listing .= getViz($GLOBALS['sql_object']$id_filter$result_sdi[$j]$threshold_value);
  71.                         $listing .= "</td>";
  72.                         $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;
  73.                         $listing .= "</tr>" END_LINE;
  74.                         
  75.                         array_push($a$result_sdi[$j]['sdii_id'])// we add the id into array for not displaying it twice
  76.                     }
  77.                 }
  78.             }
  79.         }
  80.         $listing .= "</tbody>" END_LINE;
  81.         $listing .= "</table>" END_LINE;
  82.         
  83.         hoverJsBox();
  84.  
  85.         echo $listing;
  86.     }
  87. }
  88.  
  89. /**
  90.  * DisplayListValuesByProjects()
  91.  * affichage du tableau de bord
  92.  * @param integer $id_filter 
  93.  * @param integer $filter 
  94.  * @return 
  95.  ***/
  96.  
  97. if(!function_exists('DisplayListValuesByProjects')) {
  98.  
  99.     function DisplayListValuesByProjects($id_filter = -1$filter = -1)
  100.     {
  101.         $result $GLOBALS['sql_object'-> DBSelect(SQL_getListProjects());
  102.         $result_sdi $GLOBALS['sql_object'-> DBSelect(SQL_getListSdi("P"$valueparam 0));
  103.         $listing "";
  104.  
  105.         $current_project '';
  106.  
  107.         for ($i 0;$i count($result);$i++{
  108.             if ($result[$i]['project_id'!= $current_project && $current_project <> ''{
  109.                 $listing .= "</tbody>" END_LINE;
  110.                 $listing .= "</table>" END_LINE;
  111.             }
  112.             if ($result[$i]['project_id'!= $current_project{
  113.  
  114.                 $current_project $result[$i]['project_id'];
  115.                 $listing .= "<h2 class=\"dashboard project-".$current_project."\">" formatText($result[$i]['project_name']'2HTML'"</h2>".END_LINE;
  116.                 $listing .= '<table cellspacing="0" cellpadding="5" class="table_dashboard" summary="'.sprintf(_t('dashboard','list_public_summary')formatText($result[$i]['project_name']'2HTML')).'">' END_LINE;
  117.                 $listing .= '<thead>' END_LINE;
  118.                 $listing .= '<tr>' END_LINE;
  119.                 $listing .= '<td style="width:250px">'.mb_ucfirst(_t('dashboard','graphic_value')).'</td>' END_LINE;
  120.                 $listing .= '<td>'.mb_ucfirst(_t('dashboard','label_value')).'</td>' END_LINE;
  121.                 $listing .= '</tr>' END_LINE;
  122.                 $listing .= '</thead>' END_LINE;
  123.                 $listing .= '<tbody>' END_LINE;
  124.                     
  125.             }
  126.             for ($j 0;$j count($result_sdi);$j++{
  127.                 if ($result[$i]['project_id'== $result_sdi[$j]['jps_project_id']{
  128.                         
  129.                     // we display the value only if attached to dashboard
  130.                     if ($result_sdi[$j]['sdii_to_dashboard']=='Y'{
  131.                         // setting $threshold_value
  132.                         // By default initial value
  133.                         $threshold_value $result_sdi[$j]['sdii_threshold_value'];
  134.                         // if set, we get the latest for the given scale
  135.                         $r $GLOBALS['sql_object'-> DBSelect(SQL_getlastInsertByPublicationDate($result_sdi[$j]['sdii_id']$id_filter));
  136.                         if(isset($r[0]['sdiv_value']&& !is_null($r[0]['sdiv_threshold'])) {
  137.                             $threshold_value $r[0]['sdiv_threshold'];
  138.                         }
  139.                             
  140.                         $link_det_sdiarray('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id'=>$result_sdi[$j]['sdii_id']'parentid'=> $id_filter'name' => $result_sdi[$j]['sdii_name']);
  141.                         $listing .= "<tr>" END_LINE;
  142.                         $listing .= "<td>";
  143.                         $listing .= getViz($GLOBALS['sql_object']$id_filter$result_sdi[$j]$threshold_value);
  144.                         $listing .= "</td>";
  145.                         $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;
  146.                         $listing .= "</tr>" END_LINE;
  147.                     }
  148.                 }
  149.             }
  150.         }
  151.         $listing .= "</tbody>" END_LINE;
  152.         $listing .= "</table>" END_LINE;
  153.  
  154.         hoverJsBox();
  155.         
  156.         echo $listing;
  157.     }
  158. }
  159.  
  160. function hoverJsBox({
  161.     
  162.     $js '<script type="text/javascript">
  163.     $(document).ready(function() {
  164.     $(".dashboard-indicator-gauge .cursor").removeAttr("title");
  165.     $(".infobox").hover(
  166.         function() {
  167.             $(this).next().fadeIn("fast");
  168.         },
  169.         function() {
  170.             $(this).next().hide();
  171.         }
  172.     );
  173.     });
  174.     </script>';
  175.     footerAddInlineJS($js'default'false);
  176. }
  177.  
  178.  
  179. /**
  180.  * DisplayOneSdi()
  181.  * affichage d'un indicateur et infos résumé
  182.  * @param $sdi_id 
  183.  * @param $scale_id 
  184.  * @return 
  185.  ***/
  186. if(!function_exists('DisplayOneSdi')) {
  187.  
  188.     function DisplayOneSdi($sdi_id$scale_id)
  189.     {
  190.         echo GetSdiTitle($sdi_id$scale_id);
  191.         echo getDashboardNavigation($sdi_id,$scale_id);
  192.         echo GetAllValue($sdi_id$scale_id);
  193.         echo GetOneSdiInfo($sdi_id);
  194.     }
  195. }
  196.  
  197. /**
  198.  * DisplayOneSdirules()
  199.  * affichage d'un indicateur et toutes ses infos
  200.  * @param $sdi_id 
  201.  * @param $scale_id 
  202.  * @return 
  203.  ***/
  204. if(!function_exists('DisplayOneSdirules')) {
  205.  
  206.     function DisplayOneSdirules($sdi_id$scale_id)
  207.     {
  208.         echo GetSdiTitle($sdi_id$scale_id);
  209.         echo getDashboardNavigation($sdi_id,$scale_id);
  210.         echo GetOneSdiRules($sdi_id);
  211.     }
  212. }
  213. /**
  214.  * DisplayOneSdievaluation()
  215.  * affichage d'un indicateur et toutes ses infos
  216.  * @param $sdi_id 
  217.  * @param $scale_id 
  218.  * @return 
  219.  ***/
  220. if(!function_exists('DisplayOneSdievaluation')) {
  221.  
  222.     function DisplayOneSdievaluation($sdi_id$scale_id)
  223.     {
  224.         echo GetSdiTitle($sdi_id$scale_id);
  225.         echo getDashboardNavigation($sdi_id,$scale_id);
  226.         echo GetOneSdiEvaluation($sdi_id);
  227.     }
  228. }
  229. /**
  230.  * DisplayOneSdiprovider()
  231.  * affichage d'un indicateur et toutes ses infos
  232.  * @param $sdi_id 
  233.  * @param $scale_id 
  234.  * @return 
  235.  ***/
  236. if(!function_exists('DisplayOneSdiprovider')) {
  237.  
  238.     function DisplayOneSdiprovider($sdi_id$scale_id)
  239.     {
  240.         echo GetSdiTitle($sdi_id$scale_id);
  241.         echo getDashboardNavigation($sdi_id,$scale_id);
  242.         echo GetOneSdiProvider($sdi_id);
  243.     }
  244. }
  245. /**
  246.  * GetAllValue()
  247.  * afficahge de l'ensemble des valeurs publiques d'un IDD
  248.  * @param $sdi_id 
  249.  * @param $scale_id 
  250.  * @return 
  251.  ***/
  252. if(!function_exists('GetAllValue')) {
  253.  
  254.     function GetAllValue($sdi_id$scale_id)
  255.     {
  256.         $result_value $GLOBALS['sql_object'-> DBSelect(SQL_getAllValue("SCD"$scale_id$sdi_id));
  257.         $result_sdi_value $GLOBALS['sql_object'-> DBSelect(SQL_getInfoSdiforvalue($sdi_id));
  258.  
  259.         // setting $default_threshold value
  260.         // By default initial value
  261.         $default_threshold $result_sdi_value[0]['sdii_threshold_value'];
  262.  
  263.         $content '<div id="indicator-value" class="internal-content">' END_LINE;
  264.         $content .= '<h2>'._t('dashboard','historic').'</h2>' END_LINE;
  265.         $content .= '<div id="indicator-threshold">'._t('sdi','initial_threshold_value').' : <span>'.$result_sdi_value[0]['sdii_threshold_value'].' '.$result_sdi_value[0]['sdii_unit'].'</span></div>' END_LINE;
  266.  
  267.         if ($result_value <> false{
  268.             if (count($result_value2{
  269.                 $content .= '<h3>'._t('dashboard','rep_graph').' </h3>' END_LINE;
  270.  
  271.                 $content .= "<img src=\"../dashboard/graph.php?id=" $sdi_id "&amp;scale_id=" $scale_id "\"  id=\"imggraph\" class=\"graph\" alt=\"".formatText(_t('dashboard','rep_graph')'2ATT')."\"/>" END_LINE;
  272.             }
  273.             $content .= '<h3>'._t('dashboard','value').'</h3>' END_LINE;
  274.  
  275.             $content .= '<table cellspacing="0" cellpadding="5" class="table_dashboard_det"  summary="'._t('dashboard','all_values_summary').'">' END_LINE;
  276.             $content .= '<thead>' END_LINE;
  277.             $content .= '<tr>' END_LINE;
  278.             $content .= "<td>".mb_ucfirst(_t('dashboard','date'))."</td>" END_LINE;
  279.             $content .= "<td>".mb_ucfirst(_t('dashboard','value'))." (".$result_sdi_value[0]['sdii_unit'].")</td>" END_LINE;
  280.             $content .= "<td>".mb_ucfirst(_t('dashboard','threshold_value'))."</td>" END_LINE;
  281.             $content .= "<td>".mb_ucfirst(_t('dashboard','comment'))."</td>" END_LINE;
  282.             $content .= "</tr>" END_LINE;
  283.             $content .= "</thead>" END_LINE;
  284.             $content .= "<tbody>" END_LINE;
  285.  
  286.             for ($i 0;$i count($result_value);$i++{
  287.                 $comment '';
  288.                  
  289.                 // if set, we get it from the table
  290.                 if(!is_null($result_value[$i]['sdiv_threshold'])) {
  291.                     $threshold $result_value[$i]['sdiv_threshold'];
  292.                 else {
  293.                     $threshold $default_threshold;
  294.                 }
  295.                  
  296.           if(!empty($result_value[$i]['sdiv_comment']&& $result_value[$i]['sdiv_comment_display']=='Y'{
  297.               $comment  '<div class="valuecomment">';
  298.               $comment .= '<img src="'.THEME_PUBLIC_PATH.'images/infobull.gif" />';
  299.               $comment .= '<div class="cont"><strong>'.ucfirst(_t('dashboard''comment')).' :</strong> '.$result_value[$i]['sdiv_comment'].'</div>';
  300.               $comment .= '</div>';
  301.           }
  302.           $content .= "<tr>" END_LINE;
  303.           $content .= "<td>" formatText($result_value[$i]['date_p']'2HTML'"</td>" END_LINE;
  304.           $content .= "<td>" formatText($result_value[$i]['sdiv_value']'2HTML'"</td>" END_LINE;
  305.           $content .= "<td class=\"threshold\">" formatText($threshold'2HTML'"</td>" END_LINE;
  306.           $content .= "<td>"$comment"</td>\n";
  307.           $content .= "</tr>" END_LINE;
  308.             }
  309.  
  310.             $content .= "</tbody>" END_LINE;
  311.             $content .= "</table>" END_LINE;
  312.             $content .= '</div>' END_LINE;
  313.             return $content;
  314.         }
  315.     }
  316. }
  317.  
  318. /**
  319.  * GetSdiTitle()
  320.  * affichage nom d'un indicateur
  321.  * @param $sdi_id 
  322.  * @param $scale_id 
  323.  * @return 
  324.  ***/
  325. if(!function_exists('GetSdiTitle')) {
  326.  
  327.     function GetSdiTitle($sdi_id$scale_id)
  328.     {
  329.         $link_selfarray('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id' => $sdi_id'parentid' => $_REQUEST['parentid']);
  330.         $data_sdi $GLOBALS['sql_object'-> DBSelect(SQL_getOnesdiname($sdi_idarray('P')));
  331.         
  332.         if($data_sdi == 0error_redirect();
  333.         
  334.         $data_scale $GLOBALS['sql_object'-> DBSelect(SQL_getonescale($scale_id));
  335.         $sdi_name formatText($data_sdi[0]['sdii_name']'2HTML');
  336.         $sdi_description formatText($data_sdi[0]['sdii_description']'2HTML');
  337.         $scale_name formatText(cutText($data_scale[0]['scale_denomination']150)'2HTML');
  338.         $content  '<div id="indicator-main">' END_LINE;
  339.         $content .= '<h1>' mb_ucfirst($sdi_name'</h1>' END_LINE;
  340.         $content .='<p class="permalink">'.END_LINE;
  341.         $content .= formatted_permalink($link_self);
  342.         $content .='</p>'.END_LINE;
  343.         $content .= '<div id="indicator-desc" class="body">' $sdi_description '</div>' END_LINE;
  344.         $content .= '<p class="scale"> échelle : <span>' $scale_name '</span></p>' END_LINE;
  345.         $content .= '</div>' END_LINE;
  346.  
  347.         return $content;
  348.     }
  349. }
  350.  
  351. /**
  352.  * GetOneSdiInfo()
  353.  * récupération des infos générales d'un indicateur
  354.  * @param $sdi_id 
  355.  * @return 
  356.  ***/
  357. if(!function_exists('GetOneSdiInfo')) {
  358.  
  359.     function GetOneSdiInfo($sdi_id)
  360.     {
  361.         $data $GLOBALS['sql_object'-> DBSelect(SQL_getInfoSdi($sdi_id));
  362.  
  363.         $sdi_name formatText($data[0]['sdii_name']'2HTML');
  364.         $sdi_theme formatText(cutText($data[0]['theme_name']150)'2HTML');
  365.         $sdi_description formatText($data[0]['sdii_description']'2HTML');
  366.         $sdi_comment formatText($data[0]['sdii_comment']'2HTML');
  367.         $sdi_goal formatText($data[0]['sdii_goal']'2HTML');
  368.         $sdi_consulting formatText($data[0]['sdii_consulting']'2HTML');
  369.  
  370.         $content '<div id="indicator-info" class="internal-content">' END_LINE;
  371.         $content .= '<h2>'.mb_ucfirst(_t('dashboard','det_sdi2')).'</h2>' END_LINE;
  372.         $content .= '<h3> '.mb_ucfirst(_t('sdi','goal_public')).' </h3>' END_LINE;
  373.         $content .= '<div id="indicator-goal" class="body">' $sdi_goal '</div>' END_LINE;
  374.         $content .= '<h3>'.mb_ucfirst(_t('sdi','consulting_public')).'</h3>' END_LINE;
  375.         $content .= '<div id="indicator-advices" class="body">' $sdi_consulting '</div>' END_LINE;
  376.         $content .= '</div><br />' END_LINE;
  377.         return $content;
  378.     }
  379. }
  380.  
  381. /**
  382.  * GetOneSdiRules()
  383.  * récupération des réglementations d'un indicateur
  384.  * @param $sdi_id 
  385.  * @return 
  386.  ***/
  387. if(!function_exists('GetOneSdiRules')) {
  388.  
  389.     function GetOneSdiRules($sdi_id)
  390.     {
  391.         $result_r $GLOBALS['sql_object'-> DBSelect(SQL_getRules($sdi_id$GLOBALS['sql_object']-1));
  392.         $r_title formatText($result_r[0]['sdir_title']'2HTML');
  393.         $r_body formatText($result_r[0]['sdir_body']'2HTML');
  394.         if(!empty($result_r[0]['sdir_referer_uri'])) {
  395.             $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>";
  396.         }
  397.  
  398.         $content '<div id="indicator-rules" class="internal-content">' END_LINE;
  399.         $content .= '<h2>'.mb_ucfirst(_t('sdi','r_body')).'</h2>' END_LINE;
  400.         if ($result_r[0]['sdir_title'== ""{
  401.             $content .= "<p class=\"info\">"._t('divers','nodata')." </p>" END_LINE;
  402.         else {
  403.             $content .= "<h3>" $r_title "</h3>" END_LINE;
  404.             $content .= "<div class=\"body\">" $r_body "</div>" END_LINE;
  405.             if(isset($url)) {
  406.                 $content .= "<p>" $url "</p>" END_LINE;
  407.             }
  408.         }
  409.         $content .= '</div>' END_LINE;
  410.  
  411.         return $content;
  412.     }
  413. }
  414.  
  415. /**
  416.  * GetOneSdiEvaluation()
  417.  * récupération des critères d'évaluation d'un indicateur
  418.  * @param $sdi_id 
  419.  * @return 
  420.  ***/
  421. if(!function_exists('GetOneSdiEvaluation')) {
  422.  
  423.     function GetOneSdiEvaluation($sdi_id)
  424.     {
  425.         $result_e $GLOBALS['sql_object'-> DBSelect(SQL_getEvaluation($sdi_id$GLOBALS['sql_object']-1));
  426.  
  427.         $content '<div id="indicator-evaluation" class="internal-content">' END_LINE;
  428.         $content .= '<h2>'.mb_ucfirst(_t('sdi','e_title')).'</h2>' END_LINE;
  429.         $content .= '<table cellspacing="0" cellpadding="5" class="table_dashboard_det" summary="'._t('dashboard','evaluation_values_summary').'">' END_LINE;
  430.         $content .= '<thead>' END_LINE;
  431.         $content .= '<tr>' END_LINE;
  432.         $content .= "<td>"._t('sdi','e_scale_compare')."</td>" END_LINE;
  433.         $content .= "<td>"._t('sdi','e_fiability')."</td>" END_LINE;
  434.         $content .= "<td>"._t('sdi','e_accessibility')."</td>" END_LINE;
  435.         $content .= "<td>"._t('sdi','e_lisibility')."</td>" END_LINE;
  436.         $content .= "<td>"._t('sdi','e_relevance')."</td>" END_LINE;
  437.         $content .= "<td>"._t('sdi','e_global_performance')."</td>" END_LINE;
  438.         $content .= "</tr>" END_LINE;
  439.         $content .= "</thead>" END_LINE;
  440.         $content .= "<tbody>" END_LINE;
  441.         $content .= "<tr>" END_LINE;
  442.         $content .= "<td>" $result_e[0]['sdie_scale_compare'"</td>" END_LINE;
  443.         $content .= "<td>" $result_e[0]['sdie_fiability'"</td>" END_LINE;
  444.         $content .= "<td>" $result_e[0]['sdie_accessibility'"</td>" END_LINE;
  445.         $content .= "<td>" $result_e[0]['sdie_lisibility'"</td>" END_LINE;
  446.         $content .= "<td>" $result_e[0]['sdie_relevance'"</td>" END_LINE;
  447.         $content .= "<td>" $result_e[0]['sdie_global_performance'"</td>" END_LINE;
  448.         $content .= "</tr>" END_LINE;
  449.         $content .= "</tbody>" END_LINE;
  450.         $content .= "</table>" END_LINE;
  451.         $content .= '</div>' END_LINE;
  452.  
  453.         return $content;
  454.     }
  455. }
  456.  
  457. /**
  458.  * GetOneSdiProvider()
  459.  * récupération des infos du fournisseurs d'un indicateur
  460.  * @param $sdi_id 
  461.  * @return 
  462.  ***/
  463. if(!function_exists('GetOneSdiProvider')) {
  464.  
  465.     function GetOneSdiProvider($sdi_id)
  466.     {
  467.         $result_p $GLOBALS['sql_object'-> DBSelect(SQL_getProvider($sdi_id$GLOBALS['sql_object']-1));
  468.  
  469.         $p_name formatText($result_p[0]['sdip_name']'2HTML');
  470.         $p_description formatText($result_p[0]['sdip_description']'2HTML');
  471.  
  472.         $content '<div id="indicator-provider" class="internal-content">' END_LINE;
  473.         $content .= '<h2>'.mb_ucfirst(_t('sdi','p_title')).'</h2>' END_LINE;
  474.         if ($result_p[0]['sdip_name'== ""{
  475.             $content .= "<p class=\"info\">"._t('divers','nodata')." </p>" END_LINE;
  476.         else {
  477.             $content .= '<p>' $p_name '</p>' END_LINE;
  478.             $content .= '<div class="body">' $p_description '</div>' END_LINE;
  479.         }
  480.         $content .= '</div>' END_LINE;
  481.         return $content;
  482.     }
  483. }
  484.  
  485. /**
  486.  * getDataVizMode()
  487.  * return a link to switch display mode
  488.  * @param $scale_id 
  489.  * @return string 
  490.  * @todo remove or use to display tabular data
  491.  ***/
  492. if(!function_exists('getDataVizSwitcher')) {
  493.  
  494.     function getDataVizSwitcher($altmode$scale_id)
  495.     {
  496.         if$altmode )  {
  497.             $link array('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue']'id' => $scale_id);
  498.             $msg _t('dashboard''mode_by_finality');
  499.         else {
  500.             $link array('rub'=> $GLOBALS['links'][U_L]['dashboard']['linkvalue']'id' => $scale_id'altmode' => true);
  501.             $msg _t('dashboard''mode_by_project');
  502.         }
  503.         // adding these vars to url allow to display the right scale into filter box
  504.         // @todo filters should be enhanced
  505.         if(array_key_exists('filter'$_REQUEST&& $_REQUEST['filter'== $GLOBALS['filters'][U_L]['scale']['linkvalue']{
  506.             $link array_merge($linkarray('filter' => $GLOBALS['filters'][U_L]['scale']['linkvalue']));
  507.         }
  508.         
  509.         
  510.         $str   '<div class="switchnav">';
  511.         $str  .= '<a class="button" href="'.HrefMaker($link).'" title="'.$msg.'">'.$msg.'</a>'.END_LINE;
  512.         $str  .= '</div>';
  513.         
  514.         return $str;
  515.     }
  516. }
  517.  
  518. /**
  519.  * getDashboardNavigation()
  520.  * Return a string with the internal navigation
  521.  * @param int 
  522.  * @param int 
  523.  * @return string 
  524.  ***/
  525. if(!function_exists('getDashboardNavigation')) {
  526.  
  527.     function getDashboardNavigation($sdi_id,$scale_id)
  528.     {
  529.         $data $GLOBALS['sql_object'-> DBSelect(SQL_getOnesdiname($sdi_id));
  530.         $link_aff_info HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard']['linkvalue'],'id' => $sdi_id'parentid' => $scale_id'name' => $data[0]['sdii_name']));
  531.         $link_aff_rules HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-rules']['linkvalue']'id' => $sdi_id'parentid' => $scale_id'name' => $data[0]['sdii_name']));
  532.          
  533.         $link_aff_provider HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-provider']['linkvalue'],'id' => $sdi_id'parentid' => $scale_id'name' => $data[0]['sdii_name']));
  534.         $link_aff_evaluation HrefMaker(array('rub' => $GLOBALS['links'][U_L]['dashboard-assessment']['linkvalue']'id' => $sdi_id'parentid' => $scale_id'name' => $data[0]['sdii_name']));
  535.          
  536.         ActiveItemKey($GLOBALS['activeitem'])=='dashboard' $info_class='active' $info_class='';
  537.         ActiveItemKey($GLOBALS['activeitem'])=='dashboard-rules' $rules_class='active' $rules_class='';
  538.         ActiveItemKey($GLOBALS['activeitem'])=='dashboard-assessment' $assessment_class='active' $assessment_class='';
  539.         ActiveItemKey($GLOBALS['activeitem'])=='dashboard-provider' $provider_class='active' $provider_class='';
  540.  
  541.         $content ="<div class=\"internal-nav\" id=\"indicator-nav\">"END_LINE;
  542.         $content .="<ul>"END_LINE;
  543.         $content .="<li>"END_LINE;
  544.         $content .= '<a href="' $link_aff_info '" title="'.formatText(_t('dashboard','mode_aff_info')'2ATT').'" class="'.$info_class.'">'._t('dashboard','mode_aff_info').'</a> ' END_LINE;
  545.         $content .="</li>"END_LINE;
  546.         $content .="<li>"END_LINE;
  547.         $content .= '<a href="' $link_aff_rules '" title="'.formatText(_t('dashboard','mode_aff_rules')'2ATT').'" class="'.$rules_class.'">'._t('dashboard','mode_aff_rules').'</a> ' END_LINE;
  548.         $content .="</li>"END_LINE;
  549.         $content .="<li>"END_LINE;
  550.         $content .= '<a href="' $link_aff_provider '" title="'._t('dashboard','mode_aff_provider').'" class="'.$provider_class.'">'._t('dashboard','mode_aff_provider').'</a> ' END_LINE;
  551.         $content .="</li>"END_LINE;
  552.         $content .="<li>"END_LINE;
  553.         $content .= '<a href="' $link_aff_evaluation '" title="'.formatText(_t('dashboard','mode_aff_evaluation')'2ATT').'" class="'.$assessment_class.'">'._t('dashboard','mode_aff_evaluation').'</a> ' END_LINE;
  554.         $content .="</li>"END_LINE;
  555.         $content .="</ul>"END_LINE;
  556.         $content .="</div>"END_LINE;
  557.  
  558.         return $content;
  559.     }
  560. }
  561.  
  562.  
  563. ?>

Documentation generated on Mon, 08 Apr 2013 18:14:14 +0200 by phpDocumentor 1.4.1