phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc/accounts class.accounts_sql.inc.php


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/inc/accounts class.accounts_sql.inc.php
Date: Wed, 27 Dec 2006 05:54:47 +0000

CVSROOT:        /sources/phpgwapi
Module name:    phpgwapi
Changes by:     Dave Hall <skwashd>     06/12/27 05:54:47

Modified files:
        inc/accounts   : class.accounts_sql.inc.php 

Log message:
        make it more efficient

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/accounts/class.accounts_sql.inc.php?cvsroot=phpgwapi&r1=1.22&r2=1.23

Patches:
Index: class.accounts_sql.inc.php
===================================================================
RCS file: /sources/phpgwapi/phpgwapi/inc/accounts/class.accounts_sql.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- class.accounts_sql.inc.php  8 Dec 2006 15:14:59 -0000       1.22
+++ class.accounts_sql.inc.php  27 Dec 2006 05:54:47 -0000      1.23
@@ -8,7 +8,7 @@
        * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage accounts
-       * @version $Id: class.accounts_sql.inc.php,v 1.22 2006/12/08 15:14:59 
sigurdne Exp $
+       * @version $Id: class.accounts_sql.inc.php,v 1.23 2006/12/27 05:54:47 
skwashd Exp $
        */
 
        /**
@@ -295,21 +295,27 @@
                        return $id_list[$account_id];
                }
 
+               /**
+               * Match a contact ID with an account id
+               *
+               * @param int $person_id the contact person ID
+               * @param int account id - 0 if not found
+               */
                function search_person($person_id)
                {
                        static $person_list;
 
                        if (! $person_id)
                        {
-                               return False;
+                               return 0;
                        }
 
-                       if(isset($person_list[$person_id]) && 
$person_list[$person_id])
+                       if ( isset($person_list[$person_id]) )
                        {
                                return $person_list[$person_id];
                        }
 
-                       $this->db->query('SELECT account_id FROM phpgw_accounts 
WHERE person_id=' . intval($person_id) ,__LINE__,__FILE__);
+                       $this->db->query('SELECT account_id FROM phpgw_accounts 
WHERE person_id=' . (int) $person_id ,__LINE__,__FILE__);
                        if($this->db->num_rows())
                        {
                                $this->db->next_record();
@@ -317,7 +323,7 @@
                        }
                        else
                        {
-                               $person_list[$person_id] = False;
+                               $person_list[$person_id] = 0;
                        }
                        return $person_list[$person_id];
                }




reply via email to

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