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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-18 / +18 lines)
Lines 31-36 function select_first_available(id){ Link Here
31
    var copiesRowId = null;
31
    var copiesRowId = null;
32
    var wasSpecific = false;
32
    var wasSpecific = false;
33
    var lastCopiesRowId = null;
33
    var lastCopiesRowId = null;
34
35
    $(".toggle-hold-options").show();
36
    $(".hold-options").hide();
37
    $(".holddatefrom,.holddateto").prop("readOnly", true);
38
34
    $(".checkitem").parent().click(function(e){
39
    $(".checkitem").parent().click(function(e){
35
        if(e.target.tagName.toLowerCase() == 'td'){
40
        if(e.target.tagName.toLowerCase() == 'td'){
36
           $(this).find("input.checkitem").each( function() {
41
           $(this).find("input.checkitem").each( function() {
Lines 49-54 function select_first_available(id){ Link Here
49
      }
54
      }
50
    });
55
    });
51
56
57
    $(".toggle-hold-options").on("click",function(e){
58
        e.preventDefault();
59
        toggleLink = $(this);
60
        var optionsID = this.id.replace("toggle-hold-options-","");
61
        $("#hold-options-"+optionsID).toggle(0, function() {
62
            toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
63
        });
64
    });
65
52
    // Hides all 'specific copy' table rows on load.
66
    // Hides all 'specific copy' table rows on load.
53
    $(".copiesrow").hide();
67
    $(".copiesrow").hide();
54
68
Lines 61-70 function select_first_available(id){ Link Here
61
        }
75
        }
62
    });
76
    });
63
77
64
    $(".toggle-hold-options").show();
65
    $(".hold-options").hide();
66
    $(".holddatefrom,.holddateto").prop("readOnly", true);
67
68
    $(".date-format").each(function(){
78
    $(".date-format").each(function(){
69
        if($(this).hasClass("to")){ var op = "to"; }
79
        if($(this).hasClass("to")){ var op = "to"; }
70
        if($(this).hasClass("from")){ var op = "from"; }
80
        if($(this).hasClass("from")){ var op = "from"; }
Lines 117-124 function select_first_available(id){ Link Here
117
        $(".selectany").attr("checked", "checked");
127
        $(".selectany").attr("checked", "checked");
118
    [% END %]
128
    [% END %]
119
129
120
    // If we can choose a specific item, we preselect the first one
130
    // If the user is *allowed* to choose a specific item
121
    [% IF OPACItemHolds =="1" or OPACItemHolds == 'force' %]
131
    // The first one is preselected
132
    [% IF OPACItemHolds =="1" %]
122
        $("table.copiesrow").each(function(){
133
        $("table.copiesrow").each(function(){
123
            var id = suffixOf($(this).attr("id"), "_");
134
            var id = suffixOf($(this).attr("id"), "_");
124
            select_first_available(id);
135
            select_first_available(id);
Lines 202-218 function select_first_available(id){ Link Here
202
        $("#biblionumbers").val(biblionumbers);
213
        $("#biblionumbers").val(biblionumbers);
203
        return true;
214
        return true;
204
    });
215
    });
205
    $(".toggle-hold-options").on("click",function(e){
206
        e.preventDefault();
207
        toggleLink = $(this);
208
        var optionsID = this.id.replace("toggle-hold-options-","");
209
        $("#hold-options-"+optionsID).toggle(0, function() {
210
            toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
211
        });
212
    });
213
214
215
216
216
217
217
218
[% FOREACH bibitemloo IN bibitemloop %]
218
[% FOREACH bibitemloo IN bibitemloop %]
Lines 485-490 function select_first_available(id){ Link Here
485
                        [% IF OPACItemHolds == 'force' %]
485
                        [% IF OPACItemHolds == 'force' %]
486
                            <script type="text/javascript">
486
                            <script type="text/javascript">
487
                                $(document).ready(function() {
487
                                $(document).ready(function() {
488
                                    $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
488
                                    $("#copiesrow_[% bibitemloo.biblionumber %]").show();
489
                                    $("#copiesrow_[% bibitemloo.biblionumber %]").show();
489
                                });
490
                                });
490
                            </script>
491
                            </script>
491
- 

Return to bug 7825