forked from extern/egroupware
Starting update to new template class - header redirects still an issue
This commit is contained in:
parent
2808bec6c5
commit
b0364b9491
@ -41,15 +41,25 @@
|
||||
$this->read_sessiondata();
|
||||
$this->use_session = True;
|
||||
}
|
||||
global $start,$limit,$query,$sort,$order,$filter,$cat_id;
|
||||
|
||||
if($start || $start == 0) { $this->start = $start; }
|
||||
if($limit) { $this->limit = $limit; }
|
||||
if($query) { $this->query = $query; }
|
||||
if($sort) { $this->sort = $sort; }
|
||||
if($order) { $this->order = $order; }
|
||||
if($filter) { $this->filter = $filter; }
|
||||
$this->cat_id = $cat_id;
|
||||
$start = intval(get_var('start', array('POST','GET')));
|
||||
$query = get_var('query', array('POST','GET'));
|
||||
$limit = get_var('limit', array('POST','GET'));
|
||||
$sort = get_var('sort', array('POST','GET'));
|
||||
$order = get_var('order', array('POST','GET'));
|
||||
$filter = get_var('filter', array('POST','GET'));
|
||||
$cat_id = get_var('fcat_id', array('POST'));
|
||||
|
||||
$this->start = (!empty($start) || ($start == '0')) ? $start : $this->start;
|
||||
$this->limit = (!empty($limit) || ($limit == '0')) ? $limit : $this->limit;
|
||||
$this->query = (empty($query) && !empty($this->query)) || !empty($query) ? $query : $this->query;
|
||||
$this->cquery = (empty($cquery) && !empty($this->cquery)) || !empty($cquery) ? $cquery : $this->cquery;
|
||||
$this->sort = (!empty($sort)) ? $sort : $this->sort;
|
||||
$this->order = (!empty($order)) ? $order : $this->order;
|
||||
$this->filter = (!empty($filter) || ($filter == '0')) ? $filter : $this->filter;
|
||||
|
||||
$this->cat_id = (isset($cat_id) && !empty($cat_id)) ? $cat_id : $this->cat_id;
|
||||
$this->cat_id = ($cat_id == '0' || $cat_id == 0 || $cat_id == '') ? $cat_id : $this->cat_id;
|
||||
}
|
||||
|
||||
function save_sessiondata()
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
class uiXport
|
||||
{
|
||||
var $template;
|
||||
var $output = '';
|
||||
var $public_functions = array(
|
||||
'import' => True,
|
||||
'export' => True
|
||||
@ -32,7 +32,6 @@
|
||||
|
||||
function uiXport()
|
||||
{
|
||||
$this->template = $GLOBALS['phpgw']->template;
|
||||
$this->cat = CreateObject('phpgwapi.categories');
|
||||
$this->bo = CreateObject('addressbook.boXport',True);
|
||||
$this->browser = CreateObject('phpgwapi.browser');
|
||||
@ -46,6 +45,15 @@
|
||||
$this->cat_id = $this->bo->cat_id;
|
||||
}
|
||||
|
||||
function totpl()
|
||||
{
|
||||
if(@isset($this->output) && !empty($this->output))
|
||||
{
|
||||
$GLOBALS['phpgw']->template->set_var('phpgw_body', $this->output,True);
|
||||
unset($this->output);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return a select form element with the categories option dialog in it */
|
||||
function cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
|
||||
{
|
||||
@ -108,9 +116,9 @@
|
||||
{
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
set_time_limit(0)
|
||||
set_time_limit(0);
|
||||
|
||||
$this->template->set_file(array('import' => 'import.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_file(array('import' => 'import.tpl'));
|
||||
|
||||
$dir_handle = opendir(PHPGW_APP_INC . SEP . 'import');
|
||||
$i=0; $myfilearray = '';
|
||||
@ -130,35 +138,36 @@
|
||||
$conv .= '<OPTION VALUE="' . $myfilearray[$i].'">' . $fname . '</OPTION>';
|
||||
}
|
||||
|
||||
$this->template->set_var('lang_cancel',lang('Cancel'));
|
||||
$this->template->set_var('lang_cat',lang('Select Category'));
|
||||
$this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$this->template->set_var('conversion',lang('Select the type of conversion'));
|
||||
$this->template->set_var('export_path',lang('Enter the path to the export file here'));
|
||||
$this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
|
||||
$this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
|
||||
$this->template->set_var('mark_private',lang('Mark records as private'));
|
||||
$this->template->set_var('help_import',lang('In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from'));
|
||||
$this->template->set_var('help_import2',lang('the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P>'));
|
||||
$this->template->set_var('none',lang('none'));
|
||||
$this->template->set_var('debug_browser',lang('Debug output in browser'));
|
||||
$this->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard'));
|
||||
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import'));
|
||||
$this->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False));
|
||||
$this->template->set_var('tsvfilename','');
|
||||
$this->template->set_var('conv',$conv);
|
||||
$this->template->set_var('debug',lang('Debug output in browser'));
|
||||
$this->template->set_var('filetype',lang('LDIF'));
|
||||
$this->template->set_var('download',lang('Submit'));
|
||||
$this->template->set_var('start',$this->start);
|
||||
$this->template->set_var('sort',$this->sort);
|
||||
$this->template->set_var('order',$this->order);
|
||||
$this->template->set_var('filter',$this->filter);
|
||||
$this->template->set_var('query',$this->query);
|
||||
$this->template->set_var('cat_id',$this->cat_id);
|
||||
$this->template->pparse('out','import');
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cat',lang('Select Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$GLOBALS['phpgw']->template->set_var('conversion',lang('Select the type of conversion'));
|
||||
$GLOBALS['phpgw']->template->set_var('export_path',lang('Enter the path to the export file here'));
|
||||
$GLOBALS['phpgw']->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('mark_private',lang('Mark records as private'));
|
||||
$GLOBALS['phpgw']->template->set_var('help_import',lang('In Netscape, open the Addressbook and select <b>Export</b> from the <b>File</b> menu.<br>The file exported will be in LDIF format.<P>Or, in Outlook, select your Contacts folder, select <b>Import and Export...</b> from'));
|
||||
$GLOBALS['phpgw']->template->set_var('help_import2',lang('the <b>File</b> menu and export your contacts into a comma separated text (CSV) file. <P>Or, in Palm Desktop 4.0 or greater, visit your addressbook and select <b>Export</b> from the <b>File</b> menu. The file exported will be in VCard format.<P>'));
|
||||
$GLOBALS['phpgw']->template->set_var('none',lang('none'));
|
||||
$GLOBALS['phpgw']->template->set_var('debug_browser',lang('Debug output in browser'));
|
||||
$GLOBALS['phpgw']->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard'));
|
||||
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import'));
|
||||
$GLOBALS['phpgw']->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False));
|
||||
$GLOBALS['phpgw']->template->set_var('tsvfilename','');
|
||||
$GLOBALS['phpgw']->template->set_var('conv',$conv);
|
||||
$GLOBALS['phpgw']->template->set_var('debug',lang('Debug output in browser'));
|
||||
$GLOBALS['phpgw']->template->set_var('filetype',lang('LDIF'));
|
||||
$GLOBALS['phpgw']->template->set_var('download',lang('Submit'));
|
||||
$GLOBALS['phpgw']->template->set_var('start',$this->start);
|
||||
$GLOBALS['phpgw']->template->set_var('sort',$this->sort);
|
||||
$GLOBALS['phpgw']->template->set_var('order',$this->order);
|
||||
$GLOBALS['phpgw']->template->set_var('filter',$this->filter);
|
||||
$GLOBALS['phpgw']->template->set_var('query',$this->query);
|
||||
$GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id);
|
||||
|
||||
$this->output = $GLOBALS['phpgw']->template->fp('out','import');
|
||||
$this->totpl();
|
||||
}
|
||||
$GLOBALS['phpgw']->common->phpgw_footer();
|
||||
}
|
||||
|
||||
function export()
|
||||
@ -201,9 +210,9 @@
|
||||
{
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
set_time_limit(0)
|
||||
set_time_limit(0);
|
||||
|
||||
$this->template->set_file(array('export' => 'export.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_file(array('export' => 'export.tpl'));
|
||||
|
||||
$dir_handle = opendir(PHPGW_APP_INC. SEP . 'export');
|
||||
$i=0; $myfilearray = '';
|
||||
@ -223,30 +232,30 @@
|
||||
$conv .= ' <option value="'.$myfilearray[$i].'">'.$fname.'</option>'."\n";
|
||||
}
|
||||
|
||||
$this->template->set_var('lang_cancel',lang('Cancel'));
|
||||
$this->template->set_var('lang_cat',lang('Select Category'));
|
||||
$this->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False));
|
||||
$this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php'));
|
||||
$this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
|
||||
$this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
|
||||
$this->template->set_var('export_text',lang('Export from Addressbook'));
|
||||
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
|
||||
$this->template->set_var('filename',lang('Export file name'));
|
||||
$this->template->set_var('conversion',lang('Select the type of conversion'));
|
||||
$this->template->set_var('conv',$conv);
|
||||
$this->template->set_var('debug',lang(''));
|
||||
$this->template->set_var('download',lang('Submit'));
|
||||
$this->template->set_var('download_export',lang('Download export file (Uncheck to debug output in browser)'));
|
||||
$this->template->set_var('none',lang('none'));
|
||||
$this->template->set_var('start',$this->start);
|
||||
$this->template->set_var('sort',$this->sort);
|
||||
$this->template->set_var('order',$this->order);
|
||||
$this->template->set_var('filter',$this->filter);
|
||||
$this->template->set_var('query',$this->query);
|
||||
$this->template->set_var('cat_id',$this->cat_id);
|
||||
$this->template->pparse('out','export');
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cat',lang('Select Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False));
|
||||
$GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php'));
|
||||
$GLOBALS['phpgw']->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('export_text',lang('Export from Addressbook'));
|
||||
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
|
||||
$GLOBALS['phpgw']->template->set_var('filename',lang('Export file name'));
|
||||
$GLOBALS['phpgw']->template->set_var('conversion',lang('Select the type of conversion'));
|
||||
$GLOBALS['phpgw']->template->set_var('conv',$conv);
|
||||
$GLOBALS['phpgw']->template->set_var('debug',lang(''));
|
||||
$GLOBALS['phpgw']->template->set_var('download',lang('Submit'));
|
||||
$GLOBALS['phpgw']->template->set_var('download_export',lang('Download export file (Uncheck to debug output in browser)'));
|
||||
$GLOBALS['phpgw']->template->set_var('none',lang('none'));
|
||||
$GLOBALS['phpgw']->template->set_var('start',$this->start);
|
||||
$GLOBALS['phpgw']->template->set_var('sort',$this->sort);
|
||||
$GLOBALS['phpgw']->template->set_var('order',$this->order);
|
||||
$GLOBALS['phpgw']->template->set_var('filter',$this->filter);
|
||||
$GLOBALS['phpgw']->template->set_var('query',$this->query);
|
||||
$GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id);
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_footer();
|
||||
$this->output = $GLOBALS['phpgw']->template->fp('out','export');
|
||||
$this->totpl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
class uiaddressbook
|
||||
{
|
||||
var $template;
|
||||
var $output = '';
|
||||
var $contacts;
|
||||
var $bo;
|
||||
var $cat;
|
||||
@ -31,17 +31,16 @@
|
||||
var $filter;
|
||||
var $cat_id;
|
||||
|
||||
var $template;
|
||||
var $public_functions = array(
|
||||
'index' => True,
|
||||
'view' => True,
|
||||
'add' => True,
|
||||
'index' => True,
|
||||
'view' => True,
|
||||
'add' => True,
|
||||
'addfromremote' => True,
|
||||
'add_email' => True,
|
||||
'copy' => True,
|
||||
'edit' => True,
|
||||
'copy' => True,
|
||||
'edit' => True,
|
||||
'delete' => True,
|
||||
'preferences' => True,
|
||||
'preferences' => True,
|
||||
'remote_search' => True
|
||||
);
|
||||
|
||||
@ -59,7 +58,6 @@
|
||||
$this->fields = CreateObject('addressbook.uifields');
|
||||
|
||||
$this->bo = CreateObject('addressbook.boaddressbook',True);
|
||||
$this->template = $GLOBALS['phpgw']->template;
|
||||
$this->contacts = CreateObject('phpgwapi.contacts');
|
||||
$this->cat = CreateObject('phpgwapi.categories');
|
||||
$this->company = CreateObject('phpgwapi.categories','addressbook_company');
|
||||
@ -68,6 +66,15 @@
|
||||
$this->_set_sessiondata();
|
||||
}
|
||||
|
||||
function totpl()
|
||||
{
|
||||
if(@isset($this->output) && !empty($this->output))
|
||||
{
|
||||
$GLOBALS['phpgw']->template->set_var('phpgw_body', $this->output,True);
|
||||
unset($this->output);
|
||||
}
|
||||
}
|
||||
|
||||
function _set_sessiondata()
|
||||
{
|
||||
$this->start = $this->bo->start;
|
||||
@ -261,15 +268,13 @@
|
||||
*/
|
||||
function index($entries='')
|
||||
{
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
$this->template->set_file(array('addressbook_list_t' => 'index.tpl'));
|
||||
$this->template->set_block('addressbook_list_t','addressbook_header','addressbook_header');
|
||||
$this->template->set_block('addressbook_list_t','column','column');
|
||||
$this->template->set_block('addressbook_list_t','row','row');
|
||||
$this->template->set_block('addressbook_list_t','remsearch','remsearch');
|
||||
$this->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer');
|
||||
$this->template->set_block('addressbook_list_t','addressbook_alpha','addressbook_alpha');
|
||||
$GLOBALS['phpgw']->template->set_file(array('addressbook_list_t' => 'index.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_header','addressbook_header');
|
||||
$GLOBALS['phpgw']->template->set_block('addressbook_list_t','column','column');
|
||||
$GLOBALS['phpgw']->template->set_block('addressbook_list_t','row','row');
|
||||
$GLOBALS['phpgw']->template->set_block('addressbook_list_t','remsearch','remsearch');
|
||||
$GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer');
|
||||
$GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_alpha','addressbook_alpha');
|
||||
|
||||
$aar = explode(',',lang('alphabet'));
|
||||
$aar[] = 'all';
|
||||
@ -278,28 +283,28 @@
|
||||
if($this->cquery == $char ||
|
||||
($char == 'all' && !$this->cquery))
|
||||
{
|
||||
$this->template->set_var('charbgcolor','#000000');
|
||||
$this->template->set_var('charcolor','#FFFFFF');
|
||||
$GLOBALS['phpgw']->template->set_var('charbgcolor','#000000');
|
||||
$GLOBALS['phpgw']->template->set_var('charcolor','#FFFFFF');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('charbgcolor',$GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$this->template->set_var('charcolor',$GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('charbgcolor',$GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('charcolor',$GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
}
|
||||
if($char == 'all')
|
||||
{
|
||||
$this->template->set_var('charlink',
|
||||
$GLOBALS['phpgw']->template->set_var('charlink',
|
||||
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index&cquery=')
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('charlink',
|
||||
$GLOBALS['phpgw']->template->set_var('charlink',
|
||||
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index&cquery=' . $char)
|
||||
);
|
||||
}
|
||||
$this->template->set_var('char',$char != 'all' ? strtoupper($char) : lang('all'));
|
||||
$this->template->fp('alphalinks','addressbook_alpha',True);
|
||||
$GLOBALS['phpgw']->template->set_var('char',$char != 'all' ? strtoupper($char) : lang('all'));
|
||||
$GLOBALS['phpgw']->template->fp('alphalinks','addressbook_alpha',True);
|
||||
}
|
||||
|
||||
$custom = $this->fields->read_custom_fields();
|
||||
@ -470,12 +475,12 @@
|
||||
'order' => $this->order
|
||||
));
|
||||
$total_records = $this->bo->total;
|
||||
$this->template->set_var('lang_view',lang('View'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_view',lang('View'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$total_records = count($entries);
|
||||
$this->template->set_var('lang_view',lang('Add'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_view',lang('Add'));
|
||||
$showadd = True;
|
||||
}
|
||||
|
||||
@ -486,67 +491,67 @@
|
||||
$lang_showing = $GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$this->start);
|
||||
|
||||
/* set basic vars and parse the header */
|
||||
$this->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']);
|
||||
$this->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
|
||||
// $this->template->set_var('lang_view',lang('View'));
|
||||
$this->template->set_var('lang_vcard',lang('VCard'));
|
||||
$this->template->set_var('lang_edit',lang('Edit'));
|
||||
$this->template->set_var('lang_owner',lang('Owner'));
|
||||
$this->template->set_var('lang_go',lang('Go'));
|
||||
$GLOBALS['phpgw']->template->set_var('font',$GLOBALS['phpgw_info']['theme']['font']);
|
||||
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
|
||||
// $GLOBALS['phpgw']->template->set_var('lang_view',lang('View'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_vcard',lang('VCard'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_owner',lang('Owner'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_go',lang('Go'));
|
||||
|
||||
$this->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn);
|
||||
$this->template->set_var('lang_showing',$lang_showing);
|
||||
$this->template->set_var('search_filter',$search_filter);
|
||||
$this->template->set_var('cats',lang('Category'));
|
||||
$this->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
/* $this->template->set_var('cats_link',$this->cat_option($this->cat_id)); */
|
||||
$this->template->set_var('lang_cats',lang('Select'));
|
||||
$this->template->set_var('lang_addressbook',lang('Address book'));
|
||||
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$this->template->set_var('th_font',$GLOBALS['phpgw_info']['theme']['font']);
|
||||
$this->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$this->template->set_var('lang_add',lang('Add'));
|
||||
$this->template->set_var('add_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.add'));
|
||||
$this->template->set_var('lang_addvcard',lang('AddVCard'));
|
||||
$this->template->set_var('vcard_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.in'));
|
||||
$this->template->set_var('lang_import',lang('Import Contacts'));
|
||||
$this->template->set_var('import_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import'));
|
||||
$this->template->set_var('lang_import_alt',lang('Alt. CSV Import'));
|
||||
$this->template->set_var('import_alt_url',$GLOBALS['phpgw']->link('/addressbook/csv_import.php'));
|
||||
$this->template->set_var('lang_export',lang('Export Contacts'));
|
||||
$this->template->set_var('export_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
|
||||
$GLOBALS['phpgw']->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_showing',$lang_showing);
|
||||
$GLOBALS['phpgw']->template->set_var('search_filter',$search_filter);
|
||||
$GLOBALS['phpgw']->template->set_var('cats',lang('Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
/* $GLOBALS['phpgw']->template->set_var('cats_link',$this->cat_option($this->cat_id)); */
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cats',lang('Select'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_addressbook',lang('Address book'));
|
||||
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('th_font',$GLOBALS['phpgw_info']['theme']['font']);
|
||||
$GLOBALS['phpgw']->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_add',lang('Add'));
|
||||
$GLOBALS['phpgw']->template->set_var('add_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.add'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_addvcard',lang('AddVCard'));
|
||||
$GLOBALS['phpgw']->template->set_var('vcard_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.in'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_import',lang('Import Contacts'));
|
||||
$GLOBALS['phpgw']->template->set_var('import_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.import'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_import_alt',lang('Alt. CSV Import'));
|
||||
$GLOBALS['phpgw']->template->set_var('import_alt_url',$GLOBALS['phpgw']->link('/addressbook/csv_import.php'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_export',lang('Export Contacts'));
|
||||
$GLOBALS['phpgw']->template->set_var('export_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
|
||||
|
||||
$this->template->set_var('start',$this->start);
|
||||
$this->template->set_var('sort',$this->sort);
|
||||
$this->template->set_var('order',$this->order);
|
||||
$this->template->set_var('filter',$this->filter);
|
||||
$this->template->set_var('query',$this->query);
|
||||
$this->template->set_var('cat_id',$this->cat_id);
|
||||
$GLOBALS['phpgw']->template->set_var('start',$this->start);
|
||||
$GLOBALS['phpgw']->template->set_var('sort',$this->sort);
|
||||
$GLOBALS['phpgw']->template->set_var('order',$this->order);
|
||||
$GLOBALS['phpgw']->template->set_var('filter',$this->filter);
|
||||
$GLOBALS['phpgw']->template->set_var('query',$this->query);
|
||||
$GLOBALS['phpgw']->template->set_var('cat_id',$this->cat_id);
|
||||
|
||||
$this->template->set_var('qfield',$qfield);
|
||||
$this->template->set_var('cols',$cols);
|
||||
$GLOBALS['phpgw']->template->set_var('qfield',$qfield);
|
||||
$GLOBALS['phpgw']->template->set_var('cols',$cols);
|
||||
|
||||
if(@isset($GLOBALS['phpgw_info']['server']['enable_remote_addressbook']))
|
||||
{
|
||||
$this->template->set_var('remote_search',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.remote_search'));
|
||||
$this->template->set_var('remote_query',$GLOBALS['HTTP_POST_VARS']['remote_query']);
|
||||
$this->template->set_var('lang_remote_search',lang('Remote Search'));
|
||||
$this->template->set_var('search_remote',$this->remote_search_option());
|
||||
$this->template->fp('remotesearch','remsearch');
|
||||
$GLOBALS['phpgw']->template->set_var('remote_search',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.remote_search'));
|
||||
$GLOBALS['phpgw']->template->set_var('remote_query',$GLOBALS['HTTP_POST_VARS']['remote_query']);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_remote_search',lang('Remote Search'));
|
||||
$GLOBALS['phpgw']->template->set_var('search_remote',$this->remote_search_option());
|
||||
$GLOBALS['phpgw']->template->fp('remotesearch','remsearch');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('remotesearch','');
|
||||
$GLOBALS['phpgw']->template->set_var('remotesearch','');
|
||||
}
|
||||
$this->template->pparse('out','addressbook_header');
|
||||
$this->output .= $GLOBALS['phpgw']->template->parse('out','addressbook_header');
|
||||
|
||||
/* Show the entries */
|
||||
/* each entry */
|
||||
for($i=0;$i<count($entries);$i++)
|
||||
{
|
||||
$this->template->set_var('columns','');
|
||||
$GLOBALS['phpgw']->template->set_var('columns','');
|
||||
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
|
||||
$this->template->set_var('row_tr_color',$tr_color);
|
||||
$GLOBALS['phpgw']->template->set_var('row_tr_color',$tr_color);
|
||||
$myid = $entries[$i]['id'];
|
||||
$myowner = $entries[$i]['owner'];
|
||||
|
||||
@ -584,47 +589,47 @@
|
||||
$ref = '';
|
||||
$data = $coldata;
|
||||
}
|
||||
$this->template->set_var('col_data',$ref . $data);
|
||||
$this->template->parse('columns','column',True);
|
||||
$GLOBALS['phpgw']->template->set_var('col_data',$ref . $data);
|
||||
$GLOBALS['phpgw']->template->parse('columns','column',True);
|
||||
}
|
||||
|
||||
if(!$showadd)
|
||||
{
|
||||
$this->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
|
||||
$GLOBALS['phpgw']->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
|
||||
'menuaction=addressbook.uiaddressbook.view&ab_id=' . $entries[$i]['id']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
|
||||
$GLOBALS['phpgw']->template->set_var('row_view_link',$GLOBALS['phpgw']->link('/index.php',
|
||||
'menuaction=addressbook.uiaddressbook.addfromremote&fields=' . urlencode(serialize($entries[$i]))));
|
||||
// $this->template->set_var('lang_view',lang('Add'));
|
||||
// $GLOBALS['phpgw']->template->set_var('lang_view',lang('Add'));
|
||||
}
|
||||
|
||||
$this->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php',
|
||||
$GLOBALS['phpgw']->template->set_var('row_vcard_link',$GLOBALS['phpgw']->link('/index.php',
|
||||
'menuaction=addressbook.uivcard.out&ab_id='.$entries[$i]['id']));
|
||||
|
||||
/* echo '<br>: ' . $contacts->grants[$myowner] . ' - ' . $myowner; */
|
||||
if($this->contacts->check_perms($this->contacts->grants[$myowner],PHPGW_ACL_EDIT) ||
|
||||
$myowner == $GLOBALS['phpgw_info']['user']['account_id'])
|
||||
{
|
||||
$this->template->set_var('row_edit','<a href="' . $GLOBALS['phpgw']->link('/index.php',
|
||||
$GLOBALS['phpgw']->template->set_var('row_edit','<a href="' . $GLOBALS['phpgw']->link('/index.php',
|
||||
'menuaction=addressbook.uiaddressbook.edit&ab_id='.$entries[$i]['id']) . '">' . lang('Edit') . '</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('row_edit',' ');
|
||||
$GLOBALS['phpgw']->template->set_var('row_edit',' ');
|
||||
}
|
||||
|
||||
$this->template->set_var('row_owner',$GLOBALS['phpgw']->accounts->id2name($myowner));
|
||||
$GLOBALS['phpgw']->template->set_var('row_owner',$GLOBALS['phpgw']->accounts->id2name($myowner));
|
||||
|
||||
$this->template->parse('rows','row',True);
|
||||
$this->template->pparse('out','row');
|
||||
$GLOBALS['phpgw']->template->parse('rows','row',True);
|
||||
$this->output .= $GLOBALS['phpgw']->template->fp('out','row');
|
||||
reset($columns_to_display);
|
||||
}
|
||||
|
||||
$this->template->pparse('out','addressbook_footer');
|
||||
$this->output .= $GLOBALS['phpgw']->template->fp('out','addressbook_footer');
|
||||
$this->save_sessiondata();
|
||||
/* $GLOBALS['phpgw']->common->phpgw_footer(); */
|
||||
$this->totpl();
|
||||
}
|
||||
|
||||
function add_email()
|
||||
@ -703,15 +708,15 @@
|
||||
$this->bo->add_entry($fields);
|
||||
|
||||
$ab_id = $this->bo->get_lastid();
|
||||
$GLOBALS['ab_id'] = $ab_id;
|
||||
$GLOBALS['phpgw']->hooks->process('addressbook_save');
|
||||
|
||||
Header('Location: '
|
||||
. $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $ab_id . '&referer=' . $referer));
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$this->template->set_file(array('add' => 'add.tpl'));
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
$GLOBALS['phpgw']->template->set_file(array('add' => 'add.tpl'));
|
||||
|
||||
$custom = $this->fields->read_custom_fields();
|
||||
$customfields = array();
|
||||
@ -722,12 +727,14 @@
|
||||
|
||||
$this->addressbook_form('','menuaction=addressbook.uiaddressbook.add','Add','',$customfields,$this->cat_id);
|
||||
|
||||
$this->template->set_var('lang_ok',lang('ok'));
|
||||
$this->template->set_var('lang_clear',lang('clear'));
|
||||
$this->template->set_var('lang_cancel',lang('cancel'));
|
||||
$this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$this->template->parse('out','add');
|
||||
$this->template->pparse('out','add');
|
||||
$GLOBALS['phpgw']->template->set_var('lang_ok',lang('ok'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_clear',lang('clear'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel'));
|
||||
$GLOBALS['phpgw']->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$this->output .= $GLOBALS['phpgw']->template->parse('out','add');
|
||||
$this->output .= $GLOBALS['phpgw']->template->parse('out','add');
|
||||
$this->totpl();
|
||||
$GLOBALS['phpgw']->hooks->process('addressbook_add');
|
||||
}
|
||||
|
||||
function edit()
|
||||
@ -752,6 +759,8 @@
|
||||
unset($_fields['referer']);
|
||||
|
||||
$this->bo->update_entry($_fields);
|
||||
$GLOBALS['ab_id'] = $_fields['ab_id'];
|
||||
$GLOBALS['phpgw']->hooks->process('addressbook_save');
|
||||
|
||||
Header('Location: '
|
||||
. $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer)
|
||||
@ -770,8 +779,6 @@
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
/* Read in user custom fields, if any */
|
||||
$custom = $this->fields->read_custom_fields();
|
||||
$customfields = array();
|
||||
@ -785,27 +792,29 @@
|
||||
$fields = $this->bo->read_entry(array('id' => $GLOBALS['HTTP_GET_VARS']['ab_id'], 'fields' => $qfields));
|
||||
$this->addressbook_form('edit','menuaction=addressbook.uiaddressbook.edit',lang('Edit'),$fields[0],$customfields);
|
||||
|
||||
$this->template->set_file(array('edit' => 'edit.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_file(array('edit' => 'edit.tpl'));
|
||||
|
||||
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$this->template->set_var('ab_id',$GLOBALS['HTTP_GET_VARS']['ab_id']);
|
||||
$this->template->set_var('tid',$check[0]['tid']);
|
||||
$this->template->set_var('referer',$referer);
|
||||
$this->template->set_var('lang_ok',lang('ok'));
|
||||
$this->template->set_var('lang_clear',lang('clear'));
|
||||
$this->template->set_var('lang_cancel',lang('cancel'));
|
||||
$this->template->set_var('lang_submit',lang('submit'));
|
||||
$this->template->set_var('cancel_link','<form method="POST" action="'
|
||||
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('ab_id',$GLOBALS['HTTP_GET_VARS']['ab_id']);
|
||||
$GLOBALS['phpgw']->template->set_var('tid',$check[0]['tid']);
|
||||
$GLOBALS['phpgw']->template->set_var('referer',$referer);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_ok',lang('ok'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_clear',lang('clear'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('submit'));
|
||||
$GLOBALS['phpgw']->template->set_var('cancel_link','<form method="POST" action="'
|
||||
. $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index') . '">');
|
||||
|
||||
if(($this->contacts->grants[$check[0]['owner']] & PHPGW_ACL_DELETE) ||
|
||||
$check[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])
|
||||
{
|
||||
$this->template->set_var('delete_link','<form method="POST" action="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.delete') . '">');
|
||||
$this->template->set_var('delete_button','<input type="submit" name="delete" value="' . lang('Delete') . '">');
|
||||
$GLOBALS['phpgw']->template->set_var('delete_link','<form method="POST" action="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.delete') . '">');
|
||||
$GLOBALS['phpgw']->template->set_var('delete_button','<input type="submit" name="delete" value="' . lang('Delete') . '">');
|
||||
}
|
||||
|
||||
$this->template->pfp('out','edit');
|
||||
$this->output .= $GLOBALS['phpgw']->template->fp('out','edit');
|
||||
$this->totpl();
|
||||
$GLOBALS['phpgw']->hooks->process('addressbook_edit');
|
||||
}
|
||||
|
||||
function delete()
|
||||
@ -830,18 +839,16 @@
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
|
||||
$this->template->set_file(array('delete' => 'delete.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_file(array('delete' => 'delete.tpl'));
|
||||
|
||||
if($confirm != 'true')
|
||||
{
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
$this->template->set_var('lang_sure',lang('Are you sure you want to delete this entry ?'));
|
||||
$this->template->set_var('no_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$this->template->set_var('lang_no',lang('NO'));
|
||||
$this->template->set_var('yes_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.delete&ab_id=' . $ab_id . '&confirm=true'));
|
||||
$this->template->set_var('lang_yes',lang('YES'));
|
||||
$this->template->pparse('out','delete');
|
||||
$GLOBALS['phpgw']->template->set_var('lang_sure',lang('Are you sure you want to delete this entry ?'));
|
||||
$GLOBALS['phpgw']->template->set_var('no_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_no',lang('NO'));
|
||||
$GLOBALS['phpgw']->template->set_var('yes_link',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.delete&ab_id=' . $ab_id . '&confirm=true'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_yes',lang('YES'));
|
||||
$this->output .= $GLOBALS['phpgw']->template->parse('out','delete');
|
||||
|
||||
}
|
||||
else
|
||||
@ -849,6 +856,7 @@
|
||||
$this->bo->delete_entry(array('id' => $ab_id));
|
||||
@Header('Location: ' . $GLOBALS['phpgw']->link('/addressbook/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
}
|
||||
$this->totpl();
|
||||
}
|
||||
|
||||
function view()
|
||||
@ -874,16 +882,12 @@
|
||||
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
elseif(!$submit && $ab_id)
|
||||
{
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
}
|
||||
|
||||
$this->template->set_file(array('view_t' => 'view.tpl'));
|
||||
$this->template->set_block('view_t','view_header','view_header');
|
||||
$this->template->set_block('view_t','view_row','view_row');
|
||||
$this->template->set_block('view_t','view_footer','view_footer');
|
||||
$this->template->set_block('view_t','view_buttons','view_buttons');
|
||||
$GLOBALS['phpgw']->template->set_file(array('view_t' => 'view.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_block('view_t','view_header','view_header');
|
||||
$GLOBALS['phpgw']->template->set_block('view_t','view_row','view_row');
|
||||
$GLOBALS['phpgw']->template->set_block('view_t','view_footer','view_footer');
|
||||
$GLOBALS['phpgw']->template->set_block('view_t','view_buttons','view_buttons');
|
||||
|
||||
$custom = $this->fields->read_custom_fields();
|
||||
$customfields = array();
|
||||
@ -937,28 +941,28 @@
|
||||
$access_check = lang('public');
|
||||
}
|
||||
|
||||
$this->template->set_var('lang_viewpref',lang('Address book - view') . $noprefs);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_viewpref',lang('Address book - view') . $noprefs);
|
||||
|
||||
@reset($qfields);
|
||||
while(list($column,$null) = @each($qfields))
|
||||
{
|
||||
if($this->display_name($colname[$column]))
|
||||
{
|
||||
$this->template->set_var('display_col',$this->display_name($colname[$column]));
|
||||
$GLOBALS['phpgw']->template->set_var('display_col',$this->display_name($colname[$column]));
|
||||
}
|
||||
elseif($this->display_name($column))
|
||||
{
|
||||
$this->template->set_var('display_col',$this->display_name($column));
|
||||
$GLOBALS['phpgw']->template->set_var('display_col',$this->display_name($column));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('display_col',ucfirst($column));
|
||||
$GLOBALS['phpgw']->template->set_var('display_col',ucfirst($column));
|
||||
}
|
||||
$ref = $data = '';
|
||||
if($fields[0][$column])
|
||||
{
|
||||
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
|
||||
$this->template->set_var('th_bg',$tr_color);
|
||||
$GLOBALS['phpgw']->template->set_var('th_bg',$tr_color);
|
||||
$coldata = $fields[0][$column];
|
||||
/* Some fields require special formatting. */
|
||||
if(($column == 'note' || $column == 'pubkey') && $coldata)
|
||||
@ -1014,17 +1018,17 @@
|
||||
|
||||
if(!$data)
|
||||
{
|
||||
$this->template->set_var('ref_data',' ');
|
||||
$GLOBALS['phpgw']->template->set_var('ref_data',' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('ref_data',$ref . $data);
|
||||
$GLOBALS['phpgw']->template->set_var('ref_data',$ref . $data);
|
||||
}
|
||||
$this->template->parse('cols','view_row',True);
|
||||
$GLOBALS['phpgw']->template->parse('cols','view_row',True);
|
||||
}
|
||||
}
|
||||
/* Following cleans up view_row, since we were only using it to fill {cols} */
|
||||
$this->template->set_var('view_row','');
|
||||
$GLOBALS['phpgw']->template->set_var('view_row','');
|
||||
|
||||
$fields['cat_id'] = is_array($this->cat_id) ? implode(',',$this->cat_id) : $this->cat_id;
|
||||
|
||||
@ -1061,12 +1065,12 @@
|
||||
}
|
||||
|
||||
/* These are in the footer */
|
||||
$this->template->set_var('lang_owner',lang('Record owner'));
|
||||
$this->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($record_owner));
|
||||
$this->template->set_var('lang_access',lang('Record access'));
|
||||
$this->template->set_var('access',$access_check);
|
||||
$this->template->set_var('lang_category',lang('Category'));
|
||||
$this->template->set_var('catname',$catname);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_owner',lang('Record owner'));
|
||||
$GLOBALS['phpgw']->template->set_var('owner',$GLOBALS['phpgw']->common->grab_owner_name($record_owner));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_access',lang('Record access'));
|
||||
$GLOBALS['phpgw']->template->set_var('access',$access_check);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('catname',$catname);
|
||||
|
||||
if(($this->contacts->grants[$record_owner] & PHPGW_ACL_EDIT) ||
|
||||
($record_owner == $GLOBALS['phpgw_info']['user']['account_id']))
|
||||
@ -1078,28 +1082,30 @@
|
||||
$extra_vars += array('referer' => urlencode($referer));
|
||||
}
|
||||
|
||||
$this->template->set_var('edit_button',$this->html_1button_form('edit','Edit',
|
||||
$GLOBALS['phpgw']->template->set_var('edit_button',$this->html_1button_form('edit','Edit',
|
||||
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.edit&ab_id=' .$ab_id)));
|
||||
}
|
||||
$this->template->set_var('copy_button',$this->html_1button_form('submit','copy',
|
||||
$GLOBALS['phpgw']->template->set_var('copy_button',$this->html_1button_form('submit','copy',
|
||||
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.copy&ab_id=' . $fields[0]['id'])));
|
||||
|
||||
if($fields[0]['n_family'] && $fields[0]['n_given'])
|
||||
{
|
||||
$this->template->set_var('vcard_button',$this->html_1button_form('VCardForm','VCard',
|
||||
$GLOBALS['phpgw']->template->set_var('vcard_button',$this->html_1button_form('VCardForm','VCard',
|
||||
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$ab_id)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('vcard_button',lang('no vcard'));
|
||||
$GLOBALS['phpgw']->template->set_var('vcard_button',lang('no vcard'));
|
||||
}
|
||||
|
||||
$this->template->set_var('done_button',$this->html_1button_form('DoneForm','Done',
|
||||
$GLOBALS['phpgw']->template->set_var('done_button',$this->html_1button_form('DoneForm','Done',
|
||||
$referer ? $referer : $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')));
|
||||
$this->template->set_var('access_link',$access_link);
|
||||
$GLOBALS['phpgw']->template->set_var('access_link',$access_link);
|
||||
|
||||
$this->template->pfp('out','view_t');
|
||||
$this->output .= $GLOBALS['phpgw']->template->fp('out','view_t');
|
||||
$this->totpl();
|
||||
|
||||
$GLOBALS['ab_id'] = $ab_id;
|
||||
$GLOBALS['phpgw']->hooks->process('addressbook_view');
|
||||
}
|
||||
|
||||
@ -1142,16 +1148,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
|
||||
if($totalerrors)
|
||||
{
|
||||
echo '<p><center>' . $GLOBALS['phpgw']->common->error_list($errors) . '</center>';
|
||||
}
|
||||
|
||||
$this->template->set_file(array('preferences' => 'preferences.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_file(array('preferences' => 'preferences.tpl'));
|
||||
|
||||
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences'));
|
||||
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.preferences'));
|
||||
|
||||
$i = 0; $j = 0;
|
||||
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
|
||||
@ -1169,14 +1173,14 @@
|
||||
$coltest = ereg_replace('\*','',$showcol);
|
||||
if($coltest)
|
||||
{
|
||||
$this->template->set_var($col,$showcol);
|
||||
$GLOBALS['phpgw']->template->set_var($col,$showcol);
|
||||
if($GLOBALS['phpgw_info']['user']['preferences']['addressbook'][$col])
|
||||
{
|
||||
$this->template->set_var($col.'_checked',' checked');
|
||||
$GLOBALS['phpgw']->template->set_var($col.'_checked',' checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var($col.'_checked','');
|
||||
$GLOBALS['phpgw']->template->set_var($col.'_checked','');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1200,24 +1204,24 @@
|
||||
. '>' . $cf . '</option></td>' . "\n"
|
||||
. '</tr>' . "\n";
|
||||
}
|
||||
$this->template->set_var('custom_fields',$custom_var);
|
||||
$GLOBALS['phpgw']->template->set_var('custom_fields',$custom_var);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('custom_fields','');
|
||||
$GLOBALS['phpgw']->template->set_var('custom_fields','');
|
||||
}
|
||||
|
||||
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
|
||||
$this->template->set_var(tr_color,$tr_color);
|
||||
$this->template->set_var('lang_showbirthday',lang('show birthday reminders on main screen'));
|
||||
$GLOBALS['phpgw']->template->set_var(tr_color,$tr_color);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_showbirthday',lang('show birthday reminders on main screen'));
|
||||
|
||||
if($this->prefs['mainscreen_showbirthdays'])
|
||||
{
|
||||
$this->template->set_var('show_birthday',' checked');
|
||||
$GLOBALS['phpgw']->template->set_var('show_birthday',' checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('show_birthday','');
|
||||
$GLOBALS['phpgw']->template->set_var('show_birthday','');
|
||||
}
|
||||
|
||||
$list = array(
|
||||
@ -1225,35 +1229,36 @@
|
||||
'private' => lang('Private'),
|
||||
'blank' => lang('Blank')
|
||||
);
|
||||
$this->template->set_var('lang_default_filter',lang('Default Filter'));
|
||||
$this->template->set_var('filter_select',$this->formatted_list('other[default_filter]',$list,$this->prefs['default_filter']));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_default_filter',lang('Default Filter'));
|
||||
$GLOBALS['phpgw']->template->set_var('filter_select',$this->formatted_list('other[default_filter]',$list,$this->prefs['default_filter']));
|
||||
|
||||
$this->template->set_var('lang_autosave',lang('Autosave default category'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_autosave',lang('Autosave default category'));
|
||||
if($this->prefs['autosave_category'])
|
||||
{
|
||||
$this->template->set_var('autosave',' checked');
|
||||
$GLOBALS['phpgw']->template->set_var('autosave',' checked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('autosave','');
|
||||
$GLOBALS['phpgw']->template->set_var('autosave','');
|
||||
}
|
||||
$this->template->set_var('lang_defaultcat',lang('Default Category'));
|
||||
$this->template->set_var('cat_select',$this->cat_option($this->prefs['default_category']));
|
||||
$this->template->set_var('lang_abprefs',lang('Addressbook').' '.lang('Preferences'));
|
||||
$this->template->set_var('lang_fields',lang('Fields to show in address list'));
|
||||
$this->template->set_var('lang_personal',lang('Personal'));
|
||||
$this->template->set_var('lang_business',lang('Business'));
|
||||
$this->template->set_var('lang_home',lang('Home'));
|
||||
$this->template->set_var('lang_phones',lang('Extra').' '.lang('Phone Numbers'));
|
||||
$this->template->set_var('lang_other',lang('Other').' '.lang('Fields'));
|
||||
$this->template->set_var('lang_otherprefs',lang('Other').' '.lang('Preferences'));
|
||||
$this->template->set_var('lang_submit',lang('submit'));
|
||||
$this->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$this->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$this->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']);
|
||||
$this->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_defaultcat',lang('Default Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('cat_select',$this->cat_option($this->prefs['default_category']));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_abprefs',lang('Addressbook').' '.lang('Preferences'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_fields',lang('Fields to show in address list'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_personal',lang('Personal'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_business',lang('Business'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_home',lang('Home'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_phones',lang('Extra').' '.lang('Phone Numbers'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_other',lang('Other').' '.lang('Fields'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_otherprefs',lang('Other').' '.lang('Preferences'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('submit'));
|
||||
$GLOBALS['phpgw']->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']);
|
||||
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
|
||||
|
||||
$this->template->pparse('out','preferences');
|
||||
$this->output .= $GLOBALS['phpgw']->template->parse('out','preferences');
|
||||
$this->totpl();
|
||||
}
|
||||
|
||||
function get_form()
|
||||
@ -1364,7 +1369,7 @@
|
||||
$custom = $this->fields->read_custom_fields();
|
||||
while(list($name,$val) = @each($custom))
|
||||
{
|
||||
$fields[$name] = $entry[$val];
|
||||
@$fields[$name] = $entry[$val];
|
||||
}
|
||||
|
||||
$fields['ophone'] = $entry['ophone'];
|
||||
@ -1408,7 +1413,7 @@
|
||||
{
|
||||
$referer = $GLOBALS['HTTP_GET_VARS']['referer'] ? $GLOBALS['HTTP_GET_VARS']['referer'] : $GLOBALS['HTTP_POST_VARS']['referer'];
|
||||
|
||||
$this->template->set_file(array('form' => 'form.tpl'));
|
||||
$GLOBALS['phpgw']->template->set_file(array('form' => 'form.tpl'));
|
||||
|
||||
if(($GLOBALS['phpgw_info']['server']['countrylist'] == 'user_choice' &&
|
||||
$GLOBALS['phpgw_info']['user']['preferences']['common']['countrylist'] == 'use_select') ||
|
||||
@ -1515,7 +1520,7 @@
|
||||
}
|
||||
$str[$name] .= '>';
|
||||
$str[$name] = $pref[0].$str[$name].$pref[1];
|
||||
$this->template->set_var("pref_".$name,$str[$name]);
|
||||
$GLOBALS['phpgw']->template->set_var("pref_".$name,$str[$name]);
|
||||
}
|
||||
|
||||
if(strlen($bday) > 2)
|
||||
@ -1668,137 +1673,137 @@
|
||||
$create .= '';
|
||||
}
|
||||
|
||||
$this->template->set_var('lang_home',lang('Home'));
|
||||
$this->template->set_var('lang_business',lang('Business'));
|
||||
$this->template->set_var('lang_personal',lang('Personal'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_home',lang('Home'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_business',lang('Business'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_personal',lang('Personal'));
|
||||
|
||||
$this->template->set_var('lang_lastname',lang('Last Name'));
|
||||
$this->template->set_var('lastname',$lastname);
|
||||
$this->template->set_var('lang_firstname',lang('First Name'));
|
||||
$this->template->set_var('firstname',$firstname);
|
||||
$this->template->set_var('lang_middle',lang('Middle Name'));
|
||||
$this->template->set_var('middle',$middle);
|
||||
$this->template->set_var('lang_prefix',lang('Prefix'));
|
||||
$this->template->set_var('prefix',$prefix);
|
||||
$this->template->set_var('lang_suffix',lang('Suffix'));
|
||||
$this->template->set_var('suffix',$suffix);
|
||||
$this->template->set_var('lang_birthday',lang('Birthday'));
|
||||
$this->template->set_var('birthday',$birthday);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_lastname',lang('Last Name'));
|
||||
$GLOBALS['phpgw']->template->set_var('lastname',$lastname);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_firstname',lang('First Name'));
|
||||
$GLOBALS['phpgw']->template->set_var('firstname',$firstname);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_middle',lang('Middle Name'));
|
||||
$GLOBALS['phpgw']->template->set_var('middle',$middle);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_prefix',lang('Prefix'));
|
||||
$GLOBALS['phpgw']->template->set_var('prefix',$prefix);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_suffix',lang('Suffix'));
|
||||
$GLOBALS['phpgw']->template->set_var('suffix',$suffix);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_birthday',lang('Birthday'));
|
||||
$GLOBALS['phpgw']->template->set_var('birthday',$birthday);
|
||||
|
||||
$this->template->set_var('lang_company',lang('Company Name'));
|
||||
$this->template->set_var('company',$company);
|
||||
$this->template->set_var('lang_department',lang('Department'));
|
||||
$this->template->set_var('department',$department);
|
||||
$this->template->set_var('lang_title',lang('Title'));
|
||||
$this->template->set_var('title',$title);
|
||||
$this->template->set_var('lang_email',lang('Business Email'));
|
||||
$this->template->set_var('email',$email);
|
||||
$this->template->set_var('lang_email_type',lang('Business EMail Type'));
|
||||
$this->template->set_var('email_type',$email_type);
|
||||
$this->template->set_var('lang_url',lang('URL'));
|
||||
$this->template->set_var('url',$url);
|
||||
$this->template->set_var('lang_timezone',lang('time zone offset'));
|
||||
$this->template->set_var('timezone',$time_zone);
|
||||
$this->template->set_var('lang_fax',lang('Business Fax'));
|
||||
$this->template->set_var('fax',$fax);
|
||||
$this->template->set_var('lang_wphone',lang('Business Phone'));
|
||||
$this->template->set_var('wphone',$wphone);
|
||||
$this->template->set_var('lang_pager',lang('Pager'));
|
||||
$this->template->set_var('pager',$pager);
|
||||
$this->template->set_var('lang_mphone',lang('Cell Phone'));
|
||||
$this->template->set_var('mphone',$mphone);
|
||||
$this->template->set_var('lang_msgphone',lang('Message Phone'));
|
||||
$this->template->set_var('msgphone',$msgphone);
|
||||
$this->template->set_var('lang_isdnphone',lang('ISDN Phone'));
|
||||
$this->template->set_var('isdnphone',$isdnphone);
|
||||
$this->template->set_var('lang_carphone',lang('Car Phone'));
|
||||
$this->template->set_var('carphone',$carphone);
|
||||
$this->template->set_var('lang_vidphone',lang('Video Phone'));
|
||||
$this->template->set_var('vidphone',$vidphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_company',lang('Company Name'));
|
||||
$GLOBALS['phpgw']->template->set_var('company',$company);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_department',lang('Department'));
|
||||
$GLOBALS['phpgw']->template->set_var('department',$department);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_title',lang('Title'));
|
||||
$GLOBALS['phpgw']->template->set_var('title',$title);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_email',lang('Business Email'));
|
||||
$GLOBALS['phpgw']->template->set_var('email',$email);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_email_type',lang('Business EMail Type'));
|
||||
$GLOBALS['phpgw']->template->set_var('email_type',$email_type);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_url',lang('URL'));
|
||||
$GLOBALS['phpgw']->template->set_var('url',$url);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_timezone',lang('time zone offset'));
|
||||
$GLOBALS['phpgw']->template->set_var('timezone',$time_zone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_fax',lang('Business Fax'));
|
||||
$GLOBALS['phpgw']->template->set_var('fax',$fax);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_wphone',lang('Business Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('wphone',$wphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_pager',lang('Pager'));
|
||||
$GLOBALS['phpgw']->template->set_var('pager',$pager);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_mphone',lang('Cell Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('mphone',$mphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_msgphone',lang('Message Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('msgphone',$msgphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_isdnphone',lang('ISDN Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('isdnphone',$isdnphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_carphone',lang('Car Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('carphone',$carphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_vidphone',lang('Video Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('vidphone',$vidphone);
|
||||
|
||||
$this->template->set_var('lang_ophone',lang('Other Number'));
|
||||
$this->template->set_var('ophone',$ophone);
|
||||
$this->template->set_var('lang_bstreet',lang('Business Street'));
|
||||
$this->template->set_var('bstreet',$bstreet);
|
||||
$this->template->set_var('lang_address2',lang('Address Line 2'));
|
||||
$this->template->set_var('address2',$address2);
|
||||
$this->template->set_var('lang_address3',lang('Address Line 3'));
|
||||
$this->template->set_var('address3',$address3);
|
||||
$this->template->set_var('lang_bcity',lang('Business City'));
|
||||
$this->template->set_var('bcity',$bcity);
|
||||
$this->template->set_var('lang_bstate',lang('Business State'));
|
||||
$this->template->set_var('bstate',$bstate);
|
||||
$this->template->set_var('lang_bzip',lang('Business Zip Code'));
|
||||
$this->template->set_var('bzip',$bzip);
|
||||
$this->template->set_var('lang_bcountry',lang('Business Country'));
|
||||
$this->template->set_var('bcountry',$bcountry);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_ophone',lang('Other Number'));
|
||||
$GLOBALS['phpgw']->template->set_var('ophone',$ophone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_bstreet',lang('Business Street'));
|
||||
$GLOBALS['phpgw']->template->set_var('bstreet',$bstreet);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_address2',lang('Address Line 2'));
|
||||
$GLOBALS['phpgw']->template->set_var('address2',$address2);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_address3',lang('Address Line 3'));
|
||||
$GLOBALS['phpgw']->template->set_var('address3',$address3);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_bcity',lang('Business City'));
|
||||
$GLOBALS['phpgw']->template->set_var('bcity',$bcity);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_bstate',lang('Business State'));
|
||||
$GLOBALS['phpgw']->template->set_var('bstate',$bstate);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_bzip',lang('Business Zip Code'));
|
||||
$GLOBALS['phpgw']->template->set_var('bzip',$bzip);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_bcountry',lang('Business Country'));
|
||||
$GLOBALS['phpgw']->template->set_var('bcountry',$bcountry);
|
||||
if($countrylist)
|
||||
{
|
||||
$this->template->set_var('bcountry',$GLOBALS['phpgw']->country->form_select($bcountry,'entry[bcountry]'));
|
||||
$GLOBALS['phpgw']->template->set_var('bcountry',$GLOBALS['phpgw']->country->form_select($bcountry,'entry[bcountry]'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('bcountry','<input name="entry[bcountry]" value="' . $bcountry . '">');
|
||||
$GLOBALS['phpgw']->template->set_var('bcountry','<input name="entry[bcountry]" value="' . $bcountry . '">');
|
||||
}
|
||||
$this->template->set_var('lang_badrtype',lang('Address Type'));
|
||||
$this->template->set_var('badrtype',$badrtype);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_badrtype',lang('Address Type'));
|
||||
$GLOBALS['phpgw']->template->set_var('badrtype',$badrtype);
|
||||
|
||||
$this->template->set_var('lang_hphone',lang('Home Phone'));
|
||||
$this->template->set_var('hphone',$hphone);
|
||||
$this->template->set_var('lang_hemail',lang('Home Email'));
|
||||
$this->template->set_var('hemail',$hemail);
|
||||
$this->template->set_var('lang_hemail_type',lang('Home EMail Type'));
|
||||
$this->template->set_var('hemail_type',$hemail_type);
|
||||
$this->template->set_var('lang_hstreet',lang('Home Street'));
|
||||
$this->template->set_var('hstreet',$hstreet);
|
||||
$this->template->set_var('lang_hcity',lang('Home City'));
|
||||
$this->template->set_var('hcity',$hcity);
|
||||
$this->template->set_var('lang_hstate',lang('Home State'));
|
||||
$this->template->set_var('hstate',$hstate);
|
||||
$this->template->set_var('lang_hzip',lang('Home Zip Code'));
|
||||
$this->template->set_var('hzip',$hzip);
|
||||
$this->template->set_var('lang_hcountry',lang('Home Country'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hphone',lang('Home Phone'));
|
||||
$GLOBALS['phpgw']->template->set_var('hphone',$hphone);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hemail',lang('Home Email'));
|
||||
$GLOBALS['phpgw']->template->set_var('hemail',$hemail);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hemail_type',lang('Home EMail Type'));
|
||||
$GLOBALS['phpgw']->template->set_var('hemail_type',$hemail_type);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hstreet',lang('Home Street'));
|
||||
$GLOBALS['phpgw']->template->set_var('hstreet',$hstreet);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hcity',lang('Home City'));
|
||||
$GLOBALS['phpgw']->template->set_var('hcity',$hcity);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hstate',lang('Home State'));
|
||||
$GLOBALS['phpgw']->template->set_var('hstate',$hstate);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hzip',lang('Home Zip Code'));
|
||||
$GLOBALS['phpgw']->template->set_var('hzip',$hzip);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hcountry',lang('Home Country'));
|
||||
if($countrylist)
|
||||
{
|
||||
$this->template->set_var('hcountry',$GLOBALS['phpgw']->country->form_select($hcountry,'entry[hcountry]'));
|
||||
$GLOBALS['phpgw']->template->set_var('hcountry',$GLOBALS['phpgw']->country->form_select($hcountry,'entry[hcountry]'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('hcountry','<input name="entry[hcountry]" value="' . $hcountry . '">');
|
||||
$GLOBALS['phpgw']->template->set_var('hcountry','<input name="entry[hcountry]" value="' . $hcountry . '">');
|
||||
}
|
||||
$this->template->set_var('lang_hadrtype',lang('Address Type'));
|
||||
$this->template->set_var('hadrtype',$hadrtype);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_hadrtype',lang('Address Type'));
|
||||
$GLOBALS['phpgw']->template->set_var('hadrtype',$hadrtype);
|
||||
|
||||
$this->template->set_var('create',$create);
|
||||
$this->template->set_var('lang_notes',lang('notes'));
|
||||
$this->template->set_var('notes',$notes);
|
||||
$this->template->set_var('lang_label',lang('label'));
|
||||
$this->template->set_var('label',$label);
|
||||
$this->template->set_var('lang_pubkey',lang('Public Key'));
|
||||
$this->template->set_var('pubkey',$pubkey);
|
||||
$this->template->set_var('access_check',$access_check);
|
||||
$GLOBALS['phpgw']->template->set_var('create',$create);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_notes',lang('notes'));
|
||||
$GLOBALS['phpgw']->template->set_var('notes',$notes);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_label',lang('label'));
|
||||
$GLOBALS['phpgw']->template->set_var('label',$label);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_pubkey',lang('Public Key'));
|
||||
$GLOBALS['phpgw']->template->set_var('pubkey',$pubkey);
|
||||
$GLOBALS['phpgw']->template->set_var('access_check',$access_check);
|
||||
|
||||
$this->template->set_var('lang_private',lang('Private'));
|
||||
$GLOBALS['phpgw']->template->set_var('lang_private',lang('Private'));
|
||||
|
||||
$this->template->set_var('lang_cats',lang('Category'));
|
||||
$this->template->set_var('cats_link',$cats_link);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_cats',lang('Category'));
|
||||
$GLOBALS['phpgw']->template->set_var('cats_link',$cats_link);
|
||||
if($customfields)
|
||||
{
|
||||
$this->template->set_var('lang_custom',lang('Custom Fields').':');
|
||||
$this->template->set_var('custom',$custom);
|
||||
$GLOBALS['phpgw']->template->set_var('lang_custom',lang('Custom Fields').':');
|
||||
$GLOBALS['phpgw']->template->set_var('custom',$custom);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->template->set_var('lang_custom','');
|
||||
$this->template->set_var('custom','');
|
||||
$GLOBALS['phpgw']->template->set_var('lang_custom','');
|
||||
$GLOBALS['phpgw']->template->set_var('custom','');
|
||||
}
|
||||
$this->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$this->template->set_var('th_text', $GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$this->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']);
|
||||
$this->template->set_var('row_off', $GLOBALS['phpgw_info']['theme']['row_off']);
|
||||
$this->template->set_var('row_text',$GLOBALS['phpgw_info']['theme']['row_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
|
||||
$GLOBALS['phpgw']->template->set_var('th_text', $GLOBALS['phpgw_info']['theme']['th_text']);
|
||||
$GLOBALS['phpgw']->template->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']);
|
||||
$GLOBALS['phpgw']->template->set_var('row_off', $GLOBALS['phpgw_info']['theme']['row_off']);
|
||||
$GLOBALS['phpgw']->template->set_var('row_text',$GLOBALS['phpgw_info']['theme']['row_text']);
|
||||
|
||||
$this->template->pfp('out','form');
|
||||
$this->output .= $GLOBALS['phpgw']->template->fp('out','form');
|
||||
} /* end form function */
|
||||
}
|
||||
?>
|
||||
|
@ -70,7 +70,9 @@
|
||||
|
||||
function out()
|
||||
{
|
||||
global $ab_id,$nolname,$nofname;
|
||||
$ab_id = get_var('ab_id',array('GET','POST'));
|
||||
$nolname = get_var('nolname',array('GET','POST'));
|
||||
$nofname = get_var('nofname',array('GET','POST'));
|
||||
|
||||
if($nolname || $nofname)
|
||||
{
|
||||
@ -84,7 +86,12 @@
|
||||
}
|
||||
|
||||
// First, make sure they have permission to this entry
|
||||
$check = $this->bo->read_entry(array('id' => $ab_id, 'fields' => array('owner' => 'owner')));
|
||||
$check = $this->bo->read_entry(array(
|
||||
'id' => $ab_id,
|
||||
'fields' => array(
|
||||
'owner' => 'owner'
|
||||
)
|
||||
));
|
||||
$perms = $this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_READ);
|
||||
|
||||
if((!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id']))
|
||||
|
@ -17,14 +17,11 @@
|
||||
$GLOBALS['phpgw_info'] = array();
|
||||
|
||||
$GLOBALS['phpgw_info']['flags'] = array(
|
||||
'currentapp' => 'addressbook',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
'currentapp' => 'addressbook'
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
$obj = CreateObject('addressbook.uiaddressbook');
|
||||
$obj->index();
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user