|
Lines 61-66
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Link Here
|
| 61 |
); |
61 |
); |
| 62 |
|
62 |
|
| 63 |
my @messages; |
63 |
my @messages; |
|
|
64 |
my $my_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian() |
| 65 |
? C4::Context->userenv()->{'branch'} |
| 66 |
: undef; |
| 64 |
if ( $op eq 'add_form' ) { |
67 |
if ( $op eq 'add_form' ) { |
| 65 |
|
68 |
|
| 66 |
my $additional_content = Koha::AdditionalContents->find($id); |
69 |
my $additional_content = Koha::AdditionalContents->find($id); |
|
Lines 79-84
if ( $op eq 'add_form' ) {
Link Here
|
| 79 |
$category = $additional_content->category; |
82 |
$category = $additional_content->category; |
| 80 |
} |
83 |
} |
| 81 |
$template->param( |
84 |
$template->param( |
|
|
85 |
my_branch => $my_branch, |
| 82 |
additional_content => $additional_content, |
86 |
additional_content => $additional_content, |
| 83 |
translated_contents => $translated_contents, |
87 |
translated_contents => $translated_contents, |
| 84 |
); |
88 |
); |
|
Lines 87-93
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 87 |
output_and_exit_if_error($cgi, $cookie, $template, { check => 'csrf_token' }); |
91 |
output_and_exit_if_error($cgi, $cookie, $template, { check => 'csrf_token' }); |
| 88 |
my $location = $cgi->param('location'); |
92 |
my $location = $cgi->param('location'); |
| 89 |
my $code = $cgi->param('code'); |
93 |
my $code = $cgi->param('code'); |
| 90 |
my $branchcode = $cgi->param('branchcode') || undef; |
94 |
my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef; |
| 91 |
my $idnew = $cgi->param('idnew'); |
95 |
my $idnew = $cgi->param('idnew'); |
| 92 |
|
96 |
|
| 93 |
my @lang = $cgi->multi_param('lang'); |
97 |
my @lang = $cgi->multi_param('lang'); |
|
Lines 235-241
if ( $op eq 'list' ) {
Link Here
|
| 235 |
{ category => $category, lang => 'default' }, |
239 |
{ category => $category, lang => 'default' }, |
| 236 |
{ order_by => { -desc => 'published_on' } } |
240 |
{ order_by => { -desc => 'published_on' } } |
| 237 |
); |
241 |
); |
| 238 |
$template->param( additional_contents => $additional_contents ); |
242 |
$template->param( additional_contents => $additional_contents, my_branch => $my_branch ); |
| 239 |
} |
243 |
} |
| 240 |
|
244 |
|
| 241 |
my $translated_languages = C4::Languages::getTranslatedLanguages; |
245 |
my $translated_languages = C4::Languages::getTranslatedLanguages; |
| 242 |
- |
|
|