diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-08-17 15:38:22 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-08-17 15:38:22 -0700 |
commit | a618055d3a8cfc55a449847b433dcdc85df92bcd (patch) | |
tree | b97040ca60379c2e8de10a8d9884dae1e80b3beb /httemplate | |
parent | 601432ca6836e10cc4e15b1c055d77ff7f4a0540 (diff) | |
parent | d87c9f804b0cb7b6798bf770f753fb83022f5e6a (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 17 | ||||
-rw-r--r-- | httemplate/edit/elements/part_export/broadband_snmp.html | 7 | ||||
-rw-r--r-- | httemplate/edit/process/part_export.cgi | 2 | ||||
-rw-r--r-- | httemplate/elements/select-mib-popup.html | 2 | ||||
-rw-r--r-- | httemplate/misc/xmlhttp-pay_batch-note.html | 18 | ||||
-rw-r--r-- | httemplate/search/elements/cust_pay_batch_top.html | 106 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/contact.html | 2 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/hidden.html | 14 | ||||
-rwxr-xr-x | httemplate/view/cust_main/packages/section.html | 11 | ||||
-rw-r--r-- | httemplate/view/cust_pkg-popup.html | 27 |
10 files changed, 151 insertions, 55 deletions
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 63822c7c9..1eb55c88a 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -108,6 +108,14 @@ my $count_cust_pkg = " WHERE cust_pkg.pkgpart = part_pkg.pkgpart AND $agentnums_sql "; +my $count_cust_pkg_cancel = " + SELECT COUNT(*) FROM cust_pkg LEFT JOIN cust_main USING ( custnum ) + LEFT JOIN cust_pkg AS cust_pkg_next + ON (cust_pkg.pkgnum = cust_pkg_next.change_pkgnum) + WHERE cust_pkg.pkgpart = part_pkg.pkgpart + AND $agentnums_sql + AND cust_pkg.cancel IS NOT NULL AND cust_pkg.cancel != 0 +"; $select = " @@ -137,11 +145,16 @@ $select = " AND ( setup IS NULL OR setup = 0 ) ) AS num_on_hold, - ( $count_cust_pkg - AND cancel IS NOT NULL AND cancel != 0 + ( $count_cust_pkg_cancel + AND (cust_pkg_next.pkgnum IS NULL + OR cust_pkg_next.pkgpart != cust_pkg.pkgpart) ) AS num_cancelled "; +# About the num_cancelled expression: packages that were changed, but +# kept the same pkgpart, are considered "moved", not "canceled" (because +# this is the part_pkg UI). We could show the count of those but it's +# probably not interesting. my $html_init = qq! One or more service definitions are grouped together into a package diff --git a/httemplate/edit/elements/part_export/broadband_snmp.html b/httemplate/edit/elements/part_export/broadband_snmp.html index 4c0367c5a..ebb765dee 100644 --- a/httemplate/edit/elements/part_export/broadband_snmp.html +++ b/httemplate/edit/elements/part_export/broadband_snmp.html @@ -29,7 +29,7 @@ function open_select_mib(obj) { nd(1); // if there's already one open, close it var rownum = obj.rownum; - var curr_oid = obj.value || ''; + var curr_oid = obj.form.elements['oid' + rownum].value || ''; var url = '<%$fsurl%>/elements/select-mib-popup.html?' + 'callback=receive_mib;' + 'arg=' + rownum + @@ -66,10 +66,11 @@ function receive_mib(obj, rownum) { </SELECT> </TD> <TD> - <INPUT NAME="oid" ID="oid" SIZE="60" onclick="open_select_mib(this)"> + <INPUT NAME="oid" ID="oid" SIZE="54"> + <INPUT TYPE="button" VALUE="..." ID="openselector" onclick="open_select_mib(this)"> </TD> <TD> - <INPUT TYPE="text" NAME="datatype" ID="datatype" READONLY=1> + <INPUT TYPE="text" NAME="datatype" ID="datatype"> </TD> <TD> <INPUT NAME="value" ID="value"> diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index e0c470675..7fe3d0369 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -41,7 +41,7 @@ foreach my $option (split(',', $cgi->param('multi_options'))) { foreach my $option (split(',', $cgi->param('multi_options'))) { my $value = ''; foreach my $row (sort keys %{$optionrows{_ALL_}}) { - $value .= ($optionrows{$option}{$row} || '') . "\n"; + $value .= ($optionrows{$option}{$row} // '') . "\n"; } chomp($value); $options{$option} = $value; diff --git a/httemplate/elements/select-mib-popup.html b/httemplate/elements/select-mib-popup.html index bd485ef65..f95ce2b97 100644 --- a/httemplate/elements/select-mib-popup.html +++ b/httemplate/elements/select-mib-popup.html @@ -7,7 +7,7 @@ </TR> <TR> <TD ALIGN="right">Object:</TD> - <TD><INPUT TYPE="text" NAME="path" ID="input_path" WIDTH="100%"></TD> + <TD><INPUT TYPE="text" NAME="path" ID="input_path" SIZE=50 WIDTH="100%"></TD> </TR> <TR> <TD COLSPAN=2> diff --git a/httemplate/misc/xmlhttp-pay_batch-note.html b/httemplate/misc/xmlhttp-pay_batch-note.html new file mode 100644 index 000000000..ef5901631 --- /dev/null +++ b/httemplate/misc/xmlhttp-pay_batch-note.html @@ -0,0 +1,18 @@ +<% $note %>\ +<%init> + +my ($batchnum, $format) = $cgi->param('arg'); + +my $note = ''; +if ( $batchnum =~ /^(\d+)$/ ) { + my $pay_batch = FS::pay_batch->by_key($batchnum); + if ( $pay_batch and $format =~ /^(\w+)$/ ) { + my $class = "FS::pay_batch::$format"; + if ( $class->can('download_note') ) { + # now we can actually do something + $note = $class->download_note($pay_batch); + } + } +} + +</%init> diff --git a/httemplate/search/elements/cust_pay_batch_top.html b/httemplate/search/elements/cust_pay_batch_top.html index bf3047769..a773dd009 100644 --- a/httemplate/search/elements/cust_pay_batch_top.html +++ b/httemplate/search/elements/cust_pay_batch_top.html @@ -1,24 +1,43 @@ +<& /elements/xmlhttp.html, + 'url' => $p.'misc/xmlhttp-pay_batch-note.html', + 'subs' => [ 'get_note' ] +&> +<script type="text/javascript"> +function format_changed() { + var form = document.forms['download']; + get_note( <% $batchnum %>, form.elements['format'].value, + //callback + function(text) { + document.getElementById('download_note').textContent = text; + } + ); +} +<&| /elements/onload.js &>format_changed()</&> +</script> % # Download batch % if ( $status eq 'O' % or ( $status eq 'I' and $curuser->access_right('Reprocess batches') ) % or ( $status eq 'R' and $curuser->access_right('Redownload resolved batches') ) % ) { -<TABLE> -<TR><FORM ACTION="<%$p%>misc/download-batch.cgi" METHOD="POST"> -<INPUT TYPE="hidden" NAME="batchnum" VALUE="<%$batchnum%>"> +<FORM ACTION="<%$p%>misc/download-batch.cgi" NAME="download" METHOD="POST"> + <INPUT TYPE="hidden" NAME="batchnum" VALUE="<%$batchnum%>"> % if ( $fixed ) { -<INPUT TYPE="hidden" NAME="format" VALUE="<%$fixed%>"> + <INPUT TYPE="hidden" NAME="format" VALUE="<%$fixed%>"> % } % else { -Download batch in format <SELECT NAME="format"> + Download batch in format <SELECT NAME="format" onchange="format_changed()"> % foreach ( keys %download_formats ) { -<OPTION VALUE="<%$_%>"><% $download_formats{$_} %></OPTION> + <OPTION VALUE="<%$_%>"><% $download_formats{$_} %></OPTION> % } -</SELECT> -<& .select_gateway &> + </SELECT> + <& .select_gateway &> % } -<INPUT TYPE="submit" VALUE="Download"></FORM><BR><BR></TR> + <BR> + <DIV STYLE="color:#ff0000" ID="download_note"></DIV> + <INPUT TYPE="submit" VALUE="Download"> % } # end of download +</FORM> +<BR> % # Upload batch % if ( $pay_batch->status eq 'I' @@ -27,44 +46,42 @@ Download batch in format <SELECT NAME="format"> % and $conf->exists('batch-manual_approval') % ) % ) { -<TR> -<% include('/elements/form-file_upload.html', +<& /elements/form-file_upload.html, 'name' => 'FileUpload', 'action' => "${p}misc/upload-batch.cgi", 'num_files' => 1, 'fields' => [ 'batchnum', 'format', 'gatewaynum' ], 'url' => $cgi->self_url, 'message' => 'Batch results uploaded.', -) %> -Upload results<BR></TR> -<TR> -<% include('/elements/file-upload.html', +&> + Upload results<BR> + <& /elements/file-upload.html, 'field' => 'file', 'label' => 'Filename', 'no_table' => 1, -) %> -<INPUT TYPE="hidden" NAME="batchnum" VALUE="<% $batchnum %>"> -<BR></TR> + &> + <INPUT TYPE="hidden" NAME="batchnum" VALUE="<% $batchnum %>"> + <BR> % if ( $fixed ) { % if ( $fixed eq 'td_eft1464' ) { # special case -<TR>Upload in format <SELECT NAME="format"> -<OPTION VALUE="td_eftack264">TD EFT Acknowledgement</OPTION> -<OPTION VALUE="td_eftret80">TD EFT Returned Items</OPTION> -</SELECT> </TR> + Upload in format <SELECT NAME="format"> + <OPTION VALUE="td_eftack264">TD EFT Acknowledgement</OPTION> + <OPTION VALUE="td_eftret80">TD EFT Returned Items</OPTION> + </SELECT> % } % else { -<INPUT TYPE="hidden" NAME="format" VALUE="<% $fixed %>"> + <INPUT TYPE="hidden" NAME="format" VALUE="<% $fixed %>"> % } % } % else { -<TR>Upload in format <SELECT NAME="format"> + Upload in format <SELECT NAME="format"> % foreach ( keys(%upload_formats) ) { -<OPTION VALUE="<%$_%>"><% $upload_formats{$_} %></OPTION> + <OPTION VALUE="<%$_%>"><% $upload_formats{$_} %></OPTION> % } -</SELECT> -<& .select_gateway &> + </SELECT> + <& .select_gateway &> % } # if $fixed -<TR><INPUT TYPE="submit" VALUE="Upload"></TR> + <INPUT TYPE="submit" VALUE="Upload"> </FORM><BR> % } # end upload @@ -74,12 +91,12 @@ Upload results<BR></TR> % and $payby eq 'CHEK' % and $conf->exists('batch-manual_approval') % ) { -<TR><INPUT TYPE="button" VALUE="Manually approve" onclick=" +<INPUT TYPE="button" VALUE="Manually approve" onclick=" if ( confirm('Approve all remaining payments in this batch?') ) window.location.href='<%$p%>misc/process/pay_batch-approve.cgi?batchnum=<%$batchnum%>'; -"></TR> +"> +<BR> % } # end manual approval -</TABLE> % # summary info Batch is <% $statustext{$status} %><BR> @@ -119,19 +136,19 @@ my $batchnum = $pay_batch->batchnum; my $fixed = $conf->config("batch-fixed_format-$payby"); tie my %download_formats, 'Tie::IxHash', ( -'' => 'Default batch mode', -'NACHA' => '94 byte NACHA', -'csv-td_canada_trust-merchant_pc_batch' => - 'CSV file for TD Canada Trust Merchant PC Batch', -'csv-chase_canada-E-xactBatch' => - 'CSV file for Chase Canada E-xactBatch', -'PAP' => '80 byte file for TD Canada Trust PAP Batch', -'BoM' => 'Bank of Montreal ECA batch', -'ach-spiritone' => 'Spiritone ACH batch', -'paymentech' => 'XML file for Chase Paymentech', -'RBC' => 'Royal Bank of Canada PDS batch', -'td_eft1464' => '1464 byte file for TD Commercial Banking EFT', -'eft_canada' => 'EFT Canada CSV batch', + '' => 'Default batch mode', + 'NACHA' => '94 byte NACHA', + 'csv-td_canada_trust-merchant_pc_batch' => + 'CSV file for TD Canada Trust Merchant PC Batch', + 'csv-chase_canada-E-xactBatch' => + 'CSV file for Chase Canada E-xactBatch', + 'PAP' => '80 byte file for TD Canada Trust PAP Batch', + 'BoM' => 'Bank of Montreal ECA batch', + 'ach-spiritone' => 'Spiritone ACH batch', + 'paymentech' => 'XML file for Chase Paymentech', + 'RBC' => 'Royal Bank of Canada PDS batch', + 'td_eft1464' => '1464 byte file for TD Commercial Banking EFT', + 'eft_canada' => 'EFT Canada CSV batch', # insert new batch formats here ); @@ -150,4 +167,5 @@ my $count_query = "SELECT COUNT(*) FROM cust_pay_batch WHERE batchnum=$batchnum" my $count = FS::Record->scalar_sql($count_query); my $sum_query = "SELECT SUM(amount) FROM cust_pay_batch WHERE batchnum=$batchnum"; my $total = sprintf("%.2f", FS::Record->scalar_sql($sum_query)); + </%init> diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html index 151da01aa..88f8afb4c 100644 --- a/httemplate/view/cust_main/packages/contact.html +++ b/httemplate/view/cust_main/packages/contact.html @@ -10,10 +10,12 @@ ( <%pkg_detach_link($cust_pkg)%> ) </FONT> % } + <BR> % } elsif ( $show_contact_link && ! $opt{no_links} ) { <FONT SIZE=-1> ( <%pkg_add_contact_link($cust_pkg)%> ) </FONT> + <BR> % } <%init> diff --git a/httemplate/view/cust_main/packages/hidden.html b/httemplate/view/cust_main/packages/hidden.html index e3bd0fabf..35eda8c46 100644 --- a/httemplate/view/cust_main/packages/hidden.html +++ b/httemplate/view/cust_main/packages/hidden.html @@ -18,13 +18,13 @@ <B><% time2str('%b %o, %Y', $cust_pkg->get('cancel')) %></B> </TD><TD> % if ( $pkgpart_change ) { - from <B><% $part_pkg->pkg |h %></B></A> - <% $part_pkg->custom_comment |h %> + from <% $popup_link |n %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->custom_comment |h %></A> % } % if ( $pkgpart_change and $location_change ) { <BR> % } % if ( $location_change ) { - from <I><% $cust_pkg->location_label %></I> + from <I><% $popup_link |n %><% $cust_pkg->location_label %></A></I> % } </TD> </TR> @@ -52,4 +52,14 @@ my $pkgpart_change = ($next->pkgpart != $cust_pkg->pkgpart); my $location_change = ($next->locationnum != $cust_pkg->locationnum); my $both_change = $pkgpart_change && $location_change; +my $onclick = + include('/elements/popup_link_onclick.html', + 'action' => $fsurl.'view/cust_pkg-popup.html?' . $cust_pkg->pkgnum, + 'actionlabel' => 'Package #'.$cust_pkg->pkgnum, + 'width' => '1000', + 'height' => '310', + 'color' => $cust_pkg->statuscolor, + ); +my $popup_link = qq(<A HREF="#" onclick="$onclick">); + </%init> diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html index 4980feeac..217e8c556 100755 --- a/httemplate/view/cust_main/packages/section.html +++ b/httemplate/view/cust_main/packages/section.html @@ -4,17 +4,22 @@ <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Package') |h %></TH> <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Status') |h %></TH> <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Contact/Location') |h %></TH> +% if (!$opt{no_services}) { <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Services') |h %></TH> +% } </TR> % #$FS::cust_pkg::DEBUG = 2; % foreach my $cust_pkg (@$packages) { +% # if requested, this can override cust_pkg-group_by_location <& .packagerow, $cust_pkg, + %conf_opt, ( map { $_ => $opt{$_} } qw( cust_main bgcolor no_links cust_location_cache before_pkg_callback before_svc_callback after_svc_callback + cust_pkg-group_by_location + no_services )), - %conf_opt &> % } % } else { # there are no packages @@ -30,10 +35,12 @@ <& package.html, %iopt &> <& status.html, %iopt &> <TD CLASS="inv" BGCOLOR="<% $iopt{bgcolor} %>" WIDTH="20%" VALIGN="top"> - <& contact.html, %iopt &><BR> + <& contact.html, %iopt &> <& location.html, %iopt &> </TD> +% if (!$iopt{no_services}) { <& services.html, %iopt &> +% } </TR> % # insert hidden predecessors to this package, if any % # and a rolldown button to show them diff --git a/httemplate/view/cust_pkg-popup.html b/httemplate/view/cust_pkg-popup.html new file mode 100644 index 000000000..96956c732 --- /dev/null +++ b/httemplate/view/cust_pkg-popup.html @@ -0,0 +1,27 @@ +<& /elements/header-popup.html &> +<TABLE STYLE="width: 100%"> +<& cust_main/packages/section.html, + 'cust_main' => $cust_main, + 'packages' => [ $cust_pkg ], + 'cust_pkg-group_by_location' => 0, + 'no_services' => 1, +&> +</TABLE> +</BODY> +</HTML> +<%init> +my $curuser = $FS::CurrentUser::CurrentUser; +my ($pkgnum) = $cgi->keywords; +$pkgnum =~ /^\d+$/ or die "bad pkgnum $pkgnum"; + +my $cust_pkg = qsearchs({ + 'table' => 'cust_pkg', + 'addl_from' => 'JOIN cust_main USING (custnum)', + 'hashref' => { 'pkgnum' => $pkgnum }, + 'extra_sql' => ' AND '.$curuser->agentnums_sql, +}); +die "Package not found" unless $cust_pkg; +my $cust_main = $cust_pkg->cust_main; + +my $title = mt('Package [_1]', $pkgnum); +</%init> |