Making sure fix makes it into the main branch as well
[koha.git] / loadmodules.pl
1 #!/usr/bin/perl
2
3 #script to show list of budgets and bookfunds
4 #written 4/2/00 by chris@katipo.co.nz
5 #called as an include by the acquisitions index page
6
7 use C4::Acquisitions;
8 use C4::Biblio;
9 use C4::Search;
10 use CGI;
11 my $input=new CGI;
12
13 my $module=$input->param('module');
14
15 SWITCH: {
16     if ($module eq 'acquisitions') { acquisitions(); last SWITCH; }
17     if ($module eq 'somethingelse') { somethingelse(); last SWITCH; }
18 }
19
20
21 sub acquisitions {
22     # FIXME
23     # instead of getting a hash, then reading/writing to it at least twice 
24     # and up to four times, maybe this should be a different function -
25     # areAquisitionsSimple() which returns a boolean
26     my %systemprefs=systemprefs();
27     ($systemprefs{'acquisitions'}) || ($systemprefs{'acquisitions'}='normal');
28     if ($systemprefs{'acquisitions'} eq 'simple') {
29         print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl");
30     } elsif ($systemprefs{'acquisitions'} eq 'normal') {
31         print $input ->redirect("/acquisitions");
32     } else {
33         print $input ->redirect("/acquisitions");
34     }
35 }
36
37
38 sub somethingelse {
39 # just an example subroutine
40 }