[Rt-commit] [svn] r1104 - rt/branches/rt-3.1/html/Admin/Elements
leira at pallas.eruditorum.org
leira at pallas.eruditorum.org
Thu Jun 17 15:39:21 EDT 2004
Author: leira
Date: Thu Jun 17 15:39:21 2004
New Revision: 1104
Modified:
rt/branches/rt-3.1/html/Admin/Elements/EditScrips
rt/branches/rt-3.1/html/Admin/Elements/EditTemplates
Log:
RT-Ticket: 2584
RT-Status: resolved
RT-Action: comment
The Templates page now says how many scrips each template is being used by, and if you delete a template that's in use, the actions at the top warn you that you've done so.
Modified: rt/branches/rt-3.1/html/Admin/Elements/EditScrips
==============================================================================
--- rt/branches/rt-3.1/html/Admin/Elements/EditScrips (original)
+++ rt/branches/rt-3.1/html/Admin/Elements/EditScrips Thu Jun 17 15:39:21 2004
@@ -34,6 +34,11 @@
<P><i><&|/l&>(Check box to delete)</&></i></P>
% while (my $scrip = $Scrips->Next ) {
+% my $scrips = new RT::Scrips($session{'CurrentUser'});
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Queue',
+ VALUE => "$queue")
+ if defined $queue;
<TR>
<TD>
<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>">
Modified: rt/branches/rt-3.1/html/Admin/Elements/EditTemplates
==============================================================================
--- rt/branches/rt-3.1/html/Admin/Elements/EditTemplates (original)
+++ rt/branches/rt-3.1/html/Admin/Elements/EditTemplates Thu Jun 17 15:39:21 2004
@@ -31,21 +31,26 @@
% } else {
<TABLE>
<TR>
-<TH>
+<TD>
<i><&|/l&>(Check box to delete)</&></i>
-</TH>
-<TH>
-</TH>
+</TD>
+<TD>
+</TD>
</TR>
% my $count;
% while (my $TemplateObj = $Templates->Next) {
+% my $scrips = new RT::Scrips($session{'CurrentUser'});
+% $scrips->Limit (ENTRYAGGREGATOR => 'OR',
+% FIELD => 'Template',
+% VALUE => $TemplateObj->Id);
<TR>
<TD>
<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>">
</TD>
<TD>
<A HREF="Template.html?Queue=<%$id%>&Template=<%$TemplateObj->id()%>">
-<B><% loc($TemplateObj->Name) %></B></A>
+<B><% loc($TemplateObj->Name) %></B></A> <i>(<% loc('Used by [quant,_1,script]', $scrips->Count) %>)</i>
+
<br><% loc($TemplateObj->Description) %>
</TD>
</TR>
@@ -83,8 +88,15 @@
my $id = $1;
my $TemplateObj = RT::Template->new($session{'CurrentUser'});
$TemplateObj->Load($id);
+ my $scrips = new RT::Scrips($session{'CurrentUser'});
+ $scrips->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Template',
+ VALUE => $TemplateObj->Id);
my ($retval, $msg) = $TemplateObj->Delete;
if ($retval) {
+ if ($scrips->Count) {
+ push @actions, loc('WARNING: Deleted template was used by [quant,_1,script]', $scrips->Count);
+ }
push @actions, loc("Template deleted");
}
else {
More information about the Rt-commit
mailing list