noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 79/323: before deleting a card , check if it


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 79/323: before deleting a card , check if it is not used as an attribute in another card
Date: Wed, 14 Mar 2018 17:38:27 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit c157929c84c4eb9b2c87bcdd8215187593c4d63d
Author: Dany De Bontridder <address@hidden>
Date:   Wed Jan 24 19:06:55 2018 +0100

    before deleting a card , check if it is not used as an attribute in
    another card
---
 include/class/fiche.class.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 86c5253..ecc0b57 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -1984,6 +1984,16 @@ class Fiche
                 [$this->id]);
         if ( $count > 0 ) return TRUE;
         
+        $count=$this->cn->get_value("select count(*) 
+                                select count(*) 
+                from attr_def
+                join fiche_detail using (ad_id)
+                where ad_type='card'
+                and ad_value=$1"
+                ,[$qcode]);
+        
+        if ( $count > 0 ) return TRUE;
+        
         return FALSE;
     }
     /*\brief remove a card without verification */



reply via email to

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