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