my $subscriptionid = $query->param('subscriptionid');
$subs = GetSubscription($subscriptionid);
-## FIXME : Check rights to edit if mod. Could/Should display an error message.
+
+ ## FIXME : Check rights to edit if mod. Could/Should display an error message.
if ($subs->{'cannotedit'} && $op eq 'modify'){
carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
}
}
-my $onlymine=C4::Context->preference('IndependantBranches') &&
- C4::Context->userenv &&
- C4::Context->userenv->{flags} % 2 !=1 &&
- C4::Context->userenv->{branch};
+my $onlymine =
+ C4::Context->preference('IndependentBranches')
+ && C4::Context->userenv
+ && !C4::Context->IsSuperLibrarian
+ && (
+ not C4::Auth::haspermission( C4::Context->userenv->{id}, { serials => 'superserials' } )
+ )
+ && C4::Context->userenv->{branch};
my $branches = GetBranches($onlymine);
my $branchloop;
for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %{$branches}) {
}
$template->param(numberpatterns => \@numberpatternloop);
- # Get installed locales
- # FIXME this will not work with all environments.
- # If call to locale fails, @locales will be an empty array, which is fine.
- my @locales = map {
- chomp;
- # we don't want POSIX and C locales
- /^C|^POSIX$/ ? () : $_
- } `locale -a`;
- $template->param(locales => \@locales);
+ my $languages = [ map {
+ {
+ language => $_->{iso639_2_code},
+ description => $_->{language_description} || $_->{language}
+ }
+ } @{ C4::Languages::getAllLanguages() } ];
+
+ $template->param( locales => $languages );
output_html_with_http_headers $query, $cookie, $template->output;
}