<eg-grid
id-field="index"
- features="-display,-sort,-multisort"
- main-label="[% l('Checkouts') %]"
+ features="-sort,-multisort"
items-provider="gridDataProvider"
+ grid-controls="gridControls"
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('Alert Msg') %]"
+ path="acp.alert_message"></eg-grid-field>
+
+ <eg-grid-field label="[% l('Balance Owed') %]"
+ path='mbts.balance_owed'></eg-grid-field>
+
+ <eg-grid-field label="[% l('Barcode') %]" path="acp_barcode">
+ <!-- FIXME: ng-if / ng-disabled not working since the contents
+ are $interpolate'd and not $compile'd.
+ I want to hide / disable the href when there is no acp ID
+ -->
+ <a href="./cat/item/{{item.acp.id()}}/summary" target="_self">
+ {{item.copy_barcode}}
+ </a>
+ </eg-grid-field>
+
+ <eg-grid-field label="[% l('Bill #') %]"
+ path='circ.id'></eg-grid-field>
+
+ <eg-grid-field label="[% l('Call Number') %]"
+ path="acn.label"></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>
+ path='circ.due_date' dateformat='short'></eg-grid-field>
+
+ <eg-grid-field label="[% l('Family Name') %]"
+ path='au.family_name'></eg-grid-field>
+
+ <eg-grid-field label="[% l('Location') %]"
+ path='acp.location.name'> </eg-grid-field>
+
+ <eg-grid-field label="[% l('Remaining Renewals') %]"
+ path='circ.renewal_remaining'></eg-grid-field>
+
+ <eg-grid-field label="[% l('Title') %]" path="title">
+ <a target="_self" href="[% ctx.base_path %]/opac/record/{{record.doc_id()}}">
+ {{item.title}}
+ </a>
+ </eg-grid-field>
+
<eg-grid-field label="[% l('Author') %]"
- path='payload.record.author' visible></eg-grid-field>
- <eg-grid-field label="[% l('Call Number') %]"
- path='payload.copy.call_number.label' visible></eg-grid-field>
- <eg-grid-field label="[% l('Alert Msg') %]"
- path='payload.copy.alert_message' visible></eg-grid-field>
- <eg-grid-field label="[% l('Noncat #') %]"
- path='noncat_count' visible></eg-grid-field>
+ path="author" hidden></eg-grid-field>
+
+ <eg-grid-field path="circ.*" parent-idl-class="circ" hidden></eg-grid-field>
+ <eg-grid-field path="acp.*" parent-idl-class="acp" hidden></eg-grid-field>
+ <eg-grid-field path="acn.*" parent-idl-class="acn" hidden></eg-grid-field>
+ <eg-grid-field path="record.*" parent-idl-class="mvr" hidden></eg-grid-field>
+ <eg-grid-field path="mbts.*" parent-idl-class="mbts" hidden></eg-grid-field>
+ <eg-grid-field path="au.*" parent-idl-class="au" hidden></eg-grid-field>
</eg-grid>
<div class="flex-row pad-vert">
<eg-grid
id-field="index"
features="-sort,-multisort"
- main-label="[% l('Items Checked In') %]"
items-provider="gridDataProvider"
grid-controls="gridControls"
persist-key="circ.renew">
<h4 class="modal-title">[% l('Open Circulation') %]</h4>
</div>
<div class="modal-body">
-[% |l("{{circDate | date:'shortDate'}}") %]
-There is an open circulation on the requested item.
-This copy was checked out by another patron on [_1].
-[% END %]
+ <div ng-if="sameUser">
+ [% |l("{{circDate | date:'shortDate'}}") %]
+ There is an open circulation on the requested item.
+ This item was already checked out to this user on [_1].
+ [% END %]
+ </div>
+ <div ng-if="!sameUser">
+ [% |l("{{circDate | date:'shortDate'}}") %]
+ There is an open circulation on the requested item.
+ This copy was checked out by another patron on [_1].
+ [% END %]
+ </div>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary"
<div>[% l('You checked out the following items:') %]</div>
<hr/>
<ol>
- <li ng-repeat="circ in circulations">
- <div>{{circ.title}}</div>
+ <li ng-repeat="checkout in circulations">
+ <div>{{checkout.title}}</div>
<div>[% l('Barcode: [_1] Due: [_2]',
- '{{circ.target_copy.barcode}}',
- '{{circ.due_date | date:"short"}}') %]</div>
+ '{{checkout.copy.barcode}}',
+ '{{checkout.circ.due_date | date:"short"}}') %]</div>
</li>
</ol>
<hr/>
// each checkout.
patronSvc.patron_stats.checkouts.out++
- // TODO: munge from egCirc
-
- munge_checkout_resp(co_resp);
-
// copy the response event into the original grid row item
// note: angular.copy clobbers the destination
- angular.forEach(co_resp.evt, function(v, k) {
- row_item[k] = v;
+ row_item.evt = co_resp.evt;
+ angular.forEach(co_resp.data, function(val, key) {
+ row_item[key] = val;
});
+ munge_checkout_resp(co_resp, row_item);
},
function() {
// Circ was rejected somewhere along the way.
});
}
- // move some stuff around so it will play nice w/ the template
- function munge_checkout_resp(co_resp) {
- var payload = co_resp.evt.payload;
+ // add some checkout-specific additions for display
+ function munge_checkout_resp(co_resp, row_item) {
var params = co_resp.params;
-
- if (!payload) return;
-
- if (params.precat) {
- payload.record = {
- title : params.dummy_title,
- author : params.dummy_author,
- isbn : params.dummy_isbn
- };
- } else if (params.noncat) {
- payload.record = {
- title : egCore.env.cnct.map[params.noncat_type].name()
- };
- co_resp.evt.noncat_count = params.noncat_count;
- payload.circ = new egCore.idl.circ();
- payload.circ.due_date(payload.noncat_circ.duedate());
+ if (params.noncat) {
+ row_item.title = egCore.env.cnct.map[params.noncat_type].name();
+ row_item.noncat_count = params.noncat_count;
+ row_item.circ = new egCore.idl.circ();
+ row_item.circ.due_date(co_resp.evt.payload.noncat_circ.duedate());
}
}
if ($scope.checkouts.length == 0) return $q.when();
angular.forEach($scope.checkouts, function(co) {
- var circ = egCore.idl.toHash(co.payload.circ);
- circ.title = co.payload.record.title;
- print_data.circulations.push(circ);
+ if (co.circ) {
+ print_data.circulations.push({
+ circ : egCore.idl.toHash(co.circ),
+ copy : egCore.idl.toHash(co.acp),
+ call_number : egCore.idl.toHash(co.acn),
+ title : co.title,
+ author : co.author
+ })
+ };
});
return egCore.print.print({
}
service.circ_exists_dialog = function(evt, params, options) {
+
+ var openCirc = evt.payload.old_circ;
+ var sameUser = openCirc.usr() == params.patron_id;
+
return $modal.open({
templateUrl: './circ/share/t_circ_exists_dialog',
controller:
- ['$scope','$modalInstance','openCirc',
- function($scope , $modalInstance , openCirc) {
+ ['$scope','$modalInstance',
+ function($scope , $modalInstance) {
$scope.circDate = openCirc.xact_start();
+ $scope.sameUser = sameUser;
$scope.ok = function() { $modalInstance.close() }
$scope.cancel = function($event) {
$modalInstance.dismiss();
$event.preventDefault(); // form, avoid calling ok();
}
- }],
- resolve : {
- // fetch the conflicting open circulation
- openCirc : function() {
- return service.last_copy_circ(evt.payload.copy.id());
- }
- }
+ }]
}).result.then(
function() {