[open-ils-commits] [GIT] Evergreen ILS branch master updated. d07e88235a50dfb7f7ddca8fc265cb94eac69891

Evergreen Git git at git.evergreen-ils.org
Wed Sep 20 17:48:26 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  d07e88235a50dfb7f7ddca8fc265cb94eac69891 (commit)
      from  3e93cfcddb3622951e7b08d1463f70d96fad51f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d07e88235a50dfb7f7ddca8fc265cb94eac69891
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Fri Sep 15 17:02:31 2017 -0400

    LP#1700635: enable eg-marc-editor for queued records in MARC Batch Import/Export
    
    This enables the angular modal marc-editor to be called from
    the vandelay dojo UI in the iFrame.
    
    To test:
    
    [1] In the web staff client, go to MARC Batch Import/Export and load
        some records in a Vandelay queue.
    [2] Inspect the queue and choose View MARC.
    [3] Click the Edit button, and verify that it brings up the
        web staff MARC editor.
    [4] Make a change, then click Modify, then click Use Edits.
    [5] Verify that the MARC view reflects the updated record.
    [6] Go back to the queue. If the bib was /not/ imported into
        Evergreen, the bib attributes may change.
    [7] Verify that steps 1-6 in the XUL client work (and that the XUL
        MARC editor is displayed).
    
    Note that this patch doesn't ensure that the modal can save the
    record and be dismissed via just a single click of the Modify button;
    an issue was discovered with that that could not be resolved in time
    for beta2.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_edit_marc_modal.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_edit_marc_modal.tt2
new file mode 100644
index 0000000..1bc8904
--- /dev/null
+++ b/Open-ILS/src/templates/staff/cat/catalog/t_edit_marc_modal.tt2
@@ -0,0 +1,16 @@
+<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>
diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2
index 634c7bc..96780ad 100644
--- a/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2
+++ b/Open-ILS/src/templates/staff/cat/catalog/t_vandelay.tt2
@@ -1 +1 @@
-<eg-embed-frame save-space="150" url="vandelay_url"></eg-embed-frame>
+<eg-embed-frame save-space="150" url="vandelay_url" handlers="funcs"></eg-embed-frame>
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 6952660..af2ea77 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
@@ -1830,9 +1830,34 @@ function($scope , $location) {
 }])
 
 .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',
diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index 928ef05..8726153 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -1725,6 +1725,11 @@ function vlOpenMarcEditWindow(rec, postReloadHTMLHandler) {
         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;

-----------------------------------------------------------------------

Summary of changes:
 .../catalog/t_edit_marc_modal.tt2}                 |    2 +-
 .../src/templates/staff/cat/catalog/t_vandelay.tt2 |    2 +-
 .../web/js/ui/default/staff/cat/catalog/app.js     |   29 ++++++++++++++++++-
 Open-ILS/web/js/ui/default/vandelay/vandelay.js    |    5 +++
 4 files changed, 34 insertions(+), 4 deletions(-)
 copy Open-ILS/src/templates/staff/{acq/t_edit_marc_order_record.tt2 => cat/catalog/t_edit_marc_modal.tt2} (89%)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list