X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=ec5f321dda975ad33731841fbe2b86d34a583e30;hb=98f6d91ec7eaa907204afbfeb90ede1e3bff656d;hp=f1b2836381c25804cc242b67f9a4601ac3f4cc3a;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index f1b283638..ec5f321dd 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -51,24 +51,43 @@ function part_export_areyousure(href) { Customer
Services
+ Customer
Self-service
+ Export Field + Label + Modifier - + Required + +% my $conf = FS::Conf->new; % foreach my $part_svc ( @part_svc ) { % my $svcdb = $part_svc->svcdb; % my $svc_x = "FS::$svcdb"->new( { svcpart => $part_svc->svcpart } ); % my @dfields = $svc_x->fields; -% push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge +% push @dfields, 'usergroup' if $svcdb eq 'svc_acct' #double kludge +% or ($svcdb eq 'svc_broadband' +% and $conf->exists('svc_broadband-radius')); % my @fields = -% grep { $svc_x->pvf($_) -% or $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag } +% grep { my $col = $part_svc->part_svc_column($_); +% my $def = FS::part_svc->svc_table_fields($svcdb)->{$_}; +% $svc_x->pvf($_) +% or $_ ne 'svcnum' && ( +% $col->columnflag || ( $col->columnlabel !~ /^\S*$/ +% && $col->columnlabel ne $def->{'label'} +% ) +% || ( $col->required +% && !$def->{'required'} +% ) +% ) +% } % @dfields ; % my $rowspan = scalar(@fields) || 1; +% $rowspan++ if $part_svc->restrict_edit_password; % my $url = "${p}edit/part_svc.cgi?". $part_svc->svcpart; % % if ( $bgcolor eq $bgcolor1 ) { @@ -108,6 +127,14 @@ function part_export_areyousure(href) { +% tie my %selfservice_access, 'Tie::IxHash', #false laziness w/edit/part_svc.cgi +% '' => 'Yes', +% 'hidden' => 'Hidden', +% 'readonly' => 'Read-only', +% ; + CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="center"> + <% $selfservice_access{$part_svc->selfservice_access} %> + CLASS="inv" BGCOLOR="<% $bgcolor %>"> % @@ -120,7 +147,7 @@ function part_export_areyousure(href) { % - + % } @@ -128,45 +155,61 @@ function part_export_areyousure(href) { % unless ( @fields ) { -% for ( 1..3 ) { +% for ( 1..5 ) { + - + % $n1=""; -% } -% +% } #foreach $field +% if ( $part_svc->restrict_edit_password ) { + + + +% } -% } +% } #foreach $part_svc
<% $part_export->exportnum %>: <% $part_export->exporttype %> to <% $part_export->machine %><% $part_export->label_html %>
% } % } % % my($n1)=''; % foreach my $field ( @fields ) { -% my $formatter = -% FS::part_svc->svc_table_fields($svcdb)->{$field}->{format} -% || sub { shift }; -% my $flag = $part_svc->part_svc_column($field)->columnflag; % +% #a few lines of false laziness w/edit/part_svc.cgi +% my $def = FS::part_svc->svc_table_fields($svcdb)->{$field}; +% my $formatter = $def->{format} || sub { shift }; +% +% my $part_svc_column = $part_svc->part_svc_column($field); +% my $label = $part_svc_column->columnlabel || $def->{'label'}; +% my $flag = $part_svc_column->columnflag; <% $n1 %> <% $field %><% $label %> <% $flag{$flag} %> % my $value = &$formatter($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" %> +% if ( $flag =~ /^[MAH]$/ ) { +% my $select_table = ($flag eq 'H') ? 'hardware_class' : 'inventory_class'; +% foreach my $classnum ( split(',', $value) ) { +% $select_class{$classnum} = +% qsearchs($select_table, { 'classnum' => $classnum } ); +% + <% $select_class{$classnum} + ? $select_class{$classnum}->classname + : "WARNING: $select_table.classnum $classnum not found" %>
+% } % } else { <% $value %> -% } +% }
+% if ($part_svc_column->required) { + Yes +% } +
+ <% emt('Password editing restricted.') %> +
@@ -186,6 +229,7 @@ my %flag = ( 'M' => 'Manual selected from inventory', #'A' => 'Automatically fill in from inventory', 'A' => 'Automatically filled in from inventory', + 'H' => 'Selected from hardware class', 'X' => 'Excluded', ); @@ -210,6 +254,6 @@ if ( $cgi->param('orderby') eq 'active' ) { @part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc; } -my %inventory_class = (); +my %select_class = ();