4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › Koha to MARC mapping</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 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC Mapping</a></div>
15 <div class="main container-fluid">
17 <div class="col-sm-10 col-sm-push-2">
20 <h1>Koha to MARC mapping</h1>
22 <form action="/cgi-bin/koha/admin/koha2marclinks.pl" method="post" id="koha2marc">
25 <div class="dialog alert">Failed to add mapping for [% error_info | html %]</div>
28 <table id="kohafields">
37 [% FOREACH loo IN loop %]
39 <td>[% loo.kohafield | html %]</td>
40 <td>[% loo.tagfield | html %]</td>
41 <td>[% loo.tagsubfield | html %]</td>
42 <td>[% loo.liblibrarian | html %]</td>
44 [% IF !loo.readonly %]
45 <a onclick="AddFld('[% loo.kohafield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
46 [% 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 %]
55 <input id="remove_field" name="remove_field" type="hidden" value=""/>
56 <input id="add_field" name="add_field" type="hidden" value=""/>
61 </div> <!-- /.col-sm-10.col-sm-push-2 -->
63 <div class="col-sm-2 col-sm-pull-10">
65 [% INCLUDE 'admin-menu.inc' %]
67 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
70 [% MACRO jsinclude BLOCK %]
71 [% INCLUDE 'datatables.inc' %]
72 [% Asset.js("js/admin-menu.js") | $raw %]
74 function AddFld(kohafield) {
75 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.") );
76 var temp = fieldstr.split(',');
77 if( temp.length == 2 ) {
78 $('#add_field').val( kohafield+','+fieldstr );
79 $('#koha2marc').submit();
81 alert( _("Invalid input. Enter something like: 245,a") );
85 function RemFld(tagfield, subfield ) {
86 if( confirm( _("Mapping will be removed for: %s.").format(tagfield + subfield) + "\n" + _("The change will be applied immediately." ))) {
87 $('#remove_field').val(tagfield+','+subfield);
88 $('#koha2marc').submit();
91 $(document).ready(function() {
92 $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
94 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
102 [% INCLUDE 'intranet-bottom.inc' %]