[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.acl2.inc.php class.socommon....
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc class.acl2.inc.php class.socommon.... |
Date: |
Fri, 21 Apr 2006 19:09:20 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Branch:
Changes by: Sigurd Nes <address@hidden> 06/04/21 19:09:20
Modified files:
inc : class.acl2.inc.php class.socommon.inc.php
class.sorequest.inc.php
Log message:
'pgsql' is renamed to 'postgres' in HEAD
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.acl2.inc.php.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.socommon.inc.php.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sorequest.inc.php.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
Patches:
Index: property/inc/class.acl2.inc.php
diff -u property/inc/class.acl2.inc.php:1.10
property/inc/class.acl2.inc.php:1.11
--- property/inc/class.acl2.inc.php:1.10 Wed Mar 22 11:17:08 2006
+++ property/inc/class.acl2.inc.php Fri Apr 21 19:09:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage core
- * @version $Id: class.acl2.inc.php,v 1.10 2006/03/22 11:17:08 sigurdne
Exp $
+ * @version $Id: class.acl2.inc.php,v 1.11 2006/04/21 19:09:20 sigurdne
Exp $
*/
/**
@@ -40,8 +40,10 @@
$recieved_args = func_get_args();
$args = safe_args($expected_args,
$recieved_args,__LINE__,__FILE__);
- // $this->db = $GLOBALS['phpgw']->db;
- $this->db = CreateObject('phpgwapi.db');
+
+ $this->db =& $GLOBALS['phpgw']->db;
+
+ /* $this->db = CreateObject('phpgwapi.db');
$this->db->Host =
$GLOBALS['phpgw_info']['server']['db_host'];
$this->db->Type =
$GLOBALS['phpgw_info']['server']['db_type'];
$this->db->Database =
$GLOBALS['phpgw_info']['server']['db_name'];
@@ -54,15 +56,15 @@
$this->db2->Database =
$GLOBALS['phpgw_info']['server']['db_name'];
$this->db2->User =
$GLOBALS['phpgw_info']['server']['db_user'];
$this->db2->Password =
$GLOBALS['phpgw_info']['server']['db_pass'];
-
- // $this->db2 = $this->db;
+ */
+ $this->db2 = clone($GLOBALS['phpgw']->db);
$this->account_id = $args['account_id'];
$this->host_id = $args['host_id'];
$this->app_id = $args['app_id'];
- if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
+ if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql' ||
$GLOBALS['phpgw_info']['server']['db_type']=='postgres')
{
$this->like = "ILIKE";
}
Index: property/inc/class.socommon.inc.php
diff -u property/inc/class.socommon.inc.php:1.22
property/inc/class.socommon.inc.php:1.23
--- property/inc/class.socommon.inc.php:1.22 Wed Apr 19 09:24:46 2006
+++ property/inc/class.socommon.inc.php Fri Apr 21 19:09:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage core
- * @version $Id: class.socommon.inc.php,v 1.22 2006/04/19 09:24:46
sigurdne Exp $
+ * @version $Id: class.socommon.inc.php,v 1.23 2006/04/21 19:09:20
sigurdne Exp $
*/
/**
@@ -18,6 +18,18 @@
class socommon
{
+
+ /**
+ * @var string $join the sql syntax to use for JOIN
+ */
+ var $join = ' INNER JOIN ';
+
+ /**
+ * @var string $like the sql syntax to use for a case
insensitive LIKE
+ */
+ var $like = 'LIKE';
+
+
function socommon($currentapp='')
{
if($currentapp)
@@ -51,15 +63,18 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
- {
- $this->join = " JOIN ";
- $this->like = "ILIKE";
- }
- else
+ switch ( $GLOBALS['phpgw_info']['server']['db_type'] )
{
- $this->join = " INNER JOIN ";
- $this->like = "LIKE";
+ case 'pgsql':
+ $this->join = " JOIN ";
+ $this->like = "ILIKE";
+ break;
+ case 'postgres':
+ $this->join = " JOIN ";
+ $this->like = "ILIKE";
+ break;
+ default:
+ //do nothing for now
}
$this->left_join = " LEFT JOIN ";
Index: property/inc/class.sorequest.inc.php
diff -u property/inc/class.sorequest.inc.php:1.16
property/inc/class.sorequest.inc.php:1.17
--- property/inc/class.sorequest.inc.php:1.16 Wed Apr 19 08:35:32 2006
+++ property/inc/class.sorequest.inc.php Fri Apr 21 19:09:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.sorequest.inc.php,v 1.16 2006/04/19 08:35:32
sigurdne Exp $
+ * @version $Id: class.sorequest.inc.php,v 1.17 2006/04/21 19:09:20
sigurdne Exp $
*/
/**
@@ -81,7 +81,7 @@
while (is_array($request) && list(,$id) =
each($request))
{
-
if($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
+
if($GLOBALS['phpgw_info']['server']['db_type']=='pgsql' ||
$GLOBALS['phpgw_info']['server']['db_type']=='postgres')
{
$sql = "UPDATE fm_request SET score =
(SELECT sum(priority_key * ( degree * probability * ( consequence +1 ))) FROM
fm_request_condition"
. " $this->join
fm_request_condition_type ON (fm_request_condition.condition_type =
fm_request_condition_type.id) WHERE request_id = $id) WHERE fm_request.id =
$id";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc class.acl2.inc.php class.socommon....,
Sigurd Nes <=