38 parent::__construct($p_table);
46 $this->
set_col_label(
"ad_search_followup", _(
"Recherche suivi"));
54 [
"value"=>
"text",
"label"=>_(
"Texte")],
55 [
"value"=>
"date",
"label"=>_(
"Date")],
56 [
"value"=>
"numeric",
"label"=>_(
"Nombre")],
57 [
"value"=>
"select",
"label"=>_(
"Choix")],
58 [
"value"=>
"card",
"label"=>_(
"Fiche")],
59 [
"value"=>
"zone",
"label"=>_(
"Zone de texte")],
60 [
"value"=>
"check",
"label"=>_(
"Coche")],
61 [
"value"=>
"poste",
"label"=>_(
"Poste comptable")]
66 $this->
set_order([
'ad_id',
'ad_text',
"ad_type",
"ad_default_order",
"ad_size",
"ad_extra",
"ad_search_followup"]);
76 tracedebug(
"card_attribute.log",
$row);
77 if (
$row[
'ad_id']>=9000)
88 parent::display_row(
$row);
102 if ($p_key==
"ad_search_followup")
105 $ic->set_callback(
"ajax_misc.php");
106 $ic->add_json_param(
"op",
"card");
107 $ic->add_json_param(
"gDossier", $this->dossier_id);
108 $ic->add_json_param(
"op2",
"attribute");
109 $ic->add_json_param(
"action",
"enable_search");
110 $ic->add_json_param(
"ad_id",
$p_id);
111 $ic->add_json_param(
"ctl",
$p_id);
116 if ($p_key==
"ad_text")
120 if ($p_key==
"ad_extra")
138 if ($p_key==
"ad_search_followup")
141 $ic=
new InputSwitch(
"ad_search_followup", $p_value);
144 elseif ($p_key==
"ad_text")
153 elseif ($p_key==
"ad_extra")
167 if ($object_sql->get(
"ad_id")<9000&&$object_sql->get(
"ad_id")!=-1)
176 upper(trim(ad1.ad_text)) = upper(trim($1))
179 $count_duplicate=$object_sql->cn->get_value(
$count, [$object_sql->ad_text, $object_sql->ad_id]);
180 if ($count_duplicate>0)
182 $this->
set_error(
"ad_text", _(
"Doublon"));
185 if (in_array($object_sql->get(
"ad_type"),
186 array(
'date',
'text',
'numeric',
'zone',
'poste',
'card',
'select',
'check'))==
false)
188 $this->
set_error(
"ad_type", _(
"Type invalide"));
192 if (trim($object_sql->ad_text)==
"")
194 $this->
set_error(
"ad_text", _(
"Description ne peut pas être vide"));
197 if ($object_sql->ad_size==
"")
199 $object_sql->ad_size=22;
201 if ($object_sql->ad_type==
'numeric')
203 $object_sql->ad_extra=(trim($object_sql->ad_extra)==
'')?
'2':$object_sql->ad_extra;
206 $this->
set_error(
"ad_text", _(
"La précision doit être un chiffre"));
210 if ($object_sql->ad_type==
'select')
212 if (trim($object_sql->ad_extra)==
"")
215 $this->
set_error(
"ad_extra", _(
"La requête SQL est vide "));
217 if (preg_match(
'/^\h*select/i', $object_sql->ad_extra)==0)
219 $this->
set_error(
"ad_extra", _(
"La requête SQL doit commencer par SELECT "));
222 if ( $object_sql->ad_default_order < 11 || $object_sql->ad_default_order > 9998) {
223 $this->
set_error(
"ad_default_order",_(
"Valeur entre 11 et 9998"));
236 if ($object_sql->getp(
"ad_id")<9000)
238 throw new Exception(_(
"Effacement bloqué"));
245 $sql=$db->exec_sql(
"delete from fiche_detail where ad_id=$1 ", array($object_sql->ad_id));
247 $sql=
"delete from jnt_fic_attr where ad_id=$1";
248 $res=$db->exec_sql(
$sql, array($object_sql->ad_id));
250 $sql=
"delete from attr_def where ad_id=$1";
251 $res=$db->exec_sql(
$sql, array($object_sql->ad_id));
253 $object_sql=$this->
get_table()->delete();
256 catch (Exception
$ex)
259 throw new Exception(_(
"Effacement bloqué : attribut utilisé"));
td($p_string='', $p_extra='')
surround the string with td
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
manage the table attr_def
input_custom($p_key, $p_value)
For the type custom , we can call a function to display properly the value.
__construct(\Data_SQL $p_table)
display_row_custom($p_key, $p_value, $p_id=0)
For the type custom , we can call a function to display properly the value.
display_row($row)
Display row of table attr_def.
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.
A switch let you switch between 2 values : 0 and 1, it is used to replace the check.
Purpose is to propose a librairy to display a table content and allow to update and delete row ,...
count_error()
returns the nb of errors found
set_delete_row($p_value)
Enable or disable the deletion of rows.
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_tips($p_key, $p_comment)
Set the info for a column, use Icon_Action::infobulle the message are in message_javascript....
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_update_row($p_value)
Enable or disable the updating of rows.
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
if( $delta< 0) elseif( $delta==0)