Bug 12071: improve generation of Z39.50 search links
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / addbooks.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Cataloging</title>
3 [% INCLUDE 'greybox.inc' %]
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript">
6     //<![CDATA[
7
8      $(document).ready(function() {
9         $("#z3950search").click(function(){
10             PopupZ3950("");
11             return false;
12         });
13
14         $(".z3950searchFw").click(function(){
15             PopupZ3950($(this).prop('id'));
16             return false;
17         });
18      });
19
20     /* this function open a popup to search on z3950 server.  */
21     function PopupZ3950(fw) {
22         var strQuery = GetZ3950Terms(fw);
23         if(strQuery){
24             window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=760,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
25         }
26     }
27     /* provide Z3950 search points */
28     function GetZ3950Terms(fw){
29         var strQuery="&frameworkcode=" + fw;
30         [% FOREACH z3950_search_param IN z3950_search_params %]
31             strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.encvalue |uri %]";
32         [% END %]
33         return strQuery;
34     }
35     //]]>
36 </script>
37 </head>
38 <body id="cat_addbooks" class="cat">
39 [% INCLUDE 'header.inc' %]
40 [% INCLUDE 'cataloging-search.inc' %]
41
42 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Cataloging</div>
43
44 <div id="doc" class="yui-t7">
45
46    <div id="bd">
47         <div id="yui-main">
48
49 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
50   <div id="toolbar" class="btn-toolbar">
51         <div class="btn-group">
52             <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-plus"></i> New record <span class="caret"></span></button>
53             <ul class="dropdown-menu">
54                 <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
55                 [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
56                 <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</a></li>
57                 [% END %]
58             </ul>
59         </div>
60         <div class="btn-group">
61             <button class="btn btn-small" id="z3950search"><i class="icon-search"></i> New from Z39.50</button>
62             <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">
63                 <span class="caret"></span>
64             </button>
65             <ul class="dropdown-menu">
66                 <li id="" class="z3950searchFw"><a href="#">Default framework</a></li>
67                 [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
68                 <li id="[% frameworkcodeloo.value %]" class="z3950searchFw"><a href="#">[% frameworkcodeloo.frameworktext %]</a></li>
69                 [% END %]
70             </ul>
71         </div>
72   </div>
73 [% END %]
74
75         [% IF ( noitemsfound ) %]
76                 No results found
77         [% END %]
78
79 <!-- display the search results -->
80
81 [% IF ( total ) %]
82 [% total %] result(s) found in catalog,
83 <a href="#searchresult-breeding">[% breeding_count %] result(s) found in reservoir</a>
84 <div class="pages">[% pagination_bar %]</div>
85 <div class="searchresults">
86     <table>
87         <tr>
88             <th>Title</th>
89             <th>Location</th>
90             <th>Preview</th>
91             [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<th>&nbsp;</th>[% ELSE %][% END %]
92             [% IF ( CAN_user_editcatalogue_edit_items ) %]<th>&nbsp;</th>[% END %]
93         </tr>
94     [% FOREACH resultsloo IN resultsloop %]
95         [% IF ( loop.even ) %]
96             <tr class="highlight">
97         [% ELSE %]
98             <tr>
99         [% END %]
100             <td>
101                 <p>
102                     <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% resultsloo.biblionumber %]">[% resultsloo.title |html %]</a>
103                 [% FOREACH subtitl IN resultsloo.subtitle %][% subtitl.subfield %][% END %]</p>
104                 [% IF ( resultsloo.summary ) %]
105                     <p>[% resultsloo.summary %]</p>
106                 [% ELSE %]
107                     <p>
108                         [% IF ( resultsloo.author ) %]
109                             [% resultsloo.author %]
110                         [% ELSE %]
111                             &nbsp;
112                         [% END %]
113                         [% IF ( resultsloo.isbn ) %] - [% resultsloo.isbn %] [% END %]
114                         [% IF ( resultsloo.publicationyear ) %] - [% resultsloo.publicationyear %][% END %]
115                         [% IF ( resultsloo.publishercode ) %]- [% resultsloo.publishercode %][% END %]
116                         [% IF ( resultsloo.copyrightdate ) %] - [% resultsloo.copyrightdate %][% END %]
117                         [% IF ( resultsloo.edition ) %]Edition: [% resultsloo.edition %][% END %]
118                         [% IF ( resultsloo.place ) %] ; [% resultsloo.place %][% END %]
119                         [% IF ( resultsloo.pages ) %] - [% resultsloo.pages %][% END %]
120                         [% IF ( resultsloo.size ) %] ; [% resultsloo.size %][% END %]
121                         [% IF ( resultsloo.timestamp ) %] <i>(modified on [% resultsloo.timestamp %])</i>[% END %]
122                     </p>
123                 [% END %]
124                 </td>
125                 <td>
126                     [% IF ( resultsloo.available_items_loop ) %]
127                         <span class="available">
128                         [% FOREACH items_loo IN resultsloo.available_items_loop %]
129                             [% items_loo.count %] [% items_loo.branchname %]
130                             <i>
131                         [% IF ( items_loo.location ) %][% items_loo.location %][% END %]
132                         [% IF ( items_loo.itemcallnumber ) %][% items_loo.itemcallnumber %][% END %]
133                             [% IF ( items_loo.classification ) %]
134                             <a href="/cgi-bin/koha/catalogue/search.pl?q=callnum:[% items_loo.classification |url %]">
135                                 [% items_loo.classification %]
136                             </a>
137                         [% END %]
138                         </i>
139                             <br />
140                         [% END %]
141                         </span>
142                     [% END %]
143                     <span class="unavailable">
144                         [% IF ( resultsloo.onloancount ) %] Checked out ([% resultsloo.onloancount %]),<br /> [% END %]
145                         [% IF ( resultsloo.withdrawncount ) %] Withdrawn ([% resultsloo.withdrawncount %]),<br /> [% END %]
146                         [% IF ( resultsloo.itemlostcount ) %] Lost ([% resultsloo.itemlostcount %])<br />[% END %]
147                         [% IF ( resultsloo.orderedcount ) %] On order ([% resultsloo.orderedcount %])[% END %]
148                     </span>
149                 </td>
150                                 <td> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% resultsloo.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% resultsloo.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a>
151                 </td>
152                 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% resultsloo.biblionumber %]">Edit biblio</a></td>[% END %]
153                 [% IF ( CAN_user_editcatalogue_edit_items ) %]<td><a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% resultsloo.biblionumber %]">Add/Edit items</a></td>[% END %]
154             </tr>
155     [% END %]
156     </table>
157 </div>
158 [% ELSE %]
159     [% IF ( query ) %]
160         [% IF ( error ) %]<div class="dialog alert">[% END %]<b>No results found</b>
161         [% IF ( error ) %]
162             Error: <span class="error">[% error %]</span></div>
163         [% END %]
164     [% END %]
165 [% END %]
166
167 [% IF ( query ) %]
168 <div id="searchresult-breeding">
169     <h3>Biblios in reservoir</h3>
170     [% IF ( breeding_loop ) %]
171         <table>
172             <tr>
173                 <th>Title</th>
174                 <th>ISBN</th>
175                 <th>Date</th>
176                 <th>Edition</th>
177                 <th>Coming from</th>
178                 <th>Preview</th>
179                 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<th>&nbsp;</th>[% END %]
180             </tr>
181             [% FOREACH breeding_loo IN breeding_loop %]
182             [% IF ( loop.odd ) %]
183                <tr>
184             [% ELSE %]
185                <tr class="highlight">
186             [% END %]
187                 <td>[% breeding_loo.title |html %]
188                 [% breeding_loo.author %]</td>
189                 <td>[% breeding_loo.isbn %]</td>
190                 <td>[% breeding_loo.copyrightdate %]</td>
191                 <td>[% breeding_loo.edition %]</td>
192                 <td>[% breeding_loo.file %]</td>
193                 <td> <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.id %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.id %]" title="MARC" rel="gb_page_center[600,500]">Card</a>
194                                 </td>
195                 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<td>
196                     <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id %]">Add biblio</a>
197                 </td>[% END %]
198             </tr>
199             [% END %]
200         </table>
201     [% ELSE %]
202     <p>None</p>
203     [% END %]
204 </div>
205 [% END %]
206 </div>
207 </div>
208 [% INCLUDE 'intranet-bottom.inc' %]