Bug 7825: (follow-up) do not preselect item when OpacItemHolds is 'force'
This patch changes the default behavior for the 'force' value. If the pref is set to force, no item is preselected and the item list is shown. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
976b1dbb7e
commit
83ae892749
1 changed files with 18 additions and 17 deletions
|
@ -32,6 +32,11 @@ function select_first_available(id){
|
||||||
var copiesRowId = null;
|
var copiesRowId = null;
|
||||||
var wasSpecific = false;
|
var wasSpecific = false;
|
||||||
var lastCopiesRowId = null;
|
var lastCopiesRowId = null;
|
||||||
|
|
||||||
|
$(".toggle-hold-options").show();
|
||||||
|
$(".hold-options").hide();
|
||||||
|
$(".holddatefrom,.holddateto").prop("readOnly", true);
|
||||||
|
|
||||||
$(".checkitem").parent().click(function(e){
|
$(".checkitem").parent().click(function(e){
|
||||||
if(e.target.tagName.toLowerCase() == 'td'){
|
if(e.target.tagName.toLowerCase() == 'td'){
|
||||||
$(this).find("input.checkitem").each( function() {
|
$(this).find("input.checkitem").each( function() {
|
||||||
|
@ -50,6 +55,15 @@ function select_first_available(id){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".toggle-hold-options").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
toggleLink = $(this);
|
||||||
|
var optionsID = this.id.replace("toggle-hold-options-","");
|
||||||
|
$("#hold-options-"+optionsID).toggle(0, function() {
|
||||||
|
toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Hides all 'specific copy' table rows on load.
|
// Hides all 'specific copy' table rows on load.
|
||||||
$(".copiesrow").hide();
|
$(".copiesrow").hide();
|
||||||
|
|
||||||
|
@ -62,10 +76,6 @@ function select_first_available(id){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".toggle-hold-options").show();
|
|
||||||
$(".hold-options").hide();
|
|
||||||
$(".holddatefrom,.holddateto").prop("readOnly", true);
|
|
||||||
|
|
||||||
$(".date-format").each(function(){
|
$(".date-format").each(function(){
|
||||||
if($(this).hasClass("to")){ var op = "to"; }
|
if($(this).hasClass("to")){ var op = "to"; }
|
||||||
if($(this).hasClass("from")){ var op = "from"; }
|
if($(this).hasClass("from")){ var op = "from"; }
|
||||||
|
@ -118,8 +128,9 @@ function select_first_available(id){
|
||||||
$(".selectany").attr("checked", "checked");
|
$(".selectany").attr("checked", "checked");
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
// If we can choose a specific item, we preselect the first one
|
// If the user is *allowed* to choose a specific item
|
||||||
[% IF OPACItemHolds =="1" or OPACItemHolds == 'force' %]
|
// The first one is preselected
|
||||||
|
[% IF OPACItemHolds =="1" %]
|
||||||
$("table.copiesrow").each(function(){
|
$("table.copiesrow").each(function(){
|
||||||
var id = suffixOf($(this).attr("id"), "_");
|
var id = suffixOf($(this).attr("id"), "_");
|
||||||
select_first_available(id);
|
select_first_available(id);
|
||||||
|
@ -203,17 +214,6 @@ function select_first_available(id){
|
||||||
$("#biblionumbers").val(biblionumbers);
|
$("#biblionumbers").val(biblionumbers);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
$(".toggle-hold-options").on("click",function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
toggleLink = $(this);
|
|
||||||
var optionsID = this.id.replace("toggle-hold-options-","");
|
|
||||||
$("#hold-options-"+optionsID).toggle(0, function() {
|
|
||||||
toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[% FOREACH bibitemloo IN bibitemloop %]
|
[% FOREACH bibitemloo IN bibitemloop %]
|
||||||
|
@ -489,6 +489,7 @@ function select_first_available(id){
|
||||||
[% IF OPACItemHolds == 'force' %]
|
[% IF OPACItemHolds == 'force' %]
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
|
||||||
$("#copiesrow_[% bibitemloo.biblionumber %]").show();
|
$("#copiesrow_[% bibitemloo.biblionumber %]").show();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue