egroupware/infolog/delete.php

82 lines
3.4 KiB
PHP
Raw Normal View History

2001-05-23 21:07:45 +02:00
<?php
/**************************************************************************\
* phpGroupWare - Info Log *
* http://www.phpgroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
2001-05-24 15:40:40 +02:00
* originaly based on todo written by Joseph Engo <jengo@phpgroupware.org> *
2001-05-23 21:07:45 +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$ */
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'nofooter' => True,
2001-05-24 15:40:40 +02:00
'currentapp' => 'infolog'
2001-05-23 21:07:45 +02:00
);
include('../header.inc.php');
if (! $info_id) {
2001-05-24 15:40:40 +02:00
Header('Location: ' . $phpgw->link('/infolog/index.php',"&sort=$sort&order=$order&query=$query&start=$start"
2001-05-23 21:07:45 +02:00
. "&filter=$filter&cat_id=$cat_id"));
}
2001-05-24 15:40:40 +02:00
$phpgw->infolog = createobject('infolog.infolog');
if (! $phpgw->infolog->check_access($info_id,PHPGW_ACL_DELETE)) {
Header('Location: ' . $phpgw->link('/infolog/index.php',"&sort=$sort&order=$order&query=$query&start=$start"
2001-05-23 21:07:45 +02:00
. "&filter=$filter&cat_id$cat_id"));
}
if ($confirm) {
2001-05-24 15:40:40 +02:00
$phpgw->infolog->delete($info_id);
2001-05-23 21:07:45 +02:00
2001-05-24 15:40:40 +02:00
Header('Location: ' . $phpgw->link('/infolog/index.php',"cd=16&sort=$sort&order=$order&query=$query&start="
2001-05-23 21:07:45 +02:00
. "$start&filter=$filter&cat_id=$cat_id"));
} else {
$phpgw->common->phpgw_header();
echo parse_navbar();
$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";
$phpgw->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
2001-05-23 21:07:45 +02:00
$phpgw->template->set_file(array( 'info_delete' => 'delete.tpl' ));
2001-05-24 15:40:40 +02:00
$phpgw->template->set_var( $phpgw->infolog->setStyleSheet( ));
$phpgw->template->set_var( $phpgw->infolog->infoHeaders( ));
$phpgw->template->set_var( $phpgw->infolog->formatInfo( $info_id ));
2001-05-23 21:07:45 +02:00
$phpgw->template->set_var('lang_info_action',lang('Info Log - Delete'));
$phpgw->template->set_var('deleteheader',lang('Are you sure you want to delete this entry'));
2001-05-24 15:40:40 +02:00
$nolinkf = $phpgw->link('/infolog/index.php',"sort=$sort&order=$order&query=$query&start=$start&filter=$filter");
2001-05-23 21:07:45 +02:00
$nolink = '<a href="' . $nolinkf . '">' . lang('No') .'</a>';
$phpgw->template->set_var('nolink',$nolink);
$phpgw->template->set_var('cancel_action',$nolinkf);
$phpgw->template->set_var('lang_cancel',lang('No - Cancel'));
2001-05-24 15:40:40 +02:00
$yeslinkf = $phpgw->link('/infolog/delete.php',"info_id=$info_id&confirm=True&sort="
2001-05-23 21:07:45 +02:00
. "$sort&order=$order&query=$query&start=$start&filter=$filter");
$yeslink = '<a href="' . $yeslinkf . '">' . lang('Yes') . '</a>';
$phpgw->template->set_var('yeslink',$yeslink);
$phpgw->template->set_var('delete_action',$yeslinkf);
$phpgw->template->set_var('lang_delete',lang('Yes - Delete'));
$phpgw->template->pfp('out','info_delete');
$phpgw->common->phpgw_footer();
echo parse_navbar_end();
}
?>