Bugzilla – Attachment 37878 Details for
Bug 13813
Remove deprecated module C4::Dates from system - first steps
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13813 - Remove C4::Dates from C4/Barcodes/annual.pm
Bug-13813---Remove-C4Dates-from-C4Barcodesannualpm.patch (text/plain), 2.47 KB, created by
Jonathan Druart
on 2015-04-15 08:13:54 UTC
(
hide
)
Description:
Bug 13813 - Remove C4::Dates from C4/Barcodes/annual.pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-15 08:13:54 UTC
Size:
2.47 KB
patch
obsolete
>From b0adcefaac53b1dd73ed758f97fb9ede6cd45264 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 13 Mar 2015 14:59:49 +0100 >Subject: [PATCH] Bug 13813 - Remove C4::Dates from C4/Barcodes/annual.pm > >To test: >Set syspref autoBarcode to <year>-001, <year>-002 >Edit items or add item, click in empty barcode field, verify that barcodes are filled in as appropriate. > >Amended following comment #58 > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Barcodes/annual.pm | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > >diff --git a/C4/Barcodes/annual.pm b/C4/Barcodes/annual.pm >index ae03274..7b7e8ca 100644 >--- a/C4/Barcodes/annual.pm >+++ b/C4/Barcodes/annual.pm >@@ -24,7 +24,6 @@ use Carp; > > use C4::Context; > use C4::Debug; >-use C4::Dates; > > use vars qw($VERSION @ISA); > use vars qw($debug $cgi_debug); # from C4::Debug, of course >@@ -44,13 +43,13 @@ sub db_max ($;$) { > my ($iso); > if (@_) { > my $input = shift; >- $iso = C4::Dates->new($input,'iso')->output('iso'); # try to set the date w/ 2nd arg >+ $iso = output_pref({ dt => dt_from_string( $input, 'iso' ), dateformat => 'iso', dateonly => 1 }); # try to set the date w/ 2nd arg > unless ($iso) { > warn "Failed to create 'iso' Dates object with input '$input'. Reverting to today's date."; >- $iso = C4::Dates->new->output('iso'); # failover back to today >+ $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); # failover back to today > } > } else { >- $iso = C4::Dates->new->output('iso'); >+ $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); > } > my $year = substr($iso,0,4); # YYYY > $sth->execute("$year-%"); >@@ -61,7 +60,7 @@ sub db_max ($;$) { > > sub initial () { > my $self = shift; >- return substr(C4::Dates->new->output('iso'),0,4) .'-'. sprintf('%'."$width.$width".'d', 1); >+ return substr(output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 0, 4 ) .'-'. sprintf('%'."$width.$width".'d', 1); > } > > sub parse ($;$) { >@@ -82,7 +81,7 @@ sub width ($;$) { > sub process_head($$;$$) { # (self,head,whole,specific) > my ($self,$head,$whole,$specific) = @_; > $specific and return $head; # if this is built off an existing barcode, just return the head unchanged. >- return substr(C4::Dates->new->output('iso'),0,4) . '-'; # else get new YYYY- >+ return substr(output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 0, 4 ) . '-'; # else get new YYYY- > } > > sub new_object { >-- >2.1.0
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 13813
:
36827
|
36828
|
36829
|
36830
|
36831
|
36832
|
36835
|
36836
|
36839
|
36845
|
36850
|
36851
|
36855
|
36857
|
36858
|
36859
|
36862
|
36863
|
36864
|
36865
|
36870
|
36871
|
36872
|
36878
|
36879
|
36880
|
36881
|
36882
|
36883
|
36884
|
36885
|
36886
|
36887
|
36888
|
36889
|
36890
|
36892
|
36893
|
36894
|
36895
|
36896
|
36897
|
36898
|
36899
|
36900
|
36901
|
36902
|
37227
|
37730
|
37731
|
37732
|
37736
|
37737
|
37746
|
37748
|
37749
|
37753
|
37754
|
37757
|
37762
|
37763
|
37764
|
37765
|
37766
|
37767
|
37768
|
37770
|
37810
|
37828
|
37835
|
37839
|
37840
|
37841
|
37842
|
37843
|
37853
|
37854
|
37855
|
37856
|
37857
|
37858
|
37859
|
37860
|
37861
|
37862
|
37863
|
37864
|
37865
|
37866
|
37867
|
37868
|
37869
|
37870
|
37871
|
37872
|
37873
|
37874
|
37875
|
37876
|
37877
|
37878
|
37879
|
37880
|
37881
|
37882
|
37883
|
37884
|
37885
|
37886
|
37887
|
37888
|
37889
|
37890
|
37891
|
39666
|
40894
|
42052
|
42175
|
42274
|
42286
|
42292
|
42293
|
42294