[Rt-commit] r16516 - rt/branches/3.999-DANGEROUS/share/html/Admin/Global/StatusSchemas
ruz at bestpractical.com
ruz at bestpractical.com
Thu Oct 23 12:40:28 EDT 2008
Author: ruz
Date: Thu Oct 23 12:40:28 2008
New Revision: 16516
Added:
rt/branches/3.999-DANGEROUS/share/html/Admin/Global/StatusSchemas/Statuses.html
Removed:
rt/branches/3.999-DANGEROUS/share/html/Admin/Global/StatusSchemas/Modify.html
Log:
* move Modify.html -> Statuses.html
Added: rt/branches/3.999-DANGEROUS/share/html/Admin/Global/StatusSchemas/Statuses.html
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/share/html/Admin/Global/StatusSchemas/Statuses.html Thu Oct 23 12:40:28 2008
@@ -0,0 +1,59 @@
+<&| /Admin/Elements/Header, title => $title &>
+
+<& Elements/Tabs,
+ title => $title,
+ schema => $schema,
+ current_tab => 'Admin/Global/StatusSchemas/Statuses.html',
+&>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="<% RT->config->get('WebPath') %>/Admin/Global/StatusSchemas/Statuses.html" method="post">
+<input type="hidden" name="name" value="<% $name %>" />
+
+% foreach my $type (qw(Initial Active Inactive)) { # loc
+% my $method = lc $type;
+<% _($type) %>: <input name="<% $method %>" value="<% $ARGS{ $method } || join ', ', $schema->$method() %>" size="40" /><br />
+% }
+
+<& /Elements/Submit, label => _('Update'), name => 'update' &>
+</form>
+
+</&>
+
+<%INIT>
+my $title = _("Modify system status schemas", $name);
+
+use RT::StatusSchema;
+my $schema = RT::StatusSchema->new->load( $name );
+unless ( $schema ) {
+ Jifty->web->redirect(
+ RT->config->get('WebPath')
+ . '/Admin/Global/StatusSchemas/index.html'
+ );
+}
+
+my @results;
+if ( $update ) {
+ my %tmp;
+ foreach my $type ( qw(initial active inactive) ) {
+ $tmp{ $type } = [
+ grep length && defined,
+ map { s/^\s+//; s/\s+$//; $_}
+ split /\s*,\s*/,
+ $ARGS{ $type } || ''
+ ];
+ }
+ my ($status, $msg) = $schema->set_statuses( %tmp );
+ push @results, $msg if $msg;
+
+ foreach my $type ( qw(initial active inactive) ) {
+ $ARGS{ $type } = join ', ', $schema->$type();
+ }
+}
+
+</%INIT>
+<%ARGS>
+$name => undef
+$update => undef
+</%ARGS>
More information about the Rt-commit
mailing list