[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.bojsaddressbook.inc.php, 1.1.2.2,
From: |
Dave Hall <address@hidden> |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.bojsaddressbook.inc.php, 1.1.2.2, 1.1.2.3 class.contact_accounts.inc.php, 1.1.2.3, 1.1.2.4 class.contact_org.inc.php, 1.1.2.3, 1.1.2.4 class.contact_org_person.inc.php, 1.1.2.3, 1.1.2.4 class.contact_person.inc.php, 1.1.2.4, 1.1.2.5 class.contacts_sql.inc.php, 1.17.2.2.2.15, 1.17.2.2.2.16 class.sql_builder.inc.php, 1.1.2.8, 1.1.2.9 class.uijsaddressbook.inc.php, 1.1.2.2, 1.1.2.3 functions.inc.php, 1.121.2.13.2.14, 1.121.2.13.2.15 |
Date: |
Sat, 04 Oct 2003 23:42:40 +0000 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv10646/inc
Modified Files:
Tag: Version-0_9_16-branch
class.bojsaddressbook.inc.php class.contact_accounts.inc.php
class.contact_org.inc.php class.contact_org_person.inc.php
class.contact_person.inc.php class.contacts_sql.inc.php
class.sql_builder.inc.php class.uijsaddressbook.inc.php
functions.inc.php
Log Message:
various fixes from Step One Crew
Index: class.contact_accounts.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/phpgwapi/inc/Attic/class.contact_accounts.inc.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** class.contact_accounts.inc.php 3 Oct 2003 00:24:37 -0000 1.1.2.3
--- class.contact_accounts.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.4
***************
*** 49,52 ****
--- 49,57 ----
}
+ function criteria_account_person_id($element)
+ {
+ $this->_add_criteria($this->index_criteria($element));
+ }
+
function select_is_user($element)
{
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.15
retrieving revision 1.17.2.2.2.16
diff -C2 -d -r1.17.2.2.2.15 -r1.17.2.2.2.16
*** class.contacts_sql.inc.php 3 Oct 2003 03:09:32 -0000 1.17.2.2.2.15
--- class.contacts_sql.inc.php 4 Oct 2003 23:42:36 -0000 1.17.2.2.2.16
***************
*** 79,83 ****
// 'name'
=> 'full name',
'per_first_name'
=> 'first name',
! 'per_last_name' =>
'last name',
'per_middle_name'
=> 'middle name',
'per_initials'
=> 'initials',
--- 79,83 ----
// 'name'
=> 'full name',
'per_first_name'
=> 'first name',
! 'per_last_name'
=> 'last name',
'per_middle_name'
=> 'middle name',
'per_initials'
=> 'initials',
***************
*** 119,123 ****
'adr_two_type'
=> 'home address type',
'tz'
=> 'time zone',
! 'geo'
=> 'geo',
'fn'
=> 'full name',
'sound'
=> 'Sound',
--- 119,123 ----
'adr_two_type'
=> 'home address type',
'tz'
=> 'time zone',
! 'geo'
=> 'geo',
'fn'
=> 'full name',
'sound'
=> 'Sound',
***************
*** 159,165 ****
'addr_preferred'
=> 'preffered address',
! 'owner' =>
'owner',
'access'
=> 'access',
! 'addr_pref_val' =>
'preferred address value',
'other_name'
=> 'custom name',
'other_value'
=> 'custom value',
--- 159,165 ----
'addr_preferred'
=> 'preffered address',
! 'owner'
=> 'owner',
'access'
=> 'access',
! 'addr_pref_val'
=> 'preferred address value',
'other_name'
=> 'custom name',
'other_value'
=> 'custom value',
***************
*** 172,176 ****
'count_orgs'
=> 'number of organizations',
'account_id'
=> 'account id',
! 'count_persons' =>
'number of persons',
--- 172,176 ----
'count_orgs'
=> 'number of organizations',
'account_id'
=> 'account id',
! 'count_persons'
=> 'number of persons',
***************
*** 267,325 ****
'sel_cat_id' =>
array('phpgwapi.contact_central', '0'),
! 'org_id' =>
array('phpgwapi.contact_org', '1'),
! 'org_name' =>
array('phpgwapi.contact_org', '1'),
! 'org_active' =>
array('phpgwapi.contact_org', '1'),
! 'org_parent' =>
array('phpgwapi.contact_org', '1'),
! 'org_creaton' =>
array('phpgwapi.contact_org', '1'),
! 'org_creatby' =>
array('phpgwapi.contact_org', '1'),
! 'org_modon' =>
array('phpgwapi.contact_org', '1'),
! 'org_modby' =>
array('phpgwapi.contact_org', '1'),
! 'name' =>
array('phpgwapi.contact_org', '1'),
! 'count_orgs' =>
array('phpgwapi.contact_org', '1'),
! 'person_id' =>
array('phpgwapi.contact_person', '1'),
! 'per_first_name' =>
array('phpgwapi.contact_person', '1'),
! 'per_last_name' =>
array('phpgwapi.contact_person', '1'),
! 'per_middle_name' =>
array('phpgwapi.contact_person', '1'),
! 'per_prefix' =>
array('phpgwapi.contact_person', '1'),
! 'per_suffix' =>
array('phpgwapi.contact_person', '1'),
! 'per_birthday' =>
array('phpgwapi.contact_person', '1'),
! 'per_pubkey' =>
array('phpgwapi.contact_person', '1'),
! 'per_title' =>
array('phpgwapi.contact_person', '1'),
! 'per_department' =>
array('phpgwapi.contact_person', '1'),
! 'per_initials' =>
array('phpgwapi.contact_person', '1'),
! 'per_sound' =>
array('phpgwapi.contact_person', '1'),
! 'per_active' =>
array('phpgwapi.contact_person', '1'),
! 'per_creaton' =>
array('phpgwapi.contact_person', '1'),
! 'per_creatby' =>
array('phpgwapi.contact_person', '1'),
! 'per_modon' =>
array('phpgwapi.contact_person', '1'),
! 'per_modby' =>
array('phpgwapi.contact_person', '1'),
! 'per_name' =>
array('phpgwapi.contact_person', '1'),
! 'account_id' =>
array('phpgwapi.contact_person', '1'),
! 'count_persons' =>
array('phpgwapi.contact_person', '1'),
//deprecated start
! 'fn' =>
array('phpgwapi.contact_person', '1'),
! 'n_given' =>
array('phpgwapi.contact_person', '1'),
! 'n_family' =>
array('phpgwapi.contact_person', '1'),
! 'n_middle' =>
array('phpgwapi.contact_person', '1'),
! 'n_prefix' =>
array('phpgwapi.contact_person', '1'),
! 'n_suffix' =>
array('phpgwapi.contact_person', '1'),
! 'sound' =>
array('phpgwapi.contact_person', '1'),
! 'bday' =>
array('phpgwapi.contact_person', '1'),
! 'note' =>
array('phpgwapi.contact_person', '1'),
! 'tz' =>
array('phpgwapi.contact_person', '1'),
! 'geo' =>
array('phpgwapi.contact_person', '1'),
! 'url' =>
array('phpgwapi.contact_person', '1'),
! 'pubkey' =>
array('phpgwapi.contact_person', '1'),
! 'org_unit' =>
array('phpgwapi.contact_person', '1'),
! 'title' =>
array('phpgwapi.contact_person', '1'),
//deprecated end
! 'my_org_id' =>
array('phpgwapi.contact_org_person', '2'),
! 'my_person_id' =>
array('phpgwapi.contact_org_person', '2'),
! 'my_addr_id' =>
array('phpgwapi.contact_org_person', '2'),
! 'my_preferred' =>
array('phpgwapi.contact_org_person', '2'),
! 'my_creaton' =>
array('phpgwapi.contact_org_person', '2'),
! 'my_creatby' =>
array('phpgwapi.contact_org_person', '2'),
'key_addr_id' =>
array('phpgwapi.contact_addr', '3'),
--- 267,328 ----
'sel_cat_id' =>
array('phpgwapi.contact_central', '0'),
! 'org_id' =>
array('phpgwapi.contact_org', '2'),
! 'org_name' =>
array('phpgwapi.contact_org', '2'),
! 'org_active' =>
array('phpgwapi.contact_org', '2'),
! 'org_parent' =>
array('phpgwapi.contact_org', '2'),
! 'org_creaton' =>
array('phpgwapi.contact_org', '2'),
! 'org_creatby' =>
array('phpgwapi.contact_org', '2'),
! 'org_modon' =>
array('phpgwapi.contact_org', '2'),
! 'org_modby' =>
array('phpgwapi.contact_org', '2'),
! 'name' =>
array('phpgwapi.contact_org', '2'),
! 'count_orgs' =>
array('phpgwapi.contact_org', '2'),
! 'people' =>
array('phpgwapi.contact_org', '2'),
! 'person_id' =>
array('phpgwapi.contact_person', '2'),
! 'per_full_name' =>
array('phpgwapi.contact_person', '2'),
! 'per_first_name' =>
array('phpgwapi.contact_person', '2'),
! 'per_last_name' =>
array('phpgwapi.contact_person', '2'),
! 'per_middle_name' =>
array('phpgwapi.contact_person', '2'),
! 'per_prefix' =>
array('phpgwapi.contact_person', '2'),
! 'per_suffix' =>
array('phpgwapi.contact_person', '2'),
! 'per_birthday' =>
array('phpgwapi.contact_person', '2'),
! 'per_pubkey' =>
array('phpgwapi.contact_person', '2'),
! 'per_title' =>
array('phpgwapi.contact_person', '2'),
! 'per_department' =>
array('phpgwapi.contact_person', '2'),
! 'per_initials' =>
array('phpgwapi.contact_person', '2'),
! 'per_sound' =>
array('phpgwapi.contact_person', '2'),
! 'per_active' =>
array('phpgwapi.contact_person', '2'),
! 'per_creaton' =>
array('phpgwapi.contact_person', '2'),
! 'per_creatby' =>
array('phpgwapi.contact_person', '2'),
! 'per_modon' =>
array('phpgwapi.contact_person', '2'),
! 'per_modby' =>
array('phpgwapi.contact_person', '2'),
! 'per_name' =>
array('phpgwapi.contact_person', '2'),
! 'account_id' =>
array('phpgwapi.contact_person', '2'),
! 'count_persons' =>
array('phpgwapi.contact_person', '2'),
! 'organizations' =>
array('phpgwapi.contact_person', '2'),
//deprecated start
! 'fn' =>
array('phpgwapi.contact_person', '2'),
! 'n_given' =>
array('phpgwapi.contact_person', '2'),
! 'n_family' =>
array('phpgwapi.contact_person', '2'),
! 'n_middle' =>
array('phpgwapi.contact_person', '2'),
! 'n_prefix' =>
array('phpgwapi.contact_person', '2'),
! 'n_suffix' =>
array('phpgwapi.contact_person', '2'),
! 'sound' =>
array('phpgwapi.contact_person', '2'),
! 'bday' =>
array('phpgwapi.contact_person', '2'),
! 'note' =>
array('phpgwapi.contact_person', '2'),
! 'tz' =>
array('phpgwapi.contact_person', '2'),
! 'geo' =>
array('phpgwapi.contact_person', '2'),
! 'url' =>
array('phpgwapi.contact_person', '2'),
! 'pubkey' =>
array('phpgwapi.contact_person', '2'),
! 'org_unit' =>
array('phpgwapi.contact_person', '2'),
! 'title' =>
array('phpgwapi.contact_person', '2'),
//deprecated end
! 'my_org_id' =>
array('phpgwapi.contact_org_person', '1'),
! 'my_person_id' =>
array('phpgwapi.contact_org_person', '1'),
! 'my_addr_id' =>
array('phpgwapi.contact_org_person', '1'),
! 'my_preferred' =>
array('phpgwapi.contact_org_person', '1'),
! 'my_creaton' =>
array('phpgwapi.contact_org_person', '1'),
! 'my_creatby' =>
array('phpgwapi.contact_org_person', '1'),
'key_addr_id' =>
array('phpgwapi.contact_addr', '3'),
***************
*** 328,331 ****
--- 331,335 ----
'addr_add1' =>
array('phpgwapi.contact_addr', '3'),
'addr_add2' =>
array('phpgwapi.contact_addr', '3'),
+ 'addr_add3' =>
array('phpgwapi.contact_addr', '3'),
'addr_city' =>
array('phpgwapi.contact_addr', '3'),
'addr_state' =>
array('phpgwapi.contact_addr', '3'),
***************
*** 683,686 ****
--- 687,723 ----
}
+ /**
+ * This function try to be a comprensive way to get data from
contacts<br /> convert the contacts database output on a multidimensional
array<br />
+ */
+ function organzation_complete_data($field_list)
+ {
+ //Get comms that want to search
+ $comms = $field_list['comm_media'];
+ unset($field_list['comm_media']);
+
+ $locations = $field_list['locations'];
+ unset($field_list['locations']);
+
+ if(array_key_exists($field_list))
+ {
+ $categories = array('categories');
+ }
+ else
+ {
+ $categories = array();
+ }
+ //Get common information from database
+ foreach($comms as $media)
+ {
+ $comms_search[] =
$this->search_comm_descr($media);
+ }
+ if (count($comms_search) > 0)
+ {
+ $comms_data = array('comm_data', 'comm_descr');
+ //foreach ($comms_search[])
+ }
+ $this->request(array_merge($comm_data, $field_list,
$categories));
+ }
+
function add($owner,$fields,$access='',$cat_id='',$tid='n')
{
***************
*** 823,826 ****
--- 860,864 ----
}
$sql = $this->get_sql();
+
if ($limit)
{
***************
*** 863,869 ****
'per_department',
'per_initials',
! 'per_sound');
$this->request($data);
! $this->criteria(array('contact_id' => $contact_id));
return $this->get_query($action, __LINE__, __FILE__);
}
--- 901,909 ----
'per_department',
'per_initials',
! 'per_sound',
! 'org_name',
! 'people');
$this->request($data);
! $this->criteria(array('contact_id' => $contact_id,
'my_preferred' => 'Y'));
return $this->get_query($action, __LINE__, __FILE__);
}
***************
*** 1393,1397 ****
/**
! * Search communication description id in communications
description catalog
*
* @param integer $id The communication description id to find
--- 1433,1437 ----
/**
! * Search communication id in communications description catalog
*
* @param integer $id The communication description id to find
***************
*** 1404,1408 ****
/**
! * Search communication description in communucations
description catalog
*
* @param string $description The communication type to find
--- 1444,1448 ----
/**
! * Search communication description in communications
description catalog
*
* @param string $description The communication type to find
***************
*** 1456,1459 ****
--- 1496,1503 ----
$principal['cat_id'] =
$this->get_categories($principal['cat_id']);
}
+ if(!isset($principal['owner']))
+ {
+ $principal['owner'] =
$GLOBALS['phpgw_info']['user']['account_id'];
+ }
return $contact->update($principal,
sql_criteria::_equal('contact_id',sql::integer($cid)), $action);
}
***************
*** 1466,1470 ****
* @param integer $action PHPGW_SQL_RETURN_SQL |
PHPGW_SQL_RUN_SQL depending what we want
*/
! function edit_person($id, $data, $action=PHPGW_SQL_RETURN_SQL)
{
$person = CreateObject('phpgwapi.contact_person');
--- 1510,1514 ----
* @param integer $action PHPGW_SQL_RETURN_SQL |
PHPGW_SQL_RUN_SQL depending what we want
*/
! function edit_person($id, $data, $action=PHPGW_SQL_RUN_SQL)
{
$person = CreateObject('phpgwapi.contact_person');
***************
*** 1555,1559 ****
{
$this->contact =
CreateObject('phpgwapi.contact_central');
! $owner = $GLOBALS['phpgw_info']['user']['account_id'];
$this->lock_table($this->contact->table);
--- 1599,1603 ----
{
$this->contact =
CreateObject('phpgwapi.contact_central');
! $owner =
$principal['owner']?$principal['owner']:$GLOBALS['phpgw_info']['user']['account_id'];
$this->lock_table($this->contact->table);
***************
*** 1615,1622 ****
$this->org = CreateObject('phpgwapi.contact_org');
$this->lock_table($this->org->table);
! $principal['org_creaton']=1;
! $principal['org_creatby']=1;
! $principal['org_modon']=1;
! $principal['org_modby']=1;
$execute = $this->_add($principal,'org','org_id',$cid,
$action);
--- 1659,1666 ----
$this->org = CreateObject('phpgwapi.contact_org');
$this->lock_table($this->org->table);
! $principal['org_creaton'] = $this->get_mkdate();
! $principal['org_creatby'] = $this->get_user_id();
! $principal['org_modon'] = $this->get_mkdate();
! $principal['org_modby'] = $this->get_user_id();
$execute = $this->_add($principal,'org','org_id',$cid,
$action);
***************
*** 1636,1643 ****
$this->person = CreateObject('phpgwapi.contact_person');
$this->lock_table($this->person->table);
! $principal['per_creaton'] = 1;
! $principal['per_creatby'] = 1;
! $principal['per_modon'] = 1;
! $principal['per_modby'] = 1;
$execute =
$this->_add($principal,'person','person_id',$cid, $action);
--- 1680,1687 ----
$this->person = CreateObject('phpgwapi.contact_person');
$this->lock_table($this->person->table);
! $principal['per_creaton'] = $this->get_mkdate();
! $principal['per_creatby'] = $this->get_user_id();
! $principal['per_modon'] = $this->get_mkdate();
! $principal['per_modby'] = $this->get_user_id();
$execute =
$this->_add($principal,'person','person_id',$cid, $action);
***************
*** 1666,1673 ****
{
$this->relations =
CreateObject('phpgwapi.contact_org_person');
! $this->lock_table($this->relations->table);
$data['my_person_id'] = $person;
! $data['my_creaton'] = 1;
! $data['my_creatby'] = 1;
$sql[] = $this->_add($data,'relations',
'my_org_id', $cid, $action);
$this->unlock_table();
--- 1710,1720 ----
{
$this->relations =
CreateObject('phpgwapi.contact_org_person');
! if ($action == PHPGW_SQL_RUN_SQL)
! {
!
$this->lock_table($this->relations->table);
! }
$data['my_person_id'] = $person;
! $data['my_creaton'] = $this->get_mkdate();
! $data['my_creatby'] = $this->get_user_id();
$sql[] = $this->_add($data,'relations',
'my_org_id', $cid, $action);
$this->unlock_table();
***************
*** 1692,1696 ****
{
$this->relations =
CreateObject('phpgwapi.contact_org_person');
!
$this->lock_table($this->relations->table);
$data['my_org_id'] = $org;
$data['my_addr_id'] = $addr_id;
--- 1739,1746 ----
{
$this->relations =
CreateObject('phpgwapi.contact_org_person');
! if ($action == PHPGW_SQL_RUN_SQL)
! {
!
$this->lock_table($this->relations->table);
! }
$data['my_org_id'] = $org;
$data['my_addr_id'] = $addr_id;
***************
*** 1703,1708 ****
$data['my_preferred'] = 'N';
}
! $data['my_creaton'] = 1;
! $data['my_creatby'] = 1;
$sql[] = $this->_add($data,'relations',
'my_person_id', $cid, $action);
$this->unlock_table();
--- 1753,1758 ----
$data['my_preferred'] = 'N';
}
! $data['my_creaton'] =
$this->get_mkdate();
! $data['my_creatby'] =
$this->get_user_id();
$sql[] = $this->_add($data,'relations',
'my_person_id', $cid, $action);
$this->unlock_table();
***************
*** 1727,1734 ****
}
! $location['addr_creatby']=1;
! $location['addr_modby']=1;
! $location['addr_creaton']=1;
! $location['addr_modon']=1;
unset($location['key_addr_id']);
--- 1777,1784 ----
}
! $location['addr_creatby'] = $this->get_user_id();
! $location['addr_modby'] = $this->get_user_id();
! $location['addr_creaton'] = $this->get_mkdate();
! $location['addr_modon'] = $this->get_mkdate();
unset($location['key_addr_id']);
***************
*** 1752,1759 ****
}
! $comm['comm_creatby']=1;
! $comm['comm_modby']=1;
! $comm['comm_creaton'] = 1;
! $comm['comm_modon'] = 1;
unset($comm['key_comm_id']);
--- 1802,1809 ----
}
! $comm['comm_creatby'] = $this->get_user_id();
! $comm['comm_modby'] = $this->get_user_id();
! $comm['comm_creaton'] = $this->get_mkdate();
! $comm['comm_modon'] = $this->get_mkdate();
unset($comm['key_comm_id']);
***************
*** 2299,2302 ****
--- 2349,2361 ----
}
+ function get_account_id($contact_id)
+ {
+ $this->request('account_id');
+ $this->criteria(array('account_person_id' =>
$contact_id));
+ $user = $this->get_records(__LINE__, __FILE__);
+ return $user[0]['account_id'];
+ }
+
+
/**
* Decide if contact exist
***************
*** 2410,2418 ****
function search_catalog($field_to_search, $value_to_search,
$field, $catalog)
{
! foreach ($this->$catalog as $key => $value)
{
! if ($value[$field_to_search] ==
$value_to_search)
{
! return $value[$field];
}
}
--- 2469,2480 ----
function search_catalog($field_to_search, $value_to_search,
$field, $catalog)
{
! if(is_array($this->$catalog))
{
! foreach ($this->$catalog as $key => $value)
{
! if ($value[$field_to_search] ==
$value_to_search)
! {
! return $value[$field];
! }
}
}
***************
*** 2498,2501 ****
--- 2560,2587 ----
}
+ function search($search_fields, $pattern, $data='contact_id')
+ {
+ if(count($search_fields) > 0 && $pattern)
+ {
+ foreach($search_fields as $field)
+ {
+ $search_array[] =
sql_criteria::token_has($field, $pattern);
+ }
+ $criteria =
sql_criteria::_append_or($search_array);
+ }
+
+ $this->request('contact_id');
+ $this->criteria_token($criteria);
+ $records = $this->get_records(__LINE__, __FILE__);
+ if(is_array($records))
+ {
+ foreach($records as $key => $value)
+ {
+ $info[] = $value['contact_id'];
+ }
+ }
+ return $info;
+ }
+
function get_contacts_shared($owner_id,
$acl_type=PHPGW_ACL_READ)
{
***************
*** 2530,2533 ****
--- 2616,2621 ----
$principal = $this->$get_data_type($contact_id);
+ unset($principal[0]['owner']);
+
$cats = explode(",", $principal[0]['cat_id']);
foreach($cats as $cat)
***************
*** 2573,2578 ****
$this->relations =
CreateObject('phpgwapi.contact_org_person');
$this->lock_table($this->relations->table);
! $data['my_creaton'] = 1;
! $data['my_creatby'] = 1;
$sql[] = $this->_add($data,
'relations', 'my_person_id', $new_person_id, PHPGW_SQL_RUN_SQL);
$this->unlock_table();
--- 2661,2666 ----
$this->relations =
CreateObject('phpgwapi.contact_org_person');
$this->lock_table($this->relations->table);
! $data['my_creaton'] =
$this->get_mkdate();
! $data['my_creatby'] =
$this->get_user_id();
$sql[] = $this->_add($data,
'relations', 'my_person_id', $new_person_id, PHPGW_SQL_RUN_SQL);
$this->unlock_table();
***************
*** 2596,2601 ****
$this->relations =
CreateObject('phpgwapi.contact_org_person');
$this->lock_table($this->relations->table);
! $data['my_creaton'] = 1;
! $data['my_creatby'] = 1;
$sql[] = $this->_add($data,'relations',
'my_org_id', $new_organization_id, PHPGW_SQL_RUN_SQL);
$this->unlock_table();
--- 2684,2689 ----
$this->relations =
CreateObject('phpgwapi.contact_org_person');
$this->lock_table($this->relations->table);
! $data['my_creaton'] =
$this->get_mkdate();
! $data['my_creatby'] =
$this->get_user_id();
$sql[] = $this->_add($data,'relations',
'my_org_id', $new_organization_id, PHPGW_SQL_RUN_SQL);
$this->unlock_table();
***************
*** 2677,2681 ****
}
-
function lock_table($table, $action=PHPGW_SQL_RUN_SQL)
{
--- 2765,2768 ----
***************
*** 2792,2795 ****
--- 2879,2893 ----
return $addr_id[0]['key_addr_id'];
}
+
+ function get_mkdate()
+ {
+ $date = mktime (2,0,0,date("m")
,date("d")+1,date("Y"));
+ return $date;
+ }
+
+ function get_user_id()
+ {
+ return $GLOBALS['phpgw_info']['user']['account_id'];
+ }
}
?>
Index: class.contact_org_person.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/phpgwapi/inc/Attic/class.contact_org_person.inc.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** class.contact_org_person.inc.php 3 Oct 2003 00:24:37 -0000 1.1.2.3
--- class.contact_org_person.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.4
***************
*** 65,68 ****
--- 65,70 ----
$this->add_criteria($criteria);
}
+ $this->set_ilinks('my_org_id',
'phpgwapi.contact_org','org_id');
+ $this->set_ilinks('my_person_id',
'phpgwapi.contact_person','person_id') ;
}
***************
*** 72,76 ****
$new_criteria = sql_criteria::equal($field,
$element['value']);
$this->_add_criteria($new_criteria);
- $this->set_ilinks('my_org_id',
'phpgwapi.contact_org','org_id');
}
--- 74,77 ----
***************
*** 80,84 ****
$new_criteria = sql_criteria::equal($field,
$element['value']);
$this->_add_criteria($new_criteria);
! $this->set_ilinks('my_person_id',
'phpgwapi.contact_person','person_id') ;
}
--- 81,85 ----
$new_criteria = sql_criteria::equal($field,
$element['value']);
$this->_add_criteria($new_criteria);
! $this->set_ilinks('my_person_id',
'phpgwapi.contact_person','person_id');
}
***************
*** 93,96 ****
--- 94,106 ----
$this->_add_field(array('field' => 'my_person_id',
'real_field' => 'person_id'));
$this->set_ilinks('my_person_id',
'phpgwapi.contact_person','person_id');
+ }
+
+ function criteria_my_preferred($element)
+ {
+ $field = $this->put_alias($element['real_field']);
+ $criteria =
sql_criteria::or_(sql_criteria::equal($field, sql::string($element['value'])),
+
sql_criteria::is_null($field));
+ $this->_add_criteria($criteria);
+ return $criteria;
}
}
Index: class.bojsaddressbook.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/phpgwapi/inc/Attic/class.bojsaddressbook.inc.php,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** class.bojsaddressbook.inc.php 13 Sep 2003 07:11:42 -0000 1.1.2.2
--- class.bojsaddressbook.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.3
***************
*** 62,70 ****
//A list of contacts, each having their own fields given by
this array.
var $mass_query_cols = array (
! 'per_title' => 'per_title',
! 'per_first_name' => 'per_first_name',
! 'per_last_name' => 'per_last_name',
! 'org_name' => 'org_name',
! 'contact_id' => 'contact_id'
);
//@param single_query_cols This array is similar to the one
above except this is for
--- 62,71 ----
//A list of contacts, each having their own fields given by
this array.
var $mass_query_cols = array (
! // 'per_title' ,
! 'per_first_name' ,
! 'per_last_name' ,
! 'contact_id'
! // 'my_org_id',
! // 'org_name'
);
//@param single_query_cols This array is similar to the one
above except this is for
***************
*** 76,84 ****
//the names of each field in english. Use it to decide what
values to add here
var $single_query_cols = array (
! 'per_title' => 'per_title',
! 'per_first_name' => 'per_first_name',
! 'per_last_name' => 'per_last_name',
! 'org_name' => 'org_name',
! 'contact_id' => 'contact_id'
);
--- 77,89 ----
//the names of each field in english. Use it to decide what
values to add here
var $single_query_cols = array (
! 'per_title',
! 'per_first_name',
! 'per_last_name' ,
! 'per_department',
! 'contact_id' ,
! 'addr_add1',
! 'addr_add2',
! 'addr_city',
! 'addr_country'
);
***************
*** 149,159 ****
{
$this->parse_contactquery($contactquery);
! if(is_array($this->filters))
{
! // print '<BR><B>NORMAL
QUERY</B><BR>';
$data['result']=$this->contactsobject->get_persons(
$this->mass_query_cols,'','','','',
$this->filters
);
}
elseif($this->filters == 'directory')
--- 154,188 ----
{
$this->parse_contactquery($contactquery);
! //Searching freely in all fields
! if($contactquery['query']!='')
{
!
! //print
"<BR><B>".print_r($this->mass_query_cols)." searcvhing".
!
$contactquery['query']."</B><BR>";
!
$precriteria=$this->contactsobject->criteria_for_index(
!
$GLOBALS['phpgw_info']['user']['account_id'],
! PHPGW_CONTACTS_ALL,
!
($this->filters['sel_cat_id'] ? $this->filters['sel_cat_id'] :
!
PHPGW_CONTACTS_CATEGORIES_ALL),
! $this->mass_query_cols,
$contactquery['query']);
!
! //print
"<BR><B>Precriteria</B><BR>";
! //print_r($precriteria);
!
$data['result']=$this->contactsobject->get_persons(
!
$this->mass_query_cols,'','','','','',
! $precriteria
! );
! }
! elseif(is_array($this->filters))
! {
! //print '<BR><B>NORMAL
QUERY</B><BR>';
! // print_r($this->mass_query_cols);
! // print_r($this->filters);
$data['result']=$this->contactsobject->get_persons(
$this->mass_query_cols,'','','','',
$this->filters
);
+
+ // print_r($data);
}
elseif($this->filters == 'directory')
***************
*** 168,172 ****
$contacts[] =
$id['contact_id'];
}
! //
print '<BR><B>Fed to comm_contact'.var_export($contacts).'</B><BR>';
$entries_comm =
$this->contactsobject->get_comm_contact_data($contacts, $this->commtypes);
--- 197,201 ----
$contacts[] =
$id['contact_id'];
}
! //
print '<BR><B>Fed to comm_contact'.print_r($contacts).'</B><BR>';
$entries_comm =
$this->contactsobject->get_comm_contact_data($contacts, $this->commtypes);
***************
*** 216,221 ****
$notfirsttime=False;
// while(list($k,$v)=each($contactquery))
! // print '<BR><B>Contactyquery</B><BR>';
! // print_r($contactquery);
foreach ($contactquery as $k => $v)
{
--- 245,250 ----
$notfirsttime=False;
// while(list($k,$v)=each($contactquery))
! //print '<BR><B>Contactyquery</B><BR>';
! //print_r($contactquery);
foreach ($contactquery as $k => $v)
{
***************
*** 229,242 ****
case 'none':
{
!
$this->filters = array('owner' => array_keys(array_keys($this->grants)));
}
case
'user_only':
{
!
$this->filters= array('owner' => $GLOBALS['phpgw_info']['user']['account_id']);
break;
}
case
'directory':
{
!
$this->filters='directory';
$notfirsttime=True;
break;
--- 258,276 ----
case 'none':
{
!
//print_r($this->grants);
!
$this->filters ['owner'] = array_keys($this->grants);
!
//$this->filters['OWNER_CONSTANT']=PHPGW_CONTACTS_ALL;
!
break;
}
case
'user_only':
{
!
$this->filters['owner'] = $GLOBALS['phpgw_info']['user']['account_id'];
!
//$this->filters['OWNER_CONSTANT']=PHPGW_CONTACTS_MINE;
break;
}
case
'directory':
{
!
$this->filters['owner']='addressmaster';
!
//$this->filters['OWNER_CONSTANT']=PHPGW_CONTACTS_PRIVATE;
$notfirsttime=True;
break;
***************
*** 244,256 ****
case 'private':
{
!
$this->filters=array(
!
'owner' => $GLOBALS['phpgw_info']['user']['account_id'],
!
'access' => 'private');
!
break;
! }
! case
'directory':
! {
!
!
$notfirsttime=True;
break;
}
--- 278,283 ----
case 'private':
{
!
$this->filters['owner'] = $GLOBALS['phpgw_info']['user']['account_id'];
!
$this->filter['access'] = 'private';
break;
}
***************
*** 261,267 ****
case 'categories':
{
! if($v)
{
! $notfirsttime=true;
}
break;
--- 288,294 ----
case 'categories':
{
! if($v!='')
{
!
$this->filters['sel_cat_id']=$v;
}
break;
***************
*** 276,281 ****
}//end switch
}//end while
! // print "<BR> built query";
! // print_r($this->filters);
}//end function
--- 303,309 ----
}//end switch
}//end while
! //print "<BR> built query";
! // $this->filters['my_preferred']='Y';
! //print_r($this->filters);
}//end function
***************
*** 296,301 ****
function recordinfo($addy_id)
{
$entry = $this->contactsobject->get_persons(
! $this->single_query_cols,"",array("contact_id" =>
"$addy_id"));
if(!$entry[0])
{
--- 324,330 ----
function recordinfo($addy_id)
{
+ //print "<BR><B>CID".$addy_id."</B><BR>";
$entry = $this->contactsobject->get_persons(
! $this->single_query_cols,"","","","",array("contact_id"
=> "$addy_id"));
if(!$entry[0])
{
***************
*** 515,519 ****
return $data;
}
!
}
?>
--- 544,553 ----
return $data;
}
! //@function display_name
! //Changes a false addressbook field into the correct string in
the current language
! function display_name($fieldname)
! {
! $this->contactsobject->display_name($fieldname);
! }
}
?>
Index: class.contact_person.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/phpgwapi/inc/Attic/class.contact_person.inc.php,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** class.contact_person.inc.php 3 Oct 2003 00:24:37 -0000 1.1.2.4
--- class.contact_person.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.5
***************
*** 13,16 ****
--- 13,23 ----
'field'
=> '',
'type'
=> 'integer'),
+ 'per_full_name' => array('select'
=> 'full_name',
+ 'criteria'
=> '',
+ 'insert'
=> '',
+ 'update'
=> '',
+ 'delete'
=> '',
+ 'sort'
=> '',
+ 'field'
=> ''),
'per_first_name' => array('select'
=> '',
'criteria'
=> '',
***************
*** 248,252 ****
'delete'
=> '',
'sort'
=> '',
! 'field'
=> 'person_id'));
function contact_person ($ali = '', $field = '', $criteria =
'')
--- 255,260 ----
'delete'
=> '',
'sort'
=> '',
! 'field'
=> 'person_id'),
! 'organizations' => array('select'
=>'unlink_person'));
function contact_person ($ali = '', $field = '', $criteria =
'')
***************
*** 282,285 ****
--- 290,306 ----
{
$this->add_field('count_persons', 'count(person_id)');
+ }
+
+ function full_name()
+ {
+
+ $this->add_field('per_full_name',
sql::concat_null(array($this->real_field('per_first_name'), sql::string(' '),
+
$this->real_field('per_middle_name'), sql::string(' '),
+
$this->real_field('per_last_name'))));
+ }
+
+ function unlink_person()
+ {
+ unset($this->ilink['phpgwapi.contact_central']);
}
}
Index: class.uijsaddressbook.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/phpgwapi/inc/Attic/class.uijsaddressbook.inc.php,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** class.uijsaddressbook.inc.php 13 Sep 2003 07:11:42 -0000 1.1.2.2
--- class.uijsaddressbook.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.3
***************
*** 168,222 ****
//This array converts field names of the contact backend (or
the bo class for that matter)
//to english so they can be passed through a lang call to be
shown to the user
! var $field_trans = array(
! 'fn' => 'full name',
! 'sound' => 'Sound',
! 'org_name' => 'company name',
! 'org_unit' => 'department',
! 'title' => 'title',
! 'n_prefix' => 'prefix',
! 'per_first_name' => 'first name',
! 'n_middle' => 'middle name',
! 'per_last_name' => 'last name',
! 'n_suffix' => 'suffix',
! 'label' => 'label',
! 'adr_one_street' => 'business street',
! 'adr_one_locality' => 'business city',
! 'adr_one_region' => 'business state',
! 'adr_one_postalcode' => 'business zip code',
! 'adr_one_countryname' => 'business country',
! 'adr_one_type' => 'business address
type',
! 'adr_two_street' => 'home street',
! 'adr_two_locality' => 'home city',
! 'adr_two_region' => 'home state',
! 'adr_two_postalcode' => 'home zip code',
! 'adr_two_countryname' => 'home country',
! 'adr_two_type' => 'home address type',
! 'tz' => 'time zone',
! 'geo' => 'geo',
! 'tel_work' => 'business phone',
! 'tel_home' => 'home phone',
! 'tel_voice' => 'voice phone',
! 'tel_msg' => 'message phone',
! 'tel_fax' => 'fax',
! 'tel_pager' => 'pager',
! 'tel_cell' => 'mobile phone',
! 'tel_bbs' => 'bbs phone',
! 'tel_modem' => 'modem phone',
! 'tel_isdn' => 'isdn phone',
! 'tel_car' => 'car phone',
! 'tel_video' => 'video phone',
! 'tel_prefer' => 'preferred phone',
! 'email' => 'business email',
! 'email_type' => 'business email type',
! 'email_home' => 'home email',
! 'email_home_type' => 'home email type',
! 'address2' => 'address line 2',
! 'address3' => 'address line 3',
! 'ophone' => 'Other Phone',
! 'bday' => 'birthday',
! 'url' => 'url',
! 'pubkey' => 'public key',
! 'note' => 'notes'
! );
//@function uijsaddressbook constructor
--- 168,172 ----
//This array converts field names of the contact backend (or
the bo class for that matter)
//to english so they can be passed through a lang call to be
shown to the user
! var $field_trans = "in_constructor";
//@function uijsaddressbook constructor
***************
*** 962,965 ****
--- 912,916 ----
));
$this->bo=CreateObject("phpgwapi.bojsaddressbook");
+
$this->field_trans=$this->bo->contactsobject->contact_fields['showable'];
$data = $this->bo->recordinfo($this->nameselect);
if(!$data)
Index: class.sql_builder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/Attic/class.sql_builder.inc.php,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** class.sql_builder.inc.php 2 Oct 2003 22:23:54 -0000 1.1.2.8
--- class.sql_builder.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.9
***************
*** 172,176 ****
$this->ldebug('sort_by_distances',
array('Distances' => $this->distance,
! 'Path' => array_keys($this->path)),
'dump');
$this->entity_to_center($entity_far_away,
--- 172,178 ----
$this->ldebug('sort_by_distances',
array('Distances' => $this->distance,
! 'Path' => array_keys($this->path),
! 'Entity Distance' =>
$entity_distance,
! 'Entity far away' =>
$entity_far_away),
'dump');
$this->entity_to_center($entity_far_away,
***************
*** 234,238 ****
'entity
this iteration' => $entity,
'Actual
distance' => $dist));
! if ($dist < $min_distance)
{
//We found a good one
--- 236,241 ----
'entity
this iteration' => $entity,
'Actual
distance' => $dist));
! $tmp = array_keys($this->path);
! if ($dist < $min_distance || ($min_distance ==
$entity_distance && !in_array($entity, $tmp)))
{
//We found a good one
***************
*** 321,325 ****
'dump');
$this->sort_by_distances();
- // var_dump($this->all_criteria);
foreach ($this->entities as $name => $class)
{
--- 324,327 ----
***************
*** 581,586 ****
{
list($entity_name, $entity) =
$this->instance_entity_by_field($field);
- // echo "<br>field is ";
- // var_dump($field);
$entity->set_operation($operation);
return
$entity->real_field($entity->put_real_alias($field));
--- 583,586 ----
***************
*** 1165,1173 ****
function ldebug($myfoo, $data, $type = 'string', $err = '')
{
! // if (!((($myfoo != 'SQL') xor
! // ($myfoo != 'criteria')) xor
// ($myfoo == '')) xor
// ($myfoo == ''))
! // if ($myfoo != 'SQL')
// {
return;
--- 1165,1173 ----
function ldebug($myfoo, $data, $type = 'string', $err = '')
{
! // if (!((($myfoo != 'entity_to_center') xor
! // ($myfoo != 'sort_by_distances')) xor
// ($myfoo == '')) xor
// ($myfoo == ''))
! // if ($myfoo != 'sort_by_distances')
// {
return;
***************
*** 1196,1200 ****
{
$output .= " -$vari = ";
! $output .= var_dump($value)."\n<br>";
}
break;
--- 1196,1200 ----
{
$output .= " -$vari = ";
! $output .= var_dump($value,
True)."\n<br>";
}
break;
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.121.2.13.2.14
retrieving revision 1.121.2.13.2.15
diff -C2 -d -r1.121.2.13.2.14 -r1.121.2.13.2.15
*** functions.inc.php 29 Sep 2003 00:20:16 -0000 1.121.2.13.2.14
--- functions.inc.php 4 Oct 2003 23:42:36 -0000 1.121.2.13.2.15
***************
*** 218,221 ****
--- 218,225 ----
$GLOBALS['phpgw']->preferences = CreateObject('phpgwapi.preferences');
$GLOBALS['phpgw']->applications = CreateObject('phpgwapi.applications');
+ if($GLOBALS['phpgw_info']['flags']['enable_class_contacts'] == True)
+ {
+ $GLOBALS['phpgw']->contacts =
CreateObject('phpgwapi.contacts');
+ }
print_debug('main class loaded', 'messageonly','api');
if (!
isset($GLOBALS['phpgw_info']['flags']['included_classes']['error']) ||
Index: class.contact_org.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/Attic/class.contact_org.inc.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** class.contact_org.inc.php 3 Oct 2003 00:24:37 -0000 1.1.2.3
--- class.contact_org.inc.php 4 Oct 2003 23:42:36 -0000 1.1.2.4
***************
*** 82,86 ****
'delete' => '',
'sort' => '',
! 'field' => ''));
function contact_org ($ali = '', $field = '', $criteria =
'')
--- 82,87 ----
'delete' => '',
'sort' => '',
! 'field' => ''),
! 'people' => array('select' =>
'unlink_org'));
function contact_org ($ali = '', $field = '', $criteria =
'')
***************
*** 115,118 ****
--- 116,124 ----
{
$this->add_field('count_orgs', 'count(org_id)');
+ }
+
+ function unlink_org()
+ {
+ unset($this->ilink['phpgwapi.contact_central']);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/inc class.bojsaddressbook.inc.php, 1.1.2.2, 1.1.2.3 class.contact_accounts.inc.php, 1.1.2.3, 1.1.2.4 class.contact_org.inc.php, 1.1.2.3, 1.1.2.4 class.contact_org_person.inc.php, 1.1.2.3, 1.1.2.4 class.contact_person.inc.php, 1.1.2.4, 1.1.2.5 class.contacts_sql.inc.php, 1.17.2.2.2.15, 1.17.2.2.2.16 class.sql_builder.inc.php, 1.1.2.8, 1.1.2.9 class.uijsaddressbook.inc.php, 1.1.2.2, 1.1.2.3 functions.inc.php, 1.121.2.13.2.14, 1.121.2.13.2.15,
Dave Hall <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] phpgwapi/setup tables_baseline.inc.php, 1.5, 1.5.4.1
- Next by Date:
[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.21, 1.36.2.15.2.22 class.soaddressbook.inc.php, 1.14.2.3.2.12, 1.14.2.3.2.13 class.catalog_manager.inc.php, 1.1.2.1, 1.1.2.2
- Previous by thread:
[Phpgroupware-cvs] phpgwapi/setup tables_baseline.inc.php, 1.5, 1.5.4.1
- Next by thread:
[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.21, 1.36.2.15.2.22 class.soaddressbook.inc.php, 1.14.2.3.2.12, 1.14.2.3.2.13 class.catalog_manager.inc.php, 1.1.2.1, 1.1.2.2
- Index(es):