From 27f5673f2d8af5b411ee191b8b02308596c1c00e Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 22 Jul 2019 21:22:16 +0200 Subject: [PATCH] Bug : card cannot use a attribute of the type "card", reason : the query was wrong and there were a confusion between this->name and this->id in "get_js_attr()" --- include/class/fiche.class.php | 4 ++-- include/lib/html_input.class.php | 2 +- sql/upgrade.sql | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php index 647b19b95..3d59b9e90 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -654,7 +654,7 @@ class Fiche $w->extra=$filter; $w->extra2=0; $label=new ISpan(); - $label->name="av_text".$uniq.$r->ad_id."_label"; + $label->name="av_text".$r->ad_id.$uniq."_label"; $fiche=new Fiche($this->cn); $fiche->get_by_qcode($r->av_text); if ($fiche->id==0) @@ -670,7 +670,7 @@ class Fiche } $w->set_attribute('ipopup', 'ipopcard'); $w->set_attribute('typecard', $filter); - $w->set_attribute('inp', "av_text".$r->ad_id); + $w->set_attribute('inp', $w->id); $w->set_attribute('label', $label->name); $w->autocomplete=0; $w->dblclick="fill_ipopcard(this);"; diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index 3fffb05af..d3a605895 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -139,7 +139,7 @@ class HtmlInput for ($i=0; $iattribute); $i++) { list($name, $value)=$this->attribute[$i]; - $tmp1=sprintf("$('%s').%s='%s';", $this->name, $name, $value); + $tmp1=sprintf("$('%s').%s='%s';", $this->id, $name, $value); $attr.=$tmp1; } $attr=create_script($attr); diff --git a/sql/upgrade.sql b/sql/upgrade.sql index e69de29bb..2abcfb5bf 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -0,0 +1 @@ +update attr_def set ad_extra = '[sql] fd_id in (select fd_id from fiche_def where frd_id in (4,8,9,14))' where ad_id=25;