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 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
13 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22 <a href="#" aria-current="page">Koha to MARC Mapping</a>
27 <div class="main container-fluid">
29 <div class="col-sm-10 col-sm-push-2">
32 <h1>Koha to MARC mapping</h1>
34 <div class="dialog message">If you make any change to the mappings, you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</div>
35 <form action="/cgi-bin/koha/admin/koha2marclinks.pl" method="post" id="koha2marc">
38 <div class="dialog alert">Failed to add mapping for [% error_info | html %]</div>
41 <table id="kohafields">
50 [% FOREACH loo IN loop %]
52 <td>[% loo.kohafield | html %]</td>
53 <td>[% loo.tagfield | html %]</td>
54 <td>[% loo.tagsubfield | html %]</td>
55 <td>[% loo.liblibrarian | html %]</td>
57 [% IF !loo.readonly %]
58 <a onclick="AddFld('[% loo.kohafield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
59 [% 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 %]
68 <input id="remove_field" name="remove_field" type="hidden" value=""/>
69 <input id="add_field" name="add_field" type="hidden" value=""/>
74 </div> <!-- /.col-sm-10.col-sm-push-2 -->
76 <div class="col-sm-2 col-sm-pull-10">
78 [% INCLUDE 'admin-menu.inc' %]
80 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
83 [% MACRO jsinclude BLOCK %]
84 [% INCLUDE 'datatables.inc' %]
85 [% Asset.js("js/admin-menu.js") | $raw %]
87 function AddFld(kohafield) {
88 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.)\nThe change will be applied immediately.") );
89 var temp = fieldstr.split(',');
90 if( temp.length == 2 ) {
91 $('#add_field').val( kohafield+','+fieldstr );
92 $('#koha2marc').submit();
94 alert( _("Invalid input. Enter something like: 245,a") );
98 function RemFld(tagfield, subfield ) {
99 if( confirm( _("Mapping will be removed for: %s.").format(tagfield + subfield) + "\n" + _("The change will be applied immediately." ))) {
100 $('#remove_field').val(tagfield+','+subfield);
101 $('#koha2marc').submit();
104 $(document).ready(function() {
105 $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
107 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
115 [% INCLUDE 'intranet-bottom.inc' %]