8af5f2ce91f980e9dde861fe35605589f1c68ea6
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / unimarc_field_210c.tt
1 [% USE raw %]
2 [% PROCESS 'authorities-search-results.inc' %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>UNIMARC field 210c builder</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="cat_unimarc_field_210c" class="cat" style="padding:1em;">
10 <h1>UNIMARC field 210c builder</h1>
11     <h4>Search for authority type: EDITORS</h4>
12         <form name="f" method="post" action="plugin_launcher.pl">
13         <fieldset class="rows">
14             <input type="hidden" name="plugin_name" value="unimarc_field_210c.pl" />
15             <input type="hidden" name="op" value="do_search" />
16             <input type="hidden" name="type" value="intranet" />
17             <input type="hidden" name="nbstatements" value="[% nbstatements | html %]" />
18             <input type="hidden" name="index" value="[% index | html %]" />
19             <input type="hidden" name="authtypecode" value="EDITORS" />
20             <input type="hidden" name="q" value="[% index | html %]" />
21             <input type="hidden" name="marclist" value="all" />
22             <input type="hidden" name="and_or" value="and" />
23             <input type="hidden" name="excluding" value="" />
24                  <ol>
25                     <li>
26                                         <select name="orderby" id="orderby">
27                                 <option value="">None</option>
28                                 <option value="HeadingAsc" selected="selected">Heading A-Z</option>
29                                 <option value="HeadingDsc">Heading Z-A</option>
30                                 </select>
31                                         <select name="operator" id="operator">
32                                     <option value="contains">contains</option>
33                                     <option value="start">starts with</option>
34                                     <option value="is">is exactly</option>
35                                 </select>
36                     <input type="text" id="value" name="value" value="[% resultstring | html %]" />
37                     </li>
38                 </ol>
39                 </fieldset>
40                 <fieldset class="action">
41                 <input type="submit" value="Search" />
42                 </fieldset>
43         </form>
44             [% IF ( total ) %]
45             <h3>Authority search results</h3>
46             <div class="pages">
47                           [% pagination_bar | $raw %]
48                         </div>[% END %]
49             <p>
50                 [% IF ( total ) %]
51                     &nbsp;<strong>Results [% from | html %] to [% to | html %] of [% total | html %]</strong><br /><br />
52                 [% ELSE %]
53                     &nbsp; No results found<br />
54                 [% END %]
55             </p>
56 [% IF ( total ) %]
57         <div id="resultlist">
58             <table>
59                 <tr>
60                     <th>Summary</th>
61                     <th>Heading type</th>
62                     <th>Used</th>
63                     <th>Get it!</th>
64                 </tr>
65                 [% FOREACH resul IN result %]
66                     <tr>
67                         <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td>
68                         <td>[% resul.summary.label | html %]</td>
69                         <td>[% resul.used | html %] times</td>
70                         <td>
71                         [% IF ( resul.to_report ) %]
72                             <button class="choosebt">Choose</button>
73                             <p class="toreport" style="display:none">[% resul.to_report |replace('\n', '\\n') |replace('\r', '\\r') |html %]</p>
74                         [% END %]
75                         </td>
76                     </tr>
77                 [% END %]
78             </table>
79         </div>
80 [% END %]
81
82             [% IF ( total ) %]<div class="pages">
83                           [% pagination_bar | $raw %]
84                         </div>
85             [% END %]
86
87 <!-- Authority details modal -->
88 <div class="modal" id="authorityDetail" tabindex="-1" role="dialog" aria-labelledby="authorityDetailLabel">
89     <div class="modal-dialog" role="document">
90         <div class="modal-content">
91             <div class="modal-header">
92                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
93                 <h4 class="modal-title" id="authorityDetailLabel"></h4>
94             </div>
95             <div class="modal-body">
96                 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" />
97             </div>
98             <div class="modal-footer">
99                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
100             </div>
101         </div>
102     </div>
103 </div>
104
105 [% MACRO jsinclude BLOCK %]
106     <script>
107         $(document).ready(function(){
108             $(".choosebt").on("click",function(){
109                 var toreport = $(this).siblings(".toreport").text();
110                 report(toreport);
111             });
112             $(".authorizedheading a").on("click", function(e){
113                 e.preventDefault();
114                 var authid = $(this).data("authid");
115
116                 $.get("/cgi-bin/koha/authorities/detail.pl", { authid : authid }, function( data ){
117                     var auth_detail = $(data).find("#authoritiestabs");
118                     auth_detail.find("ul").remove();
119                     $("#authorityDetail .modal-title").html(_("Authority") + " " + authid );
120                     $("#authorityDetail .modal-body").html( auth_detail );
121                 });
122
123                 $("#authorityDetail").modal("show");
124             });
125             $("#authorityDetail").on("hidden.bs.modal", function(){
126                 $("#authorityDetail .modal-body, #authorityDetail .modal-title").html("");
127                 $("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>");
128             });
129         });
130         function report(summary){
131             var doc   = opener.document;
132             var field = doc.getElementById('[% index | html %]');
133
134             field.value = summary;
135             self.close();
136         }
137     </script>
138 [% END %]
139
140 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]