Lines 24-33
use C4::Biblio;
Link Here
|
24 |
use C4::Koha; |
24 |
use C4::Koha; |
25 |
use C4::Output; |
25 |
use C4::Output; |
26 |
|
26 |
|
27 |
my $query = new CGI; |
27 |
use Koha::BiblioFrameworks; |
28 |
|
28 |
|
29 |
my $framework = $query->param('framework') || ""; |
29 |
my $query = new CGI; |
30 |
|
30 |
|
|
|
31 |
my $frameworkcode = $query->param('framework') || ""; |
31 |
my $field = $query->param('fieldname'); |
32 |
my $field = $query->param('fieldname'); |
32 |
my $fieldcode = $query->param('marcfield'); |
33 |
my $fieldcode = $query->param('marcfield'); |
33 |
my $subfieldcode = $query->param('marcsubfield'); |
34 |
my $subfieldcode = $query->param('marcsubfield'); |
Lines 43-84
my ($template, $loggedinuser, $cookie)
Link Here
|
43 |
debug => 1, |
44 |
debug => 1, |
44 |
}); |
45 |
}); |
45 |
|
46 |
|
46 |
# get framework list |
|
|
47 |
my $frameworks = getframeworks(); |
48 |
my @frameworkloop; |
49 |
my $selected; |
50 |
my $frameworktext; |
51 |
foreach my $thisframeworkcode (keys %$frameworks) { |
52 |
if ($thisframeworkcode eq $framework){ |
53 |
$selected = 1; |
54 |
$frameworktext = $frameworks->{$thisframeworkcode}->{'frameworktext'}; |
55 |
} else { |
56 |
$selected = 0; |
57 |
} |
58 |
my %row =(value => $thisframeworkcode, |
59 |
selected => $selected, |
60 |
frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, |
61 |
); |
62 |
push @frameworkloop, \%row; |
63 |
} |
64 |
|
65 |
if($op eq "delete" and $id){ |
47 |
if($op eq "delete" and $id){ |
66 |
DeleteFieldMapping($id); |
48 |
DeleteFieldMapping($id); |
67 |
print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$framework); |
49 |
print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$frameworkcode); |
68 |
exit; |
50 |
exit; |
69 |
} |
51 |
} |
70 |
|
52 |
|
71 |
# insert operation |
53 |
# insert operation |
72 |
if($field and $fieldcode){ |
54 |
if($field and $fieldcode){ |
73 |
SetFieldMapping($framework, $field, $fieldcode, $subfieldcode); |
55 |
SetFieldMapping($frameworkcode, $field, $fieldcode, $subfieldcode); |
74 |
} |
56 |
} |
75 |
|
57 |
|
76 |
my $fieldloop = GetFieldMapping($framework); |
58 |
my $fieldloop = GetFieldMapping($frameworkcode); |
77 |
|
59 |
|
78 |
$template->param( frameworkloop => \@frameworkloop, |
60 |
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); |
79 |
framework => $framework, |
61 |
my $framework = $frameworks->search( { frameworkcode => $frameworkcode } )->next; |
80 |
frameworktext => $frameworktext, |
62 |
$template->param( |
81 |
fields => $fieldloop, |
63 |
frameworks => $frameworks, |
82 |
); |
64 |
framework => $framework, |
|
|
65 |
fields => $fieldloop, |
66 |
); |
83 |
|
67 |
|
84 |
output_html_with_http_headers $query, $cookie, $template->output; |
68 |
output_html_with_http_headers $query, $cookie, $template->output; |