<option value="bills_current">[% l('Bills, Current') %]</option>
<option value="bills_historical">[% l('Bills, Historical') %]</option>
<option value="bill_payment">[% l('Bills, Payment') %]</option>
+ <option value="patron_address">[% l('Patron Address') %]</option>
<option value="patron_note">[% l('Patron Note') %]</option>
<option value="transit_slip">[% l('Transit Slip') %]</option>
</select>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
- <li><a href='' ng-click="checkoutArgs.noncat_type='barcode';focusMe=true">
+ <li><a href
+ ng-click="checkoutArgs.noncat_type='barcode';focusMe=true">
[% l('Barcode') %]</a>
</li>
<li class="divider"></li>
</div>
</form>
</div>
+ <div class="col-md-6">
+ <div class="flex-row">
+ <div class="flex-cell"></div>
+ <div class="checkbox pad-horiz">
+ <label>
+ <input type="checkbox" ng-model="checkoutArgs.sticky_date"/>
+ [% l('Specific Due Date') %]
+ </label>
+ </div>
+ <!--
+ <div><input type="checkbox" class="checkbox" ng-model="checkoutArgs.sticky_date"/></div>
+ <div class="pad-horiz">[% l('Specific Due Date') %]</div>
+ -->
+ <!-- FIXME: This needs a time component as well, but type="datetime"
+ is not yet supported by any browsers -->
+ <div><input eg-date-input class="form-control"
+ ng-model="checkoutArgs.due_date"/>
+ </div>
+ </div>
+ </div>
</div>
+<hr/>
<eg-grid
id-field="id"
persist-key="circ.patron.checkout">
<eg-grid-field label="[% l('Barcode') %]" path='copy_barcode' visible></eg-grid-field>
<eg-grid-field label="[% l('Circ ID') %]" path='payload.circ.id' visible></eg-grid-field>
- <eg-grid-field label="[% l('Due Date') %]" path='payload.circ.due_date' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Due Date') %]" path='payload.circ.due_date'
+ visible datatype="timestamp" dateformat="short"></eg-grid-field>
<eg-grid-field label="[% l('Response') %]" path='textcode' visible></eg-grid-field>
<eg-grid-field label="[% l('Title') %]" path='payload.record.title' visible></eg-grid-field>
<eg-grid-field label="[% l('Author') %]" path='payload.record.author' visible></eg-grid-field>
<div class="panel">
<div class="panel-body">
<fieldset>
- <legend>{{addr.address_type()}}</legend>
+ <legend>
+ {{addr.address_type()}}
+ <a href class="pad-horiz patron-summary-act-link"
+ ng-click="print_address(addr)">[% l('(print)') %]</a>
+ </legend>
<div>{{addr.street1()}} {{addr.street2()}}</div>
<div>{{addr.city()}}, {{addr.state()}} {{addr.post_code()}}</div>
</fieldset>
but the ones I'm finding aren't quite cutting it..*/
.patron-summary-alert {color: red; font-weight:bold}
.patron-summary-alert-small {color: red}
-
.patron-summary-divider { border-top: 1px solid #CCC}
+.patron-summary-act-link {font-size: .8em;}
+
#patron-checkout-barcode { width: 16em; }
#patron-search-form div.form-group {
--- /dev/null
+<div>
+ <div>
+ {{patron.first_given_name}}
+ {{patron.second_given_name}}
+ {{patron.family_name}}
+ </div>
+ <div>{{address.street1}}</div>
+ <div ng-if="address.street2">{{address.street2}}</div>
+ <div>
+ {{address.city}}, {{address.state}} {{address.post_code}}
+ </div>
+</div>
},
title : seed_record.title,
author : seed_record.author,
- staff : egCore.idl.toHash(egCore.auth.user())
+ staff : egCore.idl.toHash(egCore.auth.user()),
+ patron : egCore.idl.toHash(egCore.auth.user()),
+ address : seed_addr
}
$scope.preview_scope.payments = [
$scope.patron = function() { return patronSvc.current }
$scope.patron_stats = function() { return patronSvc.patron_stats }
$scope.summary_stat_cats = function() { return patronSvc.summary_stat_cats }
+
+ $scope.print_address = function(addr) {
+ egCore.hatch.printFromTemplate('default', 'patron_address', {
+ patron : egCore.idl.toHash(patronSvc.current),
+ address : egCore.idl.toHash(addr)
+ });
+ }
}])
.controller('PatronBarcodeSearchCtrl',
var search = {};
angular.forEach(args, function(val, key) {
if (!val) return;
- if (key == 'profile') {
+ if (key == 'profile' && args.profile) {
search.profile = {value : args.profile.id(), group : 0};
- } else if (key == 'home_ou') {
+ } else if (key == 'home_ou' && args.home_ou) {
search.home_ou = args.home_ou.id(); // passed separately
} else if (key == 'inactive') {
search.inactive = val;
$scope.initTab('checkout', $routeParams.id);
$scope.focusMe = true;
$scope.checkouts = patronSvc.checkouts;
- $scope.checkoutArgs = {noncat_type : 'barcode'};
+ $scope.checkoutArgs = {
+ noncat_type : 'barcode',
+ due_date : new Date()
+ };
$scope.gridDataProvider = egGridDataProvider.instance({
get : function(offset, count) {
return this.arrayNotifier($scope.checkouts, offset, count);
var params = angular.copy(args);
params.patron_id = patronSvc.current.id();
+ if (args.sticky_date) {
+ params.due_date = args.due_date.toISOString();
+ } else {
+ delete params.due_date;
+ }
+ delete params.sticky_date;
+
if (params.noncat_type == 'barcode') {
if (!args.copy_barcode) return;
path : '@', // optional; flesh path
label : '@', // optional; display label
flex : '@', // optional; default flex width
+ dateformat : '@', // optional: passed down to egGridValueFilter
// optional: for non-IDL columns, specifying a datatype
// lets the caller control which display filter is used.
sortable : colSpec.sortable,
nonsortable : colSpec.nonsortable,
multisortable : colSpec.multisortable,
- nonmultisortable : colSpec.nonmultisortable
+ nonmultisortable : colSpec.nonmultisortable,
+ dateformat : colSpec.dateformat
};
}
}
case 'timestamp':
// canned angular date filter FTW
- return $filter('date')(value, 'shortDate');
+ if (!column.dateformat)
+ column.dateformat = 'shortDate';
+ return $filter('date')(value, column.dateformat);
case 'money':
return $filter('currency')(value);
default: