noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 104/219: Réécriture de CFGPCMN pour util


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 104/219: Réécriture de CFGPCMN pour utiliser ManageTable pas de delete proposé si compte utilisé
Date: Mon, 18 Dec 2017 13:22:45 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 754eb4420eb4b566e6531dbed4bddfc21e3e2aed
Author: Dany De Bontridder <address@hidden>
Date:   Tue Oct 24 00:31:54 2017 +0200

        Réécriture de CFGPCMN pour utiliser ManageTable
    pas de delete proposé si compte utilisé
---
 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 8902fd3..fae6345 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 "<td>";
                     echo 
HtmlInput::history_account($p_row['pcm_val'],h($p_row["pcm_lib"]));
                     echo "</td>";
@@ -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("&nbsp;");
 
 
         echo '</tr>';



reply via email to

[Prev in Thread] Current Thread [Next in Thread]