noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
cfgfiche.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 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00020 /*! \file
00021  * \brief module to manage the card (removing, listing, creating, modify attribut)
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 // Add an attribut
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 // Remove an attribut
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 // Try to remove a category
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             /* some card are not removed because it is used */
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 // Change some basis info
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 // Save order of the attributes
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 // Save a new category of card
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 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations