+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Administration › Record matching rules
[% IF ( matching_rule_form ) %]
</select>
[% END %]
-<script type="text/javascript">
-//<![CDATA[
-
-var maxMatchPoint = [% max_matchpoint %];
-var maxMatchCheck = [% max_matchcheck %];
-
-function InsertMatchpoint(loc, index) {
- var original= $("#"+index);
- var clone = original.clone();
- clone.show();
-
- // update IDs and form names
- maxMatchPoint++;
- clone.attr('id', 'mp_' + maxMatchPoint);
- $("span.counter",clone).html(maxMatchPoint);
- $("label",clone).each(function(){
- var s = $(this).attr("for");
- if (s.match(/mp_num/)) {
- $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
- }
- });
-
- $("div",clone).each(function(){
- var s = $(this).attr("id");
- if (s.match(/mp_num/)) {
- $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
- }
- });
- $("input",clone).each(function(){
- var s = $(this).attr("id");
- if(s.match(/mp_num/)){
- $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
- }
-
- var s = $(this).attr("name");
- if(s.match(/mp_num/)){
- $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
- }
- });
- $("#match_points").append(clone);
-}
-
-function InsertMatchcheck(loc, index) {
- var original= $("#"+index);
- var clone = original.clone();
- clone.show();
-
- // update IDs and form names
- maxMatchCheck++;
- clone.attr('id', 'mc_' + maxMatchCheck);
- $("span.counter",clone).html(maxMatchCheck);
- $("label",clone).each(function(){
- var s = $(this).attr("for");
- if (s.match(/mc_num/)) {
- $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
- }
- });
-
- $("div",clone).each(function(){
- var s = $(this).attr("id");
- if (s.match(/mc_num/)) {
- $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
- }
- });
- $("input",clone).each(function(){
- var s = $(this).attr("id");
- if(s.match(/mc_num/)){
- $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
- }
-
- var s = $(this).attr("name");
- if(s.match(/mc_num/)){
- $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
- }
- });
- $("#match_checks").append(clone);
-}
-
-function DeleteMatchpoint(loc) {
- $(loc).parent().parent().parent().remove();
- if($(".matchgroup",$("#match_points")).length == 0){
- maxMatchPoint = 0;
- $("#addMatchPoint").show();
- }
-}
-
-function DeleteMatchcheck(loc) {
- $(loc).parent().parent().parent().remove();
- if($(".matchgroup",$("#match_checks")).length == 0){
- maxMatchCheck = 0;
- $("#addMatchCheck").show();
- }
-}
-
-function DoCancel(f) {
- f.op.value='';
- document.Aform.submit();
-}
-
-function CheckMatchingRuleForm(f) {
- var ok=1;
- var _alertString="";
- var alertString2;
- if (f.code.value.length==0) {
- _alertString += "\n- " + _("Matching rule code missing");
- }
- if (f.description.value.length==0) {
- _alertString += "\n- " + _("Description missing");
- }
- if (f.threshold.value.length==0) {
- _alertString += "\n- " + _("Threshold missing");
- }
- if (_alertString.length==0) {
- document.Aform.submit();
- } else {
- alertString2 = _("Form not submitted because of the following problem(s)");
- alertString2 += "\n------------------------------------------------------------------------------------\n";
- alertString2 += _alertString;
- alert(alertString2);
- }
-}
-
-function CheckRuleForm(f) {
- var ok=1;
- var _alertString="";
- var alertString2;
- if (f.sort_rule.value.length==0) {
- _alertString += "\n- " + _("Filing rule code missing");
- }
- if (f.description.value.length==0) {
- _alertString += "\n- " + _("Description missing");
- }
- if (f.sort_routine.value.length==0) {
- _alertString += "\n- " + _("Sort routine missing");
- }
- if (_alertString.length==0) {
- document.Aform.submit();
- } else {
- alertString2 = _("Form not submitted because of the following problem(s)");
- alertString2 += "\n------------------------------------------------------------------------------------\n";
- alertString2 += _alertString;
- alert(alertString2);
- }
-}
-
-//]]>
-</script>
<style type="text/css">
fieldset.rows fieldset.rows { border-width : 0; }
fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; }
[% INCLUDE 'admin-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
+ <script type="text/javascript">
+ var maxMatchPoint = [% max_matchpoint %];
+ var maxMatchCheck = [% max_matchcheck %];
+
+ function InsertMatchpoint(loc, index) {
+ var original= $("#"+index);
+ var clone = original.clone();
+ clone.show();
+
+ // update IDs and form names
+ maxMatchPoint++;
+ clone.attr('id', 'mp_' + maxMatchPoint);
+ $("span.counter",clone).html(maxMatchPoint);
+ $("label",clone).each(function(){
+ var s = $(this).attr("for");
+ if (s.match(/mp_num/)) {
+ $(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
+ }
+ });
+
+ $("div",clone).each(function(){
+ var s = $(this).attr("id");
+ if (s.match(/mp_num/)) {
+ $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
+ }
+ });
+ $("input",clone).each(function(){
+ var s = $(this).attr("id");
+ if(s.match(/mp_num/)){
+ $(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
+ }
+
+ var s = $(this).attr("name");
+ if(s.match(/mp_num/)){
+ $(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint));
+ }
+ });
+ $("#match_points").append(clone);
+ }
+
+ function InsertMatchcheck(loc, index) {
+ var original= $("#"+index);
+ var clone = original.clone();
+ clone.show();
+
+ // update IDs and form names
+ maxMatchCheck++;
+ clone.attr('id', 'mc_' + maxMatchCheck);
+ $("span.counter",clone).html(maxMatchCheck);
+ $("label",clone).each(function(){
+ var s = $(this).attr("for");
+ if (s.match(/mc_num/)) {
+ $(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
+ }
+ });
+
+ $("div",clone).each(function(){
+ var s = $(this).attr("id");
+ if (s.match(/mc_num/)) {
+ $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
+ }
+ });
+ $("input",clone).each(function(){
+ var s = $(this).attr("id");
+ if(s.match(/mc_num/)){
+ $(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
+ }
+
+ var s = $(this).attr("name");
+ if(s.match(/mc_num/)){
+ $(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck));
+ }
+ });
+ $("#match_checks").append(clone);
+ }
+
+ function DeleteMatchpoint(loc) {
+ $(loc).parent().parent().parent().remove();
+ if($(".matchgroup",$("#match_points")).length == 0){
+ maxMatchPoint = 0;
+ $("#addMatchPoint").show();
+ }
+ }
+
+ function DeleteMatchcheck(loc) {
+ $(loc).parent().parent().parent().remove();
+ if($(".matchgroup",$("#match_checks")).length == 0){
+ maxMatchCheck = 0;
+ $("#addMatchCheck").show();
+ }
+ }
+
+ function DoCancel(f) {
+ f.op.value='';
+ document.Aform.submit();
+ }
+
+ function CheckMatchingRuleForm(f) {
+ var ok=1;
+ var _alertString="";
+ var alertString2;
+ if (f.code.value.length==0) {
+ _alertString += "\n- " + _("Matching rule code missing");
+ }
+ if (f.description.value.length==0) {
+ _alertString += "\n- " + _("Description missing");
+ }
+ if (f.threshold.value.length==0) {
+ _alertString += "\n- " + _("Threshold missing");
+ }
+ if (_alertString.length==0) {
+ document.Aform.submit();
+ } else {
+ alertString2 = _("Form not submitted because of the following problem(s)");
+ alertString2 += "\n------------------------------------------------------------------------------------\n";
+ alertString2 += _alertString;
+ alert(alertString2);
+ }
+ }
+
+ function CheckRuleForm(f) {
+ var ok=1;
+ var _alertString="";
+ var alertString2;
+ if (f.sort_rule.value.length==0) {
+ _alertString += "\n- " + _("Filing rule code missing");
+ }
+ if (f.description.value.length==0) {
+ _alertString += "\n- " + _("Description missing");
+ }
+ if (f.sort_routine.value.length==0) {
+ _alertString += "\n- " + _("Sort routine missing");
+ }
+ if (_alertString.length==0) {
+ document.Aform.submit();
+ } else {
+ alertString2 = _("Form not submitted because of the following problem(s)");
+ alertString2 += "\n------------------------------------------------------------------------------------\n";
+ alertString2 += _alertString;
+ alert(alertString2);
+ }
+ }
+ </script>
+[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Administration › OAI sets › OAI set mappings</title>
[% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-$(document).ready(function() {
- $("#mappingform").submit(function(){
- hideDialogBox();
- });
- $("body").on("click","#ORbutton", function(e){
- e.preventDefault();
- newCondition();
- });
- $("body").on("click",".clear-field",function(e){
- e.preventDefault();
- clearRow(e.target);
- });
-});
-
-function newCondition() {
- var tr = $('#ORbutton').parents('tr');
- var clone = $(tr).clone();
- $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
- $(tr).parent('tbody').append(clone);
-}
-function clearRow(link){
- var tr = $(link).parent().parent();
- var found = tr.find('#ORbutton');
- if( found.length ){
- tr.find('input[type="text"]').attr("value","");
- } else {
- tr.find('input[type="text"]').attr("value","").end().hide();
- }
-}
-function hideDialogBox() {
- $('div.dialog').remove();
-}
-//]]>
-</script>
</head>
<body id="admin_oai_set_mappings" class="admin">
[% INCLUDE 'admin-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#mappingform").submit(function(){
+ hideDialogBox();
+ });
+ $("body").on("click","#ORbutton", function(e){
+ e.preventDefault();
+ newCondition();
+ });
+ $("body").on("click",".clear-field",function(e){
+ e.preventDefault();
+ clearRow(e.target);
+ });
+ });
+
+ function newCondition() {
+ var tr = $('#ORbutton').parents('tr');
+ var clone = $(tr).clone();
+ $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
+ $(tr).parent('tbody').append(clone);
+ }
+ function clearRow(link){
+ var tr = $(link).parent().parent();
+ var found = tr.find('#ORbutton');
+ if( found.length ){
+ tr.find('input[type="text"]').attr("value","");
+ } else {
+ tr.find('input[type="text"]').attr("value","").end().hide();
+ }
+ }
+ function hideDialogBox() {
+ $('div.dialog').remove();
+ }
+ </script>
+[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Administration › [% IF ( op_new ) %]OAI sets configuration › Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-function newDescField() {
- $("#adddescription").before(
- '<li><label>setDescription: </label>' +
- '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
- '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>' +
- '</li>'
- );
-}
-
-function delDescField(minusButton) {
- var li = minusButton.parent('li');
- $(li).remove();
-}
-
-function confirmDelete() {
- return confirm(_("Are you sure you want to delete this OAI set?"));
-}
-
-$(document).ready(function() {
- $(".delete_oai_set").on("click",function(){
- return confirmDelete();
- });
-
- $("body").on("click", ".remove_description", function(e){
- e.preventDefault();
- delDescField($(this));
- });
-
- $(".add_description").on("click", function(e){
- e.preventDefault();
- newDescField();
- });
-
-});
-//]]>
-</script>
</head>
<body id="admin_oai_sets" class="admin">
[% INCLUDE 'admin-menu.inc' %]
</div>
</div>
+
+[% MACRO jsinclude BLOCK %]
+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
+ <script type="text/javascript">
+ function newDescField() {
+ $("#adddescription").before(
+ '<li><label>setDescription: </label>' +
+ '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
+ '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>' +
+ '</li>'
+ );
+ }
+
+ function delDescField(minusButton) {
+ var li = minusButton.parent('li');
+ $(li).remove();
+ }
+
+ function confirmDelete() {
+ return confirm(_("Are you sure you want to delete this OAI set?"));
+ }
+
+ $(document).ready(function() {
+ $(".delete_oai_set").on("click",function(){
+ return confirmDelete();
+ });
+
+ $("body").on("click", ".remove_description", function(e){
+ e.preventDefault();
+ delDescField($(this));
+ });
+
+ $(".add_description").on("click", function(e){
+ e.preventDefault();
+ newDescField();
+ });
+
+ });
+ </script>
+[% END %]
[% INCLUDE 'intranet-bottom.inc' %]