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

Source for file add_biblio.php

Documentation is available at add_biblio.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage resources
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  'Resource' module is used by 'Publication' and 'Workshop' modules
  10.  */
  11.  
  12. //////////// Check Inclusion de pages ////////////
  13. if (!class_exists('auth')) {
  14.   include_once("../lib/lib_common.php");
  15.   ReloadIndex('admin');
  16. }
  17. ////////////
  18.  
  19.  
  20. $complete_type=strtoupper($mod_inc);
  21. if($type=='P'{
  22.   $requeteSQL_getPublicationTitle($parent);
  23.   $result=$sql_object->DBSelect($requete);
  24.   $current_title=FormatText($result[0]['publi_title']'2HTML');
  25.   $publi_owner=$result[0]['publi_posted_by'];
  26.  
  27.   //////////// Check Droits utilisateur ////////////
  28.   if (!$l21auth->hasRight('publication')) ReloadIndex('admin');
  29.   if ($l21auth->GetSessionElement('id')!=$publi_owner && !$l21auth->isSuperAdmin()) ReloadIndex('admin');
  30.   ///////////
  31. }
  32. if($type=='W'{
  33.   $requeteSQL_getWorkshopRepTitleAndGroup($parent);
  34.   $result=$sql_object->DBSelect($requete);
  35.   $current_title=FormatText($result[0]['workrep_title'].' ('.$result[0]['workshop_denomination'].')''2HTML');
  36.   $workshop_id=$result[0]['workrep_workshop_id'];
  37.  
  38.   //////////// Check Droits utilisateur ////////////
  39.   if (!$l21auth->hasRight('workshop')) ReloadIndex('admin');
  40.   if (!$l21auth->isWorkgroupOrganiser($l21auth->GetSessionElement('id')$sql_object$workshop_id&& !$l21auth->isSuperAdmin()) ReloadIndex('admin');
  41.   ///////////
  42. }
  43. ?>
  44.  
  45. <div id="chemin">
  46. <ul>
  47.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  48.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu',$mod_inc)?></a></li>
  49.     <li><span><?php echo formatNavTitle(_t('resources',$mod_inc.'_type')." : "$current_title)?></span></li>
  50. </ul>
  51. </div>
  52. <!--end barre haute -->
  53. <?php
  54. $form_author='';
  55. $form_title='';
  56. $form_sub_title='';
  57. $form_editor='';
  58. $form_published_date='';
  59.  
  60. $resources_objectnew resources;
  61.  
  62. if(isset($_POST['enregistrer'])) {
  63.   $data_table=unserialize(urldecode($_POST['data_table']));
  64.   $result=$resources_object->AddBiblioRes($parent$data_table$complete_type$sql_object);
  65.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&type=".$type."&id=".$parent;
  66.   if($result===trueheader("Location: ".$link_confirm);
  67.   else  system_error();
  68. }
  69.  
  70. if(isset($_POST['valider'])) {
  71.   $table[0]=$_POST['biblio_author'];
  72.   $table[1]=$_POST['biblio_title'];
  73.   $table[2]=$_POST['biblio_sub_title'];
  74.   $table[3]=$_POST['biblio_editor'];
  75.   $table[4]=$_POST['biblio_published_date'];
  76.   $table[5]=0// range
  77.  
  78.   $integrity=$resources_object->CheckDataIntegrity($table,'BIBLIO');
  79.  
  80.   if(is_string($integrity)) {
  81.     $text_format='2FIELD';
  82.   else {
  83.     $text_format='2HTML';
  84.   }
  85.   $form_author=formatText($_POST['biblio_author']$text_format);
  86.   $form_title=formatText($_POST['biblio_title']$text_format);
  87.   $form_sub_title=formatText($_POST['biblio_sub_title']$text_format);
  88.   $form_editor=formatText($_POST['biblio_editor']$text_format);
  89.   $form_published_date=formatText($_POST['biblio_published_date']$text_format);
  90.  
  91.   $table=urlencode(serialize($table));
  92. }
  93.  
  94.  
  95. include_once(THEME_ADMIN_PATH."quickicons.php");
  96.  
  97. ?>
  98.  
  99. <?php
  100. if(!isset($integrity|| is_string($integrity)) {
  101.   ?>
  102. <div class="contentcontainer"><?php
  103. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  104. ?>
  105. <div id="content"><?php
  106. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  107. ?>
  108. <h2><?php echo formatTitleh2($current_title)?></h2>
  109. <form id="addbiblio" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  110.     <p>
  111.         <label for="biblio_author"><?php echo mb_ucfirst(_t('resources','biblio_author'))?> : *</label>
  112.         <input name="biblio_author" type="text" class="textfield" id="biblio_author" maxlength="200" value="<?php echo $form_author?>" />
  113.     </p>
  114.     <p>
  115.         <label for="biblio_title"><?php echo mb_ucfirst(_t('resources','biblio_title'))?> : *</label>
  116.         <input name="biblio_title" type="text" class="textfield" id="biblio_title" maxlength="255" value="<?php echo $form_title?>" />
  117.     </p>
  118.     <p>
  119.         <label for="biblio_sub_title"><?php echo mb_ucfirst(_t('resources','biblio_sub_title'))?> : </label>
  120.         <input name="biblio_sub_title" type="text" class="textfield" id="biblio_sub_title" maxlength="255" value="<?php echo $form_sub_title?>" />
  121.     </p>
  122.     <p>
  123.         <label for="biblio_editor"><?php echo mb_ucfirst(_t('resources','biblio_editor'))?> : </label>
  124.         <input name="biblio_editor" type="text" class="textfield" id="biblio_editor" maxlength="255" value="<?php echo $form_editor?>" />
  125.     </p>
  126.     <p>
  127.         <label for="biblio_published_date"><?php echo mb_ucfirst(_t('resources','biblio_published_date'))?> : </label>
  128.         <input name="biblio_published_date" type="text" class="textfield" id="biblio_published_date" maxlength="100"     value="<?php echo $form_published_date?>" />
  129.     </p>
  130.     <div>
  131.         <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  132.         <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  133.         <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  134.         <input name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  135.         <?php echo cancel_button($cancel_link)?>
  136.         <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  137.     </div>
  138. </form>
  139. </div>
  140. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>
  141. <?php
  142. // Récapitulatif
  143. else    {
  144.  
  145.   $display_sub_title=empty_none($form_sub_title);
  146.   $display_editor=empty_none($form_editor);
  147.   $display_published_date=empty_none($form_published_date);
  148.  
  149.  
  150.   ?>
  151. <div class="contentcontainer"><?php
  152. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  153. ?>
  154. <div id="content">
  155. <h2><?php echo formatTitleh2(_t('recap','title'))?></h2>
  156. <?php
  157. echo "<dl class=\"summary\">\n";
  158. echo "<dt>".mb_ucfirst(_t('resources','biblio_author'))." :</dt>\n";
  159. echo "<dd>".$form_author."</dd>\n";
  160. echo "<dt>".mb_ucfirst(_t('resources','biblio_title'))." :</dt>\n";
  161. echo "<dd>".$form_title."</dd>\n";
  162. echo "<dt>".mb_ucfirst(_t('resources','biblio_sub_title'))." :</dt>\n";
  163. echo "<dd>".$display_sub_title."</dd>\n";
  164. echo "<dt>".mb_ucfirst(_t('resources','biblio_editor'))." :</dt>\n";
  165. echo "<dd>".$display_editor."</dd>\n";
  166. echo "<dt>".mb_ucfirst(_t('resources','biblio_published_date'))." :</dt>\n";
  167. echo "<dd>".$display_published_date."</dd>\n";
  168. echo "</dl>\n";
  169. ?>
  170. <form id="addbiblio" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  171.     <div>
  172.         <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  173.         <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  174.         <input name="type" type="hidden" value="<?php echo $type?>" id="type" />
  175.         <input name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  176.         <input name="data_table" type="hidden" value="<?php echo $table?>" id="data_table" />
  177.         <?php echo cancel_button($cancel_link)?>
  178.         <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  179.         <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="valider" />
  180.     </div>
  181. </form>
  182. </div>
  183. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>
  184. <?php
  185. }
  186. ?>

Documentation generated on Thu, 20 Mar 2014 16:45:55 +0100 by phpDocumentor 1.4.1