3 # Copyright 2011 BibLibre SARL
4 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # Koha is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Koha; if not, see <http://www.gnu.org/licenses>.
25 Admin page to describe OAI SETs
32 use C4::Auth qw( get_template_and_user );
33 use C4::Output qw( output_html_with_http_headers );
34 use C4::OAI::Sets qw( AddOAISet DelOAISet GetOAISet GetOAISets ModOAISet );
38 my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
39 template_name => 'admin/oai_sets.tt',
42 flagsrequired => { 'parameters' => 'manage_oai_sets' },
45 my $op = $input->param('op');
47 if($op && $op eq "new") {
48 $template->param( op_new => 1 );
49 } elsif($op && $op eq "savenew") {
50 my $spec = $input->param('spec');
51 my $name = $input->param('name');
52 my @descriptions = $input->multi_param('description');
56 descriptions => \@descriptions
58 } elsif($op && $op eq "mod") {
59 my $id = $input->param('id');
60 my $set = GetOAISet($id);
64 spec => $set->{'spec'},
65 name => $set->{'name'},
66 descriptions => [ map { {description => $_} } @{ $set->{'descriptions'} } ],
68 } elsif($op && $op eq "savemod") {
69 my $id = $input->param('id');
70 my $spec = $input->param('spec');
71 my $name = $input->param('name');
72 my @descriptions = $input->multi_param('description');
77 descriptions => \@descriptions
79 } elsif($op && $op eq "del") {
80 my $id = $input->param('id');
84 my $OAISets = GetOAISets;
91 descriptions => [ map { {description => $_} } @{ $_->{'descriptions'} } ]
96 sets_loop => \@sets_loop,
99 output_html_with_http_headers $input, $cookie, $template->output;