diff --git a/Koha/Ticket.pm b/Koha/Ticket.pm
index 711bcd9e12..f716304dec 100644
--- a/Koha/Ticket.pm
+++ b/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;
diff --git a/installer/data/mysql/atomicupdate/bug_31028.pl b/installer/data/mysql/atomicupdate/bug_31028.pl
index 68015ef4fb..179f835fc2 100644
--- a/installer/data/mysql/atomicupdate/bug_31028.pl
+++ b/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 page.", 'email' );
+ }
+ );
+ say $out "Added new notice 'TICKET_NOTIFY'";
}
}
diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml
index 469ee70163..261a6dff0d 100644
--- a/installer/data/mysql/en/mandatory/sample_notices.yml
+++ b/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 page."
+
- module: circulation
code: ACCOUNT_CREDIT
branchcode: ""
diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql
index a7fdb86bb0..85a1213abd 100644
--- a/installer/data/mysql/mandatory/sysprefs.sql
+++ b/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'),
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
index b28bf50099..c533548e8e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
+++ b/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:
-