<div>
- <div ng-if="bre" class="row col-md-12 pad-vert marcfastitemadd" ng-hide="brandNewRecord">
- <input id="mfiacn" type="text" placeholder="[% l('Call Number') %]" ng-model="fast_item_callnumber"/>
- <input id="mfiabc" type="text" placeholder="[% l('Barcode') %]" ng-model="fast_item_barcode"/>
- <button class="btn btn-default" ng-click="saveFastItem()">Add Item</button>
+ <div ng-show="bre" class="row pad-vert marcfastitemadd" ng-hide="brandNewRecord">
+ <div class="col-md-2">
+ <label><input type="checkbox" ng-model="enable_fast_add"/> [% l('Add Item') %]</label>
+ </div>
+ <div class="col-md-2">
+ <input id="mfiacn" class="form-control" ng-show="enable_fast_add" type="text" placeholder="[% l('Call Number') %]" ng-model="fast_item_callnumber"/>
+ </div>
+ <div class="col-md-2">
+ <input id="mfiabc" class="form-control" ng-show="enable_fast_add" type="text" placeholder="[% l('Barcode') %]" ng-model="fast_item_barcode"/>
+ </div>
</div>
- <div class="pad-vert row col-md-12 marctypesource">
+ <div class="pad-vert row marctypesource">
<div class="col-md-2">
- <label>Flat Text Editor:</label>
- <input type="checkbox" ng-model="flatEditor" ng-change="refreshVisual()"/>
+ <label>
+ <input type="checkbox" ng-model="flatEditor" ng-change="refreshVisual()"/>
+ [% l('Flat Text Editor') %]
+ </label>
</div>
<div class="col-md-2">
- <label>Record Type:</label>
- {{calculated_record_type}}
+ <div class="input-group">
+ <span class="input-group-addon"><b>[% l('Record Type') %]</b></span>
+ <span class="input-group-addon">{{calculated_record_type}}</span>
+ </div>
</div>
<div ng-if="bre" class="col-md-2">
<eg-marc-edit-bibsource/>
</div>
- <div class="col-md-1">
- <button class="btn btn-default" ng-show="record_type == 'bre'" ng-click="validateHeadings()">[% l('Validate') %]</button>
- </div>
- <div class="col-md-1">
- <button class="btn btn-default" ng-click="saveRecord()">Save</button>
- </div>
- <div class="col-md-1">
- <button class="btn btn-default" ng-click="seeBreaker()">Breaker</button>
- </div>
- <div class="col-md-1" ng-hide="brandNewRecord">
- <button ng-hide="Record().deleted()" class="btn btn-default" ng-click="deleteRecord()">Delete</button>
- <button ng-show="Record().deleted()" class="btn btn-default" ng-click="undeleteRecord()">Undelete</button>
+ <div class="col-md-6">
+ <div class="btn-group">
+ <span class="btn-group">
+ <button class="btn btn-default" ng-show="record_type == 'bre'" ng-click="validateHeadings()">[% l('Validate') %]</button>
+ </span>
+ <span class="btn-group">
+ <button class="btn btn-default" ng-click="saveRecord()">[% l('Save') %]</button>
+ </span>
+ <span class="btn-group">
+ <button class="btn btn-default" ng-click="seeBreaker()">[% l('Breaker') %]</button>
+ </span>
+ <span class="btn-group">
+ <button ng-hide="brandNewRecord || Record().deleted()" class="btn btn-default" ng-click="deleteRecord()">[% l('Delete') %]</button>
+ <button ng-if="!brandNewRecord && Record().deleted()" class="btn btn-default" ng-click="undeleteRecord()">[% l('Undelete') %]</button>
+ </span>
+ </div>
</div>
</div>
});
},
- controller : ['$timeout','$scope','$q','egCore', 'egTagTable',
- function ( $timeout , $scope , $q, egCore , egTagTable ) {
+ controller : ['$timeout','$scope','$q','$window','egCore', 'egTagTable',
+ function ( $timeout , $scope , $q, $window , egCore , egTagTable ) {
MARC21.Record.delimiter = '$';
+ $scope.enable_fast_add = false;
+ $scope.fast_item_callnumber = '';
+ $scope.fast_item_barcode = '';
$scope.flatEditor = false;
$scope.brandNewRecord = false;
$scope.bib_source = null;
if ($scope.recordId) {
return egCore.pcrud.update(
$scope.Record()
- ).then(loadRecord);
+ ).then(function() {
+ if ($scope.enable_fast_add) {
+ egCore.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.anon_cache.set_value',
+ null, 'edit-these-copies', {
+ record_id: $scope.recordId,
+ raw: [{
+ label : $scope.fast_item_callnumber,
+ barcode : $scope.fast_item_barcode,
+ }],
+ hide_vols : false,
+ hide_copies : false
+ }
+ ).then(function(key) {
+ if (key) {
+ var url = egCore.env.basePath + 'cat/volcopy/' + key;
+ $timeout(function() { $window.open(url, '_blank') });
+ } else {
+ alert('Could not create anonymous cache key!');
+ }
+ });
+ }
+ }).then(loadRecord);
} else {
$scope.Record().creator(egCore.auth.user().id());
$scope.Record().create_date('now');
$scope.Record()
).then(function(bre) {
$scope.recordId = bre.id();
+ if ($scope.enable_fast_add) {
+ egCore.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.anon_cache.set_value',
+ null, 'edit-these-copies', {
+ record_id: $scope.recordId,
+ raw: [{
+ label : $scope.fast_item_callnumber,
+ barcode : $scope.fast_item_barcode,
+ }],
+ hide_vols : false,
+ hide_copies : false
+ }
+ ).then(function(key) {
+ if (key) {
+ var url = egCore.env.basePath + 'cat/volcopy/' + key;
+ $timeout(function() { $window.open(url, '_blank') });
+ } else {
+ alert('Could not create anonymous cache key!');
+ }
+ });
+ }
}).then(loadRecord);
}
+
+
};
$scope.seeBreaker = function () {