From 68c50a6d1c2d6e5efb6c3548a10851bb6cefe58e Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 17 Feb 2015 13:30:57 -0500 Subject: [PATCH] LP#1402797 Add (stub) fast item add, and (working) bib source selection Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- .../src/templates/staff/cat/share/t_marcedit.tt2 | 37 +++++++++++++++ Open-ILS/src/templates/staff/css/cat.css.tt2 | 6 ++- .../js/ui/default/staff/cat/services/marcedit.js | 53 +++++++++++++++------- 3 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 diff --git a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 new file mode 100644 index 0000000000..1d4dbba728 --- /dev/null +++ b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 @@ -0,0 +1,37 @@ +
+
+
+ + + +
+
+
+
+
+
{{calculated_record_type}}
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ + + diff --git a/Open-ILS/src/templates/staff/css/cat.css.tt2 b/Open-ILS/src/templates/staff/css/cat.css.tt2 index 2d653a879d..ba4f41a48c 100644 --- a/Open-ILS/src/templates/staff/css/cat.css.tt2 +++ b/Open-ILS/src/templates/staff/css/cat.css.tt2 @@ -1,5 +1,9 @@ .marcrecord { - background-color: lightgrey; + //background-color: lightgrey; +} + +.marcfastitemadd, .marctypesource { + border-bottom: solid thin gray; } .marcedit { 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 000587cfb8..f6f2e05304 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 @@ -267,23 +267,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) /// TODO: fixed field editor and such .directive("egMarcEditRecord", function () { return { - template: '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - ''+ - '
'+ - '', + templateUrl : './cat/share/t_marcedit', restrict: 'E', replace: false, scope: { recordId : '=', recordType : '@', maxUndo : '@' }, @@ -304,6 +288,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) controller : ['$timeout','$scope','egCore', function ( $timeout , $scope , egCore ) { + $scope.bib_source = null; $scope.record_type = $scope.recordType || 'bre'; $scope.max_undo = $scope.maxUndo || 100; $scope.record_undo_stack = []; @@ -648,9 +633,15 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) $scope.in_redo = true; $scope[$scope.record_type] = rec; $scope.record = new MARC.Record({ marcxml : $scope[$scope.record_type].marc() }); + $scope.calculated_record_type = $scope.record.recordType(); $scope.controlfields = $scope.record.fields.filter(function(f){ return f.isControlfield() }); $scope.datafields = $scope.record.fields.filter(function(f){ return !f.isControlfield() }); $scope.save_stack_depth = $scope.record_undo_stack.length; + + if ($scope.record_type == 'bre') { + $scope.bib_source = $scope[$scope.record_type].source(); + } + }).then(setCaret); } @@ -792,4 +783,32 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) } }) +.directive("egMarcEditBibsource", ['$timeout',function ($timeout) { + return { + restrict: 'E', + replace: false, + template: ''+ + ''+ + '', + controller: ['$scope','egCore', + function ($scope , egCore) { + + egCore.pcrud.retrieveAll('cbs', {}, {atomic : true}) + .then(function(list) { $scope.bib_sources = list; }); + + $scope.$watch('bib_source', + function(newVal, oldVal) { + if (newVal !== oldVal) { + $scope.bre.source(newVal); + } + } + ); + + } + ] + } +}]) + ; -- 2.11.0