View | Details | Raw Unified | Return to bug 13540
Collapse All | Expand All

(-)a/C4/Items.pm (-19 / +1 lines)
Lines 959-980 sub GetItemLocation { Link Here
959
    return \%itemlocation;
959
    return \%itemlocation;
960
}
960
}
961
961
962
=head GetRealItemLocations
963
964
    my $locations = C4::Items::GetRealItemLocations($itemnumber);
965
966
A convenience function of getting just the Item location and permanent_location
967
@PARAM1, Long, the koha-items.itemnumber
968
@RETURNS, Reference to Hash, with koha.items.location and permanent_location as hash keys.
969
970
=cut
971
sub GetRealItemLocations {
972
    my $itemnumber = shift;
973
    my $sth = C4::Context->dbh()->prepare('SELECT location, permanent_location FROM items WHERE itemnumber = ?');
974
    $sth->execute($itemnumber);
975
    return $sth->fetchrow_hashref();
976
}
977
978
=head2 GetLostItems
962
=head2 GetLostItems
979
963
980
  $items = GetLostItems( $where );
964
  $items = GetLostItems( $where );
Lines 2071-2078 sub _do_column_fixes_for_mod { Link Here
2071
        else {
2055
        else {
2072
            #Preserve the old permanent_location in face of adversity!
2056
            #Preserve the old permanent_location in face of adversity!
2073
            #Don't let it fall to 'PROC' or 'CART'. Otherwise it will be forever lost!
2057
            #Don't let it fall to 'PROC' or 'CART'. Otherwise it will be forever lost!
2074
            my $locations = GetRealItemLocations( $item->{itemnumber} );
2058
            $item->{'permanent_location'} = C4::Items::GetItem($item->{itemnumber})->{permanent_location};
2075
            $item->{'permanent_location'} = $locations->{'permanent_location'};
2076
        }
2059
        }
2077
    }
2060
    }
2078
    if (exists $item->{'timestamp'}) {
2061
    if (exists $item->{'timestamp'}) {
2079
- 

Return to bug 13540