fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15320] booking: fix delete


From: sigurdne
Subject: [Fmsystem-commits] [15320] booking: fix delete
Date: Thu, 23 Jun 2016 08:36:50 +0000 (UTC)

Revision: 15320
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15320
Author:   sigurdne
Date:     2016-06-23 08:36:50 +0000 (Thu, 23 Jun 2016)
Log Message:
-----------
booking: fix delete

Modified Paths:
--------------
    trunk/booking/inc/class.soallocation.inc.php
    trunk/booking/inc/class.sobooking.inc.php
    trunk/booking/inc/class.soevent.inc.php
    trunk/booking/inc/class.soseason.inc.php
    trunk/booking/inc/class.uievent.inc.php

Modified: trunk/booking/inc/class.soallocation.inc.php
===================================================================
--- trunk/booking/inc/class.soallocation.inc.php        2016-06-23 07:36:56 UTC 
(rev 15319)
+++ trunk/booking/inc/class.soallocation.inc.php        2016-06-23 08:36:50 UTC 
(rev 15320)
@@ -283,13 +283,14 @@
                public function delete_allocation( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
                        $table_name = $this->table_name . '_resource';
                        $sql = "DELETE FROM $table_name WHERE allocation_id = 
($id)";
                        $db->query($sql, __LINE__, __FILE__);
                        $table_name = $this->table_name;
                        $sql = "DELETE FROM $table_name WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
-                       return True;
+                       return  $db->transaction_commit();
                }
 
                public function update_id_string()

Modified: trunk/booking/inc/class.sobooking.inc.php
===================================================================
--- trunk/booking/inc/class.sobooking.inc.php   2016-06-23 07:36:56 UTC (rev 
15319)
+++ trunk/booking/inc/class.sobooking.inc.php   2016-06-23 08:36:50 UTC (rev 
15320)
@@ -434,6 +434,7 @@
                public function delete_booking( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
                        $table_name = $this->table_name . '_resource';
                        $sql = "DELETE FROM $table_name WHERE booking_id = 
($id)";
                        $db->query($sql, __LINE__, __FILE__);
@@ -446,15 +447,18 @@
                        $table_name = $this->table_name;
                        $sql = "DELETE FROM $table_name WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
+                       return  $db->transaction_commit();
                }
 
                public function delete_allocation( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
                        $sql = "DELETE FROM bb_allocation_resource WHERE 
allocation_id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
                        $sql = "DELETE FROM bb_allocation WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
+                       return  $db->transaction_commit();
                }
 
                public function got_no_allocation( $booking )

Modified: trunk/booking/inc/class.soevent.inc.php
===================================================================
--- trunk/booking/inc/class.soevent.inc.php     2016-06-23 07:36:56 UTC (rev 
15319)
+++ trunk/booking/inc/class.soevent.inc.php     2016-06-23 08:36:50 UTC (rev 
15320)
@@ -312,6 +312,10 @@
                public function delete_event( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
+                       $table_name = $this->table_name . '_cost';
+                       $sql = "DELETE FROM $table_name WHERE event_id = ($id)";
+                       $db->query($sql, __LINE__, __FILE__);
                        $table_name = $this->table_name . '_comment';
                        $sql = "DELETE FROM $table_name WHERE event_id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
@@ -330,7 +334,7 @@
                        $table_name = $this->table_name;
                        $sql = "DELETE FROM $table_name WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
-                       return True;
+                       return  $db->transaction_commit();
                }
 
                public function update_id_string()

Modified: trunk/booking/inc/class.soseason.inc.php
===================================================================
--- trunk/booking/inc/class.soseason.inc.php    2016-06-23 07:36:56 UTC (rev 
15319)
+++ trunk/booking/inc/class.soseason.inc.php    2016-06-23 08:36:50 UTC (rev 
15320)
@@ -389,7 +389,9 @@
 
                function delete( $id )
                {
+                       $this->db->transaction_begin();
                        $this->db->query("DELETE FROM 
bb_wtemplate_alloc_resource WHERE allocation_id=" . intval($id), __LINE__, 
__FILE__);
                        $this->db->query("DELETE FROM bb_wtemplate_alloc WHERE 
id=" . intval($id), __LINE__, __FILE__);
+                       return  $this->db->transaction_commit();
                }
        }
\ No newline at end of file

Modified: trunk/booking/inc/class.uievent.inc.php
===================================================================
--- trunk/booking/inc/class.uievent.inc.php     2016-06-23 07:36:56 UTC (rev 
15319)
+++ trunk/booking/inc/class.uievent.inc.php     2016-06-23 08:36:50 UTC (rev 
15320)
@@ -1023,7 +1023,7 @@
 
                public function delete()
                {
-                       $event_id = phpgw::get_var('event_id', 'int');
+                       $event_id = phpgw::get_var('id', 'int');
                        $application_id = phpgw::get_var('application_id', 
'int');
 
                        if ($GLOBALS['phpgw']->acl->check('admin', 
phpgwapi_acl::ADD, 'booking'))




reply via email to

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