From 0efeb8ac5ecc9626b900eaeb7c5485181a992bdf Mon Sep 17 00:00:00 2001 From: tonnesen Date: Tue, 3 Sep 2002 21:59:48 +0000 Subject: [PATCH] Call kohareporter from installer.pl and koha.upgrade --- Install.pm | 34 +++++++++++++++++++++++++++++++++- buildrelease | 1 + installer.pl | 7 +++++++ koha.upgrade | 6 ++++++ kohareporter | 23 ++++++++++++++++++++++- 5 files changed, 69 insertions(+), 2 deletions(-) diff --git a/Install.pm b/Install.pm index 0d4313a432..c941f10616 100644 --- a/Install.pm +++ b/Install.pm @@ -115,6 +115,7 @@ They can be installed by running (as root) the following: %s |; + $messages->{'AllPerlModulesInstalled'}->{en}=qq| ============================== @@ -206,7 +207,7 @@ For more information visit http://www.koha.org Press to exit the installer: |; sub releasecandidatewarning { - my $message=getmessage('ReleaseCandidateWarning', [$::kohaversion, $::kohaversion]); + my $message=getmessage('ReleaseCandidateWarning', [$::newversion, $::newversion]); my $answer=showmessage($message, 'yn', 'n'); if ($answer =~ /y/i) { @@ -263,8 +264,39 @@ sub checkperlmodules { } + unless (-x "/usr/bin/perl") { + my $realperl=`which perl`; + chomp $realperl; + $realperl = showmessage(getmessage('NoUsrBinPerl'), 'none'); + until (-x $realperl) { + $realperl=showmessage(getmessage('AskLocationOfPerlExecutable', $realperl), 'free', $realperl, 1); + } + my $response=showmessage(getmessage('ConfirmPerlExecutableSymlink', $realperl), 'yn', 'y', 1); + unless ($response eq 'n') { + system("ln -s $realperl /usr/bin/perl"); + } + } + + } +$messages->{'NoUsrBinPerl'}->{en}=qq| + +======================================== += Perl is not located in /usr/bin/perl = +======================================== + +The Koha perl scripts expect to find the perl executable in the /usr/bin +directory. It is not there on your system. + +|; + +$messages->{'AskLocationOfPerlExecutable'}->{en}=qq|Location of Perl Executable: [%s]: |; +$messages->{'ConfirmPerlExecutableSymlink'}->{en}=qq| +The Koha scripts will _not_ work without a symlink from %s to /usr/bin/perl + +May I create this symlink? ([Y]/N): +: |; sub getmessage { my $messagename=shift; diff --git a/buildrelease b/buildrelease index 9e316d1271..68c983bdc7 100644 --- a/buildrelease +++ b/buildrelease @@ -224,6 +224,7 @@ system("mv $rootdir/intranet-cgi/TODO $rootdir"); system("mv $rootdir/intranet-cgi/installer.pl $rootdir"); system("mv $rootdir/intranet-cgi/koha.upgrade $rootdir"); system("mv $rootdir/intranet-cgi/Install.pm $rootdir"); +system("mv $rootdir/intranet-cgi/kohareporter $rootdir"); chmod 0770, "$rootdir/installer.pl"; chmod 0770, "$rootdir/koha.upgrade"; system("mv $rootdir/intranet-cgi/koha.conf $rootdir"); diff --git a/installer.pl b/installer.pl index a0e4f817a6..63853bc2cc 100644 --- a/installer.pl +++ b/installer.pl @@ -94,3 +94,10 @@ showmessage(getmessage('AuthenticationWarning'), 'PressEnter'); showmessage(getmessage('Completed', [ $::servername, $::intranetport, $::servername, $::opacport]), 'PressEnter'); + + +my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y'); +if ($reply=~/y/i) { + system("perl kohareporter"); +} + diff --git a/koha.upgrade b/koha.upgrade index 00a6728abe..6dd9caf1ce 100644 --- a/koha.upgrade +++ b/koha.upgrade @@ -453,3 +453,9 @@ Apache. Please report any problems you encounter through http://bugs.koha.org/ |; + + +my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y'); +if ($reply=~/y/i) { + system("perl kohareporter"); +} diff --git a/kohareporter b/kohareporter index bb85cd7068..f62112c65d 100755 --- a/kohareporter +++ b/kohareporter @@ -36,7 +36,10 @@ print qq| = Koha Installation Survey = ============================ -Feel free to skip any questions that you do not want to answer, +Feel free to skip any questions that you do not want to answer. + +There will be a comments section at the end if you would like to provide +additional information that does not fit within these questions. |; @@ -62,6 +65,8 @@ $params.="&$param"; print "\n\nAdditional Comments: [leave two blank lines to end]\n"; + + my $additionalcomments='%0D%0D'; my $lastlineblank=0; while () { @@ -79,6 +84,22 @@ while () { $additionalcomments=urlencode($additionalcomments); $params.="&AdditionalComments=$additionalcomments"; +print "\n\n"; +print qq| +==================== += Survey Completed = +==================== + +Thank you for completing our survey. We will now connect to a web server on +$host to transfer your responses. + +Do you wish to continue submitting your survey results ([Y]/N)? |; +my $reply=; +if ($reply=~/n/i) { + print "Aborting survey submission...\n"; + sleep 3; + exit; +} $remote = IO::Socket::INET->new( Proto => "tcp", -- 2.39.5