summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-09-22 22:09:49 +0000
committerivan <ivan>2011-09-22 22:09:49 +0000
commit91ffcc0ecc1e1da51fa4b99a342691caa85a5992 (patch)
tree4f2698dc92a432469b2d12d0c9dd935c47d9fb8f
parent1c4910d0047029e0cee65a658e5090096d548d8a (diff)
random cleanups
-rw-r--r--FS/FS/rate_region.pm3
-rw-r--r--httemplate/edit/access_group.html3
-rw-r--r--httemplate/edit/cgp_rule.html4
-rw-r--r--httemplate/edit/payment_gateway.html2
-rwxr-xr-xhttemplate/edit/process/cust_credit.cgi7
-rw-r--r--httemplate/edit/process/tax_class.html4
-rw-r--r--httemplate/edit/rate_detail.html8
7 files changed, 18 insertions, 13 deletions
diff --git a/FS/FS/rate_region.pm b/FS/FS/rate_region.pm
index 0e6522302..f4a0ab196 100644
--- a/FS/FS/rate_region.pm
+++ b/FS/FS/rate_region.pm
@@ -248,6 +248,7 @@ Returns all prefixes (see L<FS::rate_prefix>) for this region.
sub rate_prefix {
my $self = shift;
+ map { $_ } #return $self->num_rate_prefix unless wantarray;
sort { $a->countrycode cmp $b->countrycode
or $a->npa cmp $b->npa
or $a->nxx cmp $b->nxx
@@ -264,7 +265,7 @@ destionation.
sub dest_detail {
my $self = shift;
- qsearch( 'rate_detail', { 'dest_regionnum' => $self->regionnum, } );
+ qsearch( 'rate_detail', { 'dest_regionnum' => $self->regionnum } );
}
=item prefixes_short
diff --git a/httemplate/edit/access_group.html b/httemplate/edit/access_group.html
index 1eed26dfe..b5757afca 100644
--- a/httemplate/edit/access_group.html
+++ b/httemplate/edit/access_group.html
@@ -18,6 +18,9 @@ tie my %rights, 'Tie::IxHash', FS::AccessRight->rights_info;
</%once>
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
my $html_bottom_sub = sub {
my $access_group = shift;
diff --git a/httemplate/edit/cgp_rule.html b/httemplate/edit/cgp_rule.html
index 41275aba7..1f838e238 100644
--- a/httemplate/edit/cgp_rule.html
+++ b/httemplate/edit/cgp_rule.html
@@ -59,7 +59,7 @@ my $m2_error_callback_cond = sub {
my $num = $1;
if ( grep $cgi->param("ruleconditionnum$num$_"), @gfields ) {
my $x = new FS::cgp_rule_condition {
- 'ruleconditionnum' => $cgi->param("ruleconditionnum$num"),
+ 'ruleconditionnum' => scalar($cgi->param("ruleconditionnum$num")),
map { $_ => scalar($cgi->param("ruleconditionnum${num}_$_")) } @fields,
};
$x;
@@ -84,7 +84,7 @@ my $m2_error_callback_action = sub {
my $num = $1;
if ( grep $cgi->param("ruleactionnum$num$_"), @gfields ) {
my $x = new FS::cgp_rule_action {
- 'ruleactionnum' => $cgi->param("ruleactionnum$num"),
+ 'ruleactionnum' => scalar($cgi->param("ruleactionnum$num")),
map { $_ => scalar($cgi->param("ruleactionnum${num}_$_")) } @fields,
};
$x;
diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html
index 62e35fcdb..cfb86048c 100644
--- a/httemplate/edit/payment_gateway.html
+++ b/httemplate/edit/payment_gateway.html
@@ -5,7 +5,7 @@
'fields' => $fields,
'field_callback' => $field_callback,
'labels' => {
- 'gatewaynum' => 'Gateway #',
+ 'gatewaynum' => 'Gateway',
'gateway_module' => 'Gateway',
'gateway_username' => 'Username',
'gateway_password' => 'Password',
diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi
index a4330dcdd..776112ac0 100755
--- a/httemplate/edit/process/cust_credit.cgi
+++ b/httemplate/edit/process/cust_credit.cgi
@@ -42,9 +42,10 @@ if ($reasonnum == -1) {
$error = 'Enter a new reason (or select an existing one)'
unless $cgi->param('newreasonnum') !~ /^\s*$/;
- my $reason = new FS::reason({ 'reason_type' => $cgi->param('newreasonnumT'),
- 'reason' => $cgi->param('newreasonnum'),
- });
+ my $reason = new FS::reason {
+ 'reason_type' => scalar($cgi->param('newreasonnumT')),
+ 'reason' => scalar($cgi->param('newreasonnum')),
+ };
$error ||= $reason->insert;
$cgi->param('reasonnum', $reason->reasonnum)
unless $error;
diff --git a/httemplate/edit/process/tax_class.html b/httemplate/edit/process/tax_class.html
index 339c9083e..7b630ff52 100644
--- a/httemplate/edit/process/tax_class.html
+++ b/httemplate/edit/process/tax_class.html
@@ -10,8 +10,8 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $tax_class = new FS::tax_class {
- 'taxclass' => $cgi->param('taxclass'),
- 'description' => $cgi->param('description'),
+ 'taxclass' => scalar($cgi->param('taxclass')),
+ 'description' => scalar($cgi->param('description')),
};
#maybe this whole thing should be in a transaction. at some point, no biggie
diff --git a/httemplate/edit/rate_detail.html b/httemplate/edit/rate_detail.html
index d0b85095b..0e406897f 100644
--- a/httemplate/edit/rate_detail.html
+++ b/httemplate/edit/rate_detail.html
@@ -52,10 +52,10 @@
],
'new_hashref_callback' => sub {
- { ratenum => $cgi->param('ratenum'),
- dest_regionnum => $cgi->param('dest_regionnum'),
- ratetimenum => $cgi->param('ratetimenum'),
- cdrtypenum => $cgi->param('cdrtypenum'),
+ { ratenum => scalar($cgi->param('ratenum')),
+ dest_regionnum => scalar($cgi->param('dest_regionnum')),
+ ratetimenum => scalar($cgi->param('ratetimenum')),
+ cdrtypenum => scalar($cgi->param('cdrtypenum')),
min_included => 0,
conn_charge => 0,
}