|
Lines 1024-1030
sub GetLostItems {
Link Here
|
| 1024 |
|
1024 |
|
| 1025 |
=head2 GetItemsForInventory |
1025 |
=head2 GetItemsForInventory |
| 1026 |
|
1026 |
|
| 1027 |
($itemlist, $iTotalRecords) = GetItemsForInventory($minlocation, $maxlocation, $location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $offset, $size, $statushash); |
1027 |
($itemlist, $iTotalRecords) = GetItemsForInventory( { |
|
|
1028 |
minlocation => $minlocation, |
| 1029 |
maxlocation => $maxlocation, |
| 1030 |
location => $location, |
| 1031 |
itemtype => $itemtype, |
| 1032 |
ignoreissued => $ignoreissued, |
| 1033 |
datelastseen => $datelastseen, |
| 1034 |
branchcode => $branchcode, |
| 1035 |
branch => $branch, |
| 1036 |
offset => $offset, |
| 1037 |
size => $size, |
| 1038 |
stautshash => $statushash |
| 1039 |
interface => $interface, |
| 1040 |
} ); |
| 1028 |
|
1041 |
|
| 1029 |
Retrieve a list of title/authors/barcode/callnumber, for biblio inventory. |
1042 |
Retrieve a list of title/authors/barcode/callnumber, for biblio inventory. |
| 1030 |
|
1043 |
|
|
Lines 1042-1048
$iTotalRecords is the number of rows that would have been returned without the $
Link Here
|
| 1042 |
=cut |
1055 |
=cut |
| 1043 |
|
1056 |
|
| 1044 |
sub GetItemsForInventory { |
1057 |
sub GetItemsForInventory { |
| 1045 |
my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $size, $statushash ) = @_; |
1058 |
my ( $parameters ) = @_; |
|
|
1059 |
my $minlocation = $parameters->{'minlocation'} // ''; |
| 1060 |
my $maxlocation = $parameters->{'maxlocation'} // ''; |
| 1061 |
my $location = $parameters->{'location'} // ''; |
| 1062 |
my $itemtype = $parameters->{'itemtype'} // ''; |
| 1063 |
my $ignoreissued = $parameters->{'ignoreissued'} // ''; |
| 1064 |
my $datelastseen = $parameters->{'datelastseen'} // ''; |
| 1065 |
my $branchcode = $parameters->{'branchcode'} // ''; |
| 1066 |
my $branch = $parameters->{'branch'} // ''; |
| 1067 |
my $offset = $parameters->{'offset'} // ''; |
| 1068 |
my $size = $parameters->{'size'} // ''; |
| 1069 |
my $statushash = $parameters->{'statushash'} // ''; |
| 1070 |
|
| 1046 |
my $dbh = C4::Context->dbh; |
1071 |
my $dbh = C4::Context->dbh; |
| 1047 |
my ( @bind_params, @where_strings ); |
1072 |
my ( @bind_params, @where_strings ); |
| 1048 |
|
1073 |
|
|
Lines 1121-1136
sub GetItemsForInventory {
Link Here
|
| 1121 |
$sth->execute( @bind_params ); |
1146 |
$sth->execute( @bind_params ); |
| 1122 |
my ($iTotalRecords) = $sth->fetchrow_array(); |
1147 |
my ($iTotalRecords) = $sth->fetchrow_array(); |
| 1123 |
|
1148 |
|
|
|
1149 |
my $avmapping = C4::Koha::GetKohaAuthorisedValuesMapping( { |
| 1150 |
interface => 'unknown' |
| 1151 |
} ); |
| 1124 |
foreach my $row (@$tmpresults) { |
1152 |
foreach my $row (@$tmpresults) { |
| 1125 |
|
1153 |
|
| 1126 |
# Auth values |
1154 |
# Auth values |
| 1127 |
foreach (keys %$row) { |
1155 |
foreach (keys %$row) { |
| 1128 |
# If the koha field is mapped to a marc field |
1156 |
if (defined($avmapping->{"items.$_,".$row->{'frameworkcode'}.",".$row->{$_}})) { |
| 1129 |
my ($f, $sf) = GetMarcFromKohaField("items.$_", $row->{'frameworkcode'}); |
1157 |
$row->{$_} = $avmapping->{"items.$_,".$row->{'frameworkcode'}.",".$row->{$_}}; |
| 1130 |
if ($f and $sf) { |
|
|
| 1131 |
# We replace the code with it's description |
| 1132 |
my $authvals = C4::Koha::GetKohaAuthorisedValuesFromField($f, $sf, $row->{'frameworkcode'}); |
| 1133 |
$row->{$_} = $authvals->{$row->{$_}} if defined $authvals->{$row->{$_}}; |
| 1134 |
} |
1158 |
} |
| 1135 |
} |
1159 |
} |
| 1136 |
push @results, $row; |
1160 |
push @results, $row; |