View | Details | Raw Unified | Return to bug 10662
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/lib/codemirror/xml.js (+402 lines)
Line 0 Link Here
1
// CodeMirror, copyright (c) by Marijn Haverbeke and others
2
// Distributed under an MIT license: https://codemirror.net/LICENSE
3
4
(function(mod) {
5
  if (typeof exports == "object" && typeof module == "object") // CommonJS
6
    mod(require("../../lib/codemirror"));
7
  else if (typeof define == "function" && define.amd) // AMD
8
    define(["../../lib/codemirror"], mod);
9
  else // Plain browser env
10
    mod(CodeMirror);
11
})(function(CodeMirror) {
12
"use strict";
13
14
var htmlConfig = {
15
  autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
16
                    'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
17
                    'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
18
                    'track': true, 'wbr': true, 'menuitem': true},
19
  implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
20
                     'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
21
                     'th': true, 'tr': true},
22
  contextGrabbers: {
23
    'dd': {'dd': true, 'dt': true},
24
    'dt': {'dd': true, 'dt': true},
25
    'li': {'li': true},
26
    'option': {'option': true, 'optgroup': true},
27
    'optgroup': {'optgroup': true},
28
    'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
29
          'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
30
          'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
31
          'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
32
          'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
33
    'rp': {'rp': true, 'rt': true},
34
    'rt': {'rp': true, 'rt': true},
35
    'tbody': {'tbody': true, 'tfoot': true},
36
    'td': {'td': true, 'th': true},
37
    'tfoot': {'tbody': true},
38
    'th': {'td': true, 'th': true},
39
    'thead': {'tbody': true, 'tfoot': true},
40
    'tr': {'tr': true}
41
  },
42
  doNotIndent: {"pre": true},
43
  allowUnquoted: true,
44
  allowMissing: true,
45
  caseFold: true
46
}
47
48
var xmlConfig = {
49
  autoSelfClosers: {},
50
  implicitlyClosed: {},
51
  contextGrabbers: {},
52
  doNotIndent: {},
53
  allowUnquoted: false,
54
  allowMissing: false,
55
  allowMissingTagName: false,
56
  caseFold: false
57
}
58
59
CodeMirror.defineMode("xml", function(editorConf, config_) {
60
  var indentUnit = editorConf.indentUnit
61
  var config = {}
62
  var defaults = config_.htmlMode ? htmlConfig : xmlConfig
63
  for (var prop in defaults) config[prop] = defaults[prop]
64
  for (var prop in config_) config[prop] = config_[prop]
65
66
  // Return variables for tokenizers
67
  var type, setStyle;
68
69
  function inText(stream, state) {
70
    function chain(parser) {
71
      state.tokenize = parser;
72
      return parser(stream, state);
73
    }
74
75
    var ch = stream.next();
76
    if (ch == "<") {
77
      if (stream.eat("!")) {
78
        if (stream.eat("[")) {
79
          if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
80
          else return null;
81
        } else if (stream.match("--")) {
82
          return chain(inBlock("comment", "-->"));
83
        } else if (stream.match("DOCTYPE", true, true)) {
84
          stream.eatWhile(/[\w\._\-]/);
85
          return chain(doctype(1));
86
        } else {
87
          return null;
88
        }
89
      } else if (stream.eat("?")) {
90
        stream.eatWhile(/[\w\._\-]/);
91
        state.tokenize = inBlock("meta", "?>");
92
        return "meta";
93
      } else {
94
        type = stream.eat("/") ? "closeTag" : "openTag";
95
        state.tokenize = inTag;
96
        return "tag bracket";
97
      }
98
    } else if (ch == "&") {
99
      var ok;
100
      if (stream.eat("#")) {
101
        if (stream.eat("x")) {
102
          ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
103
        } else {
104
          ok = stream.eatWhile(/[\d]/) && stream.eat(";");
105
        }
106
      } else {
107
        ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
108
      }
109
      return ok ? "atom" : "error";
110
    } else {
111
      stream.eatWhile(/[^&<]/);
112
      return null;
113
    }
114
  }
115
  inText.isInText = true;
116
117
  function inTag(stream, state) {
118
    var ch = stream.next();
119
    if (ch == ">" || (ch == "/" && stream.eat(">"))) {
120
      state.tokenize = inText;
121
      type = ch == ">" ? "endTag" : "selfcloseTag";
122
      return "tag bracket";
123
    } else if (ch == "=") {
124
      type = "equals";
125
      return null;
126
    } else if (ch == "<") {
127
      state.tokenize = inText;
128
      state.state = baseState;
129
      state.tagName = state.tagStart = null;
130
      var next = state.tokenize(stream, state);
131
      return next ? next + " tag error" : "tag error";
132
    } else if (/[\'\"]/.test(ch)) {
133
      state.tokenize = inAttribute(ch);
134
      state.stringStartCol = stream.column();
135
      return state.tokenize(stream, state);
136
    } else {
137
      stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
138
      return "word";
139
    }
140
  }
141
142
  function inAttribute(quote) {
143
    var closure = function(stream, state) {
144
      while (!stream.eol()) {
145
        if (stream.next() == quote) {
146
          state.tokenize = inTag;
147
          break;
148
        }
149
      }
150
      return "string";
151
    };
152
    closure.isInAttribute = true;
153
    return closure;
154
  }
155
156
  function inBlock(style, terminator) {
157
    return function(stream, state) {
158
      while (!stream.eol()) {
159
        if (stream.match(terminator)) {
160
          state.tokenize = inText;
161
          break;
162
        }
163
        stream.next();
164
      }
165
      return style;
166
    }
167
  }
168
169
  function doctype(depth) {
170
    return function(stream, state) {
171
      var ch;
172
      while ((ch = stream.next()) != null) {
173
        if (ch == "<") {
174
          state.tokenize = doctype(depth + 1);
175
          return state.tokenize(stream, state);
176
        } else if (ch == ">") {
177
          if (depth == 1) {
178
            state.tokenize = inText;
179
            break;
180
          } else {
181
            state.tokenize = doctype(depth - 1);
182
            return state.tokenize(stream, state);
183
          }
184
        }
185
      }
186
      return "meta";
187
    };
188
  }
189
190
  function Context(state, tagName, startOfLine) {
191
    this.prev = state.context;
192
    this.tagName = tagName;
193
    this.indent = state.indented;
194
    this.startOfLine = startOfLine;
195
    if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
196
      this.noIndent = true;
197
  }
198
  function popContext(state) {
199
    if (state.context) state.context = state.context.prev;
200
  }
201
  function maybePopContext(state, nextTagName) {
202
    var parentTagName;
203
    while (true) {
204
      if (!state.context) {
205
        return;
206
      }
207
      parentTagName = state.context.tagName;
208
      if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
209
          !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
210
        return;
211
      }
212
      popContext(state);
213
    }
214
  }
215
216
  function baseState(type, stream, state) {
217
    if (type == "openTag") {
218
      state.tagStart = stream.column();
219
      return tagNameState;
220
    } else if (type == "closeTag") {
221
      return closeTagNameState;
222
    } else {
223
      return baseState;
224
    }
225
  }
226
  function tagNameState(type, stream, state) {
227
    if (type == "word") {
228
      state.tagName = stream.current();
229
      setStyle = "tag";
230
      return attrState;
231
    } else if (config.allowMissingTagName && type == "endTag") {
232
      setStyle = "tag bracket";
233
      return attrState(type, stream, state);
234
    } else {
235
      setStyle = "error";
236
      return tagNameState;
237
    }
238
  }
239
  function closeTagNameState(type, stream, state) {
240
    if (type == "word") {
241
      var tagName = stream.current();
242
      if (state.context && state.context.tagName != tagName &&
243
          config.implicitlyClosed.hasOwnProperty(state.context.tagName))
244
        popContext(state);
245
      if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
246
        setStyle = "tag";
247
        return closeState;
248
      } else {
249
        setStyle = "tag error";
250
        return closeStateErr;
251
      }
252
    } else if (config.allowMissingTagName && type == "endTag") {
253
      setStyle = "tag bracket";
254
      return closeState(type, stream, state);
255
    } else {
256
      setStyle = "error";
257
      return closeStateErr;
258
    }
259
  }
260
261
  function closeState(type, _stream, state) {
262
    if (type != "endTag") {
263
      setStyle = "error";
264
      return closeState;
265
    }
266
    popContext(state);
267
    return baseState;
268
  }
269
  function closeStateErr(type, stream, state) {
270
    setStyle = "error";
271
    return closeState(type, stream, state);
272
  }
273
274
  function attrState(type, _stream, state) {
275
    if (type == "word") {
276
      setStyle = "attribute";
277
      return attrEqState;
278
    } else if (type == "endTag" || type == "selfcloseTag") {
279
      var tagName = state.tagName, tagStart = state.tagStart;
280
      state.tagName = state.tagStart = null;
281
      if (type == "selfcloseTag" ||
282
          config.autoSelfClosers.hasOwnProperty(tagName)) {
283
        maybePopContext(state, tagName);
284
      } else {
285
        maybePopContext(state, tagName);
286
        state.context = new Context(state, tagName, tagStart == state.indented);
287
      }
288
      return baseState;
289
    }
290
    setStyle = "error";
291
    return attrState;
292
  }
293
  function attrEqState(type, stream, state) {
294
    if (type == "equals") return attrValueState;
295
    if (!config.allowMissing) setStyle = "error";
296
    return attrState(type, stream, state);
297
  }
298
  function attrValueState(type, stream, state) {
299
    if (type == "string") return attrContinuedState;
300
    if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
301
    setStyle = "error";
302
    return attrState(type, stream, state);
303
  }
304
  function attrContinuedState(type, stream, state) {
305
    if (type == "string") return attrContinuedState;
306
    return attrState(type, stream, state);
307
  }
308
309
  return {
310
    startState: function(baseIndent) {
311
      var state = {tokenize: inText,
312
                   state: baseState,
313
                   indented: baseIndent || 0,
314
                   tagName: null, tagStart: null,
315
                   context: null}
316
      if (baseIndent != null) state.baseIndent = baseIndent
317
      return state
318
    },
319
320
    token: function(stream, state) {
321
      if (!state.tagName && stream.sol())
322
        state.indented = stream.indentation();
323
324
      if (stream.eatSpace()) return null;
325
      type = null;
326
      var style = state.tokenize(stream, state);
327
      if ((style || type) && style != "comment") {
328
        setStyle = null;
329
        state.state = state.state(type || style, stream, state);
330
        if (setStyle)
331
          style = setStyle == "error" ? style + " error" : setStyle;
332
      }
333
      return style;
334
    },
335
336
    indent: function(state, textAfter, fullLine) {
337
      var context = state.context;
338
      // Indent multi-line strings (e.g. css).
339
      if (state.tokenize.isInAttribute) {
340
        if (state.tagStart == state.indented)
341
          return state.stringStartCol + 1;
342
        else
343
          return state.indented + indentUnit;
344
      }
345
      if (context && context.noIndent) return CodeMirror.Pass;
346
      if (state.tokenize != inTag && state.tokenize != inText)
347
        return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
348
      // Indent the starts of attribute names.
349
      if (state.tagName) {
350
        if (config.multilineTagIndentPastTag !== false)
351
          return state.tagStart + state.tagName.length + 2;
352
        else
353
          return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
354
      }
355
      if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
356
      var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
357
      if (tagAfter && tagAfter[1]) { // Closing tag spotted
358
        while (context) {
359
          if (context.tagName == tagAfter[2]) {
360
            context = context.prev;
361
            break;
362
          } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
363
            context = context.prev;
364
          } else {
365
            break;
366
          }
367
        }
368
      } else if (tagAfter) { // Opening tag spotted
369
        while (context) {
370
          var grabbers = config.contextGrabbers[context.tagName];
371
          if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
372
            context = context.prev;
373
          else
374
            break;
375
        }
376
      }
377
      while (context && context.prev && !context.startOfLine)
378
        context = context.prev;
379
      if (context) return context.indent + indentUnit;
380
      else return state.baseIndent || 0;
381
    },
382
383
    electricInput: /<\/[\s\w:]+>$/,
384
    blockCommentStart: "<!--",
385
    blockCommentEnd: "-->",
386
387
    configuration: config.htmlMode ? "html" : "xml",
388
    helperType: config.htmlMode ? "html" : "xml",
389
390
    skipAttribute: function(state) {
391
      if (state.state == attrValueState)
392
        state.state = attrState
393
    }
394
  };
395
});
396
397
CodeMirror.defineMIME("text/xml", "xml");
398
CodeMirror.defineMIME("application/xml", "xml");
399
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
400
  CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
401
402
});
(-)a/koha-tmpl/intranet-tmpl/lib/codemirror/xml.min.js (+1 lines)
Line 0 Link Here
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})});
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt (-209 / +192 lines)
Lines 1-100 Link Here
1
[% USE raw %]
2
[% USE Asset %]
1
[% USE ColumnsSettings %]
3
[% USE ColumnsSettings %]
4
[% USE KohaDates %]
2
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Tools &rsaquo; OAI-PMH harvester</title>
7
<title>Koha &rsaquo; Tools &rsaquo; OAI-PMH harvester</title>
5
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
6
[% dashboard_page = '/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl' %]
9
[% dashboard_page = '/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl' %]
7
[% request_page = '/cgi-bin/koha/tools/oai-pmh-harvester/request.pl' %]
10
[% request_page = '/cgi-bin/koha/tools/oai-pmh-harvester/request.pl' %]
8
<style type="text/css">
11
[% Asset.css("css/datatables.css") | $raw %]
9
    a.paginate_button {
10
        padding: 2px;
11
    }
12
</style>
13
</head>
12
</head>
14
<body id="tools_oai-pmh-harvester" class="tools">
13
<body id="tools_oai-pmh-harvester" class="tools">
15
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'cat-search.inc' %]
15
[% INCLUDE 'cat-search.inc' %]
17
    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; OAI-PMH harvester</div>
16
    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; OAI-PMH harvester</div>
18
    <div id="doc3" class="yui-t2">
17
19
        <div id="bd">
18
<div class="main container-fluid">
20
            <div id="yui-main">
19
    <div class="row">
21
                <div class="yui-b">
20
        <div class="col-sm-10 col-sm-push-2">
22
                    <h1>OAI-PMH harvester</h1>
21
            <main>
23
                    <div id="toolbar" class="btn-toolbar">
22
24
                        <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>
23
                <h1>OAI-PMH harvester</h1>
24
                <div id="toolbar" class="btn-toolbar">
25
                    <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>
26
                </div>
27
                [% IF ( harvester.offline ) %]
28
                    <div class="dialog alert">
29
                        <span>OAI-PMH harvester offline</span>
25
                    </div>
30
                    </div>
26
                    [% IF ( harvester.offline ) %]
31
                [% END %]
27
                        <div class="alert">
32
                <div id="dashboard-items" class="toptabs">
28
                            <span>OAI-PMH harvester offline</span>
33
                    <ul>
29
                        </div>
34
                        <li>
30
                    [% END %]
35
                            <a href="#saved_requests">Saved requests <span id="saved_count">([% saved_requests.size | html %])</span></a>
31
                    <div id="dashboard-items" class="toptabs">
36
                        </li>
32
                        <ul>
37
                        <li>
33
                            <li>
38
                            <a href="#submitted_requests">Submitted requests <span id="submitted_count">([% submitted_requests.size | html %])</span></a>
34
                                <a href="#saved_requests">Saved requests <span id="saved_count">([% saved_requests.size | html %])</span></a>
39
                        </li>
35
                            </li>
40
                        <li>
36
                            <li>
41
                            <a href="#imports">Import history <span id="import_count">(0)</span></a>
37
                                <a href="#submitted_requests">Submitted requests <span id="submitted_count">([% submitted_requests.size | html %])</span></a>
42
                        </li>
38
                            </li>
43
                    </ul>
39
                            <li>
44
                    <div id="submitted_requests">
40
                                <a href="#imports">Import history <span id="import_count">(0)</span></a>
45
                        [% IF ( result.defined("start") ) %]
41
                            </li>
46
                            [% IF ( result.start ) %]
42
                        </ul>
47
                                <div class="dialog message">
43
                        <div id="submitted_requests">
48
                                    <span>Start succeeded</span>
44
                            [% IF ( result.defined("start") ) %]
45
                                <div class="alert">
46
                                    [% IF ( result.start ) %]
47
                                        <span>Start succeeded</span>
48
                                    [% ELSE %]
49
                                        <span>Start failed</span>
50
                                    [% END %]
51
                                </div>
49
                                </div>
52
                            [% ELSIF ( result.defined("stop") ) %]
50
                            [% ELSE %]
53
                                 <div class="alert">
51
                                <div class="dialog alert">
54
                                    [% IF ( result.stop ) %]
52
                                    <span>Start failed</span>
53
                                </div>
54
                            [% END %]
55
                        [% ELSIF ( result.defined("stop") ) %]
56
                                [% IF ( result.stop ) %]
57
                                    <div class="dialog message">
55
                                        <span>Stop succeeded</span>
58
                                        <span>Stop succeeded</span>
56
                                    [% ELSE %]
59
                                    </div>
60
                                [% ELSE %]
61
                                    <div class="dialog alert">
57
                                        <span>Stop failed</span>
62
                                        <span>Stop failed</span>
58
                                    [% END %]
63
                                    </div>
59
                                </div>
64
                                [% END %]
60
                            [% ELSIF ( result.defined("delete") ) %]
65
                        [% ELSIF ( result.defined("delete") ) %]
61
                                 <div class="alert">
66
                                [% IF ( result.delete ) %]
62
                                    [% IF ( result.delete ) %]
67
                                    <div class="dialog message">
63
                                        <span>Delete succeeded</span>
68
                                        <span>Delete succeeded</span>
64
                                    [% ELSE %]
69
                                    </div>
70
                                [% ELSE %]
71
                                    <div class="dialog alert">
65
                                        <span>Delete failed</span>
72
                                        <span>Delete failed</span>
66
                                    [% END %]
73
                                    </div>
67
                                </div>
74
                                [% END %]
68
                            [% END %]
75
                        [% END %]
69
                            <table id="submitted-table">
76
                        <table id="submitted-table">
70
                                <thead>
77
                            <thead>
71
                                    <tr>
78
                                <tr>
72
                                        <th>Name</th>
79
                                    <th>Name</th>
73
                                        <th>URL</th>
80
                                    <th>URL</th>
74
                                        <th>Set</th>
81
                                    <th>Set</th>
75
                                        <th>From</th>
82
                                    <th class="title-string">From</th>
76
                                        <th>Until</th>
83
                                    <th class="title-string">Until</th>
77
                                        <th>Interval</th>
84
                                    <th>Interval</th>
78
                                        <th>Effective from</th>
85
                                    <th class="title-string">Effective from</th>
79
                                        <th>Effective until</th>
86
                                    <th class="title-string">Effective until</th>
80
                                        <th>Pending imports</th>
87
                                    <th>Pending imports</th>
81
                                        <th>Status</th>
88
                                    <th>Status</th>
82
                                        <th>Error</th>
89
                                    <th>Error</th>
83
                                        <th></th>
90
                                    <th class="NoSort"></th>
84
                                    </tr>
91
                                </tr>
85
                                </thead>
92
                            </thead>
86
                                <tbody>
93
                            <tbody>
87
                                [% IF ( submitted_requests ) %]
94
                                [% IF ( submitted_requests ) %]
88
                                    [% FOREACH submitted_request IN submitted_requests %]
95
                                    [% FOREACH submitted_request IN submitted_requests %]
89
                                        <tr>
96
                                        <tr>
90
                                            <td>[% submitted_request.name | html %]</td>
97
                                            <td>[% submitted_request.name | html %]</td>
91
                                            <td>[% submitted_request.parameters.oai_pmh.baseURL | html %]</td>
98
                                            <td>[% submitted_request.parameters.oai_pmh.baseURL | html %]</td>
92
                                            <td>[% submitted_request.parameters.oai_pmh.set | html %]</td>
99
                                            <td>[% submitted_request.parameters.oai_pmh.set | html %]</td>
93
                                            <td>[% submitted_request.parameters.oai_pmh.from | html %]</td>
100
                                            <td><span title="[% submitted_request.parameters.oai_pmh.from | html %]">[% submitted_request.parameters.oai_pmh.from | $KohaDates with_hours = 1 %]</span></td>
94
                                            <td>[% submitted_request.parameters.oai_pmh.until | html %]</td>
101
                                            <td><span title="[% submitted_request.parameters.oai_pmh.until | html %]">[% submitted_request.parameters.oai_pmh.until | $KohaDates with_hours = 1 %]</span></td>
95
                                            <td>[% submitted_request.interval | html %]</td>
102
                                            <td>[% submitted_request.interval | html %]</td>
96
                                            <td>[% submitted_request.effective_from | html %]</td>
103
                                            <td><span title="[% submitted_request.effective_from | html %]">[% submitted_request.effective_from | $KohaDates with_hours = 1 %]</span></td>
97
                                            <td>[% submitted_request.effective_until | html %]</td>
104
                                            <td><span title="[% submitted_request.effective_until | html %]">[% submitted_request.effective_until | $KohaDates with_hours = 1 %]</span></td>
98
                                            <td>[% submitted_request.pending_imports |html %]</td>
105
                                            <td>[% submitted_request.pending_imports |html %]</td>
99
                                            <td>
106
                                            <td>
100
                                                [% IF ( submitted_status = submitted_request.status ) %]
107
                                                [% IF ( submitted_status = submitted_request.status ) %]
Lines 123-129 Link Here
123
                                                              <a href="[% dashboard_page | url %]?op=stop&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-stop"></i> Stop</a>
130
                                                              <a href="[% dashboard_page | url %]?op=stop&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-stop"></i> Stop</a>
124
                                                          </li>
131
                                                          </li>
125
                                                          <li>
132
                                                          <li>
126
                                                              <a href="[% dashboard_page | url %]?op=delete&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-trash"></i> Delete</a>
133
                                                              <a class="confirmdelete" href="[% dashboard_page | url %]?op=delete&uuid=[% submitted_request.uuid | url %]"><i class="fa fa-trash"></i> Delete</a>
127
                                                          </li>
134
                                                          </li>
128
                                                    </ul>
135
                                                    </ul>
129
                                                </div>
136
                                                </div>
Lines 131-279 Link Here
131
                                        </tr>
138
                                        </tr>
132
                                    [% END %]
139
                                    [% END %]
133
                                [% END %]
140
                                [% END %]
134
                                </tbody>
141
                            </tbody>
135
                            </table>
142
                        </table>
136
                        </div>
143
                    </div>
137
                        <div id="saved_requests">
144
                    <div id="saved_requests">
138
                            [% IF ( result.send.defined ) %]
145
                        [% IF ( result.send.defined ) %]
139
                                <div class="alert">
146
                                [% IF ( result.send ) %]
140
                                    [% IF ( result.send ) %]
147
                                    <div class="dialog message">
141
                                        <span>Submit succeeded</span>
148
                                        <span>Submit succeeded</span>
142
                                    [% ELSE %]
149
                                    </div>
150
                                [% ELSE %]
151
                                    <div class="dialog alert">
143
                                        <span>Submit failed</span>
152
                                        <span>Submit failed</span>
144
                                    [% END %]
153
                                    </div>
145
                                </div>
146
                            [% END %]
147
                            <table id="saved-table">
148
                                <thead>
149
                                    <tr>
150
                                        <th>Name</th>
151
                                        <th>URL</th>
152
                                   <!-- <th>Verb</th>
153
                                        <th>Metadata prefix</th>
154
                                        <th>Identifier</th> -->
155
                                        <th>Set</th>
156
                                        <th>From</th>
157
                                        <th>Until</th>
158
                                        <th>Interval</th>
159
                                   <!-- <th>Filter</th>
160
                                        <th>Framework code</th>
161
                                        <th>Record type</th>
162
                                        <th>Matcher code</th> -->
163
                                        <th></th>
164
                                    </tr>
165
                                </thead>
166
                                <tbody>
167
                                [% IF ( saved_requests ) %]
168
                                    [% FOREACH saved_request IN saved_requests %]
169
                                        <tr>
170
                                            <td>[% saved_request.name | html %]</td>
171
                                            <td>[% saved_request.http_url | html %]</td>
172
                                       <!-- <td>[% saved_request.oai_verb | html %]</td>
173
                                            <td>[% saved_request.oai_metadataPrefix | html %]</td>
174
                                            <td>[% saved_request.oai_identifier | html %]</td> -->
175
                                            <td>[% saved_request.oai_set | html %]</td>
176
                                            <td>[% saved_request.oai_from | html %]</td>
177
                                            <td>[% saved_request.oai_until | html %]</td>
178
                                            <td>[% saved_request.interval | html %]</td>
179
                                       <!-- <td>
180
                                                [% IF ( saved_request.import_filter == "default" ) %]
181
                                                    <span>Default</span>
182
                                                [% ELSE %]
183
                                                    [% saved_request.import_filter | html %]
184
                                                [% END %]
185
                                            </td>
186
                                            <td>
187
                                                [% display_framework = "" %]
188
                                                [% FOREACH framework IN frameworks %]
189
                                                    [% IF ( framework.frameworkcode == saved_request.import_framework_code ) %]
190
                                                        [% display_framework = framework %]
191
                                                    [% END %]
192
                                                [% END %]
193
                                                [% IF ( display_framework ) %]
194
                                                    [% display_framework.frameworktext | html %]
195
                                                [% ELSE %]
196
                                                    [% saved_request.import_framework_code | html %]
197
                                                [% END %]
198
                                            </td>
199
                                            <td>
200
                                                [% IF ( saved_request.import_record_type == "biblio" ) %]
201
                                                    <span>Bibliographic</span>
202
                                                [% ELSE %]
203
                                                    [% saved_request.import_record_type | html %]
204
                                                [% END %]
205
                                            </td>
206
                                            <td>
207
                                                [% display_matcher = "" %]
208
                                                [% FOREACH matcher IN matchers %]
209
                                                    [% IF ( matcher.code == saved_request.import_matcher_code ) %]
210
                                                        [% display_matcher = matcher %]
211
                                                    [% END %]
212
                                                [% END %]
213
                                                [% IF ( display_matcher ) %]
214
                                                    [% display_matcher.description | html %]
215
                                                [% ELSE %]
216
                                                    [% saved_request.import_matcher_code | html %]
217
                                                [% END %]
218
                                            </td> -->
219
                                            <td>
220
                                                <div class="dropdown">
221
                                                    <a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a>
222
                                                    <ul class="dropdown-menu pull-right" role="menu">
223
                                                          <li>
224
                                                              <a href="[% request_page | url %]?op=edit&id=[% saved_request.id | url %]"><i class="fa fa-pencil"></i> Edit</a>
225
                                                          </li>
226
                                                          <li>
227
                                                              <a href="[% request_page | url %]?op=new&id=[% saved_request.id | url %]"><i class="fa fa-copy"></i> Copy</a>
228
                                                          </li>
229
                                                          <li>
230
                                                              <a href="[% dashboard_page | url %]?op=send&id=[% saved_request.id | url %]"><i class="fa fa-send"></i> Submit</a>
231
                                                          </li>
232
                                                          <li>
233
                                                            <a href="[% request_page | url %]?op=delete&id=[% saved_request.id | url %]"><i class="fa fa-trash"></i> Delete</a>
234
                                                          </li>
235
                                                    </ul>
236
                                                </div>
237
                                            </td>
238
                                        </tr>
239
                                    [% END %]
240
                                [% END %]
154
                                [% END %]
241
                                </tbody>
155
                        [% END %]
242
                            </table>
156
                        <table id="saved-table">
243
                        </div>
157
                            <thead>
244
                        <div id="imports">
158
                                <tr>
245
                            <div class="btn-toolbar">
159
                                    <th>Name</th>
246
                                <button id="refresh-button" type="button" class="btn btn-default btn-sm">Refresh import history</button>
160
                                    <th>URL</th>
247
                            </div>
161
                                    <th>Set</th>
248
                            <table id="history-table">
162
                                    <th class="title-string">From</th>
249
                                <thead>
163
                                    <th class="title-string">Until</th>
164
                                    <th>Interval</th>
165
                                    <th class="NoSort"></th>
166
                                </tr>
167
                            </thead>
168
                            <tbody>
169
                            [% IF ( saved_requests ) %]
170
                                [% FOREACH saved_request IN saved_requests %]
250
                                    <tr>
171
                                    <tr>
251
                                        <th>Id</th>
172
                                        <td>[% saved_request.name | html %]</td>
252
                                        <th>Repository</th>
173
                                        <td>[% saved_request.http_url | html %]</td>
253
                                        <th>Identifier</th>
174
                                        <td>[% saved_request.oai_set | html %]</td>
254
                                        <th>Datestamp</th>
175
                                        <td><span title="[% saved_request.oai_from | html %]">[% saved_request.oai_from | $KohaDates with_hours = 1 %]</span></td>
255
                                        <th>Upstream status</th>
176
                                        <td><span title="[% saved_request.oai_until | html %]">[% saved_request.oai_until | $KohaDates with_hours = 1 %]</span></td>
256
                                        <th>Import status</th>
177
                                        <td>[% saved_request.interval | html %]</td>
257
                                        <th>Import timestamp</th>
178
                                        <td>
258
                                        <th>Imported record</th>
179
                                            <div class="dropdown">
259
                                        <th>Downloaded record</th>
180
                                                <a class="btn btn-default btn-xs dropdown-toggle" role="button" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a>
181
                                                <ul class="dropdown-menu pull-right" role="menu">
182
                                                      <li>
183
                                                          <a href="[% request_page | url %]?op=edit&id=[% saved_request.id | url %]"><i class="fa fa-pencil"></i> Edit</a>
184
                                                      </li>
185
                                                      <li>
186
                                                          <a href="[% request_page | url %]?op=new&id=[% saved_request.id | url %]"><i class="fa fa-copy"></i> Copy</a>
187
                                                      </li>
188
                                                      <li>
189
                                                          <a href="[% dashboard_page | url %]?op=send&id=[% saved_request.id | url %]"><i class="fa fa-send"></i> Submit</a>
190
                                                      </li>
191
                                                      <li>
192
                                                        <a class="confirmdelete" href="[% request_page | url %]?op=delete&id=[% saved_request.id | url %]"><i class="fa fa-trash"></i> Delete</a>
193
                                                      </li>
194
                                                </ul>
195
                                            </div>
196
                                        </td>
260
                                    </tr>
197
                                    </tr>
261
                                </thead>
198
                                [% END %]
262
                            </table>
199
                            [% END %]
263
200
                            </tbody>
264
                        </div>
201
                        </table>
202
                    </div>
203
                    <div id="imports">
204
                        <button id="refresh-button" type="button" class="btn btn-default btn-xs"><i class="fa fa-refresh"></i> Refresh import history</button>
205
                        <table id="history-table">
206
                            <thead>
207
                                <tr>
208
                                    <th>Id</th>
209
                                    <th>Repository</th>
210
                                    <th>Identifier</th>
211
                                    <th>Datestamp</th>
212
                                    <th>Upstream status</th>
213
                                    <th>Import status</th>
214
                                    <th>Import timestamp</th>
215
                                    <th class="NoSort">Imported record</th>
216
                                    <th class="NoSort">Downloaded record</th>
217
                                </tr>
218
                            </thead>
219
                        </table>
265
                    </div>
220
                    </div>
266
                </div>
221
                </div>
267
            </div>
222
            </main>
268
            <div class="yui-b">
223
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
224
225
        <div class="col-sm-2 col-sm-pull-10">
226
            <aside>
269
                [% INCLUDE 'tools-menu.inc' %]
227
                [% INCLUDE 'tools-menu.inc' %]
270
            </div>
228
            </aside>
271
        </div>
229
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
230
    </div> <!-- /.row -->
272
231
273
[% MACRO jsinclude BLOCK %]
232
[% MACRO jsinclude BLOCK %]
274
    [% INCLUDE 'datatables.inc' %]
233
    [% INCLUDE 'datatables.inc' %]
275
    [% INCLUDE 'columns_settings.inc' %]
234
    [% INCLUDE 'columns_settings.inc' %]
276
    <script type="text/javascript">
235
    [% Asset.js("js/tools-menu.js") | $raw %]
236
    <script>
277
        $(document).ready(function() {
237
        $(document).ready(function() {
278
            $('#dashboard-items').tabs();
238
            $('#dashboard-items').tabs();
279
            [% IF ( result.start.defined || result.stop.defined || result.delete.defined ) %]
239
            [% IF ( result.start.defined || result.stop.defined || result.delete.defined ) %]
Lines 281-293 Link Here
281
            [% END %]
241
            [% END %]
282
242
283
            var saved_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'saved-table', 'json' ) | $raw %];
243
            var saved_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'saved-table', 'json' ) | $raw %];
284
            var saved_table = KohaTable("saved-table",{},saved_table_columns_settings);
244
            var saved_table = KohaTable("saved-table",{
245
                "autoWidth": false,
246
                "aoColumnDefs": [
247
                    { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
248
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
249
                ],
250
                "sPaginationType": "four_button"
251
            },saved_table_columns_settings);
285
252
286
            var submitted_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'submitted-table', 'json' ) | $raw %];
253
            var submitted_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'submitted-table', 'json' ) | $raw %];
287
            var submitted_table = KohaTable("submitted-table",{},submitted_table_columns_settings);
254
            var submitted_table = KohaTable("submitted-table",{
255
                "autoWidth": false,
256
                "aoColumnDefs": [
257
                    { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
258
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
259
                ],
260
                "sPaginationType": "four_button"
261
            },submitted_table_columns_settings);
288
262
289
            var history_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'history-table', 'json' ) | $raw %];
263
            var history_table_columns_settings = [% ColumnsSettings.GetColumns( 'tools','oai-pmh-harvester-dashboard', 'history-table', 'json' ) | $raw %];
290
            var history_table = KohaTable("history-table",{
264
            var history_table = KohaTable("history-table",{
265
                "autoWidth": false,
266
                "aoColumnDefs": [
267
                    { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
268
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
269
                ],
270
                "sPaginationType": "four_button",
291
                serverSide: true,
271
                serverSide: true,
292
                searching: true,
272
                searching: true,
293
                processing: true,
273
                processing: true,
Lines 344-351 Link Here
344
                            var display_string = data;
324
                            var display_string = data;
345
                            var record_type = (full.record_type) ? full.record_type : 'biblio';
325
                            var record_type = (full.record_type) ? full.record_type : 'biblio';
346
                            if (data && record_type == 'biblio'){
326
                            if (data && record_type == 'biblio'){
347
                                var link_text = _("View biblio record");
327
                                var link_text = _("View in catalog");
348
                                var link = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber='+data+'">'+link_text+'</a>';
328
                                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>';
349
                                display_string = link;
329
                                display_string = link;
350
                            }
330
                            }
351
                            return display_string;
331
                            return display_string;
Lines 356-362 Link Here
356
                        data: 'import_oai_id', render: function (data, type, full, meta){
336
                        data: 'import_oai_id', render: function (data, type, full, meta){
357
                            var display_string = data;
337
                            var display_string = data;
358
                            var link_text = _("View record");
338
                            var link_text = _("View record");
359
                            var link = '<a href="/cgi-bin/koha/tools/oai-pmh-harvester/record.pl?import_oai_id='+data+'">'+link_text+'</a>';
339
                            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>';
360
                            display_string = link;
340
                            display_string = link;
361
                            return display_string;
341
                            return display_string;
362
                        }, searchable: false
342
                        }, searchable: false
Lines 372-377 Link Here
372
            $('#refresh-button').click(function(){
352
            $('#refresh-button').click(function(){
373
                history_table.dataTable().api().ajax.reload( null, false );
353
                history_table.dataTable().api().ajax.reload( null, false );
374
            });
354
            });
355
            $(".confirmdelete").on("click", function(){
356
                return confirmDelete(_("Are you sure you want to delete this request?"));
357
            })
375
        });
358
        });
376
    </script>
359
    </script>
377
[% END %]
360
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/record.tt (-11 / +43 lines)
Lines 1-23 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; OAI-PMH harvester &rsaquo; Downloaded record</title>
5
<title>Koha &rsaquo; Tools &rsaquo; OAI-PMH harvester &rsaquo; Downloaded record</title>
3
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% Asset.css("lib/codemirror/codemirror.css") | $raw %]
8
<style>
9
.CodeMirror {
10
    height: 100%
11
}
12
</style>
4
</head>
13
</head>
5
<body id="tools_oai-pmh-harvester_request" class="tools">
14
<body id="tools_oai-pmh-harvester_request" class="tools">
6
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'cat-search.inc' %]
16
[% INCLUDE 'cat-search.inc' %]
8
    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a> &rsaquo; Downloaded record</div>
17
    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a> &rsaquo; Downloaded record</div>
9
    <div id="doc3" class="yui-t2">
18
10
        <div id="bd">
19
    <div class="main container-fluid">
11
            <div id="yui-main">
20
        <div class="row">
12
                <div class="yui-b">
21
            <div class="col-sm-10 col-sm-push-2">
22
                <main>
23
13
                    <h1>Downloaded record</h1>
24
                    <h1>Downloaded record</h1>
14
                    [% IF ( record ) %]
25
                    [% IF ( record ) %]
15
                        <div style="white-space:pre">[% record | xml %]</div>
26
                        <textarea id="record">[% record | html %]</textarea>
16
                    [% END %]
27
                    [% END %]
17
                </div>
28
18
            </div>
29
                </main>
19
            <div class="yui-b">
30
            </div> <!-- /.col-sm-10.col-sm-push-2 -->
20
                [% INCLUDE 'tools-menu.inc' %]
31
21
            </div>
32
            <div class="col-sm-2 col-sm-pull-10">
22
        </div>
33
                <aside>
34
                    [% INCLUDE 'tools-menu.inc' %]
35
                </aside>
36
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
37
        </div> <!-- /.row -->
38
39
[% MACRO jsinclude BLOCK %]
40
    [% Asset.js("js/tools-menu.js") | $raw %]
41
    [% Asset.js("lib/codemirror/codemirror-compressed.js") | $raw %]
42
    [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
43
    <script>
44
        $(document).ready(function() {
45
            var editor = CodeMirror.fromTextArea( record, {
46
                lineNumbers: false,
47
                mode: "application/xml",
48
                lineWrapping: true,
49
                readOnly: true
50
            });
51
        });
52
    </script>
53
[% END %]
54
23
[% INCLUDE 'intranet-bottom.inc' %]
55
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/request.tt (-177 / +212 lines)
Lines 4-10 Link Here
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Tools &rsaquo; OAI-PMH harvester &rsaquo; Request</title>
5
<title>Koha &rsaquo; Tools &rsaquo; OAI-PMH harvester &rsaquo; Request</title>
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
<style type="text/css">
7
<style>
8
    /* Override staff-global.css which hides second, millisecond, and microsecond sliders */
8
    /* Override staff-global.css which hides second, millisecond, and microsecond sliders */
9
    .ui_tpicker_second {
9
    .ui_tpicker_second {
10
        display: block;
10
        display: block;
Lines 15-209 Link Here
15
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'cat-search.inc' %]
16
[% INCLUDE 'cat-search.inc' %]
17
    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a> &rsaquo; Request</div>
17
    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a> &rsaquo; Request</div>
18
    <div id="doc3" class="yui-t2">
18
19
        <div id="bd">
19
<div class="main container-fluid">
20
            <div id="yui-main">
20
    <div class="row">
21
                <div class="yui-b">
21
        <div class="col-sm-10 col-sm-push-2">
22
                    [% IF ( op == "edit" ) %]
22
            <main>
23
                        <h1>Edit OAI-PMH request</h1>
23
24
                [% IF ( op == "edit" ) %]
25
                    <h1>Edit OAI-PMH request</h1>
26
                [% ELSE %]
27
                    <h1>New OAI-PMH request</h1>
28
                [% END %]
29
                [% IF ( test_parameters ) %]
30
                    [% IF ( errors.size ) %]
31
                        <div class="dialog alert">Tests failed!</div>
24
                    [% ELSE %]
32
                    [% ELSE %]
25
                        <h1>New OAI-PMH request</h1>
33
                        <div class="dialog message">Tests succeeded!</div>
26
                    [% END %]
34
                    [% END %]
27
                    [% IF ( test_parameters ) %]
35
                [% END %]
28
                        [% IF ( errors.size ) %]
36
                <form action="/cgi-bin/koha/tools/oai-pmh-harvester/request.pl" method="post" name="entry-form">
29
                            <div class="dialog message"><span class="text-danger">Tests failed!</span></div>
37
                    [% IF ( op == "new" ) %]
30
                        [% ELSE %]
38
                        <input type="hidden" name="op" value="create" />
31
                            <div class="dialog message"><span class="text-success">Tests succeeded!</span></div>
39
                    [% ELSIF ( op == "edit" ) %]
32
                        [% END %]
40
                         <input type="hidden" name="op" value="update" />
41
                    [% ELSE %]
42
                        <input type="hidden" name="op" value="[% op | html %]" />
43
                    [% END %]
44
                    [% IF ( id ) %]
45
                        <input type="hidden" name="id" value="[% id | html %]" />
33
                    [% END %]
46
                    [% END %]
34
                    <form action="/cgi-bin/koha/tools/oai-pmh-harvester/request.pl" method="post" name="entry-form">
47
                    <fieldset class="rows">
35
                        [% IF ( op == "new" ) %]
48
                        <ol>
36
                            <input type="hidden" name="op" value="create" />
49
                            <li>
37
                        [% ELSIF ( op == "edit" ) %]
50
                                <label for="name">Name:</label>
38
                             <input type="hidden" name="op" value="update" />
51
                                <input type="text" size="30" id="name" name="name" value="[% oai_pmh_request.name | html %]"/>
39
                        [% ELSE %]
52
                                <span class="hint">This is a short name to help in managing requests.</span>
40
                            <input type="hidden" name="op" value="[% op | html %]" />
53
                            </li>
41
                        [% END %]
54
                        </ol>
42
                        [% IF ( id ) %]
55
                    </fieldset>
43
                            <input type="hidden" name="id" value="[% id | html %]" />
56
                    <fieldset class="rows">
44
                        [% END %]
57
                        <legend>HTTP parameters:</legend>
45
                        <fieldset class="rows">
58
                        <ol>
46
                            <ol>
59
                            <li>
47
                                <li>
60
                                <label for="http_url">URL:</label>
48
                                    <label for="name">Name:</label>
61
                                <input type="text" size="30" id="http_url" name="http_url" value="[% oai_pmh_request.http_url | html %]">
49
                                    <input type="text" size="30" id="name" name="name" value="[% oai_pmh_request.name | html %]"/>
62
                                [% IF (errors.http_url.malformed) %]
50
                                    <span class="help">This is just a short name to help in managing requests.</span>
63
                                    <span class="required">This must be a properly formatted HTTP or HTTPS URL.</span>
51
                                </li>
64
                                [% END %]
52
                            </ol>
65
                                [% IF (errors.http.404) %]
53
                        </fieldset>
66
                                    <span class="required">Cannot find address specified by this URL.</span>
54
                        <fieldset class="rows">
67
                                [% END %]
55
                            <legend>HTTP parameters:</legend>
68
                                [% IF (errors.http.401) %]
56
                            <ol>
69
                                    <span class="required">Permission denied to access this URL.</span>
57
                                <li>
70
                                [% END %]
58
                                    <label for="http_url">URL:</label>
71
                                [% IF (errors.http.generic) %]
59
                                    <input type="text" size="30" id="http_url" name="http_url" value="[% oai_pmh_request.http_url | html %]">
72
                                    <span class="required">Unable to access this URL.</span>
60
                                    [% IF (errors.http_url.malformed) %]<span class="error">[This must be a properly formatted HTTP or HTTPS URL.]</span>[% END %]
73
                                [% END %]
61
                                    [% IF (errors.http.404) %]<span class="error">[Cannot find address specified by this URL.]</span>[% END %]
74
                            </li>
62
                                    [% IF (errors.http.401) %]<span class="error">[Permission denied to access this URL.]</span>[% END %]
75
                        </ol>
63
                                    [% IF (errors.http.generic) %]<span class="error">[Unable to access this URL.]</span>[% END %]
76
                        <div class="hint">The following parameters are not required by all OAI-PMH repositories, so they may be optional for this task.</div>
64
                                </li>
77
                        <ol>
65
                            </ol>
78
                            <li>
66
                            <span class="help">The following parameters are not required by all OAI-PMH repositories, so they may be optional for this task.</span>
79
                                <label for="http_username">Username:</label>
67
                            <ol>
80
                                <input type="text" size="30" id="http_username" name="http_username" value="[% oai_pmh_request.http_username | html %]">
68
                                <li>
81
                            </li>
69
                                    <label for="http_username">Username:</label>
82
                            <li>
70
                                    <input type="text" size="30" id="http_username" name="http_username" value="[% oai_pmh_request.http_username | html %]">
83
                                <label for="http_password">Password:</label>
71
                                </li>
84
                                <input type="text" size="30" id="http_password" name="http_password" value="[% oai_pmh_request.http_password | html %]">
72
                                <li>
85
                            </li>
73
                                    <label for="http_password">Password:</label>
86
                            <li>
74
                                    <input type="text" size="30" id="http_password" name="http_password" value="[% oai_pmh_request.http_password | html %]">
87
                                <label for="http_realm">Realm:</label>
75
                                </li>
88
                                <input type="text" size="30" id="http_realm" name="http_realm" value="[% oai_pmh_request.http_realm | html %]">
76
                                <li>
89
                            </li>
77
                                    <label for="http_realm">Realm:</label>
90
                        </ol>
78
                                    <input type="text" size="30" id="http_realm" name="http_realm" value="[% oai_pmh_request.http_realm | html %]">
91
                    </fieldset>
79
                                </li>
92
                    <fieldset class="rows">
80
                            </ol>
93
                        <legend>OAI-PMH parameters:</legend>
81
                        </fieldset>
94
                        <ol>
82
                        <fieldset class="rows">
95
                            <li>
83
                            <legend>OAI-PMH parameters:</legend>
96
                                <label for="oai_verb">Verb:</label>
84
                            <ol>
97
                                <select id="oai_verb" name="oai_verb">
85
                                <li>
98
                                    [% IF ( oai_pmh_request.oai_verb == "ListRecords" ) %]
86
                                    <label for="oai_verb">Verb:</label>
99
                                    <option value="ListRecords" selected="selected">ListRecords</option>
87
                                    <select id="oai_verb" name="oai_verb">
100
                                    [% ELSE %]
88
                                        [% IF ( oai_pmh_request.oai_verb == "ListRecords" ) %]
101
                                    <option value="ListRecords">ListRecords</option>
89
                                        <option value="ListRecords" selected="selected">ListRecords</option>
102
                                    [% END %]
103
                                    [% IF ( oai_pmh_request.oai_verb == "GetRecord" ) %]
104
                                    <option value="GetRecord" selected="selected">GetRecord</option>
105
                                    [% ELSE %]
106
                                    <option value="GetRecord">GetRecord</option>
107
                                    [% END %]
108
                                </select>
109
                            </li>
110
                            <li>
111
                                <label for="oai_metadataPrefix">Metadata prefix:</label>
112
                                <input type="text" size="30" id="oai_metadataPrefix" name="oai_metadataPrefix" value="[% oai_pmh_request.oai_metadataPrefix | html %]">
113
                                [% IF (errors.oai_metadataPrefix.unavailable) %]
114
                                    <span class="required">This metadataPrefix is unavailable from this OAI-PMH provider.</span>
115
                                [% END %]
116
                                [% IF (errors.oai_metadataPrefix.missing) %]
117
                                    <span class="required">metadataPrefix is a required field for an OAI-PMH request.</span>
118
                                [% END %]
119
                            </li>
120
                            <li>
121
                                <label for="oai_identifier">Identifier:</label>
122
                                <input type="text" size="30" id="oai_identifier" name="oai_identifier" value="[% oai_pmh_request.oai_identifier | html %]">
123
                                [% IF (errors.oai_identifier.missing) %]
124
                                    <span class="required">Identifier is a required field when using GetRecord for an OAI-PMH request.</span>
125
                                [% END %]
126
                            </li>
127
                            <li>
128
                                <label for="oai_set">Set:</label>
129
                                <input type="text" size="30" id="oai_set" name="oai_set" value="[% oai_pmh_request.oai_set | html %]">
130
                                [% IF (errors.oai_set.unavailable) %]
131
                                    <span class="required">This set is unavailable from this OAI-PMH provider.</span>
132
                                [% END %]
133
                            </li>
134
                            [% IF (errors.oai.granularity_mismatch) %]
135
                                <span class="required">You must specify the same granularity for both From and Until.</span>
136
                            [% END %]
137
                            <li>
138
                                <label for="oai_from">From:</label>
139
                                <input type="text" size="30" class="datetime_utc" id="oai_from" name="oai_from" value="[% oai_pmh_request.oai_from | html %]">
140
                                <span class="hint">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span>
141
                                [% IF (errors.oai_from.malformed) %]
142
                                    <span class="required">This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.</span>
143
                                [% END %]
144
                                [% IF (errors.oai_from.unavailable) %]
145
                                    <span class="required">This granularity is unsupported by this OAI-PMH provider.</span>
146
                                [% END %]
147
                            </li>
148
                            <li>
149
                                <label for="oai_until">Until:</label>
150
                                <input type="text" size="30" class="datetime_utc" id="oai_until" name="oai_until" value="[% oai_pmh_request.oai_until | html %]">
151
                                <span class="hint">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span>
152
                                [% IF (errors.oai_until.malformed) %]
153
                                    <span class="required">This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.</span>
154
                                [% END %]
155
                                [% IF (errors.oai_until.unavailable) %]
156
                                    <span class="required">This granularity is unsupported by this OAI-PMH provider.</span>
157
                                [% END %]
158
                            </li>
159
                        </ol>
160
                    </fieldset>
161
                    <fieldset class="rows">
162
                        <legend>Import parameters:</legend>
163
                        <ol>
164
                            <li>
165
                                <label for="import_filter">Filter:</label>
166
                                [% IF ( oai_pmh_request.import_filter == "default" ) %]
167
                                    <input type="text" size="30" id="import_filter" name="import_filter" value="default">
168
                                [% ELSE %]
169
                                    <input type="text" size="30" id="import_filter" name="import_filter" value="[% oai_pmh_request.import_filter | html %]">
170
                                [% END %]
171
                                <span class="hint">If no filter is entered, the default filter will be used.</span>
172
                            </li>
173
                            <li>
174
                                <label for="import_framework_code">Framework code:</label>
175
                                <select id="import_framework_code" name="import_framework_code">
176
                                    <option value="">Default framework</option>
177
                                    [% FOREACH framework IN frameworks %]
178
                                        [% IF ( oai_pmh_request.import_framework_code == framework.frameworkcode ) %]
179
                                            <option selected="selected" value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
90
                                        [% ELSE %]
180
                                        [% ELSE %]
91
                                        <option value="ListRecords">ListRecords</option>
181
                                            <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
92
                                        [% END %]
182
                                        [% END %]
93
                                        [% IF ( oai_pmh_request.oai_verb == "GetRecord" ) %]
183
                                    [% END %]
94
                                        <option value="GetRecord" selected="selected">GetRecord</option>
184
                                </select>
185
                            </li>
186
                            <li>
187
                                <label for="import_record_type">Record type:</label>
188
                                <select id="import_record_type" name="import_record_type">
189
                                    <option value="biblio">Bibliographic</option>
190
                                </select>
191
                            </li>
192
                            <li>
193
                                <label for="import_matcher_code">Record matcher:</label>
194
                                <select id="import_matcher_code" name="import_matcher_code">
195
                                    <option value="">None</option>
196
                                    [% FOREACH matcher IN matchers %]
197
                                        [% IF ( oai_pmh_request.import_matcher_code == matcher.code ) %]
198
                                            <option value="[% matcher.code | html %]" selected="selected">[% matcher.code | html %] ([% matcher.description | html %])</option>
95
                                        [% ELSE %]
199
                                        [% ELSE %]
96
                                        <option value="GetRecord">GetRecord</option>
200
                                            <option value="[% matcher.code | html %]">[% matcher.code | html %] ([% matcher.description | html %])</option>
97
                                        [% END %]
201
                                        [% END %]
98
                                    </select>
99
                                </li>
100
                                <li>
101
                                    <label for="oai_metadataPrefix">Metadata prefix:</label>
102
                                    <input type="text" size="30" id="oai_metadataPrefix" name="oai_metadataPrefix" value="[% oai_pmh_request.oai_metadataPrefix | html %]">
103
                                    [% IF (errors.oai_metadataPrefix.unavailable) %]<span class="error">[This metadataPrefix is unavailable from this OAI-PMH provider.]</span>[% END %]
104
                                    [% IF (errors.oai_metadataPrefix.missing) %]<span class="error">[metadataPrefix is a required field for an OAI-PMH request.]</span>[% END %]
105
                                </li>
106
                                <li>
107
                                    <label for="oai_identifier">Identifier:</label>
108
                                    <input type="text" size="30" id="oai_identifier" name="oai_identifier" value="[% oai_pmh_request.oai_identifier | html %]">
109
                                    [% IF (errors.oai_identifier.missing) %]<span class="error">[Identifier is a required field when using GetRecord for an OAI-PMH request.]</span>[% END %]
110
                                </li>
111
                                <li>
112
                                    <label for="oai_set">Set:</label>
113
                                    <input type="text" size="30" id="oai_set" name="oai_set" value="[% oai_pmh_request.oai_set | html %]">
114
                                    [% IF (errors.oai_set.unavailable) %]<span class="error">[This set is unavailable from this OAI-PMH provider.]</span>[% END %]
115
                                </li>
116
                                [% IF (errors.oai.granularity_mismatch) %]<span class="error">[You must specify the same granularity for both From and Until.]</span>[% END %]
117
                                <li>
118
                                    <label for="oai_from">From:</label>
119
                                    <input type="text" size="30" class="datetime_utc" id="oai_from" name="oai_from" value="[% oai_pmh_request.oai_from | html %]">
120
                                    <span class="help">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span>
121
                                    [% IF (errors.oai_from.malformed) %]<span class="error">[This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.]</span>[% END %]
122
                                    [% IF (errors.oai_from.unavailable) %]<span class="error">[This granularity is unsupported by this OAI-PMH provider.]</span>[% END %]
123
                                </li>
124
                                <li>
125
                                    <label for="oai_until">Until:</label>
126
                                    <input type="text" size="30" class="datetime_utc" id="oai_until" name="oai_until" value="[% oai_pmh_request.oai_until | html %]">
127
                                    <span class="help">This value will be treated as UTC time. Note that some repositories only support YYYY-MM-DD datestamps.</span>
128
                                    [% IF (errors.oai_until.malformed) %]<span class="error">[This must be in YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ format.]</span>[% END %]
129
                                    [% IF (errors.oai_until.unavailable) %]<span class="error">[This granularity is unsupported by this OAI-PMH provider.]</span>[% END %]
130
                                </li>
131
                            </ol>
132
                        </fieldset>
133
                        <fieldset class="rows">
134
                            <legend>Import parameters:</legend>
135
                            <ol>
136
                                <li>
137
                                    <label for="import_filter">Filter:</label>
138
                                    [% IF ( oai_pmh_request.import_filter == "default" ) %]
139
                                        <input type="text" size="30" id="import_filter" name="import_filter" value="default">
140
                                    [% ELSE %]
141
                                        <input type="text" size="30" id="import_filter" name="import_filter" value="[% oai_pmh_request.import_filter | html %]">
142
                                    [% END %]
202
                                    [% END %]
143
                                    <span class="help">If no filter is entered, the default filter will be used.</span>
203
                                </select>
144
                                </li>
204
                                <span class="hint">See <a href="/cgi-bin/koha/admin/matching-rules.pl">record matching rules</a> to add or edit rules.</span>
145
                                <li>
205
                            </li>
146
                                    <label for="import_framework_code">Framework code:</label>
206
                        </ol>
147
                                    <select id="import_framework_code" name="import_framework_code">
207
                    </fieldset>
148
                                        <option value="">Default framework</option>
208
                    <fieldset class="rows">
149
                                        [% FOREACH framework IN frameworks %]
209
                        <legend>Download parameters:</legend>
150
                                            [% IF ( oai_pmh_request.import_framework_code == framework.frameworkcode ) %]
210
                        <ol>
151
                                                <option selected="selected" value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
211
                            <li>
152
                                            [% ELSE %]
212
                                <label for="interval">Interval (seconds): </label>
153
                                                <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
213
                                <input type="text" id="interval" name="interval" value="[% oai_pmh_request.interval | html %]" size="4">
154
                                            [% END %]
214
                                <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>
155
                                        [% END %]
215
                            </li>
156
                                    </select>
216
                        </ol>
157
                                </li>
217
                    </fieldset>
158
                                <li>
218
                    <fieldset class="action">
159
                                    <label for="import_record_type">Record type:</label>
219
                        <input type="submit" name="test_parameters" value="Test parameters">
160
                                    <select id="import_record_type" name="import_record_type">
220
                        <input type="submit" name="save" value="Save">
161
                                        <option value="biblio">Bibliographic</option>
221
                        <a class="cancel" href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">Cancel</a>
162
                                    </select>
222
                    </fieldset>
163
                                </li>
223
                </form>
164
                                <li>
224
165
                                    <label for="import_matcher_code">Record matcher:</label>
225
            </main>
166
                                    <select id="import_matcher_code" name="import_matcher_code">
226
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
167
                                        <option value="">None</option>
227
168
                                        [% FOREACH matcher IN matchers %]
228
        <div class="col-sm-2 col-sm-pull-10">
169
                                            [% IF ( oai_pmh_request.import_matcher_code == matcher.code ) %]
229
            <aside>
170
                                                <option value="[% matcher.code | html %]" selected="selected">[% matcher.code | html %] ([% matcher.description | html %])</option>
171
                                            [% ELSE %]
172
                                                <option value="[% matcher.code | html %]">[% matcher.code | html %] ([% matcher.description | html %])</option>
173
                                            [% END %]
174
                                        [% END %]
175
                                    </select>
176
                                    <span class="help">See <a href="/cgi-bin/koha/admin/matching-rules.pl">record matching rules</a> to add or edit rules.</span>
177
                                </li>
178
                            </ol>
179
                        </fieldset>
180
                        <fieldset class="rows">
181
                            <legend>Download parameters:</legend>
182
                            <ol>
183
                                <li>
184
                                    <label for="interval">Interval (seconds): </label>
185
                                    <input type="text" id="interval" name="interval" value="[% oai_pmh_request.interval | html %]" size="4">
186
                                    <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>
187
                                </li>
188
                            </ol>
189
                        </fieldset>
190
                        <fieldset class="action">
191
                            <input type="submit" name="test_parameters" value="Test parameters">
192
                            <input type="submit" name="save" value="Save">
193
                            <a class="cancel" href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">Cancel</a>
194
                        </fieldset>
195
                    </form>
196
                </div>
197
            </div>
198
            <div class="yui-b">
199
                [% INCLUDE 'tools-menu.inc' %]
230
                [% INCLUDE 'tools-menu.inc' %]
200
            </div>
231
            </aside>
201
        </div>
232
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
233
    </div> <!-- /.row -->
234
235
202
[% MACRO jsinclude BLOCK %]
236
[% MACRO jsinclude BLOCK %]
237
    [% Asset.js("js/tools-menu.js") | $raw %]
203
    [% INCLUDE 'calendar.inc' %]
238
    [% INCLUDE 'calendar.inc' %]
204
    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
239
    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
205
    [% INCLUDE 'timepicker.inc' %]
240
    [% INCLUDE 'timepicker.inc' %]
206
    <script type="text/javascript">
241
    <script>
207
        $(document).ready(function() {
242
        $(document).ready(function() {
208
            toggle_identifier();
243
            toggle_identifier();
209
            $("#oai_verb").on("click",toggle_identifier);
244
            $("#oai_verb").on("click",toggle_identifier);
(-)a/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js (-1 / +2 lines)
Lines 18-22 Link Here
18
          $('#navmenulist a[href$="/cgi-bin/koha/tools/stockrotation.pl"]').addClass("current");
18
          $('#navmenulist a[href$="/cgi-bin/koha/tools/stockrotation.pl"]').addClass("current");
19
      } else if (path.indexOf("plugins") >= 0 ) {
19
      } else if (path.indexOf("plugins") >= 0 ) {
20
          $('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').addClass("current");
20
          $('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').addClass("current");
21
      } else if (path.indexOf("oai-pmh-harvester") >= 0 ) {
22
          $('#navmenulist a[href$="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl"]').addClass("current");
21
      }
23
      }
22
  });
24
  });
23
- 

Return to bug 10662