Permalink
Browse files

[#26875895] Update member viewing scripts to still obey patron groups

  • Loading branch information...
1 parent ddd25f8 commit df3c9799b1802b2c64756a39fcdcea54560e07c9 @ctfliblime ctfliblime committed Mar 22, 2012
Showing with 59 additions and 8 deletions.
  1. +16 −1 cgi/circ/circulation.pl
  2. +14 −0 cgi/members/holdhistory.pl
  3. +15 −7 cgi/members/moremember.pl
  4. +14 −0 cgi/members/readingrec.pl
View
@@ -339,10 +339,25 @@ sub FormatFinesSummary {
}
$borrower = GetMemberDetails( $borrowernumber, 0, $circ_session );
+
+ if ( $borrower
+ && C4::Branch::CategoryTypeIsUsed('patrons')
+ && C4::Members::ConstrainPatronSearch())
+ {
+ my $agent = C4::Members::GetMember($loggedinuser);
+ $borrower = undef
+ unless C4::Branch::BranchesAreSiblings(
+ $borrower->{branchcode}, $agent->{branchcode}, 'patrons');
+ }
+ unless (defined $borrower) {
+ output_html_with_http_headers $query, $cookie, $template->output;
+ exit;
+ }
+
if ( $circ_session->{'override_user'} ) {
$template->param( flagged => 1 );
}
-
+
## Store data for last scanned borrower in cookies for future use.
my $lbb = $query->cookie(-name=>'last_borrower_borrowernumber', -value=>"$borrowernumber", -expires=>'+1y');
my $lbc = $query->cookie(-name=>'last_borrower_cardnumber', -value=>"$borrower->{'cardnumber'}", -expires=>'+1y');
View
@@ -47,6 +47,20 @@
#get borrower details
my $data=GetMember($borrowernumber,'borrowernumber');
+if ( $data
+ && C4::Branch::CategoryTypeIsUsed('patrons')
+ && C4::Members::ConstrainPatronSearch())
+{
+ my $agent = C4::Members::GetMember($loggedinuser);
+ $data = undef
+ unless C4::Branch::BranchesAreSiblings(
+ $data->{branchcode}, $agent->{branchcode}, 'patrons');
+}
+unless (defined $data) {
+ output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
+}
+
$template->param(
borrowernumber => $data->{'borrowernumber'},
firstname => $data->{'firstname'},
View
@@ -89,17 +89,25 @@ BEGIN
);
my $borrowernumber = $input->param('borrowernumber');
-#start the page and read in includes
-my $data = GetMember( $borrowernumber ,'borrowernumber');
-my $roaddetails = GetRoadTypeDetails( $data->{'streettype'} );
-my $reregistration = $input->param('reregistration');
-
-if ( not defined $data ) {
+my $data = GetMember( $borrowernumber ,'borrowernumber');
+if ( $data
+ && C4::Branch::CategoryTypeIsUsed('patrons')
+ && C4::Members::ConstrainPatronSearch())
+{
+ my $agent = C4::Members::GetMember($loggedinuser);
+ $data = undef
+ unless C4::Branch::BranchesAreSiblings(
+ $data->{branchcode}, $agent->{branchcode}, 'patrons');
+}
+unless (defined $data) {
$template->param (unknowuser => 1);
- output_html_with_http_headers $input, $cookie, $template->output;
+ output_html_with_http_headers $input, $cookie, $template->output;
exit;
}
+my $roaddetails = GetRoadTypeDetails( $data->{'streettype'} );
+my $reregistration = $input->param('reregistration');
+
# re-reregistration function to automatic calcul of date expiry
if ( $reregistration && $reregistration eq 'y' ) {
$data->{'dateexpiry'} = ExtendMemberSubscriptionTo( $borrowernumber );
View
@@ -43,6 +43,20 @@
my $borrowernumber=$input->param('borrowernumber');
#get borrower details
my $data=GetMember($borrowernumber,'borrowernumber');
+if ( $data
+ && C4::Branch::CategoryTypeIsUsed('patrons')
+ && C4::Members::ConstrainPatronSearch())
+{
+ my $agent = C4::Members::GetMember($loggedinuser);
+ $data = undef
+ unless C4::Branch::BranchesAreSiblings(
+ $data->{branchcode}, $agent->{branchcode}, 'patrons');
+}
+unless (defined $data) {
+ output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
+}
+
my $order=$input->param('order') || '';
my $order2=$order;
if ($order2 eq ''){

0 comments on commit df3c979

Please sign in to comment.