&GetPrinters &GetPrinter
&GetItemTypes &getitemtypeinfo
&GetCcodes
- &GetAuthItemlost
- &GetAuthItembinding
&get_itemtypeinfos_of
&getframeworks &getframeworkinfo
&getauthtypes &getauthtype
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();
=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
$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'});
<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 --> <!-- /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 --> <!-- /TMPL_IF --></li>
<li><span class="label">Last Borrower 2:</span> <!-- TMPL_IF NAME="card1" --><!-- TMPL_VAR NAME="card1" --><!-- TMPL_ELSE --> <!-- /TMPL_IF --></li>