[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 49/73: Improve function display_row_custom fo
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 49/73: Improve function display_row_custom for the custom sort key see Sorttable.js |
Date: |
Fri, 28 May 2021 05:26:40 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit bef67faae967f536a3f68ca3bf60cde1ea9e6dce
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue May 4 19:28:52 2021 +0200
Improve function display_row_custom for the custom sort key
see Sorttable.js
---
include/lib/manage_table_sql.class.php | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/include/lib/manage_table_sql.class.php
b/include/lib/manage_table_sql.class.php
index ec897c6..5d3a5b8 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -80,7 +80,7 @@ class Manage_Table_SQL
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
- protected $sort_column; //!< javascript sort , if empty there is no js sort
+ protected $sort_column; //!< javascript sort on this column , if empty
there is no js sort
protected $dialog_box; //!< ID of the dialog box which display the result
of the ajax calls
protected $search_table; //!< boolean , by default true ,it is possible to
search in the table,
const UPDATABLE=1;
@@ -918,17 +918,20 @@ function check()
{
$js=sprintf("onclick=\"%s.input('%s','%s');\"",
$this->object_name,
$pk_id, $this->object_name);
- $td=($i == $this->col_sort ) ? sprintf('<td sort_value="X%s"
>',$p_row[$v]):"<td>";
+ $td=($i == $this->col_sort ) ? sprintf('<td
sorttable_customkey="X%s" >',$p_row[$v]):"<td>";
echo $td.HtmlInput::anchor($p_row[$v], "", $js).'</td>';
}
elseif ( $i == $this->col_sort && $this->get_property_visible($v) )
{
if ( $this->get_col_type($v) == 'text') {
- echo td($p_row[$v],sprintf(' sort_value="X%s"
',$p_row[$v]));
+ echo td($p_row[$v],sprintf(' sorttable_customkey="X%s"
',$p_row[$v]));
} elseif ( $this->get_col_type($v) == 'numeric') {
- echo td($p_row[$v],sprintf('class="num" sort_value="%s"
',$p_row[$v]));
- } else {
- echo td($p_row[$v],sprintf(' sort_value="X%s"
',$p_row[$v]));
+ echo td($p_row[$v],sprintf('class="num" ',$p_row[$v]));
+ } elseif ($this->get_col_type($v)=="custom") {
+ // For custom col
+ echo $this->display_row_custom($v,$p_row[$v],$pk_id);
+ }else {
+ echo td($p_row[$v],sprintf(' sorttable_customkey="X%s"
',$p_row[$v]));
}
}
@@ -966,7 +969,7 @@ function check()
}
} elseif ($this->get_col_type($v)=="custom") {
// For custom col
- echo td($this->display_row_custom($v,$p_row[$v],$pk_id));
+ echo $this->display_row_custom($v,$p_row[$v],$pk_id);
}
elseif ( $this->get_col_type($v)=="numeric") {
echo td($p_row[$v],' class="num" ');
@@ -986,7 +989,9 @@ function check()
echo '</tr>';
}
/**
- * For the type custom , we can call a function to display properly the
value
+ * @brief When displaying a row, if a column has the type "custom" , we
can call this function to display properly the value
+ * including the tag "<td>".
+ *
* @param $p_key string key name
* @param $p_value string value
* @param int $p_id id of the row (optional default 0)
@@ -996,7 +1001,7 @@ function check()
* @return string
*/
function display_row_custom($p_key,$p_value,$p_id=0) {
- return $p_value;
+ return td($p_value);
}
/**
* @brief display into a dialog box the datarow in order
- [Noalyss-commit] [noalyss] 06/73: Cosmetic, (continued)
- [Noalyss-commit] [noalyss] 06/73: Cosmetic, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 08/73: Warning if PHPVERSION < 7.2, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 10/73: Cosmetic : update fontello, button inplace_edit, doc, logo and dashboad, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 16/73: Currency : add a check , upgrade version of DB, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 24/73: Bug Select_Box = problem with DIV id, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 29/73: Cosmetic : display properly currency in detail operation, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 34/73: javascript : test and improve cosmetic, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 36/73: improve captcha, replace the global variable by a "DEFINE" constant, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 41/73: Cosmetic : Card History, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 47/73: Fix block problem with font, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 49/73: Improve function display_row_custom for the custom sort key see Sorttable.js,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 50/73: Improve Manage_Table_SQL, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 55/73: Manage_Table_SQL : typo, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 56/73: Output_HTML adapt to bootstrap navbar, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 57/73: Task #1807: Boutons indistincts – thème 7 classic, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 44/73: Cosmetic : width to large if recover passwd enable and icon trash not available for document (in operation detail), Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 28/73: Task #0001961: Devise : faciliter les calculs d'écarts de conversion, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 38/73: Task #1961 : Currency remove default currency, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 40/73: Cosmetic : add button_magnifier for searching, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 52/73: Code Rewriting : rename Noalyss_SQL class by Table_Data_SQL, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 53/73: Code Rewriting : rename Noalyss_SQL class by Table_Data_SQL, Dany De Bontridder, 2021/05/28