koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/misc Install.pm,1.75,1.76


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/misc Install.pm,1.75,1.76
Date: Tue, 29 Jun 2004 01:34:07 -0700

Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24420/misc

Modified Files:
        Install.pm 
Log Message:
Adding "directory-select" feature to the "select sql file to insert to your DB".

Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -r1.75 -r1.76
*** Install.pm  22 Jun 2004 15:32:43 -0000      1.75
--- Install.pm  29 Jun 2004 08:34:05 -0000      1.76
***************
*** 1646,1650 ****
        }
  
!       my ($auto_install) = @_;
        showmessage(getmessage('InstallFiles'),'none') unless 
($auto_install->{NoPressEnter});
  
--- 1646,1650 ----
        }
  
! #     my ($auto_install) = @_;
        showmessage(getmessage('InstallFiles'),'none') unless 
($auto_install->{NoPressEnter});
  
***************
*** 1963,2002 ****
        startsysout();  
        system("$mysqldir/bin/mysql -u$user $database -e \"update 
systempreferences set value='$language' where variable='opaclanguages'\"");
!       # CHECK for any other file to append...
!       my @sql;
!       push @sql,"FINISHED";
        if (-d "scripts/misc/sql-datas") {
!           opendir D, "scripts/misc/sql-datas";
!           foreach my $sql (readdir D) {
!                       next unless ($sql =~ /.txt$/);
!                       push @sql, $sql;
!           }
!       }
!       my $loopend=0;
!       while (not $loopend) {
!               print heading("SELECT SQL FILE");
!               print qq|
  Select a file to append to the Koha DB.
  enter a number. A detailled explanation of the file will be given
  if you confirm, the file will be added to the DB
  |;
!               for (my $i=0;$i<=$#sql;$i++) {
!                       print "$i => ".$sql[$i]."\n";
!               }
!               my $response =<STDIN>;
!               if ($response==0) {
!                       $loopend = 1;
!               } else {
!                       # show the content of the file
!                       my $FileToUpload = $sql[$response];
!                       open FILE,"scripts/misc/sql-datas/$FileToUpload";
!                       my $content = <FILE>;
!                       print heading("INSERT $FileToUpload ?")."$content\n";
!                       # ask confirmation
!                       $response=showmessage(getmessage('ConfirmFileUpload'), 
'yn', 'y');
!                       # if confirmed, upload the file in the DB
!                       unless ($response =~/^n/i) {
!                               $FileToUpload =~ s/\.txt/\.sql/;
!                               system("$mysqldir/bin/mysql -u$user $database 
<scripts/misc/sql-datas/$FileToUpload");
                        }
                }
--- 1963,2034 ----
        startsysout();  
        system("$mysqldir/bin/mysql -u$user $database -e \"update 
systempreferences set value='$language' where variable='opaclanguages'\"");
!       my @dirs;
        if (-d "scripts/misc/sql-datas") {
!               # ask for directory to look for files to append
!               my @directories;
!               push @directories,"FINISHED";
!               if (-d "scripts/misc/sql-datas") {
!                       opendir D, "scripts/misc/sql-datas";
!                       foreach my $dir (readdir D) {
!                               next if ($dir =~ /^\./);
!                               push @directories, $dir;
!                       }
!               }
!               my $loopend=0;
!               while (not $loopend) {
!                       print heading("SELECT SQL DIRECTORY");
!                       print qq|
! Select a directory. You will see every file included in this directory and be 
able to choose file(s) to import into Koha
! This is a VERY important feature. By selecting the proper options, you can 
get a pre-setup Koha, almost ready to be put in production.
! Choose wisely.
! |;
!                       for (my $i=0;$i<=$#directories;$i++) {
!                               print "$i => ".$directories[$i]."\n";
!                       }
!                       my $sqluploaddir =<STDIN>;
!                       if ($sqluploaddir==0) {
!                               $loopend = 1;
!                       } else {
!                               $sqluploaddir = $directories[$sqluploaddir];
!                               # CHECK for any other file to append...
!                               my @sql;
!                               push @sql,"FINISHED";
!                               if (-d "scripts/misc/sql-datas/$sqluploaddir") {
!                                       opendir D, 
"scripts/misc/sql-datas/$sqluploaddir";
!                                       foreach my $sql (readdir D) {
!                                               next unless ($sql =~ /.txt$/);
!                                               push @sql, $sql;
!                                       }
!                               }
!                               $loopend=0;
!                               while (not $loopend) {
!                                       print heading("SELECT SQL FILE");
!                                       print qq|
  Select a file to append to the Koha DB.
  enter a number. A detailled explanation of the file will be given
  if you confirm, the file will be added to the DB
  |;
!                                       for (my $i=0;$i<=$#sql;$i++) {
!                                               print "$i => ".$sql[$i]."\n";
!                                       }
!                                       my $response =<STDIN>;
!                                       if ($response==0) {
!                                               $loopend = 1;
!                                       } else {
!                                               # show the content of the file
!                                               my $FileToUpload = 
$sql[$response];
!                                               open 
FILE,"scripts/misc/sql-datas/$sqluploaddir/$FileToUpload";
!                                               my $content = <FILE>;
!                                               print heading("INSERT 
$sqluploaddir/$FileToUpload ?")."$content\n";
!                                               # ask confirmation
!                                               
$response=showmessage(getmessage('ConfirmFileUpload'), 'yn', 'y');
!                                               # if confirmed, upload the file 
in the DB
!                                               unless ($response =~/^n/i) {
!                                                       $FileToUpload =~ 
s/\.txt/\.sql/;
!                                                       
system("$mysqldir/bin/mysql -u$user $database 
<scripts/misc/sql-datas/$sqluploaddir/$FileToUpload");
!                                               }
!                                       }
!                               }
!                               $loopend=0;
                        }
                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]