LP#1522644: Make Mark for Hold Transfer option consistent with other options
authorKathy Lussier <klussier@masslnc.org>
Fri, 3 Mar 2017 04:52:30 +0000 (23:52 -0500)
committerBill Erickson <berickxx@gmail.com>
Mon, 13 Mar 2017 14:38:42 +0000 (10:38 -0400)
Makes the following changes to the Mark for Holds Transfer Destination option:

1) Changes the label from "Mark As Title Hold Transfer Destination" to "Title
Hold Transfer." The 'Mark" piece is already implied in the "Mark For" button
label, and the long text was pushing the menu off the screen for some displays.

2) Makes the option behave as other Mark options. If a record is already marked,
it displays the marked Record ID in the menu. The mark is also removed when the
"Reset Record Marks" option is clicked.

3) Pushes the reset option down to the bottom of the menu and alphabetizes the
other Mark options above it.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 8509bf3..0848890 100644 (file)
             [% l('Mark for:') %] <span class="caret"></span>
         </button>
         <ul uib-dropdown-menu role="menu" aria-labelledby="mark-for-button">
-            <li role="menuitem">
+             <li role="menuitem">
+                    <a ng-click="markConjoined()">
+                        [% l('Conjoined Items') %]
+                    <span class="target-record-aside" ng-if="current_conjoined_target">[% l('(Currently [_1])', '{{current_conjoined_target}}') %]</span>
+                </a>
+            </li>
+           <li role="menuitem">
                 <a ng-click="markOverlay()">
                     [% l('Overlay Target') %]
                     <span class="target-record-aside" ng-if="current_overlay_target">[% l('(Currently [_1])', '{{current_overlay_target}}') %]</span>
                 </a>
             </li>
             <li role="menuitem">
-                <a ng-click="markVolTransfer()">
-                    [% l('Volume Transfer') %]
-                    <span class="target-record-aside" ng-if="current_voltransfer_target">[% l('(Currently [_1])', '{{current_voltransfer_target}}') %]</span>
+                <a ng-click="mark_hold_transfer_dest()">
+                   [% l('Title Hold Transfer') %]
+                <span class="target-record-aside" ng-if="current_hold_transfer_dest">[% l('(Currently [_1])', '{{current_hold_transfer_dest}}') %]</span>
                 </a>
             </li>
             <li role="menuitem">
-                    <a ng-click="markConjoined()">
-                        [% l('Conjoined Items') %]
-                    <span class="target-record-aside" ng-if="current_conjoined_target">[% l('(Currently [_1])', '{{current_conjoined_target}}') %]</span>
+                <a ng-click="markVolTransfer()">
+                    [% l('Volume Transfer') %]
+                    <span class="target-record-aside" ng-if="current_voltransfer_target">[% l('(Currently [_1])', '{{current_voltransfer_target}}') %]</span>
                 </a>
             </li>
             <li role="menuitem">
                 <a ng-click="clearRecordMarks()">[% l('Reset Record Marks') %]</a>
             </li>
-            <li role="menuitem">
-                <a ng-click="mark_hold_transfer_dest()">
-                   [% l('Mark as Title Hold Transfer Destination') %]
-                </a>
-            </li>
         </ul>
     </div>
   </div>
index 54f6396..0517970 100644 (file)
@@ -387,9 +387,11 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         $scope.current_overlay_target     = null;
         $scope.current_voltransfer_target = null;
         $scope.current_conjoined_target   = null;
+        $scope.current_hold_transfer_dest = null;
         egCore.hatch.removeLocalItem('eg.cat.marked_volume_transfer_record');
         egCore.hatch.removeLocalItem('eg.cat.marked_conjoined_record');
         egCore.hatch.removeLocalItem('eg.cat.marked_overlay_record');
+        egCore.hatch.removeLocalItem('eg.circ.hold.title_transfer_target');
     }
 
     $scope.stop_unload = false;
@@ -1440,7 +1442,10 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         });
     }
 
+    $scope.current_hold_transfer_dest = egCore.hatch.getLocalItem ('eg.circ.hold.title_transfer_target');
+
     $scope.mark_hold_transfer_dest = function() {
+        $scope.current_hold_transfer_dest = $scope.record_id;
         egCore.hatch.setLocalItem(
             'eg.circ.hold.title_transfer_target', $scope.record_id);
         ngToast.create(egCore.strings.HOLD_TRANSFER_DEST_MARKED);