4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha to MARC mapping › Administration › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="admin_koha2marclinks" class="admin">
10 [% WRAPPER 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
14 [% WRAPPER 'sub-header.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
21 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
24 <a href="#" aria-current="page">Koha to MARC mapping</a>
30 <div class="main container-fluid">
32 <div class="col-sm-10 col-sm-push-2">
35 <h1>Koha to MARC mapping</h1>
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">
41 <div class="dialog alert">Failed to add mapping for [% error_info | html %]</div>
44 <table id="kohafields">
53 [% FOREACH loo IN loop %]
55 <td>[% loo.kohafield | html %]</td>
56 <td>[% loo.tagfield | html %]</td>
57 <td>[% loo.tagsubfield | html %]</td>
58 <td>[% loo.liblibrarian | html %]</td>
60 [% IF !loo.readonly %]
61 <a onclick="AddFld('[% loo.kohafield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
62 [% IF loo.tagfield %] <a onclick="RemFld('[% loo.tagfield | html %]','[% loo.tagsubfield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-remove"></i> Remove</a> [% END %]
71 <input id="remove_field" name="remove_field" type="hidden" value=""/>
72 <input id="add_field" name="add_field" type="hidden" value=""/>
77 </div> <!-- /.col-sm-10.col-sm-push-2 -->
79 <div class="col-sm-2 col-sm-pull-10">
81 [% INCLUDE 'admin-menu.inc' %]
83 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
86 [% MACRO jsinclude BLOCK %]
87 [% INCLUDE 'datatables.inc' %]
88 [% Asset.js("js/admin-menu.js") | $raw %]
90 function AddFld(kohafield) {
91 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.") );
92 var temp = fieldstr.split(',');
93 if( temp.length == 2 ) {
94 $('#add_field').val( kohafield+','+fieldstr );
95 $('#koha2marc').submit();
97 alert( _("Invalid input. Enter something like: 245,a") );
101 function RemFld(tagfield, subfield ) {
102 if( confirm( _("Mapping will be removed for: %s.").format(tagfield + subfield) + "\n" + _("The change will be applied immediately." ))) {
103 $('#remove_field').val(tagfield+','+subfield);
104 $('#koha2marc').submit();
107 $(document).ready(function() {
108 $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
110 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
118 [% INCLUDE 'intranet-bottom.inc' %]