RT#27425: Fixed/blank svc_phone domain
authorJonathan Prykop <jonathan@freeside.biz>
Tue, 3 Feb 2015 04:02:53 +0000 (22:02 -0600)
committerJonathan Prykop <jonathan@freeside.biz>
Wed, 11 Feb 2015 19:38:25 +0000 (13:38 -0600)
FS/FS/part_svc.pm
FS/FS/svc_phone.pm
httemplate/edit/elements/part_svc_column.html

index 0bef7bc..c2003c4 100644 (file)
@@ -698,6 +698,8 @@ some components specified by "select-.*.html", and a bunch more...
 
 =item select_label - Used with select_table, this is the field name of labels
 
+=item select_allow_empty - Used with select_table, adds an empty option
+
 =back
 
 =cut
index 46b2311..fba232d 100644 (file)
@@ -194,6 +194,7 @@ sub table_info {
                          select_table => 'svc_domain',
                          select_key   => 'svcnum',
                          select_label => 'domain',
+                         select_allow_empty => 1,
                          disable_inventory => 1,
                        },
         'circuit_svcnum'   => { label             => 'Circuit',
index 53cda85..2bb4f5e 100644 (file)
@@ -140,7 +140,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