From 99d7cfa1ff96e45e6925f309768e047bf67fcbd4 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 19 Oct 2012 14:34:49 -0400 Subject: [PATCH] Link checker: Links to MARC Editor in verification review interface Now you can click on the number in the Record ID column on any row in the verification review interface to launch the MARC Editor for that record. This is only supports the most basic of possible mediation workflows to follow a link checker run, but more could be done with future development. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Mike Rylander --- .../templates/url_verify/review_attempt.tt2 | 2 +- .../dojo/openils/URLVerify/ReviewAttempt.js | 40 +++++++++++++++++++ .../dojo/openils/URLVerify/nls/URLVerify.js | 5 ++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/url_verify/review_attempt.tt2 b/Open-ILS/src/templates/url_verify/review_attempt.tt2 index 8252bfdeba..a087c7fa75 100644 --- a/Open-ILS/src/templates/url_verify/review_attempt.tt2 +++ b/Open-ILS/src/templates/url_verify/review_attempt.tt2 @@ -67,7 +67,7 @@ - + diff --git a/Open-ILS/web/js/dojo/openils/URLVerify/ReviewAttempt.js b/Open-ILS/web/js/dojo/openils/URLVerify/ReviewAttempt.js index d9a1cf516d..33162be3d2 100644 --- a/Open-ILS/web/js/dojo/openils/URLVerify/ReviewAttempt.js +++ b/Open-ILS/web/js/dojo/openils/URLVerify/ReviewAttempt.js @@ -2,6 +2,7 @@ if (!dojo._hasResource["openils.URLVerify.ReviewAttempt"]) { dojo.require("dojo.string"); dojo.require("openils.CGI"); dojo.require("openils.PermaCrud"); + dojo.require("openils.XUL"); dojo.require("dijit.Tooltip"); dojo.requireLocalization("openils.URLVerify", "URLVerify"); @@ -62,6 +63,45 @@ if (!dojo._hasResource["openils.URLVerify.ReviewAttempt"]) { module.progress_dialog.hide(); }; + module.open_marc_editor = function(/* bib id */ id) { + openils.XUL.newTabEasy( + "oils://remote/xul/server/cat/marcedit.xul", + dojo.string.substitute(localeStrings.MARC_EDITOR_TITLE, [id]), { + "record": { + "url": "/opac/extras/supercat/retrieve/marcxml/record/"+id, + "id": id, + "rtype": "bre" + }, + "save": { + "label": localeStrings.MARC_EDITOR_SAVE_RECORD, + "func": function(marcxml) { + fieldmapper.standardRequest( + ["open-ils.cat", "open-ils.cat.biblio.record.xml.update"], { + "async": true, + "params": [openils.User.authtoken, id, marcxml], + "onresponse": function(r) { + /* just to do /something/ upon error */ + openils.Util.readResponse(r); + } + } + ); + /* marcedit.js just expects this kind of result; meh */ + return {"id": id, "oncomplete": function() { }}; + } + } + } + ); + }; + + module.format_bib_id = function(id) { + if (!id) return ""; + + return "" + id + ""; + }; + }()); } diff --git a/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js b/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js index d2128dbde9..c9302db172 100644 --- a/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js +++ b/Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js @@ -17,5 +17,8 @@ "CLONE_SESSION_NAME": "Copy of ${0}", "XPATH": "XPath", "SESSION_NAME": "Session '${0}'", - "SELECT_MORE": "Click here to review all session URLs and/or select other URLs to verify" + "SELECT_MORE": "Click here to review all session URLs and/or select other URLs to verify", + "MARC_EDITOR_LINK": "Click to open MARC Editor for this record", + "MARC_EDITOR_TITLE": "Record ID #${0}", + "MARC_EDITOR_SAVE_RECORD": "Save Record" } -- 2.43.2