noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
cat_document.inc.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief this file is included to perform modification on category of document
00024  * table document_type
00025  */
00026 
00027 // show list of document
00028 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00029 require_once ('class_document_type.php');
00030 
00031 if ( isset($_POST['add']) )
00032 {
00033     $catDoc=new Document_Type($cn);
00034     $catDoc->insert($_POST['cat'],$_POST['prefix']);
00035 }
00036 if ( isset($_POST['save'])) {
00037         $catDoc=new Document_Type($cn,$_POST['dt_id']);
00038         $catDoc->get();
00039         $catDoc->dt_value=trim($_POST['dt_name']);
00040         $catDoc->dt_prefix=trim($_POST['dt_prefix']);
00041         if ( $catDoc->dt_value=="") {
00042                 alert(_("Le nom ne peut pas ĂȘtre vide"));
00043         } else {
00044                 $catDoc->update();
00045         }
00046         if ($_POST['seq'] != 0 && isNumber($_POST['seq'])==1){
00047                 $catDoc->set_number($_POST['seq']);
00048         }
00049 }
00050 $aList=Document_Type::get_list($cn);
00051 $addCat=new IText('cat');
00052 $addPrefix=new IText('prefix');
00053 $str_addCat=$addCat->input();
00054 $str_addPrefix=$addPrefix->input();
00055 $str_submit=HtmlInput::submit('add',_('Ajout'));
00056 echo '<div class="content">';
00057 require_once('template/list_category_document.php');
00058 echo '</div>';
00059 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations