From 8025ab99b48861ebce844b8809af3e8242efcb28 Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Wed, 3 Jul 2019 19:11:54 +0000
Subject: [PATCH] Bug 23261: Add notice for login/registering to RBdigital
 results

To test:
 1 - You will need a valid library RBDigital account
 2 - Fill in the RecordedBooks system preferences
 3 - Open the catalog, perform a search with RBDigtal resuls, 'love' often works
 4 - Click to the results
 5 - Note if not logged you don't see availability
 6 - Log in with a patron with no email, note you do not see any notice that you must register your email with RBDigital
 7 - Apply patch
 8 - Reload results, you now see a notice to register with rbdigital, do so unless you already have an account
 9 - Add your associated email to the koha account
10 - Reload results, note you see availability
11 - Log out, reload results
12 - Note you see a promp to login to see availability

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
---
 .../opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt
index 64366cd0f3..15581833d0 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt
@@ -26,6 +26,10 @@
                 <div class="span10">
                     <div id="recordedbooks-results-content" class="maincontent searchresults">
                         <h1>RecordedBooks search for '[% q | html %]'</h1>
+                            [% UNLESS ( loggedinusername ) %]
+                                 <h3 class="rb_login">Sign in to view availability and checkout items or place holds</h3>
+                            [% END %]
+
                             <div id="breadcrumbs">
                                 <p></p>
                             </div>
@@ -81,7 +85,6 @@ function search( page ) {
         for ( var i = 0; data.items[i]; i++ ) {
             var prod = data.items[i];
             var results = [];
-
             results.push( '<tr>' );
 
             results.push( '<td class="info"><span class="title">' );
@@ -154,6 +157,9 @@ $( document ).ready( function() {
     KOHA.RecordedBooks.with_account_details("#breadcrumbs", function() {
         search( 1 );
     });
+    if( KOHA.RecordedBooks.is_identified() == 'false' ){
+        $("#breadcrumbs").before('<h3 class="rb_register"><a href="https://[% Koha.Preference('RecordedBooksDomain') %]">To see availability you must register for RecordedBooks using your cardnumber and the email associated with your Koha account</a></h3>');
+    }
     [% ELSE %]
         search( 1 );
     [% END %]
-- 
2.11.0