egroupware_official/addressbook/deletefield.php

68 lines
2.6 KiB
PHP
Raw Normal View History

2001-04-21 16:51:05 +02:00
<?php
/**************************************************************************\
2001-04-23 05:13:03 +02:00
* phpGroupWare - Addressbook *
2001-04-21 16:51:05 +02:00
* (http://www.phpgroupware.org) *
2001-05-21 10:18:40 +02:00
* Written by Bettina Gille [ceb@phpgroupware.org] *
2001-04-21 16:51:05 +02:00
* ----------------------------------------------- *
* 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-05-21 10:18:40 +02:00
if ($confirm)
{
$phpgw_info['flags'] = array(
2001-04-21 16:51:05 +02:00
'noheader' => True,
'nonavbar' => True
);
}
2001-05-21 10:18:40 +02:00
$phpgw_info['flags']['currentapp'] = 'addressbook';
2001-04-21 16:51:05 +02:00
include('../header.inc.php');
2001-05-21 10:18:40 +02:00
if (!$field)
{
2001-04-21 16:51:05 +02:00
Header('Location: ' . $phpgw->link('/addressbook/fields.php'));
}
2001-05-21 10:18:40 +02:00
if ($confirm)
{
2001-04-21 16:51:05 +02:00
save_custom_field($field);
Header('Location: ' . $phpgw->link('/addressbook/fields.php',"start=$start&query=$query&sort=$sort"));
}
else
{
2001-05-21 10:18:40 +02:00
$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="field" value="' . $field .'">' . "\n";
2001-04-21 16:51:05 +02:00
$t = new Template(PHPGW_APP_TPL);
2001-04-21 16:51:05 +02:00
$t->set_file(array('field_delete' => 'delete_common.tpl'));
$t->set_var('messages',lang('Are you sure you want to delete this field?'));
$nolinkf = $phpgw->link('/addressbook/fields.php',"field_id=$field_id&start=$start&query=$query&sort=$sort");
2001-05-21 10:18:40 +02:00
$nolink = '<a href="' . $nolinkf . '">' . lang('No') . '</a>';
2001-04-21 16:51:05 +02:00
$t->set_var('no',$nolink);
2001-05-21 10:18:40 +02:00
$yeslinkf = $phpgw->link('/addressbook/deletefield.php','field_id=' . $field_id . '&confirm=True');
$yeslinkf = '<form method="POST" name="yesbutton" action="' . $phpgw->link('/addressbook/deletefield.php') . '\">'
2001-04-21 16:51:05 +02:00
. $hidden_vars
2001-05-21 10:18:40 +02:00
. '<input type="hidden" name="field_id" value="' . $field_id . '">'
. '<input type="hidden" name="confirm" value="True">'
. '<input type="submit" name="yesbutton" value="Yes">'
. '</form><script>document.yesbutton.yesbutton.focus()</script>';
2001-04-21 16:51:05 +02:00
2001-05-21 10:18:40 +02:00
$yeslink = '<a href="' . $yeslinkf . '">' . lang('Yes') . '</a>';
2001-04-21 16:51:05 +02:00
$yeslink = $yeslinkf;
$t->set_var('yes',$yeslink);
$t->pparse('out','field_delete');
}
$phpgw->common->phpgw_footer();
?>