From ce98306f315a53f2ac4b8c010341c4f84bf728a8 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 19 Oct 2006 14:29:27 +0000 Subject: suspension and cancellation reasons --- httemplate/edit/reason.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 httemplate/edit/reason.html (limited to 'httemplate/edit/reason.html') diff --git a/httemplate/edit/reason.html b/httemplate/edit/reason.html new file mode 100644 index 000000000..2f5932846 --- /dev/null +++ b/httemplate/edit/reason.html @@ -0,0 +1,42 @@ +% +% $cgi->param('class') =~ /^(\w)$/ or die "illegal class"; +% my $class=$1; +% +% my %classmap = ('C' => 'cancel', +% 'S' => 'suspend', +% ); +% my $classname = $classmap{$class}; +% +% my (@types) = qsearch( 'reason_type', { 'class' => $class } ); +% +<% include( 'elements/edit.html', + 'name' => ucfirst($classname) . ' Reason', + 'table' => 'reason', + 'labels' => { + 'reasonnum' => ucfirst($classname) . ' Reason', + 'reason_type' => ucfirst($classname) . ' Reason type', + 'reason' => ucfirst($classname) . ' Reason', + 'disabled' => 'Disabled', + 'class' => '', + }, + 'fields' => [ + { 'field' => 'reason_type', + 'type' => 'select', + 'value' => { 'vcolumn' => 'typenum', + 'ccolumn' => 'type', + 'values' => \@types, + }, + }, + 'reason', + { 'field' => 'class', + 'type' => 'fixedhidden', + 'value' => $class, + }, + { 'field' => 'disabled', + 'type' => 'checkbox', + 'value' => 'Y' + }, + ], + 'viewall_url' => $p . "browse/reason.html?class=$class", + ) +%> -- cgit v1.2.1 From 9811b8ce65909a293810ddbcd8c9b5ca963fba01 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 23 Oct 2006 04:21:04 +0000 Subject: events should attach reasons --- httemplate/edit/reason.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'httemplate/edit/reason.html') diff --git a/httemplate/edit/reason.html b/httemplate/edit/reason.html index 2f5932846..7c0722cea 100644 --- a/httemplate/edit/reason.html +++ b/httemplate/edit/reason.html @@ -9,6 +9,9 @@ % % my (@types) = qsearch( 'reason_type', { 'class' => $class } ); % +% unless (scalar(@types)) { +% print $cgi->redirect( "reason_type.html?class=$class" ); +% } <% include( 'elements/edit.html', 'name' => ucfirst($classname) . ' Reason', 'table' => 'reason', -- cgit v1.2.1