Merge branch 'bug_2832' into 3.12-master
[koha.git] / opac / opac-user.pl
index b89e862..eee3d38 100755 (executable)
@@ -12,9 +12,9 @@
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
 use strict;
@@ -65,7 +65,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     }
 );
 
-my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
+my $show_priority;
+for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
+    m/priority/ and $show_priority = 1;
+}
 my $patronupdate = $query->param('patronupdate');
 my $canrenew = 1;
 
@@ -107,6 +110,7 @@ if ( $borr->{amountoutstanding} > $no_renewal_amt ) {
     $canrenew = 0;
     $template->param(
         renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ),
+        renewal_blocked_fines_amountoutstanding => sprintf( '%.02f', $borr->{amountoutstanding} ),
     );
 }
 
@@ -260,9 +264,10 @@ foreach my $res (@reserves) {
     $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
     my $biblioData = GetBiblioData($res->{'biblionumber'});
     $res->{'reserves_title'} = $biblioData->{'title'};
-    if ($OPACDisplayRequestPriority) {
-        $res->{'priority'} = '' if $res->{'priority'} eq '0';
+    if ($show_priority) {
+        $res->{'priority'} ||= '';
     }
+    $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
 }
 
 # use Data::Dumper;
@@ -270,7 +275,7 @@ foreach my $res (@reserves) {
 
 $template->param( RESERVES       => \@reserves );
 $template->param( reserves_count => $#reserves+1 );
-$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority;
+$template->param( showpriority=>$show_priority );
 
 my @waiting;
 my $wcount = 0;
@@ -360,5 +365,11 @@ $template->param(
     dateformat    => C4::Context->preference("dateformat"),
 );
 
+$template->param( DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar() );
+$template->param(
+    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
+    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') ,
+);
+
 output_html_with_http_headers $query, $cookie, $template->output;