From 89ddb2265e936d1acfa48f7ec3b8484014ea5e40 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 12 Dec 2016 22:28:01 +0000 Subject: [PATCH] Bug 17855-Same as previous Test plan: 1. Go through web installer and onboarding tool as outlined in this guide: https://koha-community.org/manual/installation/html/ This is a combination of 2 commits. --- C4/Members.pm | 2 +- .../en/{default => optional}/patron_categories.sql | 0 .../en/{default => optional}/patron_categories.txt | 0 .../en/{default => optional}/sample_itemtypes.sql | 0 .../en/{default => optional}/sample_itemtypes.txt | 0 installer/install.pl | 6 + installer/onboarding.pl | 446 +++++++++++++++++++++ .../intranet-tmpl/prog/en/includes/calendar.inc | 2 +- .../intranet-tmpl/prog/en/includes/header.inc | 2 + .../prog/en/includes/installer-doc-head-close.inc | 15 + .../prog/en/modules/installer/step3.tt | 201 +++++----- .../intranet-tmpl/prog/en/modules/intranet-main.tt | 2 - .../prog/en/modules/onboarding/onboardingstep0.tt | 54 +++ .../prog/en/modules/onboarding/onboardingstep1.tt | 118 ++++++ .../prog/en/modules/onboarding/onboardingstep2.tt | 235 +++++++++++ .../prog/en/modules/onboarding/onboardingstep3.tt | 127 ++++++ .../prog/en/modules/onboarding/onboardingstep4.tt | 94 +++++ .../prog/en/modules/onboarding/onboardingstep5.tt | 145 +++++++ koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt | 41 ++ summary.pl | 58 +++ 20 files changed, 1454 insertions(+), 94 deletions(-) rename installer/data/mysql/en/{default => optional}/patron_categories.sql (100%) rename installer/data/mysql/en/{default => optional}/patron_categories.txt (100%) rename installer/data/mysql/en/{default => optional}/sample_itemtypes.sql (100%) rename installer/data/mysql/en/{default => optional}/sample_itemtypes.txt (100%) create mode 100755 installer/onboarding.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt create mode 100755 summary.pl diff --git a/C4/Members.pm b/C4/Members.pm index dfe4cbd..a11cdb2 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -498,7 +498,7 @@ sub AddMember { } my $patron_category = $schema->resultset('Category')->find( $data{'categorycode'} ); - $data{'privacy'} = + $data{'privacy'} = $patron_category->default_privacy() eq 'default' ? 1 : $patron_category->default_privacy() eq 'never' ? 2 : $patron_category->default_privacy() eq 'forever' ? 0 diff --git a/installer/data/mysql/en/default/patron_categories.sql b/installer/data/mysql/en/optional/patron_categories.sql similarity index 100% rename from installer/data/mysql/en/default/patron_categories.sql rename to installer/data/mysql/en/optional/patron_categories.sql diff --git a/installer/data/mysql/en/default/patron_categories.txt b/installer/data/mysql/en/optional/patron_categories.txt similarity index 100% rename from installer/data/mysql/en/default/patron_categories.txt rename to installer/data/mysql/en/optional/patron_categories.txt diff --git a/installer/data/mysql/en/default/sample_itemtypes.sql b/installer/data/mysql/en/optional/sample_itemtypes.sql similarity index 100% rename from installer/data/mysql/en/default/sample_itemtypes.sql rename to installer/data/mysql/en/optional/sample_itemtypes.sql diff --git a/installer/data/mysql/en/default/sample_itemtypes.txt b/installer/data/mysql/en/optional/sample_itemtypes.txt similarity index 100% rename from installer/data/mysql/en/default/sample_itemtypes.txt rename to installer/data/mysql/en/optional/sample_itemtypes.txt diff --git a/installer/install.pl b/installer/install.pl index 512ca3c..17d01e9 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -199,6 +199,7 @@ elsif ( $step && $step == 3 ) { # The installer will have to relogin since we do not pass cookie to redirection. $template->param( "$op" => 1 ); } + elsif ( $op && $op eq 'addframeworks' ) { # # 1ST install, 3rd sub-step : insert the SQL files the user has selected @@ -250,6 +251,10 @@ elsif ( $step && $step == 3 ) { $template->param( "en_sample_data" => $sample_defaulted_to_en); $template->param( "levelloop" => $levellist ); $template->param( "$op" => 1 ); + + my $setup = $query->param('setup'); + $template->param( "setup"=> $setup ); + } elsif ( $op && $op eq 'choosemarc' ) { # @@ -270,6 +275,7 @@ elsif ( $step && $step == 3 ) { # But could also be useful to have some Authorised values data set prepared here. # Marcflavour Selection is achieved through radiobuttons. my $langchoice = $query->param('fwklanguage'); + $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); $langchoice =~ s/[^a-zA-Z_-]*//g; my $dir = diff --git a/installer/onboarding.pl b/installer/onboarding.pl new file mode 100755 index 0000000..f660c3f --- /dev/null +++ b/installer/onboarding.pl @@ -0,0 +1,446 @@ +#!/usr/bin/perl +#Recommended pragmas +use strict; +use warnings; +use diagnostics; + + +use Modern::Perl; + +#External modules +use CGI qw ( -utf8 ); +use List::MoreUtils qw/uniq/; +use Digest::MD5 qw(md5_base64); +use Encode qw( encode ); + +#Internal modules +use C4::Koha; +use C4::Auth; +use C4::Context; +use C4::Output; +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::ItemTypes; +use Koha::Patron::HouseboundRole; +use Koha::Patron::HouseboundRoles; +use Koha::Token; +use Email::Valid; +use Module::Load; + +#Setting variables +my $input = new CGI; +my $query = new CGI; +my $step = $query->param('step'); + +#Getting the appropriate template to display to the user--> +my ( $template, $loggedinuser, $cookie) = get_template_and_user( + { + template_name => "/onboarding/onboardingstep" . ( $step ? $step : 0 ) . ".tt", + query => $query, + type => "intranet", + authnotrequired => 0, + debug => 1, + } +); + +#Check database connection +my %info; +$info{'dbname'} = C4::Context->config("database"); +$info{'dbms'} = +( C4::Context->config("db_scheme") + ? C4::Context->config("db_scheme") + : "mysql" ); + +$info{'hostname'} = C4::Context->config("hostname"); +$info{'port'} = C4::Context->config("port"); +$info{'user'} = C4::Context->config("user"); +$info{'password'} = C4::Context->config("pass"); +my $dbh = DBI->connect( + "DBI:$info{dbms}:dbname=$info{dbname};host=$info{hostname}" + . ( $info{port} ? ";port=$info{port}" : "" ), + $info{'user'}, $info{'password'} +); + + +#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 = $query->param('op'); +$template->param('op'=>$op); +if ( $op && $op eq 'finish' ) { #If the value of $op equals 'finish' then redirect user to /cgi-bin/koha/mainpage.pl + print $query->redirect("/cgi-bin/koha/mainpage.pl"); + exit; +} + + +#Store the value of the template input name='start' in the variable $start so we can check if the user has pressed this button and starting the onboarding tool process +my $start = $query->param('start'); +$template->param('start'=>$start); #Hand the start variable back to the template +if ( $start && $start eq 'Start setting up my Koha' ){ + my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); + $template->param(libraries => $libraries, + group_types => [ + { categorytype => 'searchdomain', + categories => [ Koha::LibraryCategories->search( { categorytype => 'searchdomain' } ) ], + }, + { categorytype => 'properties', + categories => [ Koha::LibraryCategories->search( { categorytype => 'properties' } ) ], + }, + ] + ); + + +#Select any library records from the database and hand them back to the template in the libraries variable. +}elsif ( $start && $start eq 'Add a patron category' ){ + +#Select all the patron category records in the categories database table and store them in the newly declared variable $categories + my $categories = Koha::Patron::Categories->search(); + $template->param( + categories => $categories, + ); #Hand the variable categories back to the template + +}elsif ( $start && $start eq 'Add an item type' ){ + my $itemtypes = Koha::ItemTypes->search(); + $template->param( + itemtypes => $itemtypes, + ); + +#Check if the $step variable equals 1 i.e. the user has clicked to create a library in the create library screen 1 +}elsif ( $step && $step == 1 ) { + + my $createlibrary = $query->param('createlibrary'); #Store the inputted library branch code and name in $createlibrary + $template->param('createlibrary'=>$createlibrary); # Hand the library values back to the template in the createlibrary variable + + #store inputted parameters in variables + my $branchcode = $input->param('branchcode'); + my $categorycode = $input->param('categorycode'); + my $op = $input->param('op') || 'list'; + my $message; + my $library; +#my @messages; + + #Take the text 'branchname' and store it in the @fields array + my @fields = qw( + branchname + ); + + +#test + $template->param('branchcode'=>$branchcode); + + $branchcode =~ s|\s||g; # Use a regular expression to check the value of the inputted branchcode + + #Create a new library object and store the branchcode and @fields array values in this new library object + $library = Koha::Library->new( + { branchcode => $branchcode, + ( map { $_ => scalar $input->param($_) || undef } @fields ) + } + ); + + eval { $library->store; }; #Use the eval{} function to store the library object + + if($library){ + $message = 'success_on_insert'; + }else{ + $message = 'error_on_insert'; + } + + $template->param('message' => $message); + + +#Check if the $step vairable equals 2 i.e. the user has clicked to create a patron category in the create patron category screen 1 +}elsif ( $step && $step == 2 ){ + my $createcat = $query->param('createcat'); #Store the inputted library branch code and name in $createlibrary + $template->param('createcat'=>$createcat); # Hand the library values back to the template in the createlibrary variable + + + #Initialising values + my $input = new CGI; + my $searchfield = $input->param('description') // q||; + my $categorycode = $input->param('categorycode'); + my $op = $input->param('op') // 'list'; + my $message; + my $category; + + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "/onboarding/onboardingstep2.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { parameters => 'parameters_remaining_permissions' }, + debug => 1, + } + ); + my $categorycode = $input->param('categorycode'); + my $description = $input->param('description'); + my $overduenoticerequired = $input->param('overduenoticerequired'); + my $category_type = $input->param('category_type'); + my $default_privacy = $input->param('default_privacy'); + my $enrolmentperiod = $input->param('enrolmentperiod'); + my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef; + + #Converts the string into a date format + if ( $enrolmentperioddate) { + $enrolmentperioddate = output_pref( + { + dt => dt_from_string($enrolmentperioddate), + dateformat => 'iso', + dateonly => 1, + } + ); + } + #Adds to the database + $category = Koha::Patron::Category->new({ + categorycode=> $categorycode, + description => $description, + overduenoticerequired => $overduenoticerequired, + category_type=> $category_type, + default_privacy => $default_privacy, + enrolmentperiod => $enrolmentperiod, + enrolmentperioddate => $enrolmentperioddate, + }); + eval { + $category->store; + }; + + #Error messages + if($category){ + $message = 'success_on_insert'; + }else{ + $message = 'error_on_insert'; + } + + $template->param('message' => $message); + + } + +#Create a patron +}elsif ( $step && $step == 3 ){ + my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); + $template->param(libraries => $libraries, + group_types => [ + { categorytype => 'searchdomain', + categories => [ Koha::LibraryCategories->search( { categorytype => 'searchdomain' } ) ], + }, + { categorytype => 'properties', + categories => [ Koha::LibraryCategories->search( { categorytype => 'properties' } ) ], + }, + ] + ); + + my $categories; + $categories= Koha::Patron::Categories->search(); + $template->param( + categories => $categories, + ); + + my $input = new CGI; + my $op = $input->param('op') // 'list'; + + my @messages; + my @errors; + + my ($template, $loggedinuser, $cookie)= get_template_and_user({ + template_name => "/onboarding/onboardingstep3.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); + + + if($op eq 'add_validate'){ + my %newdata; + +#Store the template form values in the newdata hash + $newdata{borrowernumber} = $input->param('borrowernumber'); + $newdata{surname} = $input->param('surname'); + $newdata{firstname} = $input->param('firstname'); + $newdata{cardnumber} = $input->param('cardnumber'); + $newdata{branchcode} = $input->param('libraries'); + $newdata{categorycode} = $input->param('categorycode_entry'); + $newdata{userid} = $input->param('userid'); + $newdata{password} = $input->param('password'); + $newdata{password2} = $input->param('password2'); + $newdata{dateexpiry} = '12/10/2016'; + $newdata{privacy} = "default"; + + if(my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ + push @errors, $error_code == 1 + ? 'ERROR_cardnumber_already_exists' + :$error_code == 2 + ? 'ERROR_cardnumber_length' + :() + } + + + +#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); +#Create a hash named member2 and fillit with the borrowernumber of the borrower that has just been created + my %member2; + $member2{'borrowernumber'}=$borrowernumber; + + + my $flag = $input->param('flag'); + + if ($input->param('newflags')) { + my $dbh=C4::Context->dbh(); + my @perms = $input->multi_param('flag'); + my %all_module_perms = (); + my %sub_perms = (); + foreach my $perm (@perms) { + if ($perm !~ /:/) { + $all_module_perms{$perm} = 1; + } else { + my ($module, $sub_perm) = split /:/, $perm, 2; + push @{ $sub_perms{$module} }, $sub_perm; + } + } + + + # 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; + } + } + + $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?"); + $sth->execute($module_flags, $borrowernumber); + + +#Error handling checking if the patron was created successfully + if(!$borrowernumber){ + push @messages, {type=> 'error', code => 'error_on_insert'}; + }else{ + push @messages, {type=> 'message', code => 'success_on_insert'}; + } + + } + } + + } +}elsif ( $step && $step == 4){ + my $createitemtype = $input->param('createitemtype'); + $template->param('createitemtype'=> $createitemtype ); + + my $input = new CGI; + my $itemtype_code = $input->param('itemtype'); + my $op = $input->param('op') // 'list'; + my $message; + + my( $template, $borrowernumber, $cookie) = get_template_and_user( + { template_name => "/onboarding/onboardingstep4.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { parameters => 'parameters_remaining_permissions'}, + debug => 1, + } + ); + + if($op eq 'add_form'){ + my $itemtype = Koha::ItemTypes->find($itemtype_code); + $template->param(itemtype=> $itemtype,); + }elsif($op eq 'add_validate'){ + my $itemtype = Koha::ItemTypes->find($itemtype_code); + my $description = $input->param('description'); + + #store the input from the form - only 2 fields + my $thisitemtype= Koha::ItemType->new( + { itemtype => $itemtype_code, + description => $description, + } + ); + eval{ $thisitemtype->store; }; + #Error messages + if($thisitemtype){ + $message = 'success_on_insert'; + }else{ + $message = 'error_on_insert'; + } + + $template->param('message' => $message); + } +}elsif ( $step && $step == 5){ + my $test="a"; + warn $test; + + #Fetching all the existing categories to display in a drop down box + my $categories; + $categories= Koha::Patron::Categories->search(); + $template->param( + categories => $categories, + ); + + my $itemtypes; + $itemtypes= Koha::ItemTypes->search(); + $template->param( + itemtypes => $itemtypes, + ); + + my $input = CGI->new; + my($template, $loggedinuser, $cookie) =get_template_and_user({ + template_name => "/onboarding/onboardingstep5.tt", + query => $input, + type => "intranet", + authnotrequired=>0, + flagsrequired=> {parameters => 'manage_circ_rules'}, + debug =>1, + }); + my $type = $input->param('type'); + my $branch = $input->param('branch'); + if($op eq 'add_form'){ + } + + elsif($op eq 'add_validate'){ + my $bor = $input->param('categorycode'); + my $itemtype = $input->param('itemtype'); + my $maxissueqty = $input->param('maxissueqty'); + my $issuelength = $input->param('issuelength'); + #$issuelength = $issuelength eq q{} ? undef : $issuelength; + my $lengthunit = $input->param('lengthunit'); + my $renewalsallowed = $input->param('renewalsallowed'); + my $renewalperiod = $input->param('renewalperiod'); + my $onshelfholds = $input->param('onshelfholds'); + + my $params ={ + categorycode => $bor, + itemtype => $itemtype, + maxissueqty => $maxissueqty, + renewalsallowed => $renewalsallowed, + renewalperiod => $renewalperiod, + lengthunit => $lengthunit, + onshelfholds => $onshelfholds, + }; + my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype}); + if($issuingrule){ + $issuingrule->set($params)->store(); + }else{ + Koha::IssuingRule->new()->set($params)->store(); + } + } + } + + + +output_html_with_http_headers $input, $cookie, $template->output; + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index f6d9e9b..a4bbe62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -6,7 +6,7 @@ var debug = "[% debug %]"; var dformat = "[% dateformat %]"; var sentmsg = 0; if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} -var MSG_PLEASE_ENTER_A_VALID_DATE = _("Please enter a valid date (should match %s)."); +var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s).")); function is_valid_date(date) { // An empty string is considered as a valid date for convenient reasons. diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 193bcc1..9e56f71 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -42,6 +42,8 @@
  • Administration
  • [% END %]
  • About Koha
  • +
  • Summary
  • + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc index a4b435c..60d0e66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/installer-doc-head-close.inc @@ -1,5 +1,9 @@ + + + + + + + + + + + + + + + +function Hide(link) +{ + // Toggle the display of a given element on the page. + // + subfield = document.getElementById('bloc'+link); + var initstyle = subfield.style.display; + if (initstyle == 'block') subfield.style.display = 'none' ; + if (initstyle == 'none') subfield.style.display = 'block' ; +} + +//]]> + [% END %] + + [% IF ( finish ) %]

    Congratulations, installation complete

    -

    If this page does not redirect in 5 seconds, click here.

    +

    If this page does not redirect in 5 seconds, click here.

    [% END %] + + [% IF ( choosemarc ) %] -

    Select your MARC flavor

    -

    MARC stands for Machine Readable Cataloging, containing information about a bibliographic record. MARC21 is more commonly used globally, whereas UNIMARC tends to be used in Europe.

    +

    Choose your setup

    +

    Basic setup selects recommended settings by default.

    + +
    + Basic
    + Advanced
    +
    + +

    Select your MARC flavor

    +

    MARC stands for Machine Readable Cataloging, containing information about a bibliographic record. MARC21 is more commonly used globally, whereas UNIMARC tends to be used in Europe.

    +

    [% FOREACH flavourloo IN flavourloop %]

    @@ -82,13 +95,19 @@ [% END %]
    [% END %] -

    -

    Click 'Next' to continue

    + +

    +

    Click 'Next' to continue

    +
    + [% END %] + [% IF ( selectframeworks ) %] +

    [% setup %] setup

    Selecting Default Settings

    + + + + + +
    +

    Welcome to Koha

    +

    Koha

    +

    We're just going to set up a few things......

    +
    + + +
    +
    + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt new file mode 100644 index 0000000..f783202 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt @@ -0,0 +1,118 @@ + +[% INCLUDE 'doc-head-open.inc' %] +[% INCLUDE 'installer-doc-head-close.inc' %] + + +Welcome › to › Koha + + + + + + + +
    +

    Welcome to Koha

    +

    Koha

    +
    + [% IF libraries.count > 0 %] +
    +

    You do not need to create a library as you have already installed the sample library data previously

    +
    + +
    + +
    +
    + + +[% ELSIF (createlibrary) %] + + [% IF message == "success_on_insert" %] +
    + +

    New Library

    +
    +

    Success: Library created! Your branchcode is [% branchcode %] +

    +

    To add another library and for more settings,
    + go to Tools->Administration->Libraries and Groups +

    + Next up: + +
    + + [%ELSE %] + +
    + +

    Failed

    +
    +

    Library was not successfully created
    + Please try again or contact your system administrator.

    +
    + +
    + [%END%] + +[% ELSE %] + +

    Create a Library

    +
    +
    + + +
      +
    1. + + + Required +
    2. +
    3. + + + Required +
    4. +
    +
    +
    + +
    +[% END %] + + + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt new file mode 100644 index 0000000..1635c68 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt @@ -0,0 +1,235 @@ + +[% USE Koha %] +[% USE KohaDates %] +[% USE Price %] +[% INCLUDE 'doc-head-open.inc' %] + Add a patron category +[% INCLUDE 'installer-doc-head-close.inc' %] +[% INCLUDE 'calendar.inc' %] + + + + + +
    +

    Welcome to Koha

    +

    Koha

    +
    + + +[% IF categories.count > 0 %] +
    +

    You do not need to create a patron category as you have already installed the sample patron categories data previously

    +
    + +
    + +
    +
    + + +[% ELSIF op == "add_validate" %] + [% IF message != "error_on_insert" %] +
    + +

    New patron category

    +
    +

    Success: Patron category created! Your patron category code is [% category.categorycode %]

    +

    To add another patron category and for more settings
    + go to More->Administration->Patrons & Circulation->Patron Categories

    +
    + Next up:
    + +
    + [% ELSE %] +
    + Message is [% message %] + +

    Failed

    +
    Patron Category was not successfully created.
    + Please try again or contact your system administrator.

    +
    + +
    + [% END %] + + +[% ELSE %] +

    Create a new Patron Category

    +
    +
    + + +
      +
    1. + + + Required +
    2. + +
    3. + + + Required +
    4. + +
    5. + + +
    6. + +
    7. + + + Required +
    8. + +
    9. + + +

      Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob batch_anonymise.pl which should be set up by your system administrator.

      +
    10. + + Enrolment period: +
      +
      + Choose one +
        +
      1. + + months +
      2. +
      3. + + +
      4. +
      +
      +
      + + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] + + + + + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt new file mode 100644 index 0000000..83667cb --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt @@ -0,0 +1,127 @@ + +[% USE Koha %] +[% USE KohaDates %] +[% USE Price %] + +[% INCLUDE 'doc-head-open.inc' %] +[% IF ( finish ) %][% END %] + + +[% INCLUDE 'installer-doc-head-close.inc' %] +[% INCLUDE 'calendar.inc' %] +[% INCLUDE 'datatables.inc' %] + + + +Create Patron + + + + + +
      +

      Welcome to Koha

      +

      Koha

      +
      + +[% IF op == 'add_validate' %] + +
      + +

      New Patron

      +
      +

      Success: New patron created!

      +

      To create another patron, go to Patrons > New Patron.
      + More > Set Permissions in a user page to gain superlibrarian permissions. +

      + Next up: + +
      + +[% ELSE %] + +

      Create a new Patron

      +
      +
      + + +
        +

        Patron Identity

        +
      1. + + + + Required +
      2. +
      3. + + + Required +
      4. +
      + + Library Management +
        +
      1. + + + Required +
      2. +
      3. + + + + Required +
      4. +
      5. + + + Required +
      6. +
      + +
        + +

        Patron permissions

        + +
      1. + + +
      2. +
      +
        +

        OPAC/Staff Login

        +
      1. + + + Required +
      2. +
      3. + + + Required +
      4. +
      5. + + + Required +
      6. +
      +

      + +
      +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt new file mode 100644 index 0000000..73400ff --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt @@ -0,0 +1,94 @@ + +[% INCLUDE 'doc-head-open.inc' %] + +[% IF ( finish ) %][% END %] +[% INCLUDE 'installer-doc-head-close.inc' %] + + +Create item type + + + + + + + +
      +

      Welcome to Koha

      +

      Koha

      +
      + +[% IF itemtypes.count > 0 %] +
      + h no! Patron was not created

      + +

      You do not need to create a item type as you have already installed the sample item type data previously

      +
      + +
      + +
      +
      + + + +[% ELSIF op == "add_validate" %] + + [% IF message != "error_on_insert" %] +
      + +

      New Item type

      + +
      +

      Success: New item type created!

      +

      To create another item type later and for more setttings
      + go to More->Administration->Item types +

      + Next up: + +
      + [% ELSE %] +
      + +

      Failed

      +
      +

      Item type was not successfully created.
      + Please try again or contact your system administrator.

      +
      +
      + [% END %] +[% ELSE %] + +

      Create a new Item type

      +
      +
      + + +
        +
      1. + + + Required +
      2. +
      3. + + + Required +
      4. +
      +

      + +
      +[% END %] + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt new file mode 100644 index 0000000..f2a7ac8 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -0,0 +1,145 @@ + +[% INCLUDE 'doc-head-open.inc' %] + +[% IF ( finish ) %][% END %] +[% INCLUDE 'installer-doc-head-close.inc' %] + + +Create Circulation rule + + + + + + + +
      +

      Welcome to Koha

      +

      Koha

      +
      + +[% IF (finish) %] +

      Congratulations you have finished and ready to use Koha

      +Start using Koha + +[% END %] + + +[% IF op == "add_validate" %] + +
      + + +

      New Circulation rule

      + +
      +

      Success: New circulation rule created!

      +

      To create circulation rule, go to
      + More->Administration->Circulation and Fine Rules +

      + Next up: + +
      + + + +[% ELSE %] + +

      Create a new Circulation rule

      + +
      +
      + + +
        +
      1. + + + Required +
      2. + +
      3. + + + Required +
      4. + +
      5. + + + Required +
      6. + +
      7. + + + Required +
      8. + +
      9. + + +
      10. + +
      11. + + + Required +
      12. + +
      13. + + + Required +
      14. + +
      15. + + +
      16. +
      +

      + +
      +[% END %] + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt new file mode 100644 index 0000000..7c4882c --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/summary.tt @@ -0,0 +1,41 @@ +[% USE Koha %] +[% INCLUDE 'doc-head-open.inc' %] +Koha Tutorial Summary +[% INCLUDE 'doc-head-close.inc' %] + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'cat-search.inc' %] + + + +
      +
      +
      +

      Tutorial Summary Page

      +
      +

      Library

      +

      To add another library and for more settings, go to
      + More > Administration > Libraries and Groups

      + +

      Patron Category

      +

      To add another patron category and for more settings, go to
      + More > Administration > Patrons and Circulation > Patron Categories

      + +

      Patron

      +

      To create another patron, go to Patrons > New Patron. To set the
      + permissions of the patron, go to the patron's page and More > Set Permissions

      + +

      Item Type

      +

      To create another item type and for more settings, go to
      + More > Administration > Item types

      + +

      Circulation Rule

      +

      To create another circulation rule, go to
      + More > Administration > Circulation and Fine Rules + +

      +
      +
      +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/summary.pl b/summary.pl new file mode 100755 index 0000000..992e487 --- /dev/null +++ b/summary.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# Copyright Pat Eyler 2003 +# Copyright Biblibre 2006 +# Parts Copyright Liblime 2008 +# Parts Copyright Chris Nighswonger 2010 +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use CGI qw ( -utf8 ); +use List::MoreUtils qw/ any /; +use LWP::Simple; +use XML::Simple; +use Config; + +use C4::Output; +use C4::Auth; +use C4::Context; +use C4::Installer; + +use Koha; +use Koha::Acquisition::Currencies; +use Koha::Patrons; +use Koha::Caches; +use Koha::Config::SysPrefs; +use C4::Members::Statistics; + +#use Smart::Comments '####'; + +my $query = new CGI; +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "summary.tt", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { catalogue => 1 }, + debug => 1, + } +); + + +output_html_with_http_headers $query, $cookie, $template->output; -- 2.1.4