@@ -, +, @@ --- Koha/Catalog/Concern.pm | 46 +++++++++++++++---- .../data/mysql/atomicupdate/bug_31028.pl | 6 +++ .../mysql/en/mandatory/sample_notices.yml | 18 ++++++++ 3 files changed, 60 insertions(+), 10 deletions(-) --- a/Koha/Catalog/Concern.pm +++ a/Koha/Catalog/Concern.pm @@ -139,26 +139,52 @@ sub store { my $is_new = !$self->in_storage; $self = $self->SUPER::store; - if ($is_new && C4::Context->preference('CatalogerEmails') ) { + if ($is_new) { - # notify the library if a notice exists - my $letter = C4::Letters::GetPreparedLetter( + # Send patron acknowledgement + my $acknowledgement_letter = C4::Letters::GetPreparedLetter( module => 'catalog', - letter_code => 'CONCERN_NOTIFY', + letter_code => 'CONCERN_ACKNOWLEDGEMENT', branchcode => $self->reporter->branchcode, tables => { catalog_concerns => $self->id } ); - if ($letter) { - my $message_id = C4::Letters::EnqueueLetter( + if ($acknowledgement_letter) { + my $acknowledgement_message_id = C4::Letters::EnqueueLetter( { - letter => $letter, + letter => $acknowledgement_letter, message_transport_type => 'email', - to_address => C4::Context->preference('CatalogerEmails'), - reply_address => $self->reporter->notice_email_address, + to_address => $self->reporter->notice_email_address } ); - C4::Letters::SendQueuedMessages( { message_id => $message_id } ); + C4::Letters::SendQueuedMessages( + { message_id => $acknowledgement_message_id } ); + } + + # Notify cataloger by email + if ( C4::Context->preference('CatalogerEmails') ) { + + # notify the library if a notice exists + my $notify_letter = C4::Letters::GetPreparedLetter( + module => 'catalog', + letter_code => 'CONCERN_NOTIFY', + branchcode => $self->reporter->branchcode, + tables => { catalog_concerns => $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 } ); + } } } --- a/installer/data/mysql/atomicupdate/bug_31028.pl +++ a/installer/data/mysql/atomicupdate/bug_31028.pl @@ -62,6 +62,12 @@ return { } ); + $dbh->do( + q{ + INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type) + VALUES ( 'catalog', 'CONCERN_ACKNOWLEDGEMENT', '', 'Concern acknowledgement', '1', 'Catalog concern acknowledgement', "Dear [% INCLUDE 'patron-title.inc' patron => catalog_concern.reporter %],\r\n\r\nThankyou for your report concerning [% INCLUDE 'biblio-title.inc' biblio=catalog_concern.biblio link = 0 %].\r\n\r\nYou reported: \r\n[% catalog_concern.message %]\r\n\r\nThankyou", 'email' ); + } + ); if ( ( $dbh->selectrow_array('SELECT COUNT(*) FROM additional_contents WHERE location=?', undef, 'CatalogConcernHelp') )[0] == 0 ) { # Check to make idempotent $dbh->do( --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ a/installer/data/mysql/en/mandatory/sample_notices.yml @@ -59,6 +59,24 @@ tables: - "" - "You can mark this concern as resolved from the concern management page." + - module: catalog + code: CONCERN_ACKNOWLEDGEMENT + branchcode: "" + name: "Concern acknowledgement" + is_html: 1 + title: "Catalog concern acknowledgment" + message_transport_type: email + lang: default + content: + - "Dear [% INCLUDE 'patron-title.inc' patron => catalog_concern.reporter %]," + - "" + - "Thankyou for your report concerning [% INCLUDE 'biblio-title.inc' biblio=catalog_concern.biblio link = 0 %]." + - "" + - "You reported: " + - "[% catalog_concern.message %]" + - "" + - "Thankyou" + - module: catalog code: CONCERN_RESOLVE branchcode: "" --