diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-03-05 17:30:46 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-03-05 17:30:46 -0800 |
commit | f34ac99a5e160d2eac4fb2cfecce820d1cf9b7ed (patch) | |
tree | efb6c09646d61677fab7ac1d42bf14117a331dff /httemplate | |
parent | aaa1a91c209ec3547b2c62dc59af935649a62b58 (diff) | |
parent | 0668c6afdce579dd202b12874bc0e9f1abe40ada (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/elements/select-user.html | 13 | ||||
-rw-r--r-- | httemplate/misc/cust_pay-import.cgi | 3 | ||||
-rw-r--r-- | httemplate/search/report_cust_bill_pkg_discount.html | 10 | ||||
-rw-r--r-- | httemplate/search/report_cust_credit.html | 10 | ||||
-rw-r--r-- | httemplate/search/report_cust_credit_bill_pkg.html | 11 | ||||
-rw-r--r-- | httemplate/search/report_cust_credit_source_bill_pkg.html | 11 | ||||
-rw-r--r-- | httemplate/search/report_cust_credit_void.html | 10 | ||||
-rw-r--r-- | httemplate/search/report_cust_pkg_discount.html | 10 |
8 files changed, 14 insertions, 64 deletions
diff --git a/httemplate/elements/select-user.html b/httemplate/elements/select-user.html index ec2341be6..e77788f61 100644 --- a/httemplate/elements/select-user.html +++ b/httemplate/elements/select-user.html @@ -17,17 +17,6 @@ my %opt = @_; -unless ( $opt{'access_user'} ) { - - my $sth = dbh->prepare(" - SELECT usernum, username FROM access_user - WHERE disabled = '' or disabled IS NULL - ") or die dbh->errstr; - $sth->execute or die $sth->errstr; - while ( my $row = $sth->fetchrow_arrayref ) { - $opt{'access_user'}->{$row->[0]} = $row->[1]; - } - -} +$opt{'access_user'} ||= $FS::CurrentUser::CurrentUser->access_users_hashref(); </%init> diff --git a/httemplate/misc/cust_pay-import.cgi b/httemplate/misc/cust_pay-import.cgi index 102f84286..bc4ac83b2 100644 --- a/httemplate/misc/cust_pay-import.cgi +++ b/httemplate/misc/cust_pay-import.cgi @@ -33,8 +33,7 @@ Import a file containing customer payments. <TH ALIGN="right">Format</TH> <TD> <SELECT NAME="format"> - <OPTION VALUE="simple-csv">Comma-separated (.csv)</OPTION> - <OPTION VALUE="simple-xls">Excel (.xls)</OPTION> + <OPTION VALUE="simple">Simple</OPTION> </SELECT> </TD> </TR> diff --git a/httemplate/search/report_cust_bill_pkg_discount.html b/httemplate/search/report_cust_bill_pkg_discount.html index 77affd19d..10ccba912 100644 --- a/httemplate/search/report_cust_bill_pkg_discount.html +++ b/httemplate/search/report_cust_bill_pkg_discount.html @@ -13,7 +13,7 @@ <& /elements/tr-select-user.html, 'label' => 'Discounts by employee: ', - 'access_user' => \%access_user, + 'access_user' => $access_user, &> <& /elements/tr-select-agent.html, @@ -44,12 +44,6 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_pkg_discount") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; -my %access_user = - map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } - @usernum; +my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_pkg_discount'); </%init> diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html index dbab66ae5..0d7a2770a 100644 --- a/httemplate/search/report_cust_credit.html +++ b/httemplate/search/report_cust_credit.html @@ -8,7 +8,7 @@ <& /elements/tr-select-user.html, 'label' => emt('Credits by employee: '), - 'access_user' => \%access_user, + 'access_user' => $access_user, &> <& /elements/tr-select-agent.html, @@ -38,13 +38,7 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; -my %access_user = - map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } - @usernum; +my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_credit'); my $unapplied = $cgi->param('unapplied') ? 1 : 0; diff --git a/httemplate/search/report_cust_credit_bill_pkg.html b/httemplate/search/report_cust_credit_bill_pkg.html index ad0f3f62e..1a54a122b 100644 --- a/httemplate/search/report_cust_credit_bill_pkg.html +++ b/httemplate/search/report_cust_credit_bill_pkg.html @@ -7,7 +7,7 @@ <& /elements/tr-select-user.html, 'label' => emt('Employee: '), - 'access_user' => \%access_user, + 'access_user' => $access_user, &> <& /elements/tr-select-agent.html, @@ -80,14 +80,7 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -#false laziness w/report_cust_credit.html -my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; -my %access_user = - map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } - @usernum; +my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_credit'); my $conf = new FS::Conf; diff --git a/httemplate/search/report_cust_credit_source_bill_pkg.html b/httemplate/search/report_cust_credit_source_bill_pkg.html index b579b92cc..7bfacc4fa 100644 --- a/httemplate/search/report_cust_credit_source_bill_pkg.html +++ b/httemplate/search/report_cust_credit_source_bill_pkg.html @@ -7,7 +7,7 @@ <& /elements/tr-select-user.html, 'label' => emt('Employee: '), - 'access_user' => \%access_user, + 'access_user' => $access_user, &> <& /elements/tr-select-agent.html, @@ -58,14 +58,7 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -#false laziness w/report_cust_credit.html -my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; -my %access_user = - map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } - @usernum; +my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_credit'); my $conf = new FS::Conf; diff --git a/httemplate/search/report_cust_credit_void.html b/httemplate/search/report_cust_credit_void.html index e96708090..16a9e42d6 100644 --- a/httemplate/search/report_cust_credit_void.html +++ b/httemplate/search/report_cust_credit_void.html @@ -7,7 +7,7 @@ <& /elements/tr-select-user.html, 'label' => emt('Credit voids by employee: '), - 'access_user' => \%access_user, + 'access_user' => $access_user, &> <& /elements/tr-select-agent.html, @@ -37,13 +37,7 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit_void") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; -my %access_user = - map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } - @usernum; +my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_credit_void'); my $title = 'Voided credit report'; diff --git a/httemplate/search/report_cust_pkg_discount.html b/httemplate/search/report_cust_pkg_discount.html index 7f0e55fed..2b9052f5b 100644 --- a/httemplate/search/report_cust_pkg_discount.html +++ b/httemplate/search/report_cust_pkg_discount.html @@ -23,7 +23,7 @@ <& /elements/tr-select-user.html, 'label' => 'Discounts by employee: ', - 'access_user' => \%access_user, + 'access_user' => $access_user, &> <& /elements/tr-select-agent.html, @@ -45,12 +45,6 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_pkg_discount") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my @usernum = map $_->[0], @{$sth->fetchall_arrayref}; -my %access_user = - map { $_ => qsearchs('access_user',{'usernum'=>$_})->username } - @usernum; +my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_pkg_discount'); </%init> |