(bug #3348) still fixing funds and budget table
[koha.git] / cataloguing / addbooks.pl
index 00ccd7a..968ee65 100755 (executable)
@@ -57,8 +57,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 # get framework list
 my $frameworks = getframeworks;
 my @frameworkcodeloop;
-foreach my $thisframeworkcode ( keys %{$frameworks} ) {
-    push @frameworkcodeloop, {
+foreach my $thisframeworkcode ( sort keys %$frameworks ) {
+    push @frameworkcodeloop,{
         value         => $thisframeworkcode,
         frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
     };
@@ -110,14 +110,13 @@ if ($query) {
     ( $countbr, @resultsbr ) = BreedingSearch( $title, $isbn );
 }
 my $breeding_loop = [];
-my $id = 0;
 for my $resultsbr (@resultsbr) {
     push @{$breeding_loop}, {
-        id               => $id++,
+        id               => $resultsbr->{import_record_id},
         isbn             => $resultsbr->{isbn},
         copyrightdate    => $resultsbr->{copyrightdate},
         editionstatement => $resultsbr->{editionstatement},
-        file             => $resultsbr->{file},
+        file             => $resultsbr->{file_name},
         title            => $resultsbr->{title},
         author           => $resultsbr->{author},
     };