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

Documentation generated on Fri, 16 Oct 2009 09:28:15 +0200 by phpDocumentor 1.4.1