noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
cfgfiche.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu
20/*! \file
21 * \brief module to manage the card (removing, listing, creating, modify attribut)
22 */
23if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
24require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
25require_once NOALYSS_INCLUDE.'/lib/user_menu.php';
26global $http;
27
28$retour=HtmlInput::button_anchor("Retour à la liste", HtmlInput::get_to_string(array("gDossier","ac")));
29$action=$http->post('action',"string", '');
30/*******************************************************************************************/
31// Try to remove a category
32/*******************************************************************************************/
33if ( $action == 'remove_cat' )
34{
35 $post_id=$http->request("fd_id","number");
36 if ($post_id == 0 || $post_id >= 500000)
37 {
38 alert(_('Impossible d\'enlever cette catégorie'));
39 } else {
40 $fd_id=new Fiche_Def($cn,$post_id);
41 $remains=$fd_id->remove();
42 if ( $remains != 0 ) {
43 /* some card are not removed because it is used */
44 alert(_('Impossible d\'enlever cette catégorie, certaines fiches sont encore utilisées'."\n".
45 'Les fiches non utilisées ont cependant été effacées'));
46 }
47 }
48 $fiche_def=new Fiche_def($cn);
49 $fiche_def->display();
50 return;
51}
52/*******************************************************************************************/
53// Change some basis info
54/*******************************************************************************************/
55if ( isset ($_POST['change_name']))
56{
57 $fiche_def=new Fiche_Def($cn,$http->request('fd_id','number'));
58
59 $label=$http->request("nom_mod");
60 $fiche_def->SaveLabel($label);
61 if ( isset($_REQUEST['create']))
62 {
63 $fiche_def->set_autocreate(true);
64 }
65 else
66 {
67 $fiche_def->set_autocreate(false);
68 }
69 $fiche_def->save_class_base($http->request('class_base'));
70 $fiche_def->save_description($http->request('fd_description'));
71
72 echo $fiche_def->input_detail();
73 echo $retour;
74 return;
75}
76
77/*******************************************************************************************/
78// Save a new category of card
79/*******************************************************************************************/
80if ( isset($_POST['add_modele']))
81{
82 $single=new Single_Record("dup");
83 if ($single->get_count()==0)
84 {
85 $single->save();
87 /**
88 * Check if we have all needed information
89 */
90 if ( $fiche_def->Add($_POST) == 0 )
91 {
92 echo $fiche_def->input_detail();
93 echo $retour;
94 return;
95 }
96 else
97 {
98 $fiche_def->input_new();
99 echo $retour;
100 return;
101 }
102 }
103 else
104 {
105 alert(_('Doublon'));
106 }
107}
108$fiche_def_id=$http->request("fd","number",0);
109$fiche_def=new Fiche_def($cn);
110if ( $fiche_def_id != 0 ){
112 $fiche_def->load();
113 echo $fiche_def->input_detail();
114} elseif ($fiche_def_id == 0)
115{
116 $fiche_def->display();
117
118}
119?>
alert($p_msg, $buffer=false)
alert in javascript
$retour
$_REQUEST['ac']
_("actif, passif,charge,...")
$fiche_def
if( $action=='remove_cat') if(isset( $_POST[ 'change_name'])) if(isset($_POST['add_modele'])) $fiche_def_id
define Class fiche and fiche def, those class are using class attribut
Objec to check a double insert into the database, this duplicate occurs after a refresh of the web pa...
$_POST['ac']
Definition do.php:312
$fd_id
if( $delta< 0) elseif( $delta==0)