+</STYLE>
+
+% # activate rolldown buttons for hidden package blocks
+<SCRIPT TYPE="text/javascript">
+function toggle_rolldown() {
+ var up_arrow = <% decode_entities('⬆') |js_string %>;
+ var dn_arrow = <% decode_entities('⬇') |js_string %>;
+ var pkgnum = this.id.replace('rolldown_', '');
+ var hidden = document.getElementById('cust_pkg'+pkgnum+'_block');
+ if (hidden.style.display == 'none') {
+ hidden.style.display = '';
+ this.textContent = this.textContent.replace(dn_arrow, up_arrow);
+ } else {
+ hidden.style.display = 'none';
+ this.textContent = this.textContent.replace(up_arrow, dn_arrow);
+ }
+}
+<&| /elements/onload.js &>
+var el;
+% if ( $cgi->param('fragment') =~ /^cust_pkg(\d+)$/ ) {
+% # IE-specific hack, but also unhide the row if it's in a hidden block
+el = document.getElementById('cust_pkg<% $1 %>');
+% }
+var all_buttons = document.getElementsByClassName('rolldown_button');
+for (var i = 0; i < all_buttons.length; i++) {
+ all_buttons[i].onclick = toggle_rolldown;
+ var block_id = all_buttons[i].id.replace('rolldown_', '');
+ if ( el && document.getElementById('cust_pkg'+block_id+'_block')
+ .contains(el)
+ ) {
+ // then toggle it now
+ all_buttons[i].click();
+ }
+}
+if ( el ) el.scrollIntoView(true);
+</&>
+</SCRIPT>
+
+<TABLE>
+ <TR>
+ <TD ALIGN="left" VALIGN="top">
+
+% my $br = 0;
+
+% if ( $total_pkgs > $maxrecords ) {
+
+% if ( 1 ) { #FS::pkg_class->num_pkg_class ) {
+ <% $br++ ? ' | ' : '' %>
+ Class: <& /elements/select-cust-pkg_class.html,
+ curr_value => scalar($cgi->param('classnum')),
+ onchange => 'classnum_changed(this);',
+ pre_options => [ '-1' => 'all',
+ '0' => '(none)',
+ ],
+ &>
+% }
+
+ <% $br++ ? ' | ' : '' %>
+ Status: <& /elements/select-cust_pkg-status.html,
+ curr_value => scalar($cgi->param('status')),
+ onchange => 'status_changed(this);',
+ &>
+
+% if ( 1 ) { #$cust_main->num_cust_location ) {
+ <% $br++ ? ' | ' : '' %>
+ Location: <& /elements/select-cust_location.html,
+ cust_main => $cust_main,
+ curr_value => scalar($cgi->param('locationnum')),
+ addnew => 0,
+ onchange => 'locationnum_changed(this);',
+ pre_options => [ '-1' => 'all', ],
+ &>
+% }
+
+ <SCRIPT TYPE="text/javascript">
+
+ function classnum_changed(what) {
+% my $classnum = $cgi->param('classnum');
+% $cgi->delete('classnum');
+ window.location = '<% $cgi->self_url %>;classnum=' + what.options[what.selectedIndex].value;
+% $cgi->param('classnum', $classnum);
+ }
+
+ function status_changed(what) {
+% my $status = $cgi->param('status');
+% $cgi->delete('status');
+ window.location = '<% $cgi->self_url %>;status=' + what.options[what.selectedIndex].value;
+% $cgi->param('status', $status);
+ }
+
+ function locationnum_changed(what) {
+% my $locationnum = $cgi->param('locationnum');
+% $cgi->delete('locationnum');
+ window.location = '<% $cgi->self_url %>;locationnum=' + what.options[what.selectedIndex].value;
+% $cgi->param('locationnum', $locationnum);
+ }