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 21-26 Link Here
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
21
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
22
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
22
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
23
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
23
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
24
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
24
<script type="text/javascript">
25
<script type="text/javascript">
25
//<![CDATA[
26
//<![CDATA[
26
/* Set some variable needed in circulation.js */
27
/* Set some variable needed in circulation.js */
Lines 656-665 No patron matched <span class="ex">[% message %]</span> Link Here
656
    [% END %]
657
    [% END %]
657
658
658
    <li>
659
    <li>
659
        [% IF ( countreserv ) %]
660
        [% IF ( holds_count ) %]
660
            <a href="#reserves">[% countreserv %] Hold(s)</a>
661
            <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a>
661
        [% ELSE %]
662
        [% ELSE %]
662
            <a href="#reserves">0 Holds</a>
663
            <a href="#reserves" id="holds-tab">0 Holds</a>
663
        [% END %]
664
        [% END %]
664
    </li>
665
    </li>
665
666
Lines 726-776 No patron matched <span class="ex">[% message %]</span> Link Here
726
[% INCLUDE borrower_debarments.inc %]
727
[% INCLUDE borrower_debarments.inc %]
727
728
728
<div id="reserves">
729
<div id="reserves">
729
[% IF ( reservloop ) %]
730
[% IF ( holds_count ) %]
730
    <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
731
    <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
731
	<input type="hidden" name="from" value="circ" />
732
        <input type="hidden" name="from" value="circ" />
732
    <table id="holdst">
733
        <table id="holds-table" style="width: 100% !Important;">
733
        <thead><tr>
734
            <thead>
734
            <th>Hold date</th>
735
                <tr>
735
            <th>Title</th>
736
                    <th>Hold date</th>
736
            <th>Call number</th>
737
                    <th>Title</th>
737
            <th>Barcode</th>
738
                    <th>Call number</th>
738
            <th>Expiration</th>
739
                    <th>Barcode</th>
739
            <th>Priority</th>
740
                    <th>Expiration</th>
740
            <th>Delete?</th>
741
                    <th>Priority</th>
741
            <th>&nbsp;</th>
742
                    <th>Delete?</th>
742
        </tr></thead>
743
                </tr>
743
		<tbody>
744
            </thead>
744
        [% FOREACH reservloo IN reservloop %]
745
        </table>
745
        <tr class="[% reservloo.color %]">
746
746
                    <td>[% reservloo.reservedate %]</td>
747
        <fieldset class="action">
747
                    <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>
748
            <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
748
                    <td>[% reservloo.itemcallnumber %]</td>
749
        </fieldset>
749
					<td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
750
                        [% END %][% IF ( reservloo.waiting ) %] <strong>waiting at [% reservloo.waitingat %]</strong>
751
                        [% END %]
752
                        [% IF ( reservloo.transfered ) %] <strong>in transit</strong> from
753
                        [% reservloo.frombranch %] since [% reservloo.datesent %]
754
                        [% END %]
755
                        [% IF ( reservloo.nottransfered ) %] hasn't been transferred yet from [% reservloo.nottransferedby %]</i>
756
                        [% END %]</em></td>
757
                    <td>[% reservloo.expirationdate | $KohaDates %]</td>
758
                    <td>
759
                        [% IF ( reservloo.waitingposition ) %]<b> [% reservloo.waitingposition %] </b>[% END %]
760
                    </td>
761
				<td><select name="rank-request">
762
                    <option value="n">No</option>
763
                    <option value="del">Yes</option>
764
                </select>
765
                <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
766
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
767
                <input type="hidden" name="reserve_id" value="[% reservloo.reserve_id %]" />
768
            </td>
769
            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
770
            </tr>
771
        [% END %]</tbody>
772
    </table>
773
            <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel marked holds" /></fieldset>
774
    </form>
750
    </form>
775
751
776
    [% IF SuspendHoldsIntranet %]
752
    [% IF SuspendHoldsIntranet %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-55 / +24 lines)
Lines 16-21 Link Here
16
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
16
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
17
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
17
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
18
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
18
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
19
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
19
<script type="text/JavaScript">
20
<script type="text/JavaScript">
20
//<![CDATA[
21
//<![CDATA[
21
/* Set some variable needed in circulation.js */
22
/* Set some variable needed in circulation.js */
Lines 394-403 function validate1(date) { Link Here
394
        [% END %]
395
        [% END %]
395
        <li><a href="#finesandcharges">Fines &amp; Charges</a></li>
396
        <li><a href="#finesandcharges">Fines &amp; Charges</a></li>
396
        <li>
397
        <li>
397
            [% IF ( countreserv ) %]
398
            [% IF ( holds_count ) %]
398
                <a href="#onhold">[% countreserv %] Hold(s)</a>
399
                <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a>
399
            [% ELSE %]
400
            [% ELSE %]
400
                <a href="#onhold">0 Holds</a>
401
                <a href="#reserves" id="holds-tab">0 Holds</a>
401
            [% END %]
402
            [% END %]
402
        </li>
403
        </li>
403
        <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
404
        <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
Lines 493-551 function validate1(date) { Link Here
493
494
494
[% INCLUDE borrower_debarments.inc %]
495
[% INCLUDE borrower_debarments.inc %]
495
496
496
<div id="onhold">
497
<div id="reserves">
497
[% IF ( reservloop ) %]
498
[% IF ( holds_count ) %]
498
<form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
499
    <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
499
	<input type="hidden" name="from" value="borrower" />
500
        <input type="hidden" name="from" value="circ" />
500
	<table id="holdst">
501
        <table id="holds-table" style="width: 100% !Important;">
501
		<thead><tr>
502
            <thead>
502
			<th>Hold date</th>
503
                <tr>
503
			<th>Title</th>
504
                    <th>Hold date</th>
504
            <th>Call number</th>
505
                    <th>Title</th>
505
			<th>Barcode</th>
506
                    <th>Call number</th>
506
            <th>Expiration</th>
507
                    <th>Barcode</th>
507
			<th>Priority</th>
508
                    <th>Expiration</th>
508
			<th>Delete?</th>
509
                    <th>Priority</th>
509
			<th>&nbsp;</th>
510
                    <th>Delete?</th>
510
		</tr></thead>
511
                </tr>
511
		<tbody>[% FOREACH reservloo IN reservloop %]
512
            </thead>
512
		<tr class="[% reservloo.color %]">
513
        </table>
513
            <td><span title="[% reservloo.reservedate %]">[% reservloo.reservedate | $KohaDates %]</span></td>
514
            <td>
515
                <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 %]
516
            </td>
517
            <td>[% reservloo.itemcallnumber %]</td>
518
            <td>[% IF ( reservloo.waiting ) %]
519
                <em>Item is <strong>waiting</strong></em>
520
                [% END %]
521
                [% IF ( reservloo.transfered ) %]
522
                <em>Item <strong>in transit</strong> from
523
                [% reservloo.frombranch %] since [% reservloo.datesent %] </em>
524
                [% END %]
525
514
526
                [% IF ( reservloo.nottransfered ) %]
515
        <fieldset class="action">
527
                <em>Item hasn't been transferred yet from [% reservloo.nottransferedby %]</em>
516
            <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
528
                [% END %]
517
        </fieldset>
529
                [% IF ( reservloo.barcodereserv ) %]
530
                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reservloo.biblionumber %]">[% reservloo.barcodereserv %]</a>
531
                [% END %]
532
            </td>
533
            <td>[% reservloo.expirationdate | $KohaDates %]</td>
534
            <td>[% IF ( reservloo.waitingposition ) %]<strong>[% reservloo.waitingposition %]</strong>[% END %]</td>
535
            <td><select name="rank-request">
536
                    <option value="n">No</option>
537
                    <option value="del">Yes</option>
538
                </select>
539
                <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
540
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
541
                <input type="hidden" name="reserve_id" value="[% reservloo.reserve_id %]" />
542
            </td>
543
            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
544
        </tr>
545
		[% END %]</tbody>
546
    </table>
547
548
        <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel marked holds" /></fieldset>
549
    </form>
518
    </form>
550
519
551
    [% IF SuspendHoldsIntranet %]
520
    [% 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