3 # Script to manage the educational institutions and its careers.
5 # CastaƱeda, Carlos Sebastian - seba3c@yahoo.com.ar - Physics Library UNLP Argentina
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
30 use C4::Interface::CGI::Output;
35 my ($template, $borrowernumber, $cookie)
36 = get_template_and_user({template_name => "admin/institutions-careers.tmpl",
40 flagsrequired => {editcatalogue => 1},
44 my $op = $cgi->param('op');
45 my $id_institution = $cgi->param('id_institution');
46 my $institution_name = $cgi->param('institution_name');
48 if ($op eq 'add_form') {
49 $template->param(add_form => 1);
51 if ($id_institution) {
52 my $info = get_educational_institution($id_institution);
53 $template->param(op => 'edit');
54 $template->param(institution_name => $info->{'institution_name'});
55 $template->param(id_institution => $id_institution);
57 $template->param(op => 'add');
60 } elsif ($op eq 'add') {
61 add_educational_institution($institution_name);
62 print $cgi->redirect('/cgi-bin/koha/admin/institutions-careers.pl');
63 } elsif ($op eq 'edit') {
64 update_educational_institution($id_institution, $institution_name);
65 print $cgi->redirect('/cgi-bin/koha/admin/institutions-careers.pl');
66 } elsif ($op eq 'del') {
67 del_educational_institution($id_institution);
68 print $cgi->redirect('/cgi-bin/koha/admin/institutions-careers.pl');
70 my @educ_institutions = &get_careers_by_institution();
71 $template->param(institutions => \@educ_institutions);
74 output_html_with_http_headers $cgi, $cookie, $template->output;