[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.2.2.3
From: |
Alejandro Borges (lex) <address@hidden> |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.2.2.30, 1.17.2.2.2.31 |
Date: |
Tue, 28 Oct 2003 07:24:10 +0000 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv30121
Modified Files:
Tag: Version-0_9_16-branch
class.contacts_sql.inc.php
Log Message:
Further duddies fixed
Index: class.contacts_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.contacts_sql.inc.php,v
retrieving revision 1.17.2.2.2.30
retrieving revision 1.17.2.2.2.31
diff -C2 -d -r1.17.2.2.2.30 -r1.17.2.2.2.31
*** class.contacts_sql.inc.php 28 Oct 2003 07:14:38 -0000 1.17.2.2.2.30
--- class.contacts_sql.inc.php 28 Oct 2003 07:24:07 -0000 1.17.2.2.2.31
***************
*** 1330,1360 ****
}
! /* This function get all the Communication media from one
contact.
! *
! * Or the first if there is no one marked as preferred.
! * @param integer $contact_id id to locate the contact
! * return array Form: (description => value, description =>
value, ...)
! */
! function get_all_comms($contact_id)
! {
! if (intval($contact_id) != 0)
! {
! // get all comm_descriptions from api function
! $this->request(array('comm_data',
'comm_descr'));
! $this->criteria(array('comm_contact_id' =>
$contact_id));
! // get all comms from db
! $records = $this->get_query(PHPGW_SQL_RUN_SQL,
__LINE__, __FILE__);
! if(count($records) == 0)
! {
! return;
! }
! foreach ($records as $comm)
! {
! $descr =
$this->search_comm_descr_id($comm['comm_descr']);
! $comms[$descr] = $comm['comm_data'];
! }
! }
! return $comms;
! }
/**
--- 1330,1334 ----
}
!
/**
***************
*** 1705,1799 ****
}
! /**
! * Get all the data for any contact or contacts that are part of
$optional_criteria.
! *
! * This function try to be a comprensive way to get data from
contacts<br /> convert the contacts database output on a multidimensional
array<br />
! * @param int|array $contact_id
! * @param mixed $optional_criteria criteria built with
sql_criteria
! * @param integer $line where this function is called, usefull
for debug
! * @param integer $file where this function is called, usefull
for debug
! * @return mixed array with all the data of contact (contacts).
! */
! function person_complete_data($contact_id, $optional_criteria =
'', $line=__LINE__, $file=__FILE__)
! {
! $this->request($this->import_export_fields);
! if (empty($optional_criteria))
! {
! if (intval($contact_id) == 0)
! {
! // this is an error
! return ;
! }
!
$this->criteria_token(sql_criteria::_equal('contact_id', $contact_id));
! }
! else
! {
! $this->criteria_token($optional_criteria);
! }
!
! $sql = $this->get_sql();
!
! $this->execute_query($sql, $line, $file);
!
! while ($this->db->next_record())
! {
! $record = $this->db->Record;
! $contact['contact_id'] =
$record['contact_id'];
! $contact['per_full_name'] =
$record['per_full_name'];
! $contact['per_first_name'] =
$record['per_first_name'];
! $contact['per_last_name'] =
$record['per_full_name'];
! $contact['per_middle_name'] =
$record['per_middle_name'];
! $contact['per_suffix'] =
$record['per_suffix'];
! $contact['per_prefix'] =
$record['per_prefix'];
! $contact['per_birthday'] =
$record['per_birthday'];
! $contact['per_pubkey'] =
$record['per_pubkey'];
! $contact['per_title'] =
$record['per_title'];
! $contact['per_departament'] =
$record['per_departamet'];
! $contact['per_initials'] =
$record['per_initials'];
! $contact['per_sound'] =
$record['per_sound'];
! $contact['per_active'] =
$record['per_active'];
! $contact['per_createon'] =
$record['per_createon'];
! $contact['per_createby'] =
$record['per_createby'];
! $contact['per_modby'] =
$record['per_modby'];
! $contact['per_modon'] =
$record['per_modon'];
! $contact['account_id'] =
$record['account_id'];
! // Locations info
! $loc_id
= $record['key_addr_id'];
! if($loc_id)
! {
! $contact['locations'][$loc_id]['type']
= $record['addr_description'];
! $contact['locations'][$loc_id]['add1']
= $record['addr_add1'];
! $contact['locations'][$loc_id]['add2']
= $record['addr_add2'];
! $contact['locations'][$loc_id]['add3']
= $record['addr_add3'];
!
$contact['locations'][$loc_id]['address'] = $record['addr_address'];
! $contact['locations'][$loc_id]['city']
= $record['addr_city'];
! $contact['locations'][$loc_id]['state']
= $record['addr_state'];
!
$contact['locations'][$loc_id]['postal_code'] = $record['addr_postal_code'];
!
$contact['locations'][$loc_id]['country'] = $record['addr_country'];
!
$contact['locations'][$loc_id]['preferred'] = $record['addr_preferred'];
! }
! // Notes
! $note_id
= $record['key_note_id'];
! if($note_id)
! {
! $contact['notes'][$note_id]['text']
= $record['note_text'];
! $contact['notes'][$note_id]['type']
= $record['note_description'];
! }
! // Communcation media fields
! if($record['comm_data'])
! {
! $comm_descr
= $record['comm_description'];
! $contact[$comm_descr]
= $record['comm_data'];
! $contact['comm_type'][$comm_descr]
= $record['comm_type_description'];
! }
! // Other fields
! if($record['other_value'])
! {
! $contact[$record['other_name']]
= $record['other_value'];
! }
! }
! return $contact;
! }
!
/*************************************************************\
* Search in catalogs functions section *
--- 1679,1683 ----
}
!
/*************************************************************\
* Search in catalogs functions section *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/inc class.contacts_sql.inc.php, 1.17.2.2.2.30, 1.17.2.2.2.31,
Alejandro Borges (lex) <address@hidden> <=