X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fpart_svc_column.html;h=075f15e2cc600112cc413284a7bbdf1d8ff564ae;hb=a7a22257d456394125eed32f8261c75a7f393ec2;hp=d03c49d2fcaff42ca469aa40fa3704f2886d851a;hpb=35b1ca7d644c773f4e0aebf6d8798c93f76a7cd8;p=freeside.git
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html
index d03c49d2f..075f15e2c 100644
--- a/httemplate/edit/elements/part_svc_column.html
+++ b/httemplate/edit/elements/part_svc_column.html
@@ -15,6 +15,7 @@ To be called from part_svc.cgi.
# don't allow the 'inventory' flags (M, A) to be chosen for
# fields that aren't free-text
my $inv_sub = sub { $_[0]->{disable_inventory} || $_[0]->{type} ne 'text' };
+
tie my %flag, 'Tie::IxHash',
'' => { 'desc' => 'No default', 'condition' => sub { 0 } },
'D' => { 'desc' => 'Default',
@@ -38,6 +39,9 @@ tie my %flag, 'Tie::IxHash',
'H' => { 'desc' => 'Select from hardware class',
'condition' => sub { $_[0]->{type} ne 'select-hardware' },
},
+ 'P' => { 'desc' => 'From package FCC 477 information',
+ 'condition' => sub { $_[0]->{type} ne 'fcc_477_speed' }, # get values from package fcc 477 information
+ },
'X' => { 'desc' => 'Excluded',
'condition' => sub { 1 }, # obsolete
},
@@ -63,35 +67,20 @@ my %communigate_fields = (
);
%once>
-
-<& /elements/table.html &>
-
>Exports
-
-% # exports
-% foreach my $part_export (@part_export) {
-
- exportnum} ? 'CHECKED' : '' %>>
- <% $part_export->label_html %>
-
-% $count++;
-% if ( $count % $columns == 0 ) {
-
-
-% }
-% }
-
-
-For the selected table, you can give fields default or fixed (unchangeable)
-values, or select an inventory class to manually or automatically fill in
-that field.
+
+%# include export selection
+<& export_svc.html,
+ part_svc => $part_svc,
+ svcdb => $svcdb
+&>
+
+Fields
<& /elements/table-grid.html, cellpadding => 4 &>
Field
Label
Modifier
+ <% $manual_require ? 'Required?' : '' %>
% $part_svc->set('svcpart' => $opt{'clone'}) if $opt{'clone'}; # for now
% my $i = 0;
@@ -108,7 +97,7 @@ that field.
+ VALUE="<% $part_svc_column->columnlabel || escapeHTML($def->{'label'}) |h %>">
@@ -147,7 +136,10 @@ that field.
% } elsif ( $def->{'type'} eq 'select' ) {
%
% if ( $def->{'select_table'} ) {
- <& /elements/select-table.html,
+% # set the 'select_svc' flag to enable two-step selection of services
+% my $comp = '/elements/select-table.html';
+% $comp = '/elements/select-svc.html' if $def->{'select_svc'};
+ <& $comp,
'field' => $name,
'id' => $name.'_select',
'table' => $def->{'select_table'},
@@ -155,8 +147,12 @@ that field.
'value_col' => $def->{'select_key'},
'order_by' => dbdef->table($def->{'select_table'})->primary_key,
'multiple' => $def->{'multiple'},
- 'disable_empty' => 1,
+ 'disable_empty' => $def->{'select_allow_empty'} ? undef : 1,
+ 'empty_label' => $def->{'select_allow_empty'} ? ' ' : undef,
'curr_value' => $value,
+ # these can be switched between multiple and singular,
+ # so put the complete curr_value in an attribute
+ 'element_etc' => 'default="'.encode_entities($value).'"',
&>
% } else {
% my (@options, %labels);
@@ -180,8 +176,8 @@ that field.
'curr_value' => $value,
&>
% }
-% } elsif ( $def->{'type'} =~ /select-(.*?).html/ ) {
- <& '/elements/'.$def->{'type'},
+% } elsif ( $def->{'type'} =~ /^select-(.*?)(.html)?$/ && $1 ne 'hardware' ) {
+ <& "/elements/select-$1.html",
'field' => $name,
'id' => $name.'_select',
'multiple' => $def->{'multiple'},
@@ -204,21 +200,51 @@ that field.
NAME="<%$name%>"
ID="<%$name%>"
VALUE="<%$value%>">
-% # inventory class selection
+% my $mode = 'inventory';
+% my $multiple = 1;
+% if ( $def->{'type'} eq 'select-hardware' ) {
+% $mode = 'hardware';
+% $multiple = 0;
+% }
+%
+% if ( $def->{'type'} eq 'fcc_477_speed' ) {
+% if ($field eq 'speed_up') {
+
+ upstream speed
+
+
+% } elsif ($field eq 'speed_down') {
+
+ downstream speed
+
+
+% }
+% } else {
<& /elements/select-table.html,
'field' => $name.'_classnum',
'id' => $name.'_select',
- 'table' => 'inventory_class',
+ 'table' => $mode.'_class',
'name_col' => 'classname',
'curr_value' => $value,
- 'empty_label' => 'Select inventory class',
- 'multiple' => 1,
+ 'empty_label' => "Select $mode class",
+ 'multiple' => $multiple,
&>
+% }
+% }
+
+
+% if ($manual_require &&
+% (!$def->{'type'} || !(grep {$_ eq $def->{'type'}} ('checkbox','disabled')))
+% ) {
+ required || $def->{'required'}) ? 'CHECKED' : '' %>
+ <% $def->{'required'} ? 'DISABLED' : '' %>
+ >
% }
-
+
% if ( $def->{def_info} ) {
(<% $def->{def_info} %>)
@@ -234,18 +260,35 @@ that field.
<% emt('Require "Provision" access right to edit password') %>
-
+
restrict_edit_password ? 'CHECKED' : '' %>>
% }
+% # special case: services with attached routers (false laziness...)
+% if ( $svcdb eq 'svc_acct'
+% or $svcdb eq 'svc_broadband'
+% or $svcdb eq 'svc_dsl'
+% or $svcdb eq 'svc_circuit' ) {
+% push @fields, 'has_router';
+
+
+ <% emt('This service has an attached router') %>
+
+
+ has_router ? 'CHECKED' : '' %>>
+
+
+% }
<& /elements/progress-init.html,
$svcdb, #form name
[ # form fields to send
- qw(svc svcpart classnum selfservice_access disabled preserve exportnum),
- @fields
+ 'ALL'
+# qw(svc svcpart classnum selfservice_access disabled preserve exportnum),
+# @fields
],
'process/part_svc.cgi', # target
$p.'browse/part_svc.cgi', # redirect landing
@@ -261,27 +304,18 @@ that field.
<%init>
my $svcdb = shift;
my %opt = @_;
-my $columns = 3;
my $count = 0;
my $communigate = 0;
my $conf = FS::Conf->new;
my $part_svc = $opt{'part_svc'} || FS::part_svc->new;
-my @part_export;
-my $export_info = FS::part_export::export_info($svcdb);
-foreach (keys %{ $export_info }) {
- push @part_export, qsearch('part_export', { exporttype => $_ });
+# see if there are communigate exports configured
+if ( exists $communigate_fields{$svcdb} ) {
+ $communigate = FS::part_export->count("exporttype like 'communigate%'");
}
-$communigate = scalar(grep {$_->exporttype =~ /^communigate/} @part_export);
my $svcpart = $opt{'clone'} || $part_svc->svcpart;
-my %has_export_svc;
-if ( $svcpart ) {
- foreach (qsearch('export_svc', { svcpart => $svcpart })) {
- $has_export_svc{$_->exportnum} = 1;
- }
-}
my @fields;
if ( defined( dbdef->table($svcdb) ) ) { # when is it ever not defined?
@@ -300,4 +334,5 @@ if ( $svcdb eq 'svc_acct'
}
my @defs = map { FS::part_svc->svc_table_fields($svcdb)->{$_} } @fields;
+my $manual_require = FS::part_svc->svc_table_info($svcdb)->{'manual_require'};
%init>