fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14054]


From: Nelson Guerra
Subject: [Fmsystem-commits] [14054]
Date: Tue, 29 Sep 2015 20:43:34 +0000

Revision: 14054
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14054
Author:   nelson224
Date:     2015-09-29 20:43:33 +0000 (Tue, 29 Sep 2015)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind/rental/inc/class.uiadjustment.inc.php

Modified: branches/dev-syncromind/rental/inc/class.uiadjustment.inc.php
===================================================================
--- branches/dev-syncromind/rental/inc/class.uiadjustment.inc.php       
2015-09-29 13:53:04 UTC (rev 14053)
+++ branches/dev-syncromind/rental/inc/class.uiadjustment.inc.php       
2015-09-29 20:43:33 UTC (rev 14054)
@@ -473,31 +473,35 @@
        
        public function delete()
        {
-               $adjustment_id = (int)phpgw::get_var('id');
-                       
-               $result = 
rental_soadjustment::get_instance()->delete($adjustment_id);
+               $list_adjustment_id = phpgw::get_var('id');
+               $message = array();
                
-               if( phpgw::get_var('phpgw_return_as') == 'json' )
+               if (is_array($list_adjustment_id))
                {
+                       foreach ($list_adjustment_id as $adjustment_id)
+                       {
+                               $result = 
rental_soadjustment::get_instance()->delete($adjustment_id);
+                               if ($result) {
+                                       $message['message'][] = 
array('msg'=>lang('id %1 has been deleted', $adjustment_id));
+                               } else {
+                                       $message['error'][] = 
array('msg'=>lang('adjustment_not_deleted'));
+                               }                               
+                       }               
+               } 
+               else 
+               {
+                       $result = 
rental_soadjustment::get_instance()->delete($list_adjustment_id);     
                        if($result)
                        {
-                               $msg = lang('id %1 has been deleted', 
$adjustment_id);
+                               $message = lang('adjustment_deleted');
                        }
                        else
                        {
-                               $msg =  lang('adjustment_not_deleted'); 
-                       }
-                       return $msg;
-               } 
+                               $message = lang('adjustment_not_deleted');      
+                       }                       
+               }        
                
-               if($result)
-               {
-                       $this->render('adjustment_list.php', array('error' => 
lang('adjustment_not_deleted')));
-               }
-               else
-               {
-                       $this->render('adjustment_list.php', array('message' => 
lang('adjustment_deleted')));   
-               }
+               return $message;
        }
        
        public function show_affected_contracts()




reply via email to

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