Bug 14045: DB Changes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / merge.tt
1 [% PROCESS 'merge-record.inc' %]
2
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Cataloging &rsaquo; Merging records</title>
5 [% INCLUDE 'greybox.inc' %]
6 [% INCLUDE 'doc-head-close.inc' %]
7 <script type="text/javascript" src="[% themelang %]/js/merge-record.js"></script>
8 [% INCLUDE 'merge-record-strings.inc' %]
9 <style type="text/css">
10 div.record ul, div.record li { float:none; display:block; }
11 div#result { margin-top: 1em; }
12 /* We use this style "against" the li ui-tabs-nav style automatically applied */
13 </style>
14 <script type="text/javascript">
15 //<![CDATA[
16
17     // When submiting the form
18     function mergeformsubmit() {
19             $("ul#ulrecord1").remove();
20             $("ul#ulrecord2").remove();
21 }
22
23 $(document).ready(function(){
24     // Getting marc structure via ajax
25     tagslib = [];
26     $.getJSON("/cgi-bin/koha/cataloguing/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) {
27         tagslib = json;
28
29     //Set focus to cataloging search
30     $("input[name=q]:eq(0)").focus();
31     });
32
33     // Creating tabs
34     $("#tabs").tabs();
35 });
36
37
38 function changeFramework(fw) {
39     $("#Frameworks").val(fw);
40 }
41
42 //]]>
43 </script>
44 </head>
45 <body id="cat_merge" class="cat">
46 [% INCLUDE 'header.inc' %]
47 [% INCLUDE 'cataloging-search.inc' %]
48 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>  &rsaquo; Merging records</div>
49
50 <div id="doc" class="yui-t7">
51
52 <div id="bd">
53         <div id="yui-main">
54
55
56 <h1>Merging records</h1>
57 [% IF ( result ) %]
58     [% IF ( errors ) %]
59
60         [% FOREACH error IN errors %]
61             <div class="dialog alert">
62
63                 [% IF error.code == 'CANNOT_MOVE' %]
64                     The following items could not be moved from the old record to the new one: [% error.value %]
65                 [% ELSE %]
66                     [% error %]
67                 [% END %]
68
69             <br />Therefore, the record to be merged has not been deleted.</div>
70         [% END %]
71
72     [% ELSE %]
73         <script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
74         <p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
75     [% END %]
76
77 [% ELSE %]
78
79 [% IF ( choosereference ) %]
80 <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>
81 <form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post">
82     <fieldset class="rows">
83         <legend>Merge reference</legend>
84         <ol>
85         <li class="radio"><input type="radio" value="[% biblio1 %]" 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/catalogue/showmarc.pl?id=[% biblio1 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio1 %]</a>)</label></li>
86         <li class="radio"><input type="radio" value="[% biblio2 %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 %]')" /><label for="mergereference2">[% title2 %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2.subfield %][% END %] (<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio2 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio2 %]</a>)</label></li>
87
88     [% IF frameworkselect %]
89           <li><label for="frameworkcode">Using framework:</label>
90                       <select name="frameworkcode" id="frameworkcode">
91                                       <option value="Default">Default</option>
92                                       [% FOREACH frameworkcodeloo IN frameworkselect %]
93                                           [% IF ( frameworkcodeloo.selected ) %]
94                                               <option value="[% frameworkcodeloo.value %]" selected="selected">
95                                           [% ELSE %]
96                                               <option value="[% frameworkcodeloo.value %]">
97                                           [% END %]
98                                            [% frameworkcodeloo.frameworktext %]
99                                            </option>
100                                       [% END %]
101                       </select></li>
102     [% END %]
103 </ol>
104
105         <input type="hidden" name="biblionumber" value="[% biblio1 %]" />
106         <input type="hidden" name="biblionumber" value="[% biblio2 %]" />
107         <fieldset class="action"><input type="submit" value="Next" /></fieldset>
108     </fieldset>
109 </form>
110 [% ELSE %]
111 [% IF ( errors ) %]
112     <div class="dialog alert">
113         [% FOREACH error IN errors %]
114             <p>
115                 [% IF error.code == 'WRONG_COUNT' %]
116                     Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time.
117                 [% ELSE %]
118                     [% error %]
119                 [% END %]
120
121             </p>
122         [% END %]
123     </div>
124 [% ELSE %]
125 <form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
126
127 <div class="yui-g">
128 <div class="yui-u first">
129 [% PROCESS mergesource recordid1=biblio1 recordid2=biblio2 %]
130 </div>
131 <div class="yui-u">
132 [% PROCESS mergetarget %]
133 </div> <!-- .yui-u -->
134
135 <input type="hidden" name="biblio1" value="[% biblio1 %]" />
136 <input type="hidden" name="biblio2" value="[% biblio2 %]" />
137 <input type="hidden" name="mergereference" value="[% mergereference %]" />
138 <input type="hidden" name="frameworkcode" value="[% framework %]" />
139
140 <fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset>
141 </div>
142 </form>
143 [% END %]
144 [% END %]
145 [% END %]
146
147 </div>
148 </div>
149 </div>
150
151 [% INCLUDE 'intranet-bottom.inc' %]