|
Lines 1-3
Link Here
|
|
|
1 |
[% SET footerjs = 1 %] |
| 1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
| 2 |
<title>Koha › Administration › Record matching rules |
3 |
<title>Koha › Administration › Record matching rules |
| 3 |
[% IF ( matching_rule_form ) %] |
4 |
[% IF ( matching_rule_form ) %] |
|
Lines 46-198
Link Here
|
| 46 |
</select> |
47 |
</select> |
| 47 |
[% END %] |
48 |
[% END %] |
| 48 |
|
49 |
|
| 49 |
<script type="text/javascript"> |
|
|
| 50 |
//<![CDATA[ |
| 51 |
|
| 52 |
var maxMatchPoint = [% max_matchpoint %]; |
| 53 |
var maxMatchCheck = [% max_matchcheck %]; |
| 54 |
|
| 55 |
function InsertMatchpoint(loc, index) { |
| 56 |
var original= $("#"+index); |
| 57 |
var clone = original.clone(); |
| 58 |
clone.show(); |
| 59 |
|
| 60 |
// update IDs and form names |
| 61 |
maxMatchPoint++; |
| 62 |
clone.attr('id', 'mp_' + maxMatchPoint); |
| 63 |
$("span.counter",clone).html(maxMatchPoint); |
| 64 |
$("label",clone).each(function(){ |
| 65 |
var s = $(this).attr("for"); |
| 66 |
if (s.match(/mp_num/)) { |
| 67 |
$(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 68 |
} |
| 69 |
}); |
| 70 |
|
| 71 |
$("div",clone).each(function(){ |
| 72 |
var s = $(this).attr("id"); |
| 73 |
if (s.match(/mp_num/)) { |
| 74 |
$(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 75 |
} |
| 76 |
}); |
| 77 |
$("input",clone).each(function(){ |
| 78 |
var s = $(this).attr("id"); |
| 79 |
if(s.match(/mp_num/)){ |
| 80 |
$(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 81 |
} |
| 82 |
|
| 83 |
var s = $(this).attr("name"); |
| 84 |
if(s.match(/mp_num/)){ |
| 85 |
$(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 86 |
} |
| 87 |
}); |
| 88 |
$("#match_points").append(clone); |
| 89 |
} |
| 90 |
|
| 91 |
function InsertMatchcheck(loc, index) { |
| 92 |
var original= $("#"+index); |
| 93 |
var clone = original.clone(); |
| 94 |
clone.show(); |
| 95 |
|
| 96 |
// update IDs and form names |
| 97 |
maxMatchCheck++; |
| 98 |
clone.attr('id', 'mc_' + maxMatchCheck); |
| 99 |
$("span.counter",clone).html(maxMatchCheck); |
| 100 |
$("label",clone).each(function(){ |
| 101 |
var s = $(this).attr("for"); |
| 102 |
if (s.match(/mc_num/)) { |
| 103 |
$(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 104 |
} |
| 105 |
}); |
| 106 |
|
| 107 |
$("div",clone).each(function(){ |
| 108 |
var s = $(this).attr("id"); |
| 109 |
if (s.match(/mc_num/)) { |
| 110 |
$(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 111 |
} |
| 112 |
}); |
| 113 |
$("input",clone).each(function(){ |
| 114 |
var s = $(this).attr("id"); |
| 115 |
if(s.match(/mc_num/)){ |
| 116 |
$(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 117 |
} |
| 118 |
|
| 119 |
var s = $(this).attr("name"); |
| 120 |
if(s.match(/mc_num/)){ |
| 121 |
$(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 122 |
} |
| 123 |
}); |
| 124 |
$("#match_checks").append(clone); |
| 125 |
} |
| 126 |
|
| 127 |
function DeleteMatchpoint(loc) { |
| 128 |
$(loc).parent().parent().parent().remove(); |
| 129 |
if($(".matchgroup",$("#match_points")).length == 0){ |
| 130 |
maxMatchPoint = 0; |
| 131 |
$("#addMatchPoint").show(); |
| 132 |
} |
| 133 |
} |
| 134 |
|
| 135 |
function DeleteMatchcheck(loc) { |
| 136 |
$(loc).parent().parent().parent().remove(); |
| 137 |
if($(".matchgroup",$("#match_checks")).length == 0){ |
| 138 |
maxMatchCheck = 0; |
| 139 |
$("#addMatchCheck").show(); |
| 140 |
} |
| 141 |
} |
| 142 |
|
| 143 |
function DoCancel(f) { |
| 144 |
f.op.value=''; |
| 145 |
document.Aform.submit(); |
| 146 |
} |
| 147 |
|
| 148 |
function CheckMatchingRuleForm(f) { |
| 149 |
var ok=1; |
| 150 |
var _alertString=""; |
| 151 |
var alertString2; |
| 152 |
if (f.code.value.length==0) { |
| 153 |
_alertString += "\n- " + _("Matching rule code missing"); |
| 154 |
} |
| 155 |
if (f.description.value.length==0) { |
| 156 |
_alertString += "\n- " + _("Description missing"); |
| 157 |
} |
| 158 |
if (f.threshold.value.length==0) { |
| 159 |
_alertString += "\n- " + _("Threshold missing"); |
| 160 |
} |
| 161 |
if (_alertString.length==0) { |
| 162 |
document.Aform.submit(); |
| 163 |
} else { |
| 164 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
| 165 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
| 166 |
alertString2 += _alertString; |
| 167 |
alert(alertString2); |
| 168 |
} |
| 169 |
} |
| 170 |
|
| 171 |
function CheckRuleForm(f) { |
| 172 |
var ok=1; |
| 173 |
var _alertString=""; |
| 174 |
var alertString2; |
| 175 |
if (f.sort_rule.value.length==0) { |
| 176 |
_alertString += "\n- " + _("Filing rule code missing"); |
| 177 |
} |
| 178 |
if (f.description.value.length==0) { |
| 179 |
_alertString += "\n- " + _("Description missing"); |
| 180 |
} |
| 181 |
if (f.sort_routine.value.length==0) { |
| 182 |
_alertString += "\n- " + _("Sort routine missing"); |
| 183 |
} |
| 184 |
if (_alertString.length==0) { |
| 185 |
document.Aform.submit(); |
| 186 |
} else { |
| 187 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
| 188 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
| 189 |
alertString2 += _alertString; |
| 190 |
alert(alertString2); |
| 191 |
} |
| 192 |
} |
| 193 |
|
| 194 |
//]]> |
| 195 |
</script> |
| 196 |
<style type="text/css"> |
50 |
<style type="text/css"> |
| 197 |
fieldset.rows fieldset.rows { border-width : 0; } |
51 |
fieldset.rows fieldset.rows { border-width : 0; } |
| 198 |
fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; } |
52 |
fieldset.rows fieldset.rows fieldset.rows { border-width : 1px; } |
|
Lines 723-726
function CheckRuleForm(f) {
Link Here
|
| 723 |
[% INCLUDE 'admin-menu.inc' %] |
577 |
[% INCLUDE 'admin-menu.inc' %] |
| 724 |
</div> |
578 |
</div> |
| 725 |
</div> |
579 |
</div> |
|
|
580 |
|
| 581 |
[% MACRO jsinclude BLOCK %] |
| 582 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> |
| 583 |
<script type="text/javascript"> |
| 584 |
var maxMatchPoint = [% max_matchpoint %]; |
| 585 |
var maxMatchCheck = [% max_matchcheck %]; |
| 586 |
|
| 587 |
function InsertMatchpoint(loc, index) { |
| 588 |
var original= $("#"+index); |
| 589 |
var clone = original.clone(); |
| 590 |
clone.show(); |
| 591 |
|
| 592 |
// update IDs and form names |
| 593 |
maxMatchPoint++; |
| 594 |
clone.attr('id', 'mp_' + maxMatchPoint); |
| 595 |
$("span.counter",clone).html(maxMatchPoint); |
| 596 |
$("label",clone).each(function(){ |
| 597 |
var s = $(this).attr("for"); |
| 598 |
if (s.match(/mp_num/)) { |
| 599 |
$(this).attr("for",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 600 |
} |
| 601 |
}); |
| 602 |
|
| 603 |
$("div",clone).each(function(){ |
| 604 |
var s = $(this).attr("id"); |
| 605 |
if (s.match(/mp_num/)) { |
| 606 |
$(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 607 |
} |
| 608 |
}); |
| 609 |
$("input",clone).each(function(){ |
| 610 |
var s = $(this).attr("id"); |
| 611 |
if(s.match(/mp_num/)){ |
| 612 |
$(this).attr("id",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 613 |
} |
| 614 |
|
| 615 |
var s = $(this).attr("name"); |
| 616 |
if(s.match(/mp_num/)){ |
| 617 |
$(this).attr("name",s.replace(/mp_num/, 'mp_' + maxMatchPoint)); |
| 618 |
} |
| 619 |
}); |
| 620 |
$("#match_points").append(clone); |
| 621 |
} |
| 622 |
|
| 623 |
function InsertMatchcheck(loc, index) { |
| 624 |
var original= $("#"+index); |
| 625 |
var clone = original.clone(); |
| 626 |
clone.show(); |
| 627 |
|
| 628 |
// update IDs and form names |
| 629 |
maxMatchCheck++; |
| 630 |
clone.attr('id', 'mc_' + maxMatchCheck); |
| 631 |
$("span.counter",clone).html(maxMatchCheck); |
| 632 |
$("label",clone).each(function(){ |
| 633 |
var s = $(this).attr("for"); |
| 634 |
if (s.match(/mc_num/)) { |
| 635 |
$(this).attr("for",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 636 |
} |
| 637 |
}); |
| 638 |
|
| 639 |
$("div",clone).each(function(){ |
| 640 |
var s = $(this).attr("id"); |
| 641 |
if (s.match(/mc_num/)) { |
| 642 |
$(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 643 |
} |
| 644 |
}); |
| 645 |
$("input",clone).each(function(){ |
| 646 |
var s = $(this).attr("id"); |
| 647 |
if(s.match(/mc_num/)){ |
| 648 |
$(this).attr("id",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 649 |
} |
| 650 |
|
| 651 |
var s = $(this).attr("name"); |
| 652 |
if(s.match(/mc_num/)){ |
| 653 |
$(this).attr("name",s.replace(/mc_num/, 'mc_' + maxMatchCheck)); |
| 654 |
} |
| 655 |
}); |
| 656 |
$("#match_checks").append(clone); |
| 657 |
} |
| 658 |
|
| 659 |
function DeleteMatchpoint(loc) { |
| 660 |
$(loc).parent().parent().parent().remove(); |
| 661 |
if($(".matchgroup",$("#match_points")).length == 0){ |
| 662 |
maxMatchPoint = 0; |
| 663 |
$("#addMatchPoint").show(); |
| 664 |
} |
| 665 |
} |
| 666 |
|
| 667 |
function DeleteMatchcheck(loc) { |
| 668 |
$(loc).parent().parent().parent().remove(); |
| 669 |
if($(".matchgroup",$("#match_checks")).length == 0){ |
| 670 |
maxMatchCheck = 0; |
| 671 |
$("#addMatchCheck").show(); |
| 672 |
} |
| 673 |
} |
| 674 |
|
| 675 |
function DoCancel(f) { |
| 676 |
f.op.value=''; |
| 677 |
document.Aform.submit(); |
| 678 |
} |
| 679 |
|
| 680 |
function CheckMatchingRuleForm(f) { |
| 681 |
var ok=1; |
| 682 |
var _alertString=""; |
| 683 |
var alertString2; |
| 684 |
if (f.code.value.length==0) { |
| 685 |
_alertString += "\n- " + _("Matching rule code missing"); |
| 686 |
} |
| 687 |
if (f.description.value.length==0) { |
| 688 |
_alertString += "\n- " + _("Description missing"); |
| 689 |
} |
| 690 |
if (f.threshold.value.length==0) { |
| 691 |
_alertString += "\n- " + _("Threshold missing"); |
| 692 |
} |
| 693 |
if (_alertString.length==0) { |
| 694 |
document.Aform.submit(); |
| 695 |
} else { |
| 696 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
| 697 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
| 698 |
alertString2 += _alertString; |
| 699 |
alert(alertString2); |
| 700 |
} |
| 701 |
} |
| 702 |
|
| 703 |
function CheckRuleForm(f) { |
| 704 |
var ok=1; |
| 705 |
var _alertString=""; |
| 706 |
var alertString2; |
| 707 |
if (f.sort_rule.value.length==0) { |
| 708 |
_alertString += "\n- " + _("Filing rule code missing"); |
| 709 |
} |
| 710 |
if (f.description.value.length==0) { |
| 711 |
_alertString += "\n- " + _("Description missing"); |
| 712 |
} |
| 713 |
if (f.sort_routine.value.length==0) { |
| 714 |
_alertString += "\n- " + _("Sort routine missing"); |
| 715 |
} |
| 716 |
if (_alertString.length==0) { |
| 717 |
document.Aform.submit(); |
| 718 |
} else { |
| 719 |
alertString2 = _("Form not submitted because of the following problem(s)"); |
| 720 |
alertString2 += "\n------------------------------------------------------------------------------------\n"; |
| 721 |
alertString2 += _alertString; |
| 722 |
alert(alertString2); |
| 723 |
} |
| 724 |
} |
| 725 |
</script> |
| 726 |
[% END %] |
| 726 |
[% INCLUDE 'intranet-bottom.inc' %] |
727 |
[% INCLUDE 'intranet-bottom.inc' %] |