Bug 22015: Move DataTables CSS to global include
[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 <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>
14
15 <div class="main container-fluid">
16     <div class="row">
17         <div class="col-sm-10 col-sm-push-2">
18             <main>
19
20 <h1>Koha to MARC mapping</h1>
21 <br/>
22 <form action="/cgi-bin/koha/admin/koha2marclinks.pl" method="post" id="koha2marc">
23
24 [% IF error_add %]
25     <div class="dialog alert">Failed to add mapping for [% error_info | html %]</div>
26 [% END %]
27
28 <table id="kohafields">
29 <thead><tr>
30     <th>Koha field</th>
31     <th>Tag</th>
32     <th>Subfield</th>
33     <th>Lib</th>
34     <th>&nbsp;</th>
35 </tr></thead>
36 <tbody>
37 [% FOREACH loo IN loop %]
38 <tr>
39     <td>[% loo.kohafield | html %]</td>
40     <td>[% loo.tagfield | html %]</td>
41     <td>[% loo.tagsubfield | html %]</td>
42     <td>[% loo.liblibrarian | html %]</td>
43     <td class="actions">
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 %]
47         [% END %]
48     </td>
49     </td>
50 </tr>
51 [% END %]
52 </tbody>
53 </table>
54
55 <input id="remove_field" name="remove_field" type="hidden" value=""/>
56 <input id="add_field" name="add_field" type="hidden" value=""/>
57
58 </form>
59
60             </main>
61         </div> <!-- /.col-sm-10.col-sm-push-2 -->
62
63         <div class="col-sm-2 col-sm-pull-10">
64             <aside>
65                 [% INCLUDE 'admin-menu.inc' %]
66             </aside>
67         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
68      </div> <!-- /.row -->
69
70 [% MACRO jsinclude BLOCK %]
71     [% INCLUDE 'datatables.inc' %]
72     [% Asset.js("js/admin-menu.js") | $raw %]
73     <script>
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();
80             } else {
81                 alert( _("Invalid input. Enter something like: 245,a") );
82             }
83         }
84
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();
89             }
90         }
91         $(document).ready(function() {
92             $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, {
93                 "aoColumnDefs": [
94                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
95                 ],
96                 "paging":   false
97             } ));
98
99          });
100     </script>
101 [% END %]
102 [% INCLUDE 'intranet-bottom.inc' %]