Bugzilla – Attachment 5928 Details for
Bug 7045
Default-value substitution inconsistent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7045: Default-value behavior inconsistency
Bug-7045-Default-value-behavior-inconsistency.patch (text/plain), 2.06 KB, created by
Jared Camins-Esakov
on 2011-10-17 15:10:16 UTC
(
hide
)
Description:
Bug 7045: Default-value behavior inconsistency
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2011-10-17 15:10:16 UTC
Size:
2.06 KB
patch
obsolete
>From f377826179a92c7fd6d73761012e156ca4fb94f9 Mon Sep 17 00:00:00 2001 >From: D Ruth Bavousett <ruth@bywatersolutions.com> >Date: Mon, 17 Oct 2011 07:15:17 -0700 >Subject: [PATCH] Bug 7045: Default-value behavior inconsistency >Content-Type: text/plain; charset="UTF-8" > >This patch will allow for YY as well as YYYY substitutions on framework default values, and >changes the substitution of 'user' for the username to require USER. > >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >--- > cataloguing/addbiblio.pl | 4 +++- > cataloguing/additem.pl | 2 ++ > 2 files changed, 5 insertions(+), 1 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index ee0662a..e180c82 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -307,13 +307,15 @@ sub create_input { > > # get today date & replace YYYY, MM, DD if provided in the default value > my ( $year, $month, $day ) = Today(); >+ my $shortyear = substr $year, 2, 2; > $month = sprintf( "%02d", $month ); > $day = sprintf( "%02d", $day ); > $value =~ s/YYYY/$year/g; >+ $value =~ s/YY/$shortyear/g; > $value =~ s/MM/$month/g; > $value =~ s/DD/$day/g; > my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); >- $value=~s/user/$username/g; >+ $value=~s/USER/$username/g; > > } > my $dbh = C4::Context->dbh; >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 6229f0c..6e22913 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -125,7 +125,9 @@ sub generate_subfield_form { > $value = $subfieldlib->{defaultvalue}; > # get today date & replace YYYY, MM, DD if provided in the default value > my ( $year, $month, $day ) = split ',', $today_iso; # FIXME: iso dates don't have commas! >+ my $shortyear = substr $year, 2, 2; > $value =~ s/YYYY/$year/g; >+ $value =~ s/YY/$shortyear/g; > $value =~ s/MM/$month/g; > $value =~ s/DD/$day/g; > } >-- >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 7045
:
5922
|
5923
|
5924
|
5925
|
5926
|
5927
|
5928
|
5929
|
5931
|
5932
|
54496
|
54497
|
54500
|
54501
|
54669
|
54670