LP#1522644: Make Mark for Hold Transfer option consistent with other options user/kmlussier/LP1522644-transfer-title-holds-issues
authorKathy Lussier <klussier@masslnc.org>
Fri, 3 Mar 2017 04:52:30 +0000 (23:52 -0500)
committerKathy Lussier <klussier@masslnc.org>
Fri, 3 Mar 2017 05:02:57 +0000 (00:02 -0500)
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>
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 3ab19cc..0a9df35 100644 (file)
@@ -388,9 +388,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;
@@ -1423,7 +1425,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);