29require_once NOALYSS_INCLUDE.
'/constant.php';
30require_once NOALYSS_INCLUDE.
'/database/poste_analytique_sql.class.php';
44 $this->description=
"";
54 $sql=
"select pa_id as id,pa_name as name,".
55 "pa_description as description from plan_analytique $p_order";
58 if (
$array == FALSE )
return array();
64 if ( $this->
id==0)
return;
66 $sql=
"select pa_name,pa_description from plan_analytique where pa_id=$1";
67 $ret= $this->
db->exec_sql(
$sql,array($this->
id));
74 $this->description=
$a[
'pa_description'];
80 if ( $this->
id == 0 )
return;
81 $this->
db->exec_sql(
"delete from plan_analytique where pa_id=$1",array($this->
id));
86 if ( $this->
id==0)
return;
88 if ( strlen(
$name) == 0)
92 $this->
db->exec_sql(
"update plan_analytique set pa_name=$1,
99 if ( strlen(
$name) == 0)
101 if ( $this->
isAppend() ==
false)
return;
103 $this->
db->exec_sql(
"insert into plan_analytique(pa_name,pa_description)".
106 $this->
id=$this->
db->get_current_seq(
'plan_analytique_pa_id_seq');
112 $wName=
new IText(
'pa_name',$this->
name,
"pa_name");
114 $iName->set_callback(
"ajax_misc.php");
116 $iName->add_json_param(
"action",
"anc_updatedescription");
117 $iName->add_json_param(
"op",
"anc_updatedescription");
118 $iName->add_json_param(
"id",$this->
id);
121 $wDescription=
new IText(
'pa_description',$this->description,
"pa_description");
122 $wDescription->size=50;
123 if ( $this->description ==
"") $wDescription->value=_(
"Aucune description");
125 $iDescription->add_json_param(
"gDossier",
$dossier_id);
126 $iDescription->add_json_param(
"op",
"anc_updatedescription");
127 $iDescription->add_json_param(
"action",
"anc_updatedescription");
128 $iDescription->set_callback(
"ajax_misc.php");
129 $iDescription->add_json_param(
"id",$this->
id);
132 $wId=
new IHidden(
"pa_id",$this->
id);
134 $ret.=
'<tr>'.td(_(
'Nom')).
'<td>'.$iName->input().
'</td>'.
'</tr>';
135 $ret.=
"<tr>".td(_(
'Description')).
'<td>'.$iDescription->input().
'</td>'.
"</tr>";
145 $wName=
new IText(
"pa_name");
146 $wDescription=
new IText(
"pa_description");
147 $wDescription->size=80;
150 $ret.=
'<tr>'.td(_(
'Nom')).
'<td>'.$wName->input().
'</td>'.
'</tr>';
151 $ret.=
"<tr>".td(_(
'Description')).
'<td>'.$wDescription->input().
'</td>'.
"</tr>";
159 $count=$this->
db->get_value(
"select count(pa_id) from plan_analytique");
173 if ( empty(
$a_plan))
return "";
176 $res.=
"<th>".h($r_plan[
'name']).
"</th>";
182 $a=$this->
db->count_sql(
"select pa_id from plan_analytique");
187 $a=$this->
db->count_sql(
"select pa_id from plan_analytique where pa_id=$1",
188 array($this->
pa_id));
190 return (
$a==0)?
false:
true;
213 echo
"<h1>Plan analytique : test</h1>";
215 $cn->exec_sql(
"delete from plan_analytique");
219 $p->name=
"Nouveau 1";
220 $p->description=
"C'est un test";
223 $p->name=
"Nouveau 2";
227 $p->name=
"Nouveau 3";
232 $p->name=
"Nouveau 4";
239 echo
"<h2>Update</h2> ";
241 $p->description=
"c'est change";
245 echo
"<h2>get_list</h2>";
248 echo
"<h2>delete </h2>";
sql_string($p_string)
Fix the problem with the quote char for the database.
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
Concerns the Analytic plan (table plan_analytique)
static hidden($p_array)
return an HTML string containing hidden input type to hold the differant PA_ID
get_list($p_order=" order by pa_name")
get the list of all existing PA
__construct($p_cn, $p_id=0)
header()
show the header for a table for PA
static fetch_all($ret)
wrapper for the function pg_fetch_all
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
static id()
return the 'gDossier' value after a check
Inplace_edit class for ajax update of HtmlInput object.