@@ -, +, @@ --- Koha/Patron/Messages.pm | 18 ++---------------- installer/data/mysql/atomicupdate/bug_12029.pl | 2 +- .../bootstrap/en/includes/opac-note.inc | 4 ++-- .../bootstrap/en/modules/opac-main.tt | 6 +++--- opac/dismiss_message.pl | 5 +++-- t/db_dependent/Koha/Patron/Messages.t | 12 ++++++------ 6 files changed, 17 insertions(+), 30 deletions(-) --- a/Koha/Patron/Messages.pm +++ a/Koha/Patron/Messages.pm @@ -50,13 +50,13 @@ sub object_class { return 'Koha::Patron::Message'; } -=head3 unread +=head3 filter_by_unread Returns a result set of messages that haven't been marked read by the patron =cut -sub unread { +sub filter_by_unread { # return resultset of messages with an undefined patron_read_date my ($self, $params) = @_; $params ||= {}; @@ -65,18 +65,4 @@ sub unread { %$params, }); } - -=head3 unread_count - - Returns a count of messages that haven't been marked read by the patron - -=cut - - -sub unread_count { - # return count of unread - my ($self, $params) = @_; - $params ||= {}; - return $self->unread(%$params)->count(); -} 1; --- a/installer/data/mysql/atomicupdate/bug_12029.pl +++ a/installer/data/mysql/atomicupdate/bug_12029.pl @@ -8,7 +8,7 @@ return { my ($dbh, $out) = @$args{qw(dbh out)}; # Do you stuffs here - my $alteration = qq{ + my $alteration = q{ ALTER TABLE messages ADD COLUMN `patron_read_date` timestamp NULL DEFAULT NULL COMMENT 'date and time patron dismissed message' --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc @@ -1,8 +1,8 @@ -[% IF patron_messages.unread_count OR opacnote %] +[% IF patron_messages.filter_by_unread.count OR opacnote %]

Messages for you