From f747c59afcc17d364e486423638e69d82425b526 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Wed, 1 Feb 2017 12:46:58 +1300 Subject: [PATCH] Bug 17956 - Added more information about SIP, LDAP and Z-targets to the onboardingstep6. Working 'Finish' button in the onboardingstep5.tt file. --- installer/onboarding.pl | 87 ++++++++-------------- .../prog/en/modules/onboarding/onboardingstep6.tt | 49 ++++++++---- 2 files changed, 65 insertions(+), 71 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index d8fa232..b10db5c 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -2,7 +2,7 @@ # This file is part of Koha. # -# Copyright (C) YEAR YOURNAME-OR-YOUREMPLOYER +# Copyright (C) YEAR Alex Buckley CatalystIT # # Koha is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -22,35 +22,24 @@ use Modern::Perl; use diagnostics; use C4::InstallAuth; use CGI qw ( -utf8 ); -use List::MoreUtils qw/uniq/; use Digest::MD5 qw(md5_base64); use Encode qw( encode ); use C4::Koha; -use C4::Context; use C4::Output; -use C4::Form::MessagingPreferences; use C4::Members; use C4::Members::Attributes; use C4::Members::AttributeTypes; use C4::Log; -use C4::Letters; -use C4::Form::MessagingPreferences; use Koha::AuthorisedValues; use Koha::Patron::Debarments; -use Koha::Cities; use Koha::Patrons; use Koha::Items; use Koha::Libraries; -use Koha::LibraryCategories; use Koha::Database; use Koha::DateUtils; use Koha::Patron::Categories; -use Koha::Patron::Category; use Koha::Patron::HouseboundRole; use Koha::Patron::HouseboundRoles; -use Koha::Token; -use Email::Valid; -use Module::Load; use Koha::ItemTypes; use Koha::IssuingRule; use Koha::IssuingRules; @@ -92,9 +81,11 @@ my $dbh = DBI->connect( ); #Store the value of the template input name='op' in the variable $op so we can check if the user has pressed the button with the name="op" and value="finish" meaning the user has finished the onboarding tool. -my $op = $input->param('op') || ""; +my $op = $input->param('op'); $template->param( 'op' => $op ); +my $schema = Koha::Database->new()->schema(); + if ( $op && $op eq 'Finish' ) { #If the value of $op equals 'finish' then redirect user to /cgi-bin/koha/mainpage.pl print $input->redirect("/cgi-bin/koha/mainpage.pl"); @@ -129,15 +120,15 @@ $template->param( my $categories = Koha::Patron::Categories->search(); $template->param( 'categories' => $categories, ); -#Select all the itemtype records in the itemtypes database table and give them to the template +#Select all ItemType records in the itemtype 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; + my $existingztargets = $schema->resultset('Z3950server')->count; $template->param(existingztargets => $existingztargets); - if ( $step && $step == 1 ) { #store inputted parameters in variables my $branchcode = $input->param('branchcode'); @@ -247,8 +238,8 @@ elsif ( $step && $step == 2 ) { #Create a patron } elsif ( $step && $step == 3 ) { - my $firstpassword = $input->param('password') || ''; - my $secondpassword = $input->param('password2') || ''; + my $firstpassword = $input->param('password'); + my $secondpassword = $input->param('password2'); #Find all patron records in the database and hand them to the template @@ -286,9 +277,6 @@ elsif ( $step && $step == 3 ) { my $categories = Koha::Patron::Categories->search(); $template->param( 'categories' => $categories, ); - - - #Incrementing the highest existing patron cardnumber to prevent duplicate cardnumber entry my $exisiting_cardnumber = my $sth_search = $dbh->prepare("SELECT MAX(cardnumber) FROM borrowers"); @@ -387,13 +375,8 @@ elsif ( $step && $step == 3 ) { $newdata{userid} = $input->param('userid'); $newdata{password} = $input->param('password'); $newdata{password2} = $input->param('password2'); + $newdata{dateexpiry} = '12/10/2016'; $newdata{privacy} = "default"; - $newdata{address} = ""; - $newdata{city} = ""; - -#Determine the dateexpiry of the patron based on the patron category it is created from - my $patron_category = Koha::Patron::Categories->find( $newdata{categorycode} ); - $newdata{dateexpiry} = $patron_category->get_expiry_date( $newdata{dateenrolled} ); #Hand the newdata hash to the AddMember subroutine in the C4::Members module and it creates a patron and hands back a borrowernumber which is being stored my $borrowernumber = &AddMember(%newdata); @@ -420,20 +403,13 @@ elsif ( $step && $step == 3 ) { } # construct flags - my $module_flags = 0; - my $sth = - $dbh->prepare("SELECT bit,flag FROM userflags ORDER BY bit"); - $sth->execute(); - while ( my ( $bit, $flag ) = $sth->fetchrow_array ) { - if ( exists $all_module_perms{$flag} ) { - $module_flags += 2**$bit; - } - } + my @userflags = $schema->resultset('Userflag')->search({}, { + order_by => { -asc => 'bit'}, + } + ); -#Set the superlibrarian permission of the newly created patron to superlibrarian - $sth = $dbh->prepare( - "UPDATE borrowers SET flags=? WHERE borrowernumber=?"); - $sth->execute( $module_flags, $borrowernumber ); + #Setting superlibrarian permissions for new patron + my $flags = Koha::Patrons->find($borrowernumber)->set({flags=>01})->store; #Error handling checking if the patron was created successfully if ( !$borrowernumber ) { @@ -586,7 +562,6 @@ elsif ( $step && $step == 5 ) { my @messages; -#New code from smart-rules.tt starts here. Needs to be added to library #Allows for the 'All' option to work when selecting all libraries for a circulation rule to apply to. if ( $branch eq "*" ) { my $sth_search = $dbh->prepare( @@ -689,24 +664,20 @@ 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 $service = $input->param('service'); + $template->param( service => $service ); - my $existingztargets = $schema->Resultset('Z3950server')->count; - $template->param(existingztargets => $existingztargets); - - my $service = $input->param('service'); - $template->param( service => $service ); + 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, + } + ); } - output_html_with_http_headers $input, $cookie, $template->output; 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 77d4864..cd848b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt @@ -16,36 +16,59 @@ LDAP
SIP
- + [% END %] + [% IF (op == "learnservice") && (service == "LDAP") %]

Important information regarding setting up LDAP service

What is LDAP?

- LDAP is a service that provides another way for users (both staff and patrons) to log into Koha by integrating in your institutions current authentication system with yourt Koha instance. LDAP can be used to log into both the Koha staff interface and OPAC. + LDAP (Lightweight Directory Access Protocol) ican be used as a method to authenticate users. Effectively it can be used to send users inputted credentials to a database where they are compared against all user records and if theres a match the user if successfully logged in. +
+ If your organisation has an existing database of user records that are used for authentication then setting up the LDAP service with Koha is a good idea because all user records would be stored in a single central location.
+ LDAP can be used to log into both the Koha staff interface and OPAC.<
-

What are the benefits of setting up LDAP on my Koha instance

- If your institution has a central database of users which it uses for authentication then by setting up LDAP in your Koha instance your users will be able to log into Koha with their existing account credentials, therefore saving users from having to create another username and password to remember.

Learn how to set up LDAP at:

- LDAP in the manual + LDAP in the manual [% ELSIF (op == "learnservice") && (service == "SIP") %]

Important information regarding setting up SIP server

- SIP is a service where you can type commands into the + SIP (Session Initiation Protocol) is a communication protocol used between ACS (Automated Circulation System in this case the Koha server) and SC (Self Checkout machines). By setting up SIP with Koha you will be able to utilise your existing library infrastructure with the Koha ILS. + If you installed Koha using debain packages then setting up SIP is easy, simply follow these steps: + 1. In your Linux terminal (in the Koha root directory) write in: + sudo koha-enable-sip

+ 2. Edit your SIPconfig.xml file.
+ 2.1. Edit the port value in the service sections at the top of the SIPconfig.xml file, making sure that the two port values have the same IP address but different port numbers.
+ 2.2. Enter an account. This account must have the same username and password as an account you have created in the Koha staff interface. Also make sure that the account is set to having 'circulate' permissions only.
+ 2.3. Enter an institution . As with acount this institution's ID must match the branchcode of a library created in the Koha staff interface

+ 3. In your Linux terminal start SIP by writing in:
+ sudo koha-start-sip

+

Learn how to test SIP at:

+ Evergreen SIP support

Important security notice about using SIP

To ensure your SIP traffic (the request and response messages sent between you and the SIP server) are secure you must use a stunnel or VPN. [% END %] -[% 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 1) %] +

Configure the z39.50 servers you installed in the web installer

+ z-targets are simply the servers you will query when looking for a specific MARC record (bibliographic record). These servers are run by other libraries and institutions around the world, for example the Library of Congress. + Click here:
+ Visit the z-target configuration page +[% ELSE %] +

Create z-targets

+ What are z-targets?
+ Z-targets are simply the servers you can choose to query when looking for a specific MARC record (bibliographic record). These servers are run by other libraries and institutions around the world, for example the Library of Congress.

+ The benefit of setting up z-targets is that when cataloging a new bibliographic item you will be able to search and import the bibliographic information for that bibliographic record from the z39.50 servers (if the item exists in their database) thereby speeding up the cataloging process. +

+ To create a z-target go to:
+ Administration -> Z39.50/SRU servers -> New Z39.50 server
+ To learn what z-target servers are avaliable for you to use in your Koha instance go to:
+ IRSpy Z39.50 target directory

+ By using this site you can simply copy the server name, hostname, port number and database name across to the Koha administrative form to create a z-target. +[% END %] -- 2.1.4