From f98e567b572ed6b5835dc68a87d1f1306220ec62 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Thu, 10 Jan 2008 12:29:19 -0600 Subject: [PATCH] Populate serialitems table, bugfix Signed-off-by: Joshua Ferraro --- C4/Serials.pm | 8 ++------ .../prog/en/modules/serials/serials-collection.tmpl | 5 +++-- serials/serials-collection.pl | 1 + serials/serials-edit.pl | 7 ------- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index e0f260c687..dce2c611d7 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -302,12 +302,8 @@ Adds an itemnumber to Serial record sub AddItem2Serial { my ( $serialid, $itemnumber ) = @_; my $dbh = C4::Context->dbh; - my $query = qq| - UPDATE serial SET itemnumber=IF(itemnumber IS NULL, $itemnumber, CONCAT(itemnumber,",",$itemnumber)) - WHERE serialid = ? - |; - my $rq = $dbh->prepare($query); - $rq->execute($serialid); + my $rq = $dbh->prepare("INSERT INTO `serialitems` SET serialid=? , itemnumber=?"); + $rq->execute($serialid, $itemnumber); return $rq->rows; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl index 32b79802d9..fb9cfb7253 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tmpl @@ -75,7 +75,7 @@ $(document).ready(function() { - "># + "># 1/day @@ -147,8 +147,9 @@ $(document).ready(function() { + ">See any subscription attached to this biblio - + diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index 057f668fe2..ca58f98290 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -70,6 +70,7 @@ if (@subscriptionid){ } $subs->{'abouttoexpire'}=abouttoexpire($subs->{'subscriptionid'}); $subs->{'subscriptionexpired'}=HasSubscriptionExpired($subs->{'subscriptionid'}); + $subs->{'subscriptionid'} = $subscriptionid; # FIXME - why was this lost ? push @$subscriptiondescs,$subs; my $tmpsubscription= GetFullSubscription($subscriptionid); @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation); diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index f1e61e4eb7..e0d66666ab 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -222,13 +222,6 @@ if ($op eq 'serialchangestatus') { my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); if ($item=~/^N/){ #New Item - # add serialid to item record - my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.itemnumber"); - my $field = $record->field($tagfield); - my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.serialid"); - if ($tagsubfield ) { - $field->update($tagsubfield => $itemhash{$item}->{'serial'}); - } # if autoBarcode is ON, calculate barcode... my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode"); -- 2.39.5