[Koha-cvs] CVS: koha/opac opac-main.pl,1.1.2.3,1.1.2.4 opac-search.pl,1.1.2.6,1.1.2.7 opac-searchresults.pl,1.1.2.6,1.1.2.7 opac-user.pl,1.1.2.7,1.1.2.8

Finlay Thompson finlayt at users.sourceforge.net
Thu Nov 14 23:14:54 CET 2002


Update of /cvsroot/koha/koha/opac
In directory usw-pr-cvs1:/tmp/cvs-serv4711

Modified Files:
      Tag: rel-1-2
	opac-main.pl opac-search.pl opac-searchresults.pl opac-user.pl 
Log Message:

incorperated the new get_template_and_user sub that handles authentificationa and the getting of templates


Index: opac-main.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-main.pl,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** opac-main.pl	14 Oct 2002 22:47:55 -0000	1.1.2.3
--- opac-main.pl	14 Nov 2002 22:14:52 -0000	1.1.2.4
***************
*** 4,21 ****
  use CGI;
  
! use C4::Output;       # gettemplate
! use C4::Auth;         # checkauth
  
  my $query = new CGI;
  
! my $flagsrequired;
! $flagsrequired->{borrow}=1;
  
! my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1, $flagsrequired);
! 
! 
! my $template = gettemplate("opac-main.tmpl", "opac");
! 
! $template->param(loggedinuser => $loggedinuser);
! 
! print "Content-Type: text/html\n\n", $template->output;
--- 4,18 ----
  use CGI;
  
! use C4::Auth;       # get_template_and_user
  
  my $query = new CGI;
  
! my ($template, $borrowernumber, $cookie) 
!     = get_template_and_user({template_name => "opac-main.tmpl",
! 			     query => $query,
! 			     type => "opac",
! 			     authnotrequired => 1,
! 			     flagsrequired => {borrow => 1},
! 			 });
  
! print $query->header(-cookie => $cookie), $template->output;

Index: opac-search.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-search.pl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -r1.1.2.6 -r1.1.2.7
*** opac-search.pl	5 Nov 2002 19:54:43 -0000	1.1.2.6
--- opac-search.pl	14 Nov 2002 22:14:52 -0000	1.1.2.7
***************
*** 3,12 ****
  require Exporter;
  
- use C4::Output;
- use CGI;
  use C4::Auth;
  use C4::Context;
  
  my $classlist='';
  my $dbh=C4::Context->dbh();
  my $sth=$dbh->prepare("select groupname,itemtypes from itemtypesearchgroups order by groupname");
--- 3,12 ----
  require Exporter;
  
  use C4::Auth;
+ use CGI;
  use C4::Context;
  
  my $classlist='';
+ 
  my $dbh=C4::Context->dbh();
  my $sth=$dbh->prepare("select groupname,itemtypes from itemtypesearchgroups order by groupname");
***************
*** 19,31 ****
  my $query = new CGI;
  
! my $flagsrequired;
! $flagsrequired->{borrow}=1;
! 
! my ($loggedinuser, $cookie, $sessionID) = checkauth($query ,1, $flagsrequired);
  
- my $template = gettemplate("opac-search.tmpl", "opac");
  
! $template->param(loggedinuser => $loggedinuser,
! 		classlist => $classlist);
  
! print "Content-Type: text/html\n\n", $template->output;
--- 19,32 ----
  my $query = new CGI;
  
! my ($template, $borrowernumber, $cookie) 
!     = get_template_and_user({template_name => "opac-search.tmpl",
! 			     query => $query,
! 			     type => "opac",
! 			     authnotrequired => 1,
! 			     flagsrequired => {borrow => 1},
! 			 });
  
  
! $template->param(classlist => $classlist);
  
! print $query->header(-cookie => $cookie), $template->output;

Index: opac-searchresults.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-searchresults.pl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -r1.1.2.6 -r1.1.2.7
*** opac-searchresults.pl	28 Oct 2002 19:56:09 -0000	1.1.2.6
--- opac-searchresults.pl	14 Nov 2002 22:14:52 -0000	1.1.2.7
***************
*** 5,20 ****
  use C4::Search;
  use C4::Auth;
- use C4::Output; # now contains gettemplate
  
  my $query=new CGI;
  
! my $flagsrequired;
! $flagsrequired->{borrow}=1;
! 
! my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1, $flagsrequired);
! 
! 
! my $template = gettemplate ("opac-searchresults.tmpl", "opac");
! 
  
  
--- 5,18 ----
  use C4::Search;
  use C4::Auth;
  
  my $query=new CGI;
  
! my ($template, $borrowernumber, $cookie) 
!     = get_template_and_user({template_name => "opac-searchresults.tmpl",
! 			     query => $query,
! 			     type => "opac",
! 			     authnotrequired => 1,
! 			     flagsrequired => {borrow => 1},
! 			 });
  
  
***************
*** 22,25 ****
--- 20,24 ----
  
  
+ 
  if ($subject) {
      $template->param(subjectsearch => $subject);
***************
*** 34,41 ****
--- 33,44 ----
  # collect all the fields ...
  my %search;
+ 
  my $forminputs;
  my $searchdesc = '';
  foreach my $field (@fields) {
      $search{$field} = $query->param($field);
+     if ($field eq 'keyword'){
+ 	$search{$field} = $query->param('words') unless $search{$field};
+     }
      if ($search{$field}) {
  	push @$forminputs, {field => $field, value => $search{$field}};
***************
*** 43,46 ****
--- 46,50 ----
      }
  }
+ 
  $search{'ttype'} = $query->param('ttype');
  push @$forminputs, {field => 'ttype', value => $search{'ttype'}};
***************
*** 69,72 ****
--- 73,77 ----
  }
  
+ my $num = 1;
  foreach my $res (@results) {
      my @items = ItemInfo(undef, $res->{'biblionumber'}, "intra");
***************
*** 76,79 ****
--- 81,88 ----
      }
      $res->{'norequests'} = $norequests;
+     # set up the even odd elements....
+     $res->{'even'} = 1 if $num % 2 == 0;
+     $res->{'odd'} = 1 if $num % 2 == 1;
+     $num++;
  }
  
***************
*** 103,107 ****
  $template->param(searchdesc => $searchdesc);
  $template->param(SEARCH_RESULTS => $resultsarray);
- $template->param(loggedinuser => $loggedinuser);
  
  my $numbers;
--- 112,115 ----
***************
*** 117,122 ****
  
  $template->param(numbers => $numbers);
- 
- $template->param(loggedinuser => $loggedinuser);
  
  print $query->header(-cookie => $cookie), $template->output;
--- 125,128 ----

Index: opac-user.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-user.pl,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -r1.1.2.7 -r1.1.2.8
*** opac-user.pl	28 Oct 2002 19:56:10 -0000	1.1.2.7
--- opac-user.pl	14 Nov 2002 22:14:52 -0000	1.1.2.8
***************
*** 4,9 ****
  use CGI;
  
! use C4::Output;       # gettemplate
! use C4::Auth;         # checkauth, getborrowernumber.
  use C4::Koha;
  use C4::Circulation::Circ2;
--- 4,8 ----
  use CGI;
  
! use C4::Auth;
  use C4::Koha;
  use C4::Circulation::Circ2;
***************
*** 11,24 ****
  
  my $query = new CGI;
! 
! my $flagsrequired;
! $flagsrequired->{borrow}=1;
! 
! my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired);
! 
! my $template = gettemplate("opac-user.tmpl", "opac");
  
  # get borrower information ....
- my $borrowernumber = getborrowernumber($loggedinuser);
  my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
  
--- 10,22 ----
  
  my $query = new CGI;
! my ($template, $borrowernumber, $cookie) 
!     = get_template_and_user({template_name => "opac-user.tmpl",
! 			     query => $query,
! 			     type => "opac",
! 			     authnotrequired => 0,
! 			     flagsrequired => {borrow => 1},
! 			     });
  
  # get borrower information ....
  my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
  
***************
*** 96,99 ****
  $template->param(waiting_count => $wcount);
  
! $template->param(loggedinuser => $loggedinuser);
! print "Content-Type: text/html\n\n", $template->output;
--- 94,97 ----
  $template->param(waiting_count => $wcount);
  
! print $query->header(-cookie => $cookie), $template->output;
! 





More information about the Koha-cvs mailing list