From ff56cc262019fe20d8b62779d6237a6c52d531ff Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 30 Jan 2017 18:27:57 +1300 Subject: [PATCH] Bug 17956 - Added in a retrieval and count of all z3950targets from the database. This value is handed to the template, and is used to determine whether or not to display the z-target configuration link in onboardingstep6.tt --- installer/onboarding.pl | 33 ++++++++++++++-------- .../prog/en/modules/onboarding/onboardingstep6.tt | 8 ++++-- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index c3d718e..d8fa232 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -129,10 +129,15 @@ $template->param( my $categories = Koha::Patron::Categories->search(); $template->param( 'categories' => $categories, ); -#Check if the $step variable equals 1 i.e. the user has clicked to create a library in the create library screen 1 +#Select all the itemtype records in the itemtypes database table and give them to the template my $itemtypes = Koha::ItemTypes->search(); $template->param( 'itemtypes' => $itemtypes, ); +#Select all the ztarget records in the z3950server table and give them to the template + my $existingztargets = $schema->Resultset('Z3950server')->count; + $template->param(existingztargets => $existingztargets); + + if ( $step && $step == 1 ) { #store inputted parameters in variables my $branchcode = $input->param('branchcode'); @@ -684,17 +689,21 @@ elsif ( $step && $step == 5 ) { } } elsif ( $step && $step == 6 ){ -# my ( $template, $loggedinuser, $cookie ) = -# C4::InstallAuth::get_template_and_user( -# { -# template_name => "/onboarding/onboardingstep6.tt", -# query => $input, -# type => "intranet", -# authnotrequired => 0, -# flagsrequired => { parameters => 'manage_circ_rules' }, -# debug => 1, -# } -# ); + my ( $template, $loggedinuser, $cookie ) = + C4::InstallAuth::get_template_and_user( + { + template_name => "/onboarding/onboardingstep6.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { parameters => 'manage_circ_rules' }, + debug => 1, + } + ); + + my $existingztargets = $schema->Resultset('Z3950server')->count; + $template->param(existingztargets => $existingztargets); + my $service = $input->param('service'); $template->param( service => $service ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt index d36b805..77d4864 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt @@ -11,7 +11,7 @@
-

What service are you using?

+

Are you using SIP or LDAP?

LDAP
SIP
@@ -39,11 +39,13 @@ [% END %] -

Configure z-targets

+ +[% IF existingztargets < 0 %] +

Configure any z-targets you know you might want

z-targets are simply the servers you will query when looking for a sepcific MARC record (bibliographic record). Often these are set to the z39.50 servers run by the Library of Congress. Click here:
Visit the z-target configuration page