Show copy/volume info on STAFF detail page.
This change helps the staff side catch up w/ the OPAC display and be more useful to librarians dealing with serials. Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
797c1d5502
commit
0855e8ef29
|
|
@ -80,23 +80,24 @@ my $dat = &GetBiblioData($biblionumber);
|
|||
#coping with subscriptions
|
||||
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
|
||||
my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
|
||||
|
||||
|
||||
|
||||
my @subs;
|
||||
$dat->{'serial'}=1 if $subscriptionsnumber;
|
||||
foreach my $subscription (@subscriptions) {
|
||||
my %cell;
|
||||
$cell{subscriptionid} = $subscription->{subscriptionid};
|
||||
$cell{subscriptionnotes} = $subscription->{notes};
|
||||
|
||||
$cell{branchcode} = $subscription->{branchcode};
|
||||
$cell{hasalert} = $subscription->{hasalert};
|
||||
#get the three latest serials.
|
||||
$cell{latestserials} =
|
||||
GetLatestSerials( $subscription->{subscriptionid}, 3 );
|
||||
push @subs, \%cell;
|
||||
}
|
||||
$dat->{imageurl} = getitemtypeimagesrc() . "/".$itemtypes->{ $dat->{itemtype} }{imageurl};
|
||||
$dat->{'count'} = @items;
|
||||
my @itemloop;
|
||||
$dat->{'count'} = scalar @items;
|
||||
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
|
||||
my $collections = GetKohaAuthorisedValues('items.ccode' , $fw);
|
||||
my (@itemloop, %itemfields);
|
||||
my $norequests = 1;
|
||||
foreach my $item (@items) {
|
||||
|
||||
|
|
@ -106,21 +107,22 @@ foreach my $item (@items) {
|
|||
# format some item fields for display
|
||||
$item->{ $item->{'publictype'} } = 1;
|
||||
$item->{imageurl} = getitemtypeimagesrc() . "/".$itemtypes->{ $item->{itype} }{imageurl};
|
||||
$item->{datedue} = format_date($item->{datedue});
|
||||
$item->{datelastseen} = format_date($item->{datelastseen});
|
||||
$item->{onloan} = format_date($item->{onloan});
|
||||
foreach (qw(datedue datelastseen onloan)) {
|
||||
$item->{$_} = format_date($item->{$_});
|
||||
}
|
||||
# item damaged, lost, withdrawn loops
|
||||
$item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
|
||||
if ($item->{damaged}) {
|
||||
$item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
|
||||
}
|
||||
#get shelf location and collection code description if they are authorised value.
|
||||
my $shelflocations = GetKohaAuthorisedValues('items.location',$fw );
|
||||
my $shelfcode= $item->{'location'};
|
||||
$item->{'location'} = $shelflocations->{$shelfcode} if(defined($shelflocations) && exists($shelflocations->{$shelfcode}));
|
||||
my $collections = GetKohaAuthorisedValues('items.ccode',$fw );
|
||||
my $ccode= $item->{'ccode'};
|
||||
$item->{'ccode'} = $collections->{$ccode} if(defined($collections) && exists($collections->{$ccode}));
|
||||
foreach (qw(ccode enumchron copynumber)) {
|
||||
$itemfields{$_} = 1 if($item->{$_});
|
||||
}
|
||||
|
||||
# checking for holds
|
||||
my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($item->{itemnumber});
|
||||
|
|
@ -131,7 +133,7 @@ foreach my $item (@items) {
|
|||
$item->{reservedate} = format_date($reservedate);
|
||||
$item->{ReservedForBorrowernumber} = $reservedfor;
|
||||
$item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'};
|
||||
$item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'};
|
||||
$item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'};
|
||||
$item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname};
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +142,7 @@ foreach my $item (@items) {
|
|||
if ( $transfertwhen ne '' ) {
|
||||
$item->{transfertwhen} = format_date($transfertwhen);
|
||||
$item->{transfertfrom} = $branches->{$transfertfrom}{branchname};
|
||||
$item->{transfertto} = $branches->{$transfertto}{branchname};
|
||||
$item->{transfertto} = $branches->{$transfertto}{branchname};
|
||||
$item->{nocancel} = 1;
|
||||
}
|
||||
|
||||
|
|
@ -155,15 +157,17 @@ foreach my $item (@items) {
|
|||
}
|
||||
|
||||
$template->param( norequests => $norequests );
|
||||
|
||||
$template->param(
|
||||
MARCNOTES => $marcnotesarray,
|
||||
MARCSUBJCTS => $marcsubjctsarray,
|
||||
MARCAUTHORS => $marcauthorsarray,
|
||||
MARCSERIES => $marcseriesarray,
|
||||
MARCURLS => $marcurlsarray,
|
||||
subtitle => $subtitle,
|
||||
);
|
||||
$template->param(
|
||||
MARCNOTES => $marcnotesarray,
|
||||
MARCSUBJCTS => $marcsubjctsarray,
|
||||
MARCAUTHORS => $marcauthorsarray,
|
||||
MARCSERIES => $marcseriesarray,
|
||||
MARCURLS => $marcurlsarray,
|
||||
subtitle => $subtitle,
|
||||
itemdata_ccode => $itemfields{ccode},
|
||||
itemdata_enumchron => $itemfields{enumchron},
|
||||
itemdata_copynumber => $itemfields{copynumber},
|
||||
);
|
||||
|
||||
my @results = ( $dat, );
|
||||
foreach ( keys %{$dat} ) {
|
||||
|
|
@ -179,6 +183,8 @@ $template->param(
|
|||
subscriptiontitle => $dat->{title},
|
||||
);
|
||||
|
||||
# $debug and $template->param(debug_display => 1);
|
||||
|
||||
# XISBN Stuff
|
||||
my $xisbn=$dat->{'isbn'};
|
||||
$xisbn =~ s/(p|-| |:)//g;
|
||||
|
|
|
|||
|
|
@ -159,32 +159,35 @@ function verify_images() {
|
|||
<tr>
|
||||
<!-- TMPL_IF NAME="item-level_itypes" --><th>Item type</th><!-- /TMPL_IF -->
|
||||
<th>Location</th>
|
||||
<th>Collection</th>
|
||||
<!-- TMPL_IF NAME="itemdata_ccode" --><th>Collection</th><!-- /TMPL_IF -->
|
||||
<th>Call Number</th>
|
||||
<th>Status</th>
|
||||
<th>Last seen</th>
|
||||
<th>Barcode</th>
|
||||
<th>Volume</th>
|
||||
<!-- TMPL_IF NAME="itemdata_enumchron" --><th>Publication Details</th>
|
||||
<!-- TMPL_ELSIF NAME="serial" --><th>Volume</th>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="itemdata_copynumber" --><th>Copy No.</th><!-- /TMPL_IF -->
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="itemloop" -->
|
||||
<tr>
|
||||
<!-- TMPL_IF NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="noItemTypeImages" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->"><!-- /TMPL_IF --></td><!-- /TMPL_IF -->
|
||||
<td><!-- TMPL_UNLESS NAME="singlebranchmode" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_UNLESS --> <!-- TMPL_VAR NAME="location" --> </td>
|
||||
<td><!-- TMPL_VAR name="ccode" --></td>
|
||||
<td><!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --></td>
|
||||
<td>
|
||||
<!-- TMPL_IF NAME="item-level_itypes" --><td class="itype"><!-- TMPL_IF NAME="noItemTypeImages" --><!-- TMPL_VAR NAME="description" --><!-- TMPL_ELSE --><img src="<!-- TMPL_VAR NAME="imageurl" -->" alt="<!-- TMPL_VAR NAME="description" -->" title="<!-- TMPL_VAR NAME="description" -->"><!-- /TMPL_IF --></td><!-- /TMPL_IF -->
|
||||
<td class="location"><!-- TMPL_UNLESS NAME="singlebranchmode" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_UNLESS --> <!-- TMPL_VAR NAME="location" --> </td>
|
||||
<!-- TMPL_IF NAME="itemdata_ccode" --><td><!-- TMPL_VAR name="ccode" --></td><!-- /TMPL_IF -->
|
||||
<td class="itemcallnumber"><!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --></td>
|
||||
<td class="status">
|
||||
|
||||
<!-- TMPL_IF name="datedue" -->
|
||||
<!-- TMPL_IF NAME="NOTSAMEBRANCH" -->
|
||||
<span class="datedue">Checked out, due <!-- TMPL_VAR NAME="datedue" --></span>
|
||||
<!-- TMPL_ELSE -->
|
||||
<span class="datedue">Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a>, due <!-- TMPL_VAR NAME="datedue" --></span>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSE -->
|
||||
<!-- TMPL_IF Name="transfertwhen" -->
|
||||
In transit from <!-- TMPL_VAR NAME="transfertfrom" -->,
|
||||
to <!-- TMPL_VAR NAME="transfertto" -->, since <!-- TMPL_VAR NAME="transfertwhen" -->
|
||||
<!-- /TMPL_IF -->
|
||||
<span class="datedue">Checked out
|
||||
<!-- TMPL_UNLESS NAME="NOTSAMEBRANCH" -->
|
||||
to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a>
|
||||
<!-- /TMPL_UNLESS -->
|
||||
: due <!-- TMPL_VAR NAME="datedue" -->
|
||||
</span>
|
||||
<!-- TMPL_ELSIF Name="transfertwhen" -->
|
||||
In transit from <!-- TMPL_VAR NAME="transfertfrom" -->,
|
||||
to <!-- TMPL_VAR NAME="transfertto" -->, since <!-- TMPL_VAR NAME="transfertwhen" -->
|
||||
<!-- FIXME: the "since" clause is redundant w/ lastseen field -->
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="itemlost" -->
|
||||
|
|
@ -244,13 +247,16 @@ function verify_images() {
|
|||
<!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS -->
|
||||
|
||||
</td>
|
||||
<td><!-- TMPL_VAR NAME="datelastseen" --></td>
|
||||
<td class="datelastseen"><!-- TMPL_VAR NAME="datelastseen" --></td>
|
||||
<td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=<!-- TMPL_VAR NAME="type" -->&item=<!-- TMPL_VAR NAME="itemnumber" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->#item<!-- TMPL_VAR NAME="itemnumber">"><!-- TMPL_VAR NAME="barcode" --></a></td>
|
||||
<!-- TMPL_IF NAME="serial" -->
|
||||
<td><!-- TMPL_VAR NAME="serialseq" --><!-- TMPL_IF NAME="publisheddate" --> (<!-- TMPL_VAR NAME="publisheddate" -->)<!-- /TMPL_IF --></td>
|
||||
<!-- TMPL_ELSE -->
|
||||
<td><!-- TMPL_VAR NAME="enumchron" --></td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="itemdata_enumchron" -->
|
||||
<td class="enumchron"><!-- TMPL_VAR NAME="enumchron" --></td>
|
||||
<!-- TMPL_ELSIF NAME="serial" -->
|
||||
<td class="serialseq"><!-- TMPL_VAR NAME="serialseq" --><!-- TMPL_IF NAME="publisheddate" --> (<!-- TMPL_VAR NAME="publisheddate" -->)<!-- /TMPL_IF --></td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="itemdata_copynumber" -->
|
||||
<td class="copynumber"><!-- TMPL_VAR NAME="copynumber" --></td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="type" -->
|
||||
<td><a href="/cgi-bin/koha/maint/catmaintain.pl?type=fixitemtype&bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&item=<!-- TMPL_VAR NAME="itemtype" -->">Fix Itemtype</a></td>
|
||||
<!-- /TMPL_IF -->
|
||||
|
|
@ -258,6 +264,14 @@ function verify_images() {
|
|||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
<!-- TMPL_IF NAME="debug_display" -->
|
||||
<br /><br />
|
||||
<table>
|
||||
<tr><td>itemdata_enumchron</td><td><!-- TMPL_VAR NAME="itemdata_enumchron" --></td></tr>
|
||||
<tr><td>itemdata_copynumber</td><td><!-- TMPL_VAR NAME="itemdata_copynumber" --></td></tr>
|
||||
<tr><td>serial</td><td><!-- TMPL_VAR NAME="serial" --></td></tr>
|
||||
</table>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSE -->
|
||||
<p>No physical items for this record</p>
|
||||
<!-- /TMPL_IF -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue