egroupware_official/addressbook/fields.php

96 lines
4.3 KiB
PHP
Raw Normal View History

<?php
/**************************************************************************\
* phpGroupWare - Addressbook *
* http://www.phpgroupware.org *
2001-04-21 16:51:05 +02:00
* Written by Bettina Gille [ceb@phpgroupware.org] *
* ----------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$GLOBALS['phpgw_info'] = array();
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw_info']['flags'] = array(
2001-04-21 16:51:05 +02:00
'currentapp' => 'addressbook',
2001-08-09 02:52:53 +02:00
'enable_nextmatchs_class' => True
);
2001-04-21 16:51:05 +02:00
include('../header.inc.php');
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_file(array(
2001-04-21 16:51:05 +02:00
'field_list_t' => 'listfields.tpl',
2001-08-09 02:52:53 +02:00
'field_list' => 'listfields.tpl'
));
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_block('field_list_t','field_list','list');
$field = $HTTP_POST_VARS['field'];
$start = $HTTP_POST_VARS['start'];
$query = $HTTP_POST_VARS['query'];
$sort = $HTTP_POST_VARS['sort'];
$order = $HTTP_POST_VARS['order'];
$filter = $HTTP_POST_VARS['filter'];
2001-08-09 02:52:53 +02:00
$common_hidden_vars =
'<input type="hidden" name="sort" value="' . $sort . '">' . "\n"
. '<input type="hidden" name="order" value="' . $order . '">' . "\n"
. '<input type="hidden" name="query" value="' . $query . '">' . "\n"
. '<input type="hidden" name="start" value="' . $start . '">' . "\n"
. '<input type="hidden" name="filter" value="' . $filter . '">' . "\n";
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('lang_action',lang('Custom Fields'));
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/addressbook/addfield.php'));
$GLOBALS['phpgw']->template->set_var('lang_add',lang('Add'));
$GLOBALS['phpgw']->template->set_var('title_fields',lang('addressbook').' - '.lang('Custom Fields'));
$GLOBALS['phpgw']->template->set_var('lang_search',lang('Search'));
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/addressbook/fields.php'));
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
if (!$start)
{
$start = 0;
}
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
if (!$sort)
{
$sort = 'ASC';
}
2001-04-21 16:51:05 +02:00
$fields = read_custom_fields($start,$limit,$query,$sort,$order);
$total_records = count($fields);
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('left',$GLOBALS['phpgw']->nextmatchs->left('/addressbook/fields.php',$start,$total_records));
$GLOBALS['phpgw']->template->set_var('right',$GLOBALS['phpgw']->nextmatchs->right('/addressbook/fields.php',$start,$total_records));
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('lang_showing',$GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$start));
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
$GLOBALS['phpgw']->template->set_var('sort_field',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'name',$order,'/addressbook/fields.php',lang('Name')));
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit'));
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
2001-04-21 16:51:05 +02:00
for ($i=0;$i<count($fields);$i++)
{
2001-12-04 02:04:21 +01:00
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$GLOBALS['phpgw']->template->set_var(tr_color,$tr_color);
2001-04-21 16:51:05 +02:00
2001-05-01 11:32:52 +02:00
$field = $fields[$i]['name'];
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('cfield',$field);
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('edit',$GLOBALS['phpgw']->link('/addressbook/editfield.php',"field=$field&start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
$GLOBALS['phpgw']->template->set_var('lang_edit_entry',lang('Edit'));
2001-04-21 16:51:05 +02:00
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->set_var('delete',$GLOBALS['phpgw']->link('/addressbook/deletefield.php',"field=$field&start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
$GLOBALS['phpgw']->template->set_var('lang_delete_entry',lang('Delete'));
$GLOBALS['phpgw']->template->parse('list','field_list',True);
}
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->template->parse('out','field_list_t',True);
$GLOBALS['phpgw']->template->p('out');
2001-12-04 02:04:21 +01:00
$GLOBALS['phpgw']->common->phpgw_footer();
?>