Bugzilla – Attachment 84322 Details for
Bug 10662
Build OAI-PMH Harvesting Client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10662: (follow-up) Template corrections and improvements
Bug-10662-follow-up-Template-corrections-and-impro.patch (text/plain), 83.84 KB, created by
David Cook
on 2019-01-23 06:31:44 UTC
(
hide
)
Description:
Bug 10662: (follow-up) Template corrections and improvements
Filename:
MIME Type:
Creator:
David Cook
Created:
2019-01-23 06:31:44 UTC
Size:
83.84 KB
patch
obsolete
>From 3d01cc6ff54beb0eb72aa6ee45e712b73cf3ecf5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 2 Nov 2018 14:40:14 +0000 >Subject: [PATCH] Bug 10662: (follow-up) Template corrections and improvements > >This patch makes a number of corrections and improvements to the OAI >harvester templates: > > - Add missing DataTables CSS include > - Replace YUI grid with Bootstrap > - Correct style of inline dialogs (.dialog.alert, .dialog.message) > - Correct class of form hint and error messages > - Format dates in saved and submitted requests tables > - Add title-string sorting to DataTables configuration > - Add delete confirmation to saved and submitted tables > - Disable sorting on action columns > - Style action links inside tables as buttons > - Removed commented markup > - Add missing JavaScript include (tools-menu.js) to highlight active > section in sidebar menu > - Add CodeMirror styling to record view page (CodeMirror XML mode file > is added to enable this) > - Remove invalid <script> "type" attribute > >To test, apply the patch and clear your cache if necessary. > > - Go to Tools -> OAI-PMH harvester > - "Saved," "Submitted," and "Import history" table should look > correct and work correctly: Sorting, column visibility, > pagination, etc. > - In the "Saved" and "Submitted" tables, dates should be formatted > according to the dateformat preference and sorting of these dates > should work correctly. > - In the "Import history" table the "View record" and "View in > catalog" links should be styled as Bootstrap buttons. > - Click the "View record" button. > - The view of the downloaded record should have XML syntax > highlighting. > - When you perform actions like submitting requests, starting > requests, etc, corresponding dialogs should be styled correctly. > Informational/successful information should be "message" style > dialogs. Error dialogs should be "alert" style. > - Click "New request" > - Form hints in the new request form should be styled correctly. > - Submit the form without filling in any fields. Field-specific > error messages should be styled italic red. > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > koha-tmpl/intranet-tmpl/lib/codemirror/xml.js | 402 +++++++++++++++++++++ > koha-tmpl/intranet-tmpl/lib/codemirror/xml.min.js | 1 + > .../modules/tools/oai-pmh-harvester/dashboard.tt | 401 ++++++++++---------- > .../en/modules/tools/oai-pmh-harvester/record.tt | 54 ++- > .../en/modules/tools/oai-pmh-harvester/request.tt | 389 +++++++++++--------- > koha-tmpl/intranet-tmpl/prog/js/tools-menu.js | 2 + > 6 files changed, 852 insertions(+), 397 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/lib/codemirror/xml.js > create mode 100644 koha-tmpl/intranet-tmpl/lib/codemirror/xml.min.js > >diff --git a/koha-tmpl/intranet-tmpl/lib/codemirror/xml.js b/koha-tmpl/intranet-tmpl/lib/codemirror/xml.js >new file mode 100644 >index 0000000000..b67bf850b1 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/lib/codemirror/xml.js >@@ -0,0 +1,402 @@ >+// CodeMirror, copyright (c) by Marijn Haverbeke and others >+// Distributed under an MIT license: https://codemirror.net/LICENSE >+ >+(function(mod) { >+ if (typeof exports == "object" && typeof module == "object") // CommonJS >+ mod(require("../../lib/codemirror")); >+ else if (typeof define == "function" && define.amd) // AMD >+ define(["../../lib/codemirror"], mod); >+ else // Plain browser env >+ mod(CodeMirror); >+})(function(CodeMirror) { >+"use strict"; >+ >+var htmlConfig = { >+ autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, >+ 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, >+ 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, >+ 'track': true, 'wbr': true, 'menuitem': true}, >+ implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, >+ 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, >+ 'th': true, 'tr': true}, >+ contextGrabbers: { >+ 'dd': {'dd': true, 'dt': true}, >+ 'dt': {'dd': true, 'dt': true}, >+ 'li': {'li': true}, >+ 'option': {'option': true, 'optgroup': true}, >+ 'optgroup': {'optgroup': true}, >+ 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, >+ 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, >+ 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, >+ 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, >+ 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, >+ 'rp': {'rp': true, 'rt': true}, >+ 'rt': {'rp': true, 'rt': true}, >+ 'tbody': {'tbody': true, 'tfoot': true}, >+ 'td': {'td': true, 'th': true}, >+ 'tfoot': {'tbody': true}, >+ 'th': {'td': true, 'th': true}, >+ 'thead': {'tbody': true, 'tfoot': true}, >+ 'tr': {'tr': true} >+ }, >+ doNotIndent: {"pre": true}, >+ allowUnquoted: true, >+ allowMissing: true, >+ caseFold: true >+} >+ >+var xmlConfig = { >+ autoSelfClosers: {}, >+ implicitlyClosed: {}, >+ contextGrabbers: {}, >+ doNotIndent: {}, >+ allowUnquoted: false, >+ allowMissing: false, >+ allowMissingTagName: false, >+ caseFold: false >+} >+ >+CodeMirror.defineMode("xml", function(editorConf, config_) { >+ var indentUnit = editorConf.indentUnit >+ var config = {} >+ var defaults = config_.htmlMode ? htmlConfig : xmlConfig >+ for (var prop in defaults) config[prop] = defaults[prop] >+ for (var prop in config_) config[prop] = config_[prop] >+ >+ // Return variables for tokenizers >+ var type, setStyle; >+ >+ function inText(stream, state) { >+ function chain(parser) { >+ state.tokenize = parser; >+ return parser(stream, state); >+ } >+ >+ var ch = stream.next(); >+ if (ch == "<") { >+ if (stream.eat("!")) { >+ if (stream.eat("[")) { >+ if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); >+ else return null; >+ } else if (stream.match("--")) { >+ return chain(inBlock("comment", "-->")); >+ } else if (stream.match("DOCTYPE", true, true)) { >+ stream.eatWhile(/[\w\._\-]/); >+ return chain(doctype(1)); >+ } else { >+ return null; >+ } >+ } else if (stream.eat("?")) { >+ stream.eatWhile(/[\w\._\-]/); >+ state.tokenize = inBlock("meta", "?>"); >+ return "meta"; >+ } else { >+ type = stream.eat("/") ? "closeTag" : "openTag"; >+ state.tokenize = inTag; >+ return "tag bracket"; >+ } >+ } else if (ch == "&") { >+ var ok; >+ if (stream.eat("#")) { >+ if (stream.eat("x")) { >+ ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); >+ } else { >+ ok = stream.eatWhile(/[\d]/) && stream.eat(";"); >+ } >+ } else { >+ ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); >+ } >+ return ok ? "atom" : "error"; >+ } else { >+ stream.eatWhile(/[^&<]/); >+ return null; >+ } >+ } >+ inText.isInText = true; >+ >+ function inTag(stream, state) { >+ var ch = stream.next(); >+ if (ch == ">" || (ch == "/" && stream.eat(">"))) { >+ state.tokenize = inText; >+ type = ch == ">" ? "endTag" : "selfcloseTag"; >+ return "tag bracket"; >+ } else if (ch == "=") { >+ type = "equals"; >+ return null; >+ } else if (ch == "<") { >+ state.tokenize = inText; >+ state.state = baseState; >+ state.tagName = state.tagStart = null; >+ var next = state.tokenize(stream, state); >+ return next ? next + " tag error" : "tag error"; >+ } else if (/[\'\"]/.test(ch)) { >+ state.tokenize = inAttribute(ch); >+ state.stringStartCol = stream.column(); >+ return state.tokenize(stream, state); >+ } else { >+ stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); >+ return "word"; >+ } >+ } >+ >+ function inAttribute(quote) { >+ var closure = function(stream, state) { >+ while (!stream.eol()) { >+ if (stream.next() == quote) { >+ state.tokenize = inTag; >+ break; >+ } >+ } >+ return "string"; >+ }; >+ closure.isInAttribute = true; >+ return closure; >+ } >+ >+ function inBlock(style, terminator) { >+ return function(stream, state) { >+ while (!stream.eol()) { >+ if (stream.match(terminator)) { >+ state.tokenize = inText; >+ break; >+ } >+ stream.next(); >+ } >+ return style; >+ } >+ } >+ >+ function doctype(depth) { >+ return function(stream, state) { >+ var ch; >+ while ((ch = stream.next()) != null) { >+ if (ch == "<") { >+ state.tokenize = doctype(depth + 1); >+ return state.tokenize(stream, state); >+ } else if (ch == ">") { >+ if (depth == 1) { >+ state.tokenize = inText; >+ break; >+ } else { >+ state.tokenize = doctype(depth - 1); >+ return state.tokenize(stream, state); >+ } >+ } >+ } >+ return "meta"; >+ }; >+ } >+ >+ function Context(state, tagName, startOfLine) { >+ this.prev = state.context; >+ this.tagName = tagName; >+ this.indent = state.indented; >+ this.startOfLine = startOfLine; >+ if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) >+ this.noIndent = true; >+ } >+ function popContext(state) { >+ if (state.context) state.context = state.context.prev; >+ } >+ function maybePopContext(state, nextTagName) { >+ var parentTagName; >+ while (true) { >+ if (!state.context) { >+ return; >+ } >+ parentTagName = state.context.tagName; >+ if (!config.contextGrabbers.hasOwnProperty(parentTagName) || >+ !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { >+ return; >+ } >+ popContext(state); >+ } >+ } >+ >+ function baseState(type, stream, state) { >+ if (type == "openTag") { >+ state.tagStart = stream.column(); >+ return tagNameState; >+ } else if (type == "closeTag") { >+ return closeTagNameState; >+ } else { >+ return baseState; >+ } >+ } >+ function tagNameState(type, stream, state) { >+ if (type == "word") { >+ state.tagName = stream.current(); >+ setStyle = "tag"; >+ return attrState; >+ } else if (config.allowMissingTagName && type == "endTag") { >+ setStyle = "tag bracket"; >+ return attrState(type, stream, state); >+ } else { >+ setStyle = "error"; >+ return tagNameState; >+ } >+ } >+ function closeTagNameState(type, stream, state) { >+ if (type == "word") { >+ var tagName = stream.current(); >+ if (state.context && state.context.tagName != tagName && >+ config.implicitlyClosed.hasOwnProperty(state.context.tagName)) >+ popContext(state); >+ if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { >+ setStyle = "tag"; >+ return closeState; >+ } else { >+ setStyle = "tag error"; >+ return closeStateErr; >+ } >+ } else if (config.allowMissingTagName && type == "endTag") { >+ setStyle = "tag bracket"; >+ return closeState(type, stream, state); >+ } else { >+ setStyle = "error"; >+ return closeStateErr; >+ } >+ } >+ >+ function closeState(type, _stream, state) { >+ if (type != "endTag") { >+ setStyle = "error"; >+ return closeState; >+ } >+ popContext(state); >+ return baseState; >+ } >+ function closeStateErr(type, stream, state) { >+ setStyle = "error"; >+ return closeState(type, stream, state); >+ } >+ >+ function attrState(type, _stream, state) { >+ if (type == "word") { >+ setStyle = "attribute"; >+ return attrEqState; >+ } else if (type == "endTag" || type == "selfcloseTag") { >+ var tagName = state.tagName, tagStart = state.tagStart; >+ state.tagName = state.tagStart = null; >+ if (type == "selfcloseTag" || >+ config.autoSelfClosers.hasOwnProperty(tagName)) { >+ maybePopContext(state, tagName); >+ } else { >+ maybePopContext(state, tagName); >+ state.context = new Context(state, tagName, tagStart == state.indented); >+ } >+ return baseState; >+ } >+ setStyle = "error"; >+ return attrState; >+ } >+ function attrEqState(type, stream, state) { >+ if (type == "equals") return attrValueState; >+ if (!config.allowMissing) setStyle = "error"; >+ return attrState(type, stream, state); >+ } >+ function attrValueState(type, stream, state) { >+ if (type == "string") return attrContinuedState; >+ if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} >+ setStyle = "error"; >+ return attrState(type, stream, state); >+ } >+ function attrContinuedState(type, stream, state) { >+ if (type == "string") return attrContinuedState; >+ return attrState(type, stream, state); >+ } >+ >+ return { >+ startState: function(baseIndent) { >+ var state = {tokenize: inText, >+ state: baseState, >+ indented: baseIndent || 0, >+ tagName: null, tagStart: null, >+ context: null} >+ if (baseIndent != null) state.baseIndent = baseIndent >+ return state >+ }, >+ >+ token: function(stream, state) { >+ if (!state.tagName && stream.sol()) >+ state.indented = stream.indentation(); >+ >+ if (stream.eatSpace()) return null; >+ type = null; >+ var style = state.tokenize(stream, state); >+ if ((style || type) && style != "comment") { >+ setStyle = null; >+ state.state = state.state(type || style, stream, state); >+ if (setStyle) >+ style = setStyle == "error" ? style + " error" : setStyle; >+ } >+ return style; >+ }, >+ >+ indent: function(state, textAfter, fullLine) { >+ var context = state.context; >+ // Indent multi-line strings (e.g. css). >+ if (state.tokenize.isInAttribute) { >+ if (state.tagStart == state.indented) >+ return state.stringStartCol + 1; >+ else >+ return state.indented + indentUnit; >+ } >+ if (context && context.noIndent) return CodeMirror.Pass; >+ if (state.tokenize != inTag && state.tokenize != inText) >+ return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; >+ // Indent the starts of attribute names. >+ if (state.tagName) { >+ if (config.multilineTagIndentPastTag !== false) >+ return state.tagStart + state.tagName.length + 2; >+ else >+ return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); >+ } >+ if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0; >+ var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter); >+ if (tagAfter && tagAfter[1]) { // Closing tag spotted >+ while (context) { >+ if (context.tagName == tagAfter[2]) { >+ context = context.prev; >+ break; >+ } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) { >+ context = context.prev; >+ } else { >+ break; >+ } >+ } >+ } else if (tagAfter) { // Opening tag spotted >+ while (context) { >+ var grabbers = config.contextGrabbers[context.tagName]; >+ if (grabbers && grabbers.hasOwnProperty(tagAfter[2])) >+ context = context.prev; >+ else >+ break; >+ } >+ } >+ while (context && context.prev && !context.startOfLine) >+ context = context.prev; >+ if (context) return context.indent + indentUnit; >+ else return state.baseIndent || 0; >+ }, >+ >+ electricInput: /<\/[\s\w:]+>$/, >+ blockCommentStart: "<!--", >+ blockCommentEnd: "-->", >+ >+ configuration: config.htmlMode ? "html" : "xml", >+ helperType: config.htmlMode ? "html" : "xml", >+ >+ skipAttribute: function(state) { >+ if (state.state == attrValueState) >+ state.state = attrState >+ } >+ }; >+}); >+ >+CodeMirror.defineMIME("text/xml", "xml"); >+CodeMirror.defineMIME("application/xml", "xml"); >+if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) >+ CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); >+ >+}); >diff --git a/koha-tmpl/intranet-tmpl/lib/codemirror/xml.min.js b/koha-tmpl/intranet-tmpl/lib/codemirror/xml.min.js >new file mode 100644 >index 0000000000..fecf34d0e1 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/lib/codemirror/xml.min.js >@@ -0,0 +1 @@ >+!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",function(r,o){var a,i,l=r.indentUnit,u={},d=o.htmlMode?e:n;for(var c in d)u[c]=d[c];for(var c in o)u[c]=o[c];function s(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(m("atom","]]>")):null:t.match("--")?n(m("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(function t(e){return function(n,r){for(var o;null!=(o=n.next());){if("<"==o)return r.tokenize=t(e+1),r.tokenize(n,r);if(">"==o){if(1==e){r.tokenize=s;break}return r.tokenize=t(e-1),r.tokenize(n,r)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=m("meta","?>"),"meta"):(a=t.eat("/")?"closeTag":"openTag",e.tokenize=f,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function f(t,e){var n,r,o=t.next();if(">"==o||"/"==o&&t.eat(">"))return e.tokenize=s,a=">"==o?"endTag":"selfcloseTag","tag bracket";if("="==o)return a="equals",null;if("<"==o){e.tokenize=s,e.state=h,e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}return/[\'\"]/.test(o)?(e.tokenize=(n=o,(r=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=f;break}return"string"}).isInAttribute=!0,r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=s;break}n.next()}return t}}function g(t){t.context&&(t.context=t.context.prev)}function p(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!u.contextGrabbers.hasOwnProperty(n)||!u.contextGrabbers[n].hasOwnProperty(e))return;g(t)}}function h(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?b:h}function x(t,e,n){return"word"==t?(n.tagName=e.current(),i="tag",v):u.allowMissingTagName&&"endTag"==t?(i="tag bracket",v(t,e,n)):(i="error",x)}function b(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&u.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===u.matchClosing?(i="tag",k):(i="tag error",w)}return u.allowMissingTagName&&"endTag"==t?(i="tag bracket",k(t,e,n)):(i="error",w)}function k(t,e,n){return"endTag"!=t?(i="error",k):(g(n),h)}function w(t,e,n){return i="error",k(t,0,n)}function v(t,e,n){if("word"==t)return i="attribute",T;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||u.autoSelfClosers.hasOwnProperty(r)?p(n,r):(p(n,r),n.context=new function(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(u.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}(n,r,o==n.indented)),h}return i="error",v}function T(t,e,n){return"equals"==t?y:(u.allowMissing||(i="error"),v(t,0,n))}function y(t,e,n){return"string"==t?N:"word"==t&&u.allowUnquoted?(i="string",v):(i="error",v(t,0,n))}function N(t,e,n){return"string"==t?N:v(t,0,n)}return s.isInText=!0,{startState:function(t){var e={tokenize:s,state:h,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;a=null;var n=e.tokenize(t,e);return(n||a)&&"comment"!=n&&(i=null,e.state=e.state(a||n,t,e),i&&(n="error"==i?n+" error":i)),n},indent:function(e,n,r){var o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+l;if(o&&o.noIndent)return t.Pass;if(e.tokenize!=f&&e.tokenize!=s)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==u.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+l*(u.multilineTagIndentFactor||1);if(u.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;o;){if(o.tagName==a[2]){o=o.prev;break}if(!u.implicitlyClosed.hasOwnProperty(o.tagName))break;o=o.prev}else if(a)for(;o;){var i=u.contextGrabbers[o.tagName];if(!i||!i.hasOwnProperty(a[2]))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+l:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:u.htmlMode?"html":"xml",helperType:u.htmlMode?"html":"xml",skipAttribute:function(t){t.state==y&&(t.state=v)}}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt >index 4a4097f7fc..dceeecad34 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt >@@ -1,100 +1,107 @@ >+[% USE raw %] >+[% USE Asset %] > [% USE ColumnsSettings %] >+[% USE KohaDates %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › OAI-PMH harvester</title> > [% INCLUDE 'doc-head-close.inc' %] > [% dashboard_page = '/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl' %] > [% request_page = '/cgi-bin/koha/tools/oai-pmh-harvester/request.pl' %] >-<style type="text/css"> >- a.paginate_button { >- padding: 2px; >- } >-</style> >+[% Asset.css("css/datatables.css") | $raw %] > </head> > <body id="tools_oai-pmh-harvester" class="tools"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › OAI-PMH harvester</div> >- <div id="doc3" class="yui-t2"> >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- <h1>OAI-PMH harvester</h1> >- <div id="toolbar" class="btn-toolbar"> >- <a id="new-request" class="btn btn-default btn-sm" href="[% request_page | url %]?op=new"><i class="fa fa-plus"></i> New request</a> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ >+ <h1>OAI-PMH harvester</h1> >+ <div id="toolbar" class="btn-toolbar"> >+ <a id="new-request" class="btn btn-default btn-sm" href="[% request_page | url %]?op=new"><i class="fa fa-plus"></i> New request</a> >+ </div> >+ [% IF ( harvester.offline ) %] >+ <div class="dialog alert"> >+ <span>OAI-PMH harvester offline</span> > </div> >- [% IF ( harvester.offline ) %] >- <div class="alert"> >- <span>OAI-PMH harvester offline</span> >- </div> >- [% END %] >- <div id="dashboard-items" class="toptabs"> >- <ul> >- <li> >- <a href="#saved_requests">Saved requests <span id="saved_count">([% saved_requests.size | html %])</span></a> >- </li> >- <li> >- <a href="#submitted_requests">Submitted requests <span id="submitted_count">([% submitted_requests.size | html %])</span></a> >- </li> >- <li> >- <a href="#imports">Import history <span id="import_count">(0)</span></a> >- </li> >- </ul> >- <div id="submitted_requests"> >- [% IF ( result.defined("start") ) %] >- <div class="alert"> >- [% IF ( result.start ) %] >- <span>Start succeeded</span> >- [% ELSE %] >- <span>Start failed</span> >- [% END %] >+ [% END %] >+ <div id="dashboard-items" class="toptabs"> >+ <ul> >+ <li> >+ <a href="#saved_requests">Saved requests <span id="saved_count">([% saved_requests.size | html %])</span></a> >+ </li> >+ <li> >+ <a href="#submitted_requests">Submitted requests <span id="submitted_count">([% submitted_requests.size | html %])</span></a> >+ </li> >+ <li> >+ <a href="#imports">Import history <span id="import_count">(0)</span></a> >+ </li> >+ </ul> >+ <div id="submitted_requests"> >+ [% IF ( result.defined("start") ) %] >+ [% IF ( result.start ) %] >+ <div class="dialog message"> >+ <span>Start succeeded</span> > </div> >- [% ELSIF ( result.defined("stop") ) %] >- <div class="alert"> >- [% IF ( result.stop ) %] >+ [% ELSE %] >+ <div class="dialog alert"> >+ <span>Start failed</span> >+ </div> >+ [% END %] >+ [% ELSIF ( result.defined("stop") ) %] >+ [% IF ( result.stop ) %] >+ <div class="dialog message"> > <span>Stop succeeded</span> >- [% ELSE %] >+ </div> >+ [% ELSE %] >+ <div class="dialog alert"> > <span>Stop failed</span> >- [% END %] >- </div> >- [% ELSIF ( result.defined("delete") ) %] >- <div class="alert"> >- [% IF ( result.delete ) %] >+ </div> >+ [% END %] >+ [% ELSIF ( result.defined("delete") ) %] >+ [% IF ( result.delete ) %] >+ <div class="dialog message"> > <span>Delete succeeded</span> >- [% ELSE %] >+ </div> >+ [% ELSE %] >+ <div class="dialog alert"> > <span>Delete failed</span> >- [% END %] >- </div> >- [% END %] >- <table id="submitted-table"> >- <thead> >- <tr> >- <th>Name</th> >- <th>URL</th> >- <th>Set</th> >- <th>From</th> >- <th>Until</th> >- <th>Interval</th> >- <th>Effective from</th> >- <th>Effective until</th> >- <th>Pending imports</th> >- <th>Status</th> >- <th>Error</th> >- <th></th> >- </tr> >- </thead> >- <tbody> >+ </div> >+ [% END %] >+ [% END %] >+ <table id="submitted-table"> >+ <thead> >+ <tr> >+ <th>Name</th> >+ <th>URL</th> >+ <th>Set</th> >+ <th class="title-string">From</th> >+ <th class="title-string">Until</th> >+ <th>Interval</th> >+ <th class="title-string">Effective from</th> >+ <th class="title-string">Effective until</th> >+ <th>Pending imports</th> >+ <th>Status</th> >+ <th>Error</th> >+ <th class="NoSort"></th> >+ </tr> >+ </thead> >+ <tbody> > [% IF ( submitted_requests ) %] > [% FOREACH submitted_request IN submitted_requests %] > <tr> > <td>[% submitted_request.name | html %]</td> > <td>[% submitted_request.parameters.oai_pmh.baseURL | html %]</td> > <td>[% submitted_request.parameters.oai_pmh.set | html %]</td> >- <td>[% submitted_request.parameters.oai_pmh.from | html %]</td> >- <td>[% submitted_request.parameters.oai_pmh.until | html %]</td> >+ <td><span title="[% submitted_request.parameters.oai_pmh.from | html %]">[% submitted_request.parameters.oai_pmh.from | $KohaDates with_hours = 1 %]</span></td> >+ <td><span title="[% submitted_request.parameters.oai_pmh.until | html %]">[% submitted_request.parameters.oai_pmh.until | $KohaDates with_hours = 1 %]</span></td> > <td>[% submitted_request.interval | html %]</td> >- <td>[% submitted_request.effective_from | html %]</td> >- <td>[% submitted_request.effective_until | html %]</td> >+ <td><span title="[% submitted_request.effective_from | html %]">[% submitted_request.effective_from | $KohaDates with_hours = 1 %]</span></td> >+ <td><span title="[% submitted_request.effective_until | html %]">[% submitted_request.effective_until | $KohaDates with_hours = 1 %]</span></td> > <td>[% submitted_request.pending_imports |html %]</td> > <td> > [% IF ( submitted_status = submitted_request.status ) %] >@@ -123,7 +130,7 @@ > <a href="[% dashboard_page | url %]?op=stop&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-stop"></i> Stop</a> > </li> > <li> >- <a href="[% dashboard_page | url %]?op=delete&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-trash"></i> Delete</a> >+ <a class="confirmdelete" href="[% dashboard_page | url %]?op=delete&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-trash"></i> Delete</a> > </li> > </ul> > </div> >@@ -131,149 +138,102 @@ > </tr> > [% END %] > [% END %] >- </tbody> >- </table> >- </div> >- <div id="saved_requests"> >- [% IF ( result.send.defined ) %] >- <div class="alert"> >- [% IF ( result.send ) %] >+ </tbody> >+ </table> >+ </div> >+ <div id="saved_requests"> >+ [% IF ( result.send.defined ) %] >+ [% IF ( result.send ) %] >+ <div class="dialog message"> > <span>Submit succeeded</span> >- [% ELSE %] >+ </div> >+ [% ELSE %] >+ <div class="dialog alert"> > <span>Submit failed</span> >- [% END %] >- </div> >- [% END %] >- <table id="saved-table"> >- <thead> >- <tr> >- <th>Name</th> >- <th>URL</th> >- <!-- <th>Verb</th> >- <th>Metadata prefix</th> >- <th>Identifier</th> --> >- <th>Set</th> >- <th>From</th> >- <th>Until</th> >- <th>Interval</th> >- <!-- <th>Filter</th> >- <th>Framework code</th> >- <th>Record type</th> >- <th>Matcher code</th> --> >- <th></th> >- </tr> >- </thead> >- <tbody> >- [% IF ( saved_requests ) %] >- [% FOREACH saved_request IN saved_requests %] >- <tr> >- <td>[% saved_request.name | html %]</td> >- <td>[% saved_request.http_url | html %]</td> >- <!-- <td>[% saved_request.oai_verb | html %]</td> >- <td>[% saved_request.oai_metadataPrefix | html %]</td> >- <td>[% saved_request.oai_identifier | html %]</td> --> >- <td>[% saved_request.oai_set | html %]</td> >- <td>[% saved_request.oai_from | html %]</td> >- <td>[% saved_request.oai_until | html %]</td> >- <td>[% saved_request.interval | html %]</td> >- <!-- <td> >- [% IF ( saved_request.import_filter == "default" ) %] >- <span>Default</span> >- [% ELSE %] >- [% saved_request.import_filter | html %] >- [% END %] >- </td> >- <td> >- [% display_framework = "" %] >- [% FOREACH framework IN frameworks %] >- [% IF ( framework.frameworkcode == saved_request.import_framework_code ) %] >- [% display_framework = framework %] >- [% END %] >- [% END %] >- [% IF ( display_framework ) %] >- [% display_framework.frameworktext | html %] >- [% ELSE %] >- [% saved_request.import_framework_code | html %] >- [% END %] >- </td> >- <td> >- [% IF ( saved_request.import_record_type == "biblio" ) %] >- <span>Bibliographic</span> >- [% ELSE %] >- [% saved_request.import_record_type | html %] >- [% END %] >- </td> >- <td> >- [% display_matcher = "" %] >- [% FOREACH matcher IN matchers %] >- [% IF ( matcher.code == saved_request.import_matcher_code ) %] >- [% display_matcher = matcher %] >- [% END %] >- [% END %] >- [% IF ( display_matcher ) %] >- [% display_matcher.description | html %] >- [% ELSE %] >- [% saved_request.import_matcher_code | html %] >- [% END %] >- </td> --> >- <td> >- <div class="dropdown"> >- <a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a> >- <ul class="dropdown-menu pull-right" role="menu"> >- <li> >- <a href="[% request_page | url %]?op=edit&id=[% saved_request.id | url %]"><i class="fa fa-pencil"></i> Edit</a> >- </li> >- <li> >- <a href="[% request_page | url %]?op=new&id=[% saved_request.id | url %]"><i class="fa fa-copy"></i> Copy</a> >- </li> >- <li> >- <a href="[% dashboard_page | url %]?op=send&id=[% saved_request.id | url %]"><i class="fa fa-send"></i> Submit</a> >- </li> >- <li> >- <a href="[% request_page | url %]?op=delete&id=[% saved_request.id | url %]"><i class="fa fa-trash"></i> Delete</a> >- </li> >- </ul> >- </div> >- </td> >- </tr> >- [% END %] >+ </div> > [% END %] >- </tbody> >- </table> >- </div> >- <div id="imports"> >- <div class="btn-toolbar"> >- <button id="refresh-button" type="button" class="btn btn-default btn-sm">Refresh import history</button> >- </div> >- <table id="history-table"> >- <thead> >+ [% END %] >+ <table id="saved-table"> >+ <thead> >+ <tr> >+ <th>Name</th> >+ <th>URL</th> >+ <th>Set</th> >+ <th class="title-string">From</th> >+ <th class="title-string">Until</th> >+ <th>Interval</th> >+ <th class="NoSort"></th> >+ </tr> >+ </thead> >+ <tbody> >+ [% IF ( saved_requests ) %] >+ [% FOREACH saved_request IN saved_requests %] > <tr> >- <th>Id</th> >- <th>Repository</th> >- <th>Identifier</th> >- <th>Datestamp</th> >- <th>Upstream status</th> >- <th>Import status</th> >- <th>Import timestamp</th> >- <th>Imported record</th> >- <th>Downloaded record</th> >+ <td>[% saved_request.name | html %]</td> >+ <td>[% saved_request.http_url | html %]</td> >+ <td>[% saved_request.oai_set | html %]</td> >+ <td><span title="[% saved_request.oai_from | html %]">[% saved_request.oai_from | $KohaDates with_hours = 1 %]</span></td> >+ <td><span title="[% saved_request.oai_until | html %]">[% saved_request.oai_until | $KohaDates with_hours = 1 %]</span></td> >+ <td>[% saved_request.interval | html %]</td> >+ <td> >+ <div class="dropdown"> >+ <a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a> >+ <ul class="dropdown-menu pull-right" role="menu"> >+ <li> >+ <a href="[% request_page | url %]?op=edit&id=[% saved_request.id | url %]"><i class="fa fa-pencil"></i> Edit</a> >+ </li> >+ <li> >+ <a href="[% request_page | url %]?op=new&id=[% saved_request.id | url %]"><i class="fa fa-copy"></i> Copy</a> >+ </li> >+ <li> >+ <a href="[% dashboard_page | url %]?op=send&id=[% saved_request.id | url %]"><i class="fa fa-send"></i> Submit</a> >+ </li> >+ <li> >+ <a class="confirmdelete" href="[% request_page | url %]?op=delete&id=[% saved_request.id | url %]"><i class="fa fa-trash"></i> Delete</a> >+ </li> >+ </ul> >+ </div> >+ </td> > </tr> >- </thead> >- </table> >- >- </div> >+ [% END %] >+ [% END %] >+ </tbody> >+ </table> >+ </div> >+ <div id="imports"> >+ <button id="refresh-button" type="button" class="btn btn-default btn-xs"><i class="fa fa-refresh"></i> Refresh import history</button> >+ <table id="history-table"> >+ <thead> >+ <tr> >+ <th>Id</th> >+ <th>Repository</th> >+ <th>Identifier</th> >+ <th>Datestamp</th> >+ <th>Upstream status</th> >+ <th>Import status</th> >+ <th>Import timestamp</th> >+ <th class="NoSort">Imported record</th> >+ <th class="NoSort">Downloaded record</th> >+ </tr> >+ </thead> >+ </table> > </div> > </div> >- </div> >- <div class="yui-b"> >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> > [% INCLUDE 'tools-menu.inc' %] >- </div> >- </div> >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] >- <script type="text/javascript"> >+ [% Asset.js("js/tools-menu.js") | $raw %] >+ <script> > $(document).ready(function() { > $('#dashboard-items').tabs(); > [% IF ( result.start.defined || result.stop.defined || result.delete.defined ) %] >@@ -281,13 +241,33 @@ > [% END %] > > var saved_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'saved-table', 'json' ) | $raw %]; >- var saved_table = KohaTable("saved-table",{},saved_table_columns_settings); >+ var saved_table = KohaTable("saved-table",{ >+ "autoWidth": false, >+ "aoColumnDefs": [ >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "sPaginationType": "four_button" >+ },saved_table_columns_settings); > > var submitted_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'submitted-table', 'json' ) | $raw %]; >- var submitted_table = KohaTable("submitted-table",{},submitted_table_columns_settings); >+ var submitted_table = KohaTable("submitted-table",{ >+ "autoWidth": false, >+ "aoColumnDefs": [ >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "sPaginationType": "four_button" >+ },submitted_table_columns_settings); > > var history_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'history-table', 'json' ) | $raw %]; > var history_table = KohaTable("history-table",{ >+ "autoWidth": false, >+ "aoColumnDefs": [ >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "sPaginationType": "four_button", > serverSide: true, > searching: true, > processing: true, >@@ -344,8 +324,8 @@ > var display_string = data; > var record_type = (full.record_type) ? full.record_type : 'biblio'; > if (data && record_type == 'biblio'){ >- var link_text = _("View biblio record"); >- var link = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='+data+'">'+link_text+'</a>'; >+ var link_text = _("View in catalog"); >+ var link = '<a class=\"btn btn-default btn-xs\" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='+data+'"><i class=\"fa fa-eye\"></i> '+link_text+'</a>'; > display_string = link; > } > return display_string; >@@ -356,7 +336,7 @@ > data: 'import_oai_id', render: function (data, type, full, meta){ > var display_string = data; > var link_text = _("View record"); >- var link = '<a href="/cgi-bin/koha/tools/oai-pmh-harvester/record.pl?import_oai_id='+data+'">'+link_text+'</a>'; >+ var link = '<a class=\"btn btn-default btn-xs\" href="/cgi-bin/koha/tools/oai-pmh-harvester/record.pl?import_oai_id='+data+'"><i class=\"fa fa-code\"></i> '+link_text+'</a>'; > display_string = link; > return display_string; > }, searchable: false >@@ -372,6 +352,9 @@ > $('#refresh-button').click(function(){ > history_table.dataTable().api().ajax.reload( null, false ); > }); >+ $(".confirmdelete").on("click", function(){ >+ return confirmDelete(_("Are you sure you want to delete this request?")); >+ }) > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/record.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/record.tt >index 4b2d217356..19a4d46927 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/record.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/record.tt >@@ -1,23 +1,55 @@ >+[% USE raw %] >+[% USE Asset %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › OAI-PMH harvester › Downloaded record</title> > [% INCLUDE 'doc-head-close.inc' %] >+[% Asset.css("lib/codemirror/codemirror.css") | $raw %] >+<style> >+.CodeMirror { >+ height: 100% >+} >+</style> > </head> > <body id="tools_oai-pmh-harvester_request" class="tools"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a> › Downloaded record</div> >- <div id="doc3" class="yui-t2"> >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >+ >+ <div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ > <h1>Downloaded record</h1> > [% IF ( record ) %] >- <div style="white-space:pre">[% record | xml %]</div> >+ <textarea id="record">[% record | html %]</textarea> > [% END %] >- </div> >- </div> >- <div class="yui-b"> >- [% INCLUDE 'tools-menu.inc' %] >- </div> >- </div> >+ >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'tools-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ >+[% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/tools-menu.js") | $raw %] >+ [% Asset.js("lib/codemirror/codemirror-compressed.js") | $raw %] >+ [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %] >+ <script> >+ $(document).ready(function() { >+ var editor = CodeMirror.fromTextArea( record, { >+ lineNumbers: false, >+ mode: "application/xml", >+ lineWrapping: true, >+ readOnly: true >+ }); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/request.tt >index 78a878d6a6..676ed9b7d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/request.tt >@@ -4,7 +4,7 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › OAI-PMH harvester › Request</title> > [% INCLUDE 'doc-head-close.inc' %] >-<style type="text/css"> >+<style> > /* Override staff-global.css which hides second, millisecond, and microsecond sliders */ > .ui_tpicker_second { > display: block; >@@ -15,195 +15,230 @@ > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a> › Request</div> >- <div id="doc3" class="yui-t2"> >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- [% IF ( op == "edit" ) %] >- <h1>Edit OAI-PMH request</h1> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ >+ [% IF ( op == "edit" ) %] >+ <h1>Edit OAI-PMH request</h1> >+ [% ELSE %] >+ <h1>New OAI-PMH request</h1> >+ [% END %] >+ [% IF ( test_parameters ) %] >+ [% IF ( errors.size ) %] >+ <div class="dialog alert">Tests failed!</div> > [% ELSE %] >- <h1>New OAI-PMH request</h1> >+ <div class="dialog message">Tests succeeded!</div> > [% END %] >- [% IF ( test_parameters ) %] >- [% IF ( errors.size ) %] >- <div class="dialog message"><span class="text-danger">Tests failed!</span></div> >- [% ELSE %] >- <div class="dialog message"><span class="text-success">Tests succeeded!</span></div> >- [% END %] >+ [% END %] >+ <form action="/cgi-bin/koha/tools/oai-pmh-harvester/request.pl" method="post" name="entry-form"> >+ [% IF ( op == "new" ) %] >+ <input type="hidden" name="op" value="create" /> >+ [% ELSIF ( op == "edit" ) %] >+ <input type="hidden" name="op" value="update" /> >+ [% ELSE %] >+ <input type="hidden" name="op" value="[% op | html %]" /> >+ [% END %] >+ [% IF ( id ) %] >+ <input type="hidden" name="id" value="[% id | html %]" /> > [% END %] >- <form action="/cgi-bin/koha/tools/oai-pmh-harvester/request.pl" method="post" name="entry-form"> >- [% IF ( op == "new" ) %] >- <input type="hidden" name="op" value="create" /> >- [% ELSIF ( op == "edit" ) %] >- <input type="hidden" name="op" value="update" /> >- [% ELSE %] >- <input type="hidden" name="op" value="[% op | html %]" /> >- [% END %] >- [% IF ( id ) %] >- <input type="hidden" name="id" value="[% id | html %]" /> >- [% END %] >- <fieldset class="rows"> >- <ol> >- <li> >- <label for="name">Name:</label> >- <input type="text" size="30" id="name" name="name" value="[% oai_pmh_request.name | html %]"/> >- <span class="help">This is just a short name to help in managing requests.</span> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>HTTP parameters:</legend> >- <ol> >- <li> >- <label for="http_url">URL:</label> >- <input type="text" size="30" id="http_url" name="http_url" value="[% oai_pmh_request.http_url | html %]"> >- [% IF (errors.http_url.malformed) %]<span class="error">[This must be a properly formatted HTTP or HTTPS URL.]</span>[% END %] >- [% IF (errors.http.404) %]<span class="error">[Cannot find address specified by this URL.]</span>[% END %] >- [% IF (errors.http.401) %]<span class="error">[Permission denied to access this URL.]</span>[% END %] >- [% IF (errors.http.generic) %]<span class="error">[Unable to access this URL.]</span>[% END %] >- </li> >- </ol> >- <span class="help">The following parameters are not required by all OAI-PMH repositories, so they may be optional for this task.</span> >- <ol> >- <li> >- <label for="http_username">Username:</label> >- <input type="text" size="30" id="http_username" name="http_username" value="[% oai_pmh_request.http_username | html %]"> >- </li> >- <li> >- <label for="http_password">Password:</label> >- <input type="text" size="30" id="http_password" name="http_password" value="[% oai_pmh_request.http_password | html %]"> >- </li> >- <li> >- <label for="http_realm">Realm:</label> >- <input type="text" size="30" id="http_realm" name="http_realm" value="[% oai_pmh_request.http_realm | html %]"> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>OAI-PMH parameters:</legend> >- <ol> >- <li> >- <label for="oai_verb">Verb:</label> >- <select id="oai_verb" name="oai_verb"> >- [% IF ( oai_pmh_request.oai_verb == "ListRecords" ) %] >- <option value="ListRecords" selected="selected">ListRecords</option> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="name">Name:</label> >+ <input type="text" size="30" id="name" name="name" value="[% oai_pmh_request.name | html %]"/> >+ <span class="hint">This is a short name to help in managing requests.</span> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="rows"> >+ <legend>HTTP parameters:</legend> >+ <ol> >+ <li> >+ <label for="http_url">URL:</label> >+ <input type="text" size="30" id="http_url" name="http_url" value="[% oai_pmh_request.http_url | html %]"> >+ [% IF (errors.http_url.malformed) %] >+ <span class="required">This must be a properly formatted HTTP or HTTPS URL.</span> >+ [% END %] >+ [% IF (errors.http.404) %] >+ <span class="required">Cannot find address specified by this URL.</span> >+ [% END %] >+ [% IF (errors.http.401) %] >+ <span class="required">Permission denied to access this URL.</span> >+ [% END %] >+ [% IF (errors.http.generic) %] >+ <span class="required">Unable to access this URL.</span> >+ [% END %] >+ </li> >+ </ol> >+ <div class="hint">The following parameters are not required by all OAI-PMH repositories, so they may be optional for this task.</div> >+ <ol> >+ <li> >+ <label for="http_username">Username:</label> >+ <input type="text" size="30" id="http_username" name="http_username" value="[% oai_pmh_request.http_username | html %]"> >+ </li> >+ <li> >+ <label for="http_password">Password:</label> >+ <input type="text" size="30" id="http_password" name="http_password" value="[% oai_pmh_request.http_password | html %]"> >+ </li> >+ <li> >+ <label for="http_realm">Realm:</label> >+ <input type="text" size="30" id="http_realm" name="http_realm" value="[% oai_pmh_request.http_realm | html %]"> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="rows"> >+ <legend>OAI-PMH parameters:</legend> >+ <ol> >+ <li> >+ <label for="oai_verb">Verb:</label> >+ <select id="oai_verb" name="oai_verb"> >+ [% IF ( oai_pmh_request.oai_verb == "ListRecords" ) %] >+ <option value="ListRecords" selected="selected">ListRecords</option> >+ [% ELSE %] >+ <option value="ListRecords">ListRecords</option> >+ [% END %] >+ [% IF ( oai_pmh_request.oai_verb == "GetRecord" ) %] >+ <option value="GetRecord" selected="selected">GetRecord</option> >+ [% ELSE %] >+ <option value="GetRecord">GetRecord</option> >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="oai_metadataPrefix">Metadata prefix:</label> >+ <input type="text" size="30" id="oai_metadataPrefix" name="oai_metadataPrefix" value="[% oai_pmh_request.oai_metadataPrefix | html %]"> >+ [% IF (errors.oai_metadataPrefix.unavailable) %] >+ <span class="required">This metadataPrefix is unavailable from this OAI-PMH provider.</span> >+ [% END %] >+ [% IF (errors.oai_metadataPrefix.missing) %] >+ <span class="required">metadataPrefix is a required field for an OAI-PMH request.</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="oai_identifier">Identifier:</label> >+ <input type="text" size="30" id="oai_identifier" name="oai_identifier" value="[% oai_pmh_request.oai_identifier | html %]"> >+ [% IF (errors.oai_identifier.missing) %] >+ <span class="required">Identifier is a required field when using GetRecord for an OAI-PMH request.</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="oai_set">Set:</label> >+ <input type="text" size="30" id="oai_set" name="oai_set" value="[% oai_pmh_request.oai_set | html %]"> >+ [% IF (errors.oai_set.unavailable) %] >+ <span class="required">This set is unavailable from this OAI-PMH provider.</span> >+ [% END %] >+ </li> >+ [% IF (errors.oai.granularity_mismatch) %] >+ <span class="required">You must specify the same granularity for both From and Until.</span> >+ [% END %] >+ <li> >+ <label for="oai_from">From:</label> >+ <input type="text" size="30" class="datetime_utc" id="oai_from" name="oai_from" value="[% oai_pmh_request.oai_from | html %]"> >+ <span class="hint">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span> >+ [% IF (errors.oai_from.malformed) %] >+ <span class="required">This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.</span> >+ [% END %] >+ [% IF (errors.oai_from.unavailable) %] >+ <span class="required">This granularity is unsupported by this OAI-PMH provider.</span> >+ [% END %] >+ </li> >+ <li> >+ <label for="oai_until">Until:</label> >+ <input type="text" size="30" class="datetime_utc" id="oai_until" name="oai_until" value="[% oai_pmh_request.oai_until | html %]"> >+ <span class="hint">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span> >+ [% IF (errors.oai_until.malformed) %] >+ <span class="required">This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.</span> >+ [% END %] >+ [% IF (errors.oai_until.unavailable) %] >+ <span class="required">This granularity is unsupported by this OAI-PMH provider.</span> >+ [% END %] >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="rows"> >+ <legend>Import parameters:</legend> >+ <ol> >+ <li> >+ <label for="import_filter">Filter:</label> >+ [% IF ( oai_pmh_request.import_filter == "default" ) %] >+ <input type="text" size="30" id="import_filter" name="import_filter" value="default"> >+ [% ELSE %] >+ <input type="text" size="30" id="import_filter" name="import_filter" value="[% oai_pmh_request.import_filter | html %]"> >+ [% END %] >+ <span class="hint">If no filter is entered, the default filter will be used.</span> >+ </li> >+ <li> >+ <label for="import_framework_code">Framework code:</label> >+ <select id="import_framework_code" name="import_framework_code"> >+ <option value="">Default framework</option> >+ [% FOREACH framework IN frameworks %] >+ [% IF ( oai_pmh_request.import_framework_code == framework.frameworkcode ) %] >+ <option selected="selected" value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option> > [% ELSE %] >- <option value="ListRecords">ListRecords</option> >+ <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option> > [% END %] >- [% IF ( oai_pmh_request.oai_verb == "GetRecord" ) %] >- <option value="GetRecord" selected="selected">GetRecord</option> >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="import_record_type">Record type:</label> >+ <select id="import_record_type" name="import_record_type"> >+ <option value="biblio">Bibliographic</option> >+ </select> >+ </li> >+ <li> >+ <label for="import_matcher_code">Record matcher:</label> >+ <select id="import_matcher_code" name="import_matcher_code"> >+ <option value="">None</option> >+ [% FOREACH matcher IN matchers %] >+ [% IF ( oai_pmh_request.import_matcher_code == matcher.code ) %] >+ <option value="[% matcher.code | html %]" selected="selected">[% matcher.code | html %] ([% matcher.description | html %])</option> > [% ELSE %] >- <option value="GetRecord">GetRecord</option> >+ <option value="[% matcher.code | html %]">[% matcher.code | html %] ([% matcher.description | html %])</option> > [% END %] >- </select> >- </li> >- <li> >- <label for="oai_metadataPrefix">Metadata prefix:</label> >- <input type="text" size="30" id="oai_metadataPrefix" name="oai_metadataPrefix" value="[% oai_pmh_request.oai_metadataPrefix | html %]"> >- [% IF (errors.oai_metadataPrefix.unavailable) %]<span class="error">[This metadataPrefix is unavailable from this OAI-PMH provider.]</span>[% END %] >- [% IF (errors.oai_metadataPrefix.missing) %]<span class="error">[metadataPrefix is a required field for an OAI-PMH request.]</span>[% END %] >- </li> >- <li> >- <label for="oai_identifier">Identifier:</label> >- <input type="text" size="30" id="oai_identifier" name="oai_identifier" value="[% oai_pmh_request.oai_identifier | html %]"> >- [% IF (errors.oai_identifier.missing) %]<span class="error">[Identifier is a required field when using GetRecord for an OAI-PMH request.]</span>[% END %] >- </li> >- <li> >- <label for="oai_set">Set:</label> >- <input type="text" size="30" id="oai_set" name="oai_set" value="[% oai_pmh_request.oai_set | html %]"> >- [% IF (errors.oai_set.unavailable) %]<span class="error">[This set is unavailable from this OAI-PMH provider.]</span>[% END %] >- </li> >- [% IF (errors.oai.granularity_mismatch) %]<span class="error">[You must specify the same granularity for both From and Until.]</span>[% END %] >- <li> >- <label for="oai_from">From:</label> >- <input type="text" size="30" class="datetime_utc" id="oai_from" name="oai_from" value="[% oai_pmh_request.oai_from | html %]"> >- <span class="help">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span> >- [% IF (errors.oai_from.malformed) %]<span class="error">[This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.]</span>[% END %] >- [% IF (errors.oai_from.unavailable) %]<span class="error">[This granularity is unsupported by this OAI-PMH provider.]</span>[% END %] >- </li> >- <li> >- <label for="oai_until">Until:</label> >- <input type="text" size="30" class="datetime_utc" id="oai_until" name="oai_until" value="[% oai_pmh_request.oai_until | html %]"> >- <span class="help">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span> >- [% IF (errors.oai_until.malformed) %]<span class="error">[This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.]</span>[% END %] >- [% IF (errors.oai_until.unavailable) %]<span class="error">[This granularity is unsupported by this OAI-PMH provider.]</span>[% END %] >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>Import parameters:</legend> >- <ol> >- <li> >- <label for="import_filter">Filter:</label> >- [% IF ( oai_pmh_request.import_filter == "default" ) %] >- <input type="text" size="30" id="import_filter" name="import_filter" value="default"> >- [% ELSE %] >- <input type="text" size="30" id="import_filter" name="import_filter" value="[% oai_pmh_request.import_filter | html %]"> > [% END %] >- <span class="help">If no filter is entered, the default filter will be used.</span> >- </li> >- <li> >- <label for="import_framework_code">Framework code:</label> >- <select id="import_framework_code" name="import_framework_code"> >- <option value="">Default framework</option> >- [% FOREACH framework IN frameworks %] >- [% IF ( oai_pmh_request.import_framework_code == framework.frameworkcode ) %] >- <option selected="selected" value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option> >- [% ELSE %] >- <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >- <li> >- <label for="import_record_type">Record type:</label> >- <select id="import_record_type" name="import_record_type"> >- <option value="biblio">Bibliographic</option> >- </select> >- </li> >- <li> >- <label for="import_matcher_code">Record matcher:</label> >- <select id="import_matcher_code" name="import_matcher_code"> >- <option value="">None</option> >- [% FOREACH matcher IN matchers %] >- [% IF ( oai_pmh_request.import_matcher_code == matcher.code ) %] >- <option value="[% matcher.code | html %]" selected="selected">[% matcher.code | html %] ([% matcher.description | html %])</option> >- [% ELSE %] >- <option value="[% matcher.code | html %]">[% matcher.code | html %] ([% matcher.description | html %])</option> >- [% END %] >- [% END %] >- </select> >- <span class="help">See <a href="/cgi-bin/koha/admin/matching-rules.pl">record matching rules</a> to add or edit rules.</span> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>Download parameters:</legend> >- <ol> >- <li> >- <label for="interval">Interval (seconds): </label> >- <input type="text" id="interval" name="interval" value="[% oai_pmh_request.interval | html %]" size="4"> >- <span class="help">The download request will be repeated in intervals of this many seconds. Enter "0" if you want the task to only happen once.</span> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" name="test_parameters" value="Test parameters"> >- <input type="submit" name="save" value="Save"> >- <a class="cancel" href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">Cancel</a> >- </fieldset> >- </form> >- </div> >- </div> >- <div class="yui-b"> >+ </select> >+ <span class="hint">See <a href="/cgi-bin/koha/admin/matching-rules.pl">record matching rules</a> to add or edit rules.</span> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="rows"> >+ <legend>Download parameters:</legend> >+ <ol> >+ <li> >+ <label for="interval">Interval (seconds): </label> >+ <input type="text" id="interval" name="interval" value="[% oai_pmh_request.interval | html %]" size="4"> >+ <span class="hint">The download request will be repeated in intervals of this many seconds. Enter "0" if you want the task to only happen once.</span> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" name="test_parameters" value="Test parameters"> >+ <input type="submit" name="save" value="Save"> >+ <a class="cancel" href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">Cancel</a> >+ </fieldset> >+ </form> >+ >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> > [% INCLUDE 'tools-menu.inc' %] >- </div> >- </div> >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ >+ > [% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %] > [% INCLUDE 'timepicker.inc' %] >- <script type="text/javascript"> >+ <script> > $(document).ready(function() { > toggle_identifier(); > $("#oai_verb").on("click",toggle_identifier); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js b/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js >index 14325b6f9d..781757e035 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js >@@ -18,5 +18,7 @@ > $('#navmenulist a[href$="/cgi-bin/koha/tools/stockrotation.pl"]').addClass("current"); > } else if (path.indexOf("plugins") >= 0 ) { > $('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').addClass("current"); >+ } else if (path.indexOf("oai-pmh-harvester") >= 0 ) { >+ $('#navmenulist a[href$="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl"]').addClass("current"); > } > }); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10662
:
20757
|
20758
|
21954
|
42446
|
42447
|
42448
|
44792
|
44793
|
47675
|
48096
|
49832
|
50254
|
50980
|
51510
|
51511
|
51512
|
51514
|
51562
|
51563
|
51564
|
51565
|
51705
|
53258
|
53259
|
53260
|
53361
|
53362
|
64444
|
64445
|
64446
|
64479
|
64480
|
64481
|
65016
|
65017
|
65018
|
65019
|
68508
|
71008
|
71009
|
71010
|
71011
|
71012
|
71013
|
71014
|
71015
|
78569
|
78570
|
78571
|
78572
|
78573
|
78574
|
78575
|
78576
|
78577
|
78583
|
78601
|
78617
|
78754
|
78756
|
78758
|
78760
|
78762
|
78764
|
78767
|
78769
|
78771
|
78859
|
78860
|
78914
|
78956
|
79039
|
79045
|
81783
|
81784
|
81786
|
81789
|
81790
|
81855
|
81856
|
81861
|
81862
|
81863
|
81864
|
81902
|
82219
|
84318
|
84319
|
84320
|
84321
|
84322
|
85152
|
85224
|
85225
|
85226
|
85227
|
85228
|
85229
|
99739
|
99740
|
99741
|
99742
|
99743
|
99744
|
99745