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

Source for file add_cal.php

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

Documentation generated on Thu, 03 May 2012 15:02:00 +0200 by phpDocumentor 1.4.1