summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorjeff <jeff>2006-10-19 14:29:27 +0000
committerjeff <jeff>2006-10-19 14:29:27 +0000
commitce98306f315a53f2ac4b8c010341c4f84bf728a8 (patch)
tree284731e6ad5daf4580b3afdfa3812a864e136b89 /httemplate/edit
parentcdffa6e5fe5c8cf0755a3f3497ae71170bbe4cea (diff)
suspension and cancellation reasons
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/process/reason.html6
-rw-r--r--httemplate/edit/process/reason_type.html6
-rw-r--r--httemplate/edit/reason.html42
-rw-r--r--httemplate/edit/reason_type.html28
4 files changed, 82 insertions, 0 deletions
diff --git a/httemplate/edit/process/reason.html b/httemplate/edit/process/reason.html
new file mode 100644
index 000000000..55c1ea958
--- /dev/null
+++ b/httemplate/edit/process/reason.html
@@ -0,0 +1,6 @@
+<% include( 'elements/process.html',
+ 'table' => 'reason',
+ 'redirect' => popurl(3) . 'browse/reason.html?class=' .
+ $cgi->param('class') . '&',
+ )
+%>
diff --git a/httemplate/edit/process/reason_type.html b/httemplate/edit/process/reason_type.html
new file mode 100644
index 000000000..4ccccaddd
--- /dev/null
+++ b/httemplate/edit/process/reason_type.html
@@ -0,0 +1,6 @@
+<% include( 'elements/process.html',
+ 'table' => 'reason_type',
+ 'redirect' => popurl(3) . 'browse/reason_type.html?class=' .
+ $cgi->param('class') . '&',
+ )
+%>
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",
+ )
+%>
diff --git a/httemplate/edit/reason_type.html b/httemplate/edit/reason_type.html
new file mode 100644
index 000000000..970529e35
--- /dev/null
+++ b/httemplate/edit/reason_type.html
@@ -0,0 +1,28 @@
+%
+%$cgi->param('class') =~ /^(\w)$/;
+%my $class = $1;
+%
+%my %classmap = ( 'C' => 'Cancel',
+% 'S' => 'Suspend',
+% );
+%
+%my $classname = $classmap{$class};
+%
+<% include( 'elements/edit.html',
+ 'name' => $classname . ' Reason Type',
+ 'table' => 'reason_type',
+ 'labels' => {
+ 'typenum' => $classname . ' reason type',
+ 'type' => $classname . ' reason type name',
+ 'class' => '',
+ },
+ 'fields' => [
+ 'type',
+ { 'field' => 'class',
+ 'type' => 'hidden',
+ },
+ ],
+ 'viewall_url' => $p . "browse/reason_type.html?class=$class",
+ 'new_hashref_callback' => sub {{ 'class' => $class }},
+ )
+%>