From 9608be1f5c73517fc348f1ab458892b34ed7facb Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 24 Jun 2006 16:41:45 +0000 Subject: Add the ability to link customer service definition fields to inventory classes, with an "automatic/manual" flag. Add the ability for the web interface to maintain these links. Start prettying up the service def. edit in preparation for Bigger Changes. --- httemplate/browse/part_svc.cgi | 28 +++- httemplate/edit/part_svc.cgi | 271 ++++++++++++++++++++++++++-------- httemplate/elements/select-table.html | 16 +- httemplate/elements/table-grid.html | 8 +- 4 files changed, 249 insertions(+), 74 deletions(-) (limited to 'httemplate') diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index eef2676c0..805bd88b9 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -1,9 +1,15 @@ <% +#code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm my %flag = ( - 'D' => 'Default', - 'F' => 'Fixed', '' => '', + 'D' => 'Default', + 'F' => 'Fixed (unchangeable)', + #'M' => 'Manual selection from inventory', + 'M' => 'Manual selected from inventory', + #'A' => 'Automatically fill in from inventory', + 'A' => 'Automatically filled in from inventory', + 'X' => 'Excluded', ); my %search; @@ -27,6 +33,8 @@ if ( $cgi->param('orderby') eq 'active' ) { @part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc; } +my %inventory_class = (); + %> <%= include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %> @@ -125,7 +133,21 @@ map { qsearchs('part_export', { exportnum => $_->exportnum } ) } qsearch('export <%= $n1 %> <%= $field %> <%= $flag{$flag} %> - <%= $part_svc->part_svc_column($field)->columnvalue%> + + + <% my $value = $part_svc->part_svc_column($field)->columnvalue; + if ( $flag =~ /^[MA]$/ ) { + $inventory_class{$value} + ||= qsearchs('inventory_class', { 'classnum' => $value } ); + %> + <%= $inventory_class{$value} + ? $inventory_class{$value}->classname + : "WARNING: inventory_class.classnum $value not found" %> + <% } else { %> + <%= $value %> + <% } %> + + <% $n1=""; } diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index c5fff25e0..77011e9dd 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -38,28 +38,24 @@ Service
Disable new orders {disabled} eq 'Y' ? ' CHECKED' : '' %>>

-Services are items you offer to your customers. -