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

(-)a/Koha/Schema/Result/Reserve.pm (-1 / +23 lines)
Lines 288-293 __PACKAGE__->belongs_to( Link Here
288
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
288
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
289
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ig/fobzvZf1OgAHZFtkyyQ
289
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ig/fobzvZf1OgAHZFtkyyQ
290
290
291
__PACKAGE__->belongs_to(
292
  "item",
293
  "Koha::Schema::Result::Item",
294
  { itemnumber => "itemnumber" },
295
  {
296
    is_deferrable => 1,
297
    join_type     => "LEFT",
298
    on_delete     => "CASCADE",
299
    on_update     => "CASCADE",
300
  },
301
);
302
303
__PACKAGE__->belongs_to(
304
  "biblio",
305
  "Koha::Schema::Result::Biblio",
306
  { biblionumber => "biblionumber" },
307
  {
308
    is_deferrable => 1,
309
    join_type     => "LEFT",
310
    on_delete     => "CASCADE",
311
    on_update     => "CASCADE",
312
  },
313
);
291
314
292
# You can replace this text with custom content, and it will be preserved on regeneration
293
1;
315
1;
(-)a/api/holds.pl (+143 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
4
5
# Copyright 2014 ByWater Solutions
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 3 of the License, or (at your option) any later
12
# version.
13
#
14
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along
19
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22
use Modern::Perl;
23
24
use CGI;
25
use JSON qw(to_json);
26
27
use C4::Auth qw(check_cookie_auth);
28
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue );
29
use C4::Branch qw(GetBranchName);
30
use C4::Charset;
31
use C4::Circulation qw(GetTransfers);
32
use C4::Context;
33
34
use Koha::Database;
35
use Koha::DateUtils;
36
37
my $input = new CGI;
38
39
my ( $auth_status, $sessionID ) =
40
  check_cookie_auth( $input->cookie('CGISESSID'),
41
    { circulate => 'circulate_remaining_permissions' } );
42
43
if ( $auth_status ne "ok" ) {
44
    exit 0;
45
}
46
47
my $branch = C4::Context->userenv->{'branch'};
48
49
my $schema = Koha::Database->new()->schema();
50
51
my @sort_columns =
52
  qw/reservedate title itemcallnumber barcode expirationdate priority/;
53
54
my $borrowernumber    = $input->param('borrowernumber');
55
my $offset            = $input->param('iDisplayStart');
56
my $results_per_page  = $input->param('iDisplayLength');
57
my $sorting_direction = $input->param('sSortDir_0') || 'desc';
58
my $sorting_column    = $sort_columns[ $input->param('iSortCol_0') ]
59
  || 'reservedate';
60
61
binmode STDOUT, ":encoding(UTF-8)";
62
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
63
64
my $holds_rs = $schema->resultset('Reserve')->search(
65
    { borrowernumber => $borrowernumber },
66
    {
67
        prefetch => { 'item'                => 'biblio' },
68
        order_by => { "-$sorting_direction" => $sorting_column }
69
    }
70
);
71
72
my $borrower;
73
my @holds;
74
while ( my $h = $holds_rs->next() ) {
75
    my $item = $h->item();
76
77
    my $biblionumber = $h->biblio()->biblionumber();
78
79
    my $hold = {
80
        DT_RowId       => $h->reserve_id(),
81
        biblionumber   => $biblionumber,
82
        title          => $h->biblio()->title(),
83
        author         => $h->biblio()->author(),
84
        reserve_id     => $h->reserve_id(),
85
        reservedate    => $h->reservedate(),
86
        expirationdate => $h->expirationdate(),
87
        suspend        => $h->suspend(),
88
        suspend_until  => $h->suspend_until(),
89
        found          => $h->found(),
90
        waiting        => $h->found() eq 'W',
91
        waiting_at     => $h->branchcode()->branchname(),
92
        waiting_here   => $h->branchcode()->branchcode() eq $branch,
93
        priority       => $h->priority(),
94
        subtitle       => GetRecordValue(
95
            'subtitle', GetMarcBiblio($biblionumber),
96
            GetFrameworkCode($biblionumber)
97
        ),
98
        reservedate_formatted => $h->reservedate()
99
        ? output_pref_due( dt_from_string( $h->reservedate() ) )
100
        : q{},
101
        suspend_until_formatted => $h->suspend_until()
102
        ? output_pref_due( dt_from_string( $h->suspend_until() ) )
103
        : q{},
104
        expirationdate_formatted => $h->expirationdate()
105
        ? output_pref_due( dt_from_string( $h->expirationdate() ) )
106
        : q{},
107
    };
108
109
    $hold->{transfered}     = 0;
110
    $hold->{not_transfered} = 0;
111
112
    if ($item) {
113
        $hold->{itemnumber}     = $item->itemnumber();
114
        $hold->{barcode}        = $item->barcode();
115
        $hold->{itemtype}       = $item->effective_itemtype();
116
        $hold->{itemcallnumber} = $item->itemcallnumber() || q{};
117
118
        my ( $transferred_when, $transferred_from, $transferred_to ) =
119
          GetTransfers( $item->itemnumber() );
120
        if ($transferred_when) {
121
            $hold->{color}       = 'transferred';
122
            $hold->{transferred} = 1;
123
            $hold->{date_sent}   = format_date($transferred_when);
124
            $hold->{from_branch} = GetBranchName($transferred_from);
125
        }
126
        elsif ( $item->holdingbranch()->branchcode() ne
127
            $h->branchcode()->branchcode() )
128
        {
129
            $hold->{not_transferred}    = 1;
130
            $hold->{not_transferred_by} = $h->branchcode()->branchname();
131
        }
132
    }
133
134
    push( @holds, $hold );
135
}
136
137
my $data;
138
$data->{'iTotalRecords'}        = scalar @holds;
139
$data->{'iTotalDisplayRecords'} = scalar @holds;
140
$data->{'sEcho'}                = $input->param('sEcho') || undef;
141
$data->{'aaData'}               = \@holds;
142
143
print to_json($data);
(-)a/circ/circulation.pl (-84 / +3 lines)
Lines 361-451 if ($borrowernumber) { Link Here
361
# BUILD HTML
361
# BUILD HTML
362
# show all reserves of this borrower, and the position of the reservation ....
362
# show all reserves of this borrower, and the position of the reservation ....
363
if ($borrowernumber) {
363
if ($borrowernumber) {
364
    $template->param(
365
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
366
          ->count( { borrowernumber => $borrowernumber } ) );
364
367
365
    # new op dev
366
    # now we show the status of the borrower's reservations
367
    my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber );
368
    my @reservloop;
369
    my @WaitingReserveLoop;
370
    
371
    foreach my $num_res (@borrowerreserv) {
372
        my %getreserv;
373
        my %getWaitingReserveInfo;
374
        my $getiteminfo  = GetBiblioFromItemNumber( $num_res->{'itemnumber'} );
375
        my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} );
376
        my ( $transfertwhen, $transfertfrom, $transfertto ) =
377
          GetTransfers( $num_res->{'itemnumber'} );
378
379
        $getreserv{waiting}       = 0;
380
        $getreserv{transfered}    = 0;
381
        $getreserv{nottransfered} = 0;
382
383
        $getreserv{reservedate}    = format_date( $num_res->{'reservedate'} );
384
        $getreserv{reserve_id}  = $num_res->{'reserve_id'};
385
        $getreserv{title}          = $getiteminfo->{'title'};
386
        $getreserv{subtitle}       = GetRecordValue('subtitle', GetMarcBiblio($getiteminfo->{biblionumber}), GetFrameworkCode($getiteminfo->{biblionumber}));
387
        $getreserv{itemtype}       = $itemtypeinfo->{'description'};
388
        $getreserv{author}         = $getiteminfo->{'author'};
389
        $getreserv{barcodereserv}  = $getiteminfo->{'barcode'};
390
        $getreserv{itemcallnumber} = $getiteminfo->{'itemcallnumber'};
391
        $getreserv{biblionumber}   = $getiteminfo->{'biblionumber'};
392
        $getreserv{waitingat}      = GetBranchName( $num_res->{'branchcode'} );
393
        $getreserv{suspend}        = $num_res->{'suspend'};
394
        $getreserv{suspend_until}  = $num_res->{'suspend_until'};
395
        #         check if we have a waiting status for reservations
396
        if ( $num_res->{'found'} && $num_res->{'found'} eq 'W' ) {
397
            $getreserv{color}   = 'reserved';
398
            $getreserv{waiting} = 1;
399
#     genarate information displaying only waiting reserves
400
        $getWaitingReserveInfo{title}        = $getiteminfo->{'title'};
401
        $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'};
402
        $getWaitingReserveInfo{itemtype}     = $itemtypeinfo->{'description'};
403
        $getWaitingReserveInfo{author}       = $getiteminfo->{'author'};
404
        $getWaitingReserveInfo{itemcallnumber} = $getiteminfo->{'itemcallnumber'};
405
        $getWaitingReserveInfo{reservedate}  = format_date( $num_res->{'reservedate'} );
406
        $getWaitingReserveInfo{waitingat}    = GetBranchName( $num_res->{'branchcode'} );
407
        $getWaitingReserveInfo{waitinghere}  = 1 if $num_res->{'branchcode'} eq $branch;
408
        }
409
        #         check transfers with the itemnumber foud in th reservation loop
410
        if ($transfertwhen) {
411
            $getreserv{color}      = 'transfered';
412
            $getreserv{transfered} = 1;
413
            $getreserv{datesent}   = format_date($transfertwhen);
414
            $getreserv{frombranch} = GetBranchName($transfertfrom);
415
        } elsif ($getiteminfo->{'holdingbranch'} ne $num_res->{'branchcode'}) {
416
            $getreserv{nottransfered}   = 1;
417
            $getreserv{nottransferedby} = GetBranchName( $getiteminfo->{'holdingbranch'} );
418
        }
419
420
#         if we don't have a reserv on item, we put the biblio infos and the waiting position
421
        if ( $getiteminfo->{'title'} eq '' ) {
422
            my $getbibinfo = GetBiblioData( $num_res->{'biblionumber'} );
423
424
            $getreserv{color}           = 'inwait';
425
            $getreserv{title}           = $getbibinfo->{'title'};
426
            $getreserv{subtitle}        = GetRecordValue('subtitle', GetMarcBiblio($num_res->{biblionumber}), GetFrameworkCode($num_res->{biblionumber}));
427
            $getreserv{nottransfered}   = 0;
428
            $getreserv{itemtype}        = $itemtypeinfo->{'description'};
429
            $getreserv{author}          = $getbibinfo->{'author'};
430
            $getreserv{biblionumber}    = $num_res->{'biblionumber'};
431
        }
432
        $getreserv{waitingposition} = $num_res->{'priority'};
433
        $getreserv{expirationdate} = $num_res->{'expirationdate'};
434
        push( @reservloop, \%getreserv );
435
436
#         if we have a reserve waiting, initiate waitingreserveloop
437
        if ($getreserv{waiting} == 1) {
438
        push (@WaitingReserveLoop, \%getWaitingReserveInfo)
439
        }
440
      
441
    }
442
443
    # return result to the template
444
    $template->param( 
445
        countreserv => scalar @reservloop,
446
        reservloop  => \@reservloop ,
447
        WaitingReserveLoop  => \@WaitingReserveLoop,
448
    );
449
    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
368
    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
450
}
369
}
451
370
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js (+131 lines)
Line 0 Link Here
1
$(document).ready(function() {
2
    // Don't load holds table unless it is clicked on
3
    var holdsTable;
4
    $("#holds-tab").click( function() {
5
        if ( ! holdsTable ) {
6
            holdsTable = $("#holds-table").dataTable({
7
                "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
8
                "aoColumns": [
9
                    {
10
                        "mDataProp": "reservedate_formatted"
11
                    },
12
                    {
13
                        "mDataProp": function ( oObj ) {
14
                            title = "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
15
                                  + oObj.biblionumber
16
                                  + "'>"
17
                                  + oObj.title;
18
19
                            $.each(oObj.subtitle, function( index, value ) {
20
                                      title += " " + value.subfield;
21
                            });
22
23
                            title += "</a>";
24
25
                            if ( oObj.author ) {
26
                                title += " " + _("by") + " " + oObj.author;
27
                            }
28
29
                            if ( oObj.itemnotes ) {
30
                                var span_class = "";
31
                                if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
32
                                    span_class = "circ-hlt";
33
                                }
34
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
35
                            }
36
37
                            title += " "
38
                                  + "<a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber="
39
                                  + oObj.biblionumber
40
                                  + "&itemnumber="
41
                                  + oObj.itemnumber
42
                                  + "#"
43
                                  + oObj.itemnumber
44
                                  + "'>"
45
                                  + oObj.barcode
46
                                  + "</a>";
47
48
                            return title;
49
                        }
50
                    },
51
                    {
52
                        "mDataProp": function( oObj ) {
53
                            return oObj.itemcallnumber || "";
54
                        }
55
                    },
56
                    {
57
                        "mDataProp": function( oObj ) {
58
                            var data = "";
59
60
                            if ( oObj.suspend == 1 ) {
61
                                data += "<p>" + _("Hold is") + " <strong> " + _("suspended") + " </strong>";
62
                                if ( oObj.suspend_until ) {
63
                                    data += " " + _("until") + " " + oObj.suspend_until_formatted;
64
                                }
65
                                data += "</p>";
66
                            }
67
68
                            if ( oObj.barcode ) {
69
                                data += "<em>";
70
                                if ( oObj.found == "W" ) {
71
                                    data += _("Item is") + " <strong> " + _("waiting") + " </strong>";
72
73
                                    if ( ! oObj.waiting_here ) {
74
                                        data += " " + _("at") + " " + oObj.waiting_at;
75
                                    }
76
                                } else if ( oObj.transferred ) {
77
                                    data += _("Item is") + " <strong> " + _("in transit") + " </strong> " + _("from") + oObj.from_branch;
78
                                } else if ( oObj.not_transferred ) {
79
                                    data += _("Item hasn't been transferred yet from") + " " + oObj.not_transferred_by;
80
                                }                                 data += "</em>";
81
82
                                data += " <a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
83
                                     + oObj.biblionumber + "'>" + oObj.barcode + "</a>";
84
                            }
85
86
                            return data;
87
                        }
88
                    },
89
                    { "mDataProp": "expirationdate_formatted" },
90
                    {
91
                        "mDataProp": function( oObj ) {
92
                            if ( oObj.priority && parseInt( oObj.priority ) && parseInt( oObj.priority ) > 0 ) {
93
                                return oObj.priority;
94
                            } else {
95
                                return "";
96
                            }
97
                        }
98
                    },
99
                    {
100
                        "mDataProp": function( oObj ) {
101
                            return "<select name='rank-request'>"
102
                                 + "<option value='n'>" + _("No") + "</option>"
103
                                 + "<option value='del'>" + _("Yes") + "</option>"
104
                                 + "</select>"
105
                                 + "<input type='hidden' name='biblionumber' value='" + oObj.biblionumber + "'>"
106
                                 + "<input type='hidden' name='borrowernumber' value='" + borrowernumber + "'>"
107
                                 + "<input type='hidden' name='reserve_id' value='" + oObj.reserve_id + "'>";
108
                        }
109
                    }
110
                ],
111
                "bPaginate": false,
112
                "bProcessing": true,
113
                "bServerSide": true,
114
                "sAjaxSource": '/cgi-bin/koha/api/holds.pl',
115
                "fnServerData": function ( sSource, aoData, fnCallback ) {
116
                    aoData.push( { "name": "borrowernumber", "value": borrowernumber } );
117
118
                    $.getJSON( sSource, aoData, function (json) {
119
                        fnCallback(json)
120
                    } );
121
                },
122
            });
123
124
            $("#holds-table_processing").position({
125
                of: $( "#holds-table" ),
126
                collision: "none"
127
            });
128
        }
129
    });
130
131
});
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-47 / +23 lines)
Lines 22-27 Link Here
22
[% INCLUDE 'timepicker.inc' %]
22
[% INCLUDE 'timepicker.inc' %]
23
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
23
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
24
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
24
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
25
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
25
<script type="text/javascript">
26
<script type="text/javascript">
26
//<![CDATA[
27
//<![CDATA[
27
/* Set some variable needed in circulation.js */
28
/* Set some variable needed in circulation.js */
Lines 657-666 No patron matched <span class="ex">[% message %]</span> Link Here
657
    [% END %]
658
    [% END %]
658
659
659
    <li>
660
    <li>
660
        [% IF ( countreserv ) %]
661
        [% IF ( holds_count ) %]
661
            <a href="#reserves">[% countreserv %] Hold(s)</a>
662
            <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a>
662
        [% ELSE %]
663
        [% ELSE %]
663
            <a href="#reserves">0 Holds</a>
664
            <a href="#reserves" id="holds-tab">0 Holds</a>
664
        [% END %]
665
        [% END %]
665
    </li>
666
    </li>
666
667
Lines 727-777 No patron matched <span class="ex">[% message %]</span> Link Here
727
[% INCLUDE borrower_debarments.inc %]
728
[% INCLUDE borrower_debarments.inc %]
728
729
729
<div id="reserves">
730
<div id="reserves">
730
[% IF ( reservloop ) %]
731
[% IF ( holds_count ) %]
731
    <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
732
    <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
732
	<input type="hidden" name="from" value="circ" />
733
        <input type="hidden" name="from" value="circ" />
733
    <table id="holdst">
734
        <table id="holds-table" style="width: 100% !Important;">
734
        <thead><tr>
735
            <thead>
735
            <th>Hold date</th>
736
                <tr>
736
            <th>Title</th>
737
                    <th>Hold date</th>
737
            <th>Call number</th>
738
                    <th>Title</th>
738
            <th>Barcode</th>
739
                    <th>Call number</th>
739
            <th>Expiration</th>
740
                    <th>Barcode</th>
740
            <th>Priority</th>
741
                    <th>Expiration</th>
741
            <th>Delete?</th>
742
                    <th>Priority</th>
742
            <th>&nbsp;</th>
743
                    <th>Delete?</th>
743
        </tr></thead>
744
                </tr>
744
		<tbody>
745
            </thead>
745
        [% FOREACH reservloo IN reservloop %]
746
        </table>
746
        <tr class="[% reservloo.color %]">
747
747
                    <td>[% reservloo.reservedate %]</td>
748
        <fieldset class="action">
748
                    <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %][% FOREACH subtitl IN reservloo.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
749
            <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
749
                    <td>[% reservloo.itemcallnumber %]</td>
750
        </fieldset>
750
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
751
                        [% END %][% IF ( reservloo.waiting ) %] <strong>waiting at [% reservloo.waitingat %]</strong>
752
                        [% END %]
753
                        [% IF ( reservloo.transfered ) %] <strong>in transit</strong> from
754
                        [% reservloo.frombranch %] since [% reservloo.datesent %]
755
                        [% END %]
756
                        [% IF ( reservloo.nottransfered ) %] hasn't been transferred yet from [% reservloo.nottransferedby %]</i>
757
                        [% END %]</em></td>
758
                    <td>[% reservloo.expirationdate | $KohaDates %]</td>
759
                    <td>
760
                        [% IF ( reservloo.waitingposition ) %]<b> [% reservloo.waitingposition %] </b>[% END %]
761
                    </td>
762
				<td><select name="rank-request">
763
                    <option value="n">No</option>
764
                    <option value="del">Yes</option>
765
                </select>
766
                <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
767
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
768
                <input type="hidden" name="reserve_id" value="[% reservloo.reserve_id %]" />
769
            </td>
770
            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
771
            </tr>
772
        [% END %]</tbody>
773
    </table>
774
            <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel marked holds" /></fieldset>
775
    </form>
751
    </form>
776
752
777
    [% IF SuspendHoldsIntranet %]
753
    [% IF SuspendHoldsIntranet %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-55 / +24 lines)
Lines 15-20 Link Here
15
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
15
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
16
[% INCLUDE 'timepicker.inc' %]
16
[% INCLUDE 'timepicker.inc' %]
17
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
17
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
18
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
18
<script type="text/JavaScript">
19
<script type="text/JavaScript">
19
//<![CDATA[
20
//<![CDATA[
20
/* Set some variable needed in circulation.js */
21
/* Set some variable needed in circulation.js */
Lines 391-400 function validate1(date) { Link Here
391
        [% END %]
392
        [% END %]
392
        <li><a href="#finesandcharges">Fines &amp; Charges</a></li>
393
        <li><a href="#finesandcharges">Fines &amp; Charges</a></li>
393
        <li>
394
        <li>
394
            [% IF ( countreserv ) %]
395
            [% IF ( holds_count ) %]
395
                <a href="#onhold">[% countreserv %] Hold(s)</a>
396
                <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a>
396
            [% ELSE %]
397
            [% ELSE %]
397
                <a href="#onhold">0 Holds</a>
398
                <a href="#reserves" id="holds-tab">0 Holds</a>
398
            [% END %]
399
            [% END %]
399
        </li>
400
        </li>
400
        <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
401
        <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
Lines 490-548 function validate1(date) { Link Here
490
491
491
[% INCLUDE borrower_debarments.inc %]
492
[% INCLUDE borrower_debarments.inc %]
492
493
493
<div id="onhold">
494
<div id="reserves">
494
[% IF ( reservloop ) %]
495
[% IF ( holds_count ) %]
495
<form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
496
    <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
496
	<input type="hidden" name="from" value="borrower" />
497
        <input type="hidden" name="from" value="circ" />
497
	<table id="holdst">
498
        <table id="holds-table" style="width: 100% !Important;">
498
		<thead><tr>
499
            <thead>
499
			<th>Hold date</th>
500
                <tr>
500
			<th>Title</th>
501
                    <th>Hold date</th>
501
            <th>Call number</th>
502
                    <th>Title</th>
502
			<th>Barcode</th>
503
                    <th>Call number</th>
503
            <th>Expiration</th>
504
                    <th>Barcode</th>
504
			<th>Priority</th>
505
                    <th>Expiration</th>
505
			<th>Delete?</th>
506
                    <th>Priority</th>
506
			<th>&nbsp;</th>
507
                    <th>Delete?</th>
507
		</tr></thead>
508
                </tr>
508
		<tbody>[% FOREACH reservloo IN reservloop %]
509
            </thead>
509
		<tr class="[% reservloo.color %]">
510
        </table>
510
            <td><span title="[% reservloo.reservedate %]">[% reservloo.reservedate | $KohaDates %]</span></td>
511
            <td>
512
                <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]">[% reservloo.title |html %][% FOREACH subtitl IN reservloo.subtitle %] [% subtitl.subfield %][% END %]</a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]
513
            </td>
514
            <td>[% reservloo.itemcallnumber %]</td>
515
            <td>[% IF ( reservloo.waiting ) %]
516
                <em>Item is <strong>waiting</strong></em>
517
                [% END %]
518
                [% IF ( reservloo.transfered ) %]
519
                <em>Item <strong>in transit</strong> from
520
                [% reservloo.frombranch %] since [% reservloo.datesent %] </em>
521
                [% END %]
522
511
523
                [% IF ( reservloo.nottransfered ) %]
512
        <fieldset class="action">
524
                <em>Item hasn't been transferred yet from [% reservloo.nottransferedby %]</em>
513
            <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
525
                [% END %]
514
        </fieldset>
526
                [% IF ( reservloo.barcodereserv ) %]
527
                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reservloo.biblionumber %]">[% reservloo.barcodereserv %]</a>
528
                [% END %]
529
            </td>
530
            <td>[% reservloo.expirationdate | $KohaDates %]</td>
531
            <td>[% IF ( reservloo.waitingposition ) %]<strong>[% reservloo.waitingposition %]</strong>[% END %]</td>
532
            <td><select name="rank-request">
533
                    <option value="n">No</option>
534
                    <option value="del">Yes</option>
535
                </select>
536
                <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
537
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
538
                <input type="hidden" name="reserve_id" value="[% reservloo.reserve_id %]" />
539
            </td>
540
            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
541
        </tr>
542
		[% END %]</tbody>
543
    </table>
544
545
        <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel marked holds" /></fieldset>
546
    </form>
515
    </form>
547
516
548
    [% IF SuspendHoldsIntranet %]
517
    [% IF SuspendHoldsIntranet %]
(-)a/members/moremember.pl (-72 / +3 lines)
Lines 246-322 my $totalprice = 0; Link Here
246
# BUILD HTML
246
# BUILD HTML
247
# show all reserves of this borrower, and the position of the reservation ....
247
# show all reserves of this borrower, and the position of the reservation ....
248
if ($borrowernumber) {
248
if ($borrowernumber) {
249
249
    $template->param(
250
    # new op dev
250
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
251
    # now we show the status of the borrower's reservations
251
          ->count( { borrowernumber => $borrowernumber } ) );
252
    my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber );
253
    my @reservloop;
254
    foreach my $num_res (@borrowerreserv) {
255
        my %getreserv;
256
        my $getiteminfo  = GetBiblioFromItemNumber( $num_res->{'itemnumber'} );
257
        my $itemtypeinfo = getitemtypeinfo( $getiteminfo->{'itemtype'} );
258
        my ( $transfertwhen, $transfertfrom, $transfertto ) =
259
            GetTransfers( $num_res->{'itemnumber'} );
260
261
        foreach (qw(waiting transfered nottransfered)) {
262
            $getreserv{$_} = 0;
263
        }
264
        $getreserv{reservedate}  = $num_res->{'reservedate'};
265
        foreach (qw(biblionumber title author itemcallnumber )) {
266
            $getreserv{$_} = $getiteminfo->{$_};
267
        }
268
        $getreserv{barcodereserv}  = $getiteminfo->{'barcode'};
269
        $getreserv{itemtype}  = $itemtypeinfo->{'description'};
270
271
        # 		check if we have a waitin status for reservations
272
        if ( $num_res->{'found'} eq 'W' ) {
273
            $getreserv{color}   = 'reserved';
274
            $getreserv{waiting} = 1;
275
        }
276
277
        # 		check transfers with the itemnumber foud in th reservation loop
278
        if ($transfertwhen) {
279
            $getreserv{color}      = 'transfered';
280
            $getreserv{transfered} = 1;
281
            $getreserv{datesent}   = C4::Dates->new($transfertwhen, 'iso')->output('syspref') or die "Cannot get new($transfertwhen, 'iso') from C4::Dates";
282
            $getreserv{frombranch} = GetBranchName($transfertfrom);
283
        }
284
285
        if ( ( $getiteminfo->{'holdingbranch'} ne $num_res->{'branchcode'} )
286
            and not $transfertwhen )
287
        {
288
            $getreserv{nottransfered}   = 1;
289
            $getreserv{nottransferedby} =
290
                GetBranchName( $getiteminfo->{'holdingbranch'} );
291
        }
292
        $getreserv{title}          = $getiteminfo->{'title'};
293
        $getreserv{subtitle}       = GetRecordValue('subtitle', GetMarcBiblio($getiteminfo->{biblionumber}), GetFrameworkCode($getiteminfo->{biblionumber}));
294
295
# 		if we don't have a reserv on item, we put the biblio infos and the waiting position
296
        if ( $getiteminfo->{'title'} eq '' ) {
297
            my $getbibinfo = GetBiblioData( $num_res->{'biblionumber'} );
298
            my $getbibtype = getitemtypeinfo( $getbibinfo->{'itemtype'} );
299
            $getreserv{color}           = 'inwait';
300
            $getreserv{title}           = $getbibinfo->{'title'};
301
            $getreserv{subtitle}        = GetRecordValue('subtitle', GetMarcBiblio($num_res->{biblionumber}), GetFrameworkCode($num_res->{biblionumber}));
302
            $getreserv{nottransfered}   = 0;
303
            $getreserv{itemtype}        = $getbibtype->{'description'};
304
            $getreserv{author}          = $getbibinfo->{'author'};
305
            $getreserv{biblionumber}  = $num_res->{'biblionumber'};	
306
        }
307
        $getreserv{waitingposition} = $num_res->{'priority'};
308
        $getreserv{suspend} = $num_res->{'suspend'};
309
        $getreserv{suspend_until} = $num_res->{'suspend_until'};
310
        $getreserv{expirationdate} = $num_res->{'expirationdate'};
311
        $getreserv{reserve_id} = $num_res->{'reserve_id'};
312
313
        push( @reservloop, \%getreserv );
314
    }
315
316
    # return result to the template
317
    $template->param( reservloop => \@reservloop,
318
        countreserv => scalar @reservloop,
319
	 );
320
}
252
}
321
253
322
# current alert subscriptions
254
# current alert subscriptions
323
- 

Return to bug 11703