|
Lines 141-200
Link Here
|
| 141 |
[% IF ( MARCAUTHORS ) %] |
141 |
[% IF ( MARCAUTHORS ) %] |
| 142 |
<div class="results_summary"> |
142 |
<div class="results_summary"> |
| 143 |
<span class="label">Additional authors:</span> |
143 |
<span class="label">Additional authors:</span> |
| 144 |
[% IF OPACPopupAuthorsSearch %] |
|
|
| 145 |
<!-- Author search term selection modal --> |
| 146 |
<div id="authorSearch" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="authorSearchLabel" aria-hidden="true"> |
| 147 |
<div class="modal-header"> |
| 148 |
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button> |
| 149 |
<h3 id="authorSearchLabel">Select the item(s) to search</h3> |
| 150 |
</div> |
| 151 |
<div class="modal-body"> |
| 152 |
<input type="checkbox" onchange="checkAll(this, '#authorsList')" /> <b>All</b> |
| 153 |
<ul id="authorsList"> |
| 154 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
| 155 |
<li> |
| 156 |
[% IF (MARCAUTHOR.authoritylink) %] |
| 157 |
<input type="checkbox" name="checkbox" |
| 158 |
id="author_[% loop.count | html %]" |
| 159 |
onclick="makeAuthorRequest()" |
| 160 |
value="an:[% MARCAUTHOR.authoritylink | html %]" /> |
| 161 |
[% ELSE %] |
| 162 |
<input type="checkbox" name="checkbox" |
| 163 |
id="author_[% loop.count | html %]" |
| 164 |
onclick="makeAuthorRequest()" |
| 165 |
value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" /> |
| 166 |
[% END %] |
| 167 |
<label for="author_[% loop.count | html %]"> |
| 168 |
[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
| 169 |
[% SUBFIELD.value | html %] |
| 170 |
[% END %] |
| 171 |
</label> |
| 172 |
</li> |
| 173 |
[% END # /FOREACH MARCAUTHORS %] |
| 174 |
</ul> |
| 175 |
</div> |
| 176 |
<div class="modal-footer"> |
| 177 |
<a id="validAuthorSearch" href="#" class="btn btn-primary">Search</a> |
| 178 |
<a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> |
| 179 |
</div> |
| 180 |
</div> |
| 181 |
[% END # /OPACPopupAuthorsSearch %] |
| 182 |
|
| 183 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
144 |
[% FOREACH MARCAUTHOR IN MARCAUTHORS %] |
| 184 |
[% authorsloop = loop %] |
|
|
| 185 |
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
145 |
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] |
| 186 |
[% MARCAUTHOR_SUBFIELDS_LOO.separator | html %] |
146 |
[% MARCAUTHOR_SUBFIELDS_LOO.separator | html %] |
| 187 |
[% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %] |
147 |
[% IF ( MARCAUTHOR.authoritylink ) %] |
| 188 |
<a role="button" data-toggle="modal" title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]" |
148 |
<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]" class="contributors authority_link" data-authid="[% MARCAUTHOR.authoritylink | html %]" 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 %]"> |
| 189 |
class="showauthors" data-count="[% authorsloop.count | html %]" |
|
|
| 190 |
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 %]#authorSearch">[% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a> |
| 191 |
[% ELSE %] |
149 |
[% ELSE %] |
| 192 |
<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]" |
150 |
<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]" class="contributors" 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 %]"> |
| 193 |
class="showauthors" 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 | html %]</a> |
|
|
| 194 |
[% END %] |
151 |
[% END %] |
|
|
152 |
[% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a> |
| 195 |
[% END %] |
153 |
[% END %] |
| 196 |
[% IF (MARCAUTHOR.authoritylink) %] |
154 |
[% IF (MARCAUTHOR.authoritylink) %] |
| 197 |
<a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink | html %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface | html %]/[% theme | html %]/images/filefind.png"></a> |
155 |
<a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink | html %]"><i class="fa fa-search"></i></a> |
| 198 |
[% END %] |
156 |
[% END %] |
| 199 |
[% IF IDREF and MARCAUTHOR.unimarc3 %] |
157 |
[% IF IDREF and MARCAUTHOR.unimarc3 %] |
| 200 |
<a href="/cgi-bin/koha/opac-idref.pl?unimarc3=[% MARCAUTHOR.unimarc3 | uri %]" title="IdRef" rel="gb_page_center[600,500]">IdRef</a> |
158 |
<a href="/cgi-bin/koha/opac-idref.pl?unimarc3=[% MARCAUTHOR.unimarc3 | uri %]" title="IdRef" rel="gb_page_center[600,500]">IdRef</a> |
|
Lines 1403-1408
Link Here
|
| 1403 |
</table> |
1361 |
</table> |
| 1404 |
[% END %][%# end of items_table block %] |
1362 |
[% END %][%# end of items_table block %] |
| 1405 |
|
1363 |
|
|
|
1364 |
[% IF ( OPACPopupAuthorsSearch ) %] |
| 1365 |
<!-- Modal --> |
| 1366 |
<div class="modal hide" id="authorSearch" tabindex="-1" role="dialog" aria-labelledby="authorSearchLabel"> |
| 1367 |
<div class="modal-dialog" role="document"> |
| 1368 |
<div class="modal-content"> |
| 1369 |
<div class="modal-header"> |
| 1370 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 1371 |
<h3 id="authorSearchLabel">Select the item(s) to search</h3> |
| 1372 |
</div> |
| 1373 |
<div class="modal-body"> |
| 1374 |
<a href="#" class="check_all"><i class="fa fa-check"></i> Select all</a> <span class="sep">|</span> |
| 1375 |
<a href="#" class="check_none"><i class="fa fa-remove"></i> Select none</a> |
| 1376 |
<ul id="authorsList"> |
| 1377 |
</ul> |
| 1378 |
</div> |
| 1379 |
<div class="modal-footer"> |
| 1380 |
<a id="validAuthorSearch" href="#" class="btn btn-primary">Search</a> |
| 1381 |
<a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> |
| 1382 |
</div> |
| 1383 |
</div> <!-- /.modal-content --> |
| 1384 |
</div> <!-- /.modal-dialog --> |
| 1385 |
</div> <!-- /#myModal --> |
| 1386 |
[% END %] |
| 1387 |
|
| 1406 |
[% BLOCK jsinclude %] |
1388 |
[% BLOCK jsinclude %] |
| 1407 |
[% INCLUDE 'datatables.inc' %] |
1389 |
[% INCLUDE 'datatables.inc' %] |
| 1408 |
[% INCLUDE 'columns_settings.inc' %] |
1390 |
[% INCLUDE 'columns_settings.inc' %] |
|
Lines 1426-1431
Link Here
|
| 1426 |
[% END %] |
1408 |
[% END %] |
| 1427 |
|
1409 |
|
| 1428 |
<script> |
1410 |
<script> |
|
|
1411 |
var OPACPopupAuthorsSearch = "[% Koha.Preference('OPACPopupAuthorsSearch') | html %]"; |
| 1429 |
[% IF ( OpacHighlightedWords ) %] |
1412 |
[% IF ( OpacHighlightedWords ) %] |
| 1430 |
var q_array = new Array(); // holds search terms if available |
1413 |
var q_array = new Array(); // holds search terms if available |
| 1431 |
|
1414 |
|
|
Lines 1771-1808
Link Here
|
| 1771 |
} |
1754 |
} |
| 1772 |
} |
1755 |
} |
| 1773 |
[% END # / IF IDreamBooksReviews || IDreamBooksReadometer %] |
1756 |
[% END # / IF IDreamBooksReviews || IDreamBooksReadometer %] |
| 1774 |
</script> |
|
|
| 1775 |
|
1757 |
|
| 1776 |
[% IF OPACPopupAuthorsSearch %] |
1758 |
$(document).ready(function() { |
| 1777 |
<script> |
1759 |
if( OPACPopupAuthorsSearch == "1" ){ |
| 1778 |
function showAuthors(element){ |
1760 |
$(".contributors").on("click", function(e){ |
| 1779 |
var authornumber = $(element).attr("data-count"); |
1761 |
e.preventDefault(); |
|
|
1762 |
var selected_author = $(this).text(); |
| 1763 |
var authors = $(".contributors"); |
| 1764 |
if( authors.length > 1 ){ |
| 1765 |
authors.each(function( index ){ |
| 1766 |
var authid = ""; |
| 1767 |
var search_prefix = "au,wrdl:"; |
| 1768 |
var preselected = false; |
| 1769 |
var search_label = $(this).text().trim(); |
| 1770 |
if( $(this).text() == selected_author ){ preselected = true } |
| 1771 |
if( $(this).hasClass("authority_link") ){ |
| 1772 |
authid = $(this).data("authid"); |
| 1773 |
search_string = "an:" + authid; |
| 1774 |
} else { |
| 1775 |
search_string = "au:" + encodeURIComponent( search_label ); |
| 1776 |
} |
| 1777 |
var authorlink = $("<li>") |
| 1778 |
.append( $("<input>", { type: "checkbox", class: "select_author", value: search_string, id: "author" + index } ).prop("checked", preselected ) ) |
| 1779 |
.append(" ") |
| 1780 |
.append( $("<label>", { for: "author" + index, text: search_label } ) ) |
| 1781 |
$("#authorsList").append( authorlink ); |
| 1782 |
$("#authorSearch").modal("show"); |
| 1783 |
}); |
| 1784 |
} else { |
| 1785 |
location.href = $(this).attr("href"); |
| 1786 |
} |
| 1787 |
}); |
| 1788 |
} |
| 1780 |
|
1789 |
|
| 1781 |
// Check checkbox related to the clicked link |
1790 |
$("#authorSearch").on("hide.bs.modal", function(){ |
| 1782 |
$("#authorsList input[type='checkbox']").attr('checked', false); |
1791 |
$("#authorsList").html(""); |
| 1783 |
$("#author_"+authornumber).attr('checked', true); |
1792 |
}); |
| 1784 |
|
1793 |
|
| 1785 |
makeAuthorRequest(); |
1794 |
$(".check_all").on("click", function(e){ |
| 1786 |
} |
1795 |
e.preventDefault(); |
|
|
1796 |
$(".select_author").each(function(){ |
| 1797 |
$(this).prop("checked", true ); |
| 1798 |
}); |
| 1799 |
}); |
| 1787 |
|
1800 |
|
| 1788 |
function checkAll(checkbox, elem) { |
1801 |
$(".check_none").on("click", function(e){ |
| 1789 |
var check = $(checkbox).attr('checked') ? true : false; |
1802 |
e.preventDefault(); |
| 1790 |
$(elem).find("input[type='checkbox']").attr('checked', check); |
1803 |
$(".select_author").each(function(){ |
| 1791 |
elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest(); |
1804 |
$(this).prop("checked", false ); |
| 1792 |
} |
1805 |
}); |
|
|
1806 |
}); |
| 1807 |
|
| 1808 |
$("#validAuthorSearch").on("click", function(e){ |
| 1809 |
e.preventDefault(); |
| 1810 |
makeAuthorRequest(); |
| 1811 |
}); |
| 1812 |
}); |
| 1793 |
|
1813 |
|
| 1794 |
function makeAuthorRequest(){ |
1814 |
function makeAuthorRequest(){ |
| 1795 |
var values = []; |
1815 |
var values = []; |
| 1796 |
|
1816 |
$(".select_author").each(function(){ |
| 1797 |
$("#authorsList").find("input[type='checkbox']:checked").each(function () { |
1817 |
if( $(this).prop("checked") ){ |
| 1798 |
values.push($(this).val()); |
1818 |
values.push( $(this).val() ); |
|
|
1819 |
} |
| 1799 |
}); |
1820 |
}); |
| 1800 |
|
1821 |
|
| 1801 |
if (values.length > 0) { |
1822 |
if (values.length > 0) { |
| 1802 |
var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); |
1823 |
var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); |
| 1803 |
$("#validAuthorSearch").attr("href", request); |
1824 |
location.href = request; |
| 1804 |
} else { |
|
|
| 1805 |
$("#validAuthorSearch").removeAttr("href"); |
| 1806 |
} |
1825 |
} |
| 1807 |
|
1826 |
|
| 1808 |
} |
1827 |
} |
|
Lines 1844-1855
Link Here
|
| 1844 |
$("#validSubjectSearch").removeAttr("href"); |
1863 |
$("#validSubjectSearch").removeAttr("href"); |
| 1845 |
} |
1864 |
} |
| 1846 |
} |
1865 |
} |
| 1847 |
$(document).ready(function() { |
|
|
| 1848 |
$("a.showauthors").click(function(e){ |
| 1849 |
e.preventDefault(); |
| 1850 |
showAuthors(this); |
| 1851 |
}); |
| 1852 |
}); |
| 1853 |
</script> |
1866 |
</script> |
| 1854 |
[% END # / IF OPACPopupAuthorsSearch %] |
|
|
| 1855 |
[% END %] |
1867 |
[% END %] |