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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt (-65 / +108 lines)
Lines 8-56 Link Here
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
9
<script type="text/JavaScript">
9
<script type="text/JavaScript">
10
//<![CDATA[
10
//<![CDATA[
11
var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
11
    var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
12
var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
12
    var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
13
var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
13
    var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
14
14
15
$.tablesorter.addParser({
15
    $.tablesorter.addParser({
16
    id: 'articles', 
16
        id: 'articles', 
17
    is: function(s) {return false;  }, 
17
        is: function(s) {return false;  }, 
18
    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
18
        format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
19
    type: 'text' 
19
        type: 'text' 
20
});
20
    });
21
            $(function() {
21
22
            $('#opac-user-views').tabs();
22
    $(function() {
23
            $.tablesorter.defaults.widgets = ['zebra'];
23
        $('#opac-user-views').tabs();
24
            [% IF ( dateformat == 'metric' ) %]$.tablesorter.defaults.dateFormat = ['uk'];[% END %]
24
        $.tablesorter.defaults.widgets = ['zebra'];
25
			$("#holdst").tablesorter({
25
26
				sortList: [[0,0]]
26
        [% IF ( dateformat == 'metric' ) %]
27
			}); 
27
            $.tablesorter.defaults.dateFormat = ['uk'];
28
			$("#checkoutst").tablesorter({
28
        [% END %]
29
                [% IF ( JacketImages ) %]sortList: [[2,0]][% ELSE %]sortList: [[1,0]][% END %]
29
30
            }); 
30
        $("#holdst").tablesorter({
31
			$("#overduest").tablesorter();
31
            sortList: [[0,0]]
32
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
32
        }); 
33
        [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]$("#renewselected").submit(function(){
33
34
            valid = false;
34
        $("#checkoutst").tablesorter({
35
            $("input[type=checkbox]").each(function(){
35
            [% IF ( JacketImages ) %]
36
                if($(this).is(':checked')){
36
                sortList: [[2,0]]
37
                    valid = true;
37
            [% ELSE %]
38
                sortList: [[1,0]]
39
            [% END %]
40
        });
41
42
        $("#overduest").tablesorter();
43
44
        [% IF ( GoogleJackets ) %]
45
            KOHA.Google.GetCoverFromIsbn();
46
        [% END %]
47
48
        [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
49
            $("#renewselected").submit(function(){
50
                valid = false;
51
                $("input[type=checkbox]").each(function(){
52
                    if ( $(this).is(':checked') ){
53
                        valid = true;
54
                    }
55
                });
56
57
                if (!valid) {
58
                    alert(_("Nothing has been selected. Check the box for each item you want to renew"));
38
                }
59
                }
60
61
                return valid;
39
            });
62
            });
40
            if(!valid){
63
41
                alert(_("Nothing has been selected. Check the box for each item you want to renew"));
64
            $("#renewselected_link").live('click',function(){
42
            }
65
                $("#renewselected").submit();
43
            return valid;
66
            });
44
        });
67
45
        $("#renewselected_link").live('click',function(){
68
            $("#renewall_link").live('click',function(){
46
            $("#renewselected").submit();
69
                $("#renewall").submit();
47
        });
48
        $("#renewall_link").live('click',function(){
49
            $("#renewall").submit();
50
        });
51
        $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");[% END %]
52
        $( "#suspend_until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
53
            });
70
            });
71
72
            [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
73
                $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
74
            [% END %]
75
        [% END %]
76
77
        $( "#suspend_until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
78
    });
54
//]]>
79
//]]>
55
</script>
80
</script>
56
</head>
81
</head>
Lines 107-113 $.tablesorter.addParser({ Link Here
107
                <string>Please note:</string>
132
                <string>Please note:</string>
108
                <span>
133
                <span>
109
                    Your account renewal failed because of the following:
134
                    Your account renewal failed because of the following:
110
                    [% FOREACH error IN RENEW_ERROR.split('|') %]
135
                    [% FOREACH error IN RENEW_ERROR.split('\|') %]
111
                        [% IF error == 'card_expired' %]
136
                        [% IF error == 'card_expired' %]
112
                            Your account has expired. Please contact the library for more information.
137
                            Your account has expired. Please contact the library for more information.
113
                        [% ELSIF error == 'too_many' %]
138
                        [% ELSIF error == 'too_many' %]
Lines 155-181 $.tablesorter.addParser({ Link Here
155
180
156
    <div id="opac-user-checkouts">[% IF ( issues_count ) %]
181
    <div id="opac-user-checkouts">[% IF ( issues_count ) %]
157
        <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
182
        <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
158
    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
183
            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
159
    <input type="hidden" name="from" value="opac_user" />
184
            <input type="hidden" name="from" value="opac_user" />
160
        <table id="checkoutst">
185
161
        <caption>[% issues_count %] Item(s) checked out</caption>
186
            <table id="checkoutst">
162
       <thead><tr>
187
                <caption>[% issues_count %] Item(s) checked out</caption>
163
        [% IF ( JacketImages ) %]<th class="{sorter: false}">&nbsp;</th>[% END %]
188
164
        <th class="{sorter:'articles'}">Title</th>
189
                <thead>
165
        <th>Due</th>
190
                    <tr>
166
        [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
191
                        [% IF ( JacketImages ) %]
167
        [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
192
                            <th class="{sorter: false}">&nbsp;</th>
168
        <th>Call No.</th>
193
                        [% END %]
169
        [% IF ( OpacRenewalAllowed ) %]
194
170
        <th class="{sorter: false}">Renew</th>
195
                        <th class="{sorter:'articles'}">Title</th>
171
        [% END %]
196
172
[% IF ( OPACFinesTab ) %]
197
                        <th>Due</th>
173
        <th>Fines</th>
198
174
[% END %]
199
                        [% UNLESS ( item_level_itypes ) %]
175
        [% IF ( OPACMySummaryHTML ) %]
200
                            <th>Item type</th>
176
        <th class="{sorter: false}">Links</th>
201
                        [% END %]
177
        [% END %]
202
178
        </tr></thead>
203
                        [% IF ( show_barcode ) %]
204
                            <th>Barcode</th>
205
                        [% END %]
206
207
                        <th>Call No.</th>
208
209
                        [% IF OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions  ) %]
210
                            <th class="{sorter: false}">Renew</th>
211
                        [% END %]
212
213
                        [% IF ( OPACFinesTab ) %]
214
                            <th>Fines</th>
215
                        [% END %]
216
217
                        [% IF ( OPACMySummaryHTML ) %]
218
                            <th class="{sorter: false}">Links</th>
219
                        [% END %]
220
                    </tr>
221
                </thead>
179
        <tbody>
222
        <tbody>
180
        <!-- FIXME: the styling for highlight overrides the overdue red background,
223
        <!-- FIXME: the styling for highlight overrides the overdue red background,
181
                so currently we don't use this conditional as the first thing inside the LOOP:
224
                so currently we don't use this conditional as the first thing inside the LOOP:
Lines 214-220 $.tablesorter.addParser({ Link Here
214
                [% UNLESS ( item_level_itypes ) %]<td class="itype">[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %]
257
                [% UNLESS ( item_level_itypes ) %]<td class="itype">[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %]
215
                [% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
258
                [% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
216
                <td class="call_no">[% ISSUE.itemcallnumber %]</td>
259
                <td class="call_no">[% ISSUE.itemcallnumber %]</td>
217
                [% IF ( OpacRenewalAllowed ) %]
260
                [% IF OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) %]
218
                    <td class="renew">[% IF ( ISSUE.status ) %][% IF ( canrenew ) %]<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber %]&amp;borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>[% END %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
261
                    <td class="renew">[% IF ( ISSUE.status ) %][% IF ( canrenew ) %]<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber %]&amp;borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>[% END %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
219
                        [% ELSE %]
262
                        [% ELSE %]
220
                        Not renewable[% IF ( ISSUE.too_many ) %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>[% ELSE %][% IF ( ISSUE.on_reserve ) %] <span class="renewals">(On hold)</span>[% END %][% END %] 
263
                        Not renewable[% IF ( ISSUE.too_many ) %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>[% ELSE %][% IF ( ISSUE.on_reserve ) %] <span class="renewals">(On hold)</span>[% END %][% END %] 
Lines 229-239 $.tablesorter.addParser({ Link Here
229
            </tr>
272
            </tr>
230
        [% END %]</tbody>
273
        [% END %]</tbody>
231
        </table>
274
        </table>
232
       [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
275
       [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
233
        <input type="submit" value="Renew Selected" />
276
        <input type="submit" value="Renew Selected" />
234
        [% END %]
277
        [% END %]
235
        </form>
278
        </form>
236
        [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
279
        [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions )) %]
237
        <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
280
        <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
238
            <input type="hidden" name="from" value="opac_user" />
281
            <input type="hidden" name="from" value="opac_user" />
239
            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
282
            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
(-)a/opac/opac-user.pl (-1 / +1 lines)
Lines 145-150 $template->param( BORROWER_INFO => \@bordat, Link Here
145
                    surname           => $borr->{surname},
145
                    surname           => $borr->{surname},
146
                    showname          => $borr->{showname},
146
                    showname          => $borr->{showname},
147
                    RENEW_ERROR       => $renew_error,
147
                    RENEW_ERROR       => $renew_error,
148
                    borrower          => $borr,
148
                );
149
                );
149
150
150
#get issued items ....
151
#get issued items ....
151
- 

Return to bug 6739