X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fcontact.html;h=c2ebb093c8579411907d05e6199c29646600dfa4;hb=7516e3da0f17eeecba27219ef96a8b5f46af2083;hp=4912327c6e018dda51a1868a9065d1a8f6818d1a;hpb=6fc993993d45b0e151a2c3383ef1031f817715ff;p=freeside.git
diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html
index 4912327c6..c2ebb093c 100644
--- a/httemplate/edit/cust_main/contact.html
+++ b/httemplate/edit/cust_main/contact.html
@@ -1,4 +1,4 @@
-<% &ntable("#cccccc") %>
+
<%$r%><% mt('Contact name (last, first)') |h %> |
@@ -14,8 +14,6 @@
|
% }
-
-
% if ( $conf->exists('cust-email-high-visibility') && !$pre ) {
@@ -30,100 +28,19 @@
% }
-% unless ( $conf->exists('cust-edit-alt-field-order') ) {
-
- <% mt('Company') |h %> |
-
- <%$style%>>
- |
-
-
-<& /elements/location.html,
- 'prefix' => $pre,
- 'object' => $cust_main,
- 'onchange' => $onchange,
- 'disabled' => $disabled,
- 'style' => \@style,
- 'same_checked' => $opt{'same_checked'},
- 'geocode' => $opt{'geocode'},
- 'censustract' => $opt{'censustract'},
-&>
-
-
- <% $daytime_label %> |
-
- <%$style%>>
- |
-
-
-
- <% $night_label %> |
-
- <%$style%>>
- |
-
-
-
- <% $mobile_label %> |
-
- <%$style%>>
- |
-
-
-
- <% mt('Fax') |h %> |
-
- <%$style%>>
- |
-
-
-% } else {
-
-
- <% $daytime_label %> |
-
- <%$style%>>
- |
-
-
-
- <% $night_label %> |
-
- <%$style%>>
- |
-
+% unless ( $conf->exists('cust-edit-alt-field-order') ) { #standard order
-
- <% $mobile_label %> |
-
- <%$style%>>
- |
-
-
-<& /elements/location.html,
- 'prefix' => $pre,
- 'object' => $cust_main,
- 'onchange' => $onchange,
- 'disabled' => $disabled,
- 'style' => \@style,
- 'same_checked' => $opt{'same_checked'},
- 'geocode' => $opt{'geocode'},
- 'censustract' => $opt{'censustract'},
-&>
+ <& company &>
+ <& location &>
+ <& phones &>
+ <& fax &>
-
- <% mt('Fax') |h %> |
-
- <%$style%>>
- |
-
+% } else { #alternate field order
-
- <% mt('Company') |h %> |
-
- <%$style%>>
- |
-
+ <& phones &>
+ <& location &>
+ <& fax &>
+ <& company &>
% }
@@ -152,16 +69,69 @@
<%$r%><% mt('required fields') |h %>
+<%def company>
+% my $display = ($cust_main->residential_commercial eq 'Commercial')
+% ? '' : 'none';
+
+ <% mt('Company') |h %> |
+
+ <%$style%>>
+ |
+
+%def>
+
+<%def location>
+ <& /elements/location.html,
+ 'prefix' => $pre,
+ 'object' => $cust_main,
+ 'onchange' => $onchange,
+ 'disabled' => $disabled,
+ 'style' => \@style,
+ 'same_checked' => $opt{'same_checked'},
+ 'geocode' => $opt{'geocode'},
+ 'censustract' => $opt{'censustract'},
+ &>
+%def>
+
+<%def phones>
+ <& /elements/tr-cust_main-phones.html,
+ 'prefix' => $pre,
+ 'cust_main' => $cust_main,
+ 'onchange' => $onchange,
+ 'disabled' => $disabled,
+ 'style' => $style,
+ &>
+%def>
+
+<%def fax>
+
+ <% mt('Fax') |h %> |
+
+ <%$style%>>
+ |
+
+%def>
+
+<%once>
+
+my $r = qq!* !;
+
+%once>
+<%shared>
+
+my( %opt, $cust_main, $pre, $onchange, $disabled, @style, $style );
+
+%shared>
<%init>
-my %opt = @_;
-my $cust_main = $opt{'cust_main'};
-my $pre = $opt{'pre'};
-my $onchange = $opt{'onchange'};
-my $disabled = $opt{'disabled'};
-my @style = ( $opt{'style'} ? @{ $opt{'style'} } : () );
+%opt = @_;
+$cust_main = $opt{'cust_main'};
+$pre = $opt{'pre'};
+$onchange = $opt{'onchange'};
+$disabled = $opt{'disabled'};
+@style = ( $opt{'style'} ? @{ $opt{'style'} } : () );
-my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
+$style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
my $conf = new FS::Conf;
@@ -185,19 +155,7 @@ $cust_main->set('stateid_state', $cust_main->state )
$opt{geocode} ||= $cust_main->get('geocode');
-if ( $conf->exists('cust_main-require_censustract') ) {
- $opt{censustract} ||= $cust_main->censustract;
-}
-
-my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
- ? 'Day Phone'
- : FS::Msgcat::_gettext('daytime');
-my $night_label = FS::Msgcat::_gettext('night') =~/^(night)?$/
- ? 'Night Phone'
- : FS::Msgcat::_gettext('night') || 'Night Phone';
-my $mobile_label = FS::Msgcat::_gettext('mobile') =~/^(mobile)?$/
- ? 'Mobile Phone'
- : FS::Msgcat::_gettext('mobile') || 'Mobile Phone';
+$opt{censustract} ||= $cust_main->censustract;
my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
? 'Driver’s License'
@@ -206,8 +164,6 @@ my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_st
? 'Driver’s License State'
: FS::Msgcat::_gettext('stateid_state') || 'Driver’s License State';
-my $r = qq!* !;
-
my @invoicing_list = $cust_main->invoicing_list;
my $agentnum = $cust_main->agentnum if $cust_main->custnum;