summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-04-14 15:36:20 -0700
committerMark Wells <mark@freeside.biz>2012-04-14 15:36:20 -0700
commit5371ad9dd6bf63e29ffc85c8381f1ea2630b1749 (patch)
tree0109d86cf93a84697fe84fc29927a9f058cf3d93 /httemplate
parent5abe1300f16cf01a6311203deee29373162491c7 (diff)
parent401ba3ab0637de1bc460370949b75dca092375d8 (diff)
merge master
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/docs/about.html50
-rw-r--r--httemplate/docs/credits.html7
-rw-r--r--httemplate/edit/process/svc_broadband.cgi6
-rw-r--r--httemplate/elements/customer-table.html298
-rw-r--r--httemplate/elements/freeside.css28
-rw-r--r--httemplate/elements/menu.html27
-rw-r--r--httemplate/elements/select-rt-customfield.html34
-rw-r--r--httemplate/elements/table-grid.html13
-rw-r--r--httemplate/elements/tr-select-from_to.html2
-rw-r--r--httemplate/elements/tr-select-router_block_ip.html33
-rw-r--r--httemplate/graph/cust_signup.html29
-rw-r--r--httemplate/graph/elements/monthly.html9
-rw-r--r--httemplate/graph/report_cust_bill_pkg.html6
-rw-r--r--httemplate/graph/report_cust_signup.html6
-rw-r--r--httemplate/misc/batch-cust_pay.html24
-rw-r--r--httemplate/misc/process/batch-cust_pay.cgi2
-rw-r--r--httemplate/misc/xmlhttp-cust_main-discount_terms.cgi19
-rw-r--r--httemplate/misc/xmlhttp-cust_main-search.cgi8
-rwxr-xr-xhttemplate/search/cust_main.cgi2
-rwxr-xr-xhttemplate/search/cust_pkg.cgi11
-rw-r--r--httemplate/search/cust_pkg_summary.cgi2
-rw-r--r--httemplate/search/cust_pkg_summary.html4
-rw-r--r--httemplate/search/cust_pkg_susp.cgi2
-rw-r--r--httemplate/search/cust_pkg_susp.html4
-rw-r--r--httemplate/search/elements/search-html.html6
-rw-r--r--httemplate/search/elements/search.html10
-rwxr-xr-xhttemplate/search/report_cust_pkg.html43
-rw-r--r--httemplate/search/report_rt_ticket.html32
-rw-r--r--httemplate/search/report_rt_transaction.html13
-rw-r--r--httemplate/search/rt_ticket.html125
-rw-r--r--httemplate/search/rt_transaction.html125
-rwxr-xr-xhttemplate/view/cust_main.cgi4
-rw-r--r--httemplate/view/cust_main/payment_history.html8
-rw-r--r--httemplate/view/cust_main/tickets.html9
-rwxr-xr-xhttemplate/view/logo-agent.cgi10
35 files changed, 663 insertions, 348 deletions
diff --git a/httemplate/docs/about.html b/httemplate/docs/about.html
index f0994e506..e3bb28298 100644
--- a/httemplate/docs/about.html
+++ b/httemplate/docs/about.html
@@ -1,14 +1,34 @@
-<% include('/elements/header-popup.html', { title=>'Freeside', nobr=>1 } ) %>
+<% include('/elements/header-popup.html', { title=>$title, nobr=>1 } ) %>
<% include('/elements/init_overlib.html') %>
<CENTER>
-<IMG SRC="<%$fsurl%>images/small-logo.png" BORDER="0"><BR>
-<H3>version <% $FS::VERSION %></H3>
+% if ( $agentnum ) {
+
+ <IMG SRC="<%$fsurl%>view/logo-agent.cgi?agentnum=<%$agentnum%>" BORDER="0"><BR>
+
+% my $url = $conf->config('company_url', $agentnum);
+% if ( $url ) {
+ <BR><BR>
+ <A HREF="<% $conf->config('company_url', $agentnum) %>" TARGET="_blank"><%$title%> homepage</A>
+% }
+
+% } else {
+
+ <IMG SRC="<%$fsurl%>images/small-logo.png" BORDER="0"><BR>
+ <H3>version <% $FS::VERSION %></H3>
+
+% }
</CENTER>
<CENTER>
-<FONT SIZE="-1">&copy; 2011 Freeside Internet Services, Inc.<BR>
+% if ( $agentnum ) {
+ <BR><BR>
+ <FONT SIZE="-2">Based on Freeside version <% $FS::VERSION %><BR>
+% } else {
+ <FONT SIZE="-1">
+% }
+&copy; 2012 Freeside Internet Services, Inc.<BR>
All rights reserved.<BR>
Licensed under the terms of the<BR>
GNU <b>Affero</b> General Public License.<BR>
@@ -17,6 +37,9 @@ GNU <b>Affero</b> General Public License.<BR>
<BR>
<CENTER>
+% if ( $agentnum ) {
+ <FONT SIZE="-2">
+% }
<A HREF="credits.html">Credits</A>
&nbsp;&nbsp;&nbsp;&nbsp;
<A HREF="javascript:void(0)" onClick="openLicense()">License</A>
@@ -24,13 +47,18 @@ GNU <b>Affero</b> General Public License.<BR>
<BR><BR>
<A HREF="http://www.freeside.biz/freeside" TARGET="_blank">Freeside homepage</A>
+% if ( $agentnum ) {
+ </FONT>
+% }
</CENTER>
<BR>
-<CENTER>
-<FONT SIZE="-3">"The sky was yellow and the sun was blue" -R. Hunter</FONT>
-</CENTER>
+% unless ( $agentnum ) {
+ <CENTER>
+ <FONT SIZE="-3">"A selfish heart is trouble, but a foolish heart is worse" -R. Hunter</FONT>
+ </CENTER>
+% }
<SCRIPT TYPE="text/javascript">
@@ -51,3 +79,11 @@ function openLicense() {
</BODY>
</HTML>
+<%init>
+
+my $conf = new FS::Conf;
+my $agentnum = $conf->config('brand-agent');
+
+my $title = $agentnum ? $conf->config('company_name', $agentnum) : 'Freeside';
+
+</%init>
diff --git a/httemplate/docs/credits.html b/httemplate/docs/credits.html
index 9bb1decea..c1d0d8705 100644
--- a/httemplate/docs/credits.html
+++ b/httemplate/docs/credits.html
@@ -120,6 +120,9 @@ Tim Yardley<BR>
<BR>
<BR>
<BR>
+<BR>
+<BR>
+<BR>
<SCRIPT TYPE="text/javascript">
@@ -154,12 +157,12 @@ function myHeight() {
return document.body.document.height;
else
*/
- return 1850; // approx height (add more per contributors)
+ return 1900; // approx height (add more per contributors)
}
document.body.style.overflow = 'hidden';
-var startingPosition = 360;
+var startingPosition = 340;
//huh, adjust for firefox
var ua = navigator.userAgent;
diff --git a/httemplate/edit/process/svc_broadband.cgi b/httemplate/edit/process/svc_broadband.cgi
index 31def255c..90eab4aad 100644
--- a/httemplate/edit/process/svc_broadband.cgi
+++ b/httemplate/edit/process/svc_broadband.cgi
@@ -13,9 +13,9 @@ die "access denied"
sub precheck {
my $cgi = shift;
- if ( !defined($cgi->param('ip_addr')) ) {
- $cgi->param('ip_addr', $cgi->param('prev_ip_addr') || '');
- }
+ my $ip_addr = $cgi->param('ip_addr');
+ $ip_addr =~ s/[^\d\.]//g; # converts '(automatic)' to null
+ $cgi->param('ip_addr', $ip_addr);
$cgi->param("usergroup", [ $cgi->param('usergroup') ]);
''
}
diff --git a/httemplate/elements/customer-table.html b/httemplate/elements/customer-table.html
index aa085c41a..a517ece2a 100644
--- a/httemplate/elements/customer-table.html
+++ b/httemplate/elements/customer-table.html
@@ -67,7 +67,45 @@ Example:
this.value = '';
}
-
+
+ function update_customer(searchrow, customerArray) {
+
+ var custnum_obj = document.getElementById('custnum'+searchrow);
+ var customer = document.getElementById('customer'+searchrow);
+ var customer_select = document.getElementById('cust_select'+searchrow);
+
+ custnum_obj.disabled = false;
+ custnum_obj.style.backgroundColor = '#ffffff';
+ customer.disabled = false;
+ customer.style.backgroundColor = '#ffffff';
+
+ if ( customerArray.length == 0 ) {
+
+ custnum_obj.value = 'Not found';
+ customer.value = 'Not found';
+ custnum_obj.style.color = '#ff0000';
+ customer.style.color = '#ff0000';
+
+ customer.style.display = '';
+ customer_select.style.display = 'none';
+ return false;
+
+ } else if ( customerArray.length == 5 ) {
+
+ custnum_obj.value = customerArray[0];
+ custnum_obj.style.color = '#000000';
+ customer.value = customerArray[1];
+
+ update_balance_text(searchrow, customerArray[2]);
+ update_status_text( searchrow, customerArray[3]);
+ update_status_color(searchrow, '#'+customerArray[4]);
+
+ customer.style.display = '';
+ customer_select.style.display = 'none';
+ return true;
+ }
+ }
+
function <% $opt{prefix} %>search_invnum() {
this.style.color = '#000000'
@@ -99,55 +137,25 @@ Example:
customer_select.style.display = 'none';
var custnum_obj = document.getElementById('custnum'+searchrow);
- var balance = document.getElementById('balance'+searchrow);
- var status = document.getElementById('status'+searchrow);
- balance.innerHTML = '';
- status.innerHTML = '';
+ update_balance_text(searchrow, '');
+ update_status_text(searchrow, '');
+ update_status_color(searchrow, '#000000');
function search_invnum_update(customers) {
var customerArray = eval('(' + customers + ')');
-
- custnum_obj.disabled = false;
- custnum_obj.style.backgroundColor = '#ffffff';
- customer.disabled = false;
- customer.style.backgroundColor = '#ffffff';
-
- if ( customerArray.length == 0 ) {
-
- custnum_obj.value = 'Not found';
- customer.value = 'Not found';
- custnum_obj.style.color = '#ff0000';
- customer.style.color = '#ff0000';
-
- customer.style.display = '';
- customer_select.style.display = 'none';
-
- } else if ( customerArray.length == 5 ) {
-
- custnum_obj.value = customerArray[0];
- custnum_obj.style.color = '#000000';
- customer.value = customerArray[1];
- balance.innerHTML = '<% $money_char %>' + customerArray[2] + ' &nbsp; ';
- status.innerHTML = customerArray[3];
- status.style.color = '#'+customerArray[4];
-
- customer.style.display = '';
- customer_select.style.display = 'none';
+ update_customer(searchrow, customerArray);
% if ( $opt{invnum_update_callback} ) {
<% $opt{invnum_update_callback} %>(searchrow, '<% $opt{prefix} %>')
% }
- }
-
}
invnum_search( invnum, search_invnum_update );
}
-
function <% $opt{prefix} %>search_custnum() {
this.style.color = '#000000'
@@ -180,42 +188,19 @@ Example:
var invnum = document.getElementById('invnum'+searchrow);
invnum.value = '';
-
- var balance = document.getElementById('balance'+searchrow);
- balance.innerHTML = '';
-
- var status = document.getElementById('status'+searchrow);
- status.innerHTML = '';
- function search_custnum_update(customers) {
-
- var customerArray = eval('(' + customers + ')');
+ update_balance_text(searchrow, '');
+ update_status_text( searchrow, '');
+ update_status_color(searchrow, '#000000');
- customer.disabled = false;
- customer.style.backgroundColor = '#ffffff';
-
- if ( customerArray.length == 0 ) {
-
- customer.value = 'Not found';
- customer.style.color = '#ff0000';
- custnum_obj.style.color = '#ff0000';
-
- } else if ( customerArray.length == 5 ) {
-
- custnum_obj.value = customerArray[0];
- custnum_obj.style.color = '#000000';
- customer.value = customerArray[1];
- balance.innerHTML = '<% $money_char %>' + customerArray[2] + ' &nbsp; ';
- status.innerHTML = customerArray[3];
- status.style.color = '#'+customerArray[4];
+ function search_custnum_update(customers) {
- customer.style.display = '';
- customer_select.style.display = 'none';
+ var customerArray = eval('(' + customers + ')') || [];
+ update_customer(searchrow, customerArray);
% if ( $opt{custnum_update_callback} ) {
<% $opt{custnum_update_callback} %>(searchrow, '<% $opt{prefix} %>')
% }
- }
}
custnum_search(custnum, search_custnum_update );
@@ -251,39 +236,16 @@ Example:
var customer_select = document.getElementById('cust_select'+searchrow);
- var balance = document.getElementById('balance'+searchrow);
- balance.innerHTML = '';
-
- var status = document.getElementById('status'+searchrow);
- status.innerHTML = '';
-
function search_customer_update(customers) {
- var customerArray = eval('(' + customers + ')');
+ var customerArrayArray = eval('(' + customers + ')') || [ [] ];
custnum_obj.disabled = false;
custnum_obj.style.backgroundColor = '#ffffff';
- if ( customerArray.length == 0 ) {
-
- custnum_obj.value = 'Not found';
- custnum_obj.style.color = '#ff0000';
- customer_obj.style.color = '#ff0000';
-
- customer_obj.style.display = '';
- customer_select.style.display = 'none';
-
- } else if ( customerArray.length == 1 ) {
-
- custnum_obj.value = customerArray[0][0];
- customer_obj.value = customerArray[0][1];
- balance.innerHTML = '<% $money_char %>' + customerArray[0][2] + ' &nbsp; ';
- status.innerHTML = customerArray[0][3];
- status.style.color = '#'+customerArray[0][4];
-
- customer_obj.style.display = '';
- customer_select.style.display = 'none';
+ if ( customerArrayArray.length == 1 ) {
+ update_customer(customerArrayArray[1]);
% if ( $opt{custnum_update_callback} ) {
<% $opt{custnum_update_callback} %>(searchrow, '<% $opt{prefix} %>')
% }
@@ -294,14 +256,16 @@ Example:
custnum_obj.style.color = '#ff0000';
//blank the current list
- for ( var i = customer_select.length; i >= 0; i-- )
- customer_select.options[i] = null;
+ customer_select.options.length = 0;
opt(customer_select, '', 'Multiple customers match "' + customer + '" - select one', '#ff0000');
-
//add the multiple customers
- for ( var s = 0; s < customerArray.length; s++ )
- opt(customer_select, customerArray[s][0] + '_' + customerArray[s][2] + '_' + customerArray[s][3] + '_' + customerArray[s][4], customerArray[s][1], '#000000');
+ for ( var s = 0; s < customerArrayArray.length; s++ ) {
+ opt(customer_select,
+ JSON.stringify(customerArrayArray[s]),
+ customerArrayArray[s][1],
+ '#000000');
+ }
opt(customer_select, 'cancel', '(Edit search string)', '#000000');
@@ -341,27 +305,7 @@ Example:
} else {
- var pos_underscore1 = custnum_balance_status.indexOf('_');
- var pos_underscore2 = custnum_balance_status.indexOf('_',pos_underscore1+1);
- var pos_underscore3 = custnum_balance_status.indexOf('_',pos_underscore2+1);
- var custnum = custnum_balance_status.substring(0,pos_underscore1);
- var balance = custnum_balance_status.substring(pos_underscore1+1,pos_underscore2) + ' &nbsp; ';
- var status = custnum_balance_status.substring(pos_underscore2+1,pos_underscore3);
- var color = custnum_balance_status.substring(pos_underscore3+1);
-
- custnum_obj.value = custnum;
- custnum_obj.style.color = '#000000';
-
- customer_obj.value = customer;
- customer_obj.style.color = '#000000';
-
- balance_obj.innerHTML = '<% $money_char %>' + balance;
-
- status_obj.innerHTML = status;
- status_obj.style.color = '#'+color;
-
- this.style.display = 'none';
- customer_obj.style.display = '';
+ update_customer(searchrow, JSON.parse(custnum_balance_status));
% if ( $opt{custnum_update_callback} ) {
<% $opt{custnum_update_callback} %>(searchrow, '<% $opt{prefix} %>')
@@ -378,6 +322,23 @@ Example:
what.options[length] = optionName;
}
+ function update_status_text(rownum, newval) {
+ document.getElementById('status'+rownum).value = newval;
+ document.getElementById('status'+rownum+'_text').innerHTML = newval;
+ }
+
+ function update_status_color(rownum, newval) {
+ document.getElementById('statuscolor'+rownum).value = newval;
+ document.getElementById('status'+rownum+'_text').style.color = newval;
+ }
+
+ function update_balance_text(rownum, newval) {
+ document.getElementById('balance'+rownum).value = newval;
+ document.getElementById('balance'+rownum+'_text').innerHTML = newval;
+ }
+
+
+
</SCRIPT>
<TABLE ID="<% $opt{prefix} %>OneTrueTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
@@ -430,14 +391,26 @@ Example:
</SCRIPT>
</TD>
- <TD>
- <SPAN
+ <TD STYLE="text-align: center">
+ <SPAN
+ ID = "status<% $row %>_text"
+ rownum = "<% $row %>"
+ STYLE = "font-weight: bold;
+ color: <%$param->{"statuscolor$row"} || '#000000'%>"
+
+ ><% $param->{"status$row"} %></SPAN>
+ <INPUT TYPE = "hidden"
NAME = "status<% $row %>"
ID = "status<% $row %>"
+ VALUE = "<% $param->{"status$row"} %>"
+ rownum = "<% $row %>"
+ >
+ <INPUT TYPE = "hidden"
+ NAME = "statuscolor<% $row %>"
+ ID = "statuscolor<% $row %>"
+ VALUE = "<% $param->{"statuscolor$row"} %>"
rownum = "<% $row %>"
- STYLE = "text-align:center; font-weight: bold"
>
- </SPAN>
</TD>
<TD>
@@ -456,6 +429,21 @@ Example:
</SCRIPT>
</TD>
+ <TD STYLE="text-align:right">
+ <% $money_char %>
+ <SPAN
+ ID = "balance<% $row %>_text"
+ rownum = "<% $row %>"
+ ><% $param->{"balance$row"} %></SPAN>
+ &nbsp;
+ <INPUT TYPE = "hidden"
+ NAME = "balance<% $row %>"
+ ID = "balance<% $row %>"
+ VALUE = "<% $param->{"balance$row"} %>"
+ rownum = "<% $row %>"
+ >
+ </TD>
+
% my $col = 0;
% foreach my $field ( @{$opt{fields}} ) {
% my $value;
@@ -494,15 +482,6 @@ Example:
</TD>
% $col++;
% }
- <TD STYLE="text-align:right;">
- <SPAN
- NAME = "balance<% $row %>"
- ID = "balance<% $row %>"
- rownum = "<% $row %>"
- >
- </SPAN>
- &nbsp;
- </TD>
</TR>
% }
@@ -613,15 +592,28 @@ Example:
row.appendChild(custnum_cell);
var status_cell = document.createElement('TD');
+ status_cell.style.textAlign = 'center';
- var status_span = document.createElement('SPAN');
- status_span.setAttribute('name', 'status'+<% $opt{prefix} %>rownum);
- status_span.setAttribute('id', 'status'+<% $opt{prefix} %>rownum);
- status_span.style.textAlign = 'center';
- status_span.style.fontWeight = 'bold';
- status_span.setAttribute('rownum', <% $opt{prefix} %>rownum);
- status_cell.appendChild(status_span);
+ var status_span = document.createElement('SPAN');
+ status_span.setAttribute('id', 'status'+<% $opt{prefix} %>rownum+'_text');
+ status_span.style.fontWeight = 'bold';
+ status_span.setAttribute('rownum', <% $opt{prefix} %>rownum);
+ status_cell.appendChild(status_span);
+ var status_input = document.createElement('INPUT');
+ status_input.setAttribute('type', 'hidden');
+ status_input.setAttribute('name', 'status'+<% $opt{prefix} %>rownum);
+ status_input.setAttribute('id', 'status'+<% $opt{prefix} %>rownum);
+ status_input.setAttribute('rownum', <% $opt{prefix} %>rownum);
+ status_cell.appendChild(status_input);
+
+ var statuscolor_input = document.createElement('INPUT');
+ statuscolor_input.setAttribute('type', 'hidden');
+ statuscolor_input.setAttribute('name', 'statuscolor'+<% $opt{prefix} %>rownum);
+ statuscolor_input.setAttribute('id', 'statuscolor'+<% $opt{prefix} %>rownum);
+ statuscolor_input.setAttribute('rownum', <% $opt{prefix} %>rownum);
+ status_cell.appendChild(statuscolor_input);
+
row.appendChild(status_cell);
var customer_cell = document.createElement('TD');
@@ -649,13 +641,25 @@ Example:
row.appendChild(customer_cell);
var balance_cell = document.createElement('TD');
- balance_cell.style.textAlign = 'right';
-
- var balance_span = document.createElement('SPAN');
- balance_span.setAttribute('name', 'balance'+<% $opt{prefix} %>rownum);
- balance_span.setAttribute('id', 'balance'+<% $opt{prefix} %>rownum);
- balance_span.setAttribute('rownum', <% $opt{prefix} %>rownum);
- balance_cell.appendChild(balance_span);
+
+ balance_cell.style.textAlign = 'right';
+ balance_cell.appendChild(document.createTextNode('<%$money_char%>'));
+
+ var balance_span = document.createElement('SPAN');
+ balance_span.setAttribute('id', 'balance'+<% $opt{prefix} %>rownum+'_text');
+ balance_span.setAttribute('rownum', <% $opt{prefix} %>rownum);
+ balance_cell.appendChild(balance_span);
+
+ balance_cell.appendChild(
+ document.createTextNode(String.fromCharCode(160)) //&nbsp;
+ );
+
+ var balance_input = document.createElement('INPUT');
+ balance_input.setAttribute('type', 'hidden');
+ balance_input.setAttribute('name', 'balance'+<% $opt{prefix} %>rownum);
+ balance_input.setAttribute('id', 'balance'+<% $opt{prefix} %>rownum);
+ balance_input.setAttribute('rownum', <% $opt{prefix} %>rownum);
+ balance_cell.appendChild(balance_input);
row.appendChild(balance_cell);
@@ -676,9 +680,10 @@ Example:
my_cell.appendChild(my_text);
% }
+% my $name = (ref($field) eq 'CODE') ? "column${col}_" : $field;
var my_input = document.createElement('INPUT');
- my_input.setAttribute('name', '<% $field %>'+<% $opt{prefix} %>rownum);
- my_input.setAttribute('id', '<% $field %>'+<% $opt{prefix} %>rownum);
+ my_input.setAttribute('name', '<% $name %>'+<% $opt{prefix} %>rownum);
+ my_input.setAttribute('id', '<% $name %>'+<% $opt{prefix} %>rownum);
my_input.style.textAlign = '<% $align{ $opt{align}->[$col] || 'l' } %>';
my_input.setAttribute('size', <% $sizes->[$col] || 10 %>);
% if ($types->[$col] eq 'immutable') {
@@ -725,7 +730,7 @@ my $conf = new FS::Conf;
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
-my $types = $opt{'types'} ? [ @{$opt{'types'}} ] : [];
+my $types = $opt{'type'} ? [ @{$opt{'type'}} ] : [];
my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : [];
my $param = $opt{param};
@@ -742,5 +747,4 @@ my %align = (
);
my $money_char = $conf->config('money_char') || '$';
-
</%init>
diff --git a/httemplate/elements/freeside.css b/httemplate/elements/freeside.css
index 44a4a3ca2..c291e1e33 100644
--- a/httemplate/elements/freeside.css
+++ b/httemplate/elements/freeside.css
@@ -250,3 +250,31 @@ div.fstabcontainer {
background-color:#f8f8f8;
}
+table.grid {
+ border: 1px solid #cccccc;
+ -moz-box-shadow: 1px 1px 2px #666666;
+ -webkit-box-shadow: 1px 1px 2px #666666;
+ box-shadow: 1px 1px 2px #666666;
+ filter: progid:DXImageTransform.Microsoft.Shadow(color='#666666', Direction=135, Strength=2);
+}
+
+th.grid {
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-bottom: 2px;
+ border: none;
+ empty-cells: show;
+}
+
+td.grid {
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-bottom: 2px;
+ border: none;
+ empty-cells: show;
+}
+
+table.inv { border: none }
+th.inv { border: none }
+td.inv { border: none }
+
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 3b0969f5c..b1cbebf34 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -28,7 +28,7 @@
% 'width' => 300,
% 'height' => 375,
% 'color' => '#7e0079',
-% 'scrolling' => 'no',
+% #'scrolling' => 'no',
% );
% $fs_popup =~ s/return false;//;
function about_freeside() {
@@ -106,7 +106,7 @@ $report_customers_lists{'with USPS-unvalidated addresses'} = [ $fsurl. 'search/c
tie my %report_customers, 'Tie::IxHash';
$report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ]
- if $curuser->access_right('List customers');
+ if $curuser->access_right('List all customers');
$report_customers{'Zip code distribution'} = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ];
$report_customers{'Customer signup report'} = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ],
$report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html', 'by status, signup date, agent, etc.' ]
@@ -238,9 +238,11 @@ if ( $curuser->access_right('Financial reports') ) {
$report_packages{'separator2'} = '';
}
$report_packages{'All customer packages'} = [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ];
-$report_packages{'Package summary'} = [ $fsurl.'search/cust_pkg_summary.html', 'Show package sales summary', ];
+$report_packages{'Package summary'} = [ $fsurl.'search/cust_pkg_summary.html', 'Show package sales summary', ]
+ if $curuser->access_right('Summarize packages');
$report_packages{'Suspended customer packages'} = [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ];
-$report_packages{'Suspension summary'} = [ $fsurl.'search/cust_pkg_susp.html', 'Show suspension activity', ];
+$report_packages{'Suspension summary'} = [ $fsurl.'search/cust_pkg_susp.html', 'Show suspension activity', ]
+ if $curuser->access_right('Summarize packages');
$report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ];
$report_packages{'FCC Form 477 packages'} = [ $fsurl.'search/report_477.html', 'Summarize packages by census tract for particular types' ]
if $conf->exists('cust_main-require_censustract');
@@ -626,11 +628,18 @@ $help_menu{'Ticketing documentation'} = [ 'http://wiki.bestpractical.com/', 'Req
$help_menu{'Networking monitoring documentation'} = [ 'http://torrus.org/userguide.pod.html', 'Torrus User Guide' ]
if $conf->config('network_monitoring_system') eq 'Torrus_Internal';
$help_menu{'separator'} = '';
-$help_menu{"About Freeside v$FS::VERSION"} = [ "javascript:about_freeside()", '' ];
-$help_menu{"About RT v$RT::VERSION"} = [ 'http://www.bestpractical.com/rt', 'Request Tracker Homepage' ]
- if $conf->config('ticket_system') eq 'RT_Internal';
-$help_menu{"About Torrus v1.0.9"} = [ 'http://www.torrus.org/', 'Torrus Homepage' ] #XXX manual version
- if $conf->config('network_monitoring_system') eq 'Torrus_Internal';
+
+my $agentnum = $conf->config('brand-agent');
+if ( $agentnum ) {
+ my $company_name = $conf->config('company_name', $agentnum);
+ $help_menu{"About $company_name"} = [ "javascript:about_freeside()", '' ];
+} else {
+ $help_menu{"About Freeside v$FS::VERSION"} = [ "javascript:about_freeside()", '' ];
+ $help_menu{"About RT v$RT::VERSION"} = [ 'http://www.bestpractical.com/rt', 'Request Tracker Homepage' ]
+ if $conf->config('ticket_system') eq 'RT_Internal';
+ $help_menu{"About Torrus v1.0.9"} = [ 'http://www.torrus.org/', 'Torrus Homepage' ] #XXX manual version
+ if $conf->config('network_monitoring_system') eq 'Torrus_Internal';
+}
tie my %menu, 'Tie::IxHash';
diff --git a/httemplate/elements/select-rt-customfield.html b/httemplate/elements/select-rt-customfield.html
new file mode 100644
index 000000000..7a45bb14b
--- /dev/null
+++ b/httemplate/elements/select-rt-customfield.html
@@ -0,0 +1,34 @@
+<SELECT NAME="<% $opt{name} %>">
+% while ( @fields ) {
+<OPTION VALUE="<% shift @fields %>"><% shift @fields %></OPTION>
+% }
+</SELECT>
+<%once>
+RT::Init();
+</%once>
+<%init>
+my %opt = @_;
+my $lookuptype = $opt{lookuptype};
+my $valuetype = $opt{valuetype};
+# get a list of TimeValue-type custom fields
+my $CurrentUser = RT::CurrentUser->new();
+$CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username);
+die "RT not configured" unless $CurrentUser->id;
+my $CFs = RT::CustomFields->new($CurrentUser);
+
+$CFs->Limit(FIELD => 'LookupType',
+ OPERATOR => 'ENDSWITH',
+ VALUE => $lookuptype)
+ if $lookuptype;
+
+$CFs->Limit(FIELD => 'Type',
+ VALUE => $valuetype)
+ if $valuetype;
+
+my @fields;
+push @fields, '', $opt{empty_label} if exists($opt{empty_label});
+
+while (my $CF = $CFs->Next) {
+ push @fields, $CF->Name, ($CF->Description || $CF->Name);
+}
+</%init>
diff --git a/httemplate/elements/table-grid.html b/httemplate/elements/table-grid.html
index 4d7deeaa4..4f4200570 100644
--- a/httemplate/elements/table-grid.html
+++ b/httemplate/elements/table-grid.html
@@ -1,15 +1,4 @@
-<STYLE TYPE="text/css">
-
-.grid TH { padding-left: 3px; padding-right: 3px; padding-bottom: 2px; border: none; empty-cells: show }
-.grid TD { padding-left: 3px; padding-right: 3px; padding-bottom: 2px; border: none; empty-cells: show }
-
-.inv table { border: none }
-.inv TH { border: none }
-.inv TD { border: none }
-
-</STYLE>
-
-<TABLE CLASS="grid" CELLSPACING=<% $opt{cellspacing} %> CELLPADDING=<% $opt{cellpadding} %> <% $opt{bgcolor} %> STYLE="border: 1px solid #cccccc;">
+<TABLE CLASS="grid" CELLSPACING=<% $opt{cellspacing} %> CELLPADDING=<% $opt{cellpadding} %> <% $opt{bgcolor} %>>
<%init>
diff --git a/httemplate/elements/tr-select-from_to.html b/httemplate/elements/tr-select-from_to.html
index 100381234..a27412f99 100644
--- a/httemplate/elements/tr-select-from_to.html
+++ b/httemplate/elements/tr-select-from_to.html
@@ -39,7 +39,7 @@
my %hash = (
'show_month_abbr' => 1,
'start_year' => '1999',
- 'end_year' => '2012', #haha, well...
+ 'end_year' => '2013', #haha, well...
@_,
);
</%init>
diff --git a/httemplate/elements/tr-select-router_block_ip.html b/httemplate/elements/tr-select-router_block_ip.html
index ed8fe810f..95d1787b8 100644
--- a/httemplate/elements/tr-select-router_block_ip.html
+++ b/httemplate/elements/tr-select-router_block_ip.html
@@ -1,23 +1,34 @@
<script type="text/javascript">
var manual_addr_routernum = <% encode_json(\%manual_addr_routernum) %>;
var ip_addr_curr_value = <% $opt{'ip_addr'} |js_string %>;
-function lock_ip_addr(obj, i) {
- var routernum = obj.value;
- var select_blocknum = document.getElementsByName('blocknum')[0];
+var blocknum_curr_value = <% $opt{'blocknum'} |js_string %>;
+function update_ip_addr(obj, i) {
+ var routernum = document.getElementById('router_select_0').value;
+ var select_blocknum = document.getElementById('router_select_1');
+ var blocknum = select_blocknum.value;
var input_ip_addr = document.getElementById('input_ip_addr');
if ( manual_addr_routernum[routernum] == 'Y' ) {
-%# enable ip_addr, default it to its previous value, and hide block selection
+%# hide block selection and default ip address to its previous value
select_blocknum.style.display = 'none';
input_ip_addr.value = ip_addr_curr_value;
- input_ip_addr.disabled = false;
}
else {
%# the reverse
select_blocknum.style.display = '';
- input_ip_addr.disabled = true;
- input_ip_addr.value = '(automatic)';
+%# default ip address to null, unless the router/block are set to the
+%# previous value, in which case default it to current value
+ if ( routernum == router_curr_values[0] &&
+ blocknum == router_curr_values[1] ) {
+ input_ip_addr.value = ip_addr_curr_value;
+ } else {
+ input_ip_addr.value = <% mt('(automatic)') |js_string %>;
+ }
}
}
+function clearhint_ip_addr (what) {
+ if ( what.value == <% mt('(automatic)') |js_string %> )
+ what.value = '';
+}
</script>
<& /elements/tr-td-label.html, label => ($opt{'label'} || 'Router') &>
<td>
@@ -27,7 +38,7 @@ function lock_ip_addr(obj, i) {
records => \@routers,
name_col => 'routername',
value_col => 'routernum',
- onchange => 'lock_ip_addr',
+ onchange => 'update_ip_addr',
curr_value=> $opt{'routernum'},
},
{
@@ -39,6 +50,7 @@ function lock_ip_addr(obj, i) {
name_col => 'cidr',
link_col => 'routernum',
empty_label => '(any)',
+ onchange => 'update_ip_addr',
curr_value => $opt{'blocknum'},
},
]
@@ -52,12 +64,11 @@ function lock_ip_addr(obj, i) {
% }
% else {
<input type="text" id="input_ip_addr" name="ip_addr"
- value="<% $opt{'ip_addr'} |h%>">
+ value="<% $opt{'ip_addr'} |h%>" onfocus="clearhint_ip_addr(this)">
% }
</td> </tr>
-<input type="hidden" name="prev_ip_addr" value="<% $opt{'ip_addr'} |h%>">
<script type="text/javascript">
-lock_ip_addr(document.getElementsByName('routernum')[0],0);
+update_ip_addr();
</script>
<%init>
diff --git a/httemplate/graph/cust_signup.html b/httemplate/graph/cust_signup.html
index dd9100f1e..a3eb702f2 100644
--- a/httemplate/graph/cust_signup.html
+++ b/httemplate/graph/cust_signup.html
@@ -9,7 +9,7 @@
'agentnum' => $agentnum,
'sprintf' => '%u',
'disable_money' => 1,
- 'bottom_total' => (scalar @items > 1 ? 1 : 0),
+ 'bottom_total' => (scalar @items > 1 && !$indirect ? 1 : 0),
'bottom_link' => $bottom_link,
'link_fromparam' => 'signupdate_begin',
'link_toparam' => 'signupdate_end',
@@ -59,25 +59,34 @@ elsif ( $cgi->param('refnum') =~ /^(\d*)$/ ) {
}
}
+my $indirect = ($cgi->param('indirect') eq 'Y' ? 1 : 0);
+
my (@items, @labels, @colors, @params, @links);
my $hue = 0;
-my $hue_increment = 125;
+my $hue_increment = 75;
my @signup_colors;
foreach my $referral (@referral) {
+ my %params = ('refnum' => $referral->refnum) unless $all_referral;
+
push @items, 'signups';
push @labels, ( $all_referral ? 'Signups' : $referral->referral );
- push @params, ( $all_referral ? [] : [ 'refnum' => $referral->refnum ] );
+ push @params, [ %params ];
push @links, $link . ($all_referral ? '' : "refnum=".$referral->refnum.';');
- if ( !@signup_colors ) {
- @signup_colors = Color::Scheme->new
- ->from_hue($hue)
- ->scheme('analogic')
- ->colors;
- $hue += $hue_increment;
+ # rotate hue for each referral type
+ @signup_colors = Color::Scheme->new->from_hue($hue)->colors;
+ $hue += $hue_increment;
+ push @colors, $signup_colors[0];
+ if ( $indirect ) {
+ push @items, 'signups';
+ push @labels, $all_referral ?
+ 'Referrals' :
+ $referral->referral . ' referrals';
+ push @params, [ %params, 'indirect' => 1 ];
+ push @links, '';
+ push @colors, $signup_colors[1];
}
- push @colors, shift @signup_colors;
}
</%init>
diff --git a/httemplate/graph/elements/monthly.html b/httemplate/graph/elements/monthly.html
index 072798c2a..86530dd39 100644
--- a/httemplate/graph/elements/monthly.html
+++ b/httemplate/graph/elements/monthly.html
@@ -92,10 +92,7 @@ $opt{'start_year'} ||= $cgi->param('start_year'); # || 1899+$curyear;
$opt{'end_month'} ||= $cgi->param('end_month'); # || $curmon+1;
$opt{'end_year'} ||= $cgi->param('end_year'); # || 1900+$curyear;
-#find end of projection
-$opt{'project_month'} ||= $cgi->param('project_month') || 0;
-$opt{'project_year'} ||= $cgi->param('project_year') || 0;
-# setting these to zero prevents projection on reports that don't support it
+$opt{'projection'} ||= $cgi->param('projection') ? 1 : 0;
if ( $opt{'daily'} ) { # daily granularity
$opt{'start_day'} ||= $cgi->param('start_day');
@@ -118,9 +115,7 @@ my %reportopts = (
'end_day' => $opt{'end_day'},
'end_month' => $opt{'end_month'},
'end_year' => $opt{'end_year'},
- 'project_day' => $opt{'project_day'},
- 'project_month' => $opt{'project_month'},
- 'project_year' => $opt{'project_year'},
+ 'projection' => $opt{'projection'},
'agentnum' => $opt{'agentnum'},
'remove_empty' => $opt{'remove_empty'},
'doublemonths' => $opt{'doublemonths'},
diff --git a/httemplate/graph/report_cust_bill_pkg.html b/httemplate/graph/report_cust_bill_pkg.html
index f2c486cf4..07d4421e8 100644
--- a/httemplate/graph/report_cust_bill_pkg.html
+++ b/httemplate/graph/report_cust_bill_pkg.html
@@ -7,10 +7,8 @@
<% include('/elements/tr-select-from_to.html' ) %>
<TR>
- <TD ALIGN="right">Project to:</TD>
- <TD><& /elements/select-month_year.html,
- prefix => 'project',
- show_month_abbr => 1 &></TD>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="projection" VALUE="1"></TD>
+ <TD>Show projected data for future months</TD>
</TR>
<% include('/elements/tr-select-agent.html',
diff --git a/httemplate/graph/report_cust_signup.html b/httemplate/graph/report_cust_signup.html
index 9d3f5006b..12dec8e6a 100644
--- a/httemplate/graph/report_cust_signup.html
+++ b/httemplate/graph/report_cust_signup.html
@@ -22,6 +22,12 @@
)
%>
+<& /elements/tr-td-label.html, label => 'Show customer referrals' &>
+<TD>
+ <INPUT TYPE="checkbox" NAME="indirect" VALUE="Y">
+</TD>
+</TR>
+
</TABLE>
<BR><INPUT TYPE="submit" VALUE="Display">
diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
index 11fdeee61..2e798652d 100644
--- a/httemplate/misc/batch-cust_pay.html
+++ b/httemplate/misc/batch-cust_pay.html
@@ -62,10 +62,10 @@ function select_discount_term(row, prefix) {
name_singular => 'payment',
header => \@header,
fields => \@fields,
- types => \@types,
+ type => \@types,
align => \@align,
- sizes => \@sizes,
- colors => \@colors,
+ size => \@sizes,
+ color => \@colors,
param => \%param,
footer => \@footer,
footer_align => \@footer_align,
@@ -96,18 +96,19 @@ die "access denied"
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
-my @header = ( '', 'Amount', 'Check #' );
-my @fields = ( sub { "$money_char" }, 'paid', 'payinfo' );
-my @types = ( 'immutable', '', '' );
-my @align = ( 'c', 'r', 'r' );
-my @sizes = ( 0, 8, 10 );
-my @colors = ( '', '', '' );
+my @header = ( 'Amount', 'Check #' );
+my @fields = ( 'paid', 'payinfo' );
+my @types = ( '', '' );
+my @align = ( 'r', 'r' );
+my @sizes = ( 8, 10 );
+my @colors = ( '', '' );
my %param = ();
-my @footer = ( "$money_char", '_TOTAL', '' );
-my @footer_align = ( 'c', 'r', 'r' );
+my @footer = ( '_TOTAL', '' );
+my @footer_align = ( 'r', 'r' );
my $custnum_update_callback = '';
if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM part_pkg_discount') ) {
+ #push @header, 'Discount';
push @header, '';
push @fields, 'discount_term';
push @types, 'immutable';
@@ -119,6 +120,7 @@ if ( FS::Record->scalar_sql('SELECT COUNT(*) FROM part_pkg_discount') ) {
$custnum_update_callback = 'select_discount_term';
}
+#push @header, 'Error';
push @header, '';
push @fields, 'error';
push @types, 'immutable';
diff --git a/httemplate/misc/process/batch-cust_pay.cgi b/httemplate/misc/process/batch-cust_pay.cgi
index aa371266c..a6b90ea74 100644
--- a/httemplate/misc/process/batch-cust_pay.cgi
+++ b/httemplate/misc/process/batch-cust_pay.cgi
@@ -19,7 +19,7 @@
% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
% });
% }
-% if ( !$cust_main ) { # not found, try agent_custid
+% if ( length($custnum) and !$cust_main ) { # not found, try agent_custid
% $cust_main = qsearchs({
% 'table' => 'cust_main',
% 'hashref' => { 'agent_custid' => $custnum },
diff --git a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
index 71e2da597..b524e69fc 100644
--- a/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
+++ b/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
@@ -2,15 +2,18 @@
%
% my $return = [];
% my $custnum = $cgi->param('arg');
-% my $cust_main = '';
-% $cust_main = qsearchs({
-% 'table' => 'cust_main',
-% 'hashref' => { 'custnum' => $custnum },
-% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
-% });
+% if ( $custnum =~ /^\d+$/ ) {
+% my $cust_main = '';
+% $cust_main = qsearchs({
+% 'table' => 'cust_main',
+% 'hashref' => { 'custnum' => $custnum },
+% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+% });
%
-% if ($cust_main) {
-% $return = [ map [ $_, "$_ months" ], $cust_main->discount_terms ];
+% if ($cust_main) {
+% $return = [ map [ $_, sprintf("%d months", $_) ],
+% $cust_main->discount_terms ];
+% }
% }
%
<% objToJson($return) %>
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi
index 68c5bf597..436501e8b 100644
--- a/httemplate/misc/xmlhttp-cust_main-search.cgi
+++ b/httemplate/misc/xmlhttp-cust_main-search.cgi
@@ -18,9 +18,13 @@
% } elsif ( $sub eq 'invnum_search' ) {
%
% my $string = $cgi->param('arg');
-% my $inv = qsearchs('cust_bill', { 'invnum' => $string });
-% my $return = $inv ? findbycustnum($inv->custnum,0) : [];
+% if ( $string =~ /^(\d+)$/ ) {
+% my $inv = qsearchs('cust_bill', { 'invnum' => $1 });
+% my $return = $inv ? findbycustnum($inv->custnum,0) : [];
<% objToJson($return) %>
+% } else { #return nothing
+[]
+% }
% }
% elsif ( $sub eq 'exact_search' ) {
% # XXX possibly should query each element separately
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index aae8c7e99..859ef04e6 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -334,7 +334,7 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('List customers');
+ unless $curuser->access_right('List all customers');
my $conf = new FS::Conf;
my $maxrecords = $conf->config('maxsearchrecordsperpage');
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index 297edee90..887ec6039 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -20,6 +20,7 @@
emt('Susp. delay'),
emt('Expire'),
emt('Contract end'),
+ emt('Changed'),
emt('Cancel'),
emt('Reason'),
FS::UI::Web::cust_header(
@@ -45,7 +46,7 @@
sub { FS::part_pkg::freq_pretty(shift); },
( map { time_or_blank($_) }
- qw( setup last_bill bill adjourn susp dundate expire contract_end cancel ) ),
+ qw( setup last_bill bill adjourn susp dundate expire contract_end change_date cancel ) ),
sub { my $self = shift;
my $return = '';
@@ -94,13 +95,14 @@
'',
'',
'',
+ '',
FS::UI::Web::cust_colors(),
'',
],
- 'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '',
+ 'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
FS::UI::Web::cust_styles() ],
'size' => [ '', '', '', '', '-1' ],
- 'align' => 'rrlccrrlrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r',
+ 'align' => 'rrlccrrlrrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r',
'links' => [
$link,
$link,
@@ -117,6 +119,7 @@
'',
'',
'',
+ '', # link to changed-from package?
'',
'',
'',
@@ -182,7 +185,7 @@ my %disable = (
'' => {},
);
-foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cancel active )) {
+foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi
index cea4cdcd2..fbeeb92ce 100644
--- a/httemplate/search/cust_pkg_summary.cgi
+++ b/httemplate/search/cust_pkg_summary.cgi
@@ -25,7 +25,7 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('List packages');
+ unless $curuser->access_right('Summarize packages');
my $title = 'Package Summary Report';
my ($begin, $end) = FS::UI::Web::parse_beginning_ending($cgi);
diff --git a/httemplate/search/cust_pkg_summary.html b/httemplate/search/cust_pkg_summary.html
index a0ef47210..f9adf044e 100644
--- a/httemplate/search/cust_pkg_summary.html
+++ b/httemplate/search/cust_pkg_summary.html
@@ -21,4 +21,8 @@
<% include('/elements/footer.html') %>
<%init>
+
+die "access denied"
+ unless $curuser->access_right('Summarize packages');
+
</%init>
diff --git a/httemplate/search/cust_pkg_susp.cgi b/httemplate/search/cust_pkg_susp.cgi
index 9ab5992d9..d6bbc43d6 100644
--- a/httemplate/search/cust_pkg_susp.cgi
+++ b/httemplate/search/cust_pkg_susp.cgi
@@ -25,7 +25,7 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('List packages');
+ unless $curuser->access_right('Summarize packages');
my $money_char = FS::Conf->new()->config('money_char') || '$';
diff --git a/httemplate/search/cust_pkg_susp.html b/httemplate/search/cust_pkg_susp.html
index c59e6c158..2ac643260 100644
--- a/httemplate/search/cust_pkg_susp.html
+++ b/httemplate/search/cust_pkg_susp.html
@@ -21,4 +21,8 @@
<% include('/elements/footer.html') %>
<%init>
+
+die "access denied"
+ unless $curuser->access_right('Summarize packages');
+
</%init>
diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html
index af0c8fc09..53167c26e 100644
--- a/httemplate/search/elements/search-html.html
+++ b/httemplate/search/elements/search-html.html
@@ -130,7 +130,9 @@
</TD>
-% unless ( $opt{'disable_download'} || $type eq 'html-print' ) {
+% if ( $curuser->access_right('Download report data')
+% and !$opt{'disable_download'}
+% and $type ne 'html-print' ) {
<TD ALIGN="right">
@@ -470,6 +472,8 @@
% }
<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+
my %args = @_;
my $type = $args{'type'};
my $header = $args{'header'};
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 81ec4d082..9bc66b6fa 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -170,7 +170,6 @@ Example:
%
<% include('search-csv.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
%
-% #} elsif ( $type eq 'excel' ) {
% } elsif ( $type =~ /\.xls$/ ) {
%
<% include('search-xls.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
@@ -179,7 +178,7 @@ Example:
%
<% include('search-xml.html', rows=>$rows, opt=>\%opt ) %>
%
-% } else { # regular HTML
+% } else {
%
<% include('search-html.html',
type => $type,
@@ -205,6 +204,11 @@ my $curuser = $FS::CurrentUser::CurrentUser;
my $type = $cgi->param('_type') =~ /^(csv|\w*\.xls|xml|select|html(-print)?)$/
? $1 : 'html' ;
+if ( !$curuser->access_right('Download report data') ) {
+ $opt{'disable_download'} = 1;
+ $type = 'html';
+}
+
my %align = (
'l' => 'left',
'r' => 'right',
@@ -363,6 +367,8 @@ unless ( $type =~ /^(csv|\w*.xls)$/) {
$maxrecords ||= $confmax;
}
+ $opt{'disable_maxselect'} ||= $conf->exists('disable_maxselect');
+
$limit = $maxrecords ? "LIMIT $maxrecords" : '';
$offset = $cgi->param('offset') =~ /^(\d+)$/ ? $1 : 0;
diff --git a/httemplate/search/report_cust_pkg.html b/httemplate/search/report_cust_pkg.html
index 3da59c2ac..e47bbb1e5 100755
--- a/httemplate/search/report_cust_pkg.html
+++ b/httemplate/search/report_cust_pkg.html
@@ -88,23 +88,35 @@
%>
% }
-
+ <TR>
+ <TD COLSPAN=2>
+ <TABLE>
+ <TR>
+ <TD></TD>
+ <TD>From date <i>(m/d/y)</i></TD>
+ <TD>To date <i>(m/d/y)</i></TD>
+ </TR>
+% my $noinit = 0;
% foreach my $field (@date_fields) {
- <TR>
- <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
- <TD>
- <TABLE>
- <% include( '/elements/tr-input-beginning_ending.html',
- prefix => $field,
- layout => 'horiz',
- )
- %>
- </TABLE>
- </TD>
- </TR>
-
-% }
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
+% foreach (qw(beginning ending)) {
+ <TD>
+ <& /elements/input-date-field.html, {
+ 'name' => $field.'_'.$_,
+ 'value' => '',
+ 'noinit' => $noinit,
+ 'format' => '%m/%d/%Y',
+ } &>
+ </TD>
+% $noinit = 1;
+% }
+ </TR>
+% } #foreach $field
+ </TABLE>
+ </TD>
+ </TR>
<SCRIPT TYPE="text/javascript">
@@ -186,6 +198,7 @@ tie my %label, 'Tie::IxHash',
'dundate' => 'Suspension delayed until',
'expire' => 'Expires',
'contract_end' => 'Contract ends',
+ 'change_date' => 'Changed from other package',
'cancel' => 'Cancelled',
;
my @date_fields = keys %label;
diff --git a/httemplate/search/report_rt_ticket.html b/httemplate/search/report_rt_ticket.html
index 79a601b4b..f0d7a4200 100644
--- a/httemplate/search/report_rt_ticket.html
+++ b/httemplate/search/report_rt_ticket.html
@@ -6,10 +6,20 @@
<% include ( '/elements/tr-input-beginning_ending.html' ) %>
+ <& /elements/tr-td-label.html, label => 'Time category:' &>
+ <TD>
+ <& /elements/select-rt-customfield.html,
+ name => 'cfname',
+ lookuptype => 'RT::Transaction',
+ valuetype => 'TimeValue',
+ empty_label => 'Worked',
+ &>
+ </TD></TR>
+
<% include ( '/elements/tr-select-otaker.html' ) %>
<TR>
- <TD>Account</TD>
+ <TD ALIGN="right">Account:</TD>
<TD>
<SELECT NAME="svcnum">
<OPTION VALUE="">(all)
@@ -48,4 +58,24 @@ if ( @pkgparts ) {
});
}
+# get a list of TimeValue-type custom fields
+RT::Init();
+my $CurrentUser = RT::CurrentUser->new();
+$CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username);
+die "RT not configured" unless $CurrentUser->id;
+my $CFs = RT::CustomFields->new($CurrentUser);
+
+$CFs->Limit(FIELD => 'LookupType',
+ OPERATOR => 'ENDSWITH',
+ VALUE => 'RT::Transaction');
+
+$CFs->Limit(FIELD => 'Type',
+ VALUE => 'TimeValue');
+
+my @time_fields = ('', 'Worked');
+while (my $CF = $CFs->Next) {
+ push @time_fields, $CF->Name, ($CF->Description || $CF->Name);
+}
+
+
</%init>
diff --git a/httemplate/search/report_rt_transaction.html b/httemplate/search/report_rt_transaction.html
index 0232b8070..b8454d968 100644
--- a/httemplate/search/report_rt_transaction.html
+++ b/httemplate/search/report_rt_transaction.html
@@ -6,6 +6,17 @@
<% include ( '/elements/tr-input-beginning_ending.html' ) %>
+ <& /elements/tr-td-label.html, label => 'Time category:' &>
+ <TD>
+ <& /elements/select-rt-customfield.html,
+ name => 'cfname',
+ lookuptype => 'RT::Transaction',
+ valuetype => 'TimeValue',
+ empty_label => 'Worked',
+ &>
+ </TD></TR>
+
+
<% include ( '/elements/tr-select-otaker.html' ) %>
<% include ( '/elements/tr-input-text.html',
@@ -15,7 +26,7 @@
%>
<TR>
- <TD>Account</TD>
+ <TD ALIGN="right">Account:</TD>
<TD>
<SELECT NAME="svcnum">
<OPTION VALUE="">(all)
diff --git a/httemplate/search/rt_ticket.html b/httemplate/search/rt_ticket.html
index abe13157d..1ed5a3883 100644
--- a/httemplate/search/rt_ticket.html
+++ b/httemplate/search/rt_ticket.html
@@ -3,25 +3,27 @@
'name_singular' => 'ticket',
'query' => $query,
'count_query' => $count_query,
- 'count_addl' => [ $format_seconds_sub, $format_seconds_sub, ],
+ 'count_addl' => [ $format_seconds_sub,
+ $applied_time ? $format_seconds_sub : () ],
'header' => [ 'Ticket #',
'Ticket',
'Time',
- 'Applied',
+ $applied_time ? 'Applied' : (),
],
'fields' => [ 'ticketid',
sub { encode_entities(shift->get('subject')) },
- sub { my $seconds = shift->get('transaction_time');
+ sub { my $seconds = shift->get('ticket_time');
&{ $format_seconds_sub }( $seconds );
},
- sub { my $seconds = shift->get('support');
+ ($applied_time ?
+ sub { my $seconds = shift->get('applied_time');
&{ $format_seconds_sub }( $seconds );
- },
+ } : () ),
],
'sort_fields' => [ 'ticketid',
'subject',
'transaction_time',
- 'support_time',
+ $applied_time ? 'applied_time' : (),
],
'links' => [
$link,
@@ -48,34 +50,87 @@ $seconds)%3600)/60)."m";
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
+local $FS::Record::nowarn_classload = 1;
+
#some amount of false laziness w/timeworked.html...
-my $transactiontime = "
- CASE transactions.type when 'Set'
- THEN (to_number(newvalue,'999999')-to_number(oldvalue, '999999')) * 60
- ELSE timetaken*60
- END
-";
+my @select = (
+ 'Tickets.Id AS ticketid',
+ 'Tickets.Subject'
+);
+my @select_total = ( 'COUNT(*)' );
+my ($transaction_time, $applied_time);
my $join = 'JOIN Users ON Transactions.Creator = Users.Id '; #.
-# 'LEFT JOIN acct_rt_transaction '.
-# ' ON Transactions.Id = acct_rt_transaction.transaction_id';
my $twhere = "
- WHERE objecttype='RT::Ticket'
- AND Transactions.ObjectId = Tickets.Id
+ WHERE Transactions.ObjectType = 'RT::Ticket'
+ AND Transactions.ObjectId = Tickets.Id
+";
+
+my $cfname = '';
+if ( $cgi->param('cfname') =~ /^\w(\w|\s)*$/ ) {
+
+ $cfname = $cgi->param('cfname');
+
+ $transaction_time = "(CASE Transactions.Type
+ WHEN 'CustomField' THEN
+ ( coalesce(to_number(ocfv_new.Content,'999999'),0)
+ - coalesce(to_number(ocfv_old.Content,'999999'),0) )
+ ELSE ( to_number(ocfv_main.Content,'999999') )
+ END) * 60";
+
+ $join .= "
+ LEFT JOIN ObjectCustomFieldValues ocfv_new
+ ON ( ocfv_new.Id = Transactions.NewReference )
+ LEFT JOIN ObjectCustomFieldValues ocfv_old
+ ON ( ocfv_old.Id = Transactions.OldReference )
+ LEFT JOIN ObjectCustomFieldValues ocfv_main
+ ON ( ocfv_main.ObjectType = 'RT::Transaction'
+ AND ocfv_main.ObjectId = Transactions.Id )
+ JOIN CustomFields
+ ON ( ( CustomFields.LookupType = 'RT::Queue-RT::Ticket-RT::Transaction'
+ AND CustomFields.Id = ocfv_main.CustomField
+ AND ocfv_main.Id IS NOT NULL
+ )
+ OR
+ ( CustomFields.LookupType = 'RT::Queue-RT::Ticket'
+ AND (CustomFields.Id = ocfv_new.CustomField OR ocfv_new.Id IS NULL)
+ AND (CustomFields.Id = ocfv_old.CustomField OR ocfv_old.Id IS NULL)
+ AND ocfv_main.Id IS NULL
+ ) )
+ ";
+
+ $twhere .= " AND CustomFields.Name = '$cfname'
+ AND (ocfv_new.Id IS NOT NULL OR ocfv_old.Id IS NOT NULL OR ocfv_main.Id IS NOT NULL)";
+
+}
+else {
+ $transaction_time = "
+ CASE transactions.type when 'Set'
+ THEN (to_number(newvalue,'999999')-to_number(oldvalue, '999999')) * 60
+ ELSE timetaken*60
+ END";
+
+ my $applied = '';
+ if ( $cgi->param('svcnum') =~ /^\s*(\d+)\s*$/ ) {
+ $twhere .= " AND EXISTS( SELECT 1 FROM acct_rt_transaction WHERE acct_rt_transaction.transaction_id = Transactions.id AND svcnum = $1 )";
+ $applied = "AND svcnum = $1";
+ }
+
+ $twhere .= "
AND ( ( Transactions.Type = 'Set'
AND Transactions.Field = 'TimeWorked'
AND Transactions.NewValue != Transactions.OldValue )
OR ( ( Transactions.Type='Create' OR Transactions.Type='Comment' OR Transactions.Type='Correspond' OR Transactions.Type='Touch' )
AND Transactions.TimeTaken > 0
)
- )
-";
-#AND transaction_time != 0
-#AND $wheretimeleft
+ )";
+
+ $applied_time = "( SELECT SUM(support) FROM acct_rt_transaction LEFT JOIN Transactions ON ( transaction_id = Id ) $twhere $applied )";
+
+}
-my $support = '';
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
# TIMESTAMP is Pg-specific... ?
@@ -92,25 +147,21 @@ if ( $cgi->param('otaker') && $cgi->param('otaker') =~ /^([\w\.\-]+)$/ ) {
$twhere .= " AND Users.name = '$1' ";
}
-if ( $cgi->param('svcnum') =~ /^\s*(\d+)\s*$/ ) {
- $twhere .= " AND EXISTS( SELECT 1 FROM acct_rt_transaction WHERE acct_rt_transaction.transaction_id = Transactions.id AND svcnum = $1 )";
- $support = "AND svcnum = $1";
-}
-
my $transactions = "FROM Transactions $join $twhere";
my $where = "WHERE EXISTS ( SELECT 1 $transactions )";
-my $transaction_time = "( SELECT SUM($transactiontime) $transactions )";
-my $support_time = "( SELECT SUM(support) FROM acct_rt_transaction LEFT JOIN Transactions ON ( transaction_id = Id ) $twhere $support )";
+my $ticket_time = "( SELECT SUM($transaction_time) $transactions )";
+push @select, "$ticket_time AS ticket_time";
+push @select_total, "SUM($ticket_time)";
+
+if ( $applied_time) {
+ push @select, "$applied_time AS applied_time";
+ push @select_total, "SUM($applied_time)";
+}
my $query = {
- 'select' => join(', ',
- 'Tickets.Id AS ticketid',
- 'Tickets.Subject',
- "$transaction_time AS transaction_time",
- "$support_time AS support",
- ),
+ 'select' => join(', ', @select),
'table' => 'tickets', #Pg-ism
#'table' => 'Tickets',
'addl_from' => '', #$join,
@@ -118,13 +169,9 @@ my $query = {
'order by' => 'ORDER BY Created',
};
-my $count_query =
+my $count_query = "SELECT ".join(', ', @select_total)." FROM Tickets $where";
#"SELECT COUNT(*), SUM($transactiontime), SUM(acct_rt_transaction.support) FROM Transactions $join $where";
#"SELECT COUNT(*), ( SUM($transactiontime) $transactions ) FROM Tickets"; # $join $where";
- "SELECT COUNT(*),
- SUM( $transaction_time ),
- SUM( $support_time )
- FROM Tickets $where"; # $join $where";
my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->get('ticketid'); } ];
diff --git a/httemplate/search/rt_transaction.html b/httemplate/search/rt_transaction.html
index be9cd0bc9..1ae607be1 100644
--- a/httemplate/search/rt_transaction.html
+++ b/httemplate/search/rt_transaction.html
@@ -3,12 +3,13 @@
'name_singular' => 'transaction',
'query' => $query,
'count_query' => $count_query,
- 'count_addl' => [ $format_seconds_sub, $format_seconds_sub, ],
+ 'count_addl' => [ $format_seconds_sub,
+ $applied_time ? $format_seconds_sub : () ],
'header' => [ 'Ticket #',
'Ticket',
'Date',
'Time',
- 'Applied',
+ $applied_time ? 'Applied' : (),
],
'fields' => [ 'ticketid',
sub { encode_entities(shift->get('subject')) },
@@ -16,9 +17,10 @@
sub { my $seconds = shift->get('transaction_time');
&{ $format_seconds_sub }( $seconds );
},
- sub { my $seconds = shift->get('support');
+ ($applied_time ?
+ sub { my $seconds = shift->get('applied_time');
&{ $format_seconds_sub }( $seconds );
- },
+ } : () ),
],
'links' => [
$link,
@@ -44,21 +46,81 @@ $seconds)%3600)/60)."m";
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
+local $FS::Record::nowarn_classload = 1;
#some amount of false laziness w/timeworked.html...
-my $transactiontime = "
- CASE Transactions.Type when 'Set'
- THEN (to_number(NewValue,'999999')-to_number(OldValue, '999999')) * 60
- ELSE TimeTaken*60
- END
-";
+my @select = (
+ 'Transactions.*',
+ 'Tickets.Id AS ticketid',
+ 'Tickets.Subject',
+ 'Users.name AS otaker',
+);
+my @select_total = ( 'COUNT(*)' );
+my ($transaction_time, $applied_time);
my $join = 'JOIN Tickets ON Transactions.ObjectId = Tickets.Id '.
'JOIN Users ON Transactions.Creator = Users.Id '; #.
-# 'LEFT JOIN acct_rt_transaction '.
-# ' ON Transactions.Id = acct_rt_transaction.transaction_id';
-my $where = "
- WHERE objecttype='RT::Ticket'
+
+my $where = "WHERE Transactions.ObjectType = 'RT::Ticket'";
+
+my $cfname = '';
+if ( $cgi->param('cfname') =~ /^\w(\w|\s)*$/ ) {
+
+ # a TimeValue-type custom field
+ $cfname = $cgi->param('cfname');
+
+ $transaction_time = "(CASE Transactions.Type
+ WHEN 'CustomField' THEN
+ ( coalesce(to_number(ocfv_new.Content,'999999'),0)
+ - coalesce(to_number(ocfv_old.Content,'999999'),0) )
+ ELSE ( to_number(ocfv_main.Content,'999999') )
+ END) * 60";
+
+ # complicated because we have to deal with the case of editing the
+ # ticket custom field directly (OldReference/NewReference) as well as
+ # entering a transaction with a custom field value (ObjectId)
+ $join .= "
+ LEFT JOIN ObjectCustomFieldValues ocfv_new
+ ON ( ocfv_new.Id = Transactions.NewReference )
+ LEFT JOIN ObjectCustomFieldValues ocfv_old
+ ON ( ocfv_old.Id = Transactions.OldReference )
+ LEFT JOIN ObjectCustomFieldValues ocfv_main
+ ON ( ocfv_main.ObjectType = 'RT::Transaction'
+ AND ocfv_main.ObjectId = Transactions.Id )
+ JOIN CustomFields
+ ON ( ( CustomFields.LookupType = 'RT::Queue-RT::Ticket-RT::Transaction'
+ AND CustomFields.Id = ocfv_main.CustomField
+ AND ocfv_main.Id IS NOT NULL
+ )
+ OR
+ ( CustomFields.LookupType = 'RT::Queue-RT::Ticket'
+ AND (CustomFields.Id = ocfv_new.CustomField OR ocfv_new.Id IS NULL)
+ AND (CustomFields.Id = ocfv_old.CustomField OR ocfv_old.Id IS NULL)
+ AND ocfv_main.Id IS NULL
+ ) )
+ ";
+
+ $where .= " AND CustomFields.Name = '$cfname'
+ AND (ocfv_new.Id IS NOT NULL OR ocfv_old.Id IS NOT NULL OR ocfv_main.Id IS NOT NULL)";
+
+}
+else {
+
+ # the intrinsic TimeWorked/TimeTaken fields
+ $transaction_time = "CASE Transactions.Type when 'Set'
+ THEN (to_number(NewValue,'999999')-to_number(OldValue, '999999')) * 60
+ ELSE TimeTaken*60
+ END";
+
+ my $applied = '';
+ if ( $cgi->param('svcnum') =~ /^\s*(\d+)\s*$/ ) {
+ $where .= " AND EXISTS( SELECT 1 FROM acct_rt_transaction WHERE acct_rt_transaction.transaction_id = Transactions.id AND svcnum = $1 )";
+ $applied = "AND svcnum = $1";
+ }
+
+ $applied_time = "( SELECT SUM(support) from acct_rt_transaction where transaction_id = Transactions.id $applied )";
+
+ $where .= "
AND ( ( Transactions.Type = 'Set'
AND Transactions.Field = 'TimeWorked'
AND Transactions.NewValue != Transactions.OldValue )
@@ -66,11 +128,17 @@ my $where = "
AND Transactions.TimeTaken > 0
)
)
-";
+ ";
+
+}
#AND transaction_time != 0
#AND $wheretimeleft
-
-my $support = '';
+push @select, "($transaction_time) AS transaction_time";
+push @select_total, "SUM($transaction_time)";
+if ( $applied_time ) {
+ push @select, "($applied_time) AS applied_time";
+ push @select_total, "SUM($applied_time)";
+}
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
# TIMESTAMP is Pg-specific... ?
@@ -91,22 +159,8 @@ if ( $cgi->param('ticketid') =~ /^\s*(\d+)\s*$/ ) {
$where .= " AND Tickets.Id = $1";
}
-if ( $cgi->param('svcnum') =~ /^\s*(\d+)\s*$/ ) {
- $where .= " AND EXISTS( SELECT 1 FROM acct_rt_transaction WHERE acct_rt_transaction.transaction_id = Transactions.id AND svcnum = $1 )";
- $support = "AND svcnum = $1";
-}
-
-my $support_time = "( SELECT SUM(support) from acct_rt_transaction where transaction_id = Transactions.id $support )";
-
my $query = {
- 'select' => join(', ',
- 'Transactions.*',
- 'Tickets.Id AS ticketid',
- 'Tickets.Subject',
- 'Users.name AS otaker',
- "$transactiontime AS transaction_time",
- "$support_time AS support",
- ),
+ 'select' => join(', ', @select),
'table' => 'transactions', #Pg-ism
#'table' => 'Transactions',
'addl_from' => $join,
@@ -114,12 +168,7 @@ my $query = {
'order by' => 'ORDER BY Created',
};
-my $count_query =
- #"SELECT COUNT(*), SUM($transactiontime), SUM(acct_rt_transaction.support) FROM Transactions $join $where";
- "SELECT COUNT(*),
- SUM($transactiontime),
- SUM($support_time)
- FROM Transactions $join $where";
+my $count_query = 'SELECT '.join(', ', @select_total). " FROM Transactions $join $where";
my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->get('ticketid'); } ];
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index fda4db0d9..9ce55b0b9 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -232,9 +232,9 @@ function areyousure(href, message) {
% }
% if ( $view eq 'jumbo' ) {
- <BR><BR>
- <A NAME="tickets"><FONT SIZE="+2"><% mt('Tickets') |h %></FONT></A><BR>
+ <BR>
% }
+<BR>
% if ( $view eq 'tickets' || $view eq 'jumbo' ) {
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index c453ffadc..c7a7c8024 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -500,14 +500,15 @@ foreach my $cust_refund ($cust_main->cust_refund) {
sub translate_payby {
my ($payby,$payinfo) = (shift,shift);
my %payby = (
+ FS::payby->payby2shortname,
BILL => $payinfo ? emt('Check #') : '',
CHEK => emt('Electronic check '),
PREP => emt('Prepaid card '),
CARD => emt('Credit card #'),
COMP => emt('Complimentary by '),
- CASH => emt('Cash'),
- WEST => emt('Western Union'),
- MCRD => emt('Manual credit card'),
+ #CASH => emt('Cash'),
+ #WEST => emt('Western Union'),
+ #MCRD => emt('Manual credit card'),
);
$payby = (exists $payby{$payby}) ? $payby{$payby} : $payby;
$payby;
@@ -516,6 +517,7 @@ sub translate_payby {
sub translate_payby_refund {
my ($payby,$payinfo) = (shift,shift);
my %payby = (
+ FS::payby->payby2shortname,
BILL => $payinfo ? emt('Check #') : emt('Check'),
CHEK => emt('Electronic check '),
CARD => emt('Credit card #'),
diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html
index adfaead6e..194e90742 100644
--- a/httemplate/view/cust_main/tickets.html
+++ b/httemplate/view/cust_main/tickets.html
@@ -9,6 +9,7 @@ function updateTicketLink() {
keys %new_param),'Queue=') %>" + selector.options[selector.selectedIndex].value;
}
</SCRIPT>
+<A NAME="tickets"><FONT CLASS="fsinnerbox-title">Tickets</FONT></A>
<A id="CreateTicketLink" HREF="<% $new_link %>"><% mt('Create new ticket') |h %></A>
<% mt('in queue') |h %>
%# fetch list of queues in which the user can create tickets
@@ -28,12 +29,12 @@ function updateTicketLink() {
<SCRIPT DEFER TYPE="text/javascript">updateTicketLink();</SCRIPT>
% }
</FORM>
+ |
+View
+<A HREF="<% $open_link %>"><% mt($openlabel) |h %></A> |
+<A HREF="<% $res_link %>"><% mt('resolved') |h %></A>
<BR>
-(<A HREF="<% $open_link %>"><% mt("View $openlabel tickets for this customer") |h %></A>)
-(<A HREF="<% $res_link %>"><% mt('View resolved tickets for this customer') |h %></A>)
-<BR><BR>
-
<& /elements/table-grid.html &>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
diff --git a/httemplate/view/logo-agent.cgi b/httemplate/view/logo-agent.cgi
new file mode 100755
index 000000000..0f654140c
--- /dev/null
+++ b/httemplate/view/logo-agent.cgi
@@ -0,0 +1,10 @@
+<% $conf->config_binary("logo.png", $agentnum) %>
+<%init>
+
+my $conf = new FS::Conf;
+
+my $agentnum = $cgi->param('agentnum');
+
+http_header('Content-Type' => 'image/png' );
+
+</%init>