2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* 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$ */
|
|
|
|
|
|
|
|
if ($confirm) {
|
2000-09-05 20:36:13 +02:00
|
|
|
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2000-09-05 20:36:13 +02:00
|
|
|
$phpgw_info["flags"]["currentapp"] = "addressbook";
|
2000-11-16 08:40:37 +01:00
|
|
|
$phpgw_info["flags"]["enable_addressbook_class"] = True;
|
2000-08-18 05:24:22 +02:00
|
|
|
include("../header.inc.php");
|
|
|
|
|
2000-10-04 19:49:36 +02:00
|
|
|
if (! $ab_id) {
|
2001-01-14 03:43:14 +01:00
|
|
|
@Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/"));
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2001-02-02 02:34:22 +01:00
|
|
|
$this = CreateObject("phpgwapi.contacts");
|
|
|
|
|
2001-02-04 12:11:34 +01:00
|
|
|
#$t = new Template($phpgw_info["server"]["app_tpl"]);
|
|
|
|
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
|
2001-02-02 02:34:22 +01:00
|
|
|
$t->set_file(array("delete" => "delete.tpl"));
|
|
|
|
|
2001-01-21 03:31:24 +01:00
|
|
|
|
2000-08-18 05:24:22 +02:00
|
|
|
if ($confirm != "true") {
|
2001-02-04 20:06:00 +01:00
|
|
|
$fields = $this->read($ab_id, array("owner" => $owner), array("owner" => $owner));
|
2001-02-02 02:34:22 +01:00
|
|
|
|
2001-02-04 12:11:34 +01:00
|
|
|
if ($fielfs["owner"] != $phpgw_info["user"]["account_id"]) {
|
2001-02-02 02:34:22 +01:00
|
|
|
@Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/"));
|
|
|
|
}
|
|
|
|
|
|
|
|
$t->set_var(lang_sure,lang("Are you sure you want to delete this entry ?"));
|
|
|
|
$t->set_var(no_link,$phpgw->link("view.php","&ab_id=$ab_id&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
|
|
|
$t->set_var(lang_no,lang("NO"));
|
|
|
|
$t->set_var(yes_link,$phpgw->link("delete.php","ab_id=$ab_id&confirm=true&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
|
|
|
$t->set_var(lang_yes,lang("YES"));
|
|
|
|
$t->pparse("out","delete");
|
|
|
|
|
|
|
|
$phpgw->common->phpgw_footer();
|
2000-08-18 05:24:22 +02:00
|
|
|
|
|
|
|
} else {
|
2001-02-02 02:34:22 +01:00
|
|
|
$this->account_id=$phpgw_info["user"]["account_id"];
|
|
|
|
$this->delete($ab_id);
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-02-02 02:34:22 +01:00
|
|
|
@Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/",
|
|
|
|
"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
2000-09-05 05:14:08 +02:00
|
|
|
?>
|