LP#1402797 Implement "Retrieve Last Bib Record" using localStorage record cache
authorMike Rylander <mrylander@gmail.com>
Wed, 14 Jan 2015 20:05:14 +0000 (15:05 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Feb 2015 16:16:05 +0000 (11:16 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/services/navbar.js

index fe0695a..018a93f 100644 (file)
               [% l('Record Buckets') %]
             </a>
           </li>
+          <li>
+            <a href="" ng-click="retrieveLastRecord()" target="_self">
+              <span class="glyphicon glyphicon-share-alt"></span>
+              [% l('Retrieve Last Bib Record') %]
+            </a>
+          </li>
        </ul>
       </li>
 
index 8806d65..ba168cb 100644 (file)
@@ -45,6 +45,15 @@ angular.module('egCoreMod')
                     hotkeys.add(key, desc, function() { navTo(path) });
                 };
 
+                $scope.retrieveLastRecord = function() {
+                    var last_record = egCore.hatch.getLocalItem("eg.cat.last_record_retrieved");
+                    if (last_record) {
+                        var reg = new RegExp($location.path());
+                        $window.location.href =
+                            $window.location.href + 'cat/catalog/record/' + last_record;
+                    }
+                }
+
                 $scope.applyLocale = function(locale) {
                     // EGWeb.pm can change the locale for us w/ the right param
                     // Note: avoid using $location.search() to derive a new