From eddffe5c35507f37ed83c2529626c9be5f81a516 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 14 Mar 2011 03:53:29 +0000 Subject: [PATCH] qualification address handling changes, RT#7111 --- FS/FS/Conf.pm | 7 +++++++ httemplate/edit/prospect_main.html | 9 +++++---- httemplate/elements/location.html | 6 +++--- httemplate/elements/tr-select-cust_location.html | 7 +++++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index d8f37e5e7..a6feffe5c 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4246,6 +4246,13 @@ and customer address. Include units.', }, { + 'key' => 'prospect_main-location_required', + 'section' => 'UI', + 'description' => 'Require an address for prospects. Recommended if the main use of propects is for qualifications.', + 'type' => 'checkbox', + }, + + { 'key' => 'note-classes', 'section' => 'UI', 'description' => 'Use customer note classes', diff --git a/httemplate/edit/prospect_main.html b/httemplate/edit/prospect_main.html index 7473cc209..4495cab29 100644 --- a/httemplate/edit/prospect_main.html +++ b/httemplate/edit/prospect_main.html @@ -26,10 +26,11 @@ 'm2_error_callback' => $m2_error_callback, }, - { 'field' => 'locationnum', - 'type' => 'select-cust_location', - 'empty_label' => 'No address', - 'alt_format' => $conf->exists('prospect_main-alt_address_format'), + { 'field' => 'locationnum', + 'type' => 'select-cust_location', + 'empty_label' => 'No address', + 'disable_empty' => $conf->exists('prospect_main-location_required'), + 'alt_format' => $conf->exists('prospect_main-alt_address_format'), }, ], 'new_callback' => $new_callback, diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index f36f2c4cd..0ff119009 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -27,7 +27,7 @@ Example: 'field' => 'location_kind', 'id' => 'location_kind', 'disabled' => $disabled, - 'style' => \@style, + #'style' => \@style, 'options' => \@location_kind_options, 'labels' => $location_kind_labels, 'curr_value' => scalar($cgi->param('location_kind')) @@ -98,7 +98,7 @@ Example: 'field' => 'location_type', 'id' => 'location_type', 'disabled' => $disabled, - 'style' => \@style, + #'style' => \@style, 'options' => [ keys %location_types ], 'labels' => \%location_types, 'curr_value' => $location_type, @@ -252,7 +252,7 @@ my %select_hash = ( 'prefix' => $pre, 'onchange' => $onchange, 'disabled' => $disabled, - 'style' => \@style, + #'style' => \@style, ); my $th = $opt{'no_bold'} ? 'TD' : 'TH'; diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index d17e4dfee..d7566262e 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -11,6 +11,7 @@ Example: #optional 'empty_label' => '(default service address)', + 'disable_empty' => 0, #1 to disable ) @@ -159,7 +160,7 @@ Example: <<%$th%> ALIGN="right"><% $opt{'label'} || 'Service location' %>>