</div>
</div>
<div class="modal-footer">
- <input ng-if="!sameUser" type="submit" class="btn btn-primary"
- value="[% l('Normal Checkin then Checkout') %]"/>
- <input ng-if="sameUser" type="submit" class="btn btn-primary"
- value="[% l('Renew') %]"/>
- <button class="btn btn-warning"
- ng-click="cancel($event)">[% l('Cancel') %]</button>
+ <div class="form-group row">
+ <div class="col-md-3">
+ <label for="forgive-checkbox">[% l('Forgive fines?') %]</label>
+ </div>
+ <div class="col-md-1">
+ <input type="checkbox" class="checkbox"
+ id="forgive-checkbox" ng-model="args.forgive_fines"/>
+ </div>
+ <div class="col-md-8">
+ <input ng-if="!sameUser" type="submit" class="btn btn-primary"
+ value="[% l('Normal Checkin then Checkout') %]"/>
+ <input ng-if="sameUser" type="submit" class="btn btn-primary"
+ value="[% l('Renew') %]"/>
+ <button class="btn btn-warning"
+ ng-click="cancel($event)">[% l('Cancel') %]</button>
+ </div>
</div>
</div> <!-- modal-content -->
</div> <!-- modal-dialog -->
controller:
['$scope','$modalInstance',
function($scope , $modalInstance) {
+ $scope.args = {forgive_fines : false};
$scope.circDate = openCirc.xact_start();
$scope.sameUser = sameUser;
- $scope.ok = function() { $modalInstance.close() }
+ $scope.ok = function() { $modalInstance.close($scope.args) }
$scope.cancel = function($event) {
$modalInstance.dismiss();
$event.preventDefault(); // form, avoid calling ok();
}
}]
}).result.then(
- function() {
+ function(args) {
if (sameUser) {
+ params.void_overdues = args.forgive_fines;
options.override = true;
return service.renew(params, options);
}
- return service.checkin(
- {barcode : params.copy_barcode, noop : true}
- ).then(function(checkin_resp) {
+ return service.checkin({
+ barcode : params.copy_barcode,
+ noop : true,
+ void_overdues : args.forgive_fines
+ }).then(function(checkin_resp) {
if (checkin_resp.evt.textcode == 'SUCCESS') {
return service.checkout(params, options);
} else {