Bug 20741: Update two-column templates with Bootstrap grid: Administration part 5
[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 [% Asset.css("css/datatables.css") | $raw %]
8 </head>
9
10 <body id="admin_koha2marclinks" class="admin">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'prefs-admin-search.inc' %]
13
14 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/koha2marclinks.pl">Koha to MARC Mapping</a></div>
15
16 <div class="main container-fluid">
17     <div class="row">
18         <div class="col-sm-10 col-sm-push-2">
19             <main>
20
21 <h1>Koha to MARC mapping</h1>
22 <br/>
23 <form action="/cgi-bin/koha/admin/koha2marclinks.pl" method="post" id="koha2marc">
24
25 [% IF error_add %]
26     <div class="dialog alert">Failed to add mapping for [% error_info | html %]</div>
27 [% END %]
28
29 <table id="kohafields">
30 <thead><tr>
31     <th>Koha field</th>
32     <th>Tag</th>
33     <th>Subfield</th>
34     <th>Lib</th>
35     <th>&nbsp;</th>
36 </tr></thead>
37 <tbody>
38 [% FOREACH loo IN loop %]
39 <tr>
40     <td>[% loo.kohafield | html %]</td>
41     <td>[% loo.tagfield | html %]</td>
42     <td>[% loo.tagsubfield | html %]</td>
43     <td>[% loo.liblibrarian | html %]</td>
44     <td class="actions">
45         [% IF !loo.readonly %]
46             <a onclick="AddFld('[% loo.kohafield | html %]');" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</a>
47             [% 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 %]
48         [% END %]
49     </td>
50     </td>
51 </tr>
52 [% END %]
53 </tbody>
54 </table>
55
56 <input id="remove_field" name="remove_field" type="hidden" value=""/>
57 <input id="add_field" name="add_field" type="hidden" value=""/>
58
59 </form>
60
61             </main>
62         </div> <!-- /.col-sm-10.col-sm-push-2 -->
63
64         <div class="col-sm-2 col-sm-pull-10">
65             <aside>
66                 [% INCLUDE 'admin-menu.inc' %]
67             </aside>
68         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
69      </div> <!-- /.row -->
70
71 [% MACRO jsinclude BLOCK %]
72     [% INCLUDE 'datatables.inc' %]
73     [% Asset.js("js/admin-menu.js") | $raw %]
74     <script>
75         function AddFld(kohafield) {
76             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.") );
77             var temp = fieldstr.split(',');
78             if( temp.length == 2 ) {
79                 $('#add_field').val( kohafield+','+fieldstr );
80                 $('#koha2marc').submit();
81             } else {
82                 alert( _("Invalid input. Enter something like: 245,a") );
83             }
84         }
85
86         function RemFld(tagfield, subfield ) {
87             if( confirm( _("Mapping will be removed for: %s.").format(tagfield + subfield) + "\n" + _("The change will be applied immediately." ))) {
88                 $('#remove_field').val(tagfield+','+subfield);
89                 $('#koha2marc').submit();
90             }
91         }
92         $(document).ready(function() {
93             $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
94                 "aoColumnDefs": [
95                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
96                 ],
97                 "paging":   false
98             } ));
99
100          });
101     </script>
102 [% END %]
103 [% INCLUDE 'intranet-bottom.inc' %]