Lines 269-274
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
269 |
}); |
269 |
}); |
270 |
//]]> |
270 |
//]]> |
271 |
</script> |
271 |
</script> |
|
|
272 |
|
273 |
<script type="text/JavaScript" language="JavaScript"> |
274 |
//<![CDATA[ |
275 |
function showAuthors(element, authornumber){ |
276 |
// Hide subjects menu if displayed |
277 |
hideMenu(".subjectSearch"); |
278 |
|
279 |
// Check checkbox related to the clicked link |
280 |
$("#authorsList input[type='checkbox']").attr('checked', false); |
281 |
$("#author_"+authornumber).attr('checked', true); |
282 |
|
283 |
makeAuthorRequest(); |
284 |
|
285 |
// Display menu |
286 |
var left = element.offsetLeft || 0; |
287 |
var top = element.offsetTop || 0; |
288 |
$('.authorSearch').css('display', 'block'); |
289 |
$('.authorSearch').css('left', left); |
290 |
$('.authorSearch').css('top', top + 15); |
291 |
} |
292 |
|
293 |
function hideMenu(elem) { |
294 |
$(elem).css('display', 'none'); |
295 |
} |
296 |
|
297 |
function checkAll(checkbox, elem) { |
298 |
var check = $(checkbox).attr('checked') ? true : false; |
299 |
$(elem).find("input[type='checkbox']").attr('checked', check); |
300 |
elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest(); |
301 |
} |
302 |
|
303 |
function makeAuthorRequest(){ |
304 |
var values = []; |
305 |
|
306 |
$("#authorsList").find("input[type='checkbox']:checked").each(function () { |
307 |
values.push($(this).val()); |
308 |
}); |
309 |
|
310 |
if (values.length > 0) { |
311 |
var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); |
312 |
$("#validAuthorSearch").attr("href", request); |
313 |
} else { |
314 |
$("#validAuthorSearch").removeAttr("href"); |
315 |
} |
316 |
|
317 |
} |
318 |
|
319 |
//Subjects |
320 |
function showSubjects(element, subjectnumber, subfieldnumber){ |
321 |
// Hide author menu if displayed |
322 |
hideMenu(".authorSearch"); |
323 |
|
324 |
// Check checkbox related to the clicked link |
325 |
$("#subjectsList input[type='checkbox']").attr('checked', false); |
326 |
$("#subject_"+subjectnumber+"_"+subfieldnumber).attr('checked', true); |
327 |
|
328 |
makeSubjectRequest(); |
329 |
|
330 |
// Display menu |
331 |
var left = element.offsetLeft || 0; |
332 |
var top = element.offsetTop || 0; |
333 |
$('.subjectSearch').css('display', 'block'); |
334 |
$('.subjectSearch').css('left', left); |
335 |
$('.subjectSearch').css('top', top + 15); |
336 |
} |
337 |
|
338 |
function makeSubjectRequest() { |
339 |
var values = []; |
340 |
$("#subjectsList > ul").each(function() { |
341 |
var all_checked = true; |
342 |
var local_values = []; |
343 |
$(this).find('input[type="checkbox"]').each(function() { |
344 |
if($(this).attr('checked')) { |
345 |
local_values.push($(this).val()); |
346 |
} else { |
347 |
all_checked = false; |
348 |
} |
349 |
}); |
350 |
var authid = $(this).attr('data-authid'); |
351 |
if(all_checked && authid) { |
352 |
values.push('an:' + authid); |
353 |
} else { |
354 |
values = values.concat(local_values); |
355 |
} |
356 |
}); |
357 |
|
358 |
if(values.length > 0) { |
359 |
var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); |
360 |
$("#validSubjectSearch").attr('href', request); |
361 |
} else { |
362 |
$("#validSubjectSearch").removeAttr("href"); |
363 |
} |
364 |
} |
365 |
//]]> |
366 |
</script> |
367 |
|
272 |
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css"> |
368 |
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css"> |
273 |
#addtagl { display: none; } |
369 |
#addtagl { display: none; } |
274 |
</style>[% END %][% END %][% END %] |
370 |
</style>[% END %][% END %][% END %] |
Lines 336-347
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
336 |
</span> |
432 |
</span> |
337 |
|
433 |
|
338 |
[% IF ( MARCAUTHORS ) %] |
434 |
[% IF ( MARCAUTHORS ) %] |
339 |
<span class="results_summary"><span class="label">Authors:</span> |
435 |
<span class="results_summary"> |
|
|
436 |
<span class="label">Authors:</span> |
437 |
<div class="authorSearch" id="authorSearch"> |
438 |
<span><b>Select the item(s) to search :</b></span> |
439 |
<ul id="authorsList"> |
440 |
<li><input type="checkbox" onchange="checkAll(this, '#authorsList')"> <b>all</b></li> |
441 |
<li><hr /></li> |
340 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
442 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
341 |
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %]<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>[% END %] |
443 |
<li> |
342 |
[% UNLESS ( loop.last ) %]| |
444 |
[% IF (MARCAUTHOR.authoritylink) %] |
343 |
[% END %] |
445 |
<input type="checkbox" name="checkbox" |
|
|
446 |
id="author_[% loop.count %]" |
447 |
onclick="makeAuthorRequest()" |
448 |
value="an:[% MARCAUTHOR.authoritylink %]" /> |
449 |
[% ELSE %] |
450 |
<input type="checkbox" name="checkbox" |
451 |
id="author_[% loop.count %]" |
452 |
onclick="makeAuthorRequest()" |
453 |
value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" /> |
454 |
[% END %] |
455 |
|
456 |
[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
457 |
[% SUBFIELD.value %] |
458 |
[% END %] |
459 |
</li> |
344 |
[% END %] |
460 |
[% END %] |
|
|
461 |
</ul> |
462 |
<hr /> |
463 |
<a href="#" onclick="hideMenu('.authorSearch'); return false">Cancel</a> |
464 |
| |
465 |
<a id="validAuthorSearch">Search</a> |
466 |
</div> |
467 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
468 |
[% authorsloop = loop %] |
469 |
[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
470 |
<a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" |
471 |
onclick="showAuthors(this, [% authorsloop.count %]); return false;" |
472 |
href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link IN SUBFIELD.link_loop %][% link.operator |url %][% link.limit |url %]:[% link.link |url %][% END %]">[% SUBFIELD.value %]</a> |
473 |
[% UNLESS (loop.last) %][% SUBFIELD.separator %][% END %] |
474 |
[% END %] |
475 |
[% IF (MARCAUTHOR.authoritylink) %] |
476 |
<a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"></a> |
477 |
[% END %] |
478 |
[% UNLESS ( loop.last ) %]|[% END %] |
479 |
[% END %] |
345 |
</span> |
480 |
</span> |
346 |
[% END %] |
481 |
[% END %] |
347 |
|
482 |
|
Lines 395-406
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
395 |
[% END %] |
530 |
[% END %] |
396 |
|
531 |
|
397 |
[% IF ( MARCSUBJCTS ) %] |
532 |
[% IF ( MARCSUBJCTS ) %] |
398 |
<span class="results_summary"><span class="label">Subject(s):</span> |
533 |
<span class="results_summary"> |
399 |
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %] |
534 |
<span class="label">Subject(s):</span> |
400 |
[% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] |
535 |
<div class="subjectSearch" > |
401 |
[% MARCSUBJECT_SUBFIELDS_LOO.separator %]<a title="$[% MARCSUBJECT_SUBFIELDS_LOO.code %] [% MARCSUBJECT_SUBFIELDS_LOO.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCSUBJECT_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCSUBJECT_SUBFIELDS_LOO.value %]</a>[% END %] |
536 |
<span><b>Select the item(s) to search :</b></span> |
402 |
[% IF ( loop.last ) %][% ELSE %]|[% END %] |
537 |
<div id="subjectsList"> |
403 |
[% END %]</span> |
538 |
<input type="checkbox" id="all_subjects" |
|
|
539 |
onchange="checkAll(this, '#subjectsList')" /> |
540 |
<label for="all_subjects"> |
541 |
<b>all</b> |
542 |
</label> |
543 |
<hr /> |
544 |
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %] |
545 |
[% subjectsloop = loop %] |
546 |
[% IF MARCSUBJCT.authoritylink %] |
547 |
<ul id="subjectsList[% loop.count %]" |
548 |
data-authid="[% MARCSUBJCT.authoritylink %]"> |
549 |
[% ELSE %] |
550 |
<ul id="subjectsList[% loop.count %]"> |
551 |
[% END %] |
552 |
[% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] |
553 |
<li> |
554 |
<input type="checkbox" onclick="makeSubjectRequest()" |
555 |
name="checkbox" |
556 |
id="subject_[% subjectsloop.count %]_[% loop.count %]" |
557 |
value="su,wrdl:[% SUBFIELD.value |url %]" /> |
558 |
<label for="subject_[% subjectsloop.count %]_[% loop.count %]"> |
559 |
[% SUBFIELD.value %] |
560 |
</label> |
561 |
</li> |
562 |
[% END %] |
563 |
</ul> |
564 |
<hr /> |
565 |
[% END %] |
566 |
</div> |
567 |
<a href="#" |
568 |
onclick="hideMenu('.subjectSearch'); return false">Cancel</a> |
569 |
| |
570 |
<a id="validSubjectSearch">Search</a> |
571 |
</div> |
572 |
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %] |
573 |
[% subjectsloop = loop %] |
574 |
[% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] |
575 |
[% SUBFIELD.separator %] |
576 |
<a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]" onclick="showSubjects(this, [% subjectsloop.count %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a> |
577 |
[% END %] |
578 |
[% IF (MARCSUBJCT.authoritylink) %] |
579 |
<a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png" /></a> |
580 |
[% END %] |
581 |
[% UNLESS ( loop.last ) %] | [% END %] |
582 |
[% END %] |
583 |
</span> |
404 |
[% ELSE %] |
584 |
[% ELSE %] |
405 |
[% IF ( subjects ) %]<span class="results_summary"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject %]</a> | [% END %]</span>[% END %] |
585 |
[% IF ( subjects ) %]<span class="results_summary"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject %]</a> | [% END %]</span>[% END %] |
406 |
[% END %] |
586 |
[% END %] |
407 |
- |
|
|