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

(-)a/C4/Reserves.pm (-6 / +16 lines)
Lines 36-41 use C4::Members qw(); Link Here
36
use C4::Letters;
36
use C4::Letters;
37
use C4::Branch qw( GetBranchDetail );
37
use C4::Branch qw( GetBranchDetail );
38
use C4::Dates qw( format_date_in_iso );
38
use C4::Dates qw( format_date_in_iso );
39
40
use Koha::DateUtils;
41
39
use List::MoreUtils qw( firstidx );
42
use List::MoreUtils qw( firstidx );
40
43
41
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
44
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
Lines 1517-1536 be cleared when it is unsuspended. Link Here
1517
=cut
1520
=cut
1518
1521
1519
sub ToggleSuspend {
1522
sub ToggleSuspend {
1520
    my ( $borrowernumber, $biblionumber ) = @_;
1523
    my ( $borrowernumber, $biblionumber, $suspend_until ) = @_;
1524
1525
    $suspend_until = output_pref( dt_from_string( $suspend_until ), 'iso' ) if ( $suspend_until );
1526
1527
    my $do_until = ( $suspend_until ) ? '?' : 'NULL';
1521
1528
1522
    my $dbh = C4::Context->dbh;
1529
    my $dbh = C4::Context->dbh;
1523
1530
1524
    my $sth = $dbh->prepare(
1531
    my $sth = $dbh->prepare(
1525
        "UPDATE reserves SET suspend = NOT suspend,
1532
        "UPDATE reserves SET suspend = NOT suspend,
1526
        suspend_until = CASE WHEN suspend = 0 THEN NULL ELSE suspend_until END
1533
        suspend_until = CASE WHEN suspend = 0 THEN NULL ELSE $do_until END
1527
        WHERE biblionumber = ?
1534
        WHERE biblionumber = ?
1528
        AND borrowernumber = ?
1535
        AND borrowernumber = ?
1529
    ");
1536
    ");
1530
    $sth->execute(
1537
1531
        $biblionumber,
1538
    my @params;
1532
        $borrowernumber,
1539
    push( @params, $suspend_until ) if ( $suspend_until );
1533
    );
1540
    push( @params, $biblionumber );
1541
    push( @params, $borrowernumber );
1542
1543
    $sth->execute( @params );
1534
    $sth->finish;
1544
    $sth->finish;
1535
}
1545
}
1536
1546
(-)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