|
Lines 27-34
use C4::Languages qw(getTranslatedLanguages accept_language);
Link Here
|
| 27 |
use C4::Koha qw( GetDailyQuote ); |
27 |
use C4::Koha qw( GetDailyQuote ); |
| 28 |
use C4::Members; |
28 |
use C4::Members; |
| 29 |
use C4::Overdues; |
29 |
use C4::Overdues; |
| 30 |
use C4::Reserves; |
|
|
| 31 |
use Koha::Checkouts; |
30 |
use Koha::Checkouts; |
|
|
31 |
use Koha::Holds; |
| 32 |
|
32 |
|
| 33 |
my $input = new CGI; |
33 |
my $input = new CGI; |
| 34 |
my $dbh = C4::Context->dbh; |
34 |
my $dbh = C4::Context->dbh; |
|
Lines 66-88
my $koha_news_count = scalar @$all_koha_news;
Link Here
|
| 66 |
|
66 |
|
| 67 |
my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha |
67 |
my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha |
| 68 |
|
68 |
|
|
|
69 |
# For dashboard |
| 69 |
my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count; |
70 |
my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count; |
| 70 |
my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); |
71 |
my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); |
| 71 |
my @holds = GetReservesFromBorrowernumber($borrowernumber); |
72 |
my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count; |
| 72 |
my $holds_pending = 0; |
73 |
my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count; |
| 73 |
foreach my $hold (@holds) { |
|
|
| 74 |
if (not defined($hold->{found})){ |
| 75 |
$holds_pending++; |
| 76 |
} |
| 77 |
} |
| 78 |
my @holds_waiting = GetReservesFromBorrowernumber($borrowernumber, 'W'); |
| 79 |
my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); |
74 |
my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); |
| 80 |
|
75 |
|
|
|
76 |
if ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 ) { |
| 77 |
$template->param( dashboard_info => 1 ); |
| 78 |
} |
| 79 |
|
| 81 |
$template->param( |
80 |
$template->param( |
| 82 |
checkouts => $checkouts, |
81 |
checkouts => $checkouts, |
| 83 |
overdues => $overdues_count, |
82 |
overdues => $overdues_count, |
| 84 |
holds_pending => $holds_pending, |
83 |
holds_pending => $holds_pending, |
| 85 |
holds_waiting => scalar @holds_waiting, |
84 |
holds_waiting => $holds_waiting, |
| 86 |
total_owing => $total, |
85 |
total_owing => $total, |
| 87 |
koha_news => $all_koha_news, |
86 |
koha_news => $all_koha_news, |
| 88 |
koha_news_count => $koha_news_count, |
87 |
koha_news_count => $koha_news_count, |
| 89 |
- |
|
|