X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Felements%2Fpart_svc_column.html;h=d9500320ad85dfd92cfc86663e81a4debb18d981;hb=5e319ce3a8a7664dd776c5927850b0911af97e1b;hp=64901a80f20a3a2acffb7885c2b7f1bf66ba292b;hpb=6027eeaf77eb9f7e55a60ed551d41fe804433e2e;p=freeside.git
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html
index 64901a80f..d9500320a 100644
--- a/httemplate/edit/elements/part_svc_column.html
+++ b/httemplate/edit/elements/part_svc_column.html
@@ -64,26 +64,11 @@ 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 ) {
-
-
-% }
-% }
-
-
+%# include export selection
+<& export_svc.html,
+ part_svc => $part_svc,
+ svcdb => $svcdb
+&>
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.
@@ -92,6 +77,7 @@ that field.
Field
Label
Modifier
+ <% $manual_require ? 'Required?' : '' %>
% $part_svc->set('svcpart' => $opt{'clone'}) if $opt{'clone'}; # for now
% my $i = 0;
@@ -155,7 +141,8 @@ 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
@@ -224,9 +211,19 @@ that field.
&>
% }
+
+% 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} %>)
@@ -242,20 +239,23 @@ 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' ) {
+% 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' : '' %>>
@@ -282,27 +282,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?
@@ -321,4 +312,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>