summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/agent.cgi24
-rw-r--r--httemplate/edit/agent_payment_gateway.html28
-rw-r--r--httemplate/edit/elements/edit.html2
-rw-r--r--httemplate/edit/payment_gateway.html11
-rw-r--r--httemplate/edit/process/agent_payment_gateway.html13
-rw-r--r--httemplate/elements/notify-tickets.html8
-rw-r--r--httemplate/misc/taxproduct.cgi9
-rw-r--r--httemplate/pref/pref-process.html1
-rw-r--r--httemplate/pref/pref.html7
-rw-r--r--httemplate/search/elements/grouped-search/core2
-rw-r--r--httemplate/search/elements/grouped-search/html10
11 files changed, 53 insertions, 62 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index 3fe68c15d..751e8b69b 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -42,7 +42,7 @@ full offerings (via their type).<BR><BR>
<TH CLASS="grid" BGCOLOR="#cccccc">Currencies</TH>
% }
- <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Payment Gateway Overrides</FONT></TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Payment Gateway Override</FONT></TH>
<TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Configuration Overrides</FONT></TH>
</TR>
@@ -331,32 +331,24 @@ Unused
% }
% ##
-% # payment gateway overrides
+% # payment gateway override
% ##
<TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
<TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0>
-% foreach my $override (
-% # sort { } want taxclass-full stuff first? and default cards (empty cardtype)
-% qsearch('agent_payment_gateway', { 'agentnum' => $agent->agentnum } )
-% ) {
-%
-
+% my $gw_override = qsearchs('agent_payment_gateway', { 'agentnum' => $agent->agentnum } );
+% if ($gw_override) {
<TR>
<TD>
- <% $override->cardtype || 'Default' %> to <% $override->payment_gateway->gateway_module %> (<% $override->payment_gateway->gateway_username %>)
- <% $override->taxclass
- ? ' for '. $override->taxclass. ' only'
- : ''
- %>
- <FONT SIZE=-1><A HREF="javascript:areyousure('delete this payment gateway override', '<%$p%>misc/delete-agent_payment_gateway.cgi?<% $override->agentgatewaynum %>')">(delete)</A></FONT>
+ <% $gw_override->payment_gateway->gateway_module %> (<% $gw_override->payment_gateway->gateway_username %>)
+ <FONT SIZE=-1><A HREF="javascript:areyousure('delete this payment gateway override', '<%$p%>misc/delete-agent_payment_gateway.cgi?<% $gw_override->agentgatewaynum %>')">(delete)</A></FONT>
</TD>
</TR>
-% }
-
+% } else {
<TR>
<TD><FONT SIZE=-1><A HREF="<%$p%>edit/agent_payment_gateway.html?agentnum=<% $agent->agentnum %>">(add override)</A></FONT></TD>
</TR>
+% }
</TABLE>
</TD>
diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html
index 41a9f3e95..753bc763c 100644
--- a/httemplate/edit/agent_payment_gateway.html
+++ b/httemplate/edit/agent_payment_gateway.html
@@ -1,6 +1,6 @@
<% include("/elements/header.html","$action payment gateway override for ". $agent->agent, menubar(
#'View all payment gateways' => $p. 'browse/payment_gateway.html',
- 'View all agents' => $p. 'browse/agent.html',
+ 'View all agents' => $p. 'browse/agent.cgi',
)) %>
<% include('/elements/error.html') %>
@@ -20,32 +20,6 @@ Use gateway <SELECT NAME="gatewaynum">
</SELECT>
<BR><BR>
-for <SELECT NAME="cardtype" MULTIPLE>
-% foreach my $cardtype (
-% "",
-% "VISA card",
-% "MasterCard",
-% "Discover card",
-% "American Express card",
-% "Diner's Club/Carte Blanche",
-% "enRoute",
-% "JCB",
-% "BankCard",
-% "Switch",
-% "Solo",
-% 'ACH',
-% 'PayPal',
-%) {
-
- <OPTION VALUE="<% $cardtype %>"><% $cardtype || '(Default fallback)' %>
-% }
-
-</SELECT>
-<BR><BR>
-
-(optional) when invoice contains only items of taxclass <INPUT TYPE="text" NAME="taxclass">
-<BR><BR>
-
<INPUT TYPE="submit" VALUE="Add gateway override">
</FORM>
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index b71558df5..a0023382e 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -247,7 +247,7 @@ Example:
>
<INPUT TYPE="hidden" NAME="svcdb" VALUE="<% $table %>">
- <INPUT TYPE="hidden" NAME="<% $pkey %>" VALUE="<% $clone ? '' : $object->$pkey() %>">
+ <INPUT TYPE="hidden" ID="<% $pkey %>" NAME="<% $pkey %>" VALUE="<% $clone ? '' : $object->$pkey() %>">
<% defined($opt{'form_init'})
? ( ref($opt{'form_init'})
diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html
index b44b31513..f9b8f2415 100644
--- a/httemplate/edit/payment_gateway.html
+++ b/httemplate/edit/payment_gateway.html
@@ -22,6 +22,9 @@
<SCRIPT TYPE="text/javascript">
var modulesForNamespace = <% $json->encode(\%modules) %>;
function changeNamespace() {
+ if (document.getElementById('gatewaynum').value) {
+ return true;
+ }
var ns = document.getElementById('gateway_namespace').value;
var select_module = document.getElementById('gateway_module');
select_module.options.length = 0;
@@ -180,7 +183,13 @@ my $field_callback = sub {
my ($cgi, $object, $field_hashref ) = @_;
if ($object->gatewaynum) {
if ( $field_hashref->{field} eq 'gateway_module' ) {
- $field_hashref->{type} = 'fixed';
+ if ($object->gateway_namespace eq 'Business::OnlinePayment' &&
+ $object->gateway_module ne 'CardFortress'
+ ) {
+ $field_hashref->{options} = [ $object->gateway_module, 'CardFortress' ]
+ } else {
+ $field_hashref->{type} = 'fixed';
+ }
} elsif ( $field_hashref->{field} eq 'gateway_namespace' ) {
$field_hashref->{type} = 'fixed';
$field_hashref->{formatted_value} = $object->namespace_description;
diff --git a/httemplate/edit/process/agent_payment_gateway.html b/httemplate/edit/process/agent_payment_gateway.html
index 5b5fd948a..c9789cff6 100644
--- a/httemplate/edit/process/agent_payment_gateway.html
+++ b/httemplate/edit/process/agent_payment_gateway.html
@@ -10,20 +10,13 @@ die "agentnum $1 not found" unless $agent;
#my $old
-my @new = map {
- my $cardtype = $_;
- new FS::agent_payment_gateway {
+my $new = new FS::agent_payment_gateway {
( map { $_ => scalar($cgi->param($_)) }
fields('agent_payment_gateway')
),
- 'cardtype' => $cardtype,
};
- }
- $cgi->param('cardtype');
-foreach my $new (@new) {
- my $error = $new->insert;
- die $error if $error;
-}
+my $error = $new->insert;
+die $error if $error;
</%init>
diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index e661737bc..16a04f4d9 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -14,12 +14,20 @@
use Class::Load 'load_class';
my $enabled = $FS::TicketSystem::system eq 'RT_Internal';
+$enabled = 0 if $FS::CurrentUser::CurrentUser->option('hide_notify_tickets');
my $UnrepliedTickets;
if ($enabled) {
my $class = 'RT::Search::UnrepliedTickets';
load_class($class);
my $session = FS::TicketSystem->session;
my $CurrentUser = $session->{CurrentUser};
+ # if there are no tickets the current user could see, always hide it
+ my $AnyTickets = RT::Tickets->new($CurrentUser);
+ foreach my $status (qw(resolved rejected deleted)) {
+ $AnyTickets->LimitStatus( OPERATOR => '!=', VALUE => $status );
+ }
+ $enabled = 0 if $AnyTickets->Count == 0;
+
$UnrepliedTickets = RT::Tickets->new($CurrentUser);
my $search = $class->new(TicketsObj => $UnrepliedTickets);
$search->Prepare;
diff --git a/httemplate/misc/taxproduct.cgi b/httemplate/misc/taxproduct.cgi
index b22849343..1533e8810 100644
--- a/httemplate/misc/taxproduct.cgi
+++ b/httemplate/misc/taxproduct.cgi
@@ -5,13 +5,16 @@ my $vendor = $conf->config('tax_data_vendor');
<%init>
my $term = $cgi->param('term');
warn "taxproduct.cgi?$term"; # XXX debug
-my $search = { table => 'part_pkg_taxproduct' };
+my $search = {
+ table => 'part_pkg_taxproduct',
+ hashref => { 'data_vendor' => $vendor }
+};
if ( $term =~ /^\d+$/ ) {
- $search->{extra_sql} = " WHERE taxproduct LIKE '$term%'";
+ $search->{extra_sql} = " AND taxproduct LIKE '$term%'";
$search->{order_by} = " ORDER BY taxproduct ASC";
} elsif ( length($term) ) {
$term = dbh->quote( lc($term) ); # protect against bad strings
- $search->{extra_sql} = " WHERE POSITION($term IN LOWER(description)) > 0";
+ $search->{extra_sql} = " AND POSITION($term IN LOWER(description)) > 0";
# and sort by how close to the beginning of the string it is
$search->{order_by} = " ORDER BY POSITION($term IN LOWER(description)) ASC, LOWER(description) ASC, taxproduct ASC";
}
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index 75e57958f..a87036b36 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -56,6 +56,7 @@ unless ( $error ) { # if ($access_user) {
enable_mask_clipboard_hack dashboard_customers
customer_view_emails
printtofit
+ hide_notify_tickets
email_address
snom-ip snom-username snom-password
vonage-fromnumber vonage-username vonage-password
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index 0f23a0cba..f26d209d6 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -137,6 +137,13 @@
</TR>
<TR>
+ <TH ALIGN="right"><% emt('Hide notification of new ticket activity') %></TH>
+ <TD ALIGN="left">
+ <INPUT TYPE="checkbox" NAME="hide_notify_tickets" VALUE="1" <% $curuser->option('hide_notify_tickets') ? 'CHECKED' : '' %>>
+ </TD>
+ </TR>
+
+ <TR>
<TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
<TD ALIGN="left" COLSPAN=2>
<INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
diff --git a/httemplate/search/elements/grouped-search/core b/httemplate/search/elements/grouped-search/core
index 3d38a8c7e..b15fe8659 100644
--- a/httemplate/search/elements/grouped-search/core
+++ b/httemplate/search/elements/grouped-search/core
@@ -110,7 +110,7 @@ for my $i (0 .. scalar(@groups) - 1) {
push @group_labels, $label;
my @footer;
- if ($opt{'subtotal_row'}) {
+ if ($opt{'subtotal_row'} and @groups > 1) {
for( my $col = 0;
exists($opt{'subtotal_row'}[$col]) or exists($opt{'header'}[$col]);
$col++
diff --git a/httemplate/search/elements/grouped-search/html b/httemplate/search/elements/grouped-search/html
index 9c2418af8..28d00404b 100644
--- a/httemplate/search/elements/grouped-search/html
+++ b/httemplate/search/elements/grouped-search/html
@@ -106,14 +106,18 @@ if ($group_info->{num} > 1) {
&>
<DIV CLASS="fstabcontainer">
+% if ( $group->num_rows > 0 ) {
+<P><% emt('[quant,_1,_2]', $group->num_rows, $opt{name_singular}) %>
+</P>
%# download links
-<P><% emt('Download full results') %><BR>
+<P><% emt('Download results:') %>
% $cgi->param('type', 'xls');
-<A HREF="<% $cgi->self_url %>"><% emt('as Excel spreadsheet') %></A><BR>
+<A HREF="<% $cgi->self_url %>"><% emt('Spreadsheet') %></A>&nbsp;|&nbsp;
% $cgi->param('type', 'html-print');
-<A HREF="<% $cgi->self_url %>"><% emt('as printable copy') %></A><BR>
+<A HREF="<% $cgi->self_url %>"><% emt('webpage') %></A>
% $cgi->delete('type');
</P>
+% }
<% $pager %>