From 32a94f5cab44e63b9826d1de386149741a630b5c Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 6 Apr 2015 12:55:47 -0400 Subject: [PATCH] webstaff: Flat Text MARC editor support Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- .../src/templates/staff/cat/share/t_marcedit.tt2 | 224 +++++++++++---------- .../js/ui/default/staff/cat/services/marcedit.js | 16 ++ 2 files changed, 131 insertions(+), 109 deletions(-) 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 7dadafda01..1e1374ea3c 100644 --- a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 +++ b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 @@ -1,123 +1,129 @@
- +
+
{{calculated_record_type}}
-
-
-
- - - - - - -
-
- - - - - - -
-
- - - - - - -
-
- - - - - - -
-
- - - - - -
-
- - - - - - -
-
- - - - -
-
- - - - -
-
- - - - - - -
-
- - - - - - -
-
- - - - - - -
-
- - - - -
-
+
+
-
-
- -
-
- +
+
+
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + +
+
+ + + + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + +
+
-
- +
+
+ +
+
+ +
+
+ +
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 c114dd8141..9a364eab08 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 @@ -447,6 +447,9 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) controller : ['$timeout','$scope','egCore', 'egTagTable', function ( $timeout , $scope , egCore , egTagTable ) { + MARC21.Record.delimiter = '$'; + + $scope.flatEditor = false; $scope.bib_source = null; $scope.record_type = $scope.recordType || 'bre'; $scope.max_undo = $scope.maxUndo || 100; @@ -461,6 +464,17 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) egTagTable.loadTagTable(); + $scope.saveFlatTextMARC = function () { + $scope.record = new MARC21.Record({ marcbreaker : $scope.flat_text_marc }); + }; + + $scope.refreshVisual = function () { + if (!$scope.flatEditor) { + $scope.controlfields = $scope.record.fields.filter(function(f){ return f.isControlfield() }); + $scope.datafields = $scope.record.fields.filter(function(f){ return !f.isControlfield() }); + } + }; + $scope.onKeydown = function (event) { var event_return = true; @@ -798,6 +812,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) $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; + $scope.flat_text_marc = $scope.record.toBreaker(); if ($scope.record_type == 'bre') { $scope.bib_source = $scope[$scope.record_type].source(); @@ -824,6 +839,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) $scope.force_render = false; } + $scope.flat_text_marc = newVal; } if ($scope.record_undo_stack.length != $scope.save_stack_depth) { -- 2.11.0