diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index 64fbbf99c..a50c93c45 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -5075,5 +5075,30 @@ VAT_Code.prototype.select_value=function(vx_code)
}
}
+VAT_Code.prototype.filter_country=function()
+{
+ try {
+ var to_show="country"+id$("filter_country").value;
+ console.debug(`show ${to_show}`)
+ let a_row=id$("code_vatex_tb").rows;
+ // show all rows, then hide
+ for (let i=1;i< a_row.length;i++) {
+
+ if (id$("filter_country").value == 0 || a_row[i].hasClassName(to_show)){
+ a_row[i].show()
+ console.debug(`show row ${i}`)
+
+ }else {
+ a_row[i].hide()
+ console.debug(`hide row ${i}`)
+ }
+ }
+
+ }catch (e)
+ {
+ console.error(e.message);
+ return false;
+ }
+}
noalyss=new Noalyss();
diff --git a/include/ajax/ajax_search_vatex.php b/include/ajax/ajax_search_vatex.php
index 90adebd69..ce8bdd38b 100644
--- a/include/ajax/ajax_search_vatex.php
+++ b/include/ajax/ajax_search_vatex.php
@@ -37,8 +37,6 @@ if ($select_code == "")
{
require_once NOALYSS_TEMPLATE."/ajax-search_vatex.php";
-
-
return;
}
@@ -53,7 +51,7 @@ if ($select_code != "")
if ( ! empty ($row))
{
$answer['vx_code']=$row['vx_code'];
- $answer['vx_value']=$row['vx_code'];
+ $answer['vx_value']=Icon_Action::trash(uniqid(),"vat_code.select_value('xx')").$row['vx_code'];
$answer['vx_description']=$row['vx_description'].span($row['vx_remark'],' class="text-muted" ');
}else {
$answer['vx_code']=$answer['vx_value']=$answer['vx_description']="";
diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php
index 316660b33..51c9f8415 100755
--- a/include/lib/html_input.class.php
+++ b/include/lib/html_input.class.php
@@ -1011,6 +1011,30 @@ class HtmlInput
return $sel;
}
}
+ /**
+ * @brief filter the rows in a table and keep the colored row in alternance
+ * @param dom_id $p_table_id table
+ * @param string $p_col , column to search example 0,1,2
+ * @param int $start_row row to always keep (header)
+ * @param string $p_name name of the input field
+ * @param string $domid domid containing the second filter, it could be an HIDDEN, TEXT, SELECT field
+ * @return string HTML
+ */
+ static function filter_table_DOM($p_table_id, $p_col, $start_row, $p_name
+ ,$domid)
+ {
+
+ $r="
+
+
+
+
+
+ ";
+ $r.=' ';
+ return $r;
+ }
+
/**
* @brief filter the rows in a table and keep the colored row in alternance
* @param dom_id $p_table_id table
diff --git a/include/lib/ibutton.class.php b/include/lib/ibutton.class.php
index 18fdb7a00..761fa6aae 100644
--- a/include/lib/ibutton.class.php
+++ b/include/lib/ibutton.class.php
@@ -105,15 +105,15 @@ class ISmallButton extends IButton
$extra= ( isset($this->extra))?$this->extra:"";
$this->id=($this->id=="")?$this->name:$this->id;
$tab=(isset($this->tabindex))?' tabindex="'.$this->tabindex.'"':"";
+ $attr=$this->get_node_attribute();
+
$r='extra.
$tab.
' id="'.$this->id.'"'.
' value="'.$this->label.'"'.
- ' onClick="'.$this->javascript.'"'.$extra.'>';
- $attr=$this->get_js_attr();
- $r.=$attr;
+ ' onClick="'.$this->javascript.'"'.$extra." $attr ".'>';
return $r;
}
diff --git a/include/template/ajax-search_vatex.php b/include/template/ajax-search_vatex.php
index d38b4cbc0..7c021ac55 100644
--- a/include/template/ajax-search_vatex.php
+++ b/include/template/ajax-search_vatex.php
@@ -26,8 +26,21 @@
echo \HtmlInput::title_box(_("Choix VATEX"), $dgbox);
$a_vatex_code = $cn->get_array("select vx_code,vx_code_name,vx_description,vx_remark , vx_country from vatex_code order by 1");
$nb_vatex_code = count($a_vatex_code);
-print HtmlInput::filter_table('code_vatex_tb', '0,1,2,3', 1);
+
+
+//@var $os_country (ISELECT) filter table by country
+$os_country=new \ISelect("filter_country");
+$os_country->transform(array(
+ "countryeu"=>"Europe",
+ ""=>_("Tous"),
+ "countryfr"=>"France"
+ )
+ );
+$os_country->javascript=' onchange="vat_code.filter_country()" ';
?>
+
+=$os_country->input()?>
+=HtmlInput::filter_table_DOM('code_vatex_tb', '0,1,2,3', 1,'search_vatex','filter_country')?>
|
@@ -44,24 +57,12 @@ print HtmlInput::filter_table('code_vatex_tb', '0,1,2,3', 1);
|
-
- |
-
- = _("Aucun code") ?>
-
- |
-
- |
-
-
- = _("Effacer le code VATEX") ?>
-
- |
-
|
@@ -93,3 +94,4 @@ print HtmlInput::filter_table('code_vatex_tb', '0,1,2,3', 1);
= \HtmlInput::button_close($dgbox) ?>
+
\ No newline at end of file
|