fixes to moredetail.pl to allow status editing using updateitem.pl

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joshua Ferraro 2007-10-21 23:40:50 -05:00
parent 94861098e6
commit a6f1915422
3 changed files with 15 additions and 38 deletions

View file

@ -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

View file

@ -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'});

View file

@ -54,7 +54,7 @@ NAME="biblionumber"-->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">Modif
<li><span class="label">Current Library:</span> <!-- TMPL_VAR NAME="holdingbranch" --></li>
<li><span class="label">Last seen:</span> <!-- TMPL_VAR NAME="datelastseen" --></li>
<li><span class="label">Last borrowed:</span> <!-- TMPL_IF NAME="datelastborrowed" --><!-- TMPL_VAR NAME="datelastborrowed" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
<li><span class="label">Item Status:</span> <!-- TMPL_IF NAME="issue" -->On issue to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a><!-- TMPL_ELSE -->Available <!-- /TMPL_IF --></li>
<li><span class="label">Item Status:</span> <!-- TMPL_IF NAME="issue" -->Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a><!-- TMPL_ELSE -->Not Checked out <!-- /TMPL_IF --></li>
<!-- TMPL_IF NAME="issue" --><li><span class="label">Date Due:</span> <!-- TMPL_VAR NAME="date_due" --></li><!-- /TMPL_IF -->
<li><span class="label">Last Borrower 1:</span> <!-- TMPL_IF NAME="card0" --><!-- TMPL_VAR NAME="card0" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>
<li><span class="label">Last Borrower 2:</span> <!-- TMPL_IF NAME="card1" --><!-- TMPL_VAR NAME="card1" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></li>