Bugzilla – Attachment 31372 Details for
Bug 12729
Overdue items won't show as overdue in red in circulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12729 - Overdue items won't show as overdue in red in circulation
Bug-12729---Overdue-items-wont-show-as-overdue-in-.patch (text/plain), 2.54 KB, created by
Dobrica Pavlinusic
on 2014-09-04 13:23:36 UTC
(
hide
)
Description:
Bug 12729 - Overdue items won't show as overdue in red in circulation
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2014-09-04 13:23:36 UTC
Size:
2.54 KB
patch
obsolete
>From 0c16eab8a794ef57487bffaa5ac28f679489cdfa Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Thu, 4 Sep 2014 15:16:57 +0200 >Subject: [PATCH] Bug 12729 - Overdue items won't show as overdue in red in circulation > >It seems that Firefox date parser doesn't like our dates which are >formatted in ISO format like "2014-08-06 00:00:00". This results in >missing red color in overdue dates. > >So intead of munching different date formats and JavaScript (and having >to support different browers) this patch moves check for overdue dates >back to mysql and just transfers boolean value to JavaScript so it can >show correct class for date_due. > >Test scenario: >1. find borrower with overdue checkouts >2. verify that all dates are black (and are in ISO format) >3. apply this patch >4. reload page and verify that overdue dates turned red >--- > koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 4 +--- > svc/checkouts | 2 ++ > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >index 6efe9f9..4424d3a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >@@ -151,9 +151,7 @@ $(document).ready(function() { > { > "iDataSort": 1, // Sort on hidden unformatted date due column > "mDataProp": function( oObj ) { >- var today = new Date(); >- var due = new Date( oObj.date_due ); >- if ( today > due ) { >+ if ( oObj.date_due_overdue ) { > return "<span class='overdue'>" + oObj.date_due_formatted + "</span>"; > } else { > return oObj.date_due_formatted; >diff --git a/svc/checkouts b/svc/checkouts >index abe2c0e..f56bdff 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -60,6 +60,7 @@ my $sql = ' > SELECT > issuedate, > date_due, >+ date_due < now() as date_due_overdue, > > biblionumber, > biblio.title, >@@ -148,6 +149,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { > biblionumber => $c->{biblionumber}, > issuedate => $c->{issuedate}, > date_due => $c->{date_due}, >+ date_due_overdue => $c->{date_due_overdue} ? JSON::true : JSON::false, > renewals_count => $renewals_count, > renewals_allowed => $renewals_allowed, > renewals_remaining => $renewals_remaining, >-- >1.7.2.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 12729
:
30577
|
31142
|
31372
|
31587
|
31597