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

Source for file mod_cal.php

Documentation is available at mod_cal.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. include_once("../lib/input_helpers.php");
  12. if(isset($_POST['id']))    $id=$_POST['id'];
  13. if(isset($_GET['id']))    $id=$_GET['id'];
  14. //////////// Check Inclusion de pages ////////////
  15. if (!function_exists('AuthenthificationProcess')){
  16.   include_once("../lib/lib_common.php");
  17.   ReloadIndex('admin');
  18. }
  19. ////////////
  20.  
  21. //////////// Check Droits utilisateur ////////////
  22. if (isWorkgroupOrganiser(GetSessionElement('id')$sql_object$id)<>true && !IsSuperAdmin())
  23. ReloadIndex('admin');
  24. ////////////
  25.  
  26.  
  27. $link_add_cal $rub_link "&amp;todo=add_cal&amp;id=";
  28. $link_det $rub_link "&amp;todo=det&amp;id=";
  29.  
  30. if(isset($_POST['task_id']))    $task_id=$_POST['task_id'];
  31. if(isset($_GET['task_id']))    $task_id=$_GET['task_id'];
  32.  
  33. $calendar_objectnew calendar;
  34.  
  35. //$result_task=$calendar_object->GetOneTask($task_id, $sql_object);
  36. $req_task=SQL_getOneTask($task_id);
  37. $result_task $sql_object -> DBSelect($req_task);
  38.  
  39. $form_date=$result_task[0]['date_t'];
  40.  
  41. $form_task=formatText($result_task[0]['workcal_task']'2FIELD');
  42. $display_title_task=formatText($result_task[0]['workcal_task']'2FIELD');
  43. $form_task_details=formatText($result_task[0]['workcal_task_details']'2FIELD');
  44.  
  45. if($result_task[0]['workcal_workshop_id'== 999999999{
  46.   $display_common _t('divers''yes');
  47. else {
  48.   $display_common _t('divers''no');
  49. }
  50.  
  51. $req_det_workshopSQL_getoneCompleteWorkshop($id);
  52. $result_workshop=$sql_object->DBSelect($req_det_workshop);
  53. $workshop_denomination=formatText($result_workshop[0]['workshop_denomination']'2FIELD');
  54. $link_cancel=$rub_link."&amp;todo=list_cal&amp;id=".$id;
  55. //$workshop_object= new workshop;
  56.  
  57. if(isset($_POST['enregistrer'])) {
  58.  
  59.   $data_table=unserialize(urldecode($_POST['data_table']));
  60.   $result=$calendar_object->ModifyTask($task_id$data_table$sql_object);
  61.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&id=".$id;
  62.   if($resultheader("Location: ".$link_confirm);
  63.   else  system_error();
  64. }
  65.  
  66.  
  67. if(isset($_POST['valider'])) {
  68.  
  69.   //traitement de la date
  70.  
  71.   $table[0$_POST['date'];
  72.   $table[1$_POST['task'];
  73.   $table[2$_POST['task_details'];
  74.   $table[3$_POST['id'];
  75.  
  76.   $integrity=$calendar_object->CheckDataIntegrity($table$sql_object);
  77.  
  78.   if(is_string($integrity)) {
  79.     $text_format='2FIELD';
  80.   else {
  81.     $text_format='2HTML';
  82.     //$table[6]=$integrity;
  83.   }
  84.   $form_task=formatText($_POST['task']$text_format);
  85.   $form_task_details=formatText($_POST['task_details']$text_format);
  86.   $form_date =$_POST['date'];
  87.  
  88.   $table=urlencode(serialize($table));
  89. }
  90. include_once(THEME_ADMIN_PATH."quickicons.php");
  91. $navtitle=_t('workshop','mod_cal')." : ".$display_title_task;
  92.  
  93. footerAddJS('../lib/js/jquery.datePicker.l10n/jquery.ui.datepicker-'.U_L.'.js');
  94.  
  95. ?>
  96. <div id="chemin">
  97. <ul>
  98.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a></li>
  99.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','workshop')?></a></li>
  100.     <li><span><?php echo formatnavTitle($navtitle)?></span></li>
  101. </ul>
  102. </div>
  103. <!--end barre haute -->
  104.  
  105. <script type="text/javascript">    
  106.     $(function()
  107.     {
  108.         var dateFormat = "<?php echo DATE_FORMAT?>";
  109.         dateFormat = dateFormat.replace("yyyy", "yy");
  110.         
  111.         $(".date-pick").datepicker({
  112.             showOn: "button",
  113.             buttonImage: "../lib/js/calendar.png",
  114.             buttonImageOnly: true,
  115.             dateFormat: dateFormat,
  116.             dateMin: new Date(2000, 1 - 1, 1)
  117.         });
  118.         $( ".date-pick" ).datepicker( $.datepicker.regional[ "<?php echo U_L?>" ] );
  119.         
  120.     });
  121. </script>
  122.  
  123. <?php
  124. if(!isset($integrity|| is_string($integrity)) {
  125. ?>
  126. <div class="contentcontainer">
  127. <?php
  128. include_once($dir."/menurub.php");
  129. ?>
  130. <div id="content">
  131. <?php
  132. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  133. ?>
  134. <?php afflinkbar($todo,$id$lang)?>
  135. <h2><?php echo formatTitleh2(_t('workshop','name')." : ".$workshop_denomination)?></h2>
  136.  
  137. <form id="addtask" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  138. <p>
  139.   <label for="task">
  140.   <?php echo ucfirst(_t('workshop','task'))?> * : </label>
  141.   <input name="task" type="text" class="textfield" id="task" maxlength="200" value="<?php echo $form_task?>" />
  142. </p>
  143. <p>
  144.   <label for="task_details">
  145.   <?php echo ucfirst(_t('workshop','task_details'))?> * : </label>
  146.   <textarea id="task_details" name="task_details" <?php echo AREA_SETTINGS?> class="largetextfield"><?php echo $form_task_details?></textarea>
  147. </p>
  148. <p>
  149.   <label for="date"><?php echo ucfirst(_t('workshop','date'))?> *:</label>
  150.   <input name="date" type="text" maxlength="10" id="date" class="date-pick shorttextfield" value="<?php echo $form_date?>" />
  151. </p>
  152. <div class="label"><?php echo ucfirst(_t('workshop','task_common'))?> : </div>
  153. <div class="rightpanel"><?php echo $display_common?></div>
  154.   <div>
  155.     <input name="task_id" type="hidden" value="<?php echo $task_id?>" id="task_id" />
  156.     <input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  157.     <?php echo cancel_button($link_cancel)?>
  158.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  159.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  160.     <input name="valider" type="submit"    value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  161.   </div>
  162. </form>
  163. </div>
  164. <?php include_once($dir."/help.php")?></div>
  165. <?php
  166. // Récapitulatif
  167. else    {
  168.  
  169.   if(empty($form_task)) $display_form_task=_t('divers','nc');
  170.   else $display_form_task=formatText($form_task$text_format);
  171.  
  172.   if(empty($form_task_details)) $display_form_task_details=_t('divers','nc');
  173.   else $display_form_task_details=formatText($form_task_details$text_format);
  174.  
  175.   ?>
  176. <div class="contentcontainer"><?php
  177. include_once($dir."/menurub.php");
  178. ?>
  179. <div id="content"><?php afflinkbar($todo,$id$lang)?>
  180. <h2><?php echo _t('recap','title'?></h2>
  181. <?php
  182. echo "<dl class=\"dl3\">\n";
  183. echo "<dt>"._t('workshop','task')."</dt>\n";
  184. echo "<dd>"$display_form_task."</dd>\n";
  185. echo "<dt>"_t('workshop','task_details')"</dt>\n";
  186. echo "<dd>".$display_form_task_details."</dd>\n";
  187. echo "<dt>"._t('workshop','date')." :</dt>\n";
  188. echo "<dd>".$form_date."</dd>\n";
  189. echo "<dt>".ucfirst(_t('workshop','task_common'))." :</dt>\n";
  190. echo "<dd>".$display_common."</dd>\n";
  191. echo "</dl>\n";
  192. ?>
  193. <form id="addtask" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  194.   <div>
  195.     <input name="task_id" type="hidden" value="<?php echo $task_id?>" id="taskid" />
  196.     <input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  197.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  198.     <?php echo cancel_button($link_cancel)?>
  199.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  200.     <input name="data_table" type="hidden" value="<?php echo $table?>" id="data_table" />
  201.     <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  202.     <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="valider" />
  203.   </div>
  204. </form>
  205. </div>
  206. <?php include_once($dir."/help.php")?></div>
  207. <?php
  208. }
  209. ?>

Documentation generated on Thu, 03 May 2012 15:06:37 +0200 by phpDocumentor 1.4.1