Bugzilla – Attachment 68 Details for
Bug 1092
might be nice to have cookie keep track of patron.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patches.
patroncookie.patch (text/plain), 8.72 KB, created by
Chris Cormack
on 2006-05-31 07:05:00 UTC
(
hide
)
Description:
proposed patches.
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2006-05-31 07:05:00 UTC
Size:
8.72 KB
patch
obsolete
>diff -rc koha-2.2.5-orig/intranet-cgi/circ/circulation.pl koha-2.2.5-patch/intranet-cgi/circ/circulation.pl >*** koha-2.2.5-orig/intranet-cgi/circ/circulation.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/circ/circulation.pl 2006-05-23 17:10:33.000000000 -0600 >*************** >*** 57,64 **** > > my $findborrower = $query->param('findborrower'); > $findborrower =~ s|,| |g; > $findborrower =~ s|'| |g; >! my $borrowernumber = $query->param('borrnumber'); > my $print=$query->param('print'); > my $barcode = $query->param('barcode'); > my $year=$query->param('year'); >--- 57,64 ---- > > my $findborrower = $query->param('findborrower'); > $findborrower =~ s|,| |g; > $findborrower =~ s|'| |g; >! my $borrowernumber = $query->param('borrnumber') || $query->cookie('patron'); > my $print=$query->param('print'); > my $barcode = $query->param('barcode'); > my $year=$query->param('year'); >*************** >*** 68,81 **** >--- 69,86 ---- > my $issueconfirmed = $query->param('issueconfirmed'); > my $cancelreserve = $query->param('cancelreserve'); > > > #set up cookie..... > my $branchcookie; > my $printercookie; >+ my $patroncookie; > if ($query->param('setcookies')) { > $branchcookie = $query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y'); > $printercookie = $query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y'); > } >+ if ($query->cookie('patron') != $borrowernumber) { >+ $patroncookie = $query->cookie(-name=>'patron', -value=>"$borrowernumber", -expires=>'+1y'); >+ } > > my %env; # FIXME env is used as an "environment" variable. Could be dropped probably... > >*************** >*** 117,130 **** > } else { > $borrowerslist = \@borrowers; > } > } > > # get the borrower information..... >! my $borrower; > if ($borrowernumber) { > $borrower = getpatroninformation(\%env,$borrowernumber,0); >! my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); >! warn $borrower->{'expiry'}; > my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifyBorrowerDeparture')." days"); > my $warning=Date_Cmp(ParseDate("today"),$warningdate); > if ($warning>0){ >--- 135,149 ---- > } else { > $borrowerslist = \@borrowers; > } >+ $patroncookie = $query->cookie(-name=>'patron', -value=>"$borrowernumber", -expires=>'+1y'); > } > > # get the borrower information..... >! my ($borrower, $od, $issue, $fines); > if ($borrowernumber) { > $borrower = getpatroninformation(\%env,$borrowernumber,0); >! ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); >! # warn $borrower->{'expiry'}; > my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifyBorrowerDeparture')." days"); > my $warning=Date_Cmp(ParseDate("today"),$warningdate); > if ($warning>0){ >*************** >*** 133,139 **** > } > $template->param(overduecount => $od, > issuecount => $issue, >! finetotal => $fines); > } > > >--- 152,158 ---- > } > $template->param(overduecount => $od, > issuecount => $issue, >! finetotal => sprintf ("%0.2d",$fines)); > } > > >*************** >*** 168,180 **** > year => $year); > if ($noerror && ($noquestion || $issueconfirmed)) { > issuebook(\%env, $borrower, $barcode, $datedue); > } > } > } > > # reload the borrower info for the sake of reseting the flags..... >! if ($borrowernumber) { > $borrower = getpatroninformation(\%env,$borrowernumber,0); > } > > >--- 203,220 ---- > year => $year); > if ($noerror && ($noquestion || $issueconfirmed)) { > issuebook(\%env, $borrower, $barcode, $datedue); > } > } > } > > # reload the borrower info for the sake of reseting the flags..... >! if ($borrowernumber && $barcode) { > $borrower = getpatroninformation(\%env,$borrowernumber,0); >+ ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); >+ >+ $template->param(overduecount => $od, >+ issuecount => $issue, >+ finetotal => sprintf ("%0.2d",$fines)); > } > > >*************** >*** 316,327 **** > $t_year => 1, > $t_month => 1, > $t_day => 1, > ); > } > > >! if ($branchcookie) { >! $cookie=[$cookie, $branchcookie, $printercookie]; > } > > output_html_with_http_headers $query, $cookie, $template->output; >--- 388,400 ---- > $t_year => 1, > $t_month => 1, > $t_day => 1, >+ selected => 'checked="checked"' > ); > } > > >! if ($branchcookie || $patroncookie) { >! $cookie=[@$cookie, $branchcookie, $printercookie, $patroncookie]; > } > > output_html_with_http_headers $query, $cookie, $template->output; >diff -rc koha-2.2.5-orig/intranet-cgi/circ/returns.pl koha-2.2.5-patch/intranet-cgi/circ/returns.pl >*** koha-2.2.5-orig/intranet-cgi/circ/returns.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/circ/returns.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 401,406 **** >--- 406,417 ---- > ribortitle => $borrower->{'title'}, > riborfirstname => $borrower->{'firstname'} > ); >+ >+ # Check borrower cookie >+ if ($query->cookie('patron') != $borrower->{'borrowernumber'}) { >+ my $patroncookie = $query->cookie(-name=>'patron', -value=>$borrower->{'borrowernumber'}, -expires=>'+1y'); >+ $cookie = [@$cookie, $patroncookie]; >+ } > } > > my $color = ''; >diff -rc koha-2.2.5-orig/intranet-cgi/members/deletemem.pl koha-2.2.5-patch/intranet-cgi/members/deletemem.pl >*** koha-2.2.5-orig/intranet-cgi/members/deletemem.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/members/deletemem.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 106,112 **** > > } else { > delmember($member); >! print $input->redirect("/cgi-bin/koha/members/members-home.pl"); > } > > sub delmember{ >--- 106,119 ---- > > } else { > delmember($member); >! >! my $sessioncookie = $input->cookie(-name=>'sessionID', -value=>$input->cookie('sessionID'), -expires=>'+1h'); >! my $usercookie = $input->cookie(-name=>'userenv', -value=>$input->cookie('userenv'), -expires=>'+1h'); >! my $patroncookie = $input->cookie(-name=>'patron', -value=>"", -expires=>'now'); >! $cookie = [ $sessioncookie, $usercookie, $patroncookie ]; >! >! print $input->header({-cookie => $cookie, -status => '302 Moved', -location => '/cgi-bin/koha/members/members-home.pl'}); >! # print $input->redirect("/cgi-bin/koha/members/members-home.pl"); > } > > sub delmember{ >diff -rc koha-2.2.5-orig/intranet-cgi/members/member.pl koha-2.2.5-patch/intranet-cgi/members/member.pl >*** koha-2.2.5-orig/intranet-cgi/members/member.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/members/member.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 67,76 **** >--- 67,87 ---- > $orderby = "surname,firstname" unless $orderby; > $member =~ s/,//g; #remove any commas from search string > $member =~ s/\*/%/g; > my $env; > > my ($count,$results); > >+ # if they want a different patron, clear the cookie, otherwise redirect. >+ unless ($quicksearch) { >+ if ($member) { >+ my $patroncookie = $input->cookie(-name=>'patron', -value=>"", -expires=>'+1h'); >+ $cookie = [@$cookie, $patroncookie]; >+ } elsif ($input->cookie('patron')) { >+ print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=".$input->cookie('patron')); >+ exit; >+ } >+ } >+ > if(length($member) == 1) > { > ($count,$results)=BornameSearch($env,$member,$orderby,"simple"); >*************** >*** 81,86 **** >--- 93,103 ---- > } > > >+ if ($count == 1 && ! $quicksearch) { >+ print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=".$results->[0]{'borrowernumber'}); >+ exit; >+ } >+ > my @resultsdata; > my $background = 0; > for (my $i=0; $i < $count; $i++){ >diff -rc koha-2.2.5-orig/intranet-cgi/members/members-home.pl koha-2.2.5-patch/intranet-cgi/members/members-home.pl >*** koha-2.2.5-orig/intranet-cgi/members/members-home.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/members/members-home.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 31,36 **** >--- 31,42 ---- > flagsrequired => {borrowers => 1}, > debug => 1, > }); >+ >+ # redirect if there is already a patron >+ if ($query->cookie('patron')) { >+ print $query->redirect("/cgi-bin/koha/members/moremember.pl?bornum=".$query->cookie('patron')); >+ exit; >+ } > } > > >diff -rc koha-2.2.5-orig/intranet-cgi/members/moremember.pl koha-2.2.5-patch/intranet-cgi/members/moremember.pl >*** koha-2.2.5-orig/intranet-cgi/members/moremember.pl 2006-01-13 14:24:18.000000000 -0700 >--- koha-2.2.5-patch/intranet-cgi/members/moremember.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 69,74 **** >--- 69,81 ---- > }); > > my $bornum=$input->param('bornum'); >+ >+ #check patron cookie >+ >+ if ($bornum != $input->cookie('patron')) { >+ my $patroncookie = $input->cookie(-name=>'patron', -value=>"$bornum", -expires=>'+1h'); >+ $cookie = [@$cookie, $patroncookie]; >+ } > > #start the page and read in includes >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 1092
:
68