<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>
+ <button class="btn btn-primary" ng-click="saveRecord()">{{ saveLabel || "[% l('Save') %]"}}</button>
</span>
<span class="btn-group">
<button ng-hide="brandNewRecord || Record().deleted()" class="btn btn-default" ng-click="deleteRecord()">[% l('Delete') %]</button>
s.IMPORTED_RECORD_FROM_Z3950_AS_ID = "[% l('Record imported as ID [_1]', '{{id}}') %]";
s.GO_TO_RECORD = "[% l('Go to record') %]";
s.GO_BACK = "[% l('Go back') %]";
+ s.IMPORT_BUTTON_LABEL = "[% l('Import') %]";
+ s.SAVE_BUTTON_LABEL = "[% l('Save') %]";
}]);
</script>
</div>
<div class="modal-body">
<eg-marc-edit-record dirty-flag="dirty_flag" record-id="record_id" marc-xml="marc_xml"
- record-type="bre"
+ record-type="bre" save-label="{{save_label}}"
+ on-save="import_record_callback"
/>
</div>
<div class="modal-footer">
+ <button class="btn btn-primary" ng-click="ok()" ng-disabled="!record_id">[% l('Go to imported record') %]</button>
<button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
</div>
</div>
$scope.spawn_editor = function() {
var items = $scope.gridControls.selectedItems();
+ var recId = 0;
$modal.open({
templateUrl: './cat/z3950/t_marc_edit',
size: 'lg',
controller:
['$scope', '$modalInstance', function($scope, $modalInstance) {
$scope.focusMe = true;
- $scope.record_id = 0;
+ $scope.record_id = recId;
$scope.dirty_flag = false;
$scope.marc_xml = items[0]['marcxml'];
$scope.ok = function(args) { $modalInstance.close(args) }
$scope.cancel = function () { $modalInstance.dismiss() }
+ $scope.save_label = egCore.strings.IMPORT_BUTTON_LABEL;
+ $scope.import_record_callback = function (record_id) {
+ recId = record_id;
+ $scope.save_label = egCore.strings.SAVE_BUTTON_LABEL;
+ };
}]
- }).result.then(function (args) {
- if (!args || !args.name) return;
+ }).result.then(function () {
+ if (recId) {
+ $window.location.href = egCore.env.basePath + 'cat/catalog/record/' + recId;
+ }
});
}