[Koha-cvs] CVS: koha/C4 Biblio.pm,1.115.2.22,1.115.2.23 Koha.pm,1.22,1.22.2.1 SearchMarc.pm,1.36.2.15,1.36.2.16 Search.pm,1.99.2.8,1.99.2.9

Henri-Damien LAURENT hdl at users.sourceforge.net
Wed Sep 28 16:35:59 CEST 2005


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

Modified Files:
      Tag: rel_2_2
	Biblio.pm Koha.pm SearchMarc.pm Search.pm 
Log Message:
ordering search results by branch.
Adding independant Branch Management to getBranches in Koha.pm

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.22
retrieving revision 1.115.2.23
diff -C2 -r1.115.2.22 -r1.115.2.23
*** Biblio.pm	14 Sep 2005 10:05:12 -0000	1.115.2.22
--- Biblio.pm	28 Sep 2005 14:35:56 -0000	1.115.2.23
***************
*** 1114,1118 ****
  	if ($temp){
  		$temp =~ m/c(\d\d\d\d)/; # search cYYYY first
! 		if ($1>0) {
  			$result->{'publicationyear'} = $1;
  		} else { # if no cYYYY, get the 1st date.
--- 1114,1118 ----
  	if ($temp){
  		$temp =~ m/c(\d\d\d\d)/; # search cYYYY first
! 		if ($1) {
  			$result->{'publicationyear'} = $1;
  		} else { # if no cYYYY, get the 1st date.
***************
*** 2755,2758 ****
--- 2755,2762 ----
  # $Id$
  # $Log$
+ # Revision 1.115.2.23  2005/09/28 14:35:56  hdl
+ # ordering search results by branch.
+ # Adding independant Branch Management to getBranches in Koha.pm
+ #
  # Revision 1.115.2.22  2005/09/14 10:05:12  tipaul
  # 2 bugfixes :

Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -C2 -r1.22 -r1.22.2.1
*** Koha.pm	16 Aug 2004 12:49:42 -0000	1.22
--- Koha.pm	28 Sep 2005 14:35:57 -0000	1.22.2.1
***************
*** 203,207 ****
  	my %branches;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select * from branches order by branchname");
  	$sth->execute;
  	while (my $branch=$sth->fetchrow_hashref) {
--- 203,215 ----
  	my %branches;
  	my $dbh = C4::Context->dbh;
! 	my $sth;
! 	if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv) && (C4::Context->userenv->{flags} != 1)){
! 		my $strsth ="Select * from branches ";
! 		$strsth.= " WHERE branchcode = ".$dbh->quote(C4::Context->userenv->{branch});
! 		$strsth.= " order by branchname";
! 		$sth=$dbh->prepare($strsth);
! 	} else {
!     	$sth = $dbh->prepare("Select * from branches order by branchname");
! 	}
  	$sth->execute;
  	while (my $branch=$sth->fetchrow_hashref) {

Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/SearchMarc.pm,v
retrieving revision 1.36.2.15
retrieving revision 1.36.2.16
diff -C2 -r1.36.2.15 -r1.36.2.16
*** SearchMarc.pm	23 Sep 2005 09:45:09 -0000	1.36.2.15
--- SearchMarc.pm	28 Sep 2005 14:35:57 -0000	1.36.2.16
***************
*** 356,362 ****
  	my $sth_itemCN;
  	if (C4::Context->preference('hidelostitem')) {
! 		$sth_itemCN = $dbh->prepare("select items.* from items where biblionumber=? and (itemlost = 0 or itemlost is NULL)");
  	} else {
! 		$sth_itemCN = $dbh->prepare("select items.* from items where biblionumber=?");
  	}
  	my $sth_issue = $dbh->prepare("select date_due,returndate from issues where itemnumber=?");
--- 356,362 ----
  	my $sth_itemCN;
  	if (C4::Context->preference('hidelostitem')) {
! 		$sth_itemCN = $dbh->prepare("select items.* from items where biblionumber=? and (itemlost = 0 or itemlost is NULL) order by homebranch");
  	} else {
! 		$sth_itemCN = $dbh->prepare("select items.* from items where biblionumber=? order by homebranch");
  	}
  	my $sth_issue = $dbh->prepare("select date_due,returndate from issues where itemnumber=?");

Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.99.2.8
retrieving revision 1.99.2.9
diff -C2 -r1.99.2.8 -r1.99.2.9
*** Search.pm	5 Sep 2005 16:17:37 -0000	1.99.2.8
--- Search.pm	28 Sep 2005 14:35:57 -0000	1.99.2.9
***************
*** 1312,1316 ****
  # 		and (wthdrawn <> 1 or wthdrawn is NULL)";
  # 	}
! 	$query .= " order by items.dateaccessioned desc";
  	my $sth=$dbh->prepare($query);
  	$sth->execute($biblionumber);
--- 1312,1316 ----
  # 		and (wthdrawn <> 1 or wthdrawn is NULL)";
  # 	}
! 	$query .= " order by items.homebranch, items.dateaccessioned desc";
  	my $sth=$dbh->prepare($query);
  	$sth->execute($biblionumber);





More information about the Koha-cvs mailing list