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
39 my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user
( {
40 template_name
=> 'admin/oai_sets.tt',
44 flagsrequired
=> { 'parameters' => 'parameters_remaining_permissions' },
48 my $op = $input->param('op');
50 if($op && $op eq "new") {
51 $template->param( op_new
=> 1 );
52 } elsif($op && $op eq "savenew") {
53 my $spec = $input->param('spec');
54 my $name = $input->param('name');
55 my @descriptions = $input->param('description');
59 descriptions
=> \
@descriptions
61 } elsif($op && $op eq "mod") {
62 my $id = $input->param('id');
63 my $set = GetOAISet
($id);
67 spec
=> $set->{'spec'},
68 name
=> $set->{'name'},
69 descriptions
=> [ map { {description
=> $_} } @
{ $set->{'descriptions'} } ],
71 } elsif($op && $op eq "savemod") {
72 my $id = $input->param('id');
73 my $spec = $input->param('spec');
74 my $name = $input->param('name');
75 my @descriptions = $input->param('description');
80 descriptions
=> \
@descriptions
82 } elsif($op && $op eq "del") {
83 my $id = $input->param('id');
87 my $OAISets = GetOAISets
;
94 descriptions
=> [ map { {description
=> $_} } @
{ $_->{'descriptions'} } ]
99 sets_loop
=> \
@sets_loop,
102 output_html_with_http_headers
$input, $cookie, $template->output;