From 80edef2307a83254ebda0e89670f557ac3c0f7bc Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Fri, 30 Nov 2001 01:13:31 +0000 Subject: [PATCH] *** empty log message *** --- admin/inc/class.boaccounts.inc.php | 2 +- admin/inc/class.soapplications.inc.php | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index 635a406e61..443f8c960e 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -165,7 +165,7 @@ } $ui = createobject('admin.uiaccounts'); - $ui->list_users(); + $ui->list_users(); return False; } } diff --git a/admin/inc/class.soapplications.inc.php b/admin/inc/class.soapplications.inc.php index 3ec96042d6..54cf4046a4 100644 --- a/admin/inc/class.soapplications.inc.php +++ b/admin/inc/class.soapplications.inc.php @@ -56,8 +56,15 @@ function add($data) { - $sql = "INSERT INTO phpgw_applications (app_name,app_title,app_enabled,app_order) VALUES('" - . addslashes($data['n_app_name']) . "','" . addslashes($data['n_app_title']) . "','" + /* Yes, the sequence should work, but after a mass import in setup (new install) + it does not work on pg + */ + $sql = "SELECT MAX(app_id) from phpgw_applications"; + $this->db->query($sql,__LINE__,__FILE__); + $this->db->next_record(); + $app_id = $this->db->f(0) + 1; + $sql = "INSERT INTO phpgw_applications (app_id,app_name,app_title,app_enabled,app_order) VALUES(" + . $app_id . ",'" . addslashes($data['n_app_name']) . "','" . addslashes($data['n_app_title']) . "','" . $data['n_app_status'] . "','" . $data['app_order'] . "')"; $this->db->query($sql,__LINE__,__FILE__); @@ -76,7 +83,7 @@ function exists($app_name) { - $this->db->query("select count(*) from phpgw_applications where app_name='" . addslashes($app_name) . "'",__LINE__,__FILE__); + $this->db->query("SELECT COUNT(app_name) FROM phpgw_applications WHERE app_name='" . addslashes($app_name) . "'",__LINE__,__FILE__); $this->db->next_record(); if ($this->db->f(0) != 0) @@ -88,7 +95,7 @@ function app_order() { - $this->db->query("SELECT (max(app_order)+1) as max from phpgw_applications"); + $this->db->query("SELECT (MAX(app_order)+1) AS max FROM phpgw_applications"); $this->db->next_record(); return $this->db->f('max'); }