Bugzilla – Attachment 19175 Details for
Bug 10478
Do we need a sequential number generator?
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10478: Sequential number generator
Bug-10478-Sequential-number-generator.patch (text/plain), 1.27 KB, created by
Marcel de Rooy
on 2013-06-20 16:29:57 UTC
(
hide
)
Description:
Bug 10478: Sequential number generator
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-06-20 16:29:57 UTC
Size:
1.27 KB
patch
obsolete
>From 0fbbc96d38f413a9e222f20aff5553c4901b6858 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 20 Jun 2013 18:20:31 +0200 >Subject: [PATCH] Bug 10478: Sequential number generator >Content-Type: text/plain; charset=utf-8 > >--- > C4/Koha.pm | 27 +++++++++++++++++++++++++++ > 1 files changed, 27 insertions(+), 0 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 9976995..65ba6c0 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1503,6 +1503,33 @@ sub _isbn_cleanup { > return; > } > >+=head2 NextSequentialNumber >+ >+ Returns the next sequential number in a range (subranges possible) >+ >+ my $sh= NextSequentialNumber('shelfnumber'); >+ my $loc= NextSequentialNumber('shelflocation', $sh); >+ >+=cut >+ >+sub NextSequentialNumber { >+ my ($range, $subrange)= @_; >+ >+ my $sql=q/ >+UPDATE sequential_numbers set counter= LAST_INSERT_ID(counter+1) >+/; >+ my $dbh= C4::Context->dbh; >+ #my $dbname= C4::Context->config("database"); >+ >+ $dbh->do($sql); >+ #return $dbh->last_insert_id(undef, undef, 'sequential_numbers', 'counter'); >+ return $dbh->last_insert_id(undef, undef, undef, undef); >+ #first parameter could have been $dbname (MySQL ignores it) >+ #actually third and fourth are also ignored >+} >+ >+ >+ > 1; > > __END__ >-- >1.7.7.6
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 10478
: 19175