49 $this->
value=$p_value;
69 public function input($p_name=
null,$p_value=
null)
71 foreach (array(
'type',
'cn') as
$a)
73 if ( ! isset ($this->$a) )
throw new Exception(
'Variable non définie [ '.
$a.
']');
75 $this->
name=($p_name==
null)?$this->
name:$p_name;
76 $this->
value=($p_value==
null)?$this->
value:$p_value;
82 $sql_closed=
"where p_closed=true and p_central = false ";
85 $sql_closed=
"where p_closed=false";
88 $sql_closed=
"where p_closed=true and p_central = false ";
94 throw new Exception(
"invalide p_type in ".__FILE__.
':'.__LINE__);
96 $sql=
"select p_id,to_char(p_start,'DD.MM.YYYY') as p_start_string,
97 to_char(p_end,'DD.MM.YYYY') as p_end_string
107 if ( $this->exercice==
'')
109 if (! isset($this->
user) )
throw new Exception (__FILE__.
':'.__LINE__.
' user is not set');
110 $this->exercice=$this->
user->get_exercice();
114 if ( $sql_closed==
"") $and=
" where " ;
else $and=
" and ";
115 if ($this->
type ==
'all' ) $cond=$and.
' true ';
116 $cond.=
" $and p_exercice='".sql_string($this->exercice).
"'";
119 $sql.=$cond.
" order by p_start,p_end";
123 if (
$Max == 0 )
throw new Exception(_(
'Aucune periode trouvée'),1);
124 $ret=sprintf(
'<SELECT NAME="%s" id="%s" %s>',
131 $l_line=$this->
cn->fetch(
$i);
132 if ( $this->
value==$l_line[
'p_id'] )
139 $ret.=sprintf(
'<OPTION VALUE="%s" %s>%s - %s',$l_line[
'p_id']
141 ,$l_line[
'p_start_string']
142 ,$l_line[
'p_end_string']);
146 $ret.=sprintf(
'<OPTION VALUE="%s" %s>%s ',$l_line[
'p_id']
148 ,$l_line[
'p_start_string']
153 $ret.=sprintf(
'<OPTION VALUE="%s" %s>%s ',$l_line[
'p_id']
155 ,$l_line[
'p_end_string']
168 $r=
"not implemented ".__FILE__.
":".__LINE__;
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$input_from show_end_date
$input_to show_start_date
Generate the form for the periode Data Members.
display()
print in html the readonly value of the widget
__construct($p_name="", $p_value="", $p_exercice='')
input($p_name=null, $p_value=null)
show the input html for a periode