From d6c32d4db6c291b3bea5128ae2da92b43d01a2e8 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 10 Feb 2018 13:18:41 +0100 Subject: [PATCH] Manage_Table_SQL : Add tips for some col --- include/lib/manage_table_sql.class.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php index 80e04a9d6..24daa4b27 100644 --- a/include/lib/manage_table_sql.class.php +++ b/include/lib/manage_table_sql.class.php @@ -77,6 +77,7 @@ class Manage_Table_SQL protected $json_parameter; //!< Default parameter to add (gDossier...) protected $aerror; //!< Array containing the error of the input data protected $col_sort; //!< when inserting, it is the column to sort,-1 to disable it and append only + protected $a_info; //!< Array with the infotip const UPDATABLE=1; const VISIBLE=2; @@ -132,6 +133,18 @@ class Manage_Table_SQL function get_col_sort() { return $this->col_sort; } + /** + * Set the info for a column, use Icon_Action::infobulle + * the message are in message_javascript.php + * @param string $p_key Column name + * @param integer $p_comment comment idx + * + * @see message_javascript.php + * @see Icon_Action::infobulle() + */ + function set_col_tips($p_key,$p_comment) { + $this->a_info[$p_key]=$p_comment; + } /** * When adding an element ,we place it thanks the DOM Attribute sort_value * set it to -1 if you want one to append @@ -804,7 +817,12 @@ function check() if ($this->get_property_visible($key)===TRUE) { // Label - echo " {$label} {$error}"; + $info=""; + if ( isset($this->a_info[$key])) { + $info=Icon_Action::infobulle($this->a_info[$key]); + } + // Label + echo " {$label} {$info} {$error}"; if ($this->get_property_updatable($key)==TRUE) {