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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt (-10 / +25 lines)
Lines 33-39 Link Here
33
            <main>
33
            <main>
34
34
35
<h1>Koha to MARC mapping</h1>
35
<h1>Koha to MARC mapping</h1>
36
<br/>
36
37
<div class="dialog message">If you make any change to the mappings, you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</div>
37
<div class="dialog message">If you make any change to the mappings, you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</div>
38
<form action="/cgi-bin/koha/admin/koha2marclinks.pl" method="post" id="koha2marc">
38
<form action="/cgi-bin/koha/admin/koha2marclinks.pl" method="post" id="koha2marc">
39
39
Lines 59-66 Link Here
59
    <td>[% loo.liblibrarian | html %]</td>
59
    <td>[% loo.liblibrarian | html %]</td>
60
    <td class="actions">
60
    <td class="actions">
61
        [% IF !loo.readonly %]
61
        [% IF !loo.readonly %]
62
            <a onclick="AddFld('[% loo.kohafield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
62
            <a href="#" data-kohafield="[% loo.kohafield | html %]" class="addfld btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
63
            [% IF loo.tagfield %] <a onclick="RemFld('[% loo.tagfield | html %]','[% loo.tagsubfield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-times"></i> Remove</a> [% END %]
63
            [% IF loo.tagfield %]
64
                <a href="#" data-tagfield="[% loo.tagfield | html %]" data-tagsubfield="[% loo.tagsubfield | html %]" class="remfld btn btn-default btn-xs"><i class="fa fa-trash-can"></i> Remove</a>
65
            [% END %]
64
        [% END %]
66
        [% END %]
65
    </td>
67
    </td>
66
    </td>
68
    </td>
Lines 90-101 Link Here
90
    <script>
92
    <script>
91
        function AddFld(kohafield) {
93
        function AddFld(kohafield) {
92
            var fieldstr = prompt( _("Adding a mapping for: %s.").format(kohafield) + "\n" + _("Please enter field tag and subfield code, separated by a comma. (For control fields: add '@' as subfield code.)") + "\n" + _("The change will be applied immediately.") );
94
            var fieldstr = prompt( _("Adding a mapping for: %s.").format(kohafield) + "\n" + _("Please enter field tag and subfield code, separated by a comma. (For control fields: add '@' as subfield code.)") + "\n" + _("The change will be applied immediately.") );
93
            var temp = fieldstr.split(',');
95
            if( fieldstr ){
94
            if( temp.length == 2 ) {
96
                var temp = fieldstr.split(',');
95
                $('#add_field').val( kohafield+','+fieldstr );
97
                if( temp.length == 2 ) {
96
                $('#koha2marc').submit();
98
                    $('#add_field').val( kohafield+','+fieldstr );
97
            } else {
99
                    $('#koha2marc').submit();
98
                alert( _("Invalid input. Enter something like: 245,a") );
100
                } else {
101
                    alert( _("Invalid input. Enter something like: 245,a") );
102
                }
99
            }
103
            }
100
        }
104
        }
101
105
Lines 113-118 Link Here
113
                "paging":   false
117
                "paging":   false
114
            } ));
118
            } ));
115
119
120
            $(".addfld").on("click", function(e){
121
                e.preventDefault();
122
                const kohafield = $(this).data("kohafield");
123
                AddFld( kohafield );
124
            });
125
126
            $(".remfld").on("click", function(e){
127
                e.preventDefault();
128
                const tagfield = $(this).data("tagfield");
129
                const tagsubfield = $(this).data("tagsubfield");
130
                RemFld( tagfield, tagsubfield );
131
            });
116
         });
132
         });
117
    </script>
133
    </script>
118
[% END %]
134
[% END %]
119
- 

Return to bug 35032