Bugzilla – Attachment 4928 Details for
Bug 6139
Automatic incrementation of call number does not work if given prefix contains a '
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch (passed QA)
0001-Bug-6139-Automatic-incrementation-of-call-number-doe.patch (text/plain), 1.68 KB, created by
Paul Poulain
on 2011-08-10 11:56:46 UTC
(
hide
)
Description:
proposed patch (passed QA)
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-08-10 11:56:46 UTC
Size:
1.68 KB
patch
obsolete
>From 228f4915494d3921ecbcb6b98d7ca06e29f4cb18 Mon Sep 17 00:00:00 2001 >From: Sophie Meynieux <sophie.meynieux@biblibre.com> >Date: Fri, 8 Apr 2011 12:12:09 +0200 >Subject: [PATCH] Bug #6139 Automatic incrementation of call number does not work if prefix contains ' > >This patch also fixes giving the first callnumber with a given prefix. > >Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> >--- > cataloguing/value_builder/callnumber.pl | 10 ++++++++-- > 1 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/value_builder/callnumber.pl b/cataloguing/value_builder/callnumber.pl >index cc37af0..64507f2 100755 >--- a/cataloguing/value_builder/callnumber.pl >+++ b/cataloguing/value_builder/callnumber.pl >@@ -95,7 +95,7 @@ sub plugin { > ); > } > # If a prefix is submited, we look for the highest itemcallnumber with this prefix, and return it incremented >- } elsif ( $code =~ m/^[A-Z.\-]+$/ ) { >+ } elsif ( $code =~ m/^[A-Z.\-']+$/ ) { > my $sth = $dbh->prepare("SELECT MAX(CAST(SUBSTRING_INDEX(itemcallnumber,' ',-1) AS SIGNED)) FROM items WHERE itemcallnumber LIKE ?"); > $sth->execute($code.' %'); > if ( my $max = $sth->fetchrow ) { >@@ -103,10 +103,16 @@ sub plugin { > return => $code.' '.($max+1) > ); > } >+ else { >+ $template->param( >+ return => $code.' 1' >+ ); >+ } >+ > # The user entered a custom value, we don't touch it, this could be handled in js > } else { > $template->param( >- return => $code, >+ return => $code > ); > } > output_html_with_http_headers $input, $cookie, $template->output; >-- >1.7.4.1 >
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 6139
:
3831
| 4928