[Koha-patches] [PATCH] Bug 2555 : label batch_id not properly incremented after batch num 10. [ DO NOT APPLY ]
Ryan Higgins
ryan.higgins at liblime.com
Sat Sep 27 19:53:07 CEST 2008
On review, this patch unintentionally includes a further mod to Labels.pm
that should not be included.
Will resubmit with the encoding change removed .
Ryan
On Sat, Sep 27, 2008 at 1:40 PM, Ryan Higgins <rch at liblime.com> wrote:
> This is a stop-gap fix intended for 3.0 maintenance release.
> 3.2 should include a label_batches table which will allow named
> batches to be associated with a template & layout, and fix the
> column definition of batch_id here to be an auto_incr int.
> ---
> C4/Labels.pm | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/C4/Labels.pm b/C4/Labels.pm
> index 6531164..b162010 100644
> --- a/C4/Labels.pm
> +++ b/C4/Labels.pm
> @@ -275,7 +275,9 @@ sub add_batch ($;$) {
> my $table = (@_ and 'patroncards' eq shift) ? 'patroncards' :
> 'labels';
> my $batch_list = (@_) ? shift : undef;
> my $dbh = C4::Context->dbh;
> - my $q ="SELECT MAX(DISTINCT batch_id) FROM $table";
> + # FIXME : batch_id should be an auto_incr INT. Temporarily casting
> as int ( see koha bug 2555 )
> + # until a label_batches table is added, and we can convert batch_id to
> int.
> + my $q ="SELECT MAX( CAST(batch_id AS SIGNED) ) FROM $table";
> my $sth = $dbh->prepare($q);
> $sth->execute();
> my ($batch_id) = $sth->fetchrow_array || 0;
> @@ -1108,7 +1110,8 @@ sub DrawSpineText {
> } else {
> $hPos = ( $x_pos + $left_text_margin );
> }
> - PrintText( $hPos, $vPos, $font, $fontsize, $str );
> + use Encode;
> + PrintText( $hPos, $vPos, $font, $fontsize,
> encode('utf8',$str) );
> $vPos = $vPos - $line_spacer;
> }
> }
> --
> 1.5.5.GIT
>
>
--
Ryan Higgins
LibLime * Open-Source Solutions for Libraries
Featuring KohaZOOM ILS
888-564-2457 x704
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20080927/4d6726e2/attachment-0001.htm>
More information about the Koha-patches
mailing list