test.pl, contains a script to test the Catalogue.pm stuff.
[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::Search;
9 use CGI;
10 my $input=new CGI;
11
12 my $module=$input->param('module');
13
14 SWITCH: {
15     if ($module eq 'acquisitions') { acquisitions(); last SWITCH; }
16     if ($module eq 'somethingelse') { somethingelse(); last SWITCH; }
17 }
18
19
20 sub acquisitions {
21     # FIXME
22     # instead of getting a hash, then reading/writing to it at least twice 
23     # and up to four times, maybe this should be a different function -
24     # areAquisitionsSimple() which returns a boolean
25     my %systemprefs=systemprefs();
26     ($systemprefs{'acquisitions'}) || ($systemprefs{'acquisitions'}='normal');
27     if ($systemprefs{'acquisitions'} eq 'simple') {
28         print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl");
29     } elsif ($systemprefs{'acquisitions'} eq 'normal') {
30         print $input ->redirect("/acquisitions");
31     } else {
32         print $input ->redirect("/acquisitions");
33     }
34 }
35
36
37 sub somethingelse {
38 # just an example subroutine
39 }