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

Source for file list.php

Documentation is available at list.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. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')){
  13.     include_once("../lib/lib_common.php");
  14.     ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->hasRight('dashboard')) ReloadIndex('admin');
  20. ////////////
  21.  
  22. include_once("../lib/input_helpers.php");
  23. include_once("../dashboard/common.php");
  24. $result=$sql_object->DBSelect($req_list_theme);
  25.  
  26. //$result_sdi=$sdi_object->GetListSdi($filter="R", $valueparam=0, $sql_object);
  27. $req_sdi=SQL_getListSdi($filter="R"$valueparam=0);
  28. $result_sdi $sql_object -> DBSelect($req_sdi);
  29.  
  30. //$link_sup=$rub_link."&amp;todo=sup&amp;id=";
  31.  
  32. $link_list_scale=$rub_link."&amp;todo=list&amp;scale_id=";
  33.  
  34. if (!isset($_GET['scale_id']&& !isset($_POST['scale_id'])) {
  35.     $scale_id 1;
  36. else {
  37.     if (isset($_POST['scale_id'])) $scale_id $_POST['scale_id'];
  38.     if (isset($_GET['scale_id'])) $scale_id $_GET['scale_id'];
  39. }
  40.  
  41. $resultscale2 $sql_object -> DBSelect(SQL_getonescale($scale_id));
  42.  
  43.  
  44. function getIndicators($themes$indicators$scale_id$status$sql_object{
  45.  
  46.     global $rub_link;
  47.     
  48.     $sdi_objectnew sdi;
  49.     
  50.     if($status=='all'$test true;
  51.     if($status=='attached'$test='Y';
  52.     if($status=='not-attached'$test='N';
  53.     $listing="";
  54.  
  55.     $link_add=$rub_link."&amp;todo=add&amp;id=";
  56.     $link_det=$rub_link."&amp;todo=det&amp;id=";
  57.  
  58.     $current_sdtheme='';
  59.     
  60.     $a array()// to not display twice an indicator
  61.  
  62.     // themes loop
  63.     for ($i=0;$i<count($themes);$i++){
  64.         
  65.         
  66.         if ($themes[$i]['sdtheme_id'!= $current_sdtheme && $current_sdtheme <> ''{
  67.             $listing.="</ul>\n</div>\n";
  68.         }
  69.         if ($themes[$i]['sdtheme_id'!= $current_sdtheme{
  70.             $current_sdtheme $themes[$i]['sdtheme_id'];
  71.             $listing.="<h3><a href=\"\">".formatText($themes[$i]['sdtheme_name']'2HTML')."</a></h3>";
  72.             $listing.="<div class=\"contboxgray\">\n";
  73.             $listing.="<ul>\n";
  74.         }
  75.  
  76.         // indicators loop
  77.         for ($j=0;$j<count($indicators);$j++{
  78.             
  79.             if ($themes[$i]['theme_id'== $indicators[$j]['sdii_theme']{
  80.                 // setting $threshold_value
  81.                 // By default initial value
  82.                 $threshold_value $indicators[$j]['sdii_threshold_value'];
  83.                 // if set, we get the latest for the given scale
  84.                 $r $sql_object -> DBSelect(SQL_getlastInsertByPublicationDate($indicators[$j]['sdii_id']$scale_id));
  85.                 if(isset($r[0]['sdiv_value']&& !is_null($r[0]['sdiv_threshold'])) {
  86.                     $threshold_value $r[0]['sdiv_threshold'];
  87.                 }
  88.  
  89.                 if ($status == 'all' && $indicators[$j]['sdii_to_dashboard']=='N'{
  90.                     $cssclass=' not-attached';
  91.                 else {
  92.                     $cssclass='';
  93.                 }
  94.                  if ($indicators[$j]['sdii_to_dashboard'== $test  && !in_array($indicators[$j]['sdii_id']$a)) {
  95.                     $listing.="\t<li class=\"li2".$cssclass."\">\n";
  96.                     
  97.                     $listing.= getViz($sql_object$scale_id$indicators[$j]$threshold_value);
  98.                     
  99.                      $listing.="\t<div class=\"dashboard-indicator-label\">\n";
  100.                     $listing.="\t\t<a href=\"".$link_det.$indicators[$j]['sdii_id']."&amp;scale_id=".$scale_id."\" title=\"".formatText($indicators[$j]['sdii_name']'2HTML')."\" class=\"indic-name\">".formatTextli($indicators[$j]['sdii_name'])."</a>\n";
  101.                     if ($indicators[$j]['sdii_statut']=='D'$listing.="<span class=\"state\">"._t('statut','draft')."</span>\n";
  102.                     $listing.="\t</div>\n";
  103.                     $listing.="\t\t<a href=\"".$link_add.$indicators[$j]['sdii_id']."&amp;scale_id=".$scale_id."\" class=\"ico_add\" title=\""._t('dashboard','add')."\"><i class=\"icon-plus-circled\"></i><span>".  _t('dashboard','add')."</span></a>\n";
  104.                     
  105.                     $listing.="\t</li>\n";
  106.                     
  107.                     array_push($a$indicators[$j]['sdii_id'])// we add the id into array for not displaying it twice
  108.                     
  109.                 }
  110.             }
  111.         }
  112.         
  113.     }
  114.  
  115.     $listing.="</ul>\n</div>\n";
  116.  
  117.     return $listing;
  118.  
  119. }
  120.  
  121. //affichage selectbox échelle
  122. $resultscale $sql_object -> DBSelect($req_list_scale);
  123. $scale_selectbox="<h2>".formatText($resultscale2[0]['scale_denomination']'2HTML')."</h2>";
  124. $scale_selectbox.="<div class=\"filterselect\">";
  125. $scale_selectbox.=ScaleSelectBox($resultscale"scale"$scale_id$link_list_scale);
  126. $scale_selectbox.="</div>\n";
  127.  
  128. ?>
  129. <div id="chemin">
  130.     <ul>
  131.         <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  132.         <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','dashboard');?> </a></li>
  133.         <li><span><?php echo _t('dashboard','list')?> </span></li>
  134.     </ul>
  135. </div>
  136. <!--end barre haute -->
  137. <?php
  138. include_once(THEME_ADMIN_PATH."quickicons.php");
  139.  
  140. // including sparkline code
  141. footerAddJS('../lib/js/jquery.sparkline.min.js');
  142. footerAddInlineJS("$('.inlinebar').sparkline('html', {type: 'bar', barColor: '#8DA8CB'} );");
  143. ?>
  144. <script type="text/javascript">
  145. $(document).ready(function() {
  146.     
  147.     $("#content ul").each(
  148.               function() {
  149.                 var elem = $(this);
  150.                 if (elem.children().length == 0) {
  151.                   elem.append("<?php echo _t('divers''nodata')?>");
  152.                 }
  153.               }
  154.             );
  155.     $( "#tabs").tabs({
  156.         activate: function( event, ui ) {
  157.             $.sparkline_display_visible();
  158.             }
  159.     });
  160.  
  161.     $(".dashboard-indicator-gauge .cursor").removeAttr("title");
  162.     $(".infobox").hover(
  163.         function() {
  164.             $(this).next().fadeIn('fast');
  165.         },
  166.         function() {
  167.             $(this).next().hide();
  168.         }
  169.     );
  170. });
  171. </script>
  172. <div class="contentcontainer">
  173.     <?php    include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));    ?>
  174.     <div id="content">
  175.         <?php echo $scale_selectbox;    ?>
  176.         <br style="clear: both" />
  177.         <div id="tabs">
  178.             <ul>
  179.                 <li><a href="#tabs-1"><?php echo _t('dashboard''tab-attached')?></a></li>
  180.                 <li><a href="#tabs-2"><?php echo _t('dashboard''tab-not-attached')?></a></li>
  181.                 <li><a href="#tabs-3"><?php echo _t('dashboard''tab-all')?></a></li>
  182.             </ul>
  183.             <div id="tabs-1">
  184.                 <?php echo getIndicators($result$result_sdi$scale_id'attached'$sql_object)?>
  185.             </div>
  186.             <div id="tabs-2">
  187.                 <?php echo getIndicators($result$result_sdi$scale_id'not-attached'$sql_object)?>
  188.             </div>
  189.             <div id="tabs-3">
  190.                 <?php echo getIndicators($result$result_sdi$scale_id'all'$sql_object)?>
  191.             </div>
  192.         </div>
  193.     </div>
  194.     <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?>
  195. </div>

Documentation generated on Thu, 20 Mar 2014 16:48:38 +0100 by phpDocumentor 1.4.1