Lines 1892-1899
sub AddReturn {
Link Here
|
1892 |
} |
1892 |
} |
1893 |
} |
1893 |
} |
1894 |
|
1894 |
|
1895 |
MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, |
1895 |
eval { |
1896 |
$circControlBranch, $return_date, $borrower->{'privacy'} ); |
1896 |
MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, |
|
|
1897 |
$circControlBranch, $return_date, $borrower->{'privacy'} ); |
1898 |
}; |
1899 |
if ( $@ ) { |
1900 |
$messages->{'Wrongbranch'} = { |
1901 |
Wrongbranch => $branch, |
1902 |
Rightbranch => $message |
1903 |
}; |
1904 |
carp $@; |
1905 |
return ( 0, { WasReturned => 0 }, $issue, $borrower ); |
1906 |
} |
1897 |
|
1907 |
|
1898 |
# FIXME is the "= 1" right? This could be the borrower hash. |
1908 |
# FIXME is the "= 1" right? This could be the borrower hash. |
1899 |
$messages->{'WasReturned'} = 1; |
1909 |
$messages->{'WasReturned'} = 1; |
Lines 2071-2076
routine in C<C4::Accounts>.
Link Here
|
2071 |
sub MarkIssueReturned { |
2081 |
sub MarkIssueReturned { |
2072 |
my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate, $privacy ) = @_; |
2082 |
my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate, $privacy ) = @_; |
2073 |
|
2083 |
|
|
|
2084 |
my $anonymouspatron; |
2085 |
if ( $privacy == 2 ) { |
2086 |
# The default of 0 will not work due to foreign key constraints |
2087 |
# The anonymisation will fail if AnonymousPatron is not a valid entry |
2088 |
# We need to check if the anonymous patron exist, Koha will fail loudly if it does not |
2089 |
# Note that a warning should appear on the about page (System information tab). |
2090 |
$anonymouspatron = C4::Context->preference('AnonymousPatron'); |
2091 |
die "Fatal error: the patron ($borrowernumber) has requested a privacy on returning item but the AnonymousPatron pref is not set correctly" |
2092 |
unless C4::Members::GetMember( borrowernumber => $anonymouspatron ); |
2093 |
} |
2074 |
my $dbh = C4::Context->dbh; |
2094 |
my $dbh = C4::Context->dbh; |
2075 |
my $query = 'UPDATE issues SET returndate='; |
2095 |
my $query = 'UPDATE issues SET returndate='; |
2076 |
my @bind; |
2096 |
my @bind; |
Lines 2096-2105
sub MarkIssueReturned {
Link Here
|
2096 |
$sth_copy->execute($borrowernumber, $itemnumber); |
2116 |
$sth_copy->execute($borrowernumber, $itemnumber); |
2097 |
# anonymise patron checkout immediately if $privacy set to 2 and AnonymousPatron is set to a valid borrowernumber |
2117 |
# anonymise patron checkout immediately if $privacy set to 2 and AnonymousPatron is set to a valid borrowernumber |
2098 |
if ( $privacy == 2) { |
2118 |
if ( $privacy == 2) { |
2099 |
# The default of 0 does not work due to foreign key constraints |
|
|
2100 |
# The anonymisation will fail quietly if AnonymousPatron is not a valid entry |
2101 |
# FIXME the above is unacceptable - bug 9942 relates |
2102 |
my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) ? C4::Context->preference('AnonymousPatron') : 0; |
2103 |
my $sth_ano = $dbh->prepare("UPDATE old_issues SET borrowernumber=? |
2119 |
my $sth_ano = $dbh->prepare("UPDATE old_issues SET borrowernumber=? |
2104 |
WHERE borrowernumber = ? |
2120 |
WHERE borrowernumber = ? |
2105 |
AND itemnumber = ?"); |
2121 |
AND itemnumber = ?"); |