noalyss Version-9
irelated_action.class.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
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief Html Input
24 * - name is the name and id of the input
25 */
26
27/*!
28 * \class IRelated_Action
29 * \brief Html Input
30 * - name is the name and id of the input
31 */
33{
34
35 public function __construct($p_name='',$p_value='')
36 {
37 $this->name=$p_name;
38 $this->value=$p_value;
39 $this->amount_id=null;
40 $this->paid='';
41 $this->id=$p_name;
42 }
43 /*!\brief show the html input of the widget*/
44 public function input($p_name=null,$p_value=null)
45 {
46 $this->name=($p_name==null)?$this->name:$p_name;
47 $this->value=($p_value==null)?$this->value:$p_value;
48 if ( $this->readOnly==true) return $this->display();
49
50 $this->id=($this->id=="")?$this->name:$this->id;
51
52
53 $r=sprintf("
54 <INPUT class=\"smallbutton\" TYPE=\"button\" onClick=\"search_action(".dossier::id().",'%s')\" value=\"?\">
55 <INPUT TYPE=\"text\" style=\"color:black;background:lightyellow;border:solid 1px grey;\" NAME=\"%s\" ID=\"%s\" VALUE=\"%s\" SIZE=\"8\" readonly>
56 <INPUT class=\"smallbutton\" TYPE=\"button\" onClick=\"$('%s').value=''\" value=\"X\">
57
58 ",
59 $this->id,
60 $this->name,
61 $this->id,
62 $this->value,
63 $this->id
64 );
65 return $r;
66 }
67 /*!\brief print in html the readonly value of the widget*/
68 public function display()
69 {
70 $r=sprintf("<span><b>%s</b></span>",$this->value);
71 $r.=sprintf('<input type="hidden" name="%s" value="%s">', $this->name,$this->value);
72 return $r;
73
74 }
75 static public function test_me()
76 {
77 }
78}
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$from_poste name
$input_from id
Definition: balance.inc.php:63
class widget This class is used to create all the HTML INPUT TYPE and some specials which works with ...
$icard readOnly
$iconcerned amount_id