From 6007e1e067e49a51ee2f7ab2963292ca295c7e53 Mon Sep 17 00:00:00 2001 From: finlayt Date: Thu, 3 Oct 2002 08:51:29 +0000 Subject: [PATCH] added these files from the rel-1-2 branch. This is the beging of the new opac --- opac/opac-detail.pl | 64 ++++++++++++ opac/opac-logout.pl | 84 ++++++++++++++++ opac/opac-main.pl | 17 ++++ opac/opac-moredetail.pl | 199 +++++++++++++++++++++++++++++++++++++ opac/opac-reserve.pl | 110 ++++++++++++++++++++ opac/opac-search.pl | 16 +++ opac/opac-searchresults.pl | 121 ++++++++++++++++++++++ opac/opac-user.pl | 89 +++++++++++++++++ opac/opac-userupdate.pl | 70 +++++++++++++ 9 files changed, 770 insertions(+) create mode 100755 opac/opac-detail.pl create mode 100755 opac/opac-logout.pl create mode 100755 opac/opac-main.pl create mode 100755 opac/opac-moredetail.pl create mode 100755 opac/opac-reserve.pl create mode 100755 opac/opac-search.pl create mode 100755 opac/opac-searchresults.pl create mode 100755 opac/opac-user.pl create mode 100755 opac/opac-userupdate.pl diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl new file mode 100755 index 0000000000..3e48936e54 --- /dev/null +++ b/opac/opac-detail.pl @@ -0,0 +1,64 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use C4::Output; # contains picktemplate +use CGI; +use C4::Search; +use C4::Auth; + +my $query=new CGI; + +my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1); + +my $template = gettemplate ("opac-detail.tmpl", "opac"); + +$template->param(loggedinuser => $loggedinuser); + +my $biblionumber=$query->param('bib'); + + +# change back when ive fixed request.pl +my @items = &ItemInfo(undef, $biblionumber, 'opac'); +my $dat = &bibdata($biblionumber); +my ($authorcount, $addauthor) = &addauthor($biblionumber); +my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber); +my ($websitecount, @websites) = &getwebsites($biblionumber); + +$dat->{'count'}=@items; + +$dat->{'additional'}=$addauthor->[0]->{'author'}; +for (my $i = 1; $i < $authorcount; $i++) { + $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'}; +} # for + +my @results; + +$results[0]=$dat; + +my $resultsarray=\@results; +my $itemsarray=\@items; +my $webarray=\@webbiblioitems; +my $sitearray=\@websites; + + +my $startfrom=$query->param('startfrom'); +($startfrom) || ($startfrom=0); + +my $count=1; + +# now to get the items into a hash we can use and whack that thru +$template->param(startfrom => $startfrom+1); +$template->param(endat => $startfrom+20); +$template->param(numrecords => $count); +my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20); +my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0); +$template->param(nextstartfrom => $nextstartfrom); +$template->param(prevstartfrom => $prevstartfrom); + +$template->param(BIBLIO_RESULTS => $resultsarray); +$template->param(ITEM_RESULTS => $itemsarray); +$template->param(WEB_RESULTS => $webarray); +$template->param(SITE_RESULTS => $sitearray); + +print "Content-Type: text/html\n\n", $template->output; + diff --git a/opac/opac-logout.pl b/opac/opac-logout.pl new file mode 100755 index 0000000000..969e77d832 --- /dev/null +++ b/opac/opac-logout.pl @@ -0,0 +1,84 @@ +#!/usr/bin/perl + +use CGI; +use C4::Database; +use C4::Output; + +my $query=new CGI; + +my $sessionID=$query->cookie('sessionID'); + + +if ($ENV{'REMOTE_USER'}) { + print $query->header(); + print startpage(); + print startmenu('catalogue'); + print qq| +

Logout Feature Not Available

+Your Koha server is configured to use a type of authentication called "Basic +Authentication" instead of using a cookies-based authentication system. With +Basic Authentication, the only way to logout of Koha is by exiting your +browser. +|; + print endmenu('catalogue'); + print endpage(); + exit; +} + +my $sessions; +open (S, "/tmp/sessions"); +while (my ($sid, $u, $lasttime) = split(/:/, )) { + chomp $lasttime; + (next) unless ($sid); + (next) if ($sid eq $sessionID); + $sessions->{$sid}->{'userid'}=$u; + $sessions->{$sid}->{'lasttime'}=$lasttime; +} +open (S, ">/tmp/sessions"); +foreach (keys %$sessions) { + my $userid=$sessions->{$_}->{'userid'}; + my $lasttime=$sessions->{$_}->{'lasttime'}; + print S "$_:$userid:$lasttime\n"; +} + +my $dbh=C4Connect; + +# Check that this is the ip that created the session before deleting it + +my $sth=$dbh->prepare("select userid,ip from sessions where sessionID=?"); +$sth->execute($sessionID); +my ($userid, $ip); +if ($sth->rows) { + ($userid,$ip) = $sth->fetchrow; + if ($ip ne $ENV{'REMOTE_ADDR'}) { + # attempt to logout from a different ip than cookie was created at + exit; + } +} + +$sth=$dbh->prepare("delete from sessions where sessionID=?"); +$sth->execute($sessionID); +open L, ">>/tmp/sessionlog"; +my $time=localtime(time()); +printf L "%20s from %16s logged out at %30s (manual log out).\n", $userid, $ip, $time; +close L; + +my $cookie=$query->cookie(-name => 'sessionID', + -value => '', + -expires => '+1y'); + +# Should redirect to opac home page after logging out + +print $query->redirect("/cgi-bin/koha/opac-main.pl"); + +exit; +if ($sessionID) { + print "Logged out of $sessionID
\n"; + print "Login"; +} else { + print "Not logged in.
\n"; + print "Login"; +} + + + diff --git a/opac/opac-main.pl b/opac/opac-main.pl new file mode 100755 index 0000000000..1c615a7910 --- /dev/null +++ b/opac/opac-main.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use CGI; + +use C4::Output; # gettemplate +use C4::Auth; # checkauth + +my $query = new CGI; + +my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1); + +my $template = gettemplate("opac-main.tmpl", "opac"); + +$template->param(loggedinuser => $loggedinuser); + +print "Content-Type: text/html\n\n", $template->output; diff --git a/opac/opac-moredetail.pl b/opac/opac-moredetail.pl new file mode 100755 index 0000000000..49b6b57c3f --- /dev/null +++ b/opac/opac-moredetail.pl @@ -0,0 +1,199 @@ +#!/usr/bin/perl + +#script to display detailed information +#written 8/11/99 + +use strict; +#use DBI; +use C4::Search; +use C4::Koha; +use C4::Output; +use C4::Acquisitions; +use C4::Biblio; + +use CGI; +my $input = new CGI; +print $input->header; +#whether it is called from the opac of the intranet +my $type=$input->param('type'); +#setup colours +my $main; +my $secondary; +if ($type eq 'opac'){ + $main='#99cccc'; + $secondary='#efe5ef'; +} else { + $main='#cccc99'; + $secondary='#ffffcc'; +} +print startpage(); +print startmenu($type); +my $blah; + +my $bib=$input->param('bib'); +my $title=$input->param('title'); +my $bi=$input->param('bi'); +my $data=bibitemdata($bi); + +my (@items)=itemissues($bi); +my ($order,$ordernum)=getorder($bi,$bib); +#print @items; +my $count=@items; + +my $i=0; +print center(); + +my $dewey = $data->{'dewey'}; +$dewey =~ s/0+$//; +if ($dewey eq "000.") { $dewey = "";}; +if ($dewey < 10){$dewey='00'.$dewey;} +if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;} +if ($dewey <= 0){ + $dewey=''; +} +$dewey=~ s/\.$//; +print < + +printend +; +if ($type eq 'catmain'){ + print "Catalogue Maintenance
"; +} +print <$data->{'title'} ($data->{'author'})

+

+

+ + + + + + + + + + +
$data->{'biblioitemnumber'} GROUP - $data->{'description'}
+ + +
+ +Biblionumber: $bib
+Item Type: $data->{'itemtype'}
+Loan Length: $data->{'loanlength'}
+Rental Charge: $data->{'rentalcharge'}
+Classification: $data->{'classification'}$dewey$data->{'subclass'}
+ISBN: $data->{'isbn'}
+Publisher: $data->{'publishercode'}
+Place: $data->{'place'}
+Date: $data->{'publicationyear'}
+Volume: $data->{'volumeddesc'}
+Pages: $data->{'pages'}
+Illus: $data->{'illus'}
+Size: $data->{'size'}
+Notes: $data->{'bnotes'}
+No. of Items: $count + +printend +; +if ($type eq 'catmain'){ + print "
{'biblioitemnumber'}&bib=$data->{'biblionumber'}>Shift to another biblio"; + +} +print < +
+
+printend +; + +for (my $i=0;$i<$count;$i++){ +print < + + + + + + + +
BARCODE $items[$i]->{'barcode'}
+
+ +{'itemnumber'}> + + + +
+printend +; +$items[$i]->{'itemlost'}=~ s/0/No/; +$items[$i]->{'itemlost'}=~ s/1/Yes/; +$items[$i]->{'withdrawn'}=~ s/0/No/; +$items[$i]->{'withdrawn'}=~ s/1/Yes/; +$items[$i]->{'replacementprice'}+=0.00; + +my $year=substr($items[$i]->{'timestamp0'},0,4); +my $mon=substr($items[$i]->{'timestamp0'},4,2); +my $day=substr($items[$i]->{'timestamp0'},6,2); +$items[$i]->{'timestamp0'}="$day/$mon/$year"; + +$items[$i]->{'dateaccessioned'} = slashifyDate($items[$i]->{'dateaccessioned'}); +$items[$i]->{'datelastseen'} = slashifyDate($items[$i]->{'datelastseen'}); + +print < +Home Branch: $items[$i]->{'homebranch'}
+Last seen: $items[$i]->{'datelastseen'}
+Last borrowed: $items[$i]->{'timestamp0'}
+printend +; +if ($items[$i] eq 'Available'){ + print "Currently on issue to:
"; +} else { + print "Currently on issue to: {'borrower0'}>$items[$i]->{'card'}
"; +} +print <Last Borrower 1: $items[$i]->{'card0'}
+Last Borrower 2: $items[$i]->{'card1'}
+Current Branch: $items[$i]->{'holdingbranch'}
+Replacement Price: $items[$i]->{'replacementprice'}
+Item lost: $items[$i]->{'itemlost'}
+Paid for: $items[$i]->{'paidfor'}
+Notes: $items[$i]->{'itemnotes'}
+Renewals: $items[$i]->{'renewals'}
+{'booksellerinvoicenumber'}&catview=yes>Accession Date: $items[$i]->{'dateaccessioned'}
+printend +; +if ($items[$i]->{'wthdrawn'} eq '1'){ + $items[$i]->{'wthdrawn'}="Yes"; +} else { + $items[$i]->{'wthdrawn'}="No"; +} +print <Cancelled: $items[$i]->{'wthdrawn'}
+Total Issues: $items[$i]->{'issues'}
+Group Number: $bi
+Biblio number: $bib
+ + + + +
+ +printend +; +} +print < + +printend +; + + +print endcenter(); + +print endmenu($type); +print endpage(); diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl new file mode 100755 index 0000000000..86f5ab8268 --- /dev/null +++ b/opac/opac-reserve.pl @@ -0,0 +1,110 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use CGI; + +use C4::Search; +use C4::Output; # gettemplate +use C4::Auth; # checkauth, getborrowernumber. +use C4::Koha; +use C4::Circulation::Circ2; +use C4::Reserves2; + +my $query = new CGI; + + +my ($loggedinuser, $cookie, $sessionID) = checkauth($query); + +my $template = gettemplate("opac-reserve.tmpl", "opac"); + +# get borrower information .... +my $borrowernumber = getborrowernumber($loggedinuser); +my ($borr, $flags) = getpatroninformation(undef, $borrowernumber); +my @bordat; +$bordat[0] = $borr; +$template->param(BORROWER_INFO => \@bordat); + +# get biblionumber..... +my $biblionumber = $query->param('bib'); +$template->param(biblionumber => $biblionumber); + +my $bibdata = bibdata($biblionumber); +$template->param($bibdata); + +# get the rank number.... +my ($rank,$reserves) = FindReserves($biblionumber); +foreach my $res (@$reserves) { + if ($res->{'found'} eq 'W') { + $rank--; + } +} +$rank++; +$template->param(rank => $rank); + + + +# pass the pickup branch along.... +my $branch = $query->param('branch'); +$template->param(branch => $branch); + +my $branches = getbranches(); +$template->param(branchname => $branches->{$branch}->{'branchname'}); + + +# make branch selection options... +my $branchoptions = ''; +foreach my $br (keys %$branches) { + (next) unless $branches->{$br}->{'IS'}; + my $selected = ""; + if ($br eq $branch) { + $selected = "selected"; + } + $branchoptions .= "\n"; +} +$template->param( branchoptions => $branchoptions); + + +#get the bibitem data.... +my ($count,@data) = bibitems($biblionumber); + +foreach my $bibitem (@data) { + my @barcodes = barcodes($bibitem->{'biblioitemnumber'}); + my $barcodestext = ""; + foreach my $num (@barcodes) { + my $message = $num->{'itemlost'} == 1 ? "(lost)" : + $num->{'itemlost'} == 2 ? "(long overdue)" : "($branches->{$num->{'holdingbranch'}}->{'branchname'})"; + $barcodestext .= "$num->{'barcode'} $message
"; + } + $barcodestext = substr($barcodestext, 0, -4); + $bibitem->{'copies'} = $barcodestext; +} + + + +my @reqbibs = $query->param('reqbib'); +if ($query->param('bibitemsselected')) { + $template->param(bibitemsselected => 1); + my @tempdata; + foreach my $bibitem (@data) { + foreach my $reqbib (@reqbibs){ + push @tempdata, $bibitem if ($bibitem->{'biblioitemnumber'} == $reqbib) ; + } + } + @data = @tempdata; +} elsif ($query->param('placereserve')) { +# here we actually do the reserveration.... + my $title = $bibdata->{'title'}; + CreateReserve(undef,$branch,$borrowernumber,$biblionumber,'o',\@reqbibs,$rank,'',$title); + warn "reserve created\n"; + print $query->redirect("/cgi-bin/koha/opac-user.pl"); +} else { + $template->param(selectbibitems => 1); +} +# check that you can actually make the reserve. + + + +$template->param(BIBLIOITEMS => \@data); + +$template->param(loggedinuser => $loggedinuser); +print "Content-Type: text/html\n\n", $template->output; diff --git a/opac/opac-search.pl b/opac/opac-search.pl new file mode 100755 index 0000000000..cf6c7a35b3 --- /dev/null +++ b/opac/opac-search.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl +use strict; +require Exporter; + +use C4::Output; +use CGI; +use C4::Auth; + +my $query = new CGI; +my ($loggedinuser, $cookie, $sessionID) = checkauth($query ,1); + +my $template = gettemplate("opac-search.tmpl", "opac"); + +$template->param(loggedinuser => $loggedinuser); + +print "Content-Type: text/html\n\n", $template->output; diff --git a/opac/opac-searchresults.pl b/opac/opac-searchresults.pl new file mode 100755 index 0000000000..8e8623292b --- /dev/null +++ b/opac/opac-searchresults.pl @@ -0,0 +1,121 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use CGI; +use C4::Search; +use C4::Auth; +use C4::Output; # now contains picktemplate + +my $query=new CGI; + +my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1); + + +my $template = gettemplate ("opac-searchresults.tmpl", "opac"); + + + +my $subject=$query->param('subject'); + + +if ($subject) { + $template->param(subjectsearch => $subject); +} + +# get all the search variables +# we assume that C4::Search will validate these values for us +my @fields = ('keyword', 'subject', 'author', 'illustrator', 'itemnumber', 'isbn', 'date-before', 'date-after', 'class', 'dewey', 'branch', 'title', 'abstract', 'publisher'); + + + +# collect all the fields ... +my %search; +my $forminputs; +my $searchdesc = ''; +foreach my $field (@fields) { + $search{$field} = $query->param($field); + if ($search{$field}) { + push @$forminputs, {field => $field, value => $search{$field}}; + $searchdesc .= "$field = $search{$field}, "; + } +} +$search{'ttype'} = $query->param('ttype'); +push @$forminputs, {field => 'ttype', value => $search{'ttype'}}; + +if (my $subjectitems=$query->param('subjectitems')){ + $search{'subject'} = $subjectitems; + $searchdesc.="subject = $subjectitems, "; +} + +@$forminputs=() unless $forminputs; +$template->param(FORMINPUTS => $forminputs); + +# do the searchs .... +my $env; +$env->{itemcount}=1; +my $num=10; +my @results; +my $count; +my $startfrom = $query->param('startfrom'); +my $subjectitems=$query->param('subjectitems'); +if ($subjectitems) { + my $blah; + @results = subsearch(\$blah,$subjectitems, $num, $startfrom); + $count = $#results+1; +} else { + ($count, @results) = catalogsearch($env,'',\%search,$num,$startfrom); +} + +foreach my $res (@results) { + my @items = ItemInfo(undef, $res->{'biblionumber'}, "intra"); + my $norequests = 1; + foreach my $itm (@items) { + $norequests = 0 unless $itm->{'notforloan'}; + } + $res->{'norequests'} = $norequests; +} + + +my $startfrom=$query->param('startfrom'); +($startfrom) || ($startfrom=0); + +my $resultsarray=\@results; +($resultsarray) || (@$resultsarray=()); + + +# sorting out which results to display. +$template->param(startfrom => $startfrom+1); +($startfrom+$num<=$count) ? ($template->param(endat => $startfrom+$num)) : ($template->param(endat => $count)); +$template->param(numrecords => $count); +my $nextstartfrom=($startfrom+$num<$count) ? ($startfrom+$num) : (-1); +my $prevstartfrom=($startfrom-$num>=0) ? ($startfrom-$num) : (-1); +$template->param(nextstartfrom => $nextstartfrom); +my $displaynext=1; +my $displayprev=0; +($nextstartfrom==-1) ? ($displaynext=0) : ($displaynext=1); +($prevstartfrom==-1) ? ($displayprev=0) : ($displayprev=1); +$template->param(displaynext => $displaynext); +$template->param(displayprev => $displayprev); +$template->param(prevstartfrom => $prevstartfrom); + +$template->param(searchdesc => $searchdesc); +$template->param(SEARCH_RESULTS => $resultsarray); +$template->param(loggedinuser => $loggedinuser); + +my $numbers; +@$numbers = (); +if ($count>10) { + for (my $i=1; $i<$count/10+1; $i++) { + my $highlight=0; + my $themelang = $template->param('themelang'); + ($startfrom==($i-1)*10) && ($highlight=1); + push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*10 }; + } +} + +$template->param(numbers => $numbers); + +$template->param(loggedinuser => $loggedinuser); + +print $query->header(-cookie => $cookie), $template->output; + diff --git a/opac/opac-user.pl b/opac/opac-user.pl new file mode 100755 index 0000000000..29503f948c --- /dev/null +++ b/opac/opac-user.pl @@ -0,0 +1,89 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use CGI; + +use C4::Search; # borrdata +use C4::Output; # gettemplate +use C4::Auth; # checkauth, getborrowernumber. +use C4::Koha; +use C4::Circulation::Circ2; +use C4::Reserves2; + +my $query = new CGI; + +my ($loggedinuser, $cookie, $sessionID) = checkauth($query); + +my $template = gettemplate("opac-user.tmpl", "opac"); + +# get borrower information .... +my $borrowernumber = getborrowernumber($loggedinuser); +my ($borr, $flags) = getpatroninformation(undef, $borrowernumber); + +$borr->{'dateenrolled'} = slashifyDate($borr->{'dateenrolled'}); +$borr->{'expiry'} = slashifyDate($borr->{'expiry'}); +$borr->{'dateofbirth'} = slashifyDate($borr->{'dateofbirth'}); +$borr->{'ethnicity'} = fixEthnicity($borr->{'ethnicity'}); + +if ($borr->{'amountoutstanding'} > 5) { + $borr->{'amountoverfive'} = 1; +} else { + $borr->{'amountoverfive'} = 0; +} + +$borr->{'amountoutstanding'} = sprintf "\$%.02f", $borr->{'amountoutstanding'}; + +my @bordat; +$bordat[0] = $borr; + +$template->param(BORROWER_INFO => \@bordat); + +#get issued items .... +my $issues = getissues($borr); + +my $count=0; +my @issuedat; +foreach my $key (keys %$issues) { + my $issue = $issues->{$key}; + $issue->{'date_due'} = slashifyDate($issue->{'date_due'}); + if ($issue->{'overdue'}) { + $issue->{'status'} = "OVERDUE"; + } else { + $issue->{'status'} = "Issued"; + } +# check for reserves + my ($restype, $res) = CheckReserves($issue->{'itemnumber'}); + if ($restype) { + $issue->{'status'} .= "Reserved"; + } + my ($charges, $itemtype) = calc_charges(undef, undef, $issue->{'itemnumber'}, $borrowernumber); + $issue->{'charges'} = $charges; + push @issuedat, $issue; + $count++; +} + +$template->param(ISSUES => \@issuedat); +$template->param(issues_count => $count); + +# now the reserved items.... +my ($rcount, $reserves) = FindReserves(undef, $borrowernumber); + +$template->param(RESERVES => $reserves); +$template->param(reserves_count => $rcount); + +my $branches = getbranches(); +my @waiting; +my $wcount = 0; +foreach my $res (@$reserves) { + if ($res->{'itemnumber'}) { + $res->{'branch'} = $branches->{$res->{'branchcode'}}->{'branchname'}; + push @waiting, $res; + $wcount++; + } +} + +$template->param(WAITING => \@waiting); +$template->param(waiting_count => $wcount); + +$template->param(loggedinuser => $loggedinuser); +print "Content-Type: text/html\n\n", $template->output; diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl new file mode 100755 index 0000000000..87b9c4905d --- /dev/null +++ b/opac/opac-userupdate.pl @@ -0,0 +1,70 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use CGI; +use Mail::Sendmail; + +use C4::Output; # gettemplate +use C4::Auth; # checkauth, getborrowernumber. +use C4::Koha; +use C4::Circulation::Circ2; + + +my $query = new CGI; + +my ($loggedinuser, $cookie, $sessionID) = checkauth($query); + +# get borrower information .... +my $borrowernumber = getborrowernumber($loggedinuser); +my ($borr, $flags) = getpatroninformation(undef, $borrowernumber); + + +# handle the new information.... +# collect the form values and send an email. +my @fields = ('title', 'surname', 'firstname', 'phone', 'faxnumber', 'streetaddress', 'emailaddress', 'city'); +my $update; +my $updateemailaddress = "finlay\@katipo.co.nz"; #Will have to change this! !!!!!!!!!!!!!!!!!!! +if ($query->{'title'}) { + # get all the fields: + my $message = <<"EOF"; +Borrower $borr->{'cardnumber'} http://intradev.katipo.co.nz/cgi-bin/koha/moremember.pl?bornum=$borrowernumber + +has requested to change their personal details. Please check these new details and make the changes: +EOF + foreach my $field (@fields){ + my $newfield = $query->param($field); + $message .= "$field : $borr->{$field} --> $newfield\n"; + } + $message .= "\n\nThanks,\nKoha\n\n"; + my %mail = ( To => $updateemailaddress , + From => $updateemailaddress , + Subject => "User Request for update of Record.", + Message => $message ); + if (sendmail %mail) { +# do something if it works.... + warn "Mail sent ok\n"; + print $query->redirect('/cgi-bin/koha/opac-user.pl'); + } else { +# do something if it doesnt work.... + warn "Error sending mail: $Mail::Sendmail::error \n"; + } +} + +my $template = gettemplate("opac-userupdate.tmpl", "opac"); + + +$borr->{'dateenrolled'} = slashifyDate($borr->{'dateenrolled'}); +$borr->{'expiry'} = slashifyDate($borr->{'expiry'}); +$borr->{'dateofbirth'} = slashifyDate($borr->{'dateofbirth'}); +$borr->{'ethnicity'} = fixEthnicity($borr->{'ethnicity'}); + + +my @bordat; +$bordat[0] = $borr; + +$template->param(BORROWER_INFO => \@bordat); + + +$template->param(loggedinuser => $loggedinuser); + +print "Content-Type: text/html\n\n", $template->output; -- 2.20.1