Bug 26145: Hide 'Upload image' if no CoverImage pref is set
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / marc21_linking_section.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Cataloguing &rsaquo; plugin for links</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% IF ( fillinput ) %]
6     </head>
7
8 <body id="cat_marc21_linking_section" class="cat" style="padding:1em;">
9 <h3>MARC21 Plugin to build links between records</h3>
10 [% ELSE %]
11     </head>
12
13 <body id="cat_marc21_linking_section" class="cat" style="padding:1em;">
14 <h3>Plugin to build links between records</h3>
15     [% IF ( Search ) %]
16             <div id="MARC21_Linking_section_search">
17                <h2>Search for</h2>
18             <form name="f" method="post" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl">
19
20                      <p>
21                             <input type="hidden" name="plugin_name" value="marc21_linking_section.pl" />
22                            <input type="hidden" name="index" value="[% index | html %]" />
23                                <input type="hidden" name="result" value="marc12 field 7 [% index | html %]" />
24                                <input type="hidden" name="op" value="do_search" />
25                             <label class="label100" for="searchbox">Any word</label>
26                                <input type="text" name="search" id="searchbox" size="35" /><br />
27                              <label for="itypeloop">Item type</label>
28                                <select name="itype" id="itypeloop">
29                            <option value="" selected="selected">All Item Types</option>
30                                [% FOREACH itypeloo IN itypeloop %]
31                              <option value="[% itypeloo.itemtype | html %]">[% itypeloo.description | html %]</option>
32                               [% END %]
33                               </select>
34                       </p>
35                    <p>
36                             <input type="submit" value="Start search" />
37                    </p>
38
39             </form>
40         </div>
41
42        [% ELSE %]
43
44
45            <h2>Search results</h2>
46                 <div id="MARC21_Linking_section__resultnumber">
47                         <p>[% IF ( displayprev ) %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | html %]&amp;startfrom=[% startfromprev | html %]&amp;search=[% search | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;type=intranet&amp;op=do_search">&lt;&lt; Previous</a>[% END %]
48                               [% FOREACH number IN numbers %]
49                                 [% IF ( number.highlight ) %] <span class="highlight">[% number.number | html %]</span>
50                                 [% ELSE %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | html %]&amp;startfrom=[% number.startfrom | html %]&amp;search=[% number.search |url %]&amp;resultsperpage=[% number.resultsperpage | html %]&amp;type=intranet&amp;op=do_search">[% number.number | html %]</a>
51                                 [% END %]
52                                 [% END %]
53                                 [% IF ( displaynext ) %]
54                                   <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | html %]&amp;startfrom=[% startfromnext | html %]&amp;search=[% search | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;type=intranet&amp;op=do_search">Next&gt;&gt;</a>
55                                 [% END %]</p>
56                   <p class="resultcount">
57                           [% IF ( total ) %]Results [% from | html %] to [% to | html %] of [% total | html %]
58                           [% ELSE %]No results found
59                           [% END %]</p></div>
60             <div id="resultlist">
61                   <table>
62                                 <tr>
63                                    <th>Concise description</th>
64                                    <th>&nbsp;</th>
65                                 </tr>
66                           [% FOREACH resul IN result %]
67                           [% IF ( resul.title ) %]
68                                <tr>
69                                     [% IF ( resul.even ) %]<td class="hilighted">
70                                     [% ELSE %]<td>[% END %]
71                                                             [% IF ( resul.MARC_ON ) %]
72                                                                     <a class="transparent resultlist" href="/cgi-bin/koha/MARCdetail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title | html %]</a>
73                                                             [% ELSE %]
74                                                                     <a class="transparent resultlist" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title | html %]</a>
75                                                             [% END %]
76                                                     <p>[% resul.author | html %]
77                                                     [% IF ( resul.publishercode ) %]- [% resul.publishercode | html %][% END %]
78                                                     [% IF ( resul.place ) %] ; [% resul.place | html %][% END %]
79                                                     [% IF ( resul.pages ) %] - [% resul.pages | html %][% END %]
80                                                     [% IF ( resul.notes ) %] : [% resul.notes | html %][% END %]
81                                                     [% IF ( resul.size ) %] ; [% resul.size | html %][% END %]
82                                             </p>
83                                   </td>
84
85                                  <td>
86                       [% IF ( resul.biblionumber ) %]
87                                              <a href="javascript:jumpfull('/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | uri %]&amp;biblionumber=[% resul.biblionumber | uri %]&amp;type=intranet&amp;op=fillinput')">Choose</a>
88                       [% ELSE %]
89                                              <a href="javascript:jumpfull('/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | uri %]&amp;type=intranet&amp;op=fillinput')">Clear field</a>
90                       [% END %]
91                                    </td>
92                           </tr>
93                           [% END %]
94                               [% END %]
95                       </table>
96                </div>
97          <div id="resultnumber">
98                         <p>
99                             [% IF ( displayprev ) %]
100                                <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;amp;index=[% index | html %]&amp;amp;startfrom=[% startfromprev | html %]&amp;amp;search=[% search |url %]&amp;amp;resultsperpage=[% resultsperpage | html %]&amp;amp;type=intranet&amp;amp;op=do_search">
101                                      &lt;&lt; Previous
102                               </a>
103                            [% END %]
104
105                              [% FOREACH number IN numbers %]
106                                         [% IF ( number.highlight ) %]
107                                           <span class="highlight">
108                                                        [% number.number | html %]
109                                             </span>
110                                         [% ELSE %]
111                                              <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | html %]&amp;startfrom=[% number.startfrom | html %]&amp;search=[% number.search | html %]&amp;resultsperpage=[% number.resultsperpage | html %]&amp;type=intranet&amp;op=do_search">
112                                                  [% number.number | html %]
113                                             </a>
114                                    [% END %]
115                               [% END %]
116
117                              [% IF ( displaynext ) %]
118                                <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index | html %]&amp;startfrom=[% startfromnext | html %]&amp;search=[% search | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;type=intranet&amp;op=do_search">
119                                   Next&gt;&gt;
120                            </a>
121                            [% END %]
122                       </p>
123            </div>
124     [% END %]
125
126 [% END %]
127
128 [% MACRO jsinclude BLOCK %]
129     [% IF ( fillinput ) %]
130         <script type="text/javascript">
131             function go() {
132
133                 var index_start = "[% index | html %]";
134                 var whichfield;
135                 try {
136                     whichfield = opener.opener.document.getElementById(index_start);
137                 } catch (e) {
138                     return;
139                 }
140
141                 // browse all its subfields
142
143                 var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input');
144
145                 var re = /^tag_\d*_code_/;
146                 for (var i = 0, len = subfields.length; i < len; i++) {
147                     if (subfields[i].hasAttribute('name') == 0) { continue; }  // div elements specific to Select2
148                     if (subfields[i].getAttribute('name').match(re)) { // it s a subfield
149                         var code = subfields[i];
150                         var subfield = subfields[i + 1];
151
152                         if (code.value == '9') {
153                             subfield.value = "[% subfield_value_9 | html %]";
154                         }
155                         if (code.value == '0') {
156                             subfield.value = "[% subfield_value_0 | html %]";
157                         }
158                         if (code.value == 'a') {
159                             subfield.value = "[% subfield_value_a | html %]";
160                         }
161                         if (code.value == 'c') {
162                             subfield.value = "[% subfield_value_c | html %]";
163                         }
164                         if (code.value == 'd') {
165                             subfield.value = "[% subfield_value_d | html %]";
166                         }
167                         if (code.value == 'e') {
168                             subfield.value = "[% subfield_value_e | html %]";
169                         }
170                         if (code.value == 'h') {
171                             subfield.value = "[% subfield_value_h | html %]";
172                         }
173                         if (code.value == 'i') {
174                             subfield.value = "[% subfield_value_i | html %]";
175                         }
176                         if (code.value == 'p') {
177                             subfield.value = "[% subfield_value_p | html %]";
178                         }
179                         if (code.value == 't') {
180                             subfield.value = "[% subfield_value_t | html %]";
181                         }
182                         if (code.value == 'u') {
183                             subfield.value = "[% subfield_value_u | html %]";
184                         }
185                         if (code.value == 'v') {
186                             subfield.value = "[% subfield_value_v | html %]";
187                         }
188                         if (code.value == 'w') {
189                             subfield.value = "[% subfield_value_w | html %]";
190                         }
191                         if (code.value == 'x') {
192                             subfield.value = "[% subfield_value_x | html %]";
193                         }
194                         if (code.value == 'y') {
195                             subfield.value = "[% subfield_value_y | html %]";
196                         }
197                         if (code.value == 'z') {
198                             subfield.value = "[% subfield_value_z | html %]";
199                         }
200                     }
201                 }
202                 return false;
203             }
204
205             window.onload = go();
206             opener.close();
207             window.close();
208         </script>
209     [% ELSE %]
210         <script type="text/javascript">
211             function report(value2report) {
212                 if (document.f_pop.result.value.length == 0) {
213                     document.f_pop.result.value = value2report;
214                 } else {
215                     document.f_pop.result.value = document.f_pop.result.value + '|' + value2report;
216                 }
217                 return true;
218             }
219
220             function finish() {
221                 opener.document.f.field_value[[ % index % ]].value = document.f_pop.result.value;
222                 self.close();
223                 return false;
224             }
225         </script>
226     [% END %]
227     <script type="text/javascript">
228         function jumpfull(page){
229             window.open(page,'','width=100,height=100,toolbar=false,scrollbars=yes');
230         }
231     </script>
232 [% END %]
233
234 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]