+my $marcnotesarray = GetMarcNotes( $record, $marcflavour );
+my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
+my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
+my $marcseriesarray = GetMarcSeries($record,$marcflavour);
+my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
+my $subtitle = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $record, '');
+
+# Get Branches, Itemtypes and Locations
+my $branches = GetBranches();
+my $itemtypes = GetItemTypes();
+my $dbh = C4::Context->dbh;
+
+# change back when ive fixed request.pl
+my @items = &GetItemsInfo( $biblionumber, 'intra' );
+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;
+ my $serials_to_display;
+ $cell{subscriptionid} = $subscription->{subscriptionid};
+ $cell{subscriptionnotes} = $subscription->{notes};
+ $cell{branchcode} = $subscription->{branchcode};
+ $cell{hasalert} = $subscription->{hasalert};
+ #get the three latest serials.
+ $serials_to_display = $subscription->{staffdisplaycount};
+ $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
+ $cell{staffdisplaycount} = $serials_to_display;
+ $cell{latestserials} =
+ GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
+ push @subs, \%cell;
+}
+
+if ( defined $dat->{'itemtype'} ) {
+ $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
+}
+$dat->{'count'} = scalar @items;
+my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
+my $collections = GetKohaAuthorisedValues('items.ccode' , $fw);
+my (@itemloop, %itemfields);
+my $norequests = 1;
+my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
+my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw);
+foreach my $item (@items) {
+
+ # can place holds defaults to yes
+ $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
+
+ # format some item fields for display
+ if ( defined $item->{'publictype'} ) {
+ $item->{ $item->{'publictype'} } = 1;
+ }
+ $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl})
+ : '';
+
+ foreach (qw(datedue datelastseen onloan)) {
+ $item->{$_} = format_date($item->{$_});
+ }
+ # item damaged, lost, withdrawn loops
+ $item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost;
+ if ($item->{damaged}) {
+ $item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged;
+ }
+ #get shelf location and collection code description if they are authorised value.
+ my $shelfcode = $item->{'location'};
+ $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
+ my $ccode = $item->{'ccode'};
+ $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
+ foreach (qw(ccode enumchron copynumber)) {
+ $itemfields{$_} = 1 if ( $item->{$_} );
+ }
+
+ # checking for holds
+ my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($item->{itemnumber});
+ my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);