Bugzilla – Attachment 11871 Details for
Bug 8694
Show accurate subscription renewal warning for expired subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8694 - Show accurate subscription renewal warning for expired subscriptions
Bug-8694---Show-accurate-subscription-renewal-warn.patch (text/plain), 3.22 KB, created by
Owen Leonard
on 2012-08-28 15:06:08 UTC
(
hide
)
Description:
Bug 8694 - Show accurate subscription renewal warning for expired subscriptions
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-08-28 15:06:08 UTC
Size:
3.22 KB
patch
obsolete
>From faca33f61c8c1753a1a6e62a26b84c63e1a730b8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 28 Aug 2012 11:01:22 -0400 >Subject: [PATCH] Bug 8694 - Show accurate subscription renewal warning for > expired subscriptions >Content-Type: text/plain; charset="utf-8" > >This patch adds a check of the subscription end date when >displaying the "about to expire" message, substituting a >"already expired" warning in its place if the expiration >date is in the past. > >To test, view a subscription which is about to expire >and a subscription which has already expired. You should >see two different versions of the message. >--- > .../prog/en/modules/serials/subscription-detail.tt | 8 +++++++- > serials/subscription-detail.pl | 7 ++++++- > 2 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index 1afd0c1..d67a246 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -56,7 +56,13 @@ $(document).ready(function() { > [% INCLUDE 'serials-toolbar.inc' %] > > <h1>Subscription for [% bibliotitle %] </h1> >- [% IF ( abouttoexpire ) %]<div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>[% END %] >+ [% IF ( abouttoexpire ) %] >+ [% IF ( expired ) %] >+ <div class="dialog alert">Subscription expired on [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div> >+ [% ELSE %] >+ <div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div> >+ [% END %] >+ [% END %] > [% IF ( NEEDSCONFIRMATION ) %] > <div id="circ_needsconfirmation" class="dialog alert"> > <h3>Please Confirm Subscription deletion</h3> >diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl >index ae85c51..9dfcc1e 100755 >--- a/serials/subscription-detail.pl >+++ b/serials/subscription-detail.pl >@@ -25,7 +25,7 @@ use C4::Serials; > use C4::Output; > use C4::Context; > use C4::Search qw/enabled_staff_search_views/; >-use Date::Calc qw/Today Day_of_Year Week_of_Year Add_Delta_Days/; >+use Date::Calc qw/Today Day_of_Year Week_of_Year Add_Delta_Days Delta_Days/; > use Carp; > > my $query = new CGI; >@@ -99,10 +99,15 @@ my $hasRouting = check_routing($subscriptionid); > = checkauth($query, 0, {catalogue => 1}, "intranet"); > > # COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ? >+my $today = C4::Dates->today("iso"); >+my $expirationdiff = Delta_Days(split(/-/,"$subs->{enddate}"),split (/-/,$today)) ; >+ >+if($expirationdiff >= 0){ $subs->{expired} = 1; } > > for my $date qw(startdate enddate firstacquidate histstartdate histenddate){ > $$subs{$date} = format_date($$subs{$date}) if $date && $$subs{$date}; > } >+ > $subs->{location} = GetKohaAuthorisedValueLib("LOC",$subs->{location}); > $subs->{abouttoexpire} = abouttoexpire($subs->{subscriptionid}); > $template->param(%{ $subs }); >-- >1.7.9.5
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 8694
:
11871
|
11907
|
114437
|
115246
|
135879