LP#1772680: Changed Registrationn Form output and various other changes
authorJaswinder Singh <jaswinder.singh0011@gmail.com>
Tue, 25 Sep 2018 21:21:18 +0000 (17:21 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 6 Nov 2019 17:29:39 +0000 (12:29 -0500)
Signed-off-by: Jaswinder Singh <jaswinder.singh0011@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI/RBDigital.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/templates/opac/ebook_api/rbdigital/parts/result/table.tt2
Open-ILS/src/templates/opac/ebook_api/rbdigital/register_modal.tt2
Open-ILS/src/templates/opac/parts/vendor_tabs.tt2
Open-ILS/web/css/skin/default/ebook/rbdigital.css

index ed33d8e..af3106a 100644 (file)
@@ -112,12 +112,12 @@ sub do_client_auth {
 sub _get_vendor_library {
     my $home_ou = @_;
     my $object_rdsa;
-    my $ebook_rds_req;
+    my $ebook_rdsa_req;
 
     my $pcrud = OpenSRF::AppSession->create('open-ils.pcrud');
     $pcrud->connect();
 
-    $ebook_rds_req = $pcrud->request('open-ils.pcrud.search.ebook_rdsa.atomic', "ANONYMOUS", 
+    $ebook_rdsa_req = $pcrud->request('open-ils.pcrud.search.ebook_rdsa.atomic', "ANONYMOUS", 
         { 
             home_ou => $home_ou,
             "+ebook_rds" => {
@@ -133,9 +133,9 @@ sub _get_vendor_library {
         }
     )->gather(1);
 
-    if ($ebook_rds_req && scalar (@$ebook_rds_req) > 0) {
-        #read the library.id to find corrosponding library id from digital services atuhorized table
-        $object_rdsa = $ebook_rds_req->[0];
+    if ($ebook_rdsa_req && scalar (@$ebook_rdsa_req) > 0) {
+        #read the library.id to find corresponding library id from digital services authorized table
+        $object_rdsa = $ebook_rdsa_req->[0];
     }
 
     return $object_rdsa;
index e20b380..f689afa 100644 (file)
@@ -459,6 +459,15 @@ sub load_rbdigital_common {
         $logger->info('EbookAPI: Got patron id: '. $self->ctx->{rbdigital_patron_id});
         # Call sub to get all the vendors to be displayed on the UI
         $self->ctx->{vendors} = _get_authorized_vendors($self->editor->authtoken, $session_id);
+
+        # Loop through vendors array and get the RBdigital library URL tied to logged in User
+        foreach my $value (@ {$self->ctx->{vendors}}) {
+            if ($value->vendor_key eq 'rbdigital') {
+                $self->ctx->{vendor_library_url} = $value->[0]->digital_services_library_url;
+                last;
+            }
+        }
+
         $self->ctx->{wishlist} = _get_patron_wishlist($self->editor->authtoken, $session_id);
     } else {
         $self->ctx->{rbdigital_patron_id} = 0;
index 1390ed9..c0e4c53 100644 (file)
@@ -7,7 +7,6 @@
     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
 
     result_count = ctx.result_start;
-    USE Dumper;
 %]
 [% PROCESS "opac/parts/result/paginate.tt2" %]
 [% ctx.results_count_header = PROCESS results_count_header; 
index bc7f076..1005bea 100644 (file)
@@ -27,9 +27,9 @@
             </div>
             <div id="confirmPasswordError" class="hidden alert alert-danger">Confirm password must match with the password you entered.</div>
             <div class="form-group">
-              <label for="email"><span class="glyphicon glyphicon-envelope"></span> Email</label>
-              <input type="email" class="form-control" id="email" placeholder="Enter email" value="[% ctx.user.email | html; %]"
-                data-toggle="tooltip" data-placement="right" title="Note: Changing your email here will also update your account's email address." required>
+              <label for="email"><span class="glyphicon glyphicon-envelope"></span>RBdigital Email</label>
+              <input type="email" class="form-control" id="email" placeholder="Enter RBdigital email" value="[% ctx.user.email | html; %]"
+                data-toggle="tooltip" data-placement="right" title="Note: Changing your email here will also update your library account's email address." required>
             </div>
             
             <button id="btnRegister" type="submit" class="btn btn-success pull-left"><span class="glyphicon glyphicon-off"></span> Register</button>
                <span class="pull-right"><img src="[% ctx.media_prefix %]/images/rbdigital_logo.png[% ctx.cache_key %]" alt="[% l("RBDigital") %]"/></span>
         </div>
       </div>
-      
     </div>
   </div> 
 
   <!-- Modal for Registration Success -->
   <div id="rbdigitalRegisterSuccess" class="modal fade" role="dialog">
     <div class="modal-dialog">
-      <!-- Modal content-->
       <div class="modal-content">
         <div class="modal-header">
           <button type="button" class="close" data-dismiss="modal">&times;</button>
-          <h4><span class="glyphicon glyphicon-lock"></span>RBDigital - Registration Success</h4>
+          <h4>Congratulations!</h4>
         </div>
         <div class="modal-body">
-          <div class="alert alert-success">
-            <strong>Success!</strong> You have been successfully registered with RBDigital.
+          <div class="center-text">
+            Your RBdigital account has been created!<br><br>
+            Please remember the RBdigital password you just created. It may be different from your PINES password.<br><br>
+            Visit <a href="https://[% vendor_library_url %]">https://[% vendor_library_url %]</a>/#/help/support to learn about RBdigital and to download RBdigital mobile and desktop apps.<br><br>
+            Visit <a href="https://[% vendor_library_url %]">https://[% vendor_library_url %]</a> to search for e-books and e-audiobooks at RBdigital.com or use the RBdigital tab to search from them from this PINES site
           </div>
-          <button id="btnCloseRegisterSuccess" type="submit" class="btn btn-danger btn-default pull-right" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Close</button>
+          <button id="btnCloseRegisterSuccess" type="submit" class="btn btn-danger btn-default pull-right" data-dismiss="modal">Ok</button>
         </div>
       </div>
     </div>
index a628628..f162c44 100644 (file)
@@ -20,6 +20,9 @@
                     IF vendor.vendor_key == 'default';
                         vendor_search_url = ctx.opac_root _ vendor.search_uri;
                     END;
+                    IF vendor.vendor_key == 'rbdigital';
+                        # vendor_library_url = vendor.digital_services_library_url;
+                    END;
                     %]
                 <a id="lnkSearchResults_[%  vendor.vendor_key %]" 
                     href="[% vendor_search_url; %]" class="[% vendor_tab_class %]">[% vendor.name %]</a>
@@ -29,7 +32,7 @@
     <input type="hidden" id="rbdigitalPatronId" value="[% ctx.rbdigital_patron_id %]">
     [% IF ctx.rbdigital_patron_id == 0; %]
         <!-- Load Code for displaying the password prompt -->
-        [% INCLUDE 'opac/ebook_api/rbdigital/register_modal.tt2'; %]
+        [% INCLUDE 'opac/ebook_api/rbdigital/register_modal.tt2' vendor_library_url = ctx.vendor_library_url; %]
     [% END; %]
 [% ELSIF ctx.vendors.size > 0; %]
     <!-- Read the first vendor name based on the display_order to non-logged in users -->
index c52c52c..4a91a37 100644 (file)
     color: #FFFFFF; 
     border: 1px solid green; 
     padding: 10px;
-    font-size: 11px;
+    font-size: 12px;
     width: 600px;
 }
+
 /* Tooltip on top */
 .rbdigital .tooltip.top > .tooltip-arrow {
     border-top: 5px solid green;
@@ -102,4 +103,12 @@ a.opac-button:hover {
 
 .rbdigital_lowhits_help > div {
     margin-top: 1em;
+}
+
+.rbdigital #rbdigitalRegisterSuccess .modal-body {
+    padding-top: 15px;   
+}
+
+.rbdigital .center-text {
+       text-align: center;
 }
\ No newline at end of file