Bugzilla – Attachment 58784 Details for
Bug 17855
New onboarding tool feature to guide users through setting up Koha, and minor web installer UI improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17855-Same as previous
Bug-17855-Same-as-previous.patch (text/plain), 75.50 KB, created by
Alex Buckley
on 2017-01-10 21:49:30 UTC
(
hide
)
Description:
Bug 17855-Same as previous
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-01-10 21:49:30 UTC
Size:
75.50 KB
patch
obsolete
>From 89ddb2265e936d1acfa48f7ec3b8484014ea5e40 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >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 @@ > <li><a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a></li> > [% END %] > <li><a href="/cgi-bin/koha/about.pl">About Koha</a></li> >+ <li><a href="/cgi-bin/koha/summary.pl">Summary</a></li> >+ > </ul> > </li> > </ul> >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 @@ > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" /> >+<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" /> >+<link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" /> > <style type="text/css" media="screen"> > > [% IF ( login ) %] >@@ -69,6 +73,17 @@ td input { font-size: 1.5em; } > > </style> > >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script> >+<!-- koha core js --> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script> >+ > <script type="text/javascript"> > //<![CDATA[ > function _(s) { return s } // dummy function for gettext >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >index b7b5449..5daf7fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt >@@ -1,77 +1,90 @@ > [% INCLUDE 'doc-head-open.inc' %]<title>Koha › Web installer › Step 3</title> >-[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/installer/onboarding.pl">[% END %] > [% INCLUDE 'installer-doc-head-close.inc' %] > <div> > <h1 id="logo"><img alt="Koha" src="[% interface %]/[% theme %]/img/koha.org-logo.gif" /> Koha web installer › Step 3</h1> > > [% IF ( selectframeworks ) %] > <script type="text/javascript"> >- //<![CDATA[ >+//<![CDATA[ > >- var surl = unescape(window.location.pathname); >+var surl = unescape(window.location.pathname); > >- function doLoad() >- { >- // the timeout value should be the same as in the "refresh" meta-tag >- setTimeout( "refresh()", 2*1000 ); >- } >+function doLoad() >+{ >+ // the timeout value should be the same as in the "refresh" meta-tag >+ setTimeout( "refresh()", 2*1000 ); >+} > >- function refresh(value) >- { >- // The argument to the location.reload function determines >- // if the browser should retrieve the document from the >- // web-server. In our example all we need to do is cause >- // the JavaScript block in the document body to be >- // re-evaluated. If we needed to pull the document from >- // the web-server again (such as where the document contents >- // change dynamically) we would pass the argument as 'true'. >- // >- surl=surl+'?step=3&op=selectframeworks&fwklanguage='+value; >- >- window.location.replace( surl ); >- } >+function refresh(value) >+{ >+ // The argument to the location.reload function determines >+ // if the browser should retrieve the document from the >+ // web-server. In our example all we need to do is cause >+ // the JavaScript block in the document body to be >+ // re-evaluated. If we needed to pull the document from >+ // the web-server again (such as where the document contents >+ // change dynamically) we would pass the argument as 'true'. >+ // >+ surl=surl+'?step=3&op=selectframeworks&fwklanguage='+value; > >- function selectAllFrameworks() >+ window.location.replace( surl ); >+} >+ >+function selectAllFrameworks() >+{ >+ // A handy short link that selects all available checkboxes >+ // on the page. >+ // >+ var checkboxes = document.getElementsByTagName("input"); >+ for (var i = 0; i < checkboxes.length; i++) > { >- // A handy short link that selects all available checkboxes >- // on the page. >- // >- var checkboxes = document.getElementsByTagName("input"); >- for (var i = 0; i < checkboxes.length; i++) >+ if (checkboxes[i].type == 'checkbox') > { >- if (checkboxes[i].type == 'checkbox') >- { >- checkboxes[i].checked = true; >- } >+ checkboxes[i].checked = true; > } >- >- // Prevent event propergation. >- return false; > } > >- 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' ; >- } >+ // Prevent event propergation. >+ return false; >+} > >- //]]> >- </script> >+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' ; >+} >+ >+//]]> >+</script> > [% END %] >+ >+ > [% IF ( finish ) %] > <h1>Congratulations, installation complete</h1> >- <p>If this page does not redirect in 5 seconds, click <a href="/">here</a>.</p> >+ <p>If this page does not redirect in 5 seconds, click <a href="/cgi-bin/koha/installer/onboarding.pl">here</a>.</p> > [% END %] >+ >+ > [% IF ( choosemarc ) %] >- <h2 align="center">Select your MARC flavor</h2> >- <p>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. </p> >+ <h2 align="center">Choose your setup</h2> >+ <p>Basic setup selects recommended settings by default.</p> > <form name="frameworkselection" method="post" action="install.pl"> > <input type="hidden" name="step" value="3" /> > <input type="hidden" name="op" value="selectframeworks"/> >+ >+ <div> >+ <input type="radio" name="setup" value="Basic" checked="checked">Basic<br/> >+ <input type="radio" name="setup" value="Advanced"/>Advanced<br/> >+ </div> >+ >+ <h2 align="center">Select your MARC flavor</h2> >+ <p>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. </p> >+ > <p> > [% FOREACH flavourloo IN flavourloop %] > <div> >@@ -82,13 +95,19 @@ > [% END %] > </div> > [% END %] >- </p> >- <p> Click 'Next' to continue <input value="Next >>" type="submit" /></p> >+ >+ </p> >+ <p>Click 'Next' to continue <input value="Next >>" type="submit" /></p> >+ > </form> >+ > [% END %] > >+ > [% IF ( selectframeworks ) %] >+ <h2 align= "center"> [% setup %] setup</h2> > <h2 align="center">Selecting Default Settings</h2> >+ > <script type="text/javascript"> > var linklabel = _("Select all options"); > document.write('<p><a href="#" onclick="return selectAllFrameworks();"><button>'+linklabel+'</button></a></p>'); >@@ -97,51 +116,53 @@ > <input type="hidden" name="step" value="3" /> > <input type="hidden" name="op" value="addframeworks" /> > >- [% IF ( frameworksloop ) %] >- <h2>MARC frameworks: [% marcflavour %]</h2> >- [% IF ( en_marc_frameworks ) %] >- <h4><span class="error">No MARC frameworks are available for your language. Defaulting to the frameworks supplied for English (en)<span></h4> >- [% END %] >- [% FOREACH frameworksloo IN frameworksloop %] >- <div> >- <h3>[% frameworksloo.label %]</h3> >- [% FOREACH framework IN frameworksloo.frameworks %] <table style="border:1px;vertical-align:top;"> >- <tr> >+ [% IF ( frameworksloop ) %] >+ <h2>MARC frameworks: [% marcflavour %]</h2> >+ [% IF ( en_marc_frameworks ) %] >+ <h4><span class="error">No MARC frameworks are available for your language. >+ Defaulting to the frameworks supplied for English (en)<span></h4> >+ [% END %] >+ [% FOREACH frameworksloo IN frameworksloop %] >+ <div> >+ <h3>[% frameworksloo.label %]</h3> >+ [% FOREACH framework IN frameworksloo.frameworks %] >+ <table style="border:1px;vertical-align:top;"> >+ <tr> > <td style = "border:1px; vertical-align:top;"> >- [% IF (frameworksloo.label == "Default" ) %] >+ [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] > <input type="hidden" name="framework" value="[% framework.fwkfile %]" id =="[%framework.fwkname%]" /> > [% ELSE %] > <input type="checkbox" name="framework" value="[% framework.fwkfile %]" id =="[%framework.fwkname%]" /> > [% END %] > </td> > <td> >- [% IF (frameworksloo.label == "Default" ) %] >+ [% IF (frameworksloo.label == "Default") && (setup=="Basic") %] > <ul> >- <label for="[% framework.fwkname %]"> >- <li>[% framework.fwkdescription %]</li> >- <em>([% framework.fwkname %])</em> >- </label> >- </ul> >- </td> >- [% ELSE %] >- <td> >- <label for= "[% framework.fwkname %]"> >- [% framework.fwkdescription %] >- <em>([% framework.fwkname %])</em> >- </label> >- </td> >- [% END %] >- </tr> >+ <label for="[% framework.fwkname %]"> >+ <li> [% framework.fwkdescription %]</li> >+ <em>([% framework.fwkname %])</em> >+ </label> >+ </ul> >+ </td> >+ [% ELSE %] >+ <td> >+ <label for= "[% framework.fwkname %]"> >+ [% framework.fwkdescription %] >+ <em>([% framework.fwkname %])</em> >+ </label> >+ </td> >+ [% END %] >+ </tr> > </table> >- [% END %] >- </div> >- [% END %] >+ [% END %] >+ </div> >+ [% END %] > <h2>Other data</h2> >- [% END %] >- [% IF ( en_sample_data ) %] >- <h4><span class="error">No sample data and settings ar e available for your language. >- 132 Defaulting to the samples supplied for English (en)<span></h4> >- [% END %] >+ [% END %] >+ [% IF ( en_sample_data ) %] >+ <h4><span class="error">No sample data and settings are available for your language. >+ Defaulting to the samples supplied for English (en)<span></h4> >+ [% END %] > [% FOREACH levelloo IN levelloop %] > <div> > <h3>[% levelloo.label %]</h3> >@@ -149,20 +170,20 @@ > <table style="border:1px;vertical-align:top;"> > <tr> > <td style="vertical-align:top;"> >- [% IF (levelloo.label == "Default" ) %] >+ [% IF (levelloo.label == "Default" ) && (setup=="Basic")%] > <input type="hidden" name="framework" value="[% framework.fwkfile %]" id="[%framework.fwkname %]" /> > [% ELSE %] > <input type="checkbox" name="framework" value="[%framework.fwkfile %]" id=="[%framework.fwkname%]"/> > [% END %] > </td> > <td> >- [% IF (levelloo.label == "Default") %] >+ [% IF (levelloo.label == "Default") && (setup=="Basic")%] > <ul> > <label for="[% framework.fwkname %]"> > <li> [% framework.fwkdescription %]</li> > <em>([% framework.fwkname %])</em> > </label> >- </ul> >+ </ul> > </td> > [% ELSE %] > <td> >@@ -247,7 +268,7 @@ > <br> > <br> > <a href="install.pl?step=3&op=choosemarc" class="button"><button>Install Basic Configuration Settings</button></a> >- </p> >+ > [% END %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index f1afe8e..0abe63c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -1,5 +1,3 @@ >-[% USE Koha %] >-[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha staff client</title> > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/mainpage.css" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt >new file mode 100644 >index 0000000..8eed408 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep0.tt >@@ -0,0 +1,54 @@ >+<!-- Includes for creating library--> >+[% INCLUDE 'doc-head-open.inc' %] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+ >+ >+<head> >+<title>Welcome › to › Koha</title> >+ >+<!--jQuery code for create library--> >+<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script> >+<script type="text/javascript"> >+ //<![CDATA[ >+ $(document).ready(function() { >+ $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "iDisplayLength": 10, >+ "sPaginationType": "four_button" >+ })); >+ >+ [% UNLESS library %] >+ $("#Aform").on("submit", function( event ) { >+ if ( $("#branchcode").val().match(/\s/) ) { >+ event.preventDefault(); >+ alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code")); >+ return false; >+ } else { >+ return true; >+ } >+ }); >+ [% END %].. >+ }); >+ //]]> >+ </script> >+ </head> >+ >+ <!--Header for the koha onboarding tool--> >+<div> >+ <h1 align="center"> Welcome to Koha</h1> >+ <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> >+ <h2 align="center"> We're just going to set up a few things......</h2> >+ <form name="startkoha" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="1"/> >+ <input type="submit" name="start" value="Start setting up my Koha"/> >+ </form> >+</div> >+ >+ >+ >+ >+ >+ >+ >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 @@ >+<!--Includes for creating library--> >+[% INCLUDE 'doc-head-open.inc' %] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+ >+<head> >+<title>Welcome › to › Koha</title> >+ >+<!--jQuery code for create library--> >+<script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script> >+<script type="text/javascript"> >+ //<![CDATA[ >+ $(document).ready(function() { >+ $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "iDisplayLength": 10, >+ "sPaginationType": "four_button" >+ })); >+ >+ [% UNLESS library %] >+ $("#Aform").on("submit", function( event ) { >+ if ( $("#branchcode").val().match(/\s/) ) { >+ event.preventDefault(); >+ alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code")); >+ return false; >+ } else { >+ return true; >+ } >+ }); >+ [% END %].. >+ }); >+//]]> >+</script> >+</head> >+ >+<!--Header for the koha onboarding tool--> >+<div> >+ <h1 align="center"> Welcome to Koha</h1> >+ <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> >+</div> >+ [% IF libraries.count > 0 %] >+ <br> >+ <h3 align="left">You do not need to create a library as you have already installed the sample library data previously</h3> >+ <form name="skiplibrary" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="2"/> >+ <div> >+ <input type="submit" name="start" value="Add a patron category"/> >+ </div> >+ </form> >+ >+ <!--Create a library screen 2--> >+[% ELSIF (createlibrary) %] >+ <!--New Library created--> >+ [% IF message == "success_on_insert" %] >+ <form name="createlibrary" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="2"/> >+ <h1 align="left"> New Library</h1> >+ <div> >+ <p> Success: Library created! Your branchcode is [% branchcode %] >+</p> >+ <p> To add another library and for more settings, <br> >+ go to Tools->Administration->Libraries and Groups >+ </div> >+ Next up: >+ <input type="submit" name="start" value="Add a patron category"/> >+ </form> >+ >+ [%ELSE %] >+ <!--Implement if statement to determine if library was succesfully created here....--> >+ <form name="retrylibrary" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="1"/> >+ <h1 align="left">Failed </h1> >+ <div> >+ <p> Library was not successfully created</br> >+ Please try again or contact your system administrator. </p> >+ </div> >+ <input type="submit" value="Try again"/> >+ </form> >+ [%END%] >+ >+[% ELSE %] >+<!--Create a library screen 1--> >+ <h2>Create a Library</h2> >+ <form name="LibraryCreation" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="1"/> >+ <input type="hidden" name="createlibrary" value="createlibrary"/> >+ <ol> >+ <li> >+ <label for="branchcode" class="required">Library code: </label> >+ <input type="text" style="text-transform: uppercase;"name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="branchname" class="required">Name: </label> >+ <input type="text" style="text-transform:capitalize;" name="branchname" id="branchname" size="80" value="[% library.branchname |html %]" class=" required" required="required" style="width:200px;"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset> >+ <br> >+ <input type="submit" class="action" value="Submit"/> >+ </form> >+[% 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 @@ >+<!--Pragmas for using and including packages for create patron category--> >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Price %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title> Add a patron category</title> >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'calendar.inc' %] >+<script type="text/javascript"> >+ var MSG_CATEGORYCODE_CHARS = (_("Category code can only contain the following characters: letters, numbers, - and _.")); >+ var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date.")); >+</script> >+<script type="text/javascript"> >+jQuery.validator.addMethod( "letters_numbers", function(value,element){ >+ var patt = /^[a-zA-Z0-9\-_]+$/g; >+ if (patt.test(element.value)) { >+ return true; >+ } else { >+ return false; >+ } >+}, MSG_CATEGORYCODE_CHARS); >+ >+jQuery.validator.addMethod( "enrollment_period", function(){ >+ enrolmentperiod = $("#enrolmentperiod").val(); >+ enrolmentperioddate = $("#enrolmentperioddate").val(); >+ if ( $("#enrolmentperiod").val() !== "" && $("#enrolmentperioddate").val() !== "" ) { >+ return false; >+ } else { >+ return true; >+ } >+}, MSG_ONE_ENROLLMENTPERIOD); >+ >+$(document).ready(function(){ >+ $("#category_form").validate({ >+ rules: { >+ categorycode: { >+ required: true, >+ letters_numbers: true >+ }, >+ description: "required", >+ enrolmentperiod: { >+ required: function(element){ >+ return $("#enrolmentperioddate").val() === ""; >+ }, >+ digits: true, >+ enrollment_period: true >+ }, >+ enrolmentperioddate: { >+ required: function(element){ >+ return $("#enrolmentperiod").val() === ""; >+ }, >+ enrollment_period: true >+ }, >+ dateofbirthrequired: { >+ digits: true >+ }, >+ upperagelimit: { >+ digits: true >+ }, >+ enrolmentfee: { >+ number: true >+ }, >+ reservefee: { >+ number: true >+ }, >+ category_type: { >+ required: true >+ } >+ }, >+ messages: { >+ enrolmentperiod: { >+ required: MSG_ONE_ENROLLMENTPERIOD >+ }, >+ enrolmentperioddate: { >+ required: MSG_ONE_ENROLLMENTPERIOD >+ } >+ } >+ >+ }); >+ >+}) >+</script> >+ >+</head> >+ >+<div> <!-- Header that appears at the top of every screen in the koha onboarding tool--> >+ <h1 align="center"> Welcome to Koha</h1> >+ <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> >+</div> >+ >+ >+[% IF categories.count > 0 %] <!--This if statement checks if the categories variable handed to this template by onboarding.pl has data in it. If the categories variable does have data in it this means that the user has previously imported sample patron category data and so we do not need to show them the create patron category screen 1, instead we can display a screen with ubtton redirecting the user to step 3--> >+<br> >+ <h3 align="left">You do not need to create a patron category as you have already installed the sample patron categories data previously</h3> >+ <form name="skippatroncategory" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="3"/> >+ <div> >+ <input type="submit" name="start" value="Add a patron"/> >+ </div> >+ </form> >+ >+<!--else if the user has not previously imported sample patron categories check if the user has pressed the button name="add_validate" in the create patron category screen 1, and if they have pressed that button then display the below screen with a button to redirect the user to step 3--> >+[% ELSIF op == "add_validate" %] >+ [% IF message != "error_on_insert" %] >+ <form name="createcat" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="3"/> >+ <h1 align="left"> New patron category</h1> >+ <div> >+ <p> Success: Patron category created! Your patron category code is [% category.categorycode %] </p> >+ <p> To add another patron category and for more settings<br> >+ go to More->Administration->Patrons & Circulation->Patron Categories</p> >+ </div> >+ Next up:<br> >+ <input type="submit" name="start" value="Add a patron"><!-- When the user clicks on this button then redirect them to step 3 of the onboarding tool--> >+ </form> >+ [% ELSE %] >+ <form name="retrypatcat" method="post" action="onboarding.pl"> >+ Message is [% message %] >+ <input type="hidden" name="step" value="2"/> >+ <h1 align="left">Failed</h1> >+ <div>Patron Category was not successfully created.</br> >+ Please try again or contact your system administrator.</p> >+ </div> >+ <input type="submit" value="Try again"/> >+ </form> >+ [% END %] >+ >+ >+[% ELSE %] <!--Else display create patron category screen 1 where the user can input values to create their first patron category--> >+ <h1 align="left"> Create a new Patron Category</h1> >+ <form id="category_form" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="2"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <ol> >+ <li> >+ <label for="categorycode" class="required">Category code: </label> >+ <input type="text" style="text-transform: uppercase;" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="description" class="required">Description: </label> >+ <input type="text" style="text-transform:capitalize;" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="overduenoticerequired">Overdue notice required: </label> >+ <select name="overduenoticerequired" value="overduenoticerequired"> >+ [% IF category.overduenoticerequired %] >+ <option value="0">No</option> >+ <option value="1" selected="selected">Yes</option> >+ [% ELSE %] >+ <option value="0" selected="selected">No</option> >+ <option value="1">Yes</option> >+ [% END %] >+ </select> >+ </li> >+ >+ <li> >+ <label for="category_type" class="required">Category type: </label> >+ <select name="category_type" value="category_type" class='required' required='required'> >+ [% IF category and category.category_type == 'S' %] >+ <option value="S" selected="selected">Staff</option> >+ [% ELSE %] >+ <option value="S">Staff</option> >+ [% END %] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="default_privacy">Default privacy: </label> >+ <select value="default_privacy" name="default_privacy" required="required"> >+ [% SET default_privacy = 'default' %] >+ >+ [% IF category %] >+ [% SET default_privacy = category.default_privacy %] >+ [% END %] >+ >+ [% SWITCH default_privacy %] >+ [% CASE 'forever' %] >+ <option value="default">Default</option> >+ <option value="never">Never</option> >+ <option value="forever" selected="selected">Forever</option> >+ [% CASE 'never' %] >+ <option value="default">Default</option> >+ <option value="never" selected="selected">Never</option> >+ <option value="forever">Forever</option> >+ [% CASE %] >+ <option value="default" selected="selected">Default</option> >+ <option value="never">Never</option> >+ <option value="forever">Forever</option> >+ [% END %] >+ </select> >+ <p>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 <i>batch_anonymise.pl</i> which should be set up by your system administrator.</p> >+ </li> >+ >+ <span class="label">Enrolment period: </span> >+ </br> >+ <fieldset> >+ <legend>Choose one</legend> >+ <ol> >+ <li> >+ <label for="enrolmentperiod" style="width:6em;">In months: </label> >+ <input type="number" min="0" class="enrollmentperiod" name="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months >+ </li> >+ <li> >+ <label for="enrolmentperioddate" style="width:6em;">Until date: </label> >+ <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> >+ </li> >+ </ol> >+ </fieldset> >+ <br> >+ <input type="submit" class="action" value="Submit" /> >+ </form> >+[% 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 @@ >+<!--Includes for creating patron--> >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Price %] >+<!--[% USE Branches %]--> >+[% INCLUDE 'doc-head-open.inc' %] >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >+ >+ >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'calendar.inc' %] >+[% INCLUDE 'datatables.inc' %] >+ >+ >+<head> >+<title>Create Patron</title> >+ >+<!--jQuery scripts for creating patron--> >+<!--<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script> >+--> >+</head> >+ >+<div> >+ <h1 align="center"> Welcome to Koha</h1> >+ <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> >+</div> >+<!--Create a patron screen 2--> >+[% IF op == 'add_validate' %] >+ <!--New patron created--> >+ <form name="patrondone" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="4"/> >+ <h1 align="left"> New Patron </h1> >+ <div> >+ <p> Success: New patron created!</p> >+ <p> To create another patron, go to Patrons > New Patron. <br> >+ More > Set Permissions in a user page to gain superlibrarian permissions. >+ </div> >+ Next up: >+ <input type="submit" name="start" value="Add an item type"/> >+ </form> >+ <!--Implement a if statement to check if the patron was successfully created >+ <div> >+ <p> Oh no! Patron was not created</p> >+ </div>--> >+[% ELSE %] >+<!--Create a patron screen 1--> >+ <h1 align="left"> Create a new Patron </h2> >+ <form name="createpatron" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="3"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <ol> >+ <h3>Patron Identity</h3> >+ <li> >+ <label for="surname" class="required">Surname: </label> >+ >+ <input type="text" style="text-transform:capitalize" id="surname" name="surname" value="[% surname %]" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="firstname" class="required">First Name: </label> >+ <input style= "text-transform:capitalize;" type="text" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ >+ <legend id="library_management_lgd">Library Management</legend> >+ <ol> >+ <li> >+ <label for="cardnumber" class="required">Card Number: </label> >+ <input type="number" min="1" id="cardnumber" name="cardnumber" maxlength="20" value="[% borrower.cardnumber | html %]" class="required"> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <!--require a foreach loop to get all the values for the library that the user has either imported (in web installer) or created in the first step of this onboarding tool--> >+ <label for="libraries" class="required"> Library: </label> >+ <select name="libraries" size="1" id="libraries"> >+ >+ [% FOREACH library IN libraries %] >+ <option name="libraries" value="[% library.branchcode %]"> [% library.branchname %] >+ [% END %] >+ >+ </select> >+ <span class="required"> Required</span> >+ </li> >+ <li> >+ <label for="categorycode_entry" class="required"> Patron Category</label> >+ <select id="categorycode_entry" name="categorycode_entry" onchange="update_category_code(this);"> >+ [% FOREACH category IN categories %] >+ <option name="categorycode_entry" value = "[% category.categorycode %]"> [%category.description %]</option> >+ [% END %] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ >+ <ol> >+ >+ <h3> Patron permissions</h3> >+ <input type="hidden" name="newflags" value="1"/> >+ <li> >+ <input type="hidden" class="flag parent" id="flag-0" name="flag" value="superlibrarian"/> >+ <label name="permissioncode" for="flag-0"> superlibrarian</label> >+ </li> >+ </ol> >+ <ol> >+ <h3>OPAC/Staff Login</h3> >+ <li> >+ <label for="userid" class="required">Username: </label> >+ <input type="text" name="userid" id ="userid" size="20" value="[% userid %]" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="passwordlabel" class="required">Password: </label> >+ <input type="password" name="password" id="password" size="20" value="[% member.password |html %]" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="password2" class="required">Confirm password: </label> >+ <input type="password" id="password2" name="password2" size="20" value="" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset><br> >+ <input type="submit" class="action" value="Submit"/> >+ </form> >+[% 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 @@ >+<!--Includes for creating item type--> >+[% INCLUDE 'doc-head-open.inc' %] >+ >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+ >+<head> >+<title>Create item type</title> >+ >+<!--jQuery scripts for creating item type--> >+ >+ >+ >+</head> >+ >+<div> >+ <h1 align="center"> Welcome to Koha</h1> >+ <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> >+</div> >+ >+[% IF itemtypes.count > 0 %] >+ <br> >+ h no! Patron was not created</p> >+ >+ <h3 align="left">You do not need to create a item type as you have already installed the sample item type data previously</h3> >+ <form name="skipitemtype" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="5"/> >+ <div> >+ <input type="submit" name="start" value="Add a circulation rule"/> >+ </div> >+ </form> >+ >+ >+<!--Create a item type screen 2--> >+[% ELSIF op == "add_validate" %] >+ <!--New item type created--> >+ [% IF message != "error_on_insert" %] >+ <form name="createitemtype" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="5"/> >+ <h1 align="left"> New Item type </h1> >+ >+ <div> >+ <p> Success: New item type created!</p> >+ <p> To create another item type later and for more setttings <br> >+ go to More->Administration->Item types >+ </div> >+ Next up: >+ <input type="submit" value="Add a circulation rule"/> >+ </form> >+ [% ELSE %] >+ <form name="retryitem" method="post" action="onboarding.pl"> >+ <input type="hidden" name="step" value="4"/> >+ <h1 align="left">Failed </h1> >+ <div> >+ <p>Item type was not successfully created. </br> >+ Please try again or contact your system administrator. </p> >+ </div> >+ </form> >+ <!--Implement a if statement to check if the item type was successfully created or not >+--> [% END %] >+[% ELSE %] >+<!--Create a item type screen 1--> >+ <h1 align="left"> Create a new Item type </h2> >+ <form name="createitemform" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="4"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <ol> >+ <li> >+ <label for="itemtype" class="required">Item type code: </label> >+ <input type="text" style="text-transform:uppercase;" name="itemtype" id="itemtype" size="10" maxlength="10" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="description" class="required">Description: </label> >+ <input type="text" style="text-transform:capitalize;" name="description" id="description" size="42" value="[% itemtype.description |html %]" class="required" required="required"> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset><br> >+ <input type="submit" class="action" value="Submit"/> >+ </form> >+[% 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 @@ >+<!--Includes for creating circulation rule--> >+[% INCLUDE 'doc-head-open.inc' %] >+ >+[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %] >+[% INCLUDE 'installer-doc-head-close.inc' %] >+ >+<head> >+<title>Create Circulation rule</title> >+ >+<!--jQuery scripts for creating circulation rule--> >+ >+ >+ >+</head> >+ >+<div> >+ <h1 align="center"> Welcome to Koha</h1> >+ <h1 id="logo"><img alt="Koha" style="width:50%;margin:auto;display:block;align:center;" src="[% interface %]/[% theme %]/img/koha.org-logo.gif"/></h1> >+</div> >+ >+[% IF (finish) %] >+<h1>Congratulations you have finished and ready to use Koha</h1> >+<a href="/cgi-bin/koha/mainpage.pl">Start using Koha</a> >+ >+[% END %] >+ >+<!--Create a circulation rule screen 2--> >+[% IF op == "add_validate" %] >+ <!--New circulation rule created--> >+ <form name="finish" method="post" action="onboarding.pl"> >+ <input type="hidden" name="op" value="finish" /> >+ >+ <h1 align="left"> New Circulation rule </h1> >+ >+ <div> >+ <p> Success: New circulation rule created!</p> >+ <p> To create circulation rule, go to <br> >+ More->Administration->Circulation and Fine Rules >+ </div> >+ Next up: >+ <input type="submit" name="op" value="Finish"/> >+ </form> >+ <!-- <div> >+ <p> Oh no! Circulation Rule was not created</p> >+ </div> --> >+ >+ >+[% ELSE %] >+<!--Create a circulation rule screen 1--> >+ <h1 align="left"> Create a new Circulation rule </h2> >+ >+ <form name="createcirculationrule" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="5"/> >+ <input type="hidden" name="op" value="add_validate" /> >+ <ol> >+ <li> >+ <label for="categorycode" class="required">Patron Category: </label> >+ <select name="categorycode" id="categorycode" required="required" onchange = "update_categorycode(this);"> >+ <!-- <option name="categorycode" value="All">All--> >+ [% FOREACH category IN categories %] >+ <option name="categorycode" value = "[% category.categorycode %]"> [%category.description %]</option> >+ [%END%] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="itemtype"> Item type: </label> >+ <select id="itemtype" name="itemtype" required="required"> >+ [% FOREACH item IN itemtypes %] >+ <option name="itemtype" value = "[% item.itemtype %]"> [% item.itemtype %] >+ [%END%] >+ </select> >+ <span class="required"> Required</span> >+ </li> >+ >+ <li> >+ <label for="maxissueqty" class="required">Current checkouts allowed: </label> >+ <input type="number" min="0" name="maxissueqty" id="maxissueqty" size="10" maxlength="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="issuelength" class="required">Loan Period: </label> >+ <input type="number" min="0" name="issuelength" id="issuelength" size="10" maxlength="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="lengthunit">Units: </label> >+ <select name="lengthunit" id="lengthunit" required="required"> >+ [% SET units = 'days' %] >+ >+ [% IF category %] <!--Check if category is the correct value name in the context of units of days that a loan period is for in the item borrowing script--> >+ [% SET default_privacy = category.default_privacy %] >+ [% END %] >+ >+ [% SWITCH units %] >+ [% CASE 'days' %] >+ <option value="days" selected="selected">Days</option> >+ <option value="hours">Hours</option> >+ [% CASE 'hours' %] >+ <option value="days">Days</option> >+ <option value="hours" selected="selected">Hours</option> >+ [% END %] >+ </select> >+ </li> >+ >+ <li> >+ <label for="renewalsallowed" class="required">Renewals Allowed: </label> >+ <input type="number"min="0" name="renewalsallowed" id="renewalsallowed" size="10" maxlength="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="renewalperiod" class="required">Renewals Period: </label> >+ <input type="number" min="0"name="renewalperiod" id="renewalperiod" size="10" maxlength="10" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ >+ <li> >+ <label for="onshelfholds">On shelf holds allowed: </label> >+ <select name="onshelfholds" id="onshelfholds" required="required"> >+ <option value="yes" selected="selected">Yes</option> >+ <option value="anyunavailable">If any unavailable</option> >+ <option value="allunavailable">If all unavailable</option> >+ </select> >+ </li> >+ </ol> >+ </fieldset><br> >+ <input type="submit" class="action" value="Submit"/> >+ </form> >+[% 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' %] >+<title>Koha Tutorial Summary</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+<body id="admin_admin-home" class="admin"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'cat-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Summary</div> >+ >+<div id="doc" class="yui-t7"> >+ <div id="bd"> >+ <div id="yui-main" class="sysprefs"> >+ <div class="yui-g"><h1>Tutorial Summary Page</h1></div> >+ <fieldset style="font-size:120%"> >+ <h2>Library</h2> >+ <p> To add another library and for more settings, go to </br> >+ More > Administration > Libraries and Groups </p> >+ >+ <h2>Patron Category</h2> >+ <p>To add another patron category and for more settings, go to</br> >+ More > Administration > Patrons and Circulation > Patron Categories</p> >+ >+ <h2>Patron</h2> >+ <p>To create another patron, go to Patrons > New Patron. To set the </br> >+ permissions of the patron, go to the patron's page and More > Set Permissions</p> >+ >+ <h2>Item Type</h2> >+ <p>To create another item type and for more settings, go to</br> >+ More > Administration > Item types </p> >+ >+ <h2>Circulation Rule</h2> >+ <p>To create another circulation rule, go to </br> >+ More > Administration > Circulation and Fine Rules</p< >+ </fieldset> >+ >+ </div> >+ </div> >+</div> >+[% 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 <http://www.gnu.org/licenses>. >+ >+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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17855
:
58657
|
58658
|
58659
|
58660
|
58661
|
58662
|
58663
|
58664
|
58665
|
58666
|
58667
|
58668
|
58669
|
58781
|
58782
|
58783
|
58784
|
58785
|
58792
|
58793
|
58794
|
58846
|
58860
|
58861
|
58862
|
58886
|
58892
|
58893
|
58894
|
58895
|
58896
|
58897
|
58898
|
58899
|
58900
|
58901
|
58902
|
58903
|
58904
|
58905
|
58906
|
58907
|
59037
|
59051
|
59140
|
59141
|
59174
|
59188
|
59277
|
59279
|
59280
|
59281
|
59628
|
59703
|
59705
|
59706
|
59707
|
59708
|
59709
|
59710
|
59711
|
59712
|
59742
|
59826
|
59830
|
59840
|
59841
|
59842
|
59856
|
59857
|
60092
|
61667
|
61668
|
61986
|
62186
|
62191
|
62192
|
62193
|
62220
|
62221
|
62222
|
62223
|
62231
|
62233
|
62234
|
62235
|
62236
|
62237
|
62238
|
62239
|
62240
|
62241
|
62242
|
62243
|
62251
|
62252
|
62253
|
62254
|
62255
|
62256
|
62257
|
62258
|
62259
|
62260
|
62261
|
62262
|
62263
|
62281
|
62282
|
62283
|
62284
|
62285
|
62286
|
62287
|
62288
|
62668
|
62669
|
62670
|
62671
|
62672
|
62673
|
62674
|
62675