MT 1975 : Adding records to a list, corrected pop-up height
[koha_fer] / suggestion / acceptorreject.pl
index 6147b34..d4615a1 100755 (executable)
@@ -106,7 +106,7 @@ my $suggestions;
 my $branchcode;
 my $userenv = C4::Context->userenv;
 if ($userenv) {
-    unless ($userenv->{flags} == 1){
+    unless ($userenv->{flags} % 2 == 1){
         $branchcode=$userenv->{branch};
     }
 }
@@ -186,3 +186,24 @@ $template->param(
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
+my @allsuggestions;
+foreach my $status ('ASKED','CHECKED','REJECTED','ACCEPTED'){
+    my $suggestions = &GetSuggestionByStatus( $status, $branchcode );
+    map{
+        $_->{$status}=1 unless ($status eq 'ASKED' ||$status eq 'PENDING');
+        $_->{'reasonsloop'}=$reasonsloop;
+        $_->{'suggestioncreatedon'}=format_date($_->{'suggestioncreatedon'})
+        } @$suggestions;
+    
+    push @allsuggestions,{"suggestiontype"=>($status eq 'ASKED'?"pending":lc $status),
+                        'suggestions_loop'=>$suggestions,
+                        'reasonsloop' => $reasonsloop};
+}
+>>>>>>> suggestions changes (probably useless):suggestion/acceptorreject.pl
+$template->param(
+    suggestions => \@allsuggestions,
+    "op_$op"    => 1,
+    dateformat  => C4::Context->preference("dateformat"),
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;