View | Details | Raw Unified | Return to bug 29544
Collapse All | Expand All

(-)a/opac/opac-issue-note.pl (-2 / +10 lines)
Lines 49-54 $template->param( Link Here
49
49
50
my $issue_id = $query->param('issue_id');
50
my $issue_id = $query->param('issue_id');
51
my $issue = Koha::Checkouts->find( $issue_id );
51
my $issue = Koha::Checkouts->find( $issue_id );
52
53
54
if ( !$issue || $issue->borrowernumber != $borrowernumber ) {
55
    # exit early
56
    print $query->redirect("/cgi-bin/koha/opac-user.pl");
57
    exit;
58
}
59
52
my $itemnumber = $issue->itemnumber;
60
my $itemnumber = $issue->itemnumber;
53
my $biblio = $issue->item->biblio;
61
my $biblio = $issue->item->biblio;
54
$template->param(
62
$template->param(
Lines 60-69 $template->param( Link Here
60
);
68
);
61
69
62
my $action = $query->param('action') || "";
70
my $action = $query->param('action') || "";
63
if ( $action eq 'issuenote' && C4::Context->preference('AllowCheckoutNotes') ) {
71
if ( $action eq 'issuenote' && C4::Context->preference('AllowCheckoutNotes') && $issue ) {
64
    my $note = $query->param('note');
72
    my $note = $query->param('note');
65
    my $scrubber = C4::Scrubber->new();
73
    my $scrubber = C4::Scrubber->new();
66
    my $clean_note = $scrubber->scrub($note);
74
    my $clean_note = $scrubber->scrub($note);
75
67
    if ( $issue->set({ notedate => dt_from_string(), note => $clean_note, noteseen => 0 })->store ) {
76
    if ( $issue->set({ notedate => dt_from_string(), note => $clean_note, noteseen => 0 })->store ) {
68
        if ($clean_note) { # only send email if note not empty
77
        if ($clean_note) { # only send email if note not empty
69
            my $branch = Koha::Libraries->find( $issue->branchcode );
78
            my $branch = Koha::Libraries->find( $issue->branchcode );
70
- 

Return to bug 29544