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

Source for file rap.php

Documentation is available at rap.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. $result $sql_object->DBSelect($req_list_theme);
  23. $sdi_object new sdi;
  24. $req_sdi SQL_getListSdi($filter "R"$valueparam 0);
  25. $result_sdi $sql_object->DBSelect($req_sdi);
  26.  
  27. $finalities $sql_object->DBSelect(SQL_getSDThemes());
  28.  
  29. /**
  30.  * DEBUG_informations
  31.  * to access debug informations
  32.  * uncomment code and change the value
  33.  * of form action to post data
  34.  * on the same page
  35.  */
  36. /**
  37.  if (isset($_POST['valider'])) {
  38.  if (isset($_POST['graphic'])) $graphic = 1;
  39.  else $graphic = 'N';
  40.  
  41.  if (isset($_POST['table_value'])) $table_value = $_POST['table_value'];
  42.  else $table_value = 'non';
  43.  
  44.  if (isset($_POST['notpublished'])) $notpublished = $_POST['notpublished'];
  45.  else $notpublished = 'N';
  46.  
  47.  if (isset($_POST['provider'])) $provider = $_POST['provider'];
  48.  else $provider = 'N';
  49.  
  50.  if (isset($_POST['reglementation'])) $reglementation = $_POST['reglementation'];
  51.  else $reglementation = 'N';
  52.  
  53.  if (isset($_POST['evaluation'])) $evaluation = $_POST['evaluation'];
  54.  else $evaluation = 'N';
  55.  
  56.  if ($_POST['scale']=='det')
  57.  {
  58.  print_r($_POST['eachscale']);
  59.  }
  60.  else echo "scale ALL<br>\n";
  61.  
  62.  if ($_POST['sdi']=='det')
  63.  {
  64.  while (list(, $value) = each ($_POST['eachsdi'])) {
  65.  echo "sdi Valeur: $value<br>\n";
  66.  }
  67.  }
  68.  else echo "sdi ALL<br>\n";
  69.  
  70.  
  71.  $report_title = $_POST['title_report'];
  72.  $report_author = $_POST['author'];
  73.  $report_mail = $_POST['mail_author'];
  74.  $report_service = $_POST['service_author'];
  75.  $report_adress = $_POST['adresse_author'];
  76.  
  77.  echo "<br />" . $graphic;
  78.  echo "<br />" . $table_value;
  79.  echo "<br />" . $notpublished;
  80.  echo "<br />" . $provider;
  81.  echo "<br />" . $reglementation;
  82.  echo "<br />" . $evaluation;
  83.  echo "<br />" . $report_title;
  84.  echo "<br />" . $report_author;
  85.  echo "<br />" . $report_mail;
  86.  echo "<br />" . $report_service;
  87.  echo "<br />" . $report_adress;
  88.  echo "<br />" . $_POST['scale'];
  89.  echo "<br />" . $_POST['sdi'];
  90.  }
  91.  */
  92.  
  93. if (!isset($_REQUEST['scale_id'])) {
  94.   $scale_id 1;
  95. else {
  96.   $scale_id $_REQUEST['scale_id'];
  97. }
  98.  
  99. // Finalities filter
  100. $finalities_filter '<div class="dashboard-filter" id="by-finalities">';
  101. $finalities_filter .= '<h4>'._t('dashboard','select_by_finalities').'</h4>';
  102.  
  103. $js '';
  104.  
  105. foreach ($finalities as $finality{
  106.  
  107.     $finalities_filter .= '<a href="#" id="filter-finality-'.$finality['sdtheme_id'].'" /><i class="icon-cancel"></i>'formatText($finality['sdtheme_name']'2HTML')'</a> ';
  108.     
  109.     $js .= "$('#filter-finality-".$finality['sdtheme_id']."').click(function() {
  110.                         
  111.                         if($(this).hasClass('selected')) {
  112.                             $('li.finality-".$finality['sdtheme_id']." > input:checkbox').removeAttr('checked');
  113.                             $(this).find('i').replaceWith('<i class=\"icon-cancel\"></i>');
  114.                             $(this).removeClass('selected');
  115.                         } else {
  116.                             $('li.finality-".$finality['sdtheme_id']." > input:checkbox').attr('checked', 'checked');
  117.                             $(this).find('i').replaceWith('<i class=\"icon-ok\"></i>');
  118.                             $(this).addClass('selected');
  119.                         }
  120.                         
  121.                         return false;
  122.  
  123.                     });";
  124.     
  125.     
  126. }
  127. $finalities_filter .= '</div >';
  128.  
  129.  
  130. // Attached to dashboard filter
  131. // Finalities filter
  132. $attached_filter '<div class="dashboard-filter" id="by-association">';
  133. $attached_filter .= '<h4>'._t('dashboard','select_by_association').'</h4>';
  134. $attached_filter .= '<a href="#" id="filter-attached" /><i class="icon-cancel"></i>'_t('dashboard','indicator-attached')'</a> ';
  135. $attached_filter .= '<a href="#" id="filter-not-attached" /><i class="icon-cancel"></i>'_t('dashboard','indicator-not-attached')'</a>';
  136. $attached_filter .= '</div >';
  137.  
  138.  
  139.     $js "$('#filter-attached').click(function() {
  140.  
  141.                         if($(this).hasClass('selected')) {
  142.                             $('li.attached-to-dashboard > input:checkbox').removeAttr('checked');
  143.                             $(this).find('i').replaceWith('<i class=\"icon-cancel\"></i>');
  144.                             $(this).removeClass('selected');
  145.                         } else {
  146.                             $('li.attached-to-dashboard > input:checkbox').attr('checked', 'checked');
  147.                             $(this).find('i').replaceWith('<i class=\"icon-ok\"></i>');
  148.                             $(this).addClass('selected');
  149.                         }
  150.             
  151.                     return false;
  152.             
  153.                     });
  154.                     
  155.                     $('#filter-not-attached').click(function() {
  156.  
  157.                         if($(this).hasClass('selected')) {
  158.                             $('li.not-attached-to-dashboard > input:checkbox').removeAttr('checked');
  159.                             $(this).find('i').replaceWith('<i class=\"icon-cancel\"></i>');
  160.                             $(this).removeClass('selected');
  161.                         } else {
  162.                             $('li.not-attached-to-dashboard > input:checkbox').attr('checked', 'checked');
  163.                             $(this).find('i').replaceWith('<i class=\"icon-ok\"></i>');
  164.                             $(this).addClass('selected');
  165.                         }
  166.             
  167.                     return false;
  168.             
  169.                     });
  170.     
  171.     ";
  172.  
  173.  
  174.  
  175. $listing "";
  176. // affichage liste échelle
  177. $resultscale $sql_object->DBSelect($req_list_scale);
  178. $listing .= "<div><h2>" _t('dashboard','rap_scale_choice'"</h2></div>";
  179.  
  180. $listing .= "<div class=\"contboxgray\"><ul>\n";
  181. $listing .= "\t<li>\n";
  182. $listing .= "<input type=\"radio\" name=\"scale\" value=\"all\" checked=\"checked\" id=\"scale_all\" /><label for=\"scale_all\" class=\"autowidth\">" _t('dashboard','rap_scale_all'"</label>\n";
  183. $listing .= "<br /><input type=\"radio\" name=\"scale\" value=\"det\" id=\"scale_det\"  /><label for=\"scale_det\" class=\"autowidth\">" _t('dashboard','rap_scale_det'" </label>\n";
  184. $listing .= "\t</li></ul>\n";
  185. $listing .= "</div>\n";
  186.  
  187. $listing .= "<div class=\"contboxwhite\" id=\"display_scale\" style=\"display:none;\">\n";
  188. $listing .= "<ul>\n";
  189. for ($i 0;$i count($resultscale);$i++{
  190.   $listing .= "\t<li>\n";
  191.   $listing .= "<input type=\"checkbox\" name=\"eachscale[]\" id=\"eachscale" $resultscale[$i]['scale_id'"\" value=\"" $resultscale[$i]['scale_id'"\" />
  192.             <label for=\"eachscale" $resultscale[$i]['scale_id'"\" class=\"autowidth\">" formatText($resultscale[$i]['scale_denomination']'2HTML'"</label>\n";
  193.   $listing .= "\t</li>\n";
  194. }
  195. $listing .= "</ul>\n";
  196. $listing .= "</div>\n";
  197.  
  198. $js "$('#scale_all').click(function() {
  199.                         $('#display_scale').slideUp();
  200.                     });
  201.                     $('#scale_det').click(function() {
  202.                         $('#display_scale').slideDown();
  203.                 });";
  204.  
  205.  
  206. // affichage liste indicateur en fonction des thèmes
  207. $current_sdtheme '';
  208. $listing .= "<div><h2>" _t('dashboard','rap_sdi_choice'"</h2></div>";
  209.  
  210. $listing .= "<div class=\"contboxgray\">\n";
  211.  
  212. $listing .= "\t<ul><li>\n";
  213. $listing .= "<input type=\"radio\" name=\"sdi\" value=\"all\" checked=\"checked\" id=\"sdi_all\"/><label for=\"sdi_all\" class=\"autowidth\">" _t('dashboard','rap_sdi_all'"</label>\n";
  214. $listing .= "<br /><input type=\"radio\" name=\"sdi\" value=\"det\"   id=\"sdi_det\" /><label for=\"sdi_det\" class=\"autowidth\">" _t('dashboard','rap_sdi_det'"</label>\n";
  215. $listing .= "\t</li></ul>\n";
  216. $listing .= "</div>\n";
  217.  
  218. $listing .= "<div class=\"contboxwhite\" id=\"display_sdi\" style=\"display:none;\">\n";
  219. $listing .= "<div id=\"select-indicators\">\n";
  220. $listing .= "<h3>" _t('common''select'" : </h3>";
  221. $listing .= $attached_filter;
  222. $listing .= $finalities_filter;
  223. $listing .= "</div>\n";
  224. $listing .= "<ul>\n";
  225.  
  226. $a array()// to not display twice an indicator
  227.  
  228. for ($i 0;$i count($result);$i++{
  229.   for ($j 0;$j count($result_sdi);$j++{
  230.     if ($result[$i]['theme_id'== $result_sdi[$j]['sdii_theme']  && !in_array($result_sdi[$j]['sdii_id']$a)) {
  231.         if($result_sdi[$j]['sdii_to_dashboard'== 'Y'{
  232.             $todashboard_class 'attached-to-dashboard';
  233.         else {
  234.             $todashboard_class 'not-attached-to-dashboard';
  235.         }
  236.       $listing .= "\t<li class=\"finality-".$result[$i]['sdtheme_id']." ".$todashboard_class." "."theme-".$result[$i]['theme_id']."\">\n";
  237.       $listing .= "<input type=\"checkbox\" name=\"eachsdi[]\" id=\"eachsdi" $result_sdi[$j]['sdii_id'"\" value=\"" $result_sdi[$j]['sdii_id'"\" /><label for=\"eachsdi" $result_sdi[$j]['sdii_id'"\" class=\"autowidth\">" formatText($result_sdi[$j]['sdii_name']'2HTML'"</label>\n";
  238.       if ($result_sdi[$j]['sdii_statut'== 'D'$listing .= "<span class=\"state\"> / " _t('statut','draft'"</span>\n";
  239.       if ($result_sdi[$j]['sdii_to_dashboard'== 'N'$listing .= "<span class=\"state\"> / " _t('sdi','not_attached_to_dashboard'"</span>\n";
  240.       $listing .= "\t</li>\n";
  241.       
  242.       array_push($a$result_sdi[$j]['sdii_id'])// we add the id into array for not displaying it twice
  243.     }
  244.   }
  245. }
  246. $listing .= "</ul>\n";
  247. $listing .= "</div>\n";
  248.  
  249. $js "$('#sdi_all').click(function() {
  250.                     $('#display_sdi').slideUp();
  251.                 });
  252.                 $('#sdi_det').click(function() {
  253.                     $('#display_sdi').slideDown();
  254.                 });";
  255.  
  256.  
  257.  
  258. // affichage liste infos
  259. $listing .= "<div><h2>" _t('dashboard','rap_comp_choice'"</h2></div>";
  260. $listing .= "<div class=\"contboxgray\">\n";
  261. $listing .= "\t<ul><li>\n";
  262.  
  263. $listing .= "<input type=\"checkbox\" name=\"graphic\" id=\"graphic\" checked=\"checked\" />
  264.             <label for=\"graphic\" class=\"autowidth\">" _t('dashboard','rap_graph_values'"</label>\n";
  265. $listing .= "\t</li>\n";
  266. $listing .= "\t<li>\n";
  267. $listing .= "<input type=\"checkbox\" name=\"table_value\" id=\"table_value\" checked=\"checked\" />
  268.             <label for=\"table_value\" class=\"autowidth\">" _t('dashboard','rap_table_values'"</label>\n";
  269. $listing .= "\t</li>\n";
  270. $listing .= "\t<li>\n";
  271. $listing .= "<input type=\"checkbox\" name=\"notpublished\" id=\"notpublished\" checked=\"checked\" />
  272.             <label for=\"notpublished\" class=\"autowidth\">" _t('dashboard','rap_notpublished_values'"</label>\n";
  273. $listing .= "\t</li>\n";
  274. $listing .= "\t<li>\n";
  275. $listing .= "<input type=\"checkbox\" name=\"provider\" id=\"provider\" checked=\"checked\" />
  276.             <label for=\"provider\" class=\"autowidth\">" _t('dashboard','rap_provider_info'"</label>\n";
  277. $listing .= "\t</li>\n";
  278. $listing .= "\t<li>\n";
  279. $listing .= "<input type=\"checkbox\" name=\"reglementation\" id=\"reglementation\" checked=\"checked\" />
  280.             <label for=\"reglementation\" class=\"autowidth\">" _t('dashboard','rap_rules_info'"</label>\n";
  281. $listing .= "\t</li>\n";
  282. $listing .= "\t<li>\n";
  283. $listing .= "<input type=\"checkbox\" name=\"evaluation\" id=\"evaluation\" checked=\"checked\" />
  284.             <label for=\"evaluation\" class=\"autowidth\">" _t('dashboard','rap_eval_info'"</label>\n";
  285. $listing .= "\t</li>\n";
  286. $listing .= "\t<li>\n";
  287. $listing .= "<input type=\"checkbox\" name=\"summary\" id=\"summary\" checked=\"checked\" />
  288.             <label for=\"summary\" class=\"autowidth\">" _t('dashboard','rap_summary_info'"</label>\n";
  289. $listing .= "\t</li>\n";
  290. $listing .= "\t<li>\n";
  291. $listing .= "<input type=\"checkbox\" name=\"publi_info\" id=\"publi_info\" checked=\"checked\" />
  292.             <label for=\"publi_info\" class=\"autowidth\">" _t('dashboard','rap_publi_info'"</label>\n";
  293. $listing .= "\t</li>\n";
  294. $listing .= "\t</ul>\n";
  295. $listing .= "</div>\n";
  296.  
  297. ?>
  298. <div id="chemin">
  299. <ul>
  300.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  301.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','dashboard')?></a></li>
  302.     <li><span><?php echo _t('dashboard','rap')?></span></li>
  303. </ul>
  304. </div>
  305. <!--end barre haute -->
  306.     <?php
  307.     include_once(THEME_ADMIN_PATH."quickicons.php");
  308.  
  309.     ?>
  310. <div class="contentcontainer"><?php include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  311. ?>
  312. <div id="content">
  313.   <h2><?php echo _t('dashboard','rap')?></h2>
  314.   <form id="addrap" action="../report_sdi/sdi_report.php" method="post">
  315.   <p>
  316.     <label for="title_report"><?php echo _t('dashboard','rap_title')?> : </label>
  317.     <input name="title_report" type="text" class="textfield" id="title_report" maxlength="255" value="" />
  318.    </p>
  319.   <p>
  320.     <label for="author"><?php echo _t('dashboard','rap_author')?> : </label>
  321.     <input name="author" type="text" class="textfield" id="author" maxlength="255" value="" />
  322.   </p>
  323.   <p>
  324.     <label for="mail_author"><?php echo _t('dashboard','rap_mail_author');?> : </label>
  325.     <input name="mail_author" type="text" class="textfield"    id="mail_author" maxlength="255" value="" />
  326.   </p>
  327.   <p>
  328.     <label for="service_author"><?php echo _t('dashboard','rap_service')?> : </label>
  329.     <input name="service_author" type="text" class="textfield" id="service_author" maxlength="255" value="" />
  330.   </p>
  331.   <p>
  332.     <label for="adress_author"><?php echo _t('dashboard','rap_adress')?> : </label>
  333.     <textarea id="adress_author" name="adress_author" class="no-wysiwyg" <?php echo AREA_SETTINGS?>></textarea>
  334.   </p>
  335.   <?php
  336.   echo $listing;
  337.   ?>
  338.   <div>
  339.     <input name="annuler" type="button" value="<?php echo _t('btn','annul')?>" onclick="window.location='javascript:history.go(-1);'" class="button" id="annuler" /> 
  340.     <input name="generer" type="submit" value="<?php echo _t('dashboard','rap_generate'?>" class="button" id="generer" />
  341.     <input name="sauver" type="submit" value="<?php echo _t('dashboard','rap_save'?>" class="button" id="sauver" />
  342.   </div>
  343. </form>
  344. </div>
  345. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>

Documentation generated on Thu, 20 Mar 2014 16:49:27 +0100 by phpDocumentor 1.4.1