[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.1
From: |
Jonathan Rivera <address@hidden> |
Subject: |
[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.31, 1.36.2.15.2.32 class.boaddressbook.inc.php, 1.21.2.2.2.20, 1.21.2.2.2.21 |
Date: |
Tue, 18 Nov 2003 00:30:11 +0000 |
Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv31512/addressbook/inc
Modified Files:
Tag: Version-0_9_16-branch
class.uiaddressbook.inc.php class.boaddressbook.inc.php
Log Message:
jscalendar support and optimization in index
Index: class.boaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.boaddressbook.inc.php,v
retrieving revision 1.21.2.2.2.20
retrieving revision 1.21.2.2.2.21
diff -C2 -d -r1.21.2.2.2.20 -r1.21.2.2.2.21
*** class.boaddressbook.inc.php 3 Nov 2003 20:32:47 -0000 1.21.2.2.2.20
--- class.boaddressbook.inc.php 18 Nov 2003 00:30:06 -0000 1.21.2.2.2.21
***************
*** 535,541 ****
* @return array The array with all communications media for
this contact
*/
! function get_comm_contact_data($contacts, $fields_comms='')
{
! return $this->so->get_comm_contact_data($contacts,
$fields_comms);
}
--- 535,562 ----
* @return array The array with all communications media for
this contact
*/
! function get_comm_contact_data($contacts, $fields_comms='',
$simple=False)
{
! $data = $this->so->get_comm_contact_data($contacts,
$fields_comms);
! if($simple==True)
! {
! return $data;
! }
!
! if(is_array($data))
! {
! foreach($data as $key => $value)
! {
!
$comm_data[$value['comm_contact_id']][$value['comm_description']] =
$value['comm_data'];
! if($value['comm_preferred']=='Y')
! {
!
$comm_data[$value['comm_contact_id']]['preferred'] = $value['comm_description'];
! }
! }
! }
! else
! {
! $comm_data = array();
! }
! return $comm_data;
}
***************
*** 543,548 ****
{
$entries = $this->so->get_persons($fields, $start,
$limit, $orderby, $sort, $criteria, $token_criteria);
$this->total = $this->so->contacts->total_records;
! return $entries;
}
--- 564,580 ----
{
$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;
}
***************
*** 550,555 ****
{
$entries = $this->so->get_orgs($fields, $start,
$limit, $orderby, $sort, $criteria, $token_criteria);
$this->total = $this->so->contacts->total_records;
! return $entries;
}
--- 582,598 ----
{
$entries = $this->so->get_orgs($fields, $start,
$limit, $orderby, $sort, $criteria, $token_criteria);
+ if(is_array($entries))
+ {
+ foreach($entries as $data)
+ {
+ $orgs[$data['contact_id']] = $data;
+ }
+ }
+ else
+ {
+ $orgs = array();
+ }
$this->total = $this->so->contacts->total_records;
! return $orgs;
}
Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.36.2.15.2.31
retrieving revision 1.36.2.15.2.32
diff -C2 -d -r1.36.2.15.2.31 -r1.36.2.15.2.32
*** class.uiaddressbook.inc.php 12 Nov 2003 18:42:04 -0000 1.36.2.15.2.31
--- class.uiaddressbook.inc.php 18 Nov 2003 00:30:05 -0000 1.36.2.15.2.32
***************
*** 286,301 ****
$entries = $this->bo->$get_data_function($fields,
$this->limit, $this->start, $this->order, $this->sort, '', $criteria);
! if (!is_array($entries))
! {
! $entries=array();
! }
!
! if(count($fields_comms)>0)
{
! foreach ($entries as $id)
{
! $contacts[] = $id['contact_id'];
}
! $this->entries_comm =
$this->bo->get_comm_contact_data($contacts, $fields_comms);
}
--- 286,299 ----
$entries = $this->bo->$get_data_function($fields,
$this->limit, $this->start, $this->order, $this->sort, '', $criteria);
! if(is_array($entries))
{
! if(count($fields_comms)>0)
{
! $this->entries_comm =
$this->bo->get_comm_contact_data(array_keys($entries), $fields_comms);
}
! }
! else
! {
! $entries=array();
}
***************
*** 564,569 ****
//start to draw the add window
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
//draw the tabs and detail form
--- 562,567 ----
//start to draw the add window
! // $GLOBALS['phpgw']->common->phpgw_header();
! // echo parse_navbar();
//draw the tabs and detail form
***************
*** 655,660 ****
//start to draw the add window
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
//draw the tabs and detail form
--- 653,658 ----
//start to draw the add window
! // $GLOBALS['phpgw']->common->phpgw_header();
! // echo parse_navbar();
//draw the tabs and detail form
***************
*** 775,780 ****
//start to draw the add window
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
//draw the tabs and detail form
--- 773,778 ----
//start to draw the add window
! // $GLOBALS['phpgw']->common->phpgw_header();
! // echo parse_navbar();
//draw the tabs and detail form
***************
*** 866,871 ****
//start to draw the add window
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
//draw the tabs and detail form
--- 864,869 ----
//start to draw the add window
! // $GLOBALS['phpgw']->common->phpgw_header();
! // echo parse_navbar();
//draw the tabs and detail form
***************
*** 930,933 ****
--- 928,936 ----
function main_form($fields, $section, $form_tab)
{
+ $this->jscal = CreateObject('phpgwapi.jscalendar');
// before phpgw_header() !!!
+
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+
//print 'fields:<br>';
$js_submit = '';
***************
*** 1125,1152 ****
function person_form($fields)
{
! list( $month, $day, $year ) = split( '/',
$fields['per_birthday'] );
! $temp_month[$month] = ' selected';
! $bday_month = '<select name="' . 'entry[bday_month]' .
'">'
! . '<option value=""' . $temp_month[0] . '>'
. '</option>'
! . '<option value="1"' . $temp_month[1] . '>'
. lang('january') . '</option>'
! . '<option value="2"' . $temp_month[2] . '>'
. lang('february') . '</option>'
! . '<option value="3"' . $temp_month[3] . '>'
. lang('march') . '</option>'
! . '<option value="4"' . $temp_month[4] . '>'
. lang('april') . '</option>'
! . '<option value="5"' . $temp_month[5] . '>'
. lang('may') . '</option>'
! . '<option value="6"' . $temp_month[6] . '>'
. lang('june') . '</option>'
! . '<option value="7"' . $temp_month[7] . '>'
. lang('july') . '</option>'
! . '<option value="8"' . $temp_month[8] . '>'
. lang('august') . '</option>'
! . '<option value="9"' . $temp_month[9] . '>'
. lang('september') . '</option>'
! . '<option value="10"' . $temp_month[10] . '>'
. lang('october') . '</option>'
! . '<option value="11"' . $temp_month[11] . '>'
. lang('november') . '</option>'
! . '<option value="12"' . $temp_month[12] . '>'
. lang('december') . '</option>'
! . '</select>';
! $bday_day = '<input type="text" name="' .
'entry[bday_day]' . '" size="2" maxlength="2" value="'
! . $day . '">';
! $bday_year = '<input type="text" name="' .
'entry[bday_year]' . '" size="4" maxlength="4" value="'
! . $year . '">';
!
! $bday =
$GLOBALS['phpgw']->common->dateformatorder($bday_year,$bday_month,$bday_day)
! . '<font face="'.$theme["font"].'"
size="-2">(e.g. 1969)</font>';
if ($fields['ispublic']=='private')
--- 1128,1132 ----
function person_form($fields)
{
! $bday =
$this->jscal->input('entry[per_birthday]',$fields['per_birthday']);
if ($fields['ispublic']=='private')
***************
*** 1838,1846 ****
if($load_vars[$this->tab_comms]=='db')
{
! $data =
$this->bo->get_comm_contact_data($this->contact_id);
! if(!is_array($data))
! {
! $data = array();
! }
foreach($data as $key => $value)
{
--- 1818,1822 ----
if($load_vars[$this->tab_comms]=='db')
{
! $data =
$this->bo->get_comm_contact_data($this->contact_id,'',True);
foreach($data as $key => $value)
{
***************
*** 1981,1989 ****
$entry['access'] = 'public';
}
-
- //mini hack for save birthday
- $entry['per_birthday'] = $entry['bday_month'] .
'/'
- . $entry['bday_day'] . '/'
- . $entry['bday_year'];
$this->record_name = $entry['per_first_name'].
--- 1957,1960 ----
***************
*** 2610,2615 ****
function view_contact($contact_id='', $contact_type='',
$referer='')
{
- $comms_media = array();
-
$contact_id = (empty($contact_id))? get_var('ab_id') :
$contact_id;
$contact_type =
$contact_type?$contact_type:$this->bo->search_contact_type_id(
--- 2581,2584 ----
***************
*** 2670,2681 ****
$comms = $this->bo->get_comm_contact_data($contact_id);
!
! if(is_array($comms))
{
! foreach($comms as $key => $data)
! {
! $contacts[$data['comm_description']] =
$data['comm_data'];
! $comms_media[] =
$data['comm_description'];
! }
}
--- 2639,2651 ----
$comms = $this->bo->get_comm_contact_data($contact_id);
!
! if(is_array($comms[$contact_id]))
{
! $contacts = $contacts + $comms[$contact_id];
! $comms_media[] =
array_keys($comms[$contact_id]);
! }
! else
! {
! $comms_media[0] = array();
}
***************
*** 2704,2708 ****
$tr_color = $GLOBALS['phpgw_info']['theme']['row_on'];
!
foreach($contacts as $field => $data)
{
--- 2674,2678 ----
$tr_color = $GLOBALS['phpgw_info']['theme']['row_on'];
!
foreach($contacts as $field => $data)
{
***************
*** 2711,2715 ****
$tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$this->template->set_var('th_bg',$tr_color);
! if(in_array($field, $comms_media))
{
$this->template->set_var('display_col',lang($field));
--- 2681,2685 ----
$tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$this->template->set_var('th_bg',$tr_color);
! if(in_array($field, $comms_media[0]))
{
$this->template->set_var('display_col',lang($field));
***************
*** 2785,2800 ****
function get_comm_value($contact_id, $column)
{
! if(!is_array($this->entries_comm))
! {
! $this->entries_comm=array();
! }
!
! foreach($this->entries_comm as $comms)
! {
! if($contact_id == $comms['comm_contact_id'] &&
$column == $comms['comm_description'])
! {
! return $comms['comm_data'];
! }
! }
}
--- 2755,2759 ----
function get_comm_value($contact_id, $column)
{
! return $this->entries_comm[$contact_id][$column];
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php, 1.36.2.15.2.31, 1.36.2.15.2.32 class.boaddressbook.inc.php, 1.21.2.2.2.20, 1.21.2.2.2.21,
Jonathan Rivera <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] api/skins/default account_mgr.xsl, 1.1.2.16, 1.1.2.17 acl_mgr.xsl, 1.1.2.3, 1.1.2.4
- Next by Date:
[Phpgroupware-cvs] phpgroupware xmlrpc.php,1.11.4.6,1.11.4.7
- Previous by thread:
[Phpgroupware-cvs] api/skins/default account_mgr.xsl, 1.1.2.16, 1.1.2.17 acl_mgr.xsl, 1.1.2.3, 1.1.2.4
- Next by thread:
[Phpgroupware-cvs] phpgroupware xmlrpc.php,1.11.4.6,1.11.4.7
- Index(es):