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

Source for file mod_com.php

Documentation is available at mod_com.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.  
  15. if(isset($_POST['com_id']))    $com_id=$_POST['com_id'];
  16. if(isset($_GET['com_id']))    $com_id=$_GET['com_id'];
  17.  
  18. if(isset($_POST['mes_id']))    $mes_id=$_POST['mes_id'];
  19. if(isset($_GET['mes_id']))    $mes_id=$_GET['mes_id'];
  20.  
  21. //////////// Check Inclusion de pages ////////////
  22. if (!function_exists('AuthenthificationProcess')){
  23.   include_once("../lib/lib_common.php");
  24.   ReloadIndex('admin');
  25. }
  26. ////////////
  27.  
  28. //////////// Check Droits utilisateur ////////////
  29. if (isWorkgroupOrganiser(GetSessionElement('id')$sql_object$id)<>true && !IsSuperAdmin())
  30. ReloadIndex('admin');
  31. ////////////
  32.  
  33. $link_det=$rub_link."&amp;todo=det&amp;id=";
  34. $link_add_com=$rub_link."&amp;todo=add_com&amp;id=".$id."&amp;com_id=";
  35.  
  36. if($com_id <> 0$link_cancel=$rub_link."&amp;todo=det_com&amp;id=".$id."&amp;com_id=".$com_id;
  37. else $link_cancel=$rub_link."&amp;todo=list_com&amp;id=".$id;
  38.  
  39. //$user_id=11;
  40. $req_com_mes SQL_getOnetopicWorkcom($id$mes_id$mes_id);
  41. $result_com_mes $sql_object -> DBSelect($req_com_mes);
  42.  
  43. $req_com_dis SQL_getOnetopicWorkcom($id$com_id$com_id);
  44. $result_com_dis $sql_object -> DBSelect($req_com_dis);
  45. $com_dis_subject=formatText($result_com_dis[0]['workcom_subject']'2FIELD');
  46.  
  47. $com_root_subject=formatText($result_com_mes[0]['workcom_subject']'2FIELD');
  48.  
  49. $form_subject=formatText($result_com_mes[0]['workcom_subject']'2FIELD');
  50. $form_body=formatText($result_com_mes[0]['workcom_body']'2FIELD');
  51.  
  52. $req_det_workshopSQL_getoneCompleteWorkshop($id);
  53. $result_workshop=$sql_object->DBSelect($req_det_workshop);
  54. $workshop_denomination=formatText($result_workshop[0]['workshop_denomination']'2FIELD');
  55.  
  56.  
  57. $workshop_com_objectnew workshop_com;
  58.  
  59. if(isset($_POST['enregistrer'])) {
  60.   $data_table=unserialize(urldecode($_POST['data_table']));
  61.   //faire l'ajout de user avec AddUserWorkshop
  62.   $result=$workshop_com_object->ModifyCom($mes_id$data_table $sql_object);
  63.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&id=".$id."&com_id=".$com_id."&mes_id=".$mes_id;
  64.   if($resultheader("Location: ".$link_confirm);
  65.   else  system_error();
  66. }
  67.  
  68. if(isset($_POST['valider'])) {
  69.  
  70.   $table[0$_POST['subject'];
  71.   $table[1$_POST['body'];
  72.  
  73.   $integrity=$workshop_com_object->CheckDataIntegrity($table$sql_object);
  74.  
  75.   if(is_string($integrity)) {
  76.     $text_format='2FIELD';
  77.   else {
  78.     $text_format='2HTML';
  79.   }
  80.  
  81.   $form_subject=formatText($_POST['subject']$text_format);
  82.   $form_body=formatText($_POST['body']$text_format);
  83.   $table=urlencode(serialize($table));
  84. }
  85. include_once(THEME_ADMIN_PATH."quickicons.php");
  86.  
  87. if ($com_id==0{
  88.   $navtitle=_t('workshop','mod_com')." : ".$workshop_denomination;
  89.   $titleh2=_t('workshop','name')." : ".$workshop_denomination;
  90. }
  91. else {
  92.   $navtitle=_t('workshop','mod_com_mes')." : ".$com_dis_subject." (".$workshop_denomination.")";
  93.   $titleh2=_t('workshop','com_name')." : ".$com_dis_subject." ("._t('workshop','name')." :".$workshop_denomination.")";
  94. }
  95. ?>
  96. <div id="chemin">
  97. <ul>
  98.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a>
  99.     </li>
  100.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  101.         class="chemin_rub"><?php echo _t('menu','workshop')?></a></li>
  102.     <li><span><?php echo formatnavTitle($navtitle);
  103.     ?></span></li>
  104. </ul>
  105. </div>
  106. <!--end barre haute -->
  107.     <?php
  108.     if(!isset($integrity|| is_string($integrity)) {
  109.       ?>
  110. <div class="contentcontainer"><?php
  111. include_once($dir."/menurub.php");
  112. ?>
  113. <div id="content"><?php
  114. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  115. ?> <?php afflinkbar($todo,$id$lang)?>
  116. <h2><?php 
  117. echo formatTitleh2($titleh2)?></h2>
  118. <form id="addcom" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  119.     method="post">
  120. <p><label for="subject"><?php echo _t('workshop','com_subject')?> * :
  121. </label> <input name="subject" type="text" class="textfield"
  122.     id="subject" maxlength="150" value="<?php echo $form_subject?>" /></p>
  123. <p><label for="body"><?php echo _t('workshop','com_body')?> * : </label>
  124. <textarea id="body" name="body" <?php echo AREA_SETTINGS?>
  125.     class="largetextfield"><?php echo $form_body?></textarea></p>
  126. <div><input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  127. <input name="com_id" type="hidden" value="<?php echo $com_id?>"
  128.     id="com_id" /> <?php echo cancel_button($link_cancel)?> <input
  129.     name="mes_id" type="hidden" value="<?php echo $mes_id?>" id="mes_id" />
  130. <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  131. <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  132. <input name="valider" type="submit"
  133.     value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  134. </div>
  135. </form>
  136. </div>
  137. <?php include_once($dir."/help.php")?></div>
  138. <?php
  139. // Récapitulatif
  140.     else    {
  141.       ?>
  142. <div class="contentcontainer"><?php
  143. include_once($dir."/menurub.php");
  144. ?>
  145. <div id="content"><?php afflinkbar($todo,$id$lang)?>
  146. <h2><?php echo _t('recap','title'?></h2>
  147. <?php
  148. echo "<dl class=\"dl3\">\n";
  149. echo "<dt>"._t('workshop','com_subject')." :</dt>\n";
  150. echo "<dd>".$form_subject."</dd>\n";
  151. echo "<dt>"._t('workshop','com_body'."</dt>\n";
  152. echo "<dd>".$form_body."</dd>\n";
  153. echo "</dl>\n";
  154. ?>
  155. <form id="addworkshop" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  156.     method="post">
  157. <div><input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  158. <input name="com_id" type="hidden" value="<?php echo $com_id?>"
  159.     id="com_id" /> <?php echo cancel_button($link_cancel)?> <input
  160.     name="mes_id" type="hidden" value="<?php echo $mes_id?>" id="mes_id" />
  161. <input name="data_table" type="hidden" value="<?php echo $table?>"
  162.     id="data_table" /> <input name="rub" type="hidden"
  163.     value="<?php echo $rub?>" id="rub" /> <input name="todo"
  164.     type="hidden" value="<?php echo $todo?>" id="todo" /> <input
  165.     name="retour" type="button" value="<?php echo _t('btn','preview'?>"
  166.     class="button" id="retour" onclick="history.go(-1);" /> <input
  167.     name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>"
  168.     class="button" id="valider" /></div>
  169. </form>
  170. </div>
  171. <?php include_once($dir."/help.php")?></div>
  172. <?php
  173.     }
  174.     ?>

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