@@ -, +, @@
submissions
---
Koha/Ticket.pm | 26 +++++++++++++++++++
.../data/mysql/atomicupdate/bug_31028.pl | 16 ++++++++++++
.../mysql/en/mandatory/sample_notices.yml | 16 ++++++++++++
installer/data/mysql/mandatory/sysprefs.sql | 1 +
.../admin/preferences/cataloguing.pref | 6 +++++
5 files changed, 65 insertions(+)
--- a/Koha/Ticket.pm
+++ a/Koha/Ticket.pm
@@ -135,6 +135,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;
--- a/installer/data/mysql/atomicupdate/bug_31028.pl
+++ a/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'";
}
}
--- a/installer/data/mysql/en/mandatory/sample_notices.yml
+++ a/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: ""
--- a/installer/data/mysql/mandatory/sysprefs.sql
+++ a/installer/data/mysql/mandatory/sysprefs.sql
@@ -128,6 +128,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'),
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
+++ a/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:
-
--