[freeside-commits] freeside/httemplate/edit cust_main.cgi, 1.76.2.3, 1.76.2.4
Ivan,,,
ivan at wavetail.420.am
Sun Dec 16 17:00:09 PST 2007
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv16657/httemplate/edit
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_main.cgi
Log Message:
add cust_main-require_address2 config, reimplement address2-search config ("Unit #" search in searchbar), visual indication of require_invoicing_list_email, closes: RT#2926
Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main.cgi,v
retrieving revision 1.76.2.3
retrieving revision 1.76.2.4
diff -u -d -r1.76.2.3 -r1.76.2.4
--- cust_main.cgi 22 Nov 2007 01:03:32 -0000 1.76.2.3
+++ cust_main.cgi 17 Dec 2007 00:59:52 -0000 1.76.2.4
@@ -203,13 +203,31 @@
<!-- contact info -->
+% my $same_checked = '';
+% my $ship_disabled = '';
+% unless ( $cust_main->ship_last && $same ne 'Y' ) {
+% $same_checked = 'CHECKED';
+% $ship_disabled = 'DISABLED STYLE="background-color: #dddddd"';
+% foreach (
+% qw( last first company address1 address2 city county state zip country
+% daytime night fax )
+% ) {
+% $cust_main->set("ship_$_", $cust_main->get($_) );
+% }
+% }
+
<BR><BR>
Billing address
-<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '', 'ss' => $ss, 'stateid' => $stateid ) %>
-
-<!-- service address -->
-% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
-
+<% include('cust_main/contact.html',
+ 'cust_main' => $cust_main,
+ 'pre' => '',
+ 'onchange' => 'bill_changed(this)',
+ 'disabled' => '',
+ 'ss' => $ss,
+ 'stateid' => $stateid,
+ 'same_checked' => $same_checked, #for address2 "Unit #" labeling
+ )
+%>
<SCRIPT>
function bill_changed(what) {
@@ -237,44 +255,47 @@
function samechanged(what) {
if ( what.checked ) {
bill_changed(what);
-% for (qw( last first company address1 address2 city county state zip country daytime night fax )) {
- what.form.ship_<%$_%>.disabled = true;
- what.form.ship_<%$_%>.style.backgroundColor = '#dddddd';
-% }
+% for (qw( last first company address1 address2 city county state zip country daytime night fax )) {
+ what.form.ship_<%$_%>.disabled = true;
+ what.form.ship_<%$_%>.style.backgroundColor = '#dddddd';
+% }
+
+% if ( $conf->exists('cust_main-require_address2') ) {
+ document.getElementById('address2_required').style.visibility = '';
+ document.getElementById('address2_label').style.visibility = '';
+ document.getElementById('ship_address2_required').style.visibility = 'hidden';
+ document.getElementById('ship_address2_label').style.visibility = 'hidden';
+% }
} else {
-% for (qw( last first company address1 address2 city county state zip country daytime night fax )) {
- what.form.ship_<%$_%>.disabled = false;
- what.form.ship_<%$_%>.style.backgroundColor = '#ffffff';
-% }
+% for (qw( last first company address1 address2 city county state zip country daytime night fax )) {
+ what.form.ship_<%$_%>.disabled = false;
+ what.form.ship_<%$_%>.style.backgroundColor = '#ffffff';
+% }
+
+% if ( $conf->exists('cust_main-require_address2') ) {
+ document.getElementById('address2_required').style.visibility = 'hidden';
+ document.getElementById('address2_label').style.visibility = 'hidden';
+ document.getElementById('ship_address2_required').style.visibility = '';
+ document.getElementById('ship_address2_label').style.visibility = '';
+% }
}
}
</SCRIPT>
-%
-% my $checked = '';
-% my $disabled = '';
-% my $disabledselect = '';
-% unless ( $cust_main->ship_last && $same ne 'Y' ) {
-% $checked = 'CHECKED';
-% $disabled = 'DISABLED STYLE="background-color: #dddddd"';
-% foreach (
-% qw( last first company address1 address2 city county state zip country
-% daytime night fax )
-% ) {
-% $cust_main->set("ship_$_", $cust_main->get($_) );
-% }
-% }
-%
-
<BR>
Service address
-(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)" <%$checked%>>same as billing address)
-<% include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %>
-% }
+(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)" <%$same_checked%>>same as billing address)
+<% include('cust_main/contact.html',
+ 'cust_main' => $cust_main,
+ 'pre' => 'ship_',
+ 'onchange' => '',
+ 'disabled' => $ship_disabled,
+ )
+%>
<!-- billing info -->
More information about the freeside-commits
mailing list