Bugzilla – Attachment 22163 Details for
Bug 5670
Housebound Readers Module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Added syspref for housebound previously issued items
Added-syspref-for-housebound-previously-issued-ite.patch (text/plain), 4.27 KB, created by
Martin Renvoize (ashimema)
on 2013-10-21 16:10:57 UTC
(
hide
)
Description:
Added syspref for housebound previously issued items
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2013-10-21 16:10:57 UTC
Size:
4.27 KB
patch
obsolete
>From 9b64445a16ff0b4319e1db87b77257af47996ad2 Mon Sep 17 00:00:00 2001 >From: Mark Gavillet <mark.gavillet@ptfs-europe.com> >Date: Tue, 14 Feb 2012 16:51:31 +0000 >Subject: [PATCH] Added syspref for housebound previously issued items > >Conflicts: > C4/Circulation.pm > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt > >http://bugs.koha-community.org/show_bug.cgi?id=5670 >--- > C4/Circulation.pm | 19 ++++++++++++++ > C4/Housebound.pm | 26 ++++++++++++++++++++ > .../data/mysql/atomicupdate/housebound_tables.sql | 4 +++ > .../prog/en/modules/circ/circulation.tt | 4 +++ > 4 files changed, 53 insertions(+) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d74b97f..de5463b 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -57,6 +57,13 @@ use Date::Calc qw( > Day_of_Week > Add_Delta_Days > ); >+use POSIX qw(strftime); >+use C4::Branch; # GetBranches >+use C4::Log; # logaction >+ >+use C4::Housebound; >+use Data::Dumper; >+ > use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); > > BEGIN { >@@ -839,6 +846,18 @@ sub CanBookBeIssued { > } > } > >+# If Housebound patron and useHouseboundCheckPrev syspref is ON check for previous issue of item to patron >+ if ( C4::Context->preference('useHouseboundCheckPrevious') == 1 >+ && $borrower->{categorycode} eq 'HB' ) >+ { >+ #$template->param(testhbpref => 'switchedon'); >+ my $HBprevissue = >+ CheckPrevIssue( $borrower->{borrowernumber}, $item->{biblionumber} ); >+ if ( $HBprevissue == 1 ) { >+ $needsconfirmation{HOUSEBOUNDPREVISSUE} = 1; >+ } >+ } >+ > # > # ITEM CHECKING > # >diff --git a/C4/Housebound.pm b/C4/Housebound.pm >index 0734b91..28906ce 100644 >--- a/C4/Housebound.pm >+++ b/C4/Housebound.pm >@@ -35,6 +35,7 @@ our @EXPORT = qw( > DeleteHouseboundInstanceDetails > GetVolunteerNameAndID > GetVolunteerList >+ CheckPrevIssue > ); > > =head1 NAME >@@ -234,6 +235,31 @@ sub DeleteHouseboundInstanceDetails { > return; > } > >+sub CheckPrevIssue { >+ my ($borrowernumber,$biblionumber) = @_; >+ my $dbh = C4::Context->dbh; >+ my $query; >+ my $item; >+ my $sth; >+ my $previssue=0; >+ $sth = $dbh->prepare("select itemnumber from items where biblionumber=?"); >+ $sth->execute($biblionumber); >+ while(my @row=$sth->fetchrow_array()) >+ { >+ $query = $dbh->prepare("select count(itemnumber) from old_issues where borrowernumber=? and itemnumber=?"); >+ $query->execute($borrowernumber,$row[0]); >+ while(my @matches=$query->fetchrow_array()) >+ { >+ if ($matches[0]>0) >+ { >+ $previssue=1; >+ } >+ } >+ } >+ $sth->finish; >+ return $previssue; >+} >+ > 1; > > __END__ >diff --git a/installer/data/mysql/atomicupdate/housebound_tables.sql b/installer/data/mysql/atomicupdate/housebound_tables.sql >index 9dfeb0a..41418b7 100644 >--- a/installer/data/mysql/atomicupdate/housebound_tables.sql >+++ b/installer/data/mysql/atomicupdate/housebound_tables.sql >@@ -30,5 +30,9 @@ CREATE TABLE IF NOT EXISTS `housebound_instance` ( > insert into systempreferences (variable,value,options,explanation,type) values > ('useHouseboundModule',1,'','If ON, use the Housebound module','YesNo'); > >+insert into systempreferences (variable,value,options,explanation,type) values >+('useHouseboundCheckPrevious',1,'','If ON, checks if Housebound patrons have previous issued items to be checked out', >+'YesNo'); >+ > insert into categories (categorycode, description, enrolmentperiod, upperagelimit, dateofbirthrequired, category_type) > values ('VOL','Housebound volunteer','99','999','1','A'); >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 2a9f6b1..7c191d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -247,6 +247,10 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); > [% IF HIGHHOLDS %] > <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li> > [% END %] >+ >+[% IF HOUSEBOUNDPREVISSUE %] >+ <li>Housebound patron has previously issued this item. Check out anyway?</li> >+[% END %] > </ul> > > [% IF HIGHHOLDS %] >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5670
:
3038
|
22162
|
22163
|
22164
|
22165
|
26816
|
27288
|
50930
|
51377
|
51875
|
54384
|
54385
|
55326
|
55334
|
55335
|
55336
|
55734
|
55735
|
55736
|
55737
|
55738
|
55739
|
55865
|
55866
|
55867
|
55890
|
55891
|
56298
|
56299
|
56300
|
56301
|
56302
|
56308
|
56337
|
56341
|
56346
|
56347
|
56348
|
56349
|
56350
|
56351
|
56352
|
56353
|
56354
|
56355
|
56356
|
56357
|
56358
|
56359
|
56360
|
56361
|
56362
|
56363
|
56364
|
56365
|
56366
|
56367
|
56368
|
56369
|
56580
|
56581
|
56582
|
56583
|
56584
|
56585
|
56586
|
56587
|
56588
|
56589
|
56590
|
56591
|
56592
|
56593
|
56594
|
56595
|
56596
|
56597
|
56598
|
56599
|
56600
|
56601
|
56602
|
56603
|
56604
|
56605
|
56606