summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2006-04-22 00:58:40 +0000
committerivan <ivan>2006-04-22 00:58:40 +0000
commit1a033848671cad2cbe7687b37fc718b3b2a68b83 (patch)
tree01fc1ca352726cdc5786e0ccaf78515e9326ba84 /httemplate/edit
parent303cb4ce4b6ce634e108e3b7a0b43086a5e4f184 (diff)
start of package class web UI (add/edit package classes, package class selection in package def edit)
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/elements/edit.html6
-rw-r--r--httemplate/edit/inventory_class.html1
-rwxr-xr-xhttemplate/edit/part_pkg.cgi9
-rw-r--r--httemplate/edit/pkg_class.html10
-rw-r--r--httemplate/edit/process/elements/process.html6
-rw-r--r--httemplate/edit/process/inventory_class.html3
-rw-r--r--httemplate/edit/process/pkg_class.html5
7 files changed, 33 insertions, 7 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index ce6e2db..5486b4b 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -15,6 +15,8 @@
# ]
#
# 'menubar' => '', #menubar arrayref
+ #
+ # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
my(%opt) = @_;
@@ -55,7 +57,9 @@
} else {
@menubar = (
'Main menu' => $p, #eventually get rid of this when the ACL/UI update is done
- "View all $opt{'name'}s" => "${p}search/$table.html", #eventually use Lingua::bs to pluralize
+ #eventually use Lingua::bs to pluralize
+ "View all $opt{'name'}s" => $p. ( $opt{'viewall_dir'} || 'search' ).
+ "/$table.html",
);
}
diff --git a/httemplate/edit/inventory_class.html b/httemplate/edit/inventory_class.html
index 5dde2e5..8c5ae47 100644
--- a/httemplate/edit/inventory_class.html
+++ b/httemplate/edit/inventory_class.html
@@ -5,5 +5,6 @@
'classnum' => 'Class number',
'classname' => 'Class name',
},
+ 'viewall_dir' => 'browse',
)
%>
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 158c6e2..462d516 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -84,6 +84,7 @@ Package information
<INPUT TYPE="text" NAME="comment" SIZE=32 VALUE="<%=$part_pkg->comment%>">
</TD>
</TR>
+ <%= include( '/elements/tr-select-pkg_class.html', $part_pkg->classnum ) %>
<TR>
<TD ALIGN="right">Promotional code</TD>
<TD>
@@ -146,8 +147,8 @@ $thead .= '<TH BGCOLOR="#dcdcdc">Service</TH></TR>';
%>
-<%= itable('', 4, 1) %><TR><TD VALIGN="top">
<BR><BR>Services included
+<%= itable('', 4, 1) %><TR><TD VALIGN="top">
<%= $thead %>
<%
@@ -194,14 +195,14 @@ foreach my $part_svc ( @part_svc ) {
</TD>
</TR>
- <% $count++;
- foreach ( 1 .. $columns-1 ) {
+ <% foreach ( 1 .. $columns-1 ) {
if ( $count == int( $_ * scalar(@part_svc) / $columns ) ) {
%>
</TABLE></TD><TD VALIGN="top"><%= $thead %>
<% }
}
+ $count++;
%>
<% } %>
@@ -224,7 +225,7 @@ my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans;
-my @form_select = ();
+my @form_select = ('classnum');
if ( $conf->exists('enable_taxclasses') ) {
push @form_select, 'taxclass';
} else {
diff --git a/httemplate/edit/pkg_class.html b/httemplate/edit/pkg_class.html
new file mode 100644
index 0000000..b077f6f
--- /dev/null
+++ b/httemplate/edit/pkg_class.html
@@ -0,0 +1,10 @@
+<%= include( 'elements/edit.html',
+ 'name' => 'Package Class',
+ 'table' => 'pkg_class',
+ 'labels' => {
+ 'classnum' => 'Class number',
+ 'classname' => 'Class name',
+ },
+ 'viewall_dir' => 'browse',
+ )
+%>
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 52c8767..83ff6f7 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -5,6 +5,7 @@
# 'table' =>
# #? 'primary_key' => #required when the dbdef doesn't know...???
# #? 'fields' => []
+ # 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
my(%opt) = @_;
@@ -40,7 +41,10 @@
$cgi->param('error', $error);
print $cgi->redirect(popurl(2). "$table.html?". $cgi->query_string );
} else {
- print $cgi->redirect(popurl(3). "search/$table.html");
+ print $cgi->redirect( popurl(3).
+ ( $opt{'viewall_dir'} || 'search' ).
+ "/$table.html"
+ );
}
%>
diff --git a/httemplate/edit/process/inventory_class.html b/httemplate/edit/process/inventory_class.html
index e30e74e..ab9efef 100644
--- a/httemplate/edit/process/inventory_class.html
+++ b/httemplate/edit/process/inventory_class.html
@@ -1,4 +1,5 @@
<%= include( 'elements/process.html',
- 'table' => 'inventory_class',
+ 'table' => 'inventory_class',
+ 'viewall_dir' => 'browse',
)
%>
diff --git a/httemplate/edit/process/pkg_class.html b/httemplate/edit/process/pkg_class.html
new file mode 100644
index 0000000..48e2b80
--- /dev/null
+++ b/httemplate/edit/process/pkg_class.html
@@ -0,0 +1,5 @@
+<%= include( 'elements/process.html',
+ 'table' => 'pkg_class',
+ 'viewall_dir' => 'browse',
+ )
+%>