--- /dev/null
+<div>
+ <div class="modal-header">
+ <button type="button" class="close"
+ ng-click="cancel()" aria-hidden="true">×</button>
+ <h4 class="modal-title">[% l('Edit MARC Record') %]</h4>
+ </div>
+ <div class="modal-body">
+ <eg-marc-edit-record dirty-flag="dirty_flag" marc-xml="args.marc_xml"
+ in-place-mode="true" record-type="bre" save-label="[% l('Modify') %]" />
+ </div>
+ <div class="modal-footer">
+ <input type="submit" ng-click="ok(args)"
+ class="btn btn-primary" value="[% l('Use Edits') %]"/>
+ <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
+ </div>
+</div>
}])
.controller('VandelayCtrl',
- ['$scope','$location',
-function($scope , $location) {
+ ['$scope','$location', 'egCore', '$uibModal',
+function($scope , $location, egCore, $uibModal) {
$scope.vandelay_url = $location.absUrl().replace(/\/staff\/cat\/catalog\/vandelay/, '/vandelay/vandelay');
+ $scope.funcs = {};
+ $scope.funcs.edit_marc_modal = function(bre, callback){
+ var marcArgs = { 'marc_xml': bre.marc() };
+ var vqbibrecId = bre.id();
+ $uibModal.open({
+ templateUrl: './cat/catalog/t_edit_marc_modal',
+ size: 'lg',
+ controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
+ $scope.focusMe = true;
+ $scope.recordId = vqbibrecId;
+ $scope.args = marcArgs;
+ $scope.dirty_flag = false;
+ $scope.ok = function(marg){
+ $uibModalInstance.close(marg);
+ };
+ $scope.cancel = function(){ $uibModalInstance.dismiss() }
+ }]
+ }).result.then(function(res){
+ var new_xml = res.marc_xml;
+ egCore.pcrud.retrieve('vqbr', vqbibrecId).then(function(vqbib){
+ vqbib.marc(new_xml);
+ egCore.pcrud.update(vqbib).then( function(){ callback(vqbibrecId); });
+ });
+ });
+ };
}])
.controller('ManageAuthoritiesCtrl',
To run in Firefox directly, must set signed.applets.codebase_principal_support
to true in about:config
*/
+ if(window.IAMBROWSER){
+ xulG.edit_marc_modal(rec, function(breId){ vlLoadMARCHtml(breId, false, postReloadHTMLHandler); });
+ return;
+ }
+
win = window.open('/xul/server/cat/marcedit.xul','','chrome'); // XXX version?
var type;