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 = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian() |
67 |
? C4::Context->userenv()->{'branch'} |
68 |
: undef; |
66 |
if ( $op eq 'add_form' ) { |
69 |
if ( $op eq 'add_form' ) { |
67 |
|
70 |
|
68 |
my $additional_content = Koha::AdditionalContents->find($id); |
71 |
my $additional_content = Koha::AdditionalContents->find($id); |
Lines 72-77
if ( $op eq 'add_form' ) {
Link Here
|
72 |
$category = $additional_content->category; |
75 |
$category = $additional_content->category; |
73 |
} |
76 |
} |
74 |
$template->param( |
77 |
$template->param( |
|
|
78 |
my_branch => $my_branch, |
75 |
additional_content => $additional_content, |
79 |
additional_content => $additional_content, |
76 |
translated_contents => $translated_contents, |
80 |
translated_contents => $translated_contents, |
77 |
); |
81 |
); |
Lines 80-86
elsif ( $op eq 'cud-add_validate' ) {
Link Here
|
80 |
output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } ); |
84 |
output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } ); |
81 |
my $location = $cgi->param('location'); |
85 |
my $location = $cgi->param('location'); |
82 |
my $code = $cgi->param('code'); |
86 |
my $code = $cgi->param('code'); |
|
|
87 |
<<<<<<< HEAD |
83 |
my $branchcode = $cgi->param('branchcode') || undef; |
88 |
my $branchcode = $cgi->param('branchcode') || undef; |
|
|
89 |
======= |
90 |
my $branchcode = $my_branch ? $my_branch : $cgi->param('branchcode') || undef; |
91 |
my $idnew = $cgi->param('idnew'); |
92 |
>>>>>>> Bug 34631: Independentbranches - Non-superuser should not be able to write Additional contents for other branches |
84 |
|
93 |
|
85 |
my @lang = $cgi->multi_param('lang'); |
94 |
my @lang = $cgi->multi_param('lang'); |
86 |
|
95 |
|
Lines 223-229
if ( $op eq 'list' ) {
Link Here
|
223 |
{ category => $category, 'additional_contents_localizations.lang' => 'default' }, |
232 |
{ category => $category, 'additional_contents_localizations.lang' => 'default' }, |
224 |
{ order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' } |
233 |
{ order_by => { -desc => 'published_on' }, join => 'additional_contents_localizations' } |
225 |
); |
234 |
); |
226 |
$template->param( additional_contents => $additional_contents ); |
235 |
$template->param( additional_contents => $additional_contents, my_branch => $my_branch ); |
227 |
} |
236 |
} |
228 |
|
237 |
|
229 |
my $translated_languages = C4::Languages::getTranslatedLanguages; |
238 |
my $translated_languages = C4::Languages::getTranslatedLanguages; |
230 |
- |
|
|