3 [% PROCESS 'i18n.inc' %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% FILTER collapse %]
7 [% t("Koha to MARC mapping") | html %] ›
8 [% t("Administration") | html %] ›
11 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="admin_koha2marclinks" class="admin">
15 [% WRAPPER 'header.inc' %]
16 [% INCLUDE 'prefs-admin-search.inc' %]
19 [% WRAPPER 'sub-header.inc' %]
20 [% WRAPPER breadcrumbs %]
21 [% WRAPPER breadcrumb_item %]
22 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
24 [% WRAPPER breadcrumb_item bc_active= 1 %]
25 <span>Koha to MARC mapping</span>
27 [% END #/ WRAPPER breadcrumbs %]
28 [% END #/ WRAPPER sub-header.inc %]
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 <div class="page-section">
45 <table id="kohafields">
54 [% FOREACH loo IN loop %]
56 <td>[% loo.kohafield | html %]</td>
57 <td>[% loo.tagfield | html %]</td>
58 <td>[% loo.tagsubfield | html %]</td>
59 <td>[% loo.liblibrarian | html %]</td>
61 [% IF !loo.readonly %]
62 <a href="#" data-kohafield="[% loo.kohafield | html %]" class="addfld btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
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>
73 </div> <!-- /.page-section -->
74 <input id="remove_field" name="remove_field" type="hidden" value=""/>
75 <input id="add_field" name="add_field" type="hidden" value=""/>
80 </div> <!-- /.col-sm-10.col-sm-push-2 -->
82 <div class="col-sm-2 col-sm-pull-10">
84 [% INCLUDE 'admin-menu.inc' %]
86 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
89 [% MACRO jsinclude BLOCK %]
90 [% INCLUDE 'datatables.inc' %]
91 [% Asset.js("js/admin-menu.js") | $raw %]
93 function AddFld(kohafield) {
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.") );
96 var temp = fieldstr.split(',');
97 if( temp.length == 2 ) {
98 $('#add_field').val( kohafield+','+fieldstr );
99 $('#koha2marc').submit();
101 alert( _("Invalid input. Enter something like: 245,a") );
106 function RemFld(tagfield, subfield ) {
107 if( confirm( _("Mapping will be removed for: %s.").format(tagfield + subfield) + "\n" + _("The change will be applied immediately." ))) {
108 $('#remove_field').val(tagfield+','+subfield);
109 $('#koha2marc').submit();
112 $(document).ready(function() {
113 $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
115 { "targets": [ -1 ], "orderable": false, "searchable": false },
120 $(".addfld").on("click", function(e){
122 const kohafield = $(this).data("kohafield");
126 $(".remfld").on("click", function(e){
128 const tagfield = $(this).data("tagfield");
129 const tagsubfield = $(this).data("tagsubfield");
130 RemFld( tagfield, tagsubfield );
135 [% INCLUDE 'intranet-bottom.inc' %]