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

(-)a/C4/Reserves.pm (-6 / +14 lines)
Lines 1054-1059 itemnumber and supplying itemnumber. Link Here
1054
sub ModReserve {
1054
sub ModReserve {
1055
    #subroutine to update a reserve
1055
    #subroutine to update a reserve
1056
    my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until) = @_;
1056
    my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until) = @_;
1057
    warn "ModReserve( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until)";
1057
     return if $rank eq "W";
1058
     return if $rank eq "W";
1058
     return if $rank eq "n";
1059
     return if $rank eq "n";
1059
    my $dbh = C4::Context->dbh;
1060
    my $dbh = C4::Context->dbh;
Lines 1517-1536 be cleared when it is unsuspended. Link Here
1517
=cut
1518
=cut
1518
1519
1519
sub ToggleSuspend {
1520
sub ToggleSuspend {
1520
    my ( $borrowernumber, $biblionumber ) = @_;
1521
    my ( $borrowernumber, $biblionumber, $suspend_until ) = @_;
1522
1523
    $suspend_until = C4::Dates->new( $suspend_until )->output('iso') if ( $suspend_until );
1524
1525
    my $do_until = ( $suspend_until ) ? '?' : 'NULL';
1521
1526
1522
    my $dbh = C4::Context->dbh;
1527
    my $dbh = C4::Context->dbh;
1523
1528
1524
    my $sth = $dbh->prepare(
1529
    my $sth = $dbh->prepare(
1525
        "UPDATE reserves SET suspend = NOT suspend,
1530
        "UPDATE reserves SET suspend = NOT suspend,
1526
        suspend_until = CASE WHEN suspend = 0 THEN NULL ELSE suspend_until END
1531
        suspend_until = CASE WHEN suspend = 0 THEN NULL ELSE $do_until END
1527
        WHERE biblionumber = ?
1532
        WHERE biblionumber = ?
1528
        AND borrowernumber = ?
1533
        AND borrowernumber = ?
1529
    ");
1534
    ");
1530
    $sth->execute(
1535
1531
        $biblionumber,
1536
    my @params;
1532
        $borrowernumber,
1537
    push( @params, $suspend_until ) if ( $suspend_until );
1533
    );
1538
    push( @params, $biblionumber );
1539
    push( @params, $borrowernumber );
1540
1541
    $sth->execute( @params );
1534
    $sth->finish;
1542
    $sth->finish;
1535
}
1543
}
1536
1544
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Circulation [% IF ( borrowernumber ) %] &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' %] [% END %]</title>
3
<title>Koha &rsaquo; Circulation [% IF ( borrowernumber ) %] &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' %] [% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Patrons &rsaquo;
3
<title>Koha &rsaquo; Patrons &rsaquo;
3
[% IF ( unknowuser ) %]
4
[% IF ( unknowuser ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-2 / +3 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% UNLESS ( multi_hold ) %]
3
[% UNLESS ( multi_hold ) %]
3
    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Place a hold on [% title |html %]</title>
4
    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Place a hold on [% title |html %]</title>
Lines 731-741 function checkMultiHold() { Link Here
731
732
732
	<td>
733
	<td>
733
	[% UNLESS ( reserveloo.wait ) %]
734
	[% UNLESS ( reserveloo.wait ) %]
734
            <input type="button" value="[% IF ( reserveloo.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;date=[% reserveloo.date %]'" />
735
            <input type="button" value="[% IF ( reserveloo.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;date=[% reserveloo.date %]&amp;suspend_until=' + $('#suspend_until_[% reserveloo.borrowernumber %]').val()" />
735
736
736
            [% IF AutoResumeSuspendedHolds %]
737
            [% IF AutoResumeSuspendedHolds %]
737
	    <label for="suspend_until_[% reserveloo.borrowernumber %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label>
738
	    <label for="suspend_until_[% reserveloo.borrowernumber %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label>
738
	    <input name="suspend_until" id="suspend_until_[% reserveloo.borrowernumber %]" size="10" readonly="readonly" value="[% reserveloo.suspend_until %]" />
739
	    <input name="suspend_until" id="suspend_until_[% reserveloo.borrowernumber %]" size="10" readonly="readonly" value="[% reserveloo.suspend_until | $KohaDates %]" />
739
        <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show calendar" border="0" id="SuspendUntilDate_[% reserveloo.borrowernumber %]" style="cursor: pointer;" />
740
        <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show calendar" border="0" id="SuspendUntilDate_[% reserveloo.borrowernumber %]" style="cursor: pointer;" />
740
	    <script language="JavaScript" type="text/javascript">
741
	    <script language="JavaScript" type="text/javascript">
741
		//<![CDATA[
742
		//<![CDATA[
(-)a/reserve/request.pl (-3 / +3 lines)
Lines 113-119 if ( $action eq 'move' ) { Link Here
113
} elsif ( $action eq 'toggleSuspend' ) {
113
} elsif ( $action eq 'toggleSuspend' ) {
114
  my $borrowernumber = $input->param('borrowernumber');
114
  my $borrowernumber = $input->param('borrowernumber');
115
  my $biblionumber   = $input->param('biblionumber');
115
  my $biblionumber   = $input->param('biblionumber');
116
  ToggleSuspend( $borrowernumber, $biblionumber );
116
  my $suspend_until  = $input->param('suspend_until');
117
  ToggleSuspend( $borrowernumber, $biblionumber, $suspend_until );
117
}
118
}
118
119
119
if ($findborrower) {
120
if ($findborrower) {
Lines 573-579 foreach my $biblionumber (@biblionumbers) { Link Here
573
        $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'});
574
        $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'});
574
        $reserve{'optionloop'} = \@optionloop;
575
        $reserve{'optionloop'} = \@optionloop;
575
        $reserve{'suspend'} = $res->{'suspend'};
576
        $reserve{'suspend'} = $res->{'suspend'};
576
        $reserve{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref");
577
        $reserve{'suspend_until'} = $res->{'suspend_until'};
577
        push( @reserveloop, \%reserve );
578
        push( @reserveloop, \%reserve );
578
    }
579
    }
579
580
580
- 

Return to bug 7641