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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt (+5 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Classification sources
3
<title>Koha &rsaquo; Administration &rsaquo; Classification sources
3
[% IF ( class_source_form ) %]
4
[% IF ( class_source_form ) %]
Lines 265-268 Link Here
265
[% INCLUDE 'admin-menu.inc' %]
266
[% INCLUDE 'admin-menu.inc' %]
266
  </div>
267
  </div>
267
</div>
268
</div>
269
270
[% MACRO jsinclude BLOCK %]
271
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
272
[% END %]
268
[% INCLUDE 'intranet-bottom.inc' %]
273
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt (-1 / +6 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
4
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
Lines 39-42 Link Here
39
      </div>
40
      </div>
40
    </div>
41
    </div>
41
42
42
    [% INCLUDE 'intranet-bottom.inc' %]
43
[% MACRO jsinclude BLOCK %]
44
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
45
[% END %]
46
47
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt (-5 / +11 lines)
Lines 1-12 Link Here
1
[% SET footerjs = 1 %]
1
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
4
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
4
  [% INCLUDE 'doc-head-close.inc' %]
5
  [% INCLUDE 'doc-head-close.inc' %]
5
  <script type="text/javascript">
6
      var MSG_ITEM_SEARCH_DELETE_CONFIRM = _("Are you sure you want to delete this field?");
7
  </script>
8
  <script type="text/javascript" src="[% interface %]/[% theme %]/js/item_search_fields.js"></script>
9
</head>
6
</head>
7
10
<body id="admin_itemssearchfields" class="admin">
8
<body id="admin_itemssearchfields" class="admin">
11
  [% INCLUDE 'header.inc' %]
9
  [% INCLUDE 'header.inc' %]
12
  [% INCLUDE 'prefs-admin-search.inc' %]
10
  [% INCLUDE 'prefs-admin-search.inc' %]
Lines 110-113 Link Here
110
      </div>
108
      </div>
111
    </div>
109
    </div>
112
110
113
    [% INCLUDE 'intranet-bottom.inc' %]
111
[% MACRO jsinclude BLOCK %]
112
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
113
    <script type="text/javascript">
114
        var MSG_ITEM_SEARCH_DELETE_CONFIRM = _("Are you sure you want to delete this field?");
115
    </script>
116
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/item_search_fields.js"></script>
117
[% END %]
118
119
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt (-147 / +148 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Record matching rules
3
<title>Koha &rsaquo; Administration &rsaquo; 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' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_set_mappings.tt (-36 / +39 lines)
Lines 1-42 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; OAI sets &rsaquo; OAI set mappings</title>
3
<title>Koha &rsaquo; Administration &rsaquo; OAI sets &rsaquo; OAI set mappings</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript">
5
//<![CDATA[
6
$(document).ready(function() {
7
    $("#mappingform").submit(function(){
8
      hideDialogBox();
9
    });
10
    $("body").on("click","#ORbutton", function(e){
11
        e.preventDefault();
12
        newCondition();
13
    });
14
    $("body").on("click",".clear-field",function(e){
15
        e.preventDefault();
16
        clearRow(e.target);
17
    });
18
});
19
20
function newCondition() {
21
    var tr = $('#ORbutton').parents('tr');
22
    var clone = $(tr).clone();
23
    $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
24
    $(tr).parent('tbody').append(clone);
25
}
26
function clearRow(link){
27
    var tr = $(link).parent().parent();
28
    var found = tr.find('#ORbutton');
29
    if( found.length ){
30
      tr.find('input[type="text"]').attr("value","");
31
    } else {
32
      tr.find('input[type="text"]').attr("value","").end().hide();
33
    }
34
}
35
function hideDialogBox() {
36
    $('div.dialog').remove();
37
}
38
//]]>
39
</script>
40
</head>
5
</head>
41
6
42
<body id="admin_oai_set_mappings" class="admin">
7
<body id="admin_oai_set_mappings" class="admin">
Lines 126-129 function hideDialogBox() { Link Here
126
    [% INCLUDE 'admin-menu.inc' %]
91
    [% INCLUDE 'admin-menu.inc' %]
127
  </div>
92
  </div>
128
</div>
93
</div>
94
95
[% MACRO jsinclude BLOCK %]
96
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
97
    <script type="text/javascript">
98
        $(document).ready(function() {
99
            $("#mappingform").submit(function(){
100
              hideDialogBox();
101
            });
102
            $("body").on("click","#ORbutton", function(e){
103
                e.preventDefault();
104
                newCondition();
105
            });
106
            $("body").on("click",".clear-field",function(e){
107
                e.preventDefault();
108
                clearRow(e.target);
109
            });
110
        });
111
112
        function newCondition() {
113
            var tr = $('#ORbutton').parents('tr');
114
            var clone = $(tr).clone();
115
            $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
116
            $(tr).parent('tbody').append(clone);
117
        }
118
        function clearRow(link){
119
            var tr = $(link).parent().parent();
120
            var found = tr.find('#ORbutton');
121
            if( found.length ){
122
              tr.find('input[type="text"]').attr("value","");
123
            } else {
124
              tr.find('input[type="text"]').attr("value","").end().hide();
125
            }
126
        }
127
        function hideDialogBox() {
128
            $('div.dialog').remove();
129
        }
130
    </script>
131
[% END %]
129
[% INCLUDE 'intranet-bottom.inc' %]
132
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt (-39 / +41 lines)
Lines 1-44 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; [% IF ( op_new ) %]OAI sets configuration &rsaquo; Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
3
<title>Koha &rsaquo; Administration &rsaquo; [% IF ( op_new ) %]OAI sets configuration &rsaquo; Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript">
5
//<![CDATA[
6
function newDescField() {
7
    $("#adddescription").before(
8
        '<li><label>setDescription: </label>' +
9
        '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
10
        '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>' +
11
        '</li>'
12
    );
13
}
14
15
function delDescField(minusButton) {
16
    var li = minusButton.parent('li');
17
    $(li).remove();
18
}
19
20
function confirmDelete() {
21
  return confirm(_("Are you sure you want to delete this OAI set?"));
22
}
23
24
$(document).ready(function() {
25
    $(".delete_oai_set").on("click",function(){
26
        return confirmDelete();
27
    });
28
29
    $("body").on("click", ".remove_description", function(e){
30
        e.preventDefault();
31
        delDescField($(this));
32
    });
33
34
    $(".add_description").on("click", function(e){
35
        e.preventDefault();
36
        newDescField();
37
    });
38
39
});
40
//]]>
41
</script>
42
</head>
5
</head>
43
6
44
<body id="admin_oai_sets" class="admin">
7
<body id="admin_oai_sets" class="admin">
Lines 148-151 $(document).ready(function() { Link Here
148
    [% INCLUDE 'admin-menu.inc' %]
111
    [% INCLUDE 'admin-menu.inc' %]
149
  </div>
112
  </div>
150
</div>
113
</div>
114
115
[% MACRO jsinclude BLOCK %]
116
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
117
    <script type="text/javascript">
118
        function newDescField() {
119
            $("#adddescription").before(
120
                '<li><label>setDescription: </label>' +
121
                '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
122
                '<a class="remove_description" href="#"><i class="fa fa-fw fa-trash"></i> Remove</a>' +
123
                '</li>'
124
            );
125
        }
126
127
        function delDescField(minusButton) {
128
            var li = minusButton.parent('li');
129
            $(li).remove();
130
        }
131
132
        function confirmDelete() {
133
          return confirm(_("Are you sure you want to delete this OAI set?"));
134
        }
135
136
        $(document).ready(function() {
137
            $(".delete_oai_set").on("click",function(){
138
                return confirmDelete();
139
            });
140
141
            $("body").on("click", ".remove_description", function(e){
142
                e.preventDefault();
143
                delDescField($(this));
144
            });
145
146
            $(".add_description").on("click", function(e){
147
                e.preventDefault();
148
                newDescField();
149
            });
150
151
        });
152
    </script>
153
[% END %]
151
[% INCLUDE 'intranet-bottom.inc' %]
154
[% INCLUDE 'intranet-bottom.inc' %]
152
- 

Return to bug 19600