phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/class.bolookup.inc.php, 1.3


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.bolookup.inc.php, 1.3
Date: Sun, 24 Oct 2004 00:11:00 +0200

Update of /property/inc
Modified Files:
        Branch: 
          class.bolookup.inc.php

date: 2004/10/23 22:11:00;  author: sigurdne;  state: Exp;  lines: +68 -4

Log Message:
no message
=====================================================================
Index: property/inc/class.bolookup.inc.php
diff -u property/inc/class.bolookup.inc.php:1.2 
property/inc/class.bolookup.inc.php:1.3
--- property/inc/class.bolookup.inc.php:1.2     Wed Jun  2 18:54:27 2004
+++ property/inc/class.bolookup.inc.php Sat Oct 23 22:11:00 2004
@@ -134,13 +134,77 @@
 
                function read_addressbook()
                {
-                       $contact = $this->so->read_addressbook(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id));
-                       $this->total_records = $this->so->total_records;
+//                     $contact = $this->so->read_addressbook(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+//                                                                             
        'filter' => $this->filter,'cat_id' => $this->cat_id));
+//                     $this->total_records = $this->so->total_records;
+
+
+                       
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] &&
+                               
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+                       {
+                               $this->limit = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $this->limit = 15;
+                       }
+
+                   $fields[0] = 'per_first_name';
+                   $fields[1] = 'per_last_name';
+                   $fields[2] = 'per_department';
+                   $fields[3] = 'per_title';
+                   $fields[4] = 'addr_add1';
+                   $fields[5] = 'addr_city';
+                   $fields['owner'] = 'owner';
+                   $fields['contact_id'] = 'contact_id';
+
+
+                       $addressbook    = 
CreateObject('addressbook.boaddressbook');
+
+                       $criteria = $addressbook->criteria_contacts(1, -3, 
'person', $this->query, $fields_search);
+
+//_debug_array($criteria);
+                       $entries = $addressbook->get_persons($fields, 
$this->limit, $this->start, $this->order, $this->sort, '', $criteria);
+
+//_debug_array($entries);
+                       return $entries;
+               }
 
-                       return $contact;
+
+               /**
+               * Get the the person data what you want
+               *
+               * @param array $fields The fields that you can see from person
+               * @param integer $limit Limit of records that you want
+               * @param integer $ofset Ofset of record that you want start
+               * @param string $orderby The field which you want order
+               * @param string $sort ASC | DESC depending what you want
+               * @param mixed $criteria All criterias what you want
+               * @param mixed $criteria_token same like $criteria but 
builded<br>with sql_criteria class, more powerfull
+               * @return array with records
+               */
+               function get_persons($fields, $start='', $limit='', 
$orderby='', $sort='', $criteria='', $token_criteria='')
+               {
+                       $entries =  $this->so->get_persons($fields, $start, 
$limit, $orderby, $sort, $criteria, $token_criteria);
+                       if(is_array($entries))
+                       {
+                               foreach($entries as $data)
+                               {
+                                       $persons[$data['contact_id']] = $data;
+                               }
+                       }
+                       else
+                       {
+                               $persons = array();
+                       }
+                       $this->total = $this->so->contacts->total_records;
+                       return $persons;
                }
 
+
+
+
+
                function read_vendor()
                {
                        $vendor = $this->so->read_vendor(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,




reply via email to

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