[freeside-commits] freeside/httemplate/browse part_svc.cgi, 1.25,
1.26
Ivan,,,
ivan at wavetail.420.am
Sat Jun 24 09:41:47 PDT 2006
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail:/tmp/cvs-serv19993/httemplate/browse
Modified Files:
part_svc.cgi
Log Message:
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.
Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/part_svc.cgi,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- part_svc.cgi 31 Jan 2006 04:26:54 -0000 1.25
+++ part_svc.cgi 24 Jun 2006 16:41:45 -0000 1.26
@@ -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 @@
@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 @@
<%= $n1 %>
<TD><%= $field %></TD>
<TD><%= $flag{$flag} %></TD>
- <TD><%= $part_svc->part_svc_column($field)->columnvalue%></TD>
+
+ <TD>
+ <% 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 %>
+ <% } %>
+ </TD>
+
<% $n1="</TR><TR>";
}
More information about the freeside-commits
mailing list