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 %]
33
        [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]$("#renewselected").submit(function(){
34
            valid = false;
35
            $("input[type=checkbox]").each(function(){
36
                if($(this).is(':checked')){
37
                    valid = true;
38
                }
39
            });
40
            if(!valid){
41
                alert(_("Nothing has been selected. Check the box for each item you want to renew"));
42
            }
43
            return valid;
44
        });
45
        $("#renewselected_link").live('click',function(){
46
            $("#renewselected").submit();
47
        });
32
        });
48
        $("#renewall_link").live('click',function(){
33
49
            $("#renewall").submit();
34
        $("#checkoutst").tablesorter({
35
            [% IF ( JacketImages ) %]
36
                sortList: [[2,0]]
37
            [% ELSE %]
38
                sortList: [[1,0]]
39
            [% END %]
50
        });
40
        });
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 %]
41
52
        $( "#suspend_until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
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"));
59
                }
60
61
                return valid;
62
            });
63
64
            $("#renewselected_link").live('click',function(){
65
                $("#renewselected").submit();
66
            });
67
68
            $("#renewall_link").live('click',function(){
69
                $("#renewall").submit();
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 153-179 $.tablesorter.addParser({ Link Here
153
178
154
    <div id="opac-user-checkouts">[% IF ( issues_count ) %]
179
    <div id="opac-user-checkouts">[% IF ( issues_count ) %]
155
        <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
180
        <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
156
    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
181
            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
157
    <input type="hidden" name="from" value="opac_user" />
182
            <input type="hidden" name="from" value="opac_user" />
158
        <table id="checkoutst">
183
159
        <caption>[% issues_count %] Item(s) checked out</caption>
184
            <table id="checkoutst">
160
       <thead><tr>
185
                <caption>[% issues_count %] Item(s) checked out</caption>
161
        [% IF ( JacketImages ) %]<th class="{sorter: false}">&nbsp;</th>[% END %]
186
162
        <th class="{sorter:'articles'}">Title</th>
187
                <thead>
163
        <th>Due</th>
188
                    <tr>
164
        [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
189
                        [% IF ( JacketImages ) %]
165
        [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
190
                            <th class="{sorter: false}">&nbsp;</th>
166
        <th>Call No.</th>
191
                        [% END %]
167
        [% IF ( OpacRenewalAllowed ) %]
192
168
        <th class="{sorter: false}">Renew</th>
193
                        <th class="{sorter:'articles'}">Title</th>
169
        [% END %]
194
170
[% IF ( OPACFinesTab ) %]
195
                        <th>Due</th>
171
        <th>Fines</th>
196
172
[% END %]
197
                        [% UNLESS ( item_level_itypes ) %]
173
        [% IF ( OPACMySummaryHTML ) %]
198
                            <th>Item type</th>
174
        <th class="{sorter: false}">Links</th>
199
                        [% END %]
175
        [% END %]
200
176
        </tr></thead>
201
                        [% IF ( show_barcode ) %]
202
                            <th>Barcode</th>
203
                        [% END %]
204
205
                        <th>Call No.</th>
206
207
                        [% IF OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions  ) %]
208
                            <th class="{sorter: false}">Renew</th>
209
                        [% END %]
210
211
                        [% IF ( OPACFinesTab ) %]
212
                            <th>Fines</th>
213
                        [% END %]
214
215
                        [% IF ( OPACMySummaryHTML ) %]
216
                            <th class="{sorter: false}">Links</th>
217
                        [% END %]
218
                    </tr>
219
                </thead>
177
        <tbody>
220
        <tbody>
178
        <!-- FIXME: the styling for highlight overrides the overdue red background,
221
        <!-- FIXME: the styling for highlight overrides the overdue red background,
179
                so currently we don't use this conditional as the first thing inside the LOOP:
222
                so currently we don't use this conditional as the first thing inside the LOOP:
Lines 212-218 $.tablesorter.addParser({ Link Here
212
                [% 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 %]
255
                [% 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 %]
213
                [% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
256
                [% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
214
                <td class="call_no">[% ISSUE.itemcallnumber %]</td>
257
                <td class="call_no">[% ISSUE.itemcallnumber %]</td>
215
                [% IF ( OpacRenewalAllowed ) %]
258
                [% IF OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) %]
216
                    <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>
259
                    <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>
217
                        [% ELSE %]
260
                        [% ELSE %]
218
                        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 %] 
261
                        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 227-237 $.tablesorter.addParser({ Link Here
227
            </tr>
270
            </tr>
228
        [% END %]</tbody>
271
        [% END %]</tbody>
229
        </table>
272
        </table>
230
       [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
273
       [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
231
        <input type="submit" value="Renew Selected" />
274
        <input type="submit" value="Renew Selected" />
232
        [% END %]
275
        [% END %]
233
        </form>
276
        </form>
234
        [% IF ( canrenew && !userdebarred && OpacRenewalAllowed ) %]
277
        [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions )) %]
235
        <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
278
        <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
236
            <input type="hidden" name="from" value="opac_user" />
279
            <input type="hidden" name="from" value="opac_user" />
237
            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
280
            <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