22require_once NOALYSS_INCLUDE.
'/database/form_detail_sql.class.php';
38 parent::__construct($p_table);
54 $max=
$cn->get_value(
"select coalesce(max(fo_pos),0) +10 from form_detail where fo_fr_id=$1",
56 $form_detail->setp(
"fo_pos",
$max);
59 $acc_report_mtable->set_order([
'fo_pos',
'fo_label',
'fo_formula']);
61 $acc_report_mtable->set_col_label(
"fo_pos", _(
"Position"));
62 $acc_report_mtable->set_col_label(
"fo_label", _(
"Libellé"));
63 $acc_report_mtable->set_col_label(
"fo_formula", _(
"Formula"));
64 $acc_report_mtable->set_form_definition_id($p_form_def_id);
66 $acc_report_mtable->set_sort_column(
"fo_pos");
68 $acc_report_mtable->set_col_type(
"fo_pos",
"numeric");
69 $acc_report_mtable->set_col_type(
"fo_formula",
"custom");
70 $acc_report_mtable->set_col_tips(
"fo_formula", 79);
72 $acc_report_mtable->add_json_param(
"form_def", $p_form_def_id);
73 $acc_report_mtable->add_json_param(
"op",
"report_definition");
74 $acc_report_mtable->set_callback(
"ajax_misc.php");
76 return $acc_report_mtable;
91 if ($p_key==
'fo_formula')
94 $formula->id=
'fo_formula';
95 $formula->value=$p_value;
96 echo $formula->input();
99 sprintf(
'search_account_card({gDossier:%s,target:\'%s\'})',
Dossier::id(),
108 if ($p_key==
'fo_formula')
123 $obj->setp(
"fo_fr_id",$this->form_definition_id);
126 $this->
set_error(
"fo_formula", _(
"Formule invalide"));
130 if ( trim(
$obj->getp(
"fo_label")) ==
"") {
132 $this->
set_error(
"fo_label",_(
"Nom est vide"));
135 if ($n == 0 ) {
return true; }
td($p_string='', $p_extra='')
surround the string with td
display_table($p_order="", $p_array=NULL)
display the data of the table
input_custom($p_key, $p_value)
this function let you create your own input , for example for a ITEXT , a IRADIO ,...
static build($p_id, $p_form_def_id)
build an object Acc_Report_MTable
display_row_custom($p_key, $p_value, $p_id=0)
When displaying a row, if a column has the type "custom" , we can call this function to display prope...
__construct(\Data_SQL $p_table)
set_form_definition_id($form_definition_id)
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
static id()
return the 'gDossier' value after a check
Manage the TEXTAREA html element.
static check_formula($p_string)
Purpose is to propose a librairy to display a table content and allow to update and delete row ,...
set_error($p_col, $p_message)
set the error message for a wrong input