</div>
</div>
- <div class="pad-vert row marctypesource">
- <div class="col-md-2 form-group" ng-show="!flatOnly">
+ <div class="pad-vert pad-left row flex-row marctypesource">
+ <div class="form-group pad-horiz" ng-show="!flatOnly">
<label>
<input type="checkbox" ng-model="flatEditor.isEnabled" ng-change="refreshVisual()"/>
[% l('Flat Text Editor') %]
</label>
</div>
- <div class="col-md-2 form-group" ng-show="!flatOnly">
+ <div class="form-group pad-horiz" ng-show="!flatOnly">
<label>
<input type="checkbox" ng-model="stackSubfields.enabled" />
[% l('Stack subfields') %]
</label>
</div>
- <div class="col-md-3">
- <div class="input-group">
+ <div class="">
+ <div class="input-group pad-horiz">
<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">
+ <div ng-if="bre" class="pad-horiz">
<eg-marc-edit-bibsource/>
</div>
- <div class="col-md-3">
+ <div class="pad-horiz">
<div class="btn-group">
<span class="btn-group">
<button class="btn btn-default" ng-show="record_type == 'bre' && !flatOnly" ng-click="validateHeadings()">[% l('Validate') %]</button>
egHolds.transfer_all_bib_holds_to_marked_title(bib_ids);
}
+ // Refresh and update a single bib record.
+ // Returns a promise.
+ function updateOneRecord(recId, marcXml) {
+
+ return egCore.net.request(
+ 'open-ils.cat',
+ 'open-ils.cat.biblio.record.xml.update',
+ egCore.auth.token(), recId, marcXml
+ ).then(function(result) {
+ var evt = egCore.evt.parse(result);
+ if (evt) {
+ alert(evt);
+ return $q.reject(evt);
+ } else {
+ return result; // bib record
+ }
+ });
+ }
+
// opens the record merge dialog
$scope.openRecordMergeDialog = function(records) {
$uibModal.open({
}
$scope.post_edit_inplace = function() {
$scope.editing_inplace = false;
+ updateOneRecord($scope.lead_id, $scope.lead.marc_xml);
}
+
$scope.edit_lead_inplace = function() {
$scope.editing_inplace = true;
}
$scope.edit_lead = function() {
var lead = { marc_xml : $scope.lead.marc_xml };
-
- // passing the on-save callback this way is a
- // hack - this invocation of the MARC editor doesn't
- // need it, but for some reason using this stomps
- // over the callback set by the other MARC editor
- // instance
- var callback = $scope.post_edit_inplace;
+ var parentScope = $scope;
$uibModal.open({
templateUrl: './cat/bucket/record/t_edit_lead_record',
$scope.dirty_flag = false;
$scope.ok = function() { $uibModalInstance.close() }
$scope.cancel = function () { $uibModalInstance.dismiss() }
- $scope.on_save = callback;
+ $scope.on_save = function() {
+ parentScope.lead.marc_xml = $scope.lead.marc_xml;
+ parentScope.post_edit_inplace();
+ }
}]
}).result.then(function() {
$scope.lead.marc_xml = lead.marc_xml;
function update_bib() {
if (args.merge_profile) {
- return egCore.pcrud.retrieve('bre', args.lead_id)
- .then(function(rec) {
- rec.marc(args.lead.marc_xml);
- rec.edit_date('now');
- rec.editor(egCore.auth.user().id());
- return egCore.pcrud.update(rec);
- });
+ return updateOneRecord(args.lead_id, args.lead.marc_xml);
} else {
return $q.when();
}