From a6f191542219854e8dc87d48c2b1a56954ce458b Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sun, 21 Oct 2007 23:40:50 -0500 Subject: [PATCH] fixes to moredetail.pl to allow status editing using updateitem.pl Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Koha.pm | 47 +++++-------------- catalogue/moredetail.pl | 4 +- .../prog/en/modules/catalogue/moredetail.tmpl | 2 +- 3 files changed, 15 insertions(+), 38 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 22dae295b9..3d15b9169b 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -53,8 +53,6 @@ $VERSION = 3.00; &GetPrinters &GetPrinter &GetItemTypes &getitemtypeinfo &GetCcodes - &GetAuthItemlost - &GetAuthItembinding &get_itemtypeinfos_of &getframeworks &getframeworkinfo &getauthtypes &getauthtype @@ -294,36 +292,6 @@ sub GetCcodes { return ( $count, @results ); } -=head2 - -grab itemlost authorized values - -=cut - -sub GetAuthItemlost { - my $itemlost = shift; - my $count = 0; - my @results; - my $dbh = C4::Context->dbh; - my $sth = - $dbh->prepare( - "SELECT * FROM authorised_values ORDER BY authorised_value"); - $sth->execute; - while ( my $data = $sth->fetchrow_hashref ) { - if ( $data->{category} eq "ITEMLOST" ) { - $count++; - if ( $itemlost eq $data->{'authorised_value'} ) { - $data->{'selected'} = 1; - } - $results[$count] = $data; - - #warn "data: $data"; - } - } - $sth->finish; - return ( $count, @results ); -} - =head2 getauthtypes $authtypes = &getauthtypes(); @@ -829,15 +797,24 @@ Set C<$category> on input args if you want to limits your query to this one. Thi =cut sub GetAuthorisedValues { - my $category = shift; + my ($category,$selected) = @_; + my $count = 0; + my @results; my $dbh = C4::Context->dbh; my $query = "SELECT * FROM authorised_values"; $query .= " WHERE category = '" . $category . "'" if $category; my $sth = $dbh->prepare($query); $sth->execute; - my $data = $sth->fetchall_arrayref({}); - return $data; + while (my $data=$sth->fetchrow_hashref) { + if ($selected eq $data->{'authorised_value'} ) { + $data->{'selected'} = 1; + } + $results[$count] = $data; + $count++; + } + #my $data = $sth->fetchall_arrayref({}); + return \@results; #$data; } =item fixEncoding diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 6f3542cc29..ddb2eb5bb2 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -76,8 +76,8 @@ my $order = GetOrder($ordernum); $results[0]=$data; foreach my $item (@$items){ - $item->{itemlostloop}= GetAuthorisedValues('ITEMLOST'); - $item->{itemdamagedloop}= GetAuthorisedValues('DAMAGED'); + $item->{itemlostloop}= GetAuthorisedValues('LOST',$item->{itemlost}); + $item->{itemdamagedloop}= GetAuthorisedValues('DAMAGED',$item->{damaged}); $item->{'replacementprice'}=sprintf("%.2f", $item->{'replacementprice'}); $item->{'datelastborrowed'}= format_date($item->{'datelastborrowed'}); $item->{'dateaccessioned'} = format_date($item->{'dateaccessioned'}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl index 5dccc38984..b535e7e7ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl @@ -54,7 +54,7 @@ NAME="biblionumber"-->&itemnumber=">Modif
  • Current Library:
  • Last seen:
  • Last borrowed:  
  • -
  • Item Status: On issue to ">Available
  • +
  • Item Status: Checked out to ">Not Checked out
  • Date Due:
  • Last Borrower 1:  
  • Last Borrower 2:  
  • -- 2.39.5