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 (!function_exists('AuthenthificationProcess')) {
  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 (!hasRight('publication')) ReloadIndex('admin');
  29.   if (GetSessionElement('id')!=$publi_owner && !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 (!hasRight('workshop')) ReloadIndex('admin');
  40.   if (!AuthUser4Workshop($workshop_id$sql_object&& !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>
  48.     </li>
  49.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  50.         class="chemin_rub"><?php echo _t('menu',$mod_inc)?></a></li>
  51.     <li><span><?php echo formatNavTitle(_t('resources',$mod_inc.'_type')." : "$current_title)?></span>
  52.     </li>
  53. </ul>
  54. </div>
  55. <!--end barre haute -->
  56. <?php
  57. $form_author='';
  58. $form_title='';
  59. $form_sub_title='';
  60. $form_editor='';
  61. $form_published_date='';
  62.  
  63. $resources_objectnew resources;
  64.  
  65. if(isset($_POST['enregistrer'])) {
  66.   $data_table=unserialize(urldecode($_POST['data_table']));
  67.   $result=$resources_object->AddBiblioRes($parent$data_table$complete_type$sql_object);
  68.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&type=".$type."&id=".$parent;
  69.   if($result===trueheader("Location: ".$link_confirm);
  70.   else  system_error();
  71. }
  72.  
  73. if(isset($_POST['valider'])) {
  74.   $table[0]=$_POST['biblio_author'];
  75.   $table[1]=$_POST['biblio_title'];
  76.   $table[2]=$_POST['biblio_sub_title'];
  77.   $table[3]=$_POST['biblio_editor'];
  78.   $table[4]=$_POST['biblio_published_date'];
  79.   $table[5]=0// range
  80.  
  81.   $integrity=$resources_object->CheckDataIntegrity($table,'BIBLIO');
  82.  
  83.   if(is_string($integrity)) {
  84.     $text_format='2FIELD';
  85.   else {
  86.     $text_format='2HTML';
  87.   }
  88.   $form_author=formatText($_POST['biblio_author']$text_format);
  89.   $form_title=formatText($_POST['biblio_title']$text_format);
  90.   $form_sub_title=formatText($_POST['biblio_sub_title']$text_format);
  91.   $form_editor=formatText($_POST['biblio_editor']$text_format);
  92.   $form_published_date=formatText($_POST['biblio_published_date']$text_format);
  93.  
  94.   $table=urlencode(serialize($table));
  95. }
  96.  
  97.  
  98. include_once(THEME_ADMIN_PATH."quickicons.php");
  99.  
  100. ?>
  101.  
  102. <?php
  103. if(!isset($integrity|| is_string($integrity)) {
  104.   ?>
  105. <div class="contentcontainer"><?php
  106. include_once($dir."/menurub.php");
  107. ?>
  108. <div id="content"><?php
  109. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  110. ?>
  111. <h2><?php echo formatTitleh2($current_title)?></h2>
  112. <form id="addbiblio" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  113.     method="post">
  114. <p><label for="biblio_author"><?php echo _t('resources','biblio_author')?>
  115. : *</label> <input name="biblio_author" type="text" class="textfield"
  116.     id="biblio_author" maxlength="200" value="<?php echo $form_author?>" />
  117. </p>
  118. <p><label for="biblio_title"><?php echo _t('resources','biblio_title')?>
  119. : *</label> <input name="biblio_title" type="text" class="textfield"
  120.     id="biblio_title" maxlength="255" value="<?php echo $form_title?>" />
  121. </p>
  122. <p><label for="biblio_sub_title"><?php echo _t('resources','biblio_sub_title')?>
  123. : </label> <input name="biblio_sub_title" type="text" class="textfield"
  124.     id="biblio_sub_title" maxlength="255"
  125.     value="<?php echo $form_sub_title?>" /></p>
  126. <p><label for="biblio_editor"><?php echo _t('resources','biblio_editor')?>
  127. : </label> <input name="biblio_editor" type="text" class="textfield"
  128.     id="biblio_editor" maxlength="255" value="<?php echo $form_editor?>" />
  129. </p>
  130. <p><label for="biblio_published_date"><?php echo _t('resources','biblio_published_date')?>
  131. : </label> <input name="biblio_published_date" type="text"
  132.     class="textfield" id="biblio_published_date" maxlength="100"
  133.     value="<?php echo $form_published_date?>" /></p>
  134. <div><input name="rub" type="hidden" value="<?php echo $rub?>"
  135.     id="rub" /> <input name="todo" type="hidden"
  136.     value="<?php echo $todo?>" id="todo" /> <input name="type"
  137.     type="hidden" value="<?php echo $type?>" id="type" /> <input
  138.     name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  139. <?php echo cancel_button($cancel_link)?> <input name="valider"
  140.     type="submit" value="<?php echo _t('btn','valid'?>" class="button"
  141.     id="valider" /></div>
  142. </form>
  143. </div>
  144. <?php include_once($dir."/help.php")?></div>
  145. <?php
  146. // Récapitulatif
  147. else    {
  148.  
  149.   $display_sub_title=empty_none($form_sub_title);
  150.   $display_editor=empty_none($form_editor);
  151.   $display_published_date=empty_none($form_published_date);
  152.  
  153.  
  154.   ?>
  155. <div class="contentcontainer"><?php
  156. include_once($dir."/menurub.php");
  157. ?>
  158. <div id="content">
  159. <h2><?php echo formatTitleh2(_t('recap','title'))?></h2>
  160. <?php
  161. echo "<dl class=\"dl3\">\n";
  162. echo "<dt>"._t('resources','biblio_author')."</dt>\n";
  163. echo "<dd>".$form_author."</dd>\n";
  164. echo "<dt>"._t('resources','biblio_title')."</dt>\n";
  165. echo "<dd>".$form_title."</dd>\n";
  166. echo "<dt>"._t('resources','biblio_sub_title')."</dt>\n";
  167. echo "<dd>".$display_sub_title."</dd>\n";
  168. echo "<dt>"._t('resources','biblio_editor')."</dt>\n";
  169. echo "<dd>".$display_editor."</dd>\n";
  170. echo "<dt>"._t('resources','biblio_published_date')."</dt>\n";
  171. echo "<dd>".$display_published_date."</dd>\n";
  172. echo "</dl>\n";
  173. ?>
  174. <form id="addbiblio" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  175.     method="post">
  176. <div><input name="rub" type="hidden" value="<?php echo $rub?>"
  177.     id="rub" /> <input name="todo" type="hidden"
  178.     value="<?php echo $todo?>" id="todo" /> <input name="type"
  179.     type="hidden" value="<?php echo $type?>" id="type" /> <input
  180.     name="parent" type="hidden" value="<?php echo $parent?>" id="parent" />
  181. <input name="data_table" type="hidden" value="<?php echo $table?>"
  182.     id="data_table" /> <?php echo cancel_button($cancel_link)?> <input
  183.     name="retour" type="button" value="<?php echo _t('btn','preview'?>"
  184.     class="button" id="retour" onclick="history.go(-1);" /> <input
  185.     name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>"
  186.     class="button" id="valider" /></div>
  187. </form>
  188. </div>
  189. <?php include_once($dir."/help.php")?></div>
  190. <?php
  191. }
  192. ?>

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