bounce browser to printer URL and return with station
[koha.git] / mainpage.pl
index a0de153..e2651d8 100755 (executable)
@@ -20,7 +20,7 @@
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Output;
 use C4::Auth;
 use C4::Koha;
@@ -29,12 +29,13 @@ use C4::Review qw/numberofreviews/;
 use C4::Suggestions qw/CountSuggestion/;
 use C4::Tags qw/get_count_by_tag_status/;
 use Koha::Borrower::Modifications;
+use Koha::Borrower::Discharge;
 
 my $query = new CGI;
 
 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
     {
-        template_name   => "intranet-main.tmpl",
+        template_name   => "intranet-main.tt",
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
@@ -55,7 +56,8 @@ $template->param(
 );
 
 my $branch =
-  C4::Context->preference("IndependentBranches")
+  (      C4::Context->preference("IndependentBranchesPatronModifications")
+      || C4::Context->preference("IndependentBranches") )
   && !$flags->{'superlibrarian'}
   ? C4::Context->userenv()->{'branch'}
   : undef;
@@ -65,12 +67,14 @@ my $pendingtags        = get_count_by_tag_status(0);
 my $pendingsuggestions = CountSuggestion("ASKED");
 my $pending_borrower_modifications =
   Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
+my $pending_discharge_requests = Koha::Borrower::Discharge::count({ pending => 1 });
 
 $template->param(
     pendingcomments                => $pendingcomments,
     pendingtags                    => $pendingtags,
     pendingsuggestions             => $pendingsuggestions,
     pending_borrower_modifications => $pending_borrower_modifications,
+    pending_discharge_requests     => $pending_discharge_requests,
 );
 
 #