From 85c199c63984620cd1a8ad31d112492c61d1b4c4 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 28 Aug 2015 00:45:23 +0000 Subject: [PATCH] webstaff: add support for editing authority records This adds basic support for invoking the MARC editor on authority records, and fixes a couple bugs discovered along the way. The route currently supported is /cat/catalog/authority/:authority_id/marc_edit In the future, some sort of summary view of an authority record might be added, in which case the route "/cat/catalog/authority/:authority_id" is available. Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- .../src/templates/staff/cat/catalog/t_authority.tt2 | 3 +++ Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/cat/catalog/app.js | 19 +++++++++++++++++++ .../web/js/ui/default/staff/cat/services/marcedit.js | 2 +- .../web/js/ui/default/staff/cat/services/tagtable.js | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/src/templates/staff/cat/catalog/t_authority.tt2 diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_authority.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_authority.tt2 new file mode 100644 index 0000000000..cfacc9684c --- /dev/null +++ b/Open-ILS/src/templates/staff/cat/catalog/t_authority.tt2 @@ -0,0 +1,3 @@ +
+ +
diff --git a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 index 68a9ac57fa..f4503167af 100644 --- a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 +++ b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 @@ -114,7 +114,7 @@ - + diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 358e97efc9..c31adccbd5 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -78,6 +78,12 @@ angular.module('egCatalogApp', ['ui.bootstrap','ngRoute','egCoreMod','egGridMod' resolve : resolver }); + $routeProvider.when('/cat/catalog/authority/:authority_id/marc_edit', { + templateUrl: './cat/catalog/t_authority', + controller: 'AuthorityCtrl', + resolve : resolver + }); + $routeProvider.otherwise({redirectTo : '/cat/catalog/index'}); }) @@ -562,6 +568,19 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e }]) +.controller('AuthorityCtrl', + ['$scope','$routeParams','$location','$window','$q','egCore', +function($scope , $routeParams , $location , $window , $q , egCore) { + + // set record ID on page load if available... + $scope.authority_id = $routeParams.authority_id; + + if ($routeParams.authority_id) $scope.from_route = true; + else $scope.from_route = false; + + $scope.stop_unload = false; +}]) + .controller('URLVerifyCtrl', ['$scope','$location', function($scope , $location) { diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js index 8f52306fd0..1345415b57 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js @@ -469,7 +469,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) $scope.controlfields = []; $scope.datafields = []; - egTagTable.loadTagTable(); + egTagTable.loadTagTable({ marcRecordType : $scope.record_type }); $scope.saveFlatTextMARC = function () { $scope.record = new MARC21.Record({ marcbreaker : $scope.flat_text_marc }); diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js b/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js index f4d5e973f2..f726f2ee1c 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js @@ -36,7 +36,7 @@ function($q, egCore, egAuth) { fields.marcFormat = args.marcFormat; } if (args.marcRecordType) { - fields.marcFormat = service.normalizeRecordType(args.marcFormat); + fields.marcRecordType = service.normalizeRecordType(args.marcRecordType); } } var tt_key = 'current_tag_table_' + fields.marcFormat + '_' + -- 2.11.0