2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
2001-02-10 13:56:49 +01:00
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - addressbook *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* Written by Joseph Engo <jengo@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$ */
|
|
|
|
|
2001-03-29 10:09:50 +02:00
|
|
|
$phpgw_info['flags'] = array(
|
|
|
|
'noheader' => True,
|
|
|
|
'nonavbar' => True,
|
|
|
|
'currentapp' => 'addressbook'
|
|
|
|
);
|
|
|
|
|
|
|
|
include('../header.inc.php');
|
2001-02-10 13:56:49 +01:00
|
|
|
|
2001-03-29 10:09:50 +02:00
|
|
|
if (! $ab_id)
|
|
|
|
{
|
|
|
|
Header('Location: ' . $phpgw->link('/addressbook/index.php'));
|
2001-02-10 13:56:49 +01:00
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-07-03 09:17:13 +02:00
|
|
|
$contacts = CreateObject('phpgwapi.contacts');
|
|
|
|
$fields = $contacts->read_single_entry($ab_id,array('owner' => 'owner'));
|
2001-05-21 10:18:40 +02:00
|
|
|
//$record_owner = $fields[0]['owner'];
|
2001-02-02 02:34:22 +01:00
|
|
|
|
2001-07-03 09:17:13 +02:00
|
|
|
if (! $contacts->check_perms($contacts->grants[$fields[0]['owner']],PHPGW_ACL_DELETE) && $fields[0]['owner'] != $phpgw_info['user']['account_id'])
|
2001-03-29 10:09:50 +02:00
|
|
|
{
|
|
|
|
Header('Location: '
|
2001-03-29 17:39:10 +02:00
|
|
|
. $phpgw->link('/addressbook/index.php',"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
2001-03-29 10:09:50 +02:00
|
|
|
$phpgw->common->phpgw_exit();
|
|
|
|
}
|
|
|
|
|
2001-05-10 14:21:16 +02:00
|
|
|
$t = new Template(PHPGW_APP_TPL);
|
2001-05-21 10:18:40 +02:00
|
|
|
$t->set_file(array('delete' => 'delete.tpl'));
|
2001-02-02 02:34:22 +01:00
|
|
|
|
2001-05-21 10:18:40 +02:00
|
|
|
if ($confirm != 'true')
|
|
|
|
{
|
2001-03-29 10:09:50 +02:00
|
|
|
$phpgw->common->phpgw_header();
|
|
|
|
echo parse_navbar();
|
|
|
|
|
2001-05-21 10:18:40 +02:00
|
|
|
$t->set_var('lang_sure',lang('Are you sure you want to delete this entry ?'));
|
|
|
|
$t->set_var('no_link',$phpgw->link('/addressbook/index.php',
|
2001-03-29 17:39:10 +02:00
|
|
|
"ab_id=$ab_id&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
2001-05-21 10:18:40 +02:00
|
|
|
$t->set_var('lang_no',lang('NO'));
|
|
|
|
$t->set_var('yes_link',$phpgw->link('/addressbook/delete.php',
|
2001-03-28 14:51:59 +02:00
|
|
|
"ab_id=$ab_id&confirm=true&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
2001-05-21 10:18:40 +02:00
|
|
|
$t->set_var('lang_yes',lang('YES'));
|
|
|
|
$t->pparse('out','delete');
|
2001-02-17 11:35:10 +01:00
|
|
|
|
|
|
|
$phpgw->common->phpgw_footer();
|
2001-05-21 10:18:40 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-07-03 09:17:13 +02:00
|
|
|
$contacts->account_id = $phpgw_info['user']['account_id'];
|
|
|
|
$contacts->delete($ab_id);
|
2001-05-21 10:18:40 +02:00
|
|
|
|
|
|
|
@Header('Location: ' . $phpgw->link('/addressbook/index.php',
|
2001-03-29 17:39:10 +02:00
|
|
|
"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
|
2001-02-10 13:56:49 +01:00
|
|
|
}
|
2000-09-05 05:14:08 +02:00
|
|
|
?>
|