Bug 28438: Capitalization: Various corrections
[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 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'authorities-search.inc' %]
18
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
20     <ol>
21         <li>
22             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23         </li>
24         <li>
25             <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a>
26         </li>
27         <li>
28             <a href="#" aria-current="page">
29                 Merging records
30             </a>
31         </li>
32     </ol>
33 </nav>
34
35 <div class="main container-fluid">
36     <div class="row">
37         <div class="col-md-8 col-md-offset-2">
38             <main>
39
40 <h1>Merging records</h1>
41
42 [% IF ( errors ) %]
43
44     [% FOREACH error IN errors %]
45         <div class="dialog alert">
46             [% IF error.code == 'WRONG_COUNT' %]
47                 Number of records provided for merging: [% error.value | html %]. Currently only 2 records can be merged at a time.
48             [% ELSIF error.code == 'DESTRUCTIVE_MERGE' %]
49                 You cannot merge a record with itself. Please select two different authorities.
50             [% ELSIF error.code == 'WRONG_FRAMEWORK' %]
51                 The default framework cannot be used, or the framework does not exist. Please select another framework for merging.
52             [% ELSIF error.code == 'EMPTY_MARC' %]
53                 Sorry, but we did not find any MARC tags in the reference record.
54             [% ELSIF error.code == 'MISSING_RECORD' %]
55                 Sorry, but we did not find a record for number: [% error.value | html %].
56             [% ELSE %]
57                 [% error | html %]
58             [% END %]
59         </div>
60     [% END %]
61
62 [% ELSIF ( result ) %]
63
64     <p>The merging was successful. <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]">View the merged record.</a></p>
65
66 [% ELSIF ( choosereference ) %]
67
68 <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>
69 <form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post">
70     <fieldset class="rows">
71     <legend>Merge reference</legend>
72     <ol>
73     <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>
74     <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>
75
76     [% IF frameworkselect %]
77           <li><label for="frameworkcode">Using framework:</label>
78                       <select name="frameworkcode" id="frameworkcode">
79                                       [% FOREACH frameworkcodeloo IN frameworkselect %]
80                                           [% IF frameworkcodeloo.authtypecode == frameworkcode1 %]
81                                               <option value="[% frameworkcodeloo.authtypecode | html %]" selected="selected">
82                                           [% ELSE %]
83                                               <option value="[% frameworkcodeloo.authtypecode | html %]">
84                                           [% END %]
85                                            [% frameworkcodeloo.authtypetext | html %]
86                                            </option>
87                                       [% END %]
88                       </select></li>
89     [% END %]
90 </ol>
91
92     <input type="hidden" name="authid" value="[% recordid1 | html %]" />
93     <input type="hidden" name="authid" value="[% recordid2 | html %]" />
94     <fieldset class="action"><input type="submit" value="Next" /></fieldset>
95     </fieldset>
96 </form>
97
98 [% ELSE %]
99
100 <form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post" onsubmit="return mergeformsubmit()">
101
102     <div class="row">
103         <div class="col-sm-6">
104 [% PROCESS mergesource sourcerecords=records %]
105 </div>
106         <div class="col-sm-6">
107 [% PROCESS mergetarget %]
108 </div>
109 </div>
110
111 <input type="hidden" name="recordid1" value="[% recordid1 | html %]" />
112 <input type="hidden" name="recordid2" value="[% recordid2 | html %]" />
113 <input type="hidden" name="mergereference" value="[% mergereference | html %]" />
114 <input type="hidden" name="frameworkcode" value="[% framework | html %]" />
115
116 <fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset>
117 </form>
118
119 [% END %]
120
121         </main>
122     </div> <!-- /.col-md-8 col-md-offset-2 -->
123 </div> <!-- /.row -->
124
125 [% MACRO jsinclude BLOCK %]
126     [% INCLUDE 'authorities_js.inc' %]
127     [% Asset.js("js/merge-record.js") | $raw %]
128     <script>
129
130         // When submiting the form
131         function mergeformsubmit() {
132             $('#tabs').remove();
133         }
134
135     $(document).ready(function(){
136         // Getting marc structure via ajax
137         tagslib = [];
138         $.getJSON("/cgi-bin/koha/authorities/merge_ajax.pl", {frameworkcode : "[% framework | html %]" }, function(json) {
139             tagslib = json;
140             rebuild_target($("#tabs"), $("#resultul"));
141         });
142
143         $('.preview-merge-reference').click(function (ev) {
144             ev.preventDefault();
145             newin=window.open($(this).attr('href'),'merge_reference', 'width=1000,height=600,toolbar=false,scrollbars=yes');
146         });
147
148         // Creating tabs
149         $("#tabs").tabs();
150     });
151
152
153     function changeFramework(fw) {
154         $("#Frameworks").val(fw);
155     }
156
157     </script>
158 [% END %]
159
160 [% INCLUDE 'intranet-bottom.inc' %]