Bug 20023: Password recovery using email should be case insensitive
[koha.git] / opac / opac-detail.pl
index e7653d9..6f10c6b 100755 (executable)
@@ -32,7 +32,7 @@ use C4::Biblio;
 use C4::Items;
 use C4::Circulation;
 use C4::Tags qw(get_tags);
-use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
+use C4::XISBN qw(get_xisbns);
 use C4::External::Amazon;
 use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
 use C4::Members;
@@ -173,7 +173,6 @@ if ( $xslfile ) {
 }
 
 my $OpacBrowseResults = C4::Context->preference("OpacBrowseResults");
-$template->{VARS}->{'OpacBrowseResults'} = $OpacBrowseResults;
 
 # We look for the busc param to build the simple paging from the search
 if ($OpacBrowseResults) {
@@ -200,6 +199,7 @@ if ($session->param('busc')) {
                 }
             } else {
                 for my $value (@{$arrParamsBusc->{$_}}) {
+                    next if !defined($value);
                     $pasarParams .= '&' if ($j);
                     $pasarParams .= $_ . '=' . Encode::decode('UTF-8', uri_escape_utf8($value));
                     $j++;
@@ -459,6 +459,7 @@ if ($session->param('busc')) {
     }
     $template->param('listResults' => \@listResults) if (@listResults);
     $template->param('indexPag' => 1 + $offset, 'totalPag' => $arrParamsBusc{'total'}, 'indexPagEnd' => scalar(@arrBiblios) + $offset);
+    $template->param( 'offset' => $offset );
 }
 }
 
@@ -588,10 +589,9 @@ foreach my $subscription (@subscriptions) {
     $cell{latestserials} =
       GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
     if ( $borrowernumber ) {
-        my $sub = getalert($borrowernumber,'issue',$subscription->{subscriptionid});
-        if (@$sub[0]) {
-            $cell{hasalert} = 1;
-        }
+        my $subscription_object = Koha::Subscriptions->find( $subscription->{subscriptionid} );
+        my $subscriber = $subscription_object->subscribers->find( $borrowernumber );
+        $cell{hasalert} = 1 if $subscriber;
     }
     push @subs, \%cell;
 }
@@ -756,6 +756,14 @@ if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
 my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
 my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
 
+if( C4::Context->preference('ArticleRequests') ) {
+    my $patron = $borrowernumber ? Koha::Patrons->find($borrowernumber) : undef;
+    my $artreqpossible = $patron
+        ? $biblio->can_article_request( $patron )
+        : Koha::ItemTypes->find($biblio->itemtype)->may_article_request;
+    $template->param( artreqpossible => $artreqpossible );
+}
+
     $template->param(
                      MARCNOTES               => $marcnotesarray,
                      norequests              => $norequests,
@@ -1081,7 +1089,7 @@ if (C4::Context->preference("BakerTaylorEnabled")) {
        {
                $template->param(
                BakerTaylorContentURL   =>
-               sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
+        sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
                                $bt_user,$bt_pass,$isbn)
                );
        }