Bug 18545: Remove use of onclick from OPAC cart
To test: 1) Apply patch and add one or more items to your cart 2) Confirm that clicking the following things still works as expected: - more details - brief display - send - download - print - select all - clear all - selecting by clicking checkbox - remove title - add title to list - place hold - add tag - empty and close Sponsored-by: Catalyst IT Followed test plan, works as expected. Resolves issue with two print dialogues from Bug 18544. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (cherry picked from commit1b4d4f989b) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit38597cee18) Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
parent
9aa31608ab
commit
1fdcd9769f
|
|
@ -18,16 +18,16 @@
|
|||
[% UNLESS ( print_basket ) %]
|
||||
<div id="toolbar" class="toolbar">
|
||||
[% IF ( verbose ) %]
|
||||
<a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief display</a>
|
||||
<a href="opac-basket.pl" class="brief">Brief display</a>
|
||||
[% ELSE %]
|
||||
<a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More details</a>
|
||||
<a href="opac-basket.pl" class="detail">More details</a>
|
||||
[% END %]
|
||||
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
|
||||
<a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a>
|
||||
<a class="send" href="opac-basket.pl">Send</a>
|
||||
[% END %]
|
||||
<a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a>
|
||||
<a class="print-large" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a>
|
||||
<a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and close</a>
|
||||
<a class="download" href="opac-basket.pl">Download</a>
|
||||
<a class="print-large" href="opac-basket.pl">Print</a>
|
||||
<a class="empty" href="opac-basket.pl">Empty and close</a>
|
||||
<a class="hide close" href="opac-basket.pl">Hide window</a>
|
||||
</div>
|
||||
|
||||
|
|
@ -37,16 +37,16 @@
|
|||
<span class="sep">|</span>
|
||||
<span class="links" id="tag_hides">
|
||||
<span id="selections">Select titles to: </span>
|
||||
<a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
|
||||
<a href="#" class="deleteshelf disabled">Remove</a>
|
||||
[% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
|
||||
[% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
|
||||
<a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
|
||||
<a href="#" class="newshelf disabled">Add to a list</a>
|
||||
[% END %]
|
||||
[% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
|
||||
<a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>
|
||||
<a href="#" class="hold disabled">Place hold</a>
|
||||
[% END %]
|
||||
[% IF ( TagsInputEnabled && loggedinusername ) %]
|
||||
<a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>
|
||||
<a href="#" id="tagsel_tag" class="disabled">Tag</a>
|
||||
[% END %]
|
||||
[% END # / IF opacuserlogin %]
|
||||
</span>
|
||||
|
|
@ -54,8 +54,8 @@
|
|||
<span id="tagsel_form" style="display:none">
|
||||
<label for="tagsel_new">New tag:</label>
|
||||
<input name="tagsel_new" id="tagsel_new" maxlength="100" />
|
||||
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" onclick="tagAdded(); return false;" />
|
||||
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;">Cancel</a>
|
||||
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add">
|
||||
<a href="#" id="tagsel_cancel">Cancel</a>
|
||||
</span>
|
||||
[% END %]
|
||||
</div>
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
[% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %]
|
||||
[% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
|
||||
[% ELSE %]
|
||||
<input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked)" />
|
||||
<input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]">
|
||||
[% BIBLIO_RESULT.title |html %]
|
||||
[% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %]
|
||||
[% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
|
||||
|
|
@ -259,7 +259,7 @@
|
|||
<tr>
|
||||
[% UNLESS ( print_basket ) %]
|
||||
<td>
|
||||
<input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked);" />
|
||||
<input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]">
|
||||
</td>
|
||||
[% END %]
|
||||
<td>
|
||||
|
|
@ -370,6 +370,67 @@
|
|||
[% END # / TagsInputEnabled && loggedinusername %]
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".brief").click(function(){
|
||||
showLess();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".detail").click(function(){
|
||||
showMore();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".send").click(function(){
|
||||
sendBasket();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".download").click(function(){
|
||||
downloadBasket();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".print-large").click(function(){
|
||||
e.preventDefault();
|
||||
printBasket();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".empty").click(function(){
|
||||
delBasket();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".deleteshelf").click(function(){
|
||||
delSelRecords();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".newshelf").click(function(){
|
||||
addSelToShelf();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".hold").click(function(){
|
||||
holdSel();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#tagsel_tag").click(function(){
|
||||
tagSelected();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#tagsel_button").click(function(){
|
||||
tagAdded();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#tagsel_cancel").click(function(){
|
||||
tagCanceled();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#CheckAll").click(function(){
|
||||
var checked = [];
|
||||
$(".checkboxed").checkCheckboxes("*", true).each(
|
||||
|
|
@ -406,10 +467,13 @@
|
|||
]
|
||||
}));
|
||||
|
||||
$(".cb").click(function(){
|
||||
$(".cb").change(function(){
|
||||
if ($(this).prop("checked")){
|
||||
selRecord($(this).val(), true);
|
||||
}
|
||||
enableCheckboxActions();
|
||||
return false;
|
||||
});
|
||||
enableCheckboxActions();
|
||||
});
|
||||
|
||||
function enableCheckboxActions(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue