|
Lines 63-68
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Link Here
|
| 63 |
); |
63 |
); |
| 64 |
|
64 |
|
| 65 |
my @messages; |
65 |
my @messages; |
|
|
66 |
my $my_branch = |
| 67 |
C4::Context->preference("IndependentBranches") |
| 68 |
&& !C4::Context->IsSuperLibrarian() |
| 69 |
? C4::Context->userenv()->{'branch'} |
| 70 |
: undef; |
| 66 |
if ( $op eq 'add_form' ) { |
71 |
if ( $op eq 'add_form' ) { |
| 67 |
|
72 |
|
| 68 |
my $additional_content = Koha::AdditionalContents->find($id); |
73 |
my $additional_content = Koha::AdditionalContents->find($id); |
|
Lines 72-77
if ( $op eq 'add_form' ) {
Link Here
|
| 72 |
$category = $additional_content->category; |
77 |
$category = $additional_content->category; |
| 73 |
} |
78 |
} |
| 74 |
$template->param( |
79 |
$template->param( |
|
|
80 |
my_branch => $my_branch, |
| 75 |
additional_content => $additional_content, |
81 |
additional_content => $additional_content, |
| 76 |
translated_contents => $translated_contents, |
82 |
translated_contents => $translated_contents, |
| 77 |
); |
83 |
); |
|
Lines 79-85
if ( $op eq 'add_form' ) {
Link Here
|
| 79 |
output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } ); |
85 |
output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } ); |
| 80 |
my $location = $cgi->param('location'); |
86 |
my $location = $cgi->param('location'); |
| 81 |
my $code = $cgi->param('code'); |
87 |
my $code = $cgi->param('code'); |
| 82 |
my $branchcode = $cgi->param('branchcode') || undef; |
88 |
my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef; |
| 83 |
|
89 |
|
| 84 |
my @lang = $cgi->multi_param('lang'); |
90 |
my @lang = $cgi->multi_param('lang'); |
| 85 |
|
91 |
|
|
Lines 227-233
if ( $op eq 'list' ) {
Link Here
|
| 227 |
{ category => $category, 'additional_contents_localizations.lang' => 'default' }, |
233 |
{ category => $category, 'additional_contents_localizations.lang' => 'default' }, |
| 228 |
{ order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' } |
234 |
{ order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' } |
| 229 |
); |
235 |
); |
| 230 |
$template->param( additional_contents => $additional_contents ); |
236 |
$template->param( additional_contents => $additional_contents, my_branch => $my_branch ); |
| 231 |
} |
237 |
} |
| 232 |
|
238 |
|
| 233 |
my $translated_languages = C4::Languages::getTranslatedLanguages(); |
239 |
my $translated_languages = C4::Languages::getTranslatedLanguages(); |
| 234 |
- |
|
|