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 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00024 include_once ("ac_common.php");
00025 require_once("class_itext.php");
00026 require_once("class_ihidden.php");
00027 require_once('class_fiche.php');
00028 require_once('class_database.php');
00029 include_once ("user_menu.php");
00030 require_once('class_dossier.php');
00031 require_once 'class_sort_table.php';
00032 require_once 'class_fiche_def.php';
00033 require_once 'class_tool_uos.php';
00034
00035 $retour=HtmlInput::button_anchor("Retour à la liste", HtmlInput::get_to_string(array("gDossier","ac")));
00036
00037
00038
00039
00040 if ( isset($_POST['add_line']))
00041 {
00042 $fiche_def=new Fiche_Def($cn,$_REQUEST['fd_id']);
00043 $fiche_def->InsertAttribut($_REQUEST['ad_id']);
00044 echo $fiche_def->input_detail();
00045 echo $retour;
00046 return;
00047 }
00048
00049
00050
00051 if ( isset ($_POST['remove_line']))
00052 {
00053 $fiche_def=new Fiche_Def($cn,$_REQUEST['fd_id']);
00054 $fiche_def=new Fiche_Def($cn,$_REQUEST['fd_id']);
00055 $fiche_def->RemoveAttribut($_REQUEST['chk_remove']);
00056 echo $fiche_def->input_detail();
00057 echo $retour;
00058 return;
00059 }
00060
00061
00062
00063 if ( isset ($_POST['remove_cat']))
00064 {
00065 $post_id=HtmlInput::default_value_post('fd_id', 0);
00066 if ($post_id == 0 || $post_id >= 500000)
00067 {
00068 alert(_('Impossible d\'enlever cette catégorie'));
00069 } else {
00070 $fd_id=new Fiche_Def($cn,$post_id);
00071 $remains=$fd_id->remove();
00072 if ( $remains != 0 ) {
00073
00074 alert(_('Impossible d\'enlever cette catégorie, certaines fiches sont encore utilisées'."\n".
00075 'Les fiches non utilisées ont cependant été effacées'));
00076 }
00077 }
00078 }
00079
00080
00081
00082 if ( isset ($_POST['change_name']))
00083 {
00084 if (isset ($_REQUEST['label']) )
00085 {
00086 $fiche_def=new Fiche_Def($cn,$_REQUEST['fd_id']);
00087 $fiche_def->SaveLabel($_REQUEST['label']);
00088 if ( isset($_REQUEST['create']))
00089 {
00090 $fiche_def->set_autocreate(true);
00091 }
00092 else
00093 {
00094 $fiche_def->set_autocreate(false);
00095 }
00096 $fiche_def->save_class_base($_REQUEST['class_base']);
00097 $fiche_def->save_description($_REQUEST['fd_description']);
00098
00099 }
00100 echo $fiche_def->input_detail();
00101 echo $retour;
00102 return;
00103 }
00104
00105
00106
00107 if ( isset($_POST['save_line']))
00108 {
00109 $fiche_def=new Fiche_Def($cn,$_REQUEST['fd_id']);
00110 $fiche_def->save_order($_POST);
00111 echo $fiche_def->input_detail();
00112 echo $retour;
00113 return;
00114 }
00115
00116
00117
00118 if ( isset($_POST['add_modele']))
00119 {
00120 $single=new Tool_Uos("dup");
00121 if ($single->get_count()==0)
00122 {
00123 $single->save();
00124 $fiche_def=new Fiche_Def($cn);
00125 if ( $fiche_def->Add($_POST) == 0 )
00126 {
00127 echo $fiche_def->input_detail();
00128 echo $retour;
00129 return;
00130 }
00131 else
00132 {
00133 $fiche_def->input_new();
00134 echo $retour;
00135 return;
00136 }
00137 }
00138 else
00139 {
00140 alert('Doublon');
00141 }
00142 }
00143 $fiche_def=new Fiche_def($cn);
00144
00145 $fiche_def->Display();
00146 $dossier=Dossier::id();
00147 ?>