Browse Source

Bug 31028: Add email notification of cataloguers on submissions

This patch adds an optional cataloger notification to email the
cataloging team whenever a new catalog concern is reported.

Test plan
1) Enable `OpacCatalogConcerns`
2) Add at least one email address to the new `CatalogerEmails`
   prefernce (a comma delimited list is also allowed).
3) Confirm that a default template has been added to the Notices
   management, `TICKET_NOTIFY`.
4) Submit a new concern using the OPAC
5) Confirm that an email is sent to those email addresses listed in
   CatalogerEmails.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Helen Oliver <HOliver@tavi-port.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23.05.x
Martin Renvoize 2 years ago
committed by Tomas Cohen Arazi
parent
commit
255a8645a7
  1. 26
      Koha/Ticket.pm
  2. 16
      installer/data/mysql/atomicupdate/bug_31028.pl
  3. 16
      installer/data/mysql/en/mandatory/sample_notices.yml
  4. 1
      installer/data/mysql/mandatory/sysprefs.sql
  5. 6
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref

26
Koha/Ticket.pm

@ -134,6 +134,32 @@ sub store {
C4::Letters::SendQueuedMessages(
{ message_id => $acknowledgement_message_id } );
}
# Notify cataloger by email
if ( $self->biblio_id && C4::Context->preference('CatalogerEmails') ) {
# notify the library if a notice exists
my $notify_letter = C4::Letters::GetPreparedLetter(
module => 'catalog',
letter_code => 'TICKET_NOTIFY',
branchcode => $self->reporter->branchcode,
tables => { tickets => $self->id }
);
if ($notify_letter) {
my $message_id = C4::Letters::EnqueueLetter(
{
letter => $notify_letter,
message_transport_type => 'email',
to_address =>
C4::Context->preference('CatalogerEmails'),
reply_address => $self->reporter->notice_email_address,
}
);
C4::Letters::SendQueuedMessages(
{ message_id => $message_id } );
}
}
}
return $self;

16
installer/data/mysql/atomicupdate/bug_31028.pl

@ -109,5 +109,21 @@ return {
}
);
say $out "Added new notice 'TICKET_RESOLVE'";
$dbh->do(
q{
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free')
}
);
say $out "`CatalogerEmails` preference added";
$dbh->do(
q{
INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type)
VALUES ( 'catalog', 'TICKET_NOTIFY', '', 'Catalog concern notification', '1', 'Catalog concern reported', "Dear cataloger,\r\n\r\n[% INCLUDE 'patron-title.inc' patron => ticket.reporter %] reported the following concern with [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 %]\r\n\r\n\r\n\r\n[% ticket.body %]\r\n\r\n\r\n\r\nYou can mark this concern as resolved from the concern management <a href='[% Koha.Preference('IntranetBaseURL') %]/cgi-bin/koha/cataloguing/concerns.pl'>page</a>.", 'email' );
}
);
say $out "Added new notice 'TICKET_NOTIFY'";
}
}

16
installer/data/mysql/en/mandatory/sample_notices.yml

@ -97,6 +97,22 @@ tables:
- ""
- "Thankyou"
- module: catalog
code: TICKET_NOTIFY
branchcode: ""
name: "Concern notification"
is_html: 1
title: "Catalog concern reported"
message_transport_type: email
lang: default
content:
- "Dear cataloger,"
- "[% INCLUDE 'patron-title.inc' patron => ticket.reporter %] reported the following concern with [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 %]"
- ""
- "[% ticket.body %]"
- ""
- "You can mark this concern as resolved from the concern management <a href='[% Koha.Preference('IntranetBaseURL') %]/cgi-bin/koha/cataloguing/concerns.pl'>page</a>."
- module: circulation
code: ACCOUNT_CREDIT
branchcode: ""

1
installer/data/mysql/mandatory/sysprefs.sql

@ -131,6 +131,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'),
('casServerUrl','https://localhost:8443/cas','','URL of the cas server','Free'),
('casServerVersion','2', '2|3','Version of the CAS server Koha will connect to.','Choice'),
('CatalogerEmails', '', '', 'Notify these catalogers by email when a catalog concern is submitted', 'free'),
('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'),
('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'),
('ChargeFinesOnClosedDays','0',NULL,'Charge fines on days the library is closed.','YesNo'),

6
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref

@ -42,6 +42,12 @@ Cataloging:
1: "Allow"
0: "Don't allow"
- authorized values to be created within the cataloguing module. Librarian will need the manage_auth_values subpermission.
-
- "Use "
- pref: CatalogerEmails
default: ''
class: email
- " as the notification address for catalog concerns."
Spine labels:
-

Loading…
Cancel
Save