summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-10-08 23:00:26 -0700
committerIvan Kohler <ivan@freeside.biz>2013-10-08 23:00:26 -0700
commitfe4515eb37d76849dd08c62782d86bc7ba311dcd (patch)
tree6952cc3598de0c72b6a3eab1d53bde07a16c27f2 /httemplate/elements
parentf2766e203e1aa144d046a26cf13e01e1f5b00f64 (diff)
parent81ae0992cf8506c6a77485548ebde25eb946a9a9 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts: FS/FS/cust_main.pm
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/columnstart.html77
-rw-r--r--httemplate/elements/menu.html6
-rw-r--r--httemplate/elements/select-cable_provider.html7
-rw-r--r--httemplate/elements/tr-select-cable_provider.html12
-rw-r--r--httemplate/elements/tr-select-invoice_mode.html10
5 files changed, 111 insertions, 1 deletions
diff --git a/httemplate/elements/columnstart.html b/httemplate/elements/columnstart.html
index be37d817d..1ffbcb9e8 100644
--- a/httemplate/elements/columnstart.html
+++ b/httemplate/elements/columnstart.html
@@ -1,6 +1,81 @@
+<%doc>
+<table>
+ <& /elements/columnstart.html &>
+ <tr> ... </tr>
+ <tr> ... </tr>
+ <& /elements/columnnext.html &>
+ ...
+ <& /elements/columnend.html &>
+</table>
+
+Pass 'aligned' => 1 to have corresponding rows in the columns line up.
+</%doc>
+% my $id = sprintf('table%08d', rand(100000000));
<TR>
<TD CLASS="background" COLSPAN=99>
- <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
+ <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 id="<%$id%>">
<TR>
<TD VALIGN="top">
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
+% if ( $aligned ) {
+%# Instead of changing all the tr-* elements to sometimes output table
+%# cells without wrapping them in a row, we're just going to completely
+%# rebuild the table on the client side.
+<script type="text/javascript">
+<&| onload.js &>
+ var table = document.getElementById('<%$id%>'); // has one row, always
+ var rows = []; // row contents, each containing
+ var n_rows = []; // rows in each subtable
+ var n_cols = []; // cols in each subtable
+ var total_rows = 0; // max(n_rows)
+ for(var i=0; i < table.rows[0].cells.length; i++) {
+ // these are cells created by columnstart/columnnext
+ // each contains a table, and nothing else
+ var subtable = table.rows[0].cells[i].children[0];
+ n_rows[i] = subtable.rows.length;
+ if ( total_rows < n_rows[i] ) {
+ total_rows = n_rows[i];
+ }
+ n_cols[i] = 0;
+ var subrows = []; // the rows of this table
+ for(var j=0; j < n_rows[i]; j++) {
+ // these are the actual tr-* rows within the table, and
+ // can contain multiple cells
+ subrows[j] = [];
+ var tr = subtable.rows[j];
+ if ( n_cols[i] < tr.cells.length ) {
+ n_cols[i] = tr.cells.length;
+ }
+ for(var k=0; k < tr.cells.length; k++) {
+ subrows[j][k] = tr.cells[k];
+ }
+ } // for(j)
+ rows[i] = subrows;
+ } // for(i)
+ var new_table = document.createElement('TABLE');
+ for (var j = 0; j < total_rows; j++) {
+ var tr = document.createElement('TR');
+ for (var i = 0; i < rows.length; i++) { // subtables
+ var k = 0; // subrow position
+ if ( j < n_rows[i] ) { // then subtable i has this row
+ for (k = 0; k < rows[i][j].length; k++) { // cells
+ tr.appendChild(rows[i][j][k]);
+ }
+ } // else k is just 0
+ if ( k < n_cols[i] ) { // then we need a spacer
+ var spacer = document.createElement('TD');
+ spacer.setAttribute('colspan', n_cols[i] - k);
+ tr.appendChild(spacer);
+ }
+ } // for(i); subtables
+ // tr is complete
+ new_table.appendChild(tr);
+ } // for(j); rows
+ table.parentNode.insertBefore( new_table, table );
+ table.parentNode.removeChild(table);
+</&>
+</script>
+% } # if $aligned
+<%args>
+$aligned => 0
+</%args>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 8cbbd1742..8cb967518 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -197,6 +197,10 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) {
[ $fsurl. 'search/report_svc_phone_usage.html',
'Total usage (minutes, and amount billed) for the specified time period, per phone number.',
];
+ $report_svc{"${name} by state"} =
+ [ $fsurl. 'search/phone_state.html',
+ 'Current or historical phone services broken down by state.',
+ ];
}
@@ -517,6 +521,7 @@ tie my %config_radius, 'Tie::IxHash',
;
tie my %config_cable, 'Tie::IxHash',
+ 'Cable providers' => [ $fsurl.'browse/cable_provider.html', '' ],
'Cable modem models' => [ $fsurl.'browse/cable_model.html', '' ],
;
@@ -600,6 +605,7 @@ $config_billing{'Billing events'} = [ $fsurl.'browse/part_event.html', 'Billing
|| $curuser->access_right('Edit global billing events');
if ( $curuser->access_right('Configuration') ) {
#$config_billing{'Invoice events'} = [ $fsurl.'browse/part_bill_event.cgi', 'Deprecated, old-style actions for overdue invoices' ];
+ $config_billing{'Invoice configurations'} = [ $fsurl.'browse/invoice_conf.html', 'Adjust invoice settings for special-purpose notices' ];
$config_billing{'Invoice templates'} = [ $fsurl.'browse/invoice_template.html', 'Edit templates for HTML, plaintext and typeset invoices' ];
$config_billing{'separator'} = ''; #its a separator!
$config_billing{'Prepaid cards'} = [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ];
diff --git a/httemplate/elements/select-cable_provider.html b/httemplate/elements/select-cable_provider.html
new file mode 100644
index 000000000..9530b78c0
--- /dev/null
+++ b/httemplate/elements/select-cable_provider.html
@@ -0,0 +1,7 @@
+<% include( '/elements/select-table.html',
+ 'table' => 'cable_provider',
+ 'name_col' => 'provider',
+ 'empty_label' => 'Select provider',
+ @_,
+ )
+%>
diff --git a/httemplate/elements/tr-select-cable_provider.html b/httemplate/elements/tr-select-cable_provider.html
new file mode 100644
index 000000000..abb8564dc
--- /dev/null
+++ b/httemplate/elements/tr-select-cable_provider.html
@@ -0,0 +1,12 @@
+% #if ( scalar(@domains) < 2 ) {
+% #} else {
+ <TR>
+ <TD ALIGN="right"><% $opt{'label'} || 'Provider' %></TD>
+ <TD>
+ <% include( '/elements/select-cable_provider.html', %opt) %>
+ </TD>
+ </TR>
+% #}
+<%init>
+ my %opt = @_;
+</%init>
diff --git a/httemplate/elements/tr-select-invoice_mode.html b/httemplate/elements/tr-select-invoice_mode.html
new file mode 100644
index 000000000..3dccdccc2
--- /dev/null
+++ b/httemplate/elements/tr-select-invoice_mode.html
@@ -0,0 +1,10 @@
+<& tr-select-table.html,
+ 'label' => 'Invoice mode',
+ 'table' => 'invoice_mode',
+ 'field' => 'modenum',
+ 'name_col' => 'modename',
+ 'agent_virt' => 1,
+ 'agent_null' => 1,
+ 'empty_label' => '(none)',
+ @_
+&>