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