Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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 ?>