From 2b6eb63f57edf027bb3fafd4ab48a09c20f95878 Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 28 Nov 2003 09:29:28 +0000 Subject: [PATCH] removing unused files --- telnet/borrwraper.pl | 68 ------------ telnet/circ | 15 --- telnet/doreturns.pl | 83 --------------- telnet/issuewrapper.pl | 38 ------- telnet/returnswrapper.pl | 31 ------ telnet/startint.pl | 96 ----------------- translator/translator.pl | 196 ----------------------------------- translator/translator.readme | 31 ------ 8 files changed, 558 deletions(-) delete mode 100755 telnet/borrwraper.pl delete mode 100755 telnet/circ delete mode 100755 telnet/doreturns.pl delete mode 100755 telnet/issuewrapper.pl delete mode 100755 telnet/returnswrapper.pl delete mode 100755 telnet/startint.pl delete mode 100755 translator/translator.pl delete mode 100644 translator/translator.readme diff --git a/telnet/borrwraper.pl b/telnet/borrwraper.pl deleted file mode 100755 index f3d4f9c53a..0000000000 --- a/telnet/borrwraper.pl +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl - - -# Copyright 2000-2002 Katipo Communications -# -# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use DBI; -use C4::Context; -use C4::Circulation::Issues; -use C4::Circulation::Main; -use C4::InterfaceCDK; -use C4::Circulation::Borrower; - -# my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}"); -my %env = ( - branchcode => $ARGV[0], usercode => $ARGV[1], proccode => "lgon", borrowernumber => "", - logintime => "", lasttime => $ARGV[6], tempuser => "", debug => "9", - telnet => $ARGV[2], queue => $ARGV[3], printtype => $ARGV[4], brdata => $ARGV[5], bcard=>$ARGV[7] - ); -my ($env) = \%env; - -startint(); - helptext(''); -my $done; -my ($items,$items2,$amountdue); -my $itemsdet; -$env->{'sysarea'} = "Issues"; -$done = "Issues"; -my $i=0; -my $dbh = C4::Context->dbh; - my ($bornum,$issuesallowed,$borrower,$reason,$amountdue) = C4::Circulation::Borrower::findborrower($env,$dbh); -# my $time=localtime(time); -# open (FILE,">>/tmp/$<_$ARGV[6]"); -# print FILE "borrower found $bornum"; -# close FILE; - $env->{'loanlength'}=""; - if ($reason ne "") { - $done = $reason; - } elsif ($env->{'IssuesAllowed'} eq '0') { - error_msg($env,"No Issues Allowed =$env->{'IssuesAllowed'}"); - } else { - $env->{'bornum'} = $bornum; - $env->{'bcard'} = $borrower->{'cardnumber'}; - ($items,$items2)=C4::Circulation::Main::pastitems($env,$bornum,$dbh); #from Circulation.pm - $done = "No"; - my $it2p=0; - while ($done eq 'No'){ - ($done,$items2,$it2p,$amountdue,$itemsdet) = C4::Circulation::Issues::processitems($env,$bornum,$borrower,$items,$items2,$it2p,$amountdue,$itemsdet); - } - - } - if ($done ne 'Issues'){ - die "test"; - } diff --git a/telnet/circ b/telnet/circ deleted file mode 100755 index b560b203af..0000000000 --- a/telnet/circ +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl - -#my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}"); - -$done = "Issues"; -my $i=0; -while ($done eq "Issues") { - my @args=('startint.pl',@ARGV); - eval{system(@args)}; - $exit_value = $? >> 8; - if ($exit_value){ - $done=$exit_value; - } - -} diff --git a/telnet/doreturns.pl b/telnet/doreturns.pl deleted file mode 100755 index 1817b655d8..0000000000 --- a/telnet/doreturns.pl +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl - - -# Copyright 2000-2002 Katipo Communications -# -# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use DBI; -use C4::Context; -use C4::Accounts; -use C4::InterfaceCDK; -use C4::Circulation::Main; -use C4::Format; -use C4::Scan; -use C4::Stats; -use C4::Search; -use C4::Print; -use C4::Circulation::Returns; - - -my %env = ( -branchcode => $ARGV[0], usercode => $ARGV[1], proccode => "lgon", borrowernumber => "", -logintime => "", lasttime => "", tempuser => "", debug => "9", -telnet => $ARGV[2], queue => $ARGV[3], printtype => $ARGV[4], brdata => $ARGV[5] -); -my $env=\%env; - - -my $dbh = C4::Context->dbh; -my @items; -@items[0]=" "x50; -my $reason; -my $item; -my $reason; -my $borrower; -my $itemno; -my $itemrec; -my $bornum; -my $amt_owing; -my $odues; -my $issues; -my $resp; -startint(); -until ($reason ne "") { - ($reason,$item) = returnwindow($env,"Enter Returns",$item,\@items,$borrower,$amt_owing,$odues,$dbh,$resp); #C4::Circulation - if ($reason eq "") { - $resp = ""; - ($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) = C4::Circulation::Returns::checkissue($env,$dbh,$item); - if ($bornum ne "") { - ($issues,$odues,$amt_owing) = borrdata2($env,$bornum); - } else { - $issues = ""; - $odues = ""; - $amt_owing = ""; - } - if ($resp ne "") { - if ($itemno ne "" ) { - my $item = itemnodata($env,$dbh,$itemno); - my $fmtitem = C4::Circulation::Issues::formatitem($env,$item,"",$amt_owing); - unshift @items,$fmtitem; - if ($items[20] > "") { - pop @items; - } - } - } - } -} -die; - - diff --git a/telnet/issuewrapper.pl b/telnet/issuewrapper.pl deleted file mode 100755 index e520bb012d..0000000000 --- a/telnet/issuewrapper.pl +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/perl - -#my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}"); - - -# Copyright 2000-2002 Katipo Communications -# -# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -$done = "Issues"; -my $i=0; -my $bcard; -while ($done eq "Issues") { - my @args=('borrwraper.pl',@ARGV,$bcard); - my $time=localtime(time); - open (FILE,">>/tmp/$<_$ARGV[6]"); - print FILE "new borrower $time\n"; - close FILE; - eval{$bcard=system(@args)}; - $exit_value = $? >> 8; - if ($exit_value){ - $done=$exit_value; - } - -} diff --git a/telnet/returnswrapper.pl b/telnet/returnswrapper.pl deleted file mode 100755 index 787f6fdee2..0000000000 --- a/telnet/returnswrapper.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl - - -# Copyright 2000-2002 Katipo Communications -# -# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -$done = "returns"; -my $i=0; -while ($done eq "returns") { - my @args=('doreturns.pl',@ARGV); - eval{system(@args)}; - $exit_value = $? >> 8; - if ($exit_value){ - $done=$exit_value; - } - -} diff --git a/telnet/startint.pl b/telnet/startint.pl deleted file mode 100755 index c37f0b389b..0000000000 --- a/telnet/startint.pl +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/perl - - -# Copyright 2000-2002 Katipo Communications -# -# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use strict; -#use C4::Security; -#use C4::Database; -use C4::Circulation::Main; -#use C4::Circulation::Issues; -#use C4::Circulation::Returns; -#use C4::Circulation::Renewals; -#use C4::Circulation::Borrower; -#use C4::Reserves; -use C4::InterfaceCDK; -#use C4::Security; - - -# set up environment array -# branchcode - logged on branch -# usercode - current user -# proccode - current or last procedure -# borrowernumber - current or last borrowernumber -# logintime - time logged on -# lasttime - lastime security checked -# tempuser - temporary user -my %env = ( - branchcode => "", usercode => "", proccode => "lgon", borrowernumber => "", - logintime => "", lasttime => "", tempuser => "", debug => "9" - ); - -$env{'branchcode'} = "C"; -$env{'usercode'} = `whoami`; -$env{'telnet'} = "Y"; - - -#start interface -&startint(\%env,'Circulation'); -getbranch(\%env); -getprinter(\%env); -my $donext = 'Circ'; -my $reason; -my $data; -while ($donext ne 'Quit') { - if ($donext eq "Circ") { - ($reason,$data) = menu(\%env,'console','Circulation', - ('Issues','Returns','Select Branch','Select Printer')); - } else { - $data = $donext; - } - if ($data eq 'Issues') { - my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}","$env{'lasttime'}"); - open (FILE,">>/tmp/$<_$$"); - my $time=localtime(time); - print FILE "Start issues $time \n"; - close FILE; - system(@args); - } elsif ($data eq 'Returns') { - my @args=('returnswrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}"); - open (FILE,">>/tmp/$<_$$"); - my $time=localtime(time); - print FILE "Start returns $time \n"; - close FILE; - system(@args); -# $donext=Returns(\%env); #C4::Circulation::Returns - } elsif ($data eq 'Select Branch') { - getbranch(\%env); - } elsif ($data eq 'Select Printer') { - getprinter(\%env); -# } elsif ($data eq 'Borrower Enquiries') { - # $donext=Borenq($env); #C4::Circulation::Borrower - conversion -# } elsif ($data eq 'Reserves'){ -# $donext=EnterReserves(\%env); #C4::Reserves - } elsif ($data eq 'Quit') { - $donext = $data; - &endint(\%env); - die; - } -} - &endint(\%env); - die; diff --git a/translator/translator.pl b/translator/translator.pl deleted file mode 100755 index 7bdd18ba84..0000000000 --- a/translator/translator.pl +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/perl - - -# Copyright 2000-2002 Katipo Communications -# -# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use strict; - -use locale; -use POSIX; -use Locale::gettext; - -my $tofile; -if (exists $ENV{"HTTP_ACCEPT"}) { - $tofile=0; -} else { - $tofile=1; -} - - -print "Content-Type: text/html \n\n" unless($tofile); - -my $path=$ENV{"PATH_TRANSLATED"}; - -textdomain("koha"); - -my @locale=`locale -a`; -my %lang; -foreach(@locale){ - next unless (/_/); - push @{$lang{$`}}, $'; -} - -my $str_env=$ENV{"HTTP_ACCEPT_LANGUAGE"}; -$str_env=~s/\s*//g; -my @lang=split/,/,$str_env; -my $lang="us_US"; - -foreach my $locale(@lang){ - goto find_locale if ($locale eq 'en'); - foreach my $lg(@{$lang{$locale}}){ - setlocale(LC_MESSAGES,$locale."_".$lg); - my $tmp = gettext($locale); - if ($tmp ne $locale) - { - $lang=$tmp; - goto find_locale; - } - } -} - -find_locale: -setlocale(LC_MESSAGES,$lang); - -my @katalog; -my $plik; - -if ($tofile){ - - @katalog=`ls -R`; - - $plik=$ARGV[0]; - if ($plik eq ''){ - $plik="koha.gettext.c"; - } - -} else { - @katalog=("cos"); -} - -my $kat; -my (%dgettxt, %dane, %dane2, @dane2); -my $i; - -$dgettxt{'iso-8859-1'}=1; -$dgettxt{'us_US'}=1; - -my $txt =< - -TXT - -foreach(@katalog){ - - if (/:$/){ - $kat="$`/"; - next; - } - - if ($tofile){ - unless ($_=~/(\.html|\.inc)$/i) { - next; - } - } - - print "$kat$_" if ($tofile); - - my $dane; - { - local $/; - if ($tofile){ - open PL, "$kat$_"; - } else { - open PL, "$path"; - } - $dane=; - close PL; - } - - - $dane=~s//$txt/i; - - $dane=~s/%/&zamien/ges; # change % (specjal symbol) - $dane=~s/\\\'/&zamien/ges; # change \' - $dane=~s/\\\"/&zamien/ges; # change \" - - # take out graphics - $dane=~s/[\"\']\/?([\w-\/\.]*?\.gif)[\"\']/&zamien($1)/ges; - -# $dane=~s/messenger\s*\((.*?)\)\s*[\}\{;]/&zamien($1)/ges; -# $dane=~s/\.write(ln)?\s*\((.*?)\)\s*[\};]/&zamien($2)/ges; - - # take out string in field alt - $dane=~s/alt\s*=\s*[\"]([^\"]*)[\"]/&zamien($1)/iges; - $dane=~s/alt\s*=\s*[\']([^\']*)[\']/&zamien($1)/iges; - - $dane=~s//&zamien/ges; - $dane=~s//&zamien/iges; - - $dane=~s/<[\w\/]\w*\s*((\w*\s*=\s*(\'[^\']*\'|\"[^\"]*\"|[\w-\/?&,\.=%#]*)|[%\d*%]|\w)\s*)*>/&zamien/ges; - $dane=~s//&zamien/ges; - $dane=~s/]*>/&zamien/ges; - $dane=~s/<#.*?#>/&zamien/ges; - - my $dane2=$dane; - $dane2=~s/(\s*%\d+%\s*)+/%/gs; - $dane2=~s/^%//g; - $dane2=~s/%$//g; - foreach my $tmp(split/%/,$dane2){ - my $tmp_ok = $tmp; - $tmp_ok=~s/\s+/ /gs; - next unless ($tmp_ok=~/\w+/); - $dgettxt{$tmp_ok}++ unless $dgettxt{$tmp_ok}; - $tmp=~s/([\)\(])/\\$1/g; - $dane=~s/$tmp/gettext($tmp_ok)/es; - } - unless ($tofile){ - while($dane=~/%\d+%/){ - $dane=~s/%(\d+)%/$dane2{$1}/g; - } - print $dane; - } -} - -if ($tofile) { - - open PK, ">$plik"; - foreach my $tmp(sort keys %dgettxt){ - $tmp=~s/\"/\\\"/gs; - print PK "gettext(\"$tmp\");\n"; - } - close PK; -} - -exit; - -########################################################### - -sub zamien { - my $tmp = $&; - unless ($dgettxt{$_[0]}) { - $dgettxt{$_[0]}++; - } - $tmp=~s/$_[0]/gettext($&)/es; - unless ($dane{$tmp}) { - push @dane2, $tmp; - $dane2{$i}=$tmp; - $dane{$tmp}=$i++; - } - return "%${\($dane{$tmp})}%"; -} diff --git a/translator/translator.readme b/translator/translator.readme deleted file mode 100644 index 450329b21b..0000000000 --- a/translator/translator.readme +++ /dev/null @@ -1,31 +0,0 @@ -This is a small note about 'translator.pl'. -Author: Pawel Skuza -email: pawelzc@cz.top.pl - -The Script 'translator.pl' does two things: -1. Prepares strings that can be translated; -2. Translates strings using gettext. - -1. Prepare strings which can be translated. -Copy file 'translator.pl' into koha root directory and execute it. -eg. - cd /usr/src/koha - cp scripts/translator.pl . - ./translator.pl some_file_name - xgettext some_file_name -okoha.pot - vi koha.pot //now you must translate koha.pot - msgfmt koha.pot -okoha.mo - cp koha.mo /usr/share/locale/$$/LC_MESSAGES //where $$ is your language - -note: if you omit 'some_file_name' the translator will create 'koha.gettext.c' - -2. Translate strings using gettext. -You have to configure your apache. Put these lines into koha and opac virtual servers: - - Action text/html /cgi-bin/koha/translator/translator.pl - Action text/plane /cgi-bin/koha/translator/translator.pl - -Don't forget to set up the language preference in your browser. - -Enjoy koha in your language! - -- 2.39.2