add Mark Record As Overlay Target
authorJason Etheridge <jason@esilibrary.com>
Wed, 12 Aug 2015 19:02:16 +0000 (15:02 -0400)
committerJason Etheridge <jason@esilibrary.com>
Wed, 12 Aug 2015 19:15:45 +0000 (15:15 -0400)
to the Record Summary UI

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index f7477b1..e88223d 100644 (file)
         [% l('Holdings View') %]
     </a>
   </li>
+  <li ng-class="{disabled : !record_id}">
+    <button type="button" ng-disabled="disable_mark_for_overlay" class="btn btn-default" ng-click="mark_as_overlay_target()">
+        [% l('Mark Record As Overlay Target') %]
+    </button>
+  </li>
 </ul>
 
 <div class="tab-content">
index 8658bf6..ebbd8eb 100644 (file)
@@ -158,6 +158,13 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
     if ($routeParams.record_id) $scope.from_route = true;
     else $scope.from_route = false;
 
+    // FIXME -- we could add a permission check here
+    if ($scope.record_id == egCore.hatch.getLocalItem('eg.cat.marked_overlay_record')) {
+        $scope.disable_mark_for_overlay = true;
+    } else {
+        $scope.disable_mark_for_overlay = false;
+    }
+
     // will hold a ref to the opac iframe
     $scope.opac_iframe = null;
     $scope.parts_iframe = null;
@@ -500,6 +507,11 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
             );
     }
 
+    $scope.mark_as_overlay_target = function() {
+        egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.record_id);
+        $scope.disable_mark_for_overlay = true;
+    }
+
     $scope.set_record_tab = function(tab) {
         $scope.record_tab = tab;