|
Lines 38-50
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 38 |
query => $input, |
38 |
query => $input, |
| 39 |
type => "intranet", |
39 |
type => "intranet", |
| 40 |
authnotrequired => 0, |
40 |
authnotrequired => 0, |
| 41 |
flagsrequired => { editcatalogue => '*' }, |
41 |
flagsrequired => { tools => 'upload_general_files' }, |
| 42 |
} |
42 |
} |
| 43 |
); |
43 |
); |
| 44 |
|
44 |
|
| 45 |
$template->param( |
45 |
$template->param( |
| 46 |
plugin => $plugin, |
46 |
index => $index, |
| 47 |
index => $index, |
47 |
owner => $loggedinuser, |
|
|
48 |
plugin => $plugin, |
| 48 |
); |
49 |
); |
| 49 |
|
50 |
|
| 50 |
my $upar = $plugin ? { public => 1 } : {}; |
51 |
my $upar = $plugin ? { public => 1 } : {}; |
|
Lines 54-59
if ( $op eq 'new' ) {
Link Here
|
| 54 |
uploadcategories => Koha::Upload->getCategories, |
55 |
uploadcategories => Koha::Upload->getCategories, |
| 55 |
); |
56 |
); |
| 56 |
output_html_with_http_headers $input, $cookie, $template->output; |
57 |
output_html_with_http_headers $input, $cookie, $template->output; |
|
|
58 |
|
| 57 |
} elsif ( $op eq 'search' ) { |
59 |
} elsif ( $op eq 'search' ) { |
| 58 |
my $h = $id ? { id => $id } : { term => $term }; |
60 |
my $h = $id ? { id => $id } : { term => $term }; |
| 59 |
my @uploads = Koha::Upload->new($upar)->get($h); |
61 |
my @uploads = Koha::Upload->new($upar)->get($h); |
|
Lines 63-70
if ( $op eq 'new' ) {
Link Here
|
| 63 |
uploads => \@uploads, |
65 |
uploads => \@uploads, |
| 64 |
); |
66 |
); |
| 65 |
output_html_with_http_headers $input, $cookie, $template->output; |
67 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 66 |
} elsif ( $op eq 'delete' ) { |
|
|
| 67 |
|
68 |
|
|
|
69 |
} elsif ( $op eq 'delete' ) { |
| 68 |
# delete only takes the id parameter |
70 |
# delete only takes the id parameter |
| 69 |
my $upl = Koha::Upload->new($upar); |
71 |
my $upl = Koha::Upload->new($upar); |
| 70 |
my ($fn) = $upl->delete( { id => $id } ); |
72 |
my ($fn) = $upl->delete( { id => $id } ); |
|
Lines 79-84
if ( $op eq 'new' ) {
Link Here
|
| 79 |
uploadcategories => $upl->getCategories, |
81 |
uploadcategories => $upl->getCategories, |
| 80 |
); |
82 |
); |
| 81 |
output_html_with_http_headers $input, $cookie, $template->output; |
83 |
output_html_with_http_headers $input, $cookie, $template->output; |
|
|
84 |
|
| 82 |
} elsif ( $op eq 'download' ) { |
85 |
} elsif ( $op eq 'download' ) { |
| 83 |
my $upl = Koha::Upload->new($upar); |
86 |
my $upl = Koha::Upload->new($upar); |
| 84 |
my $rec = $upl->get( { id => $id, filehandle => 1 } ); |
87 |
my $rec = $upl->get( { id => $id, filehandle => 1 } ); |
| 85 |
- |
|
|