2 # Copyright 2009 SARL BibLibre
4 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2 of the License, or (at your option) any later
11 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with Koha; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 my $framework = $query->param('framework') || "";
31 my $field = $query->param('fieldname');
32 my $fieldcode = $query->param('marcfield');
33 my $subfieldcode = $query->param('marcsubfield');
34 my $op = $query->param('op');
35 my $id = $query->param('id');
37 my ($template, $loggedinuser, $cookie)
38 = get_template_and_user
({template_name
=> "admin/fieldmapping.tmpl",
42 flagsrequired
=> {parameters
=> 'parameters_remaining_permissions'},
47 my $frameworks = getframeworks
();
51 foreach my $thisframeworkcode (keys %$frameworks) {
52 if ($thisframeworkcode eq $framework){
54 $frameworktext = $frameworks->{$thisframeworkcode}->{'frameworktext'};
58 my %row =(value
=> $thisframeworkcode,
59 selected
=> $selected,
60 frameworktext
=> $frameworks->{$thisframeworkcode}->{'frameworktext'},
62 push @frameworkloop, \
%row;
65 if($op eq "delete" and $id){
66 DeleteFieldMapping
($id);
67 print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$framework);
72 if($field and $fieldcode){
73 SetFieldMapping
($framework, $field, $fieldcode, $subfieldcode);
76 my $fieldloop = GetFieldMapping
($framework);
78 $template->param( frameworkloop
=> \
@frameworkloop,
79 framework
=> $framework,
80 frameworktext
=> $frameworktext,
84 output_html_with_http_headers
$query, $cookie, $template->output;