[Bps-public-commit] r13920 - RT-BugTracker/html/Dist/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Wed Jul 9 14:54:36 EDT 2008
Author: ruz
Date: Wed Jul 9 14:54:32 2008
New Revision: 13920
Added:
RT-BugTracker/html/Dist/Elements/EditNotes
Modified:
RT-BugTracker/html/Dist/Elements/ShowNotes
Log:
* update ShowNotes and add EditNotes widget
Added: RT-BugTracker/html/Dist/Elements/EditNotes
==============================================================================
--- (empty file)
+++ RT-BugTracker/html/Dist/Elements/EditNotes Wed Jul 9 14:54:32 2008
@@ -0,0 +1,45 @@
+<% loc('Distribution notes') %>:
+<textarea cols="120" rows="20" name="Queue-<% $Queue->id %>-Notes"><% $value %></textarea><br />
+<%ARGS>
+$Queue => undef
+</%ARGS>
+<%INIT>
+my $value = $Queue->FirstAttribute('DistributionNotes');
+$value = $value->Content if $value;
+$value = '' unless defined $value;
+</%INIT>
+
+<%METHOD Process>
+<%ARGS>
+$Queue => undef
+</%ARGS>
+<%INIT>
+return () unless exists $ARGS{'Queue-'. $Queue->id .'-Notes'};
+my $value = $ARGS{'Queue-'. $Queue->id .'-Notes'};
+$value = $m->comp('/Elements/ScrubHTML', Content => $value );
+
+my ($status, $msg, $result);
+if ( defined $value && length $value ) {
+ ($status, $msg) = $Queue->SetAttribute(
+ Name => 'DistributionNotes',
+ Description => 'A html block with distribution notes',
+ Content => $value,
+ );
+ $RT::Logger->error("Couldn't set attribute: $msg")
+ unless $status;
+
+ $result = loc("Updated distribution notes");
+} else {
+ ($status, $msg) = $Queue->DeleteAttribute( 'DistributionNotes' );
+ $RT::Logger->error("Couldn't delete attribute: $msg")
+ unless $status;
+
+ $result = loc("Deleted distribution notes");
+}
+return loc("System error. Couldn't set notes for the distribution.")
+ unless $status;
+
+return $result;
+
+</%INIT>
+</%METHOD>
Modified: RT-BugTracker/html/Dist/Elements/ShowNotes
==============================================================================
--- RT-BugTracker/html/Dist/Elements/ShowNotes (original)
+++ RT-BugTracker/html/Dist/Elements/ShowNotes Wed Jul 9 14:54:32 2008
@@ -1,12 +1,20 @@
% if ( $Queue->Disabled ) {
-<h3>WARNING: Queue is disabled</h3>
+<h3><% loc('WARNING: Queue is disabled') %></h3>
-<p>This queue has been disabled by maintainers' request. Heh, it's still possible to create bugs using UI and may be email address, but we <b>beg you</b> "don't create new tickets". Instead read distribution's documentation and figure out how to report issues properly.</p>
+<p>This queue has been disabled by maintainers' request. Heh, it's still possible to create bugs using email address, but we <b>beg you</b> "don't create new tickets". Instead read distribution's documentation and figure out how to report issues properly.</p>
+% }
+
+% if ( defined $notes ) {
+<h3><% loc("Maintainer(s)' notes") %></h3>
-<p>Sorry for this. Later we'll provid more info here and disable creation of reports entirly.</p>
+<p><% $notes |n %></p>
% }
+
<%ARGS>
$Queue
</%ARGS>
<%INIT>
+my $notes = $Queue->FirstAttribute( 'DistributionNotes' );
+$notes = $notes->Content if $notes;
+$notes = undef if defined $notes && !length $notes;
</%INIT>
More information about the Bps-public-commit
mailing list