Bug 33130: Use template wrapper for breadcrumbs: Authorities
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / merge.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% PROCESS 'merge-record.inc' %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Merging records &rsaquo; Cataloging &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style>
9 div.record ul, div.record li { float:none; display:block; }
10 div#result { margin-top: 1em; }
11 /* We use this style "against" the li ui-tabs-nav style automatically applied */
12 </style>
13 </head>
14
15 <body id="auth_merge" class="cat">
16 [% WRAPPER 'header.inc' %]
17     [% INCLUDE 'authorities-search.inc' %]
18 [% END %]
19
20 [% WRAPPER 'sub-header.inc' %]
21     [% WRAPPER breadcrumbs %]
22         [% WRAPPER breadcrumb_item %]
23             <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
24         [% END %]
25         [% WRAPPER breadcrumb_item bc_active= 1 %]
26             <span>Merging records</span>
27         [% END %]
28     [% END #/ WRAPPER breadcrumbs %]
29 [% END #/ WRAPPER sub-header.inc %]
30
31 <div class="main container-fluid">
32     <div class="row">
33         <div class="col-md-8 col-md-offset-2">
34             <main>
35
36 <h1>Merging records</h1>
37
38 [% IF ( errors ) %]
39
40     [% FOREACH error IN errors %]
41         <div class="dialog alert">
42             [% IF error.code == 'WRONG_COUNT' %]
43                 <span>Number of records provided for merging: [% error.value | html %]. Currently only 2 records can be merged at a time.</span>
44             [% ELSIF error.code == 'DESTRUCTIVE_MERGE' %]
45                 <span>You cannot merge a record with itself. Please select two different authorities.</span>
46             [% ELSIF error.code == 'WRONG_FRAMEWORK' %]
47                 <span>The default framework cannot be used, or the framework does not exist. Please select another framework for merging.</span>
48             [% ELSIF error.code == 'EMPTY_MARC' %]
49                 <span>Sorry, but we did not find any MARC tags in the reference record.</span>
50             [% ELSIF error.code == 'MISSING_RECORD' %]
51                 <span>Sorry, but we did not find a record for number: [% error.value | html %].</span>
52             [% ELSE %]
53                 [% error | html %]
54             [% END %]
55         </div>
56     [% END %]
57
58 [% ELSIF ( result ) %]
59
60     <p>The merging was successful. <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]">View the merged record.</a></p>
61
62 [% ELSIF ( choosereference ) %]
63
64 <p>Please choose which record will be the reference for the merge. The record chosen as reference will be kept, and the other will be deleted.</p>
65 <form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post">
66     <fieldset class="rows">
67     <legend>Merge reference</legend>
68     <ol>
69     <li class="radio"><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 | html %]')" /><label for="mergereference1">[% title1 | html %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid1 | html %][% IF frameworklabel1 %] &mdash; [% frameworklabel1 | html %][% END %]</a>)</label></li>
70     <li class="radio"><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 | html %]')" /><label for="mergereference2">[% title2 | html %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2 | html %][% END %] (<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 | uri %]" title="MARC" class="preview-merge-reference" target="_blank">[% recordid2 | html %][% IF frameworklabel2 %] &mdash; [% frameworklabel2 | html %][% END %]</a>)</label></li>
71
72     [% IF frameworkselect %]
73           <li><label for="frameworkcode">Using framework:</label>
74                       <select name="frameworkcode" id="frameworkcode">
75                                       [% FOREACH frameworkcodeloo IN frameworkselect %]
76                                           [% IF frameworkcodeloo.authtypecode == frameworkcode1 %]
77                                               <option value="[% frameworkcodeloo.authtypecode | html %]" selected="selected">
78                                           [% ELSE %]
79                                               <option value="[% frameworkcodeloo.authtypecode | html %]">
80                                           [% END %]
81                                            [% frameworkcodeloo.authtypetext | html %]
82                                            </option>
83                                       [% END %]
84                       </select></li>
85     [% END %]
86 </ol>
87
88     <input type="hidden" name="authid" value="[% recordid1 | html %]" />
89     <input type="hidden" name="authid" value="[% recordid2 | html %]" />
90     </fieldset>
91     <fieldset class="action">
92         <input type="submit" class="btn btn-primary" value="Next" />
93     </fieldset>
94 </form>
95
96 [% ELSE %]
97
98 <form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post" onsubmit="return mergeformsubmit()">
99
100     <div class="row">
101         <div class="col-sm-6">
102 [% PROCESS mergesource sourcerecords=records %]
103 </div>
104         <div class="col-sm-6">
105 [% PROCESS mergetarget %]
106 </div>
107 </div>
108
109 <input type="hidden" name="recordid1" value="[% recordid1 | html %]" />
110 <input type="hidden" name="recordid2" value="[% recordid2 | html %]" />
111 <input type="hidden" name="mergereference" value="[% mergereference | html %]" />
112 <input type="hidden" name="frameworkcode" value="[% framework | html %]" />
113
114 <fieldset class="action"><input type="submit" name="merge" class="btn btn-primary" value="Merge" /></fieldset>
115 </form>
116
117 [% END %]
118
119         </main>
120     </div> <!-- /.col-md-8 col-md-offset-2 -->
121 </div> <!-- /.row -->
122
123 [% MACRO jsinclude BLOCK %]
124     [% INCLUDE 'authorities_js.inc' %]
125     [% Asset.js("js/merge-record.js") | $raw %]
126     <script>
127
128         // When submiting the form
129         function mergeformsubmit() {
130             $('#tabs').remove();
131         }
132
133     $(document).ready(function(){
134         // Getting marc structure via ajax
135         tagslib = [];
136         $.getJSON("/cgi-bin/koha/authorities/merge_ajax.pl", {frameworkcode : "[% framework | html %]" }, function(json) {
137             tagslib = json;
138             rebuild_target($("#tabs"), $("#resultul"));
139         });
140
141         $('.preview-merge-reference').click(function (ev) {
142             ev.preventDefault();
143             newin=window.open($(this).attr('href'),'merge_reference', 'width=1000,height=600,toolbar=false,scrollbars=yes');
144         });
145         if( $("#tabs .tab-pane.active").length < 1 ){
146             $("#tabs a:first").tab("show");
147         }
148     });
149
150
151     function changeFramework(fw) {
152         $("#Frameworks").val(fw);
153     }
154
155     </script>
156 [% END %]
157
158 [% INCLUDE 'intranet-bottom.inc' %]