Lines 312-317
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
312 |
}); |
312 |
}); |
313 |
//]]> |
313 |
//]]> |
314 |
</script> |
314 |
</script> |
|
|
315 |
|
316 |
<script type="text/JavaScript" language="JavaScript"> |
317 |
//<![CDATA[ |
318 |
function showAuthors(element, authornumber){ |
319 |
// Hide subjects menu if displayed |
320 |
hideMenu(".subjectSearch"); |
321 |
|
322 |
// Check checkbox related to the clicked link |
323 |
$("#authorsList input[type='checkbox']").attr('checked', false); |
324 |
$("#author_"+authornumber).attr('checked', true); |
325 |
|
326 |
makeAuthorRequest(); |
327 |
|
328 |
// Display menu |
329 |
var left = element.offsetLeft || 0; |
330 |
var top = element.offsetTop || 0; |
331 |
$('.authorSearch').css('display', 'block'); |
332 |
$('.authorSearch').css('left', left); |
333 |
$('.authorSearch').css('top', top + 15); |
334 |
} |
335 |
|
336 |
function hideMenu(elem) { |
337 |
$(elem).css('display', 'none'); |
338 |
} |
339 |
|
340 |
function checkAll(checkbox, elem) { |
341 |
var check = $(checkbox).attr('checked') ? true : false; |
342 |
$(elem).find("input[type='checkbox']").attr('checked', check); |
343 |
elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest(); |
344 |
} |
345 |
|
346 |
function makeAuthorRequest(){ |
347 |
var values = []; |
348 |
|
349 |
$("#authorsList").find("input[type='checkbox']:checked").each(function () { |
350 |
values.push($(this).val()); |
351 |
}); |
352 |
|
353 |
if (values.length > 0) { |
354 |
var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); |
355 |
$("#validAuthorSearch").attr("href", request); |
356 |
} else { |
357 |
$("#validAuthorSearch").removeAttr("href"); |
358 |
} |
359 |
|
360 |
} |
361 |
|
362 |
//Subjects |
363 |
function showSubjects(element, subjectnumber, subfieldnumber){ |
364 |
// Hide author menu if displayed |
365 |
hideMenu(".authorSearch"); |
366 |
|
367 |
// Check checkbox related to the clicked link |
368 |
$("#subjectsList input[type='checkbox']").attr('checked', false); |
369 |
$("#subject_"+subjectnumber+"_"+subfieldnumber).attr('checked', true); |
370 |
|
371 |
makeSubjectRequest(); |
372 |
|
373 |
// Display menu |
374 |
var left = element.offsetLeft || 0; |
375 |
var top = element.offsetTop || 0; |
376 |
$('.subjectSearch').css('display', 'block'); |
377 |
$('.subjectSearch').css('left', left); |
378 |
$('.subjectSearch').css('top', top + 15); |
379 |
} |
380 |
|
381 |
function makeSubjectRequest() { |
382 |
var values = []; |
383 |
$("#subjectsList > ul").each(function() { |
384 |
var all_checked = true; |
385 |
var local_values = []; |
386 |
$(this).find('input[type="checkbox"]').each(function() { |
387 |
if($(this).attr('checked')) { |
388 |
local_values.push($(this).val()); |
389 |
} else { |
390 |
all_checked = false; |
391 |
} |
392 |
}); |
393 |
var authid = $(this).attr('data-authid'); |
394 |
if(all_checked && authid) { |
395 |
values.push('an:' + authid); |
396 |
} else { |
397 |
values = values.concat(local_values); |
398 |
} |
399 |
}); |
400 |
|
401 |
if(values.length > 0) { |
402 |
var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); |
403 |
$("#validSubjectSearch").attr('href', request); |
404 |
} else { |
405 |
$("#validSubjectSearch").removeAttr("href"); |
406 |
} |
407 |
} |
408 |
//]]> |
409 |
</script> |
410 |
|
315 |
<style type="text/css"> |
411 |
<style type="text/css"> |
316 |
.branch-info-tooltip { |
412 |
.branch-info-tooltip { |
317 |
display: none; |
413 |
display: none; |
Lines 377-386
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
377 |
|
473 |
|
378 |
[% IF ( MARCAUTHORS ) %] |
474 |
[% IF ( MARCAUTHORS ) %] |
379 |
<span class="results_summary"><span class="label">Additional authors:</span> |
475 |
<span class="results_summary"><span class="label">Additional authors:</span> |
|
|
476 |
<div class="authorSearch" id="authorSearch"> |
477 |
<span><b>Select the item(s) to search :</b></span> |
478 |
<ul id="authorsList"> |
479 |
<li><input type="checkbox" onchange="checkAll(this, '#authorsList')"> <b>all</b></li> |
480 |
<li><hr /></li> |
481 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
482 |
<li> |
483 |
[% IF (MARCAUTHOR.authoritylink) %] |
484 |
<input type="checkbox" name="checkbox" |
485 |
id="author_[% loop.count %]" |
486 |
onclick="makeAuthorRequest()" |
487 |
value="an:[% MARCAUTHOR.authoritylink %]" /> |
488 |
[% ELSE %] |
489 |
<input type="checkbox" name="checkbox" |
490 |
id="author_[% loop.count %]" |
491 |
onclick="makeAuthorRequest()" |
492 |
value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" /> |
493 |
[% END %] |
494 |
|
495 |
[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
496 |
[% SUBFIELD.value %] |
497 |
[% END %] |
498 |
</li> |
499 |
[% END %] |
500 |
</ul> |
501 |
<hr /> |
502 |
<a href="#" onclick="hideMenu('.authorSearch'); return false">Cancel</a> |
503 |
| |
504 |
<a id="validAuthorSearch">Search</a> |
505 |
</div> |
380 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
506 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
|
|
507 |
[% authorsloop = loop %] |
381 |
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
508 |
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
382 |
[% MARCAUTHOR_SUBFIELDS_LOO.separator %] |
509 |
[% MARCAUTHOR_SUBFIELDS_LOO.separator %] |
383 |
<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" |
510 |
<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" |
|
|
511 |
onclick="showAuthors(this, [% authorsloop.count %]); return false;" |
384 |
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> |
512 |
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> |
385 |
[% END %] |
513 |
[% END %] |
386 |
[% IF (MARCAUTHOR.authoritylink) %] |
514 |
[% IF (MARCAUTHOR.authoritylink) %] |
Lines 443-448
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
443 |
[% IF ( MARCSUBJCTS ) %] |
571 |
[% IF ( MARCSUBJCTS ) %] |
444 |
<span class="results_summary"> |
572 |
<span class="results_summary"> |
445 |
<span class="label">Subject(s):</span> |
573 |
<span class="label">Subject(s):</span> |
|
|
574 |
<div class="subjectSearch" > |
575 |
<span><b>Select the item(s) to search :</b></span> |
576 |
<div id="subjectsList"> |
577 |
<input type="checkbox" id="all_subjects" |
578 |
onchange="checkAll(this, '#subjectsList')" /> |
579 |
<label for="all_subjects"> |
580 |
<b>all</b> |
581 |
</label> |
582 |
<hr /> |
583 |
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %] |
584 |
[% subjectsloop = loop %] |
585 |
[% IF MARCSUBJCT.authoritylink %] |
586 |
<ul id="subjectsList[% loop.count %]" |
587 |
data-authid="[% MARCSUBJCT.authoritylink %]"> |
588 |
[% ELSE %] |
589 |
<ul id="subjectsList[% loop.count %]"> |
590 |
[% END %] |
591 |
[% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] |
592 |
<li> |
593 |
<input type="checkbox" onclick="makeSubjectRequest()" |
594 |
name="checkbox" |
595 |
id="subject_[% subjectsloop.count %]_[% loop.count %]" |
596 |
value="su,wrdl:[% SUBFIELD.value |url %]" /> |
597 |
<label for="subject_[% subjectsloop.count %]_[% loop.count %]"> |
598 |
[% SUBFIELD.value %] |
599 |
</label> |
600 |
</li> |
601 |
[% END %] |
602 |
</ul> |
603 |
<hr /> |
604 |
[% END %] |
605 |
</div> |
606 |
<a href="#" |
607 |
onclick="hideMenu('.subjectSearch'); return false">Cancel</a> |
608 |
| |
609 |
<a id="validSubjectSearch">Search</a> |
610 |
</div> |
446 |
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %] |
611 |
[% FOREACH MARCSUBJCT IN MARCSUBJCTS %] |
447 |
[% subjectsloop = loop %] |
612 |
[% subjectsloop = loop %] |
448 |
[% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] |
613 |
[% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] |
449 |
- |
|
|