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

(-)a/C4/Circulation.pm (+19 lines)
Lines 57-62 use Date::Calc qw( Link Here
57
  Day_of_Week
57
  Day_of_Week
58
  Add_Delta_Days
58
  Add_Delta_Days
59
);
59
);
60
use POSIX qw(strftime);
61
use C4::Branch; # GetBranches
62
use C4::Log; # logaction
63
64
use C4::Housebound;
65
use Data::Dumper;
66
60
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
67
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
61
68
62
BEGIN {
69
BEGIN {
Lines 839-844 sub CanBookBeIssued { Link Here
839
        }
846
        }
840
    }
847
    }
841
848
849
# If Housebound patron and useHouseboundCheckPrev syspref is ON check for previous issue of item to patron
850
    if ( C4::Context->preference('useHouseboundCheckPrevious') == 1
851
        && $borrower->{categorycode} eq 'HB' )
852
    {
853
        #$template->param(testhbpref => 'switchedon');
854
        my $HBprevissue =
855
          CheckPrevIssue( $borrower->{borrowernumber}, $item->{biblionumber} );
856
        if ( $HBprevissue == 1 ) {
857
            $needsconfirmation{HOUSEBOUNDPREVISSUE} = 1;
858
        }
859
    }
860
842
    #
861
    #
843
    # ITEM CHECKING
862
    # ITEM CHECKING
844
    #
863
    #
(-)a/C4/Housebound.pm (+26 lines)
Lines 35-40 our @EXPORT = qw( Link Here
35
  DeleteHouseboundInstanceDetails
35
  DeleteHouseboundInstanceDetails
36
  GetVolunteerNameAndID
36
  GetVolunteerNameAndID
37
  GetVolunteerList
37
  GetVolunteerList
38
  CheckPrevIssue
38
);
39
);
39
40
40
=head1 NAME
41
=head1 NAME
Lines 234-239 sub DeleteHouseboundInstanceDetails { Link Here
234
    return;
235
    return;
235
}
236
}
236
237
238
sub CheckPrevIssue {
239
	my ($borrowernumber,$biblionumber) = @_;
240
	my $dbh = C4::Context->dbh;
241
    my $query;
242
    my $item;
243
    my $sth;
244
    my $previssue=0;
245
    $sth = $dbh->prepare("select itemnumber from items where biblionumber=?");
246
    $sth->execute($biblionumber);
247
    while(my @row=$sth->fetchrow_array())
248
    {
249
	$query = $dbh->prepare("select count(itemnumber) from old_issues where borrowernumber=? and itemnumber=?");
250
	$query->execute($borrowernumber,$row[0]);
251
	while(my @matches=$query->fetchrow_array())
252
	{
253
		if ($matches[0]>0)
254
		{
255
			$previssue=1;
256
		}
257
	}
258
    }
259
    $sth->finish;
260
    return $previssue;
261
}
262
237
1;
263
1;
238
264
239
__END__
265
__END__
(-)a/installer/data/mysql/atomicupdate/housebound_tables.sql (+4 lines)
Lines 30-34 CREATE TABLE IF NOT EXISTS `housebound_instance` ( Link Here
30
insert into systempreferences (variable,value,options,explanation,type) values
30
insert into systempreferences (variable,value,options,explanation,type) values
31
('useHouseboundModule',1,'','If ON, use the Housebound module','YesNo');
31
('useHouseboundModule',1,'','If ON, use the Housebound module','YesNo');
32
32
33
insert into systempreferences (variable,value,options,explanation,type) values
34
('useHouseboundCheckPrevious',1,'','If ON, checks if Housebound patrons have previous issued items to be checked out',
35
'YesNo');
36
33
insert into categories (categorycode, description, enrolmentperiod, upperagelimit, dateofbirthrequired, category_type)
37
insert into categories (categorycode, description, enrolmentperiod, upperagelimit, dateofbirthrequired, category_type)
34
values ('VOL','Housebound volunteer','99','999','1','A');
38
values ('VOL','Housebound volunteer','99','999','1','A');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +4 lines)
Lines 247-252 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); Link Here
247
[% IF  HIGHHOLDS %]
247
[% IF  HIGHHOLDS %]
248
	<li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
248
	<li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
249
[% END %]
249
[% END %]
250
251
[% IF HOUSEBOUNDPREVISSUE %]
252
    <li>Housebound patron has previously issued this item.  Check out anyway?</li>
253
[% END %]
250
</ul>
254
</ul>
251
255
252
[% IF HIGHHOLDS %]
256
[% IF HIGHHOLDS %]
253
- 

Return to bug 5670