summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-11-18 05:19:46 -0600
committerJonathan Prykop <jonathan@freeside.biz>2016-11-18 05:19:46 -0600
commit2a56c671635687bf2648eb3a7cf4bce228101af3 (patch)
tree7638e36c0d53de62cf51421e26e2acfc406bd7ab /httemplate
parente41cafbe7616c4f046c6161999d4577f1c918311 (diff)
parenteafcf16ece06a179ef55848da0a2bfcc91e1f858 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/customer-table.html26
-rw-r--r--httemplate/elements/popup-topreload.html21
-rw-r--r--httemplate/misc/batch-cust_pay.html18
-rw-r--r--httemplate/misc/process/batch-cust_pay.cgi1
-rwxr-xr-xhttemplate/search/cust_main.html3
-rwxr-xr-xhttemplate/search/report_cust_main.html4
6 files changed, 61 insertions, 12 deletions
diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html
index 0aa792d33..25c26b584 100644
--- a/httemplate/elements/customer-table.html
+++ b/httemplate/elements/customer-table.html
@@ -25,7 +25,7 @@ Example:
'custnum_update_callback' => 'name_of_js_callback' #passed a rownum
#listrefs
- 'types' => ['immutable', ''], # immutable or ''/text
+ 'type' => ['immutable', ''], # immutable, checkbox, date or ''/text
'align' => [ 'c', 'l', 'r', '' ],
'size' => [], # sizes ignored for immutable
'color' => [],
@@ -66,7 +66,10 @@ This mason element is currently only used by misc/batch-cust_pay.html,
and probably should be cleaned up more before being used by anything else.
</%doc>
-
+<LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2">
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT>
<SCRIPT TYPE="text/javascript">
var num_open_invoices = new Array;
@@ -652,6 +655,12 @@ and probably should be cleaned up more before being used by anything else.
% } elsif ( $types->[$col] eq 'checkbox' ) {
my_input.setAttribute('type', 'checkbox');
my_input.checked = (values && values.<% $field %>) ? true : false;
+% } elsif ( $types->[$col] eq 'date' ) {
+ my_input_button = document.createElement('IMG');
+ my_input_button.setAttribute('src', '<% $fsurl %>images/calendar.png');
+ my_input_button.setAttribute('title', <% mt('Select date') |js_string %>);
+ my_input_button.setAttribute('name', '<% $name %>'+thisrownum+'button');
+ my_input_button.setAttribute('id', '<% $name %>'+thisrownum+'button');
% }
my_input.value = (values && values.<% $field %>) || '';
% if ( $opt{onchange}->[$col] ) {
@@ -662,9 +671,21 @@ and probably should be cleaned up more before being used by anything else.
my_input.onkeyup = calc_total<%$col%>;
% }
my_cell.appendChild(my_input);
+% if ( $types->[$col] eq 'date' ) {
+ my_cell.appendChild(my_input_button);
+% }
row.appendChild(my_cell);
+% if ( $types->[$col] eq 'date' ) {
+ Calendar.setup({
+ inputField: '<% $name %>'+thisrownum,
+ ifFormat: "<% $date_format %>",
+ button: '<% $name %>'+thisrownum+'button',
+ align: "BR"
+ });
+% }
+
% $col++;
% }
@@ -805,6 +826,7 @@ addRow();
my(%opt) = @_;
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
my $types = $opt{'type'} ? [ @{$opt{'type'}} ] : [];
my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : [];
diff --git a/httemplate/elements/popup-topreload.html b/httemplate/elements/popup-topreload.html
new file mode 100644
index 000000000..00d5cdf50
--- /dev/null
+++ b/httemplate/elements/popup-topreload.html
@@ -0,0 +1,21 @@
+<%doc>
+
+Example:
+
+ <& /elements/popup-topreload, mt('Action completed') &>
+
+</%doc>
+<& /elements/header-popup.html, encode_entities($message) &>
+ <script src="<% $fsurl %>elements/js.cookie.js"></script>
+ <SCRIPT TYPE="text/javascript">
+ Cookies.set('freeside_status', <% $message |js_string %>,{
+ expires: 0.0035
+ });
+ topreload();
+ </SCRIPT>
+<& /elements/footer-popup.html &>
+<%init>
+
+my $message = shift;
+
+</%init>
diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
index d4d4afa6e..e20e4a4e3 100644
--- a/httemplate/misc/batch-cust_pay.html
+++ b/httemplate/misc/batch-cust_pay.html
@@ -469,16 +469,16 @@ die "access denied"
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
-my @header = ( 'Amount', 'Check #' );
-my @fields = ( 'paid', 'payinfo' );
-my @types = ( '', '' );
-my @align = ( 'r', 'r' );
-my @sizes = ( 8, 10 );
-my @colors = ( '', '' );
+my @header = ( 'Amount', 'Check #', 'Date override' );
+my @fields = ( 'paid', 'payinfo', '_date' );
+my @types = ( '', '', 'date', );
+my @align = ( 'r', 'r', 'r' );
+my @sizes = ( 8, 10, 8 );
+my @colors = ( '', '', '' );
my %param = ();
-my @footer = ( '_TOTAL', '' );
-my @footer_align = ( 'r', 'r' );
-my @onchange = ( '', '' );;
+my @footer = ( '_TOTAL', '', '' );
+my @footer_align = ( 'r', 'r', '' );
+my @onchange = ( '', '', '' );
my $use_discounts = '';
# Not entirely sure this works anymore...
diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi
index ff7886239..b4580bb4e 100644
--- a/httemplate/misc/process/batch-cust_pay.cgi
+++ b/httemplate/misc/process/batch-cust_pay.cgi
@@ -38,6 +38,7 @@ foreach my $row ( map /^custnum(\d+)$/, keys %$param ) {
'paid' => $param->{"paid$row"},
'payby' => 'BILL',
'payinfo' => $param->{"payinfo$row"},
+ '_date' => $param->{"_date$row"},
'discount_term' => $param->{"discount_term$row"},
'paybatch' => $paybatch,
'no_auto_apply' => exists($param->{"no_auto_apply$row"}) ? 'Y' : '',
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index 672c20174..1aa3390cb 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -41,7 +41,8 @@ my %search_hash = ();
#scalars
my @scalars = qw (
- agentnum salesnum status address city county state zip country
+ agentnum salesnum status
+ address city county state zip country location_history
invoice_terms
no_censustract with_geocode with_email tax no_tax POST no_POST
custbatch usernum
diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html
index b6be023f6..69bbe8538 100755
--- a/httemplate/search/report_cust_main.html
+++ b/httemplate/search/report_cust_main.html
@@ -197,6 +197,10 @@
</TD>
</TR>
+ <TR>
+ <TH ALIGN="right" VALIGN="center"><% mt('Search historical addresses') %></TH>
+ <TD><INPUT TYPE="checkbox" NAME="location_history" VALUE="1"></TD>
+
</TABLE>
<BR>