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

(-)a/circ/waitingreserves.pl (-15 / +17 lines)
Lines 26-31 use C4::Branch; # GetBranchName Link Here
26
use C4::Auth;
26
use C4::Auth;
27
use C4::Dates qw/format_date/;
27
use C4::Dates qw/format_date/;
28
use C4::Circulation;
28
use C4::Circulation;
29
use C4::Reserves; # qw/GetMaxPickUpDelay/;
29
use C4::Members;
30
use C4::Members;
30
use C4::Biblio;
31
use C4::Biblio;
31
use C4::Items;
32
use C4::Items;
Lines 112-125 foreach my $num (@getreserves) { Link Here
112
    $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'};
113
    $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'};
113
    my $getborrower  = GetMemberDetails( $num->{'borrowernumber'} );
114
    my $getborrower  = GetMemberDetails( $num->{'borrowernumber'} );
114
    my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
115
    my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
115
    $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} );
116
    if ($num->{waitingdate}){
117
	my @maxpickupdate=GetMaxPickupDate($num->{'waitingdate'},$borrowernumber, $num);
118
	$getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} );
116
119
117
    my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'});
120
	$getreserv{'maxpickupdate'} = sprintf("%d-%02d-%02d", @maxpickupdate);
118
    ( $waiting_year, $waiting_month, $waiting_day ) =
119
      Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day,
120
        C4::Context->preference('ReservesMaxPickUpDelay'));
121
    my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day );
122
121
122
	my $calcDate = Date_to_Days( @maxpickupdate );
123
124
        if ( $today > $calcDate ) {
125
            $getreserv{'messcompa'} = 1;
126
            push @overloop, \%getreserv;
127
            $overcount++;
128
        } else {
129
            push @reservloop, \%getreserv;
130
            $reservcount++;
131
        }
132
    }
123
    $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
133
    $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
124
    $getreserv{'title'}          = $gettitle->{'title'};
134
    $getreserv{'title'}          = $gettitle->{'title'};
125
    $getreserv{'itemnumber'}     = $gettitle->{'itemnumber'};
135
    $getreserv{'itemnumber'}     = $gettitle->{'itemnumber'};
Lines 128-133 foreach my $num (@getreserves) { Link Here
128
    $getreserv{'homebranch'}     = GetBranchName($gettitle->{'homebranch'});
138
    $getreserv{'homebranch'}     = GetBranchName($gettitle->{'homebranch'});
129
    $getreserv{'holdingbranch'}  = $gettitle->{'holdingbranch'};
139
    $getreserv{'holdingbranch'}  = $gettitle->{'holdingbranch'};
130
    $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'};
140
    $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'};
141
131
    if ( $gettitle->{'homebranch'} ne $gettitle->{'holdingbranch'} ) {
142
    if ( $gettitle->{'homebranch'} ne $gettitle->{'holdingbranch'} ) {
132
        $getreserv{'dotransfer'} = 1;
143
        $getreserv{'dotransfer'} = 1;
133
    }
144
    }
Lines 138-152 foreach my $num (@getreserves) { Link Here
138
    if ( $getborrower->{'emailaddress'} ) {
149
    if ( $getborrower->{'emailaddress'} ) {
139
        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
150
        $getreserv{'borrowermail'}  = $getborrower->{'emailaddress'};
140
    }
151
    }
141
 
142
    if ($today > $calcDate) {
143
        push @overloop,   \%getreserv;
144
        $overcount++;
145
    }else{
146
        push @reservloop, \%getreserv;
147
        $reservcount++;
148
    }
149
    
150
}
152
}
151
153
152
$template->param(
154
$template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc (-1 / +44 lines)
Line 0 Link Here
0
- 
1
<!-- TMPL_IF NAME="reserves_waiting" -->
2
<!-- TMPL_LOOP NAME="reserves_waiting" -->
3
	<div class="dialog message" id="reserve<!-- TMPL_VAR NAME="biblionumber" -->">
4
	  <h3>Hold Found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" escape="html" --></a></h3>
5
        <!-- TMPL_IF NAME="reservenotes" --><h4>Notes: <!-- TMPL_VAR Name="reservenotes" --></h4><!-- /TMPL_IF -->
6
        <h5>Hold for:</h5>
7
		<ul>
8
            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">
9
                <!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR Name="borfirstname" -->
10
            </a> (<!-- TMPL_VAR Name="borcnum" -->)</li>
11
            <li><!-- TMPL_VAR Name="boraddress" --><br />
12
			<!-- TMPL_IF NAME="boraddress2" --><!-- TMPL_VAR NAME="boraddress2" --><br /><!-- /TMPL_IF -->
13
			<!-- TMPL_VAR Name="borcity" --> <!-- TMPL_VAR NAME="borzip" --></li>
14
            <!-- TMPL_IF NAME="borphone" --><li><!-- TMPL_VAR Name="borphone" --></li><!-- /TMPL_IF -->
15
            <!-- TMPL_IF NAME="boremail" --><li><!-- TMPL_IF name="transfertodo" --><!-- TMPL_VAR NAME="boremail" --><!-- TMPL_ELSE --><a id="boremail" href="mailto:<!-- TMPL_VAR NAME="boremail" -->"><!-- TMPL_VAR NAME="boremail" --></a><!-- /TMPL_IF --></li><!-- /TMPL_IF -->
16
<!-- TMPL_IF NAME="debarred" --><li class="error">Patron is RESTRICTED</li><!-- /TMPL_IF -->
17
<!-- TMPL_IF NAME="gonenoaddress" --><li class="error">Patron's address is in doubt</li><!-- /TMPL_IF -->
18
        </ul>
19
        <!-- TMPL_IF name="transfertodo" -->
20
            <h4><strong>Transfer to:</strong> <!-- TMPL_VAR Name="destbranchname" --></h4>
21
		<!-- TMPL_ELSE -->
22
		<h4><strong>Hold at</strong> <!-- TMPL_VAR Name="destbranchname" --></h4>
23
        <!-- /TMPL_IF -->
24
        <form method="post" action="<!-- TMPL_VAR NAME="script_name" -->" class="confirm">
25
            <!-- TMPL_IF name="transfertodo" -->
26
		<input type="submit" class="approve" value="Confirm hold and Transfer" />
27
                <input type="submit" value="Print slip, Transfer, and Confirm" class="print" onclick="Dopop('../circ/hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;op=slip'); $('#reserve<!-- TMPL_VAR NAME="biblionumber" -->').hide(); return false;" />
28
            <!-- TMPL_ELSE -->
29
		<input type="submit" class="approve" value="Confirm hold" />
30
                <input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('../circ/hold-transfer-slip.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;op=slip'); $('#reserve<!-- TMPL_VAR NAME="biblionumber" -->').hide(); return false;" />
31
            <!-- /TMPL_IF -->
32
            <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
33
            <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR Name="circborrowernumber" -->" />
34
            <input type="hidden" name="resbarcode" value="<!-- TMPL_VAR Name="barcode" -->" />
35
            <input type="hidden" name="reservenumber" value="<!-- TMPL_VAR Name="reservenumber" -->" />
36
            <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR Name="destbranch" -->" />
37
            <input type="hidden" name="exemptfine" value="<!-- TMPL_VAR Name="exemptfine" -->" />
38
            <input type="hidden" name="dropboxmode" value="<!-- TMPL_VAR Name="dropboxmode" -->" />
39
        </form>
40
	</div>
41
<!--/TMPL_LOOP -->
42
<!-- /TMPL_IF -->
43
44

Return to bug 5875