[Rt-commit] r13555 - in rt/3.8/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Mon Jun 23 21:16:26 EDT 2008
Author: sartak
Date: Mon Jun 23 21:16:22 2008
New Revision: 13555
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/share/html/Dashboards/Modify.html
rt/3.8/trunk/share/html/Dashboards/Subscription.html
rt/3.8/trunk/share/html/Dashboards/index.html
Log:
r63098 at onn: sartak | 2008-06-23 21:16:00 -0400
Add a button to delete dashboards, some minor improvements to unsubscribe
Modified: rt/3.8/trunk/share/html/Dashboards/Modify.html
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/Modify.html (original)
+++ rt/3.8/trunk/share/html/Dashboards/Modify.html Mon Jun 23 21:16:22 2008
@@ -73,6 +73,9 @@
</td></tr>
</table>
<& /Elements/Submit, Name => 'Save', Label => loc('Save Changes') &>
+% if ($Dashboard->Id) {
+<& /Elements/Submit, Name => 'Delete', Label => loc('Delete') &>
+% }
</form>
<%INIT>
@@ -148,11 +151,22 @@
}
}
+
+if (!$Create && !$tried_create && $id && $ARGS{'Delete'}) {
+ my ($ok, $msg) = $Dashboard->Delete();
+ $ok || Abort("Couldn't delete dashboard $id: $msg");
+
+ # put the user back into a useful place with a message
+ RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Dashboards/index.html?Deleted=$id");
+
+}
+
</%INIT>
<%ARGS>
$Create => undef
$Name => undef
$id => '' unless defined $id
+$Delete => undef
</%ARGS>
Modified: rt/3.8/trunk/share/html/Dashboards/Subscription.html
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/Subscription.html (original)
+++ rt/3.8/trunk/share/html/Dashboards/Subscription.html Mon Jun 23 21:16:22 2008
@@ -191,10 +191,10 @@
if ($SubscriptionObj->Id && $Unsubscribe) {
my ($ok, $msg) = $SubscriptionObj->Delete();
- $ok || Abort("Couldn't unsubscribe to dashboard $DashboardId.");
+ $ok || Abort("Couldn't unsubscribe to dashboard $DashboardId: $msg");
# put the user back into a useful place with a message
- RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Dashboards/index.html?Unsubscribe=$DashboardId");
+ RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Dashboards/index.html?Unsubscribed=$DashboardId");
}
my %fields = (
Modified: rt/3.8/trunk/share/html/Dashboards/index.html
==============================================================================
--- rt/3.8/trunk/share/html/Dashboards/index.html (original)
+++ rt/3.8/trunk/share/html/Dashboards/index.html Mon Jun 23 21:16:22 2008
@@ -94,19 +94,24 @@
}
my @actions;
-if (defined $Unsubscribe) {
+if (defined $Unsubscribed) {
my $Dashboard = RT::Dashboard->new($session{'CurrentUser'});
- $Dashboard->LoadById($Unsubscribe);
+ $Dashboard->LoadById($Unsubscribed);
if ($Dashboard->Id) {
push @actions, loc("Unsubscribed to dashboard [_1]", $Dashboard->Name);
}
else {
- push @actions, loc("Unable to unsubscribe to dashboard [_1]", $Unsubscribe);
+ push @actions, loc("Unable to unsubscribe to dashboard [_1]", $Unsubscribed);
}
}
+if (defined $Deleted) {
+ push @actions, loc("Deleted dashboard [_1]", $Delete);
+}
+
</%INIT>
<%ARGS>
-$Unsubscribe => undef
+$Unsubscribed => undef
+$Deleted => undef
</%ARGS>
More information about the Rt-commit
mailing list