From 754eb4420eb4b566e6531dbed4bddfc21e3e2aed Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 24 Oct 2017 00:31:54 +0200 Subject: [PATCH] =?UTF-8?q?=20=20=20=20R=C3=A9=C3=A9criture=20de=20CFGPCMN?= =?UTF-8?q?=20pour=20utiliser=20ManageTable=20pas=20de=20delete=20propos?= =?UTF-8?q?=C3=A9=20si=20compte=20utilis=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class/acc_plan_mtable.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/class/acc_plan_mtable.class.php b/include/class/acc_plan_mtable.class.php index 8902fd3dc..fae6345c4 100644 --- a/include/class/acc_plan_mtable.class.php +++ b/include/class/acc_plan_mtable.class.php @@ -74,6 +74,10 @@ class Acc_Plan_MTable extends Manage_Table_SQL for ($i=0; $i<$nb_order; $i++) { $v=$this->a_order[$i]; + $nb=0; + $cn=Dossier::connect(); + $nb=$cn->get_value("select count(*) from jrnx where j_poste=$1",[$p_row['pcm_val']]); + $nb+=$cn->get_value("select count(*) from tmp_pcmn where pcm_val_parent=$1",[$p_row['pcm_val']]); if ($v=="pcm_val") { $js=sprintf("onclick=\"%s.input('%s','%s');\"", $this->object_name, @@ -90,8 +94,8 @@ class Acc_Plan_MTable extends Manage_Table_SQL } elseif ($v=="pcm_lib") { - $cn=Dossier::connect(); - if ( $cn->get_value("select count(*) from jrnx where j_poste=$1",[$p_row['pcm_val']])>0){ + + if ( $nb >0){ echo ""; echo HtmlInput::history_account($p_row['pcm_val'],h($p_row["pcm_lib"])); echo ""; @@ -106,8 +110,8 @@ class Acc_Plan_MTable extends Manage_Table_SQL echo td($p_row[$v]); } } - $this->display_icon_del($p_row); - + if ( $nb == 0 ) $this->display_icon_del($p_row); + else echo td(" "); echo '';