Bug 34478: Changes for opac-dismiss-message / opac-note.inc
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
02564dc45e
commit
c3dce50a4f
2 changed files with 3 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="message_id" value="[% message.message_id | html %]">
|
||||
<input type="hidden" name="patron_id" value="[% message.borrowernumber | html %]">
|
||||
<input type="hidden" name="op" value="cud-update" />
|
||||
<button type="submit" class="dismiss-message-button btn btn-primary"><i class="fa fa-trash" aria-hidden="true"></i> Dismiss</button>
|
||||
</form>
|
||||
[% END %]
|
||||
|
|
|
@ -26,6 +26,7 @@ use Koha::DateUtils qw( dt_from_string );
|
|||
use Koha::Patrons;
|
||||
|
||||
my $query = CGI->new;
|
||||
my $op = $query->param('op') // q{};
|
||||
|
||||
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
|
||||
{
|
||||
|
@ -40,7 +41,7 @@ my $patron = Koha::Patrons->find( $patron_id );
|
|||
my $message_id = $query->param('message_id');
|
||||
my $message = $patron->messages->find( $message_id );
|
||||
|
||||
unless ( $message ) {
|
||||
unless ( $op =~ /^cud-/ && $message ) {
|
||||
# exit early
|
||||
print $query->redirect("/cgi-bin/koha/opac-user.pl");
|
||||
exit;
|
||||
|
|
Loading…
Reference in a new issue