22if (!defined(
'ALLOWED'))
23 die(
'Appel direct ne sont pas permis');
34require_once NOALYSS_INCLUDE.
'/database/poste_analytique_sql.class.php';
40 parent::__construct($p_table);
54 $this->a_select[
"ga_id"]=
$cn->make_array(
"select '-','-' union all select ga_id,ga_id||' '||ga_description
55 from groupe_analytique
58 order by 2",0,array($p_table->pa_id));
60 [
"value"=>
"1",
"label"=>_(
"Actif")],
61 [
"value"=>
"0",
'label'=>_(
"Inactif")]
81 if (
$cn->get_value(
"select count(*) from poste_analytique where pa_id=$1 and po_name=upper($2) and po_id != $3",
85 $this->
set_error(
"po_name", _(
"Le nom doit être unique dans un plan analytique"));
89 if (trim(
$table->po_name)==
"") {
91 $this->
set_error(
"po_name", _(
"Le nom ne peut être vide"));
94 if ($is_error==0)
return TRUE;
105 $count=
$cn->get_value(
"select count(*) from public.operation_analytique where po_id=$1",[$p_row[
"po_id"]]);
106 $p_row[
"po_name"]=sprintf(
"%s (%d)",$p_row[
'po_name'],
$count);
107 parent::display_row($p_row);
115 $count_closed=
$cn->get_value(
" select count(*)
117 join jrn jn1 on (jx1.j_grpt = jn1.jr_grpt_id )
118 join jrn_def as jf1 on (jn1.jr_def_id =jf1.jrn_def_id )
119 join jrn_periode as je1 on (jf1.jrn_def_id =je1.jrn_def_id )
120 join operation_analytique as oa on (oa.j_id =jx1.j_id )
122 je1.status = 'CL' and oa.po_id=$1 ",[$this->
table->po_id]);
123 if ( $count_closed > 0 ) {
124 throw new \Exception(_(
"Effacement impossible : le poste est utilisé dans une période fermée"));
126 $cn->exec_sql(
"delete from public.poste_analytique where po_id=$1",[$this->
table->po_id]);
noalyss_str_replace($search, $replace, $string)
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
derived from Manage_Table_SQL ,
__construct(Data_SQL $p_table)
check()
Check and change po_name values.
display_row($p_row)
display a data row in the table, with the order defined in a_order and depending of the visibility of...
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
Purpose is to propose a librairy to display a table content and allow to update and delete row ,...
set_col_sort($p_num)
When adding an element ,we place it thanks the DOM Attribute sort_value set it to -1 if you want one ...
set_property_updatable($p_key, $p_value)
set a column of the data row updatable or not
set_col_type($p_key, $p_value, $p_array=NULL)
set the type of a column , it will change in the input db box , the select must supply an array of po...
set_object_name($p_object_name)
Set the object_name.
set_property_visible($p_key, $p_value)
set a column of the data row visible or not
set_error($p_col, $p_message)
set the error message for a wrong input
set_col_label($p_key, $p_display)
set the name to display for a column