fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8676] api: cleanup


From: Sigurd Nes
Subject: [Fmsystem-commits] [8676] api: cleanup
Date: Wed, 25 Jan 2012 08:50:18 +0000

Revision: 8676
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8676
Author:   sigurdne
Date:     2012-01-25 08:50:17 +0000 (Wed, 25 Jan 2012)
Log Message:
-----------
api: cleanup

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.db.inc.php
    trunk/phpgwapi/inc/class.setup.inc.php

Modified: trunk/phpgwapi/inc/class.db.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.db.inc.php 2012-01-25 07:18:04 UTC (rev 8675)
+++ trunk/phpgwapi/inc/class.db.inc.php 2012-01-25 08:50:17 UTC (rev 8676)
@@ -54,10 +54,10 @@
                /**
                 * @var string $join the sql syntax to use for JOIN
                 */
-                var $join = ' INNER JOIN ';
+                var $join = 'INNER JOIN';
                 
 
-                var $left_join = ' LEFT JOIN ';
+                var $left_join = 'LEFT JOIN';
                /**
                 * @var string $like the sql syntax to use for a case 
insensitive LIKE
                 */
@@ -138,7 +138,7 @@
                        switch ( $this->Type )
                        {
                                case 'postgres':
-                                       $this->join = " JOIN ";
+                                       $this->join = "JOIN";
                                        $this->like = "ILIKE";
                                        break;
                                default:

Modified: trunk/phpgwapi/inc/class.setup.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup.inc.php      2012-01-25 07:18:04 UTC (rev 
8675)
+++ trunk/phpgwapi/inc/class.setup.inc.php      2012-01-25 08:50:17 UTC (rev 
8676)
@@ -536,11 +536,11 @@
                        $setup_info =& $GLOBALS['setup_info'];
 
                        // Clean up locations, custom fields and ACL
-                       $this->db->query("SELECT app_id FROM phpgw_applications 
WHERE app_name = '{$appname}'");
+                       $this->db->query("SELECT app_id FROM phpgw_applications 
WHERE app_name = '{$appname}'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $app_id = (int)$this->db->f('app_id');
 
-                       $this->db->query("SELECT location_id FROM 
phpgw_locations WHERE app_id = {$app_id}");
+                       $this->db->query("SELECT location_id FROM 
phpgw_locations WHERE app_id = {$app_id}",__LINE__,__FILE__);
 
                        $locations = array();
                        while ($this->db->next_record())
@@ -550,23 +550,26 @@
 
                        if(count($locations))
                        {
-                               $this->db->query('DELETE FROM phpgw_cust_choice 
WHERE location_id IN ('. implode (',',$locations) . ')');
-                               $this->db->query('DELETE FROM 
phpgw_cust_attribute WHERE location_id IN ('. implode (',',$locations). ')');
-                               $this->db->query('DELETE FROM phpgw_acl  WHERE 
location_id IN ('. implode (',',$locations) . ')');
+                               $this->db->query('DELETE FROM phpgw_cust_choice 
WHERE location_id IN ('. implode (',',$locations) . ')',__LINE__,__FILE__);
+                               $this->db->query('DELETE FROM 
phpgw_cust_attribute WHERE location_id IN ('. implode (',',$locations). 
')',__LINE__,__FILE__);
+                               $this->db->query('DELETE FROM phpgw_acl  WHERE 
location_id IN ('. implode (',',$locations) . ')',__LINE__,__FILE__);
 
-                               $this->db->query('SELECT id FROM 
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . ')');
+                               $this->db->query('SELECT id FROM 
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . 
')',__LINE__,__FILE__);
                                $sections = array();
                                while ($this->db->next_record())
                                {
                                        $sections[] = $this->db->f('id');
                                }
-                               $this->db->query('DELETE FROM 
phpgw_config2_value WHERE section_id IN ('. implode (',',$sections) . ')');
-                               $this->db->query('DELETE FROM 
phpgw_config2_choice WHERE section_id IN ('. implode (',',$sections) . ')');
-                               $this->db->query('DELETE FROM 
phpgw_config2_attrib WHERE section_id IN ('. implode (',',$sections) . ')');
-                               $this->db->query('DELETE FROM 
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . ')');
+                               if($sections)
+                               {
+                                       $this->db->query('DELETE FROM 
phpgw_config2_value WHERE section_id IN ('. implode (',',$sections) . 
')',__LINE__,__FILE__);
+                                       $this->db->query('DELETE FROM 
phpgw_config2_choice WHERE section_id IN ('. implode (',',$sections) . 
')',__LINE__,__FILE__);
+                                       $this->db->query('DELETE FROM 
phpgw_config2_attrib WHERE section_id IN ('. implode (',',$sections) . 
')',__LINE__,__FILE__);
+                                       $this->db->query('DELETE FROM 
phpgw_config2_section WHERE location_id IN ('. implode (',',$locations) . 
')',__LINE__,__FILE__);
+                               }
                        }
 
-                       $this->db->query("DELETE FROM phpgw_locations WHERE 
app_id = {$app_id}");
+                       $this->db->query("DELETE FROM phpgw_locations WHERE 
app_id = {$app_id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_config WHERE 
config_app='{$appname}'",__LINE__,__FILE__);
                        //echo 'DELETING application: ' . $appname;
                        $this->db->query("DELETE FROM phpgw_applications WHERE 
app_name='{$appname}'",__LINE__,__FILE__);




reply via email to

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