[Koha-cvs] CVS: koha/misc Install.pm,1.90,1.91 overduenotices.pl,1.3,1.4

Paul POULAIN tipaul at users.sourceforge.net
Mon Jun 20 16:28:23 CEST 2005


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

Modified Files:
	Install.pm overduenotices.pl 
Log Message:
synch'ing 2.2 and head

Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -r1.90 -r1.91
*** Install.pm	27 May 2005 13:33:42 -0000	1.90
--- Install.pm	20 Jun 2005 14:28:10 -0000	1.91
***************
*** 3,7 ****
  
  # Copyright 2000-2002 Katipo Communications
! # Contains parts Copyright 2003-5 MJ Ray
  #
  # This file is part of Koha.
--- 3,7 ----
  
  # Copyright 2000-2002 Katipo Communications
! # Contains parts Copyright 2003-4 MJ Ray
  #
  # This file is part of Koha.
***************
*** 860,865 ****
  	unless (eval {require MARC::Record})     { push @missing,"MARC::Record" };
  	unless (eval {require Mail::Sendmail})   { push @missing,"Mail::Sendmail" };
- 	unless (eval {require PDF::API2})   { push @missing,"PDF::API2" };
  # The following modules are not mandatory, depends on how the library want to use Koha
  	unless (eval {require Net::LDAP})       {
  		if ($#missing>=0) { # only when $#missing >= 0 so this isn't fatal
--- 860,869 ----
  	unless (eval {require MARC::Record})     { push @missing,"MARC::Record" };
  	unless (eval {require Mail::Sendmail})   { push @missing,"Mail::Sendmail" };
  # The following modules are not mandatory, depends on how the library want to use Koha
+ 	unless (eval {require PDF::API2})   { 
+ 			if ($#missing>=0) { # only when $#missing >= 0 so this isn't fatal
+ 				push @missing,"You will need PDF::API2 for barcode generator" 
+ 			}
+ 	}
  	unless (eval {require Net::LDAP})       {
  		if ($#missing>=0) { # only when $#missing >= 0 so this isn't fatal
***************
*** 1952,1958 ****
  
  		startsysout();
! 		system("$mysqldir/bin/mysql '-u$user' -e \"insert into branches (branchcode,branchname,issuing) values ('$branchcode', '$branch', 1)\" '$database'");
! 		system("$mysqldir/bin/mysql '-u$user' -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'IS')\" '$database'");
! 		system("$mysqldir/bin/mysql '-u$user' -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'CU')\" '$database'");
  
  		my $printername='lp';
--- 1956,1962 ----
  
  		startsysout();
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into branches (branchcode,branchname,issuing) values ('$branchcode', '$branch', 1)\" $database");
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'IS')\" $database");
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'CU')\" $database");
  
  		my $printername='lp';
***************
*** 1973,1977 ****
  		}
  		startsysout();	
! 		system("$mysqldir/bin/mysql '-u$user' -e \"insert into printers (printername,printqueue,printtype) values ('$printername', '$printerqueue', '')\" '$database'");
  	}
  	my $language;
--- 1977,1981 ----
  		}
  		startsysout();	
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into printers (printername,printqueue,printtype) values ('$printername', '$printerqueue', '')\" $database");
  	}
  	my $language;
***************
*** 1983,1987 ****
  	}
  	startsysout();	
! 	system("$mysqldir/bin/mysql '-u$user' -e \"update systempreferences set value='$language' where variable='opaclanguages'\" '$database'");
  	my @dirs;
  	if (-d "scripts/misc/sql-datas") {
--- 1987,1991 ----
  	}
  	startsysout();	
! 	system("$mysqldir/bin/mysql -u$user -e \"update systempreferences set value='$language' where variable='opaclanguages'\" $database");
  	my @dirs;
  	if (-d "scripts/misc/sql-datas") {
***************
*** 2154,2158 ****
  
  setmysqlclipass($pass); 
! open (MD, "$mysqldir/bin/mysqldump '--user=$user' --host=$hostname '$database'|");
  
  (open BF, ">$backupdir/Koha.backup_$date") || (die "Error opening up backup file $backupdir/Koha.backup_$date: $!\n");
--- 2158,2162 ----
  
  setmysqlclipass($pass); 
! open (MD, "$mysqldir/bin/mysqldump --user=$user --host=$hostname $database|");
  
  (open BF, ">$backupdir/Koha.backup_$date") || (die "Error opening up backup file $backupdir/Koha.backup_$date: $!\n");

Index: overduenotices.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/overduenotices.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** overduenotices.pl	4 May 2005 09:02:37 -0000	1.3
--- overduenotices.pl	20 Jun 2005 14:28:12 -0000	1.4
***************
*** 74,78 ****
  # The following fields are available :
  # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
! my $mailtext = "\n\n\nDear library borrower\n\n\n       <date>\n\n       According to our records, you have <itemcount> items that are at\n       least a week overdue for return to the library or renewal.\n       If you have registered a password with the library, you may use it\n       and your library card to login at http://XXX.org\n       to check the status of your account, or you may call any of our branch\n       Please be advised that all library services will be blocked\n       if items are allowed to go more than 30 days overdue.\n\n       Thank you for using your public libraries.\n\n\n                                             <firstname> <lastname>\n                                             <address1>\n                                             <address2>\n                                             <city>  <postcode>\n\n\n\n\n\n";
  #
  # END OF PARAMETERS
--- 74,79 ----
  # The following fields are available :
  # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
! my $mailtext = "\n\n\nDear library borrower\n\n\n       <date>\n\n       According to our records, you have <itemcount> items, the description of which follows, that are at\n       least a week overdue for return to the library or renewal:\n		title		author		barcode\n<titles>\n
!        If you have registered a password with the library, you may use it\n       and your library card to login at http://XXX.org\n       to check the status of your account, or you may call any of our branch\n       Please be advised that all library services will be blocked\n       if items are allowed to go more than 30 days overdue.\n\n       Thank you for using your public libraries.\n\n\n                                             <firstname> <lastname>\n                                             <address1>\n                                             <address2>\n                                             <city>  <postcode>\n\n\n\n\n\n";
  #
  # END OF PARAMETERS
***************
*** 85,89 ****
  
  my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare ("SELECT count(*), issues.borrowernumber,firstname,surname,streetaddress,physstreet,city,zipcode,emailaddress FROM issues,borrowers,categories WHERE returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN 0 and 500 AND issues.borrowernumber=borrowers.borrowernumber and borrowers.categorycode=categories.categorycode and categories.overduenoticerequired=1 group by issues.borrowernumber");
  $sth->execute;
  # 
--- 86,92 ----
  
  my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare ("SELECT COUNT(*), issues.borrowernumber,firstname,surname,streetaddress,physstreet,city,zipcode,emailaddress FROM issues,borrowers,categories WHERE returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN 0 and 500 AND issues.borrowernumber=borrowers.borrowernumber and borrowers.categorycode=categories.categorycode and categories.overduenoticerequired=1 group by issues.borrowernumber");
! my $sth2 = $dbh->prepare("SELECT biblio.title,biblio.author,items.barcode FROM issues,items,biblio WHERE items.itemnumber=issues.itemnumber and biblio.biblionumber=items.biblionumber AND issues.borrowernumber=? AND returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN 0 and 500");
! 
  $sth->execute;
  # 
***************
*** 92,95 ****
--- 95,99 ----
  my $count = 0;   # to keep track of how many notices are printed
  my $e_count = 0;   # and e-mailed
+ my $date=localtime;
  my ($itemcount,$borrnum,$firstname,$lastname,$address1,$address2,$city,$postcode,$email);
  
***************
*** 103,107 ****
  		$notice =~ s/\<city\>/$city/g;
  		$notice =~ s/\<postcode\>/$postcode/g;
! 	
  	# if not using e-mail notices, comment out the following lines
  		if ($email) {   # or you might check for borrowers.preferredcont 
--- 107,120 ----
  		$notice =~ s/\<city\>/$city/g;
  		$notice =~ s/\<postcode\>/$postcode/g;
! 		$notice =~ s/\<date\>/$date/g;
! 
! 		$sth2->execute($borrnum);
! 		my $titles="";
! 		my ($title, $author, $barcode);
! 		while (($title, $author, $barcode) = $sth2->fetchrow){
! 			$titles .= "		".($title?$title:"")."	".($author?$author:"")."	".($barcode?$barcode:"")."\n";
! 		}
! 		$notice =~ s/\<titles\>/$titles/g;
! 		$sth2->finish;
  	# if not using e-mail notices, comment out the following lines
  		if ($email) {   # or you might check for borrowers.preferredcont 
***************
*** 136,140 ****
  		$notice .= <ODUES>;
  		if ($nomail) {
! 			print "TO => $email\n";
  			print "FROM => $from\n";
  			print "SUBJECT => Koha overdue\n";
--- 149,153 ----
  		$notice .= <ODUES>;
  		if ($nomail) {
! 			print "TO => $email\n" if $email;
  			print "FROM => $from\n";
  			print "SUBJECT => Koha overdue\n";





More information about the Koha-cvs mailing list