diff --git a/circ/circulation.pl b/circ/circulation.pl index 63d668eddc..e9a7a54363 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -35,6 +35,7 @@ use C4::Interface::CGI::Output; use C4::Koha; use HTML::Template; use C4::Date; +use Date::Manip; # # PARAMETERS READING @@ -123,6 +124,13 @@ my $borrower; if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); + warn $borrower->{'expiry'}; + my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifiyBorrowerDeparture')." days"); + my $warning=Date_Cmp(ParseDate("today"),$warningdate); + if ($warning>0){ + #borrowercard expired + $template->param(warndeparture=>$warning); + } $template->param(overduecount => $od, issuecount => $issue, finetotal => $fines); diff --git a/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl index 19f3e7e8d4..944275835c 100644 --- a/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl @@ -30,11 +30,12 @@
() +
()
" class="button circulation">
detail
&modify=edit&destination=circ" class="button circulation">edit
+
Borrower will leave soon
diff --git a/updater/updatedatabase b/updater/updatedatabase index fca9eec074..de4f380a23 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -924,6 +924,15 @@ my %tabledata = ( explanation => 'hide marc specific datas like subfield code & indicators to library', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'NotifiyBorrowerDeparture', + value => '0', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Delay before expiry where a notice is sent when issuing', + type => 'Integer', + }, ], ); @@ -1520,6 +1529,9 @@ $sth->finish; exit; # $Log$ +# Revision 1.100.2.13 2005/11/29 14:50:30 hdl +# Adding a notice before departure of a borrower +# # Revision 1.100.2.12 2005/10/25 12:36:21 tipaul # * adding a feature to enable reordering of subfields in MARC editor (can be considered as a bug ? at least one of my libraries think that yes !) # * as the MARC editor begins to be really heavy, i've also added a marc_hide systempref. It hides all marc features not requested by libraries that want MARC but not too much. It hides MARC tag & subfield code, reordering buttons as well as indicators. by default, hide_marc is off