View | Details | Raw Unified | Return to bug 5888
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+30 lines)
Lines 2154-2159 a.p1:active { Link Here
2154
div.ft {
2154
div.ft {
2155
	clear : both;
2155
	clear : both;
2156
}
2156
}
2157
2158
.authorSearch {
2159
    position: absolute;
2160
    display: none;
2161
    z-index: 2;
2162
    background-color: white;
2163
    border: 1px solid black;
2164
    padding: 4px;
2165
}
2166
.authorSearch li {
2167
    list-style-type: none;
2168
}
2169
.authorSearch ul {
2170
    padding-left: 0px;
2171
}
2172
.subjectSearch {
2173
    position: absolute;
2174
    display: none;
2175
    z-index: 2;
2176
    background-color: white;
2177
    border: 1px solid black;
2178
    padding: 4px;
2179
}
2180
.subjectSearch li {
2181
    list-style-type: none;
2182
}
2183
.subjectSearch ul {
2184
    padding-left: 0px;
2185
}
2186
2157
#basket td ul li {
2187
#basket td ul li {
2158
	font-size:90%;
2188
	font-size:90%;
2159
    list-style:disc outside url(data:image/gif;base64,R0lGODlhBQAHAJECAP///5zD6v///wAAACH5BAEAAAIALAAAAAAFAAcAAAIMjCUGkbvhFGQSmVAAADs=);
2189
    list-style:disc outside url(data:image/gif;base64,R0lGODlhBQAHAJECAP///5zD6v///wAAACH5BAEAAAIALAAAAAAFAAcAAAIMjCUGkbvhFGQSmVAAADs=);
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +165 lines)
Lines 292-297 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
292
 });
292
 });
293
//]]>
293
//]]>
294
</script>
294
</script>
295
296
<script type="text/JavaScript" language="JavaScript">
297
//<![CDATA[
298
    function showAuthors(element, authornumber){
299
        // Hide subjects menu if displayed
300
        hideMenu(".subjectSearch");
301
302
        // Check checkbox related to the clicked link
303
        $("#authorsList input[type='checkbox']").attr('checked', false);
304
        $("#author_"+authornumber).attr('checked', true);
305
306
        makeAuthorRequest();
307
308
        // Display menu
309
        var left = element.offsetLeft || 0;
310
        var top = element.offsetTop || 0;
311
        $('.authorSearch').css('display', 'block');
312
        $('.authorSearch').css('left', left);
313
        $('.authorSearch').css('top', top + 15);
314
    }
315
316
    function hideMenu(elem) {
317
        $(elem).css('display', 'none');
318
    }
319
320
    function checkAll(checkbox, elem) {
321
        var check = $(checkbox).attr('checked') ? true : false;
322
        $(elem).find("input[type='checkbox']").attr('checked', check);
323
        elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest();
324
    }
325
326
    function makeAuthorRequest(){
327
        var values = [];
328
329
        $("#authorsList").find("input[type='checkbox']:checked").each(function () {
330
            values.push($(this).val());
331
        });
332
333
        if (values.length > 0) {
334
            var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
335
            $("#validAuthorSearch").attr("href", request);
336
        } else {
337
            $("#validAuthorSearch").removeAttr("href");
338
        }
339
340
    }
341
342
    //Subjects
343
    function showSubjects(element, subjectnumber, subfieldnumber){
344
        // Hide author menu if displayed
345
        hideMenu(".authorSearch");
346
347
        // Check checkbox related to the clicked link
348
        $("#subjectsList input[type='checkbox']").attr('checked', false);
349
        $("#subject_"+subjectnumber+"_"+subfieldnumber).attr('checked', true);
350
351
        makeSubjectRequest();
352
353
        // Display menu
354
        var left = element.offsetLeft || 0;
355
        var top = element.offsetTop || 0;
356
        $('.subjectSearch').css('display', 'block');
357
        $('.subjectSearch').css('left', left);
358
        $('.subjectSearch').css('top', top + 15);
359
    }
360
361
    function makeSubjectRequest() {
362
        var values = [];
363
        $("#subjectsList > ul").each(function() {
364
            var all_checked = true;
365
            var local_values = [];
366
            $(this).find('input[type="checkbox"]').each(function() {
367
                if($(this).attr('checked')) {
368
                    local_values.push($(this).val());
369
                } else {
370
                    all_checked = false;
371
                }
372
            });
373
            var authid = $(this).attr('data-authid');
374
            if(all_checked && authid) {
375
                values.push('an:' + authid);
376
            } else {
377
                values = values.concat(local_values);
378
            }
379
        });
380
381
        if(values.length > 0) {
382
            var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
383
            $("#validSubjectSearch").attr('href', request);
384
        } else {
385
            $("#validSubjectSearch").removeAttr("href");
386
        }
387
    }
388
//]]>
389
</script>
390
295
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css">
391
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css">
296
    #addtagl { display: none; }
392
    #addtagl { display: none; }
297
</style>[% END %][% END %][% END %]
393
</style>[% END %][% END %][% END %]
Lines 360-369 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
360
456
361
    [% IF ( MARCAUTHORS ) %]
457
    [% IF ( MARCAUTHORS ) %]
362
    <span class="results_summary"><span class="label">Additional authors:</span>
458
    <span class="results_summary"><span class="label">Additional authors:</span>
459
        <div class="authorSearch" id="authorSearch">
460
            <span><b>Select the item(s) to search :</b></span>
461
            <ul id="authorsList">
462
                <li><input type="checkbox" onchange="checkAll(this, '#authorsList')"> <b>all</b></li>
463
                <li><hr /></li>
464
                [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
465
                    <li>
466
                        [% IF (MARCAUTHOR.authoritylink) %]
467
                            <input type="checkbox" name="checkbox"
468
                                id="author_[% loop.count %]"
469
                                onclick="makeAuthorRequest()"
470
                                value="an:[% MARCAUTHOR.authoritylink %]" />
471
                        [% ELSE %]
472
                            <input type="checkbox" name="checkbox"
473
                                id="author_[% loop.count %]"
474
                                onclick="makeAuthorRequest()"
475
                                value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" />
476
                        [% END %]
477
478
                        [% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
479
                            [% SUBFIELD.value %]
480
                        [% END %]
481
                    </li>
482
                [% END %]
483
            </ul>
484
            <hr />
485
            <a href="#" onclick="hideMenu('.authorSearch'); return false">Cancel</a>
486
            &nbsp;|&nbsp;
487
            <a id="validAuthorSearch">Search</a>
488
        </div>
363
        [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
489
        [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
490
            [% authorsloop = loop %]
364
            [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
491
            [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
365
                [% MARCAUTHOR_SUBFIELDS_LOO.separator %]
492
                [% MARCAUTHOR_SUBFIELDS_LOO.separator %]
366
                <a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]"
493
                <a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]"
494
                    onclick="showAuthors(this, [% authorsloop.count %]); return false;"
367
                    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>
495
                    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>
368
            [% END %]
496
            [% END %]
369
            [% IF (MARCAUTHOR.authoritylink) %]
497
            [% IF (MARCAUTHOR.authoritylink) %]
Lines 426-431 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
426
    [% IF ( MARCSUBJCTS ) %]
554
    [% IF ( MARCSUBJCTS ) %]
427
        <span class="results_summary">
555
        <span class="results_summary">
428
            <span class="label">Subject(s):</span>
556
            <span class="label">Subject(s):</span>
557
            <div class="subjectSearch" >
558
                <span><b>Select the item(s) to search :</b></span>
559
                <div id="subjectsList">
560
                    <input type="checkbox" id="all_subjects"
561
                        onchange="checkAll(this, '#subjectsList')" />
562
                    <label for="all_subjects">
563
                        <b>all</b>
564
                    </label>
565
                    <hr />
566
                    [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
567
                        [% subjectsloop = loop %]
568
                        [% IF MARCSUBJCT.authoritylink %]
569
                            <ul id="subjectsList[% loop.count %]"
570
                                data-authid="[% MARCSUBJCT.authoritylink %]">
571
                        [% ELSE %]
572
                            <ul id="subjectsList[% loop.count %]">
573
                        [% END %]
574
                        [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
575
                            <li>
576
                                <input type="checkbox" onclick="makeSubjectRequest()"
577
                                    name="checkbox"
578
                                    id="subject_[% subjectsloop.count %]_[% loop.count %]"
579
                                    value="su,wrdl:[% SUBFIELD.value |url %]" />
580
                                <label for="subject_[% subjectsloop.count %]_[% loop.count %]">
581
                                    [% SUBFIELD.value %]
582
                                </label>
583
                            </li>
584
                        [% END %]
585
                        </ul>
586
                        <hr />
587
                    [% END %]
588
                </div>
589
                <a href="#"
590
                onclick="hideMenu('.subjectSearch'); return false">Cancel</a>
591
                &nbsp;|&nbsp;
592
                <a id="validSubjectSearch">Search</a>
593
            </div>
429
            [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
594
            [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
430
                [% subjectsloop = loop %]
595
                [% subjectsloop = loop %]
431
                [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
596
                [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
432
- 

Return to bug 5888