Pman/Roo.php
authorAlan Knowles <alan@akbkhome.com>
Mon, 30 Aug 2010 07:04:20 +0000 (15:04 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 30 Aug 2010 07:04:20 +0000 (15:04 +0800)
Pman/Roo.php

index bba7cd4..dcbb811 100644 (file)
@@ -504,7 +504,7 @@ class Pman_Roo extends Pman
         }
         // collect tables
         
-        echo '<PRE>';print_r($affects);exit;
+       // echo '<PRE>';print_r($affects);exit;
         
        
         
@@ -517,6 +517,18 @@ class Pman_Roo extends Pman
         while ($x->fetch()) {
             $xx = clone($x);
             
+            
+            foreach($affects as $k=> $true) {
+                $ka = explode('.', $k);
+                $chk = DB_DataObject::factory($ka[0]);
+                $chk->{$ka[1]} =  $xx->id;
+                if ($chk->count()) {
+                    $this->jerr('Delete Dependant records first');
+                }
+            }
+            
+            
+            
             if (method_exists($x, 'checkPerm') && !$x->checkPerm('D', $this->authUser))  {
                 $this->jerr("PERMISSION DENIED");
             }