From: Bill Erickson Date: Tue, 8 Jul 2014 18:17:08 +0000 (-0400) Subject: capture holds X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=afb98a99c316f2f9f27da448dae3037855d70f4c;p=working%2FEvergreen.git capture holds Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/checkin/index.tt2 b/Open-ILS/src/templates/staff/circ/checkin/index.tt2 index ed53423a67..dd2c0cf4d2 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/index.tt2 @@ -2,7 +2,6 @@ WRAPPER "staff/base.tt2"; ctx.page_title = l("Check In"); ctx.page_app = "egCheckinApp"; - ctx.page_ctrl = "CheckinCtrl"; %] [% BLOCK APP_JS %] @@ -15,229 +14,6 @@ [% END %] -
-
- [% l('Checkin Items') %] -
-
- -
-
-
-
- [% l('Backdated Check In [_1]', - '{{checkinArgs.backdate | date:"shortDate"}}') %] -
-
- [% l('Ignore Pre-Cataloged Items') %] -
-
- [% l('Suppress Holds and Transits') %] -
-
- [% l('Amnesty Mode') %] -
-
- [% l('Auto-Print Hold and Transit Slips') %] -
-
- [% l('Clear Holds Shelf') %] -
-
-
- [% l('Always Retarget Local Holds') %] -
-
- [% l('Retarget Local Holds') %] -
-
-
- [% l('Capture Local Holds As Transits') %] -
-
-
-
- - -
-
-
-
- - - - - - -
-
-
- -
-
- - [% l('[_1] was already checked in.', '{{alert.already_checked_in}}') %] - - - [% l('Item [_1] has never circulated.', '{{alert.item_never_circed}}') %] - -
-
- -
-
-
-
[% l('Effective Date') %]
- -
-
-
-
-
- -
-
- [% l('Fine Tally:') %] - {{fine_total | currency}} - - [% l('Transaction for [_1] billed:', '{{billable_barcode}}') %] - {{billable_amount | currency}} - -
-
- -
- -[% INCLUDE 'staff/circ/checkin/t_checkin_table.tt2' %] - - - +
[% END %] diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 new file mode 100644 index 0000000000..83b88f50b4 --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 @@ -0,0 +1,225 @@ +
+
+ [% l('Checkin Items') %] + [% l('Capture Holds') %] +
+
+ +
+
+
+
+ [% l('Backdated Check In [_1]', + '{{checkinArgs.backdate | date:"shortDate"}}') %] +
+
+ [% l('Ignore Pre-Cataloged Items') %] +
+
+ [% l('Suppress Holds and Transits') %] +
+
+ [% l('Amnesty Mode') %] +
+
+ [% l('Auto-Print Hold and Transit Slips') %] +
+
+ [% l('Clear Holds Shelf') %] +
+
+
+ [% l('Always Retarget Local Holds') %] +
+
+ [% l('Retarget Local Holds') %] +
+
+
+ [% l('Capture Local Holds As Transits') %] +
+
+
+
+ + +
+
+
+
+ + + + + + +
+
+
+ +
+
+ + [% l('[_1] was already checked in.', '{{alert.already_checked_in}}') %] + + + [% l('Item [_1] has never circulated.', '{{alert.item_never_circed}}') %] + +
+
+ +
+
+
+
[% l('Effective Date') %]
+ +
+
+
+
+
+ +
+
+ [% l('Fine Tally:') %] + {{fine_total | currency}} + + [% l('Transaction for [_1] billed:', '{{billable_barcode}}') %] + {{billable_amount | currency}} + +
+
+ +
+ +[% INCLUDE 'staff/circ/checkin/t_checkin_table.tt2' %] + + + diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 index 41401f1eea..9156842346 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 @@ -6,8 +6,7 @@ main-label="[% l('Items Checked In') %]" items-provider="gridDataProvider" grid-controls="gridControls" - persist-key="circ.checkin"> - + persist-key="{{grid_persist_key}}">
  • - + [% l('Check In') %]
  • + + + [% l('Capture Holds') %] + +
  • +
  • [% l('Renew Items') %] diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js index 366dd262b0..79b1fd710f 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js @@ -4,6 +4,23 @@ angular.module('egCheckinApp', ['ngRoute', 'ui.bootstrap', .config(function($routeProvider, $locationProvider, $compileProvider) { $locationProvider.html5Mode(true); $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); // grid export + + var resolver = {delay : + ['egStartup', function(egStartup) {return egStartup.go()}]} + + $routeProvider.when('/circ/checkin/checkin', { + templateUrl: './circ/checkin/t_checkin', + controller: 'CheckinCtrl', + resolve : resolver + }); + + $routeProvider.when('/circ/checkin/capture', { + templateUrl: './circ/checkin/t_checkin', + controller: 'CheckinCtrl', + resolve : resolver + }); + + $routeProvider.otherwise({redirectTo : '/circ/checkin/checkin'}); }) .factory('checkinSvc', [function() { @@ -20,40 +37,50 @@ angular.module('egCheckinApp', ['ngRoute', 'ui.bootstrap', ['$scope','$q','$window','$location','egCore','checkinSvc','egGridDataProvider','egCirc', function($scope , $q , $window , $location , egCore , checkinSvc , egGridDataProvider , egCirc) { - var suppress_popups = false; - - // run egCore.startup here since it's not handled via resolver - egCore.startup.go().then( - function() { - // handle post-startup business - egCore.org.settings([ - 'ui.circ.suppress_checkin_popups' // more will likely follow.. - ]) - .then(function(set) { - suppress_popups = set['ui.circ.suppress_checkin_popups']; - }); - } - ); - - var today = new Date(); $scope.focusMe = true; $scope.checkins = checkinSvc.checkins; + var today = new Date(); $scope.checkinArgs = {backdate : today} $scope.using_hatch = egCore.hatch.usingHatch(); $scope.modifiers = {}; $scope.fine_total = 0; + $scope.is_capture = $location.path().match(/capture$/); + var suppress_popups = false; + $scope.grid_persist_key = $scope.is_capture ? + 'circ.checkin.capture' : 'circ.checkin.checkin'; + + egCore.org.settings([ + 'ui.circ.suppress_checkin_popups' // add other settings as needed + ]).then(function(set) { + suppress_popups = set['ui.circ.suppress_checkin_popups']; + }); + + // checkin & hold capture modifiers + var modifiers = [ + 'void_overdues', + 'clear_expired', + 'hold_as_transit', + 'manual_float', + 'no_precat_alert', + 'retarget_holds', + 'retarget_holds_all' + ]; + + if ($scope.is_capture) { + // in hold capture mode, some values are forced, regardless + // of stored preferences. + $scope.modifiers.noop = false; + $scope.modifiers.auto_print_holds_transits = true; + } else { + modifiers.push('noop'); // AKA suppress holds and transits + modifiers.push('auto_print_holds_transits'); + } // set modifiers from stored preferences - angular.forEach(['noop','void_overdues', 'clear_expired', - 'hold_as_transit','manual_float','no_precat_alert', - 'auto_print_holds_transits','retarget_holds','retarget_holds_all'], - function(mod) { - egCore.hatch.getItem('eg.circ.checkin.' + mod) - .then(function(val) { - if (val) $scope.modifiers[mod] = true; - }); - } - ); + angular.forEach(modifiers, function(mod) { + egCore.hatch.getItem('eg.circ.checkin.' + mod) + .then(function(val) { if (val) $scope.modifiers[mod] = true }); + }); // set / unset a checkin modifier // when set, store the preference diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 138394aa86..02ca8d847a 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -270,6 +270,7 @@ It also allows us to abstract away some browser finickiness. // user's expectations. Note this allows us to retain // the timezone. function strip_time(date) { + if (!date) return null; date.setHours(0); date.setMinutes(0); date.setSeconds(0);