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

Source for file det.php

Documentation is available at det.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage workshop
  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. if(isset($_POST['id']))    $id=$_POST['id'];
  12. if(isset($_GET['id']))    $id=$_GET['id'];
  13. //////////// Check Inclusion de pages ////////////
  14. if (!class_exists('auth')){
  15.   include_once("../lib/lib_common.php");
  16.   ReloadIndex('admin');
  17. }
  18. ////////////
  19.  
  20. //////////// Check Droits utilisateur ////////////
  21. if (!$l21auth->hasRight('workshop'&& !$l21auth->isSuperAdmin())
  22.     ReloadIndex('admin');
  23. ////////////
  24.  
  25.  
  26. $result=$sql_object->DBSelect($req_det);
  27. if(count($result)>1exit();
  28.  
  29. if ($result[0]['workshop_statut']<>'P' && !$l21auth->isSuperAdmin()){
  30.   ReloadIndex('admin');
  31. }
  32.  
  33. $link_det=$rub_link."&amp;todo=det&amp;id=";
  34. $link_sup=$rub_link."&amp;todo=sup&amp;id=";
  35. $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  36. $link_det_u="index.php?rub=user&amp;todo=det&amp;id=";
  37. $link_det_theme="index.php?rub=theme&amp;todo=det&amp;id=";
  38. $link_det_level="index.php?rub=level&amp;todo=det&amp;id=";
  39. $link_sup_u=$rub_link."&amp;todo=sup_u&amp;id=";
  40. $link_add_u=$rub_link."&amp;todo=add_u&amp;id=";
  41. $link_list_cal=$rub_link."&amp;todo=list_cal&amp;id=";
  42. $link_list_com=$rub_link."&amp;todo=list_com&amp;id=";
  43. $link_sup_rep="index.php?rub=workshoprep&amp;todo=sup&amp;id=";
  44. $link_mod_rep="index.php?rub=workshoprep&amp;todo=mod&amp;id=";
  45. $link_det_rep="index.php?rub=workshoprep&amp;todo=det&amp;id=";
  46. $link_add_rep="index.php?rub=workshoprep&amp;todo=add&amp;work_id=";
  47.  
  48. $workshop_denomination=formatText($result[0]['workshop_denomination']'2HTML');
  49. $workshop_resume=empty_nc(formatText($result[0]['workshop_resume']'2HTML'));
  50. $workshop_comment=empty_nc(formatText($result[0]['workshop_comment']'2HTML'));
  51. $theme_denomination=formatText($result[0]['theme_name']'2HTML');
  52. $level_denomination=formatText(empty_none($result[0]['level_name']'2HTML'));
  53. $workshop_statut=display_statut($result[0]['workshop_statut']);
  54. $display_date_crea=$result[0]['workshop_date_crea_display'];
  55. $display_last_modify=$result[0]['workshop_last_modify_display'];
  56. $workshop_objectnew workshop ;
  57.  
  58. $req_user=SQL_getWorkshopUserList($id);
  59. $result_user $sql_object -> DBSelect($req_user);
  60.  
  61. //récupération des organisateurs du workshop
  62. $form_organizer='';
  63. $j=0;
  64. for($i=0$i<count($result_user)$i++{
  65.   if ($result_user[$i]['jwu_user_right']=='O'){
  66.     $j++;
  67.     if ($j<>1$form_organizer.=", ";
  68.     $form_organizer.=$result_user[$i]['user_login'];
  69.   }
  70. }
  71.  
  72. // formattage des données
  73.  
  74. //prepa affichage des infos générales
  75. $reca_generals="<h3 class=\"part\">\n"._t('workshop','generals')." : </h3>\n";
  76. $reca_generals.="<dl class=\"dl3\">\n";
  77. $reca_generals.="<dt>".mb_ucfirst(_t('workshop','title'))." :</dt>\n";
  78. $reca_generals.="<dd>"$workshop_denomination."</dd>\n";
  79. $reca_generals.="<dt>".mb_ucfirst(_t('workshop','resume'))" :</dt>\n";
  80. $reca_generals.="<dd>".$workshop_resume."</dd>\n";
  81. $reca_generals.="<dt>".mb_ucfirst(_t('workshop','theme'))." :</dt>\n";
  82. if ($l21auth->isSuperAdmin())
  83. $reca_generals.="<dd><a href=\"".$link_det_theme.$result[0]['workshop_theme']."\" title=\"".$theme_denomination."\">".$theme_denomination."</a></dd>\n";
  84. else $reca_generals.="<dd>".$theme_denomination."</dd>\n";
  85. $reca_generals.="<dt>".mb_ucfirst(_t('workshop','level'))." :</dt>\n";
  86. if ($l21auth->isSuperAdmin(&& $result[0]['workshop_level'<> -1)
  87. $reca_generals.="<dd><a href=\"".$link_det_level.$result[0]['workshop_level']."\" title=\"".$level_denomination."\">".$level_denomination."</a></dd>\n";
  88.  
  89. else $reca_generals.="<dd>".$level_denomination."</dd>\n";
  90.  
  91. $reca_generals.="<dt>".mb_ucfirst(_t('divers','date_crea')) ." :</dt>\n";
  92. $reca_generals.="<dd>"$display_date_crea"</dd>\n";
  93. $reca_generals.="<dt>".mb_ucfirst(_t('divers','last_modify')) ." :</dt>\n";
  94. $reca_generals.="<dd>"$display_last_modify"</dd>\n";
  95. $reca_generals.="<dt>".mb_ucfirst(_t('divers','statut'))." :</dt>\n";
  96. $reca_generals.="<dd>"$workshop_statut"</dd>\n";
  97. $reca_generals.="<dt>".mb_ucfirst(_t('workshop','comment'))." :</dt>\n";
  98. $reca_generals.="<dd>"$workshop_comment"</dd>\n";
  99. $reca_generals.="<dt>".mb_ucfirst(_t('workshop','organizer'))." :</dt>\n";
  100. $reca_generals.="<dd>"$form_organizer"</dd>\n";
  101. $reca_generals.="</dl>\n";
  102.  
  103.  
  104. // Récuperation des différentes parties
  105.  
  106. //prepa affichage des utilisateurs du workgroup
  107.  
  108. if($result_user==false$contents_user="<div class=\"info\">"._t('workshop','no_user')."</div>";
  109. else {
  110.   $contents_user"<table cellspacing=\"0\" cellpadding=\"3\" class=\"table2\">\n";
  111.   $contents_user.="<thead>\n";
  112.   $contents_user.="<tr>\n";
  113.   $contents_user.="<td>".mb_ucfirst(_t('workshop','user'))."</td>\n";
  114.   $contents_user.="<td> <span class=\"semnone\">".mb_ucfirst(_t('divers','actions'))."</span></td>\n";
  115.   $contents_user.="</tr>\n";
  116.   $contents_user.="</thead>\n";
  117.   $contents_user.="<tbody>\n";
  118.   $mailing_list='';
  119.       
  120.       
  121.   for($i=0$i<count($result_user)$i++{
  122.     
  123.       if ($result_user[$i]['jwu_user_right']=='A'{
  124.           $class=' class="to-moderate" '
  125.       else {
  126.           $class='';
  127.       }
  128.     $contents_user.="<tr".$class.">\n";
  129.     $contents_user.="<td>";
  130.     if ($l21auth->isSuperAdmin())
  131.     $contents_user.="<a href=\"".$link_det_u.$result_user[$i]['jwu_user_id']."\" title=\"".formatText(_t('workshop','user')'2HTML')."\">".formatText($result_user[$i]['user_login']'2HTML')."</a>\n";
  132.     else
  133.     $contents_user.="<span>".formatText($result_user[$i]['user_login']'2HTML')."</span>";
  134.     if ($result_user[$i]['jwu_user_right']=='O')
  135.         $contents_user.=" <span class=\"text_det_it\">("._t('statut''O').")</span> ";
  136.     if ($result_user[$i]['jwu_user_right']=='A')
  137.         $contents_user.=" <span class=\"text_det_it pending-user\">("._t('statut''pending').")</span> ";
  138.     $contents_user.="</td>\n";
  139.     if ($l21auth->isWorkgroupOrganiser($l21auth->GetSessionElement('id')$sql_object$id|| $l21auth->isSuperAdmin()){
  140.       $contents_user.="<td><div class=\"iconetab\">";
  141.       if ($result_user[$i]['jwu_user_right']=='A'{
  142.           $contents_user.="<a href=\"".$link_sup_u.$id."&amp;u_id=".$result_user[$i]['jwu_user_id']."\" title=\""._t('workshop','del_user')."\" class=\"ico_sup\"></a>\n";
  143.           $contents_user.="<a href=\"../workshop/_user.php?action=accept&amp;id=".$id."&amp;u_id=".$result_user[$i]['jwu_user_id']."\" title=\""._t('workshop','add_new_user')."\" class=\"ico_add accept-user\"></a>\n";
  144.       else {
  145.           $contents_user.="<a href=\"".$link_sup_u.$id."&amp;u_id=".$result_user[$i]['jwu_user_id']."\" title=\""._t('workshop','del_user')."\" class=\"ico_sup\"></a>\n";
  146.       }
  147.       $contents_user.="<a href=\"mailto:".$result_user[$i]['profile_email']."\" title=\"".$result_user[$i]['profile_email']."\" class=\"ico_mail\"></a></div></td>";
  148.     }
  149.     else $contents_user.="<td>&nbsp;</td>\n";
  150.     $contents_user.="</tr>\n";
  151.     $mailing_list.=$result_user[$i]['profile_email'].MAIL_SEPARATOR."%20";
  152.   }
  153.   $contents_user.="</tbody>";
  154.   $contents_user.="</table>";
  155. }
  156.  
  157. $reca_user ="<br class=\"brendstep\" />\n";
  158. $reca_user.="<div class=\"toggle_title\">\n";
  159. $reca_user.="<a id=\"workshopuser\" href=\"#\">"._t('workshop','user')."</a>\n";
  160. $reca_user.="</div>\n";
  161. $reca_user.="<div id=\"workshop_user\" style=\"display:none;\" >\n";
  162. if ($l21auth->isWorkgroupOrganiser ($l21auth->GetSessionElement('id')$sql_object$id|| $l21auth->isSuperAdmin())
  163. $reca_user.="<a href=\"".$link_add_u.$id."\" title=\""._t('workshop','add_new_user')."\" class=\"ico_add2\"></a><br class=\"brendstep\" />";
  164. $reca_user.=$contents_user;
  165. if ($l21auth->isWorkgroupOrganiser ($l21auth->GetSessionElement('id')$sql_object$id|| $l21auth->isSuperAdmin())
  166. $reca_user.="<div class=\"mailing_list\"><a href=\"mailto:".$mailing_list."\" title=\""._t('workshop','mailing_list')."\"> <img src=\"" .THEME_ADMIN_PATH"images/ico_mail2.gif\" alt=\""._t('workshop','mailing_list')."\" /> &nbsp;"._t('workshop','mailing_list')."</a></div>";
  167. $reca_user.="</div>\n";
  168. $reca_user.="<br class=\"brendstep\" />\n";
  169.  
  170. //prepa affichage des rapports d'un workgroup
  171.  
  172. $req_workshop_reportSQL_getWorkshopReportList($id);
  173. $result_report=$sql_object->DBSelect($req_workshop_report);
  174.  
  175. //$workshop_report_object= new workshop_report ;
  176.  
  177. $link_res_sup="?rub=resources&amp;todo=sup&amp;id=&amp;parent=".$id."&amp;type=P&amp;id=";
  178. $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  179.  
  180. if($result_report==0{
  181.   $contents_report="<div class=\"info\">"._t('workshop','no_report')."</div>";
  182. else {
  183.   $contents_report"<table cellspacing=\"0\" cellpadding=\"3\" class=\"table2\">\n";
  184.   $contents_report.="<thead>\n";
  185.   $contents_report.="<tr>\n";
  186.   $contents_report.="<td>".mb_ucfirst(_t('workshop','title_report'))."</td>\n";
  187.   $contents_report.="<td>".mb_ucfirst(_t('divers','statut'))."</td>\n";
  188.   $contents_report.="<td>".mb_ucfirst(_t('divers','date_crea'))."</td>\n";
  189.   $contents_report.="<td> <span class=\"semnone\">".mb_ucfirst(_t('divers','actions'))."</span></td>\n";
  190.   $contents_report.="</tr>\n";
  191.   $contents_report.="</thead>\n";
  192.   $contents_report.="<tbody>\n";
  193.  
  194.   for($i=0$i<count($result_report)$i++{
  195.  
  196.     $workshop_report_title=formatText(cutText($result_report[$i]['workrep_title']601)'2HTML');
  197.  
  198.     $contents_report.="<tr>\n";
  199.     $contents_report.="<td width=\"50%\"><a href=\"".$link_det_rep.$result_report[$i]['workrep_id']."\" title=\"".$workshop_report_title."\">".$workshop_report_title."</a></td>\n";
  200.     $contents_report.="<td>".display_statut($result_report[$i]['workrep_statut'])."</td>\n";
  201.     $contents_report.="<td>".$result_report[$i]['workrep_date_crea_display']."</td>\n";
  202.     if ($l21auth->isWorkgroupOrganiser ($l21auth->GetSessionElement('id')$sql_object$id|| $l21auth->isSuperAdmin()){
  203.       $contents_report.="<td><div class=\"iconetab\"><a href=\"".$link_sup_rep.$result_report[$i]['workrep_id']."\" title=\""._t('workshop','del_report')."\" class=\"ico_sup\"></a>\n";
  204.       $contents_report.="<a href=\"".$link_mod_rep.$result_report[$i]['workrep_id']."\" title=\""._t('workshop','mod_report')."\" class=\"ico_mod\"></a></div></td>";
  205.     }
  206.     else $contents_report.="<td>&nbsp;</td>\n";
  207.     $contents_report.="</tr>\n";
  208.   }
  209.  
  210.   $contents_report.="</tbody>";
  211.   $contents_report.="</table>";
  212. }
  213.     
  214. $reca_report='';
  215. $reca_report.="<div class=\"toggle_title\">\n";
  216. $reca_report.="<a id=\"resreport\" href=\"#\">"._t('workshop','report')."</a>\n";
  217. $reca_report.="</div>\n";
  218. $reca_report.="<div id=\"res_report\" style=\"display:none;\" >\n";
  219. if ($l21auth->isWorkgroupOrganiser ($l21auth->GetSessionElement('id')$sql_object$id|| $l21auth->isSuperAdmin())
  220. $reca_report.="<a href=\"".$link_add_rep.$id."\" title=\""._t('workshop','add_new_report')."\" class=\"ico_add2\"></a><br class=\"brendstep\" />";
  221. $reca_report.=$contents_report;
  222. $reca_report.="</div>\n";
  223. $reca_report.="<br class=\"brendstep\" />\n";
  224.  
  225. $navtitle=_t('workshop','det')." : ".$workshop_denomination;
  226.  
  227. // ajax code
  228. $js '$("a.accept-user").click(function() {
  229.  
  230.             var el = this;
  231.             var url = $(el).attr("href") + "&mode=ajax";
  232.             
  233.             $.ajax({
  234.                 type: "GET",
  235.                 url: url,
  236.                 dataType: "json",
  237.                 success: function(data){
  238.                     if(data.status==1) {
  239.                         humane.success(data.msg);
  240.                         var parentel = $(el).closest("tr");
  241.                         $(parentel).find("span.pending-user").fadeOut();
  242.                         $(parentel).removeClass("to-moderate");
  243.                         $(el).fadeOut();
  244.                     } else {
  245.                         humane.error(data.msg);
  246.                     }
  247.                 }
  248.             });
  249.             
  250.             return false;
  251.  
  252.             });
  253.             ';
  254.  
  255. ?>
  256. <div id="chemin">
  257. <ul>
  258.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  259.     </li>
  260.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  261.         class="chemin_rub"><?php echo _t('menu','workshop');?></a></li>
  262.     <li><span><?php echo formatnavTitle($navtitle)?></span></li>
  263. </ul>
  264. </div>
  265. <!--end barre haute -->
  266. <?php
  267. include_once(THEME_ADMIN_PATH."quickicons.php");
  268. ?>
  269. <div class="contentcontainer"><?php
  270. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  271. ?>
  272. <div id="content"><?php    
  273. afflinkbar($todo,$id$lang);
  274. echo "<h2>".formatTitleh2($workshop_denomination)."</h2>\n";
  275. if ($l21auth->isSuperAdmin()){
  276.   echo "<a href=\"".$link_sup.$id."\" title=\""._t('workshop','sup')."\" class=\"ico_sup2\"></a>";
  277. }
  278. if ($l21auth->isSuperAdmin(|| $l21auth->isWorkgroupOrganiser ($l21auth->GetSessionElement('id')$sql_object$id)){
  279.   echo "<a href=\"".$link_mod.$id."\" title=\""._t('workshop','mod')."\" class=\"ico_mod2\"></a><br class=\"brendstep\" />";
  280. }
  281. echo $reca_generals;
  282. echo $reca_user;
  283. echo $reca_report;
  284. ?></div>
  285.  
  286. <?php
  287. // Ability to drag'n drop items
  288. if ($l21auth->isWorkgroupOrganiser ($l21auth->GetSessionElement('id')$sql_object$id|| $l21auth->isSuperAdmin()) {
  289.     footerAddJS('../lib/js/jquery.tablednd_0_5.js');
  290. }
  291. ?>
  292. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?>
  293. </div>

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