egroupware_official/infolog/delete.php

60 lines
2.5 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');
2001-06-04 20:26:46 +02:00
$phpgw->infolog = CreateObject('infolog.infolog');
$html = $phpgw->infolog->html;
2001-05-23 21:07:45 +02:00
2001-06-04 20:26:46 +02:00
$hidden_vars = array( 'sort' => $sort,'order' => $order,'query' => $query,'start' => $start,
'filter' => $filter,'cat_id' => $cat_id );
2001-05-23 21:07:45 +02:00
if (! $info_id) {
2001-06-04 20:26:46 +02:00
Header('Location: ' . $html->link('/infolog/index.php',$hidden_vars));
2001-05-23 21:07:45 +02:00
}
2001-05-24 15:40:40 +02:00
if (! $phpgw->infolog->check_access($info_id,PHPGW_ACL_DELETE)) {
2001-06-04 20:26:46 +02:00
Header('Location: ' . $html->link('/infolog/index.php',$hidden_vars));
2001-05-23 21:07:45 +02:00
}
if ($confirm) {
2001-05-24 15:40:40 +02:00
$phpgw->infolog->delete($info_id);
2001-05-23 21:07:45 +02:00
2001-06-04 20:26:46 +02:00
Header('Location: ' . $html->link('/infolog/index.php',$hidden_vars + array( 'cd' => 16 )));
2001-05-23 21:07:45 +02:00
} else {
$phpgw->common->phpgw_header();
echo parse_navbar();
2001-06-04 20:26:46 +02:00
$t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
2001-05-24 20:17:54 +02:00
$t->set_file(array( 'info_delete' => 'delete.tpl' ));
$t->set_var( $phpgw->infolog->setStyleSheet( ));
$t->set_var( $phpgw->infolog->infoHeaders( ));
$t->set_var( $phpgw->infolog->formatInfo( $info_id ));
$t->set_var('lang_info_action',lang('Info Log - Delete'));
2001-05-23 21:07:45 +02:00
2001-05-24 20:17:54 +02:00
$t->set_var('deleteheader',lang('Are you sure you want to delete this entry'));
2001-06-04 20:26:46 +02:00
$t->set_var('no_button',$html->form_1button('no_button','No - Cancel','','/infolog/index.php',$hidden_vars));
$t->set_var('yes_button',$html->form_1button('yes_button','Yes - Delete','','/infolog/delete.php',
$hidden_vars + array('info_id' => $info_id,'confirm' => 'True')));
2001-05-24 20:17:54 +02:00
$t->pfp('out','info_delete');
2001-05-23 21:07:45 +02:00
$phpgw->common->phpgw_footer();
echo parse_navbar_end();
}
?>