From c8952af16941f620e1a177f512d1c62110a3dcfb Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 5 Jun 2003 12:27:08 +0000 Subject: [PATCH] gui reordering. In loadmodule, now you can force a specific systempref. removed MARC topic and added addbiblio topic. --- loadmodules.pl | 60 +++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/loadmodules.pl b/loadmodules.pl index 785b881496..59e873109f 100755 --- a/loadmodules.pl +++ b/loadmodules.pl @@ -31,29 +31,45 @@ my $module=$input->param('module'); SWITCH: { if ($module eq 'acquisitions') { acquisitions(); last SWITCH; } if ($module eq 'search') { catalogue_search(); last SWITCH; } - if ($module eq 'MARC') {marc(); last SWITCH; } + if ($module eq 'addbiblio') {addbiblio(); last SWITCH;} if ($module eq 'somethingelse') { somethingelse(); last SWITCH; } } sub acquisitions { - my $aq_type = C4::Context->preference("acquisitions") || "normal"; - # Get the acquisition preference. This should be: - # "simple" - minimal information required - # "normal" - full information required - # other - Same as "normal" - - if ($aq_type eq 'simple') { - print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl"); - } elsif ($aq_type eq 'normal') { - print $input ->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); - } else { - print $input ->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); - } + my $aq_type = $input->param('acquisitions'); + $aq_type = C4::Context->preference("acquisitions") || "normal" unless $aq_type; + my $marc_bool =$input->param('MARC'); + $marc_bool = C4::Context->preference("MARC") ||"OFF" unless $marc_bool; + + # Get the acquisition preference. This should be: + # "simple" - minimal information required + # "normal" - full information required + # other - Same as "normal" + + if ($aq_type eq 'simple') { + if ($marc_bool eq "ON") { + print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl"); + } else { + print $input->redirect("/cgi-bin/koha/acqui.simple/addbiblio-nomarc.pl"); + } + } else { + print $input ->redirect("/cgi-bin/koha/acqui/acqui-home.pl"); + } +} + +sub addbiblio { + my $marc_bool = C4::Context->preference("MARC") ||"OFF"; + if ($marc_bool eq "ON") { + print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl"); + } else { + print $input->redirect("/cgi-bin/koha/acqui.simple/addbiblio-nomarc.pl"); + } } sub catalogue_search { - my $marc_p = C4::Context->boolean_preference("marc"); - $marc_p = 1 unless defined $marc_p; + my $marc_p = $input->param('marc'); + $marc_p = C4::Context->boolean_preference('marc') unless defined $marc_p; + $marc_p = 'ON' unless defined $marc_p; my $keyword=$input->param('keyword'); my $query = new CGI; my $type = $query->param('type'); @@ -72,18 +88,6 @@ sub catalogue_search { } } -sub marc { -# my $marc_p = C4::Context->boolean_preference("marc"); -# $marc_p = 1 unless defined $marc_p; -# my $query = new CGI; -# my $type = $query->param('type'); -# if ($marc_p) { -# print $input->redirect("/cgi-bin/koha/cataloguing.marc/cataloguing-home.pl"); -# } else { - print $input ->redirect("/cgi-bin/koha/acqui.simple/isbnsearch.pl"); -# } -} - sub somethingelse { # just an example subroutine } -- 2.39.5