summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/browse')
-rwxr-xr-xhttemplate/browse/agent.cgi20
-rwxr-xr-xhttemplate/browse/agent_type.cgi4
-rw-r--r--httemplate/browse/cdr_carrier.html22
-rw-r--r--httemplate/browse/ftp_target.html56
-rw-r--r--httemplate/browse/msgcat.html2
-rw-r--r--httemplate/browse/part_event.html14
-rwxr-xr-xhttemplate/browse/part_export.cgi63
-rwxr-xr-xhttemplate/browse/part_pkg.cgi121
-rw-r--r--httemplate/browse/part_pkg_usage.html112
-rwxr-xr-xhttemplate/browse/part_svc.cgi27
-rw-r--r--httemplate/browse/rate_region.html8
-rw-r--r--httemplate/browse/upload_target.html49
12 files changed, 398 insertions, 100 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index fc9ce5413..b9190ecb5 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -38,6 +38,10 @@ full offerings (via their type).<BR><BR>
<TH CLASS="grid" BGCOLOR="#cccccc">Ticketing</TH>
% }
+% if ( $conf->config('currencies') ) {
+ <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>Configuration Overrides</FONT></TH>
</TR>
@@ -361,19 +365,23 @@ Unused
<BR><A HREF="<%$p%>edit/prepay_credit.cgi?agentnum=<% $agent->agentnum %>">Generate cards</A>
</TD>
-% if ( $conf->config('ticket_system') ) {
-
+% if ( $conf->config('ticket_system') ) {
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% if ( $agent->ticketing_queueid ) {
-
- Queue: <% $agent->ticketing_queueid %>: <% $agent->ticketing_queue %><BR>
+% if ( $agent->ticketing_queueid ) {
+ Queue: <% $agent->ticketing_queueid %>:
+ <% $agent->ticketing_queue %>
+ <BR>
+% }
+ </TD>
% }
+% if ( $conf->config('currencies') ) {
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <% join('<BR>', sort keys %{ $agent->agent_currency_hashref } ) %>
</TD>
% }
-
<TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
<TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0>
% foreach my $override (
diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi
index 1959302d2..7711dccf7 100755
--- a/httemplate/browse/agent_type.cgi
+++ b/httemplate/browse/agent_type.cgi
@@ -44,9 +44,9 @@ my $agent_type = shift;
[
{
#'data' => $part_pkg->pkg. ' - '. $part_pkg->comment,
- 'data' => $type_pkgs->pkg. ' - '.
+ 'data' => encode_entities($type_pkgs->pkg). ' - '.
( $type_pkgs->custom ? '(CUSTOM) ' : '' ).
- $type_pkgs->comment,
+ encode_entities($type_pkgs->comment),
'align' => 'left',
'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart,
},
diff --git a/httemplate/browse/cdr_carrier.html b/httemplate/browse/cdr_carrier.html
new file mode 100644
index 000000000..3ec95f392
--- /dev/null
+++ b/httemplate/browse/cdr_carrier.html
@@ -0,0 +1,22 @@
+<& elements/browse.html,
+ 'title' => 'Carriers',
+ 'name_singular' => 'carrier',
+ 'menubar' => [ 'Add a new carrier' =>
+ $p.'edit/cdr_carrier.html',
+ ],
+ 'query' => { 'table' => 'cdr_carrier', },
+ 'count_query' => 'SELECT COUNT(*) FROM cdr_carrier',
+ 'header' => [ 'Carrier', ],
+ 'fields' => [ 'carriername', ],
+ 'links' => [ $link, ],
+ 'disableable' => 1,
+ 'disabled_statuspos' => 1,
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $link = [ "${p}edit/cdr_carrier.html?", 'carrierid' ];
+
+</%init>
diff --git a/httemplate/browse/ftp_target.html b/httemplate/browse/ftp_target.html
deleted file mode 100644
index 4a5782058..000000000
--- a/httemplate/browse/ftp_target.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<& elements/browse.html,
- 'title' => 'FTP targets',
- 'menubar' => [ 'Add a target' => $p.'edit/ftp_target.html', ],
- 'name' => 'FTP targets',
- 'query' => { 'table' => 'ftp_target',
- 'hashref' => {},
- },
- 'count_query' => $count_query,
- 'header' => [ '#',
- 'Server',
- 'Username',
- 'Password',
- 'Path',
- 'Protocol',
- '', #handling
- ],
- 'fields' => [ 'targetnum',
- 'hostname',
- 'username',
- 'password',
- 'path',
- sub {
- my $ftp_target = shift;
- my $label;
- if ($ftp_target->secure) {
- $label = 'SFTP';
- $label .= ' (port '.$ftp_target->port.')'
- if $ftp_target->port != 22;
- }
- else {
- $label = 'FTP';
- $label .= ' (port '.$ftp_target->port.')'
- if $ftp_target->port != 21;
- }
- $label;
- },
- 'handling',
- ],
- 'links' => [ $link, $link ],
-&>
-</TABLE>
-
-<% include('/elements/footer.html') %>
-
-<%once>
-
-my $count_query = 'SELECT COUNT(*) FROM ftp_target';
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $link = [ $p.'edit/ftp_target.html?', 'targetnum' ];
-</%init>
diff --git a/httemplate/browse/msgcat.html b/httemplate/browse/msgcat.html
index ac8a3a437..7509cf7d4 100644
--- a/httemplate/browse/msgcat.html
+++ b/httemplate/browse/msgcat.html
@@ -1,5 +1,5 @@
<& elements/browse.html,
- title => mt('Message catalog'),
+ title => mt('Translation strings'),
name_singular => 'string', #mt? no, we need to do it through the quant/PL stuff
query => { 'table' => 'msgcat',
'hashref' => { 'locale' => $locale, },
diff --git a/httemplate/browse/part_event.html b/httemplate/browse/part_event.html
index c06a14fe7..62e7ff0d9 100644
--- a/httemplate/browse/part_event.html
+++ b/httemplate/browse/part_event.html
@@ -47,7 +47,7 @@ my $event_sub = sub {
my $onclick = include('/elements/popup_link_onclick.html',
action => $p.'view/part_event-targets.html?eventpart='.
$part_event->eventpart,
- actionlabel => 'Event query - '.$part_event->event,
+ actionlabel => 'Event query', #no, XSS - '.$part_event->event,
width => 650,
height => 420,
close_text => 'Close',
@@ -55,14 +55,14 @@ my $event_sub = sub {
[#rows
[#subcolumns
{
- 'data' => $part_event->event,
- 'link' => $p.'edit/part_event.html?'.$part_event->eventpart,
+ 'data' => encode_entities($part_event->event),
+ 'link' => $p.'edit/part_event.html?'.$part_event->eventpart,
},
{
- 'data' => ' (query) ',
- 'size' => '-1',
- 'data_style' => 'b',
- 'onclick' => $onclick,
+ 'data' => '&nbsp;(query) ',
+ 'size' => '-1',
+ 'data_style' => 'b',
+ 'onclick' => $onclick,
},
],
];
diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi
index b7ecc00a6..876633afc 100755
--- a/httemplate/browse/part_export.cgi
+++ b/httemplate/browse/part_export.cgi
@@ -38,19 +38,76 @@ function part_export_areyousure(href) {
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $part_export->label_html %>
(<A HREF="<% $p %>edit/part_export.cgi?<% $part_export->exportnum %>">edit</A>&nbsp;|&nbsp;<A HREF="javascript:part_export_areyousure('<% $p %>misc/delete-part_export.cgi?<% $part_export->exportnum %>')">delete</A>)
+% if ( my @actions = $part_export->actions ) {
+ <P STYLE="position: absolute">
+ Management:
+% while (@actions) {
+% my $label = shift @actions;
+% my $path = shift @actions;
+ <& /elements/popup_link.html,
+ 'label' => $label,
+ 'action' => $fsurl.$path.'?'.$part_export->exportnum,
+ 'actionlabel' => $label,
+ &><% @actions ? '&nbsp;|&nbsp;' : '' %>
+% }
+ </P>
+% } #if @actions
+
</TD>
<TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
<% itable() %>
% my %opt = $part_export->options;
-% foreach my $opt ( keys %opt ) {
+% my $defs = $part_export->info->{options};
+% my %multiples;
+% foreach my $opt (keys %$defs) { # is a Tie::IxHash
+% my $group = $defs->{$opt}->{multiple};
+% if ( $group ) {
+% my @values = split("\n", $opt{$opt});
+% $multiples{$group} ||= [];
+% push @{ $multiples{$group} }, [ $opt, @values ] if @values;
+% delete $opt{$opt};
+% } elsif (length($opt{$opt})) { # the normal case
+%# foreach my $opt ( keys %opt ) {
<TR>
<TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $opt %>:&nbsp;</TD>
<TD ALIGN="left" WIDTH="67%"><% encode_entities($opt{$opt}) %></TD>
</TR>
-% }
-
+% delete $opt{$opt};
+% }
+% }
+% # now any that are somehow not in the options list
+% foreach my $opt (keys %opt) {
+% if ( length($opt{$opt}) ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $opt %>:&nbsp;</TD>
+ <TD ALIGN="left" WIDTH="67%"><% encode_entities($opt{$opt}) %></TD>
+ </TR>
+% }
+% }
+% # now show any multiple-option groups
+% foreach (sort keys %multiples) {
+% my $set = $multiples{$_};
+ <TR><TD ALIGN="center" COLSPAN=2><TABLE CLASS="grid">
+ <TR>
+% foreach my $col (@$set) {
+ <TH><% shift @$col %></TH>
+% }
+ </TR>
+% while ( 1 ) {
+ <TR>
+% my $end = 1;
+% foreach my $col (@$set) {
+ <TD><% shift @$col %></TD>
+% $end = 0 if @$col;
+% }
+ </TR>
+% last if $end;
+% }
+ </TABLE></TD></TR>
+% } #foreach keys %multiples
+
</TABLE>
</TD>
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index e3d9de13a..8b50a509f 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -1,6 +1,8 @@
<% include( 'elements/browse.html',
'title' => 'Package Definitions',
+ 'menubar' => \@menubar,
'html_init' => $html_init,
+ 'html_form' => $html_form,
'html_posttotal' => $html_posttotal,
'name' => 'package definitions',
'disableable' => 1,
@@ -20,6 +22,9 @@
'fields' => \@fields,
'links' => \@links,
'align' => $align,
+ 'link_field' => 'pkgpart',
+ 'html_init' => $html_init,
+ 'html_foot' => $html_foot,
)
%>
<%init>
@@ -33,6 +38,7 @@ my $acl_edit_global = $curuser->access_right($edit_global);
my $acl_config = $curuser->access_right('Configuration'); #to edit services
#and agent types
#and bulk change
+my $acl_edit_bulk = $curuser->access_right('Bulk edit package definitions');
die "access denied"
unless $acl_edit || $acl_edit_global;
@@ -130,13 +136,11 @@ $select = "
";
-my $html_init;
-#unless ( $cgi->param('active') ) {
- $html_init = qq!
+my $html_init = qq!
One or more service definitions are grouped together into a package
definition and given pricing information. Customers purchase packages
rather than purchase services directly.<BR><BR>
- <FORM METHOD="POST" ACTION="${p}edit/part_pkg.cgi">
+ <FORM METHOD="GET" ACTION="${p}edit/part_pkg.cgi">
<A HREF="${p}edit/part_pkg.cgi"><I>Add a new package definition</I></A>
or
!.include('/elements/select-part_pkg.html', 'element_name' => 'clone' ). qq!
@@ -144,7 +148,6 @@ my $html_init;
</FORM>
<BR><BR>
!;
-#}
$cgi->param('dummy', 1);
@@ -238,10 +241,10 @@ push @fields, sub {
],
[
{ data =>$money_char.
- sprintf('%.2f', $part_pkg->option('setup_fee') ),
+ sprintf('%.2f ', $part_pkg->option('setup_fee') ),
align=>'right'
},
- { data => ( ( $is_recur ? ' setup' : ' one-time' ).
+ { data => ( ( $is_recur ? ' &nbsp; setup' : ' &nbsp; one-time' ).
( $part_pkg->option('recur_fee') == 0
&& $part_pkg->setup_show_zero
? ' (printed on invoices)'
@@ -254,7 +257,7 @@ push @fields, sub {
[
{ data=>(
$is_recur
- ? $money_char. sprintf('%.2f ', $part_pkg->option('recur_fee'))
+ ? $money_char. sprintf('%.2f', $part_pkg->option('recur_fee'))
: $part_pkg->freq_pretty
),
align=> ( $is_recur ? 'right' : 'center' ),
@@ -262,7 +265,7 @@ push @fields, sub {
},
( $is_recur
? { data => ( $is_recur
- ? $part_pkg->freq_pretty.
+ ? ' &nbsp; '. $part_pkg->freq_pretty.
( $part_pkg->option('recur_fee') == 0
&& $part_pkg->recur_show_zero
? ' (printed on invoices)'
@@ -274,6 +277,18 @@ push @fields, sub {
: ()
),
],
+ ( map { my $dst_pkg = $_->dst_pkg;
+ [
+ { data => 'Supplemental: &nbsp;'.
+ '<A HREF="#'. $dst_pkg->pkgpart . '">' .
+ $dst_pkg->pkg . '</A>',
+ align=> 'center',
+ colspan => 2,
+ }
+ ]
+ }
+ $part_pkg->supp_part_pkg_link
+ ),
( map {
my $dst_pkg = $_->dst_pkg;
[
@@ -423,6 +438,10 @@ if ( $taxclasses ) {
$align .= 'l';
}
+# make a table of report class optionnames => the actual
+my %report_optionname_name = map { 'report_option_'.$_->num, $_->name }
+ qsearch('part_pkg_report_option', { disabled => '' });
+
push @header, 'Plan options',
'Services';
#'Service', 'Quan', 'Primary';
@@ -433,8 +452,18 @@ push @fields,
if ( $part_pkg->plan ) {
my %options = $part_pkg->options;
-
- [ map {
+ # gather any options that are really report options,
+ # convert them to their user-friendly names,
+ # and sort them (I think?)
+ my @report_options =
+ sort { $a cmp $b }
+ map { $report_optionname_name{$_} }
+ grep { $options{$_}
+ and exists($report_optionname_name{$_}) }
+ keys %options;
+
+ my @rows = (
+ map {
[
{ 'data' => "$_: ",
'align' => 'right',
@@ -445,11 +474,30 @@ push @fields,
];
}
grep { $options{$_} =~ /\S/ }
- grep { $_ !~ /^(setup|recur)_fee$/ }
+ grep { $_ !~ /^(setup|recur)_fee$/
+ and $_ !~ /^report_option_\d+$/ }
keys %options
- ];
+ );
+ if ( @report_options ) {
+ push @rows,
+ [ { 'data' => 'Report classes',
+ 'align' => 'center',
+ 'style' => 'font-weight: bold',
+ 'colspan' => 2
+ } ];
+ foreach (@report_options) {
+ push @rows, [
+ { 'data' => $_,
+ 'align' => 'center',
+ 'colspan' => 2
+ }
+ ];
+ } # foreach @report_options
+ } # if @report_options
+
+ return \@rows;
- } else {
+ } else { # should never happen...
[ map { [
{ 'data' => uc($_),
@@ -470,6 +518,8 @@ push @fields,
sub {
my $part_pkg = shift;
+ my @part_pkg_usage = sort { $a->priority <=> $b->priority }
+ $part_pkg->part_pkg_usage;
[
(map {
@@ -512,7 +562,27 @@ push @fields,
]
}
$part_pkg->svc_part_pkg_link
- )
+ ),
+ ( scalar(@part_pkg_usage) ?
+ [ { data => 'Usage minutes',
+ align => 'center',
+ colspan => 2,
+ data_style => 'b',
+ link => $p.'browse/part_pkg_usage.html#pkgpart'.
+ $part_pkg->pkgpart
+ } ]
+ : ()
+ ),
+ ( map {
+ [ { data => $_->minutes,
+ align => 'right'
+ },
+ { data => $_->description,
+ align => 'left'
+ },
+ ]
+ } @part_pkg_usage
+ ),
];
};
@@ -527,4 +597,25 @@ $extra_count = ( $count_extra_sql ? ' AND ' : ' WHERE ' ). $extra_count
if $extra_count;
my $count_query = "SELECT COUNT(*) FROM part_pkg $count_extra_sql $extra_count";
+my $html_form = '';
+my $html_foot = '';
+if ( $acl_edit_bulk ) {
+ # insert a checkbox column
+ push @header, '';
+ push @fields, sub {
+ '<INPUT TYPE="checkbox" NAME="pkgpart" VALUE=' . $_[0]->pkgpart .'>';
+ };
+ push @links, '';
+ $align .= 'c';
+ $html_form = qq!<FORM ACTION="${p}edit/bulk-part_pkg.html" METHOD="POST">!;
+ $html_foot = include('/search/elements/checkbox-foot.html',
+ submit => 'edit report classes', # for now it's only report classes
+ ) . '</FORM>';
+}
+
+my @menubar;
+# show this if there are any voip_cdr packages defined
+if ( FS::part_pkg->count("plan = 'voip_cdr'") ) {
+ push @menubar, 'Per-package usage minutes' => $p.'browse/part_pkg_usage.html';
+}
</%init>
diff --git a/httemplate/browse/part_pkg_usage.html b/httemplate/browse/part_pkg_usage.html
new file mode 100644
index 000000000..209fd3a01
--- /dev/null
+++ b/httemplate/browse/part_pkg_usage.html
@@ -0,0 +1,112 @@
+<& /elements/header.html, 'Package usage minutes' &>
+<& /elements/menubar.html, 'Package definitions', $p.'browse/part_pkg.cgi' &>
+<STYLE TYPE="text/css">
+.pkg_head {
+ background-color: #dddddd;
+ font-style: italic;
+}
+.pkg_head > td {
+ border-style: solid;
+ border-radius: 3px;
+ border-color: #555555;
+ border-width: 1px;
+}
+.usage > td {
+ text-align: center;
+}
+.error {
+ color: #ff0000;
+}
+</STYLE>
+<FORM METHOD="POST" ACTION="<%$fsurl%>edit/process/part_pkg_usage.html">
+ <TABLE STYLE="margin-top: 1em">
+ <TR>
+ <TH>Minutes</TH>
+ <TH>Shared</TH>
+ <TH>Rollover</TH>
+ <TH>Description</TH>
+ <TH>Priority</TH>
+% foreach my $class (@usage_class) {
+ <TH><% $class->classname %></TH>
+% }
+ </TR>
+
+% my $error = $cgi->param('error');
+% foreach my $part_pkg (@part_pkg) {
+% my $pkgpart = $part_pkg->pkgpart;
+% my @part_pkg_usage;
+% if ( $error ) {
+% @part_pkg_usage = @{ $error->{$pkgpart} };
+% } else {
+% @part_pkg_usage = $part_pkg->part_pkg_usage;
+% foreach my $usage (@part_pkg_usage) {
+% foreach ($usage->classnums) {
+% $usage->set("class$_".'_', 'Y');
+% }
+% }
+% }
+ <TR CLASS="pkg_head" ID="pkgpart<%$pkgpart%>">
+ <TD COLSPAN=<%$n_cols%>><% $part_pkg->pkg_comment %></TD>
+% # make it easy to enumerate the pkgparts later
+ <INPUT TYPE="hidden" NAME="pkgpart" VALUE="<% $pkgpart %>">
+ </TR>
+% # template row
+ <TR id="pkgpart<%$pkgpart%>_template" CLASS="usage">
+ <TD>
+ <INPUT TYPE="hidden" NAME="pkgusagepart">
+ <INPUT TYPE="text" NAME="minutes" ID="minutes" SIZE=7>
+ </TD>
+% foreach (qw(shared rollover)) {
+ <TD>
+ <INPUT TYPE="checkbox" NAME="<% $_ %>" ID="<% $_ %>" VALUE="Y">
+ </TD>
+% }
+ <TD>
+ <INPUT TYPE="text" NAME="description" ID="description" SIZE=20>
+ </TD>
+ <TD>
+ <INPUT TYPE="text" NAME="priority" ID="priority" SIZE=3>
+ </TD>
+% foreach (@usage_class) {
+% my $classnum = 'class' . $_->classnum . '_';
+ <TD>
+ <INPUT TYPE="checkbox" NAME="<% $classnum %>" ID="<% $classnum %>" VALUE="Y">
+ </TD>
+% }
+ </TR>
+ <& /elements/auto-table.html,
+ table => "pkgpart$pkgpart",
+ template_row => "pkgpart$pkgpart".'_template',
+ data => \@part_pkg_usage,
+ &>
+% }
+ </TABLE>
+ <BR>
+ <INPUT TYPE="submit">
+</FORM>
+<& /elements/footer.html &>
+<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+die "access denied"
+ unless $curuser->access_right(
+ ['Edit package definitions', 'Edit global package definitions']
+ );
+
+my @where = ("(plan = 'voip_cdr' OR plan = 'voip_inbound')",
+ "freq != '0'",
+ "disabled IS NULL");
+push @where, FS::part_pkg->curuser_pkgs_sql
+ unless $curuser->access_right('Edit global package definitions');
+my $extra_sql = ' WHERE '.join(' AND ', @where);
+my @part_pkg = qsearch({
+ 'table' => 'part_pkg',
+ 'extra_sql' => $extra_sql,
+ 'order_by' => ' ORDER BY pkgpart',
+});
+
+my @usage_class = sort { $a->weight <=> $b->weight }
+ qsearch('usage_class', { disabled => '' });
+
+my $n_usage_classes = scalar(@usage_class);
+my $n_cols = $n_usage_classes + 5; # minutes, shared, rollover, desc, prio
+</%init>
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index a8f4a7c84..0d3685355 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -82,6 +82,7 @@ function part_export_areyousure(href) {
% }
% @dfields ;
% my $rowspan = scalar(@fields) || 1;
+% $rowspan++ if $part_svc->restrict_edit_password;
% my $url = "${p}edit/part_svc.cgi?". $part_svc->svcpart;
%
% if ( $bgcolor eq $bgcolor1 ) {
@@ -174,24 +175,32 @@ function part_export_areyousure(href) {
% my $value = &$formatter($part_svc->part_svc_column($field)->columnvalue);
% if ( $flag =~ /^[MAH]$/ ) {
% my $select_table = ($flag eq 'H') ? 'hardware_class' : 'inventory_class';
-% $select_class{$value} ||=
-% qsearchs($select_table, { 'classnum' => $value } );
+% foreach my $classnum ( split(',', $value) ) {
+% $select_class{$classnum} =
+% qsearchs($select_table, { 'classnum' => $classnum } );
%
- <% $select_class{$value}
- ? $select_class{$value}->classname
- : "WARNING: $select_table.classnum $value not found" %>
+ <% $select_class{$classnum}
+ ? $select_class{$classnum}->classname
+ : "WARNING: $select_table.classnum $classnum not found" %><BR>
+% }
% } else {
<% $value %>
-% }
+% }
</TD>
% $n1="</TR><TR>";
-% }
-%
+% } #foreach $field
+% if ( $part_svc->restrict_edit_password ) {
+ <TR>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" COLSPAN=4 ALIGN="left">
+ <B><% emt('Password editing restricted.') %></B>
+ </TD>
+ </TR>
+% }
</TR>
-% }
+% } #foreach $part_svc
</TABLE>
</BODY>
diff --git a/httemplate/browse/rate_region.html b/httemplate/browse/rate_region.html
index b958894cb..b0ce467c0 100644
--- a/httemplate/browse/rate_region.html
+++ b/httemplate/browse/rate_region.html
@@ -62,8 +62,14 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $sub_prefixes = sub {
+ my $region = shift;
+ $region->prefixes .
+ ($region->exact_match ? ' <I>(exact match only)</I>' : '');
+};
+
my @header = ( '#', 'Region', 'Country code', 'Prefixes' );
-my @fields = ( 'regionnum', 'regionname', 'ccode', 'prefixes' );
+my @fields = ( 'regionnum', 'regionname', 'ccode', $sub_prefixes );
my @links = ( ($link) x 4 );
my @align = ( 'right', 'left', 'right', 'left' );
my @xls_format = ( ({ locked=>1, bg_color=>22 }) x 4 );
diff --git a/httemplate/browse/upload_target.html b/httemplate/browse/upload_target.html
new file mode 100644
index 000000000..e166f3520
--- /dev/null
+++ b/httemplate/browse/upload_target.html
@@ -0,0 +1,49 @@
+<& elements/browse.html,
+ 'title' => 'Upload targets',
+ 'menubar' => [ 'Add a target' => $p.'edit/upload_target.html', ],
+ 'name' => 'targets',
+ 'query' => { 'table' => 'upload_target',
+ 'hashref' => {},
+ },
+ 'count_query' => $count_query,
+ 'header' => [ '#',
+ 'Protocol',
+ 'Username',
+ 'Server/Domain',
+ 'Password',
+ 'Path',
+ '', #handling
+ ],
+ 'fields' => [ 'targetnum',
+ sub {
+ my $target = shift;
+ $label{$target->protocol}
+ },
+ 'username',
+ 'hostname',
+ 'password',
+ 'path',
+ 'handling',
+ ],
+ 'links' => [ $link, $link, $link, $link, ],
+&>
+</TABLE>
+
+<% include('/elements/footer.html') %>
+
+<%once>
+
+my $count_query = 'SELECT COUNT(*) FROM upload_target';
+my %label = (
+ email => 'Email',
+ ftp => 'FTP',
+ sftp => 'SFTP',
+);
+</%once>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $link = [ $p.'edit/upload_target.html?', 'targetnum' ];
+</%init>