Bug 18655: Correct the choose link in unimarc_field_210c value builder
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / unimarc_field_210c.tt
blob0ce0861bad1ec0585ba8aa9e7e100b9e3c1f72cb
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>
9 <body id="cat_unimarc_field_210c" class="cat" style="padding:1em;">
10 <h3>UNIMARC field 210c builder</h3>
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;<b>Results [% from | html %] to [% to | html %] of [% total | html %]</b><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>Used</th>
62                     <th>Get it!</th>
63                 </tr>
64                 [% FOREACH resul IN result %]
65                     <tr>
66                         <td>[% PROCESS authresult summary=resul.summary %]</td>
67                         <td>[% resul.used | html %] times</td>
68                         <td>
69                         [% IF ( resul.to_report ) %]
70                             <button class="choosebt">Choose</button>
71                             <p class="toreport" style="display:none">[% resul.to_report |replace('\n', '\\n') |replace('\r', '\\r') |html %]</p>
72                         [% END %]
73                         </td>
74                     </tr>
75                 [% END %]
76             </table>
77         </div>
78 [% END %]
80             [% IF ( total ) %]<div class="pages">
81                           [% pagination_bar | $raw %]
82                         </div>
83             [% END %]
85 [% MACRO jsinclude BLOCK %]
86     <script type="text/javascript">
87         $(document).ready(function(){
88             $(".choosebt").on("click",function(){
89                 var toreport = $(this).siblings(".toreport").text();
90                 report(toreport);
91             });
92         });
93         function report(summary){
94             var doc   = opener.document;
95             var field = doc.getElementById('[% index | html %]');
97             field.value = summary;
98             self.close();
99         }
100     </script>
101 [% END %]
103 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]