Bug 30952: Staff interface redesign (header)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / koha2marclinks.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha to MARC mapping &rsaquo; Administration &rsaquo; Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="admin_koha2marclinks" class="admin">
10 [% WRAPPER 'header.inc' %]
11     [% INCLUDE 'prefs-admin-search.inc' %]
12 [% END %]
13
14 [% WRAPPER 'sub-header.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16     <ol>
17         <li>
18             <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
19         </li>
20         <li>
21             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22         </li>
23         <li>
24             <a href="#" aria-current="page">Koha to MARC mapping</a>
25         </li>
26     </ol>
27 </nav>
28 [% END %]
29
30 <div class="main container-fluid">
31     <div class="row">
32         <div class="col-sm-10 col-sm-push-2">
33             <main>
34
35 <h1>Koha to MARC mapping</h1>
36 <br/>
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">
39
40 [% IF error_add %]
41     <div class="dialog alert">Failed to add mapping for [% error_info | html %]</div>
42 [% END %]
43
44 <table id="kohafields">
45 <thead><tr>
46     <th>Koha field</th>
47     <th>Tag</th>
48     <th>Subfield</th>
49     <th>Lib</th>
50     <th>&nbsp;</th>
51 </tr></thead>
52 <tbody>
53 [% FOREACH loo IN loop %]
54 <tr>
55     <td>[% loo.kohafield | html %]</td>
56     <td>[% loo.tagfield | html %]</td>
57     <td>[% loo.tagsubfield | html %]</td>
58     <td>[% loo.liblibrarian | html %]</td>
59     <td class="actions">
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 %]
63         [% END %]
64     </td>
65     </td>
66 </tr>
67 [% END %]
68 </tbody>
69 </table>
70
71 <input id="remove_field" name="remove_field" type="hidden" value=""/>
72 <input id="add_field" name="add_field" type="hidden" value=""/>
73
74 </form>
75
76             </main>
77         </div> <!-- /.col-sm-10.col-sm-push-2 -->
78
79         <div class="col-sm-2 col-sm-pull-10">
80             <aside>
81                 [% INCLUDE 'admin-menu.inc' %]
82             </aside>
83         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
84      </div> <!-- /.row -->
85
86 [% MACRO jsinclude BLOCK %]
87     [% INCLUDE 'datatables.inc' %]
88     [% Asset.js("js/admin-menu.js") | $raw %]
89     <script>
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();
96             } else {
97                 alert( _("Invalid input. Enter something like: 245,a") );
98             }
99         }
100
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();
105             }
106         }
107         $(document).ready(function() {
108             $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
109                 "aoColumnDefs": [
110                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
111                 ],
112                 "paging":   false
113             } ));
114
115          });
116     </script>
117 [% END %]
118 [% INCLUDE 'intranet-bottom.inc' %]