summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/admin.pl39
-rw-r--r--scripts/payment.pl2
-rw-r--r--scripts/recon.pl26
3 files changed, 41 insertions, 26 deletions
diff --git a/scripts/admin.pl b/scripts/admin.pl
index 9eeb9454..29cf03c2 100644
--- a/scripts/admin.pl
+++ b/scripts/admin.pl
@@ -6,11 +6,12 @@ require 'lsmb-request.pl';
use LedgerSMB::Template;
use LedgerSMB::DBObject::Admin;
use LedgerSMB::DBObject::User;
+use Data::Dumper;
sub new_user {
# uses the same page as create_user, only pre-populated.
- #my ($class, $request) = @_;
+ #my ($request) = @_;
my $request = shift @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
@@ -41,7 +42,9 @@ sub new_user {
user => $user,
template => 'Admin/edit_user',
language => $user->{language},
- format => 'HTML', path=>'UI');
+ format => 'HTML',
+ path=>'UI'
+ );
$template->render(
{
@@ -55,7 +58,7 @@ sub new_user {
sub edit_user {
# uses the same page as create_user, only pre-populated.
- my ($class, $request) = @_;
+ my ($request) = @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'user_id');
my $all_roles = $admin->get_roles();
@@ -81,12 +84,12 @@ sub edit_user {
);
}
else {
- my $edited_user = $admin->get_entire_user();
+ my $edited_user = $admin->get_entire_user($request->{user});
$template->render(
{
user=>$edited_user,
roles=>$all_roles,
- user_roles=>$admin->get_user_roles($request->{username})
+ user_roles=>$admin->get_user_roles($request->{user})
}
);
}
@@ -94,7 +97,7 @@ sub edit_user {
sub edit_group {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
my $all_roles = $admin->role_list();
@@ -129,7 +132,7 @@ sub edit_group {
sub create_group {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
my $all_roles = $admin->get_roles();
@@ -156,7 +159,7 @@ sub create_group {
sub delete_group {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
@@ -177,7 +180,7 @@ sub delete_group {
sub delete_user {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $admin = LedgerSMB::DBObject::Admin->new(base=>$request, copy=>'all');
@@ -198,10 +201,10 @@ sub delete_user {
sub new_group {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $template = LedgerSMB::Template->new( user=>$user,
- template=>'Admin/new_group.html', language=>$user->{language},
+ template=>'Admin/new_group', language=>$user->{language},
format=>'HTML', path=>'UI');
$template->render();
@@ -209,36 +212,32 @@ sub new_group {
sub cancel {
- &mainpage(@_);
+ &main(@_);
}
sub __default {
- &mainpage(@_);
+ &main(@_);
}
-sub mainpage {
+sub main {
my ($request) = @_;
my $template;
- # We need to test for a login here first.
-
-
-
my $user = LedgerSMB::DBObject::User->new(base=>$request, copy=>'all');
my $ret = $user->get_all_users();
$template = LedgerSMB::Template->new(
user=>$user,
- template=>'Admin/main.html',
+ template=>'Admin/main',
language=>$user->{language},
format=>'HTML',
path=>'UI'
);
- $template->render({users=>$ret});
+ $template->render( { users=>$user->{users} } );
}
#eval { do "scripts/custom/admin.pl"};
diff --git a/scripts/payment.pl b/scripts/payment.pl
index 6dfbed05..9037aca8 100644
--- a/scripts/payment.pl
+++ b/scripts/payment.pl
@@ -197,7 +197,7 @@ sub get_search_results {
form => $payment,
columns => \@columns,
heading => $heading,
- hiddens => $payment->take_top_level,
+ hiddens => $payment->take_top_level,
rows => $rows,
buttons => [{
value => 'reverse_payments',
diff --git a/scripts/recon.pl b/scripts/recon.pl
index a6076775..f128e1d8 100644
--- a/scripts/recon.pl
+++ b/scripts/recon.pl
@@ -71,33 +71,49 @@ status
=cut
+sub pending_search {
+
+ &search(shift @_,"pending");
+}
+
+sub approved_search {
+
+ &search(shift @_,"approved");
+}
+
sub search {
- my ($request) = @_;
+ my ($request,$type) = @_;
if ($request->type() eq "POST") {
# WE HAS DATUMS
# INTENTIONAL BAD PLURALIZATION OF LATIN
my $search = LedgerSMB::DBObject::Reconciliation->new(base => $request, copy => 'all');
- my $results = $search->search();
+ my $results = $search->search($type);
my $total = $search->total();
- my $template = LedgerSMB::Template->new( user => $user,
- template => 'reconciliation/report', language => $user->{language},
+ my $template = LedgerSMB::Template->new(
+ user => $user,
+ template => 'reconciliation/report',
+ language => $user->{language},
format => 'HTML',
path=>"UI");
return $template->render({report => $results, total => $total});
} else {
+ my $recon = LedgerSMB::DBObject::Reconciliation->new(base=>$request, copy=>'all');
+
my $template = LedgerSMB::Template->new(
user => $user,
template=>'reconciliation/search',
language=>$user->{language},
format=>'HTML',
- path=>"UI"
+ path=>"UI",
+ mode=>$type,
+ accounts=>$recon->get_accounts();
);
return $template->render();
}