From: Jan Schneider Date: Fri, 30 Apr 2010 09:50:23 +0000 (+0200) Subject: Cleanup script name. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e94c9f7e4c6ab6824eb38fde6b899fef5d152101;p=horde.git Cleanup script name. --- diff --git a/whups/lib/Whups.php b/whups/lib/Whups.php index 257342a92..bfd809eee 100644 --- a/whups/lib/Whups.php +++ b/whups/lib/Whups.php @@ -843,7 +843,7 @@ class Whups { // Admins can delete attachments. if (Whups::hasPermission($queue, 'queue', Horde_Perms::DELETE)) { $url = Horde_Util::addParameter( - Horde::applicationUrl('ticket/deleteAttachment.php'), + Horde::applicationUrl('ticket/delete_attachment.php'), array('file' => $file['name'], 'id' => $ticket, 'url' => Horde::selfUrl(true, false, true))); diff --git a/whups/ticket/deleteAttachment.php b/whups/ticket/deleteAttachment.php deleted file mode 100644 index d9b0edb9c..000000000 --- a/whups/ticket/deleteAttachment.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Copyright 2001-2010 The Horde Project (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 dirname(__FILE__) . '/../lib/Application.php'; -Horde_Registry::appInit('whups'); - -$ticket = Whups::getCurrentTicket(); -if (!Whups::hasPermission($ticket->get('queue'), 'queue', Horde_Perms::DELETE)) { - $notification->push(_("Permission Denied"), 'horde.error'); - header('Location: ' . Horde::applicationUrl($prefs->getValue('whups_default_view') . '.php', true)); - exit; -} - -$file = basename(Horde_Util::getFormData('file')); -$ticket->change('delete-attachment', $file); -$result = $ticket->commit(); -if (is_a($result, 'PEAR_Error')) { - $notification->push($result, 'horde.error'); -} else { - $notification->push(sprintf(_("Attachment %s deleted."), $file), 'horde.success'); -} - -if ($url = Horde_Util::getFormData('url')) { - header('Location: ' . $url); -} else { - header('Location: ' . Horde::applicationUrl($prefs->getValue('whups_default_view') . '.php', true)); -} diff --git a/whups/ticket/delete_attachment.php b/whups/ticket/delete_attachment.php new file mode 100644 index 000000000..d9b0edb9c --- /dev/null +++ b/whups/ticket/delete_attachment.php @@ -0,0 +1,35 @@ + + * Copyright 2001-2010 The Horde Project (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 dirname(__FILE__) . '/../lib/Application.php'; +Horde_Registry::appInit('whups'); + +$ticket = Whups::getCurrentTicket(); +if (!Whups::hasPermission($ticket->get('queue'), 'queue', Horde_Perms::DELETE)) { + $notification->push(_("Permission Denied"), 'horde.error'); + header('Location: ' . Horde::applicationUrl($prefs->getValue('whups_default_view') . '.php', true)); + exit; +} + +$file = basename(Horde_Util::getFormData('file')); +$ticket->change('delete-attachment', $file); +$result = $ticket->commit(); +if (is_a($result, 'PEAR_Error')) { + $notification->push($result, 'horde.error'); +} else { + $notification->push(sprintf(_("Attachment %s deleted."), $file), 'horde.success'); +} + +if ($url = Horde_Util::getFormData('url')) { + header('Location: ' . $url); +} else { + header('Location: ' . Horde::applicationUrl($prefs->getValue('whups_default_view') . '.php', true)); +}