Bugzilla – Attachment 13827 Details for
Bug 9014
Add time due to slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9014 - Add time due to slips
Bug-9014---Add-time-due-to-slips.patch (text/plain), 5.07 KB, created by
Katrin Fischer
on 2012-12-02 20:46:50 UTC
(
hide
)
Description:
Bug 9014 - Add time due to slips
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2012-12-02 20:46:50 UTC
Size:
5.07 KB
patch
obsolete
>From 24985177dda562910a649c19276f5762e4841c45 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 6 Nov 2012 14:00:06 -0500 >Subject: [PATCH] Bug 9014 - Add time due to slips > >--- > C4/Members.pm | 4 ++-- > Koha/DateUtils.pm | 19 +++++++++++-------- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/i18n_l10n.pref | 8 ++++++++ > 5 files changed, 29 insertions(+), 10 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index b2f45b9..2abb2cb 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -2281,8 +2281,8 @@ sub IssueSlip { > elsif ((substr $it->{'date_due'}, 0, 10) le $now) { > $it->{'overdue'} = 1; > } >- >- $it->{'date_due'}=format_date($it->{'date_due'}); >+ my $dt = dt_from_string( $it->{'date_due'} ); >+ $it->{'date_due'} = output_pref( $dt );; > } > my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist; > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 4ffc160..bb25027 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -115,26 +115,29 @@ sub output_pref { > > my $pref = > defined $force_pref ? $force_pref : C4::Context->preference('dateformat'); >+ > given ($pref) { > when (/^iso/) { > return $dateonly >- ? $dt->strftime('%Y-%m-%d') >- : $dt->strftime('%Y-%m-%d %H:%M'); >+ ? $dt->strftime("%Y-%m-%d") >+ : $dt->strftime("%Y-%m-%d %H:%M"); > } > when (/^metric/) { > return $dateonly >- ? $dt->strftime('%d/%m/%Y') >- : $dt->strftime('%d/%m/%Y %H:%M'); >+ ? $dt->strftime("%d/%m/%Y") >+ : $dt->strftime("%d/%m/%Y %H:%M"); > } > when (/^us/) { >+ my $time = ( C4::Context->preference('TimeFormat') eq '12hr' ) ? '%I:%M %p' : '%H:%M'; >+ > return $dateonly >- ? $dt->strftime('%m/%d/%Y') >- : $dt->strftime('%m/%d/%Y %H:%M'); >+ ? $dt->strftime("%m/%d/%Y") >+ : $dt->strftime("%m/%d/%Y $time"); > } > default { > return $dateonly >- ? $dt->strftime('%Y-%m-%d') >- : $dt->strftime('%Y-%m-%d %H:%M'); >+ ? $dt->strftime("%Y-%m-%d") >+ : $dt->strftime("%Y-%m-%d %H:%M"); > } > > } >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 0cc5a54..b399f52 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -388,3 +388,4 @@ INSERT INTO systempreferences (variable, value, options, explanation, type) VALU > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo'); >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f24d8b4..1c28202 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6113,6 +6113,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice')"); >+ print "Upgrade to $DBversion done (Add syspref TimeFormat)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >index cc6700b..1a7c3ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >@@ -9,6 +9,14 @@ I18N/L10N: > iso: yyyy-mm-dd > - . > - >+ - Format times sing >+ - pref: TimeFormat >+ default: us >+ choices: >+ 24hr: 24 hour format >+ 12hr: 12 hour format >+ - . >+ - > - Use > - pref: CalendarFirstDayOfWeek > default: Sunday >-- >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 9014
:
13272
|
13273
|
13507
|
13827
|
13906
|
13907
|
14164
|
14373
|
14374
|
14396
|
16411
|
16417
|
16424