Bug 11030 - Add 359, 947 and 969 fields in french unimarc_complete framework - followup
[koha_fer] / suggestion / suggestion.pl
index 7d50447..949cca3 100755 (executable)
@@ -31,6 +31,7 @@ use C4::Search;
 use C4::Dates qw(format_date);
 use C4::Members;
 use C4::Debug;
+use URI::Escape;
 
 sub Init{
     my $suggestion= shift @_;
@@ -182,7 +183,20 @@ elsif ($op eq "change" ) {
         $$suggestion_ref{'suggestionid'}=$suggestionid;
         &ModSuggestion($suggestion_ref);
     }
-    $op = 'else';
+    my $params = '';
+    foreach my $key (
+        qw(
+        displayby branchcode title author isbn publishercode copyrightdate
+        collectiontitle suggestedby suggesteddate_from suggesteddate_to
+        manageddate_from manageddate_to accepteddate_from
+        accepteddate_to budgetid
+        )
+      )
+    {
+        $params .= $key . '=' . uri_escape($input->param($key)) . '&'
+          if defined($input->param($key));
+    }
+    print $input->redirect("/cgi-bin/koha/suggestion/suggestion.pl?$params");
 }elsif ($op eq "delete" ) {
     foreach my $delete_field (@editsuggestions) {
         &DelSuggestion( $borrowernumber, $delete_field,'intranet' );
@@ -288,10 +302,11 @@ if(defined($returnsuggested) and $returnsuggested ne "noone")
 
 #branch display management
 my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : '';
-my $onlymine=C4::Context->preference('IndependentBranches') &&
-            C4::Context->userenv && 
-            C4::Context->userenv->{flags}!=1 && 
-            C4::Context->userenv->{branch};
+my $onlymine =
+     C4::Context->preference('IndependentBranches')
+  && C4::Context->userenv
+  && !C4::Context->IsSuperLibrarian()
+  && C4::Context->userenv->{branch};
 my $branches = GetBranches($onlymine);
 my @branchloop;