summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/part_svc.cgi20
-rw-r--r--httemplate/edit/elements/part_svc_column.html5
-rwxr-xr-xhttemplate/edit/part_pkg.cgi85
-rwxr-xr-xhttemplate/edit/part_svc.cgi52
-rw-r--r--httemplate/edit/process/elements/process.html21
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi5
-rw-r--r--httemplate/edit/process/quotation_convert.html7
-rwxr-xr-xhttemplate/edit/svc_acct.cgi32
-rw-r--r--httemplate/edit/svc_acct/communigate.html2
-rw-r--r--httemplate/elements/freeside.css2
-rw-r--r--httemplate/elements/header-full.html3
-rw-r--r--httemplate/elements/header-popup.html3
-rw-r--r--httemplate/elements/printtofit.js26
-rw-r--r--httemplate/elements/progress-init.html14
-rw-r--r--httemplate/elements/select-rt-customfield.html34
-rw-r--r--httemplate/elements/select-rt-queue.html24
-rw-r--r--httemplate/elements/select-terms.html5
-rw-r--r--httemplate/elements/tr-input-locale-text.html120
-rw-r--r--httemplate/elements/tr-select-router_block_ip.html2
-rw-r--r--httemplate/elements/xmlhttp.html2
-rw-r--r--httemplate/pref/pref-process.html1
-rw-r--r--httemplate/pref/pref.html9
-rwxr-xr-xhttemplate/search/elements/cust_pay_or_refund.html179
-rwxr-xr-xhttemplate/view/quotation.html2
-rw-r--r--httemplate/view/svc_acct/basics.html32
25 files changed, 378 insertions, 309 deletions
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index dee439466..b9474636d 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -112,8 +112,24 @@ function part_export_areyousure(href) {
</TD>
% }
- <TD ROWSPAN=<% $rowspan %> CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<% $url %>">
- <% $part_svc->svc %></A></TD>
+ <TD ROWSPAN=<% $rowspan %> CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <A HREF="<% $url %>">
+ <% $part_svc->svc %>
+ </A>
+% # any alternate names of the service
+% my %msgcat = map { $_->locale => $_ } $part_svc->part_svc_msgcat;
+% my %labels = map { $_ => FS::Locales->description($_) } keys %msgcat;
+% my @locales = sort { $labels{$a} cmp $labels{$b} } keys %msgcat;
+% if ( @locales ) {
+ <BR>
+ <FONT SIZE="-1">
+% foreach my $locale (@locales) {
+ <% $labels{$locale} %>: <% $msgcat{$locale}->get('svc') %>
+ <BR>
+% }
+ </FONT>
+% }
+ </TD>
<TD ROWSPAN=<% $rowspan %> CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $svcdb %></TD>
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html
index 4e112c078..816f3428b 100644
--- a/httemplate/edit/elements/part_svc_column.html
+++ b/httemplate/edit/elements/part_svc_column.html
@@ -267,8 +267,9 @@ my %communigate_fields = (
<& /elements/progress-init.html,
$svcdb, #form name
[ # form fields to send
- qw(svc svcpart classnum selfservice_access disabled preserve exportnum),
- @fields
+ 'ALL'
+# qw(svc svcpart classnum selfservice_access disabled preserve exportnum),
+# @fields
],
'process/part_svc.cgi', # target
$p.'browse/part_svc.cgi', # redirect landing
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 80a61f813..7fe659f94 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -92,7 +92,7 @@
{ type => 'columnstart' },
{ field => 'pkg',
- type => 'text',
+ type => 'input-locale-text',
size => 40, #32
maxlength => 50,
},
@@ -495,42 +495,6 @@ my $recur_show_zero_disabled = 1;
my $pkgpart = '';
-my $splice_locale_fields = sub {
- my( $fields, $pkey_value_callback, $pkg_value_callback ) = @_;
-
- my $n = 0;
- my @locale_fields = (
- map {
- my $pkey_value= $pkey_value_callback ? &$pkey_value_callback($_) : '';
- my $pkg_value = $pkg_value_callback
- ? $pkg_value_callback eq 'cgiparam'
- ? $cgi->param('pkgpartmsgnum'. $n. '_pkg')
- : &$pkg_value_callback($_)
- : '';
- (
- { field => 'pkgpartmsgnum'. $n,
- type => 'hidden',
- value => $pkey_value,
- },
- { field => 'pkgpartmsgnum'. $n. '_locale',
- type => 'hidden',
- value => $_,
- },
- { field => 'pkgpartmsgnum'. $n++. '_pkg',
- type => 'text',
- size => 40,
- #maxlength => 50,
- value => $pkg_value,
- },
- );
-
- }
- @locales
- );
- splice(@$fields, 7, 0, @locale_fields); #XXX 7 is arbitrary above
-
-};
-
my $error_callback = sub {
my($cgi, $object, $fields, $opt ) = @_;
@@ -579,16 +543,6 @@ my $error_callback = sub {
$pkgpart = $object->pkgpart;
- &$splice_locale_fields(
- $fields,
- sub {
- my $locale = shift;
- my $part_pkg_msgcat = $object->part_pkg_msgcat($locale);
- $part_pkg_msgcat ? $part_pkg_msgcat->pkgpartmsgnum : '';
- },
- 'cgiparam'
- );
-
if ( $cgi->param('error') =~ / is suggested with / ) {
#yeah, detection is a shitty kludge, but we don't have exception objects
$opt->{form_init} = '<INPUT TYPE="checkbox" NAME="part_pkg_restrict_soft_override" VALUE="Y"> Override suggestion<BR><BR>';
@@ -665,20 +619,6 @@ my $edit_callback = sub {
$pkgpart = $object->pkgpart;
- &$splice_locale_fields(
- $fields,
- sub {
- my $locale = shift;
- my $part_pkg_msgcat = $object->part_pkg_msgcat($locale);
- $part_pkg_msgcat ? $part_pkg_msgcat->pkgpartmsgnum : '';
- },
- sub {
- my $locale = shift;
- my $part_pkg_msgcat = $object->part_pkg_msgcat($locale);
- $part_pkg_msgcat ? $part_pkg_msgcat->pkg : '';
- }
- );
-
};
my $new_callback = sub {
@@ -692,8 +632,6 @@ my $new_callback = sub {
$options{'suspend_bill'}=1 if $conf->exists('part_pkg-default_suspend_bill');
- &$splice_locale_fields($fields, '', '');
-
};
my $clone_callback = sub {
@@ -732,17 +670,6 @@ my $clone_callback = sub {
foreach keys %part_pkg_currency;
}
- $recur_disabled = $object->freq ? 0 : 1;
-
- &$splice_locale_fields(
- $fields,
- '',
- sub {
- my $locale = shift;
- my $part_pkg_msgcat = $object->part_pkg_msgcat($locale);
- $part_pkg_msgcat ? $part_pkg_msgcat->pkg : '';
- }
- );
};
my $discount_error_callback = sub {
@@ -1061,6 +988,16 @@ my $html_bottom = sub {
: ''
). '>';
+ } elsif ( $href->{$field}{'type'} =~ /^select-rt-/ ) {
+
+ $html .= include('/elements/'.$href->{$field}{'type'}.'.html',
+ 'name' => $layer.'__'.$field,
+ 'curr_value' => $options{$field},
+ map { $_ => $href->{$field}{$_} }
+ grep { $_ !~ /^(name|type|parse)$/ }
+ keys %{ $href->{$field} }
+ );
+
} elsif ( $href->{$field}{'type'} eq 'select-rate' ) {
$html .= include('/elements/select-rate.html',
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
index a07fc6005..fed21256f 100755
--- a/httemplate/edit/part_svc.cgi
+++ b/httemplate/edit/part_svc.cgi
@@ -36,9 +36,26 @@
}
</STYLE>
<SCRIPT TYPE="text/javascript">
+// copy all fields from the outer form (svc and its localizations, plus
+// preserve, selfservice_access, etc.) into the inner form, creating hidden
+// inputs if needed
function fixup_submit(layer) {
- document.forms[layer].submit.disabled = true;
- fixup(document.forms[layer]);
+ var layer_form = $(document.forms[layer]);
+ var main_form = $(document.forms['SvcEditMain']);
+ var data = main_form.serializeArray();
+ for (var i = 0; i < data.length; i++) {
+ var input = layer_form.children('[name=' + data[i].name + ']');
+ if (input[0]) {
+ input.prop('value', data[i].value);
+ } else {
+ $( '<input type="hidden">' )
+ .attr('name', data[i].name)
+ .prop('value', data[i].value)
+ .appendTo(layer_form);
+ }
+ }
+ layer_form[0]['submit'].disabled = true;
+ //fixup(document.forms[layer]);
window[layer+'process'].call();
}
@@ -141,19 +158,26 @@ window.onload = function() {
</SCRIPT>
-<FORM NAME="dummy">
+<FORM NAME="SvcEditMain">
<FONT CLASS="fsinnerbox-title">Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %></FONT>
<TABLE CLASS="fsinnerbox">
-<TR>
- <TD ALIGN="right">Service</TD>
- <TD><INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"></TD>
-<TR>
+<& /elements/tr-input-locale-text.html,
+ 'object' => $part_svc,
+ 'cgi' => $cgi,
+ 'field' => 'svc',
+ 'label' => 'Service',
+ 'curr_value' => $hashref->{svc},
+&>
+%#<TR>
+%# <TD ALIGN="right">Service</TD>
+%# <TD><INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"></TD>
+%#<TR>
<& /elements/tr-select-part_svc_class.html, curr_value=>$hashref->{classnum} &>
<TR>
- <TD ALIGN="right">Self-service access</TD>
+ <TH ALIGN="right">Self-service access</TD>
<TD>
<SELECT NAME="selfservice_access">
% tie my %selfservice_access, 'Tie::IxHash', #false laziness w/browse/part_svc
@@ -172,12 +196,12 @@ window.onload = function() {
<TR>
- <TD ALIGN="right">Disable new orders</TD>
+ <TH ALIGN="right">Disable new orders</TD>
<TD><INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<% $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>></TD>
</TR>
<TR>
- <TD ALIGN="right">Preserve this service on package cancellation</TD>
+ <TH ALIGN="right">Preserve this service on package cancellation</TD>
<TD><INPUT TYPE="checkbox" NAME="preserve" VALUE="Y"<% $hashref->{'preserve'} eq 'Y' ? ' CHECKED' : '' %>>&nbsp;</TD>
</TR>
@@ -240,12 +264,12 @@ my $widget = new HTML::Widgets::SelectLayers(
#'selected_layer' => $p_svcdb,
'selected_layer' => $hashref->{svcdb} || 'svc_acct',
'options' => \%svcdb,
- 'form_name' => 'dummy',
+ 'form_name' => 'SvcEditMain',
#'form_action' => 'process/part_svc.cgi',
'form_action' => 'part_svc.cgi', #self
- 'form_elements' => [qw( svc svcpart classnum selfservice_access
- disabled preserve
- )],
+# 'form_elements' => [qw( svc svcpart classnum selfservice_access
+# disabled preserve
+# )],
'html_between' => $help,
'layer_callback' => sub {
include('elements/part_svc_column.html',
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index fd12c61d9..60aaf749a 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -62,6 +62,8 @@ Example:
'fields' => [qw( fieldname fieldname2 )],
},
+ 'process_locale' => 'fieldname', # update entries in the _msgcat table
+
'process_upload' => {
'process' => 'misc/mytable-import.html',
# fields to pass to the back end job, besides the
@@ -363,12 +365,21 @@ foreach my $value ( @values ) {
}
- if ( !$error && $opt{'process_o2m'} ) {
-
- my @process_o2m = ref($opt{'process_o2m'}) eq 'ARRAY'
- ? @{ $opt{'process_o2m'} }
- : ( $opt{'process_o2m'} );
+ my @process_o2m;
+ if ( $opt{'process_o2m'} ) {
+ @process_o2m = ref($opt{'process_o2m'}) eq 'ARRAY'
+ ? @{ $opt{'process_o2m'} }
+ : ( $opt{'process_o2m'} );
+ }
+ if ( $opt{'process_locale'} ) {
+ push @process_o2m,
+ {
+ 'table' => $table . '_msgcat',
+ 'fields' => [ 'locale', $opt{'process_locale'} ],
+ };
+ }
+ if ( !$error ) {
foreach my $process_o2m (@process_o2m) {
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
index b8042026a..c4d150ba1 100755
--- a/httemplate/edit/process/part_pkg.cgi
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -9,6 +9,7 @@
'edit_ext' => 'cgi',
'precheck_callback' => $precheck_callback,
'args_callback' => $args_callback,
+ 'process_locale' => 'pkg',
'process_m2m' => \@process_m2m,
'process_o2m' => \@process_o2m,
)
@@ -310,10 +311,6 @@ foreach my $amount_param ( grep /^usagepricepart(\d+)_amount$/, $cgi->param ) {
my @process_o2m = (
{
- 'table' => 'part_pkg_msgcat',
- 'fields' => [qw( locale pkg )],
- },
- {
'table' => 'part_pkg_usageprice',
'fields' => [qw( price currency action target amount )],
diff --git a/httemplate/edit/process/quotation_convert.html b/httemplate/edit/process/quotation_convert.html
index dc00a88d3..26b5294f7 100644
--- a/httemplate/edit/process/quotation_convert.html
+++ b/httemplate/edit/process/quotation_convert.html
@@ -10,9 +10,12 @@ my $quotation = qsearchs( 'quotation' => {
quotationnum => scalar( $cgi->param('quotationnum') ),
} ) or die 'unknown quotationnum';
+my $params = {};
+$$params{'onhold'} = $cgi->param('onhold') ? 1 : 0;
+
my $cust_main = $quotation->cust_main;
if ( $cust_main ) {
- my $error = $quotation->order;
+ my $error = $quotation->order(undef,$params);
errorpage($error) if $error;
#i should be part of the order transaction
@@ -20,7 +23,7 @@ if ( $cust_main ) {
$quotation->replace;
} else {
- $cust_main = $quotation->convert_cust_main;
+ $cust_main = $quotation->convert_cust_main( $params );
errorpage($cust_main) unless ref($cust_main);# eq 'FS::cust_main';
}
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index ca26c6cf0..7be5eabb7 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -31,7 +31,7 @@
</TR>
<% include('/elements/tr-td-label.html',
- 'label' => mt('Username'),
+ 'label' => $part_svc->part_svc_column('username')->columnlabel || mt('Username'),
'required' => $part_svc->part_svc_column('username')->required ) %>
% if ( $svcnum && $conf->exists('svc_acct-no_edit_username') ) {
<TD BGCOLOR="#eeeeee"><% $svc_acct->username() %></TD>
@@ -46,7 +46,7 @@
%if ( $part_svc->part_svc_column('_password')->columnflag ne 'F' ) {
% #XXX eventually should require "Edit Password" ACL
<% include('/elements/tr-td-label.html',
- 'label' => mt('Password'),
+ 'label' => $part_svc->part_svc_column('_password')->columnlabel || mt('Password'),
'required' => $part_svc->part_svc_column('_password')->required ) %>
<TD>
<INPUT TYPE="text" ID="clear_password" NAME="clear_password" VALUE="<% $password %>" SIZE=<% $pmax2 %> MAXLENGTH=<% $pmax %>>
@@ -68,7 +68,7 @@
% && $part_svc->part_svc_column('sec_phrase')->columnflag ne 'F' ) {
<% include('/elements/tr-td-label.html',
- 'label' => mt('Security phrase'),
+ 'label' => $part_svc->part_svc_column('sec_phrase')->columnlabel || mt('Security phrase'),
'required' => $part_svc->part_svc_column('sec_phrase')->required ) %>
<TD>
<INPUT TYPE="text" NAME="sec_phrase" VALUE="<% $sec_phrase %>" SIZE=32>
@@ -106,7 +106,7 @@
% );
<% include('/elements/tr-td-label.html',
- 'label' => mt('Domain'),
+ 'label' => $part_svc->part_svc_column('domsvc')->columnlabel || mt('Domain'),
'required' => $part_svc->part_svc_column('domsvc')->required ) %>
<TD>
<SELECT NAME="domsvc" SIZE=1>
@@ -142,6 +142,7 @@
'curr_value' => $svc_acct->pbxsvc,
'part_svc' => $part_svc,
'cust_pkg' => $cust_pkg,
+ 'label' => $part_svc->part_svc_column('pbxsvc')->columnlabel || 'PBX',
&>
%#pop
@@ -153,7 +154,7 @@
% } else {
<% include('/elements/tr-td-label.html',
- 'label' => mt('Access number'),
+ 'label' => $part_svc->part_svc_column('popnum')->columnlabel || mt('Access number'),
'required' => $part_svc->part_svc_column('popnum')->required ) %>
<TD><% FS::svc_acct_pop::popselector($popnum) %></TD>
</TR>
@@ -167,6 +168,7 @@
#'part_svc' => $part_svc,
#'cust_pkg' => $cust_pkg,
'required' => $part_svc->part_svc_column('sectornum')->required,
+ 'label' => $part_svc->part_svc_column('sectornum')->columnlabel || mt('Tower sector'),
&>
%} else {
<INPUT TYPE="hidden" NAME="sectornum" VALUE="<% $svc_acct->sectornum %>">
@@ -188,10 +190,10 @@
% if ( length($svc_acct->$xid()) ) {
<% include('/elements/tr-td-label.html',
- 'label' => uc($xid),
+ 'label' => $part_svc->part_svc_column($xid)->columnlabel || uc($xid),
'required' => $part_svc->part_svc_column($xid)->required ) %>
- <TR>
- <TD ALIGN="right"><% uc($xid) %></TD>
+%# <TR>
+%# <TD ALIGN="right"><% uc($xid) %></TD>
<TD BGCOLOR="#eeeeee"><% $svc_acct->$xid() %></TD>
<TD>
</TD>
@@ -202,7 +204,7 @@
% } else {
<% include('/elements/tr-td-label.html',
- 'label' => uc($xid),
+ 'label' => $part_svc->part_svc_column($xid)->columnlabel || uc($xid),
'required' => $part_svc->part_svc_column($xid)->required ) %>
<TD>
<INPUT TYPE="text" NAME="<% $xid %>" SIZE=8 MAXLENGTH=6 VALUE="<% $svc_acct->$xid() %>">
@@ -221,7 +223,7 @@
<% include('/elements/tr-td-label.html',
- 'label' => mt('Real Name'),
+ 'label' => $part_svc->part_svc_column('finger')->columnlabel || mt('Real Name'),
'required' => $part_svc->part_svc_column('finger')->required ) %>
<TD>
<INPUT TYPE="text" NAME="finger" VALUE="<% $svc_acct->finger %>">
@@ -240,7 +242,7 @@
<% include('/elements/tr-td-label.html',
- 'label' => mt('Home directory'),
+ 'label' => $part_svc->part_svc_column('dir')->columnlabel || mt('Home directory'),
'required' => $part_svc->part_svc_column('dir')->required ) %>
<TD><INPUT TYPE="text" NAME="dir" VALUE="<% $svc_acct->dir %>"></TD>
</TR>
@@ -258,7 +260,7 @@
<% include('/elements/tr-td-label.html',
- 'label' => mt('Shell'),
+ 'label' => $part_svc->part_svc_column('shell')->columnlabel || mt('Shell'),
'required' => $part_svc->part_svc_column('shell')->required ) %>
<TD>
<SELECT NAME="shell" SIZE=1>
@@ -289,7 +291,9 @@
'object' => $svc_acct,
'ip_field' => 'slipip',
'required' => $part_svc->part_svc_column('routernum')->required,
+ 'label' => $part_svc->part_svc_column('routernum')->columnlabel,
'ip_addr_required' => $part_svc->part_svc_column('slipip')->required,
+ 'ip_addr_label' => $part_svc->part_svc_column('slipip')->columnlabel,
&>
% } else {
% # don't expose these to the user--they're only useful in the other case
@@ -299,7 +303,7 @@
<INPUT TYPE="hidden" NAME="slipip" VALUE="<% $svc_acct->slipip %>">
% } else {
<% include('/elements/tr-td-label.html',
- 'label' => mt('IP'),
+ 'label' => $part_svc->part_svc_column('slipip')->columnlabel || mt('IP'),
'required' => $part_svc->part_svc_column('slipip')->required ) %>
<TD><INPUT TYPE="text" NAME="slipip" VALUE="<% $svc_acct->slipip %>"></TD>
</TR>
@@ -346,7 +350,7 @@
<% include('/elements/tr-td-label.html',
- 'label' => mt('RADIUS groups'),
+ 'label' => $part_svc->part_svc_column('usergroup')->columnlabel || mt('RADIUS groups'),
'required' => $part_svc->part_svc_column('usergroup')->required ) %>
% if ( $part_svc_usergroup->columnflag eq 'F' ) {
<TD BGCOLOR="#eeeeee"><% join('<BR>', @groupnames) %></TD>
diff --git a/httemplate/edit/svc_acct/communigate.html b/httemplate/edit/svc_acct/communigate.html
index 370bfb0e7..544d00be3 100644
--- a/httemplate/edit/svc_acct/communigate.html
+++ b/httemplate/edit/svc_acct/communigate.html
@@ -46,7 +46,7 @@
% if ( $part_svc->part_svc_column('quota')->columnflag eq 'F' ) {
<INPUT TYPE="hidden" NAME="quota" VALUE="<% $svc_acct->quota %>">
% } else {
-% my $quota_label = $communigate ? 'Mail storage limit' : 'Quota';
+% my $quota_label = $communigate ? 'Mail storage limit' : ($part_svc->part_svc_column('quota')->columnlabel || 'Quota');
<% include('/elements/tr-td-label.html',
'label' => $quota_label,
'required' => $part_svc->part_svc_column('quota')->required ) %>
diff --git a/httemplate/elements/freeside.css b/httemplate/elements/freeside.css
index fb5e7d961..cc104a196 100644
--- a/httemplate/elements/freeside.css
+++ b/httemplate/elements/freeside.css
@@ -235,7 +235,7 @@ div.fstabcontainer {
.fsinnerbox th {
font-weight:normal;
font-size:80%;
- valign: bottom;
+ vertical-align: bottom;
color: #666666;
}
diff --git a/httemplate/elements/header-full.html b/httemplate/elements/header-full.html
index db38eafba..07595a539 100644
--- a/httemplate/elements/header-full.html
+++ b/httemplate/elements/header-full.html
@@ -47,6 +47,9 @@ Example:
<link rel="stylesheet" href="<% $fsurl %>elements/jquery-ui.min.css">
<SCRIPT SRC="<% $fsurl %>elements/jquery.js"></SCRIPT>
<SCRIPT SRC="<% $fsurl %>elements/jquery-ui.min.js"></SCRIPT>
+% if ( $FS::CurrentUser::CurrentUser->option('printtofit') ) {
+ <SCRIPT SRC="<% $fsurl %>elements/printtofit.js"></SCRIPT>
+% }
% }
<% include('init_overlib.html') |n %>
<% include('rs_init_object.html') |n %>
diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html
index 17593693e..6c0f80b37 100644
--- a/httemplate/elements/header-popup.html
+++ b/httemplate/elements/header-popup.html
@@ -30,6 +30,9 @@ Example:
<META HTTP-Equiv="Expires" Content="0">
% unless ( $no_jquery ) {
<SCRIPT SRC="<% $fsurl %>elements/jquery.js"></SCRIPT>
+% if ( $FS::CurrentUser::CurrentUser->option('printtofit') ) {
+ <SCRIPT SRC="<% $fsurl %>elements/printtofit.js"></SCRIPT>
+% }
% }
<% $head |n %>
</HEAD>
diff --git a/httemplate/elements/printtofit.js b/httemplate/elements/printtofit.js
new file mode 100644
index 000000000..66257fca8
--- /dev/null
+++ b/httemplate/elements/printtofit.js
@@ -0,0 +1,26 @@
+$().ready(function() {
+ var beforePrint = function() {
+ if ($('body').width() > 0) {
+ // 7.5 inches * 96 DPI; maybe make the width a user pref?
+ var maxwidth = 7.5 * 96;
+ $('body').css('zoom', maxwidth / $('body').width());
+ }
+ };
+ var afterPrint = function() {
+ $('body').css('zoom', 1);
+ }
+
+ if (window.matchMedia) { // chrome, most importantly; also IE10?
+ window.matchMedia('print').addListener(
+ function(mq) {
+ mq.matches ? beforePrint() : afterPrint();
+ }
+ );
+ } else { // other IE
+ $(window).on('beforeprint', beforePrint);
+ $(window).on('afterprint', afterPrint);
+ }
+ // got nothing for firefox
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=774398
+ // but firefox already has "shrink to fit"
+});
diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html
index e38dde65f..0c2b8165a 100644
--- a/httemplate/elements/progress-init.html
+++ b/httemplate/elements/progress-init.html
@@ -98,14 +98,14 @@ function <%$key%>process () {
overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
+ // jQuery .serializeArray() maybe?
+ var copy_fields = <% encode_json(\%copy_fields) %>;
var Hash = new Array();
var x = 0;
var fieldName;
for (var i = 0; i<document.<%$formname%>.elements.length; i++) {
field = document.<%$formname%>.elements[i];
- if ( <% join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %>
- )
- {
+ if ( <% $all_fields %> || copy_fields[ field.name ] ) {
if ( field.type == 'select-multiple' ) {
//alert('select-multiple ' + field.name);
for (var j=0; j < field.options.length; j++) {
@@ -168,6 +168,14 @@ $progress_url->query_form(
%dest_info,
);
+my $all_fields = 0;
+my %copy_fields;
+if (grep '/^ALL$/', @$fields) {
+ $all_fields = 1;
+} else {
+ %copy_fields = map { $_ => 1 } @$fields;
+}
+
#stupid safari is caching the "location" of popup iframs, and submitting them
#instead of displaying them. this should prevent that.
my $popup_name = 'popup-'.random_id();
diff --git a/httemplate/elements/select-rt-customfield.html b/httemplate/elements/select-rt-customfield.html
index 85758d585..488accac3 100644
--- a/httemplate/elements/select-rt-customfield.html
+++ b/httemplate/elements/select-rt-customfield.html
@@ -1,31 +1,27 @@
-<SELECT NAME="<% $opt{name} %>">
+<SELECT NAME="<% $opt{'name'} %>"<% $opt{'multiple'} ? ' MULTIPLE' : '' %>>
% while ( @fields ) {
-<OPTION VALUE="<% shift @fields %>"><% shift @fields %></OPTION>
+% my $value = shift @fields;
+% my $label = shift @fields;
+<OPTION VALUE="<% $value %>"<% $curr_value{$value} ? ' SELECTED' : '' %>><% $label %></OPTION>
% }
</SELECT>
<%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 %curr_value = map { $_ => 1 } split(', ',$opt{'curr_value'});
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);
+my $conf = new FS::Conf;
+
+if ($conf->config('ticket_system') eq 'RT_Internal') {
+
+ push @fields, FS::TicketSystem->custom_fields(
+ lookuptype => $opt{lookuptype},
+ valuetype => $opt{valuetype},
+ );
+
}
+
</%init>
diff --git a/httemplate/elements/select-rt-queue.html b/httemplate/elements/select-rt-queue.html
new file mode 100644
index 000000000..4ae8bc942
--- /dev/null
+++ b/httemplate/elements/select-rt-queue.html
@@ -0,0 +1,24 @@
+<SELECT NAME="<% $opt{'name'} %>"<% $opt{'multiple'} ? ' MULTIPLE' : '' %>>
+% while ( @fields ) {
+% my $value = shift @fields;
+% my $label = shift @fields;
+<OPTION VALUE="<% $value %>"<% $curr_value{$value} ? ' SELECTED' : '' %>><% $label %></OPTION>
+% }
+</SELECT>
+<%init>
+my %opt = @_;
+
+my %curr_value = map { $_ => 1 } split(', ',$opt{'curr_value'});
+
+my @fields;
+push @fields, '', $opt{empty_label} if exists($opt{empty_label});
+
+my $conf = new FS::Conf;
+
+if ($conf->config('ticket_system') eq 'RT_Internal') {
+
+ push @fields, FS::TicketSystem->queues();
+
+}
+
+</%init>
diff --git a/httemplate/elements/select-terms.html b/httemplate/elements/select-terms.html
index a330df17c..eda439a4c 100644
--- a/httemplate/elements/select-terms.html
+++ b/httemplate/elements/select-terms.html
@@ -34,10 +34,7 @@ my $empty_label =
my $empty_value = $opt{'empty_value'} || '';
-my @terms = ( emt('Payable upon receipt'),
- ( map "Net $_",
- 0, 3, 5, 7, 9, 10, 14, 15, 18, 20, 21, 25, 30, 45, 60, 90 ),
- );
+my @terms = map emt($_), @FS::Conf::invoice_terms;
my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : ();
diff --git a/httemplate/elements/tr-input-locale-text.html b/httemplate/elements/tr-input-locale-text.html
new file mode 100644
index 000000000..110a8aa9b
--- /dev/null
+++ b/httemplate/elements/tr-input-locale-text.html
@@ -0,0 +1,120 @@
+<%doc>
+Usage:
+
+In edit/foo.html:
+
+<& /elements/tr-input-locale-text.html,
+ cgi => $cgi, # needed to preserve values in error redirect
+ object => $record,
+ field => 'myfield',
+ label => 'My Field',
+&>
+
+And in edit/process/foo.html:
+<& elements/process.html,
+ ...
+ process_locale => 'myfield',
+&>
+
+'object' needs to be an FS::Record subclass instance for a table that has
+a '_msgcat' localization table. For a table "foo" where "foo.myfield"
+contains some customer-visible label (in the default locale),
+"foo_msgcat.myfield" contains the translation of that label for a customer
+locale. The foreign key in foo_msgcat must have the same name as the primary
+key of foo.
+
+Currently only a single field can be localized this way; including this
+element more than once in the form will lead to conflicts. This is how
+it should work; if at some point we need to localize several fields of the
+same record, we should modify this element to show multiple inputs for each
+locale.
+
+</%doc>
+<%init>
+
+my %opt = @_;
+my $object = delete $opt{object};
+my $field = delete $opt{field};
+
+# identify our locales
+my $conf = FS::Conf->new;
+my $default_locale = $conf->config('locale') || 'en_';
+my @locales = grep { ! /^$default_locale/ } $conf->config('available-locales');
+
+my $label = delete $opt{label};
+my %labels = map { $_ => "$label&mdash;".FS::Locales->description($_) }
+ @locales;
+@locales = sort { $labels{$a} cmp $labels{$b} } @locales;
+my %curr_values;
+
+# where are the msgcat records?
+my $msgcat_table = $object->table . '_msgcat';
+my $msgcat_pkey = dbdef->table($msgcat_table)->primary_key;
+my %msgcat_pkeyvals;
+
+# find existing msgcat records, if any, and record their message values
+# and pkeys
+my $pkey = $object->primary_key;
+my $pkeyval = $object->get($pkey);
+if ($pkeyval) { # of course if this is a new record there won't be any
+ my @linked = qsearch($msgcat_table, { $pkey => $pkeyval });
+ foreach (@linked) {
+ $curr_values{ $_->locale } = $_->get( $field );
+ $msgcat_pkeyvals{ $_->locale } = $_->get( $msgcat_pkey );
+ }
+}
+
+# sticky-on-error the locale inputs
+if( my $cgi = $opt{cgi} ) {
+ my $i = 0;
+ # they're named 'foomsgnum0_locale' and 'foomsgnum0_myfield'
+ while ( my $locale = $cgi->param($msgcat_pkey . $i . '_locale') ) {
+ my $value = $cgi->param($msgcat_pkey . $i . '_' . $field);
+ $curr_values{ $locale } = $value;
+ $i++;
+ }
+}
+
+# compat with tr-input-text for styling
+my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+
+my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : '';
+
+
+</%init>
+% # pass through %opt on all of these to retain formatting
+% # one tr, td, and input for the default locale
+<& tr-input-text.html,
+ %opt,
+ 'label' => $label,
+ 'field' => $field
+&>
+% # and one for each of the others
+% my $i = 0;
+% foreach my $locale (@locales) {
+% my $basename = $msgcat_pkey . $i;
+% my $lfield = $basename . '_' . $field;
+<& tr-td-label.html,
+ %opt,
+ 'id' => $lfield, # uniqueness
+ 'label' => $labels{$locale}
+&>
+ <TD <% $colspan %><% $cell_style %> ID="<% $lfield %>_input0">
+ <& hidden.html,
+ 'field' => $basename,
+ 'curr_value' => $msgcat_pkeyvals{$locale},
+ # will be empty if this is a new record and/or new locale, that's fine
+ &>
+ <& hidden.html,
+ 'field' => $basename . '_locale',
+ 'curr_value' => $locale,
+ &>
+ <& input-text.html,
+ %opt,
+ 'field' => $lfield,
+ 'curr_value' => $curr_values{$locale},
+ &>
+ </TD>
+</TR>
+% $i++;
+% } # foreach $locale
diff --git a/httemplate/elements/tr-select-router_block_ip.html b/httemplate/elements/tr-select-router_block_ip.html
index ee135686c..2aa715e29 100644
--- a/httemplate/elements/tr-select-router_block_ip.html
+++ b/httemplate/elements/tr-select-router_block_ip.html
@@ -56,7 +56,7 @@ function clearhint_ip_addr (what) {
]
&>
</td></tr>
-<& /elements/tr-td-label.html, label => 'IP address', required => $opt{'ip_addr_required'} &>
+<& /elements/tr-td-label.html, label => ($opt{'ip_addr_label'} || 'IP address'), required => $opt{'ip_addr_required'} &>
<td>
% #warn Dumper \%fixed;
% if ( exists $fixed{$ip_field} ) {
diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html
index 2f4f0d555..e70871169 100644
--- a/httemplate/elements/xmlhttp.html
+++ b/httemplate/elements/xmlhttp.html
@@ -44,7 +44,7 @@ my %initialized = ();#won't work if component is "preloaded"... so don't do that
len = args.length - 1;
}
for (var i = 0; i < len; i++)
- content = content + "&arg=" + escape(args[i]);
+ content = content + "&arg=" + encodeURIComponent(args[i]);
content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs
if ( '<%$method%>' == 'GET' ) {
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index f03a8dfa3..b622efc15 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -55,6 +55,7 @@ unless ( $error ) { # if ($access_user) {
disable_html_editor disable_enter_submit_onetimecharge
enable_mask_clipboard_hack dashboard_customers
customer_view_emails
+ printtofit
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 50d6e8d23..c6bcf6f66 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -130,6 +130,13 @@ Interface
</TR>
<TR>
+ <TH ALIGN="right">Scale documents to fit on a letter-size page</TH>
+ <TD ALIGN="left">
+ <INPUT TYPE="checkbox" NAME="printtofit" VALUE="Y" <% $curuser->option('printtofit') ? 'CHECKED' : '' %>>
+ </TD>
+ </TR>
+
+ <TR>
<TH ALIGN="right">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>
@@ -143,8 +150,6 @@ Interface
</TD>
</TR>
-
-
</TABLE>
<BR>
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index 4ed297dac..03aaedd36 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -67,6 +67,15 @@ Examples:
],
'show_combined' => 1,
&>
+<%shared>
+# canonicalize the payby subtype string to an SQL-quoted list
+my %cardtype_of = (
+ 'VisaMC' => q['VISA card', 'MasterCard'],
+ 'Amex' => q['American Express card'],
+ 'Discover' => q['Discover card'],
+ 'Maestro' => q['Switch', 'Solo', 'Laser'],
+);
+</%shared>
<%init>
my %opt = @_;
@@ -191,10 +200,8 @@ if ($opt{'show_card_type'}) {
push @header, emt('Card Type');
$align .= 'r';
push @links, '';
- push @fields, sub {
- (($_[0]->payby eq 'CARD') && ($_[0]->paymask !~ /N\/A/)) ? cardtype($_[0]->paymask) : ''
- };
- push @sort_fields, '';
+ push @fields, 'paycardtype';
+ push @sort_fields, 'paycardtype';
}
if ( $unapplied ) {
@@ -305,150 +312,32 @@ if ( $cgi->param('magic') ) {
if ( $cgi->param('payby') ) {
my @all_payby_search = ();
- foreach my $payby ( $cgi->param('payby') ) {
-
- $payby =~
- /^(CARD|CHEK|BILL|CASH|PPAL|APPL|ANRD|PREP|WIRE|WEST|IDTP|EDI|MCRD|MCHK)(-(VisaMC|Amex|Discover|Maestro|Tokenized))?$/
- or die "illegal payby $payby";
-
- my $payby_search = "$table.payby = '$1'";
-
- if ( $3 ) {
-
- my $cardtype = $3;
-
- my $similar_to = dbh->{Driver}->{Name} =~ /^mysql/i
- ? 'REGEXP' #doesn't behave exactly the same, but
- #should work for our patterns
- : 'SIMILAR TO';
-
- my $search;
- if ( $cardtype eq 'VisaMC' ) {
-
- #avoid posix regexes for portability
- $search =
- # Visa
- " ( ( substring($table.payinfo from 1 for 1) = '4' ".
- # is not Switch
- " AND substring($table.payinfo from 1 for 4) != '4936' ".
- " AND substring($table.payinfo from 1 for 6) ".
- " NOT $similar_to '49030[2-9]' ".
- " AND substring($table.payinfo from 1 for 6) ".
- " NOT $similar_to '49033[5-9]' ".
- " AND substring($table.payinfo from 1 for 6) ".
- " NOT $similar_to '49110[1-2]' ".
- " AND substring($table.payinfo from 1 for 6) ".
- " NOT $similar_to '49117[4-9]' ".
- " AND substring($table.payinfo from 1 for 6) ".
- " NOT $similar_to '49118[1-2]' ".
- " )".
- # MasterCard
- " OR substring($table.payinfo from 1 for 2) = '51' ".
- " OR substring($table.payinfo from 1 for 2) = '52' ".
- " OR substring($table.payinfo from 1 for 2) = '53' ".
- " OR substring($table.payinfo from 1 for 2) = '54' ".
- " OR substring($table.payinfo from 1 for 2) = '54' ".
- " OR substring($table.payinfo from 1 for 2) = '55' ".
- " OR substring($table.payinfo from 1 for 4) $similar_to '222[1-9]' ".
- " OR substring($table.payinfo from 1 for 3) $similar_to '22[3-9]' ".
- " OR substring($table.payinfo from 1 for 2) $similar_to '2[3-6]' ".
- " OR substring($table.payinfo from 1 for 3) $similar_to '27[0-1]' ".
- " OR substring($table.payinfo from 1 for 4) = '2720' ".
- " OR substring($table.payinfo from 1 for 3) = '2[2-7]x' ".
- " ) ";
-
- } elsif ( $cardtype eq 'Amex' ) {
-
- $search =
- " ( substring($table.payinfo from 1 for 2 ) = '34' ".
- " OR substring($table.payinfo from 1 for 2 ) = '37' ".
- " ) ";
-
- } elsif ( $cardtype eq 'Discover' ) {
-
- my $country = $conf->config('countrydefault') || 'US';
-
- $search =
- " ( substring($table.payinfo from 1 for 4 ) = '6011' ".
- " OR substring($table.payinfo from 1 for 3 ) = '60x' ".
- " OR substring($table.payinfo from 1 for 2 ) = '65' ".
-
- # diner's 300-305 / 3095
- " OR substring($table.payinfo from 1 for 3 ) = '300' ".
- " OR substring($table.payinfo from 1 for 3 ) = '301' ".
- " OR substring($table.payinfo from 1 for 3 ) = '302' ".
- " OR substring($table.payinfo from 1 for 3 ) = '303' ".
- " OR substring($table.payinfo from 1 for 3 ) = '304' ".
- " OR substring($table.payinfo from 1 for 3 ) = '305' ".
- " OR substring($table.payinfo from 1 for 4 ) = '3095' ".
- " OR substring($table.payinfo from 1 for 3 ) = '30x' ".
-
- # diner's 36, 38, 39
- " OR substring($table.payinfo from 1 for 2 ) = '36' ".
- " OR substring($table.payinfo from 1 for 2 ) = '38' ".
- " OR substring($table.payinfo from 1 for 2 ) = '39' ".
-
- " OR substring($table.payinfo from 1 for 3 ) = '644' ".
- " OR substring($table.payinfo from 1 for 3 ) = '645' ".
- " OR substring($table.payinfo from 1 for 3 ) = '646' ".
- " OR substring($table.payinfo from 1 for 3 ) = '647' ".
- " OR substring($table.payinfo from 1 for 3 ) = '648' ".
- " OR substring($table.payinfo from 1 for 3 ) = '649' ".
- " OR substring($table.payinfo from 1 for 3 ) = '64x' ".
-
- # JCB cards in the 3528-3589 range identified as Discover inside US & territories (NOT Canada)
- ( $country =~ /^(US|PR|VI|MP|PW|GU)$/
- ?" OR substring($table.payinfo from 1 for 4 ) = '3528' ".
- " OR substring($table.payinfo from 1 for 4 ) = '3529' ".
- " OR substring($table.payinfo from 1 for 3 ) = '353' ".
- " OR substring($table.payinfo from 1 for 3 ) = '354' ".
- " OR substring($table.payinfo from 1 for 3 ) = '355' ".
- " OR substring($table.payinfo from 1 for 3 ) = '356' ".
- " OR substring($table.payinfo from 1 for 3 ) = '357' ".
- " OR substring($table.payinfo from 1 for 3 ) = '358' ".
- " OR substring($table.payinfo from 1 for 3 ) = '35x' "
- :""
- ).
-
- #China Union Pay processed as Discover in US, Mexico and Caribbean
- ( $country =~ /^(US|MX|AI|AG|AW|BS|BB|BM|BQ|VG|KY|CW|DM|DO|GD|GP|JM|MQ|MS|BL|KN|LC|VC|MF|SX|TT|TC)$/
- ?" OR substring($table.payinfo from 1 for 3 ) $similar_to '62[24-68x]' "
- :""
- ).
-
- " ) ";
-
- } elsif ( $cardtype eq 'Maestro' ) {
-
- $search =
- " ( substring($table.payinfo from 1 for 2 ) = '63' ".
- " OR substring($table.payinfo from 1 for 2 ) = '67' ".
- " OR substring($table.payinfo from 1 for 6 ) = '564182' ".
- " OR substring($table.payinfo from 1 for 4 ) = '4936' ".
- " OR substring($table.payinfo from 1 for 6 ) ".
- " $similar_to '49030[2-9]' ".
- " OR substring($table.payinfo from 1 for 6 ) ".
- " $similar_to '49033[5-9]' ".
- " OR substring($table.payinfo from 1 for 6 ) ".
- " $similar_to '49110[1-2]' ".
- " OR substring($table.payinfo from 1 for 6 ) ".
- " $similar_to '49117[4-9]' ".
- " OR substring($table.payinfo from 1 for 6 ) ".
- " $similar_to '49118[1-2]' ".
- " ) ";
-
- } elsif ( $cardtype eq 'Tokenized' ) {
-
- $search = " substring($table.payinfo from 1 for 2 ) = '99' ";
+ foreach my $payby_string ( $cgi->param('payby') ) {
+
+ my $payby_search;
+
+ my ($payby, $subtype) = split('-', $payby_string);
+ # make sure it exists and is a transaction type
+ if ( FS::payby->payment_payby2longname($payby) ) {
+ $payby_search = "$table.payby = " . dbh->quote($payby);
+ } else {
+ die "illegal payby $payby_string";
+ }
+
+ if ( $subtype ) {
+
+ if ( $subtype eq 'Tokenized' ) {
+
+ $payby_search .= " AND substring($table.payinfo from 1 for 2 ) = '99' ";
+ # XXX should store the cardtype as 'Tokenized' in this case?
} else {
- die "unknown card type $cardtype";
- }
- my $masksearch = $search;
- $masksearch =~ s/$table\.payinfo/$table.paymask/gi;
+ my $in_cardtype = $cardtype_of{$subtype}
+ or die "unknown card type $subtype";
+ $payby_search .= " AND $table.paycardtype IN($in_cardtype)";
- $payby_search = "( $payby_search AND ( $search OR ( $table.paymask IS NOT NULL AND $masksearch ) ) )";
+ }
}
@@ -610,6 +499,8 @@ if ( $cgi->param('magic') ) {
'addl_from' => $addl_from,
};
+warn Dumper \$sql_query;
+
} else {
#hmm... is this still used?
diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html
index 7221d53cd..58d398ca2 100755
--- a/httemplate/view/quotation.html
+++ b/httemplate/view/quotation.html
@@ -67,7 +67,9 @@ function areyousure(href, message) {
<BR><BR>
% if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
+% # if we end up with more than one option, combine these links and add an interstitial screen
<A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
+ | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>&onhold=1">Order on hold</A>
<BR><BR>
% }
diff --git a/httemplate/view/svc_acct/basics.html b/httemplate/view/svc_acct/basics.html
index 1b7d56b23..5532c22a5 100644
--- a/httemplate/view/svc_acct/basics.html
+++ b/httemplate/view/svc_acct/basics.html
@@ -1,18 +1,18 @@
<% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
-<& /view/elements/tr.html, label=>mt('Service'), value=>$part_svc->svc &>
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('svc')->columnlabel || mt('Service'), value=>$part_svc->svc &>
% if ( $opt{cust_svc}->agent_svcid ) {
<& /view/elements/tr.html, label=>mt('Legacy ID'), value=>$opt{cust_svc}->agent_svcid &>
% }
-<& /view/elements/tr.html, label=>mt('Username'), value=>$svc_acct->username &>
-<& /view/elements/tr.html, label=>mt('Domain'), value=>$domain &>
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('username')->columnlabel || mt('Username'), value=>$svc_acct->username &>
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('domsvc')->columnlabel || mt('Domain'), value=>$domain &>
% if ( $opt{'communigate'} ) {
<& /view/elements/tr.html, label=>mt('Aliases'), value=>$svc_acct->cgp_aliases &>
%}
% if ( $svc_acct->pbxsvc ) {
- <& /view/elements/tr.html, label=>mt('PBX'), value=>$svc_acct->pbx_title &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('pbxsvc')->columnlabel || mt('PBX'), value=>$svc_acct->pbx_title &>
%}
% my $show_pw = '';
@@ -38,7 +38,7 @@
% # show nothing
% } else {
<TR>
- <TD ALIGN="right"><% mt('Password') %></TD>
+ <TD ALIGN="right"><% $psc->columnlabel || mt('Password') %></TD>
<TD STYLE="background-color: #ffffff; white-space: nowrap">
<% $show_pw %>
% my $curuser = $FS::CurrentUser::CurrentUser;
@@ -58,12 +58,12 @@
% }
% if ( $conf->exists('security_phrase') ) {
- <& /view/elements/tr.html, label=>mt('Security phrase'), value=>$svc_acct->sec_phrase &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('sec_phrase')->columnlabel || mt('Security phrase'), value=>$svc_acct->sec_phrase &>
% }
% if ( $svc_acct->popnum ) {
% my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
- <& /view/elements/tr.html, label=>mt('Access number'), value=>$svc_acct_pop->text &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('popnum')->columnlabel || mt('Access number'), value=>$svc_acct_pop->text &>
% }
% if ( $svc_acct->sectornum && $conf->exists('svc_acct-tower_sector') ) {
@@ -72,7 +72,7 @@
% ? '<A HREF="http://'. $tower_sector->ip_addr. '">'
% : '';
<& /view/elements/tr.html,
- label => mt('Tower sector'),
+ label => $part_svc->part_svc_column('sectornum')->columnlabel || mt('Tower sector'),
value => $link. $tower_sector->description. ($link ? '</A>' : ''),
&>
% }
@@ -83,28 +83,28 @@
&>
% if ($svc_acct->uid ne '') {
- <& /view/elements/tr.html, label=>mt('UID'), value=>$svc_acct->uid &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('uid')->columnlabel || mt('UID'), value=>$svc_acct->uid &>
% }
% if ($svc_acct->gid ne '') {
- <& /view/elements/tr.html, label=>mt('GID'), value=>$svc_acct->gid &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('gid')->columnlabel || mt('GID'), value=>$svc_acct->gid &>
% }
% if ($svc_acct->finger ne '') {
- <& /view/elements/tr.html, label=>mt('Real Name'), value=>$svc_acct->finger &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('finger')->columnlabel || mt('Real Name'), value=>$svc_acct->finger &>
% }
% if ($svc_acct->dir ne '') {
- <& /view/elements/tr.html, label=>mt('Home directory'), value=>$svc_acct->dir &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('dir')->columnlabel || mt('Home directory'), value=>$svc_acct->dir &>
% }
% if ($svc_acct->shell ne '') {
- <& /view/elements/tr.html, label=>mt('Shell'), value=>$svc_acct->shell &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('shell')->columnlabel || mt('Shell'), value=>$svc_acct->shell &>
% }
% if ($svc_acct->quota ne '' && ! $opt{'communigate'} ) {
- <& /view/elements/tr.html, label=>mt('Quota'), value=>$svc_acct->quota &>
+ <& /view/elements/tr.html, label=> $part_svc->part_svc_column('quota')->columnlabel || mt('Quota'), value=>$svc_acct->quota &>
% } elsif ( $opt{'communigate'} ) {
@@ -133,7 +133,7 @@ sub slipip {
% if ($svc_acct->slipip) {
<& /view/elements/tr.html,
- label=>mt('IP address'),
+ label=> $part_svc->part_svc_column('slipip')->columnlabel || mt('IP address'),
value=> slipip($svc_acct)
&>
% }
@@ -156,7 +156,7 @@ sub slipip {
&>
% }
-<& /view/elements/tr.html, label=>mt('RADIUS groups'),
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('usergroup')->columnlabel || mt('RADIUS groups'),
value=>join('<BR>', $svc_acct->radius_groups('long_description')) &>
<& router.html, 'svc_acct' => $svc_acct &>