/usr/share/horde/whups/ticket/delete.php is in php-horde-whups 3.0.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | <?php
/**
* Displays and handles the form to delete a ticket.
*
* Copyright 2001-2002 Robert E. Coyle <robertecoyle@hotmail.com>
* Copyright 2001-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you
* did not receive this file, see http://www.horde.org/licenses/bsdl.php.
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('whups');
$ticket = Whups::getCurrentTicket();
$page_output->addLinkTag($ticket->feedLink());
$details = $ticket->getDetails();
if (!Whups::hasPermission($details['queue'], 'queue', Horde_Perms::DELETE)) {
$notification->push(_("Permission Denied"), 'horde.error');
Horde::url($prefs->getValue('whups_default_view') . '.php', true)
->redirect();
}
Whups::addTopbarSearch();
$vars = Horde_Variables::getDefaultVariables();
$vars->set('id', $id = $ticket->getId());
foreach ($details as $varname => $value) {
$vars->add($varname, $value);
}
$title = sprintf(_("Delete %s?"), '[#' . $id . '] ' . $ticket->get('summary'));
$deleteform = new Whups_Form_Ticket_Delete($vars, $title);
if ($vars->get('formname') == 'whups_form_ticket_delete') {
if ($deleteform->validate($vars)) {
if ($vars->get('yesno') == 1) {
$deleteform->getInfo($vars, $info);
try {
$ticket->delete();
$notification->push(sprintf(_("Ticket %d has been deleted."), $info['id']), 'horde.success');
Horde::url($prefs->getValue('whups_default_view') . '.php', true)
->redirect();
} catch (Whups_Exception $e) {
$notification->push(_("There was an error deleting the ticket:") . ' ' . $e->getMessage(), 'horde.error');
} catch (Horde_Exception_NotFound $e) {
$notification->push(sprintf(_("Ticket %d not found."), $info['id']));
}
} else {
$notification->push(_("The ticket was not deleted."), 'horde.message');
}
}
}
$page_output->header(array(
'title' => $title
));
$notification->notify(array('listeners' => 'status'));
require WHUPS_TEMPLATES . '/prevnext.inc';
$tabs = Whups::getTicketTabs($vars, $id);
echo $tabs->render('delete');
$deleteform->renderActive($deleteform->getRenderer(), $vars, Horde::url('ticket/delete.php'), 'post');
echo '<br />';
$form = new Whups_Form_TicketDetails($vars, $ticket);
$ticket->setDetails($vars);
$r = $form->getRenderer();
$r->beginInactive($title);
$r->renderFormInactive($form, $vars);
$r->end();
$page_output->footer();
|