Bug 5770: New system pref for new suggestion email

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nazlı Çetin 2019-04-30 15:53:20 +00:00 committed by Nick Clemens
parent c892642d9f
commit 85b2bc8cd0
3 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,41 @@
$DBversion = '18.12.00.XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( q{
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES
('EmailPurchaseSuggestions','KohaAdminEmailAddress','EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that will be sent new purchase suggestions','Choice'),
('EmailAddressForSuggestions','','','If you choose EmailAddressForSuggestions you should enter a valid email address','free')
});
$dbh->do( q{
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES
('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pending approval</h3>
<p><h4>Suggested by</h4>
<ul>
<li><<borrowers.firstname>> <<borrowers.surname>></li>
<li><<borrowers.cardnumber>></li>
<li><<borrowers.phone>></li>
<li><<borrowers.email>></li>
</ul>
</p>
<p><h4>Title suggested</h4>
<ul>
<li><b>Library:</b> <<branches.branchname>></li>
<li><b>Title:</b> <<suggestions.title>></li>
<li><b>Author:</b> <<suggestions.author>></li>
<li><b>Copyright date:</b> <<suggestions.copyrightdate>></li>
<li><b>Standard number (ISBN, ISSN or other):</b> <<suggestions.isbn>></li>
<li><b>Publisher:</b> <<suggestions.publishercode>></li>
<li><b>Collection title:</b> <<suggestions.collectiontitle>></li>
<li><b>Publication place:</b> <<suggestions.place>></li>
<li><b>Quantity:</b> <<suggestions.quantity>></li>
<li><b>Item type:</b> <<suggestions.itemtype>></li>
<li><b>Reason for suggestion:</b> <<suggestions.patronreason>></li>
<li><b>Notes:</b> <<suggestions.note>></li>
</ul>
</p>',1, 'email')
});
# Always end with this (adjust the bug info)
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 5770 - Email librarian when purchase suggestion made)\n";
}

View File

@ -159,7 +159,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'),
('ElasticsearchIndexStatus_authorities', '0', 'Authorities index status', NULL, NULL),
('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL),
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
('EmailPurchaseSuggestions','KohaAdminEmailAddress','EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that new purchase suggestions will be sent to: ','Choice'),
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),

View File

@ -6,6 +6,17 @@ Administration:
- pref: KohaAdminEmailAddress
class: email
- "(This is the default From: address for emails unless there is one for the particular library, and is referred to when an internal error occurs.)"
-
- "Choose email address that new purchase suggestions will be sent to: "
- pref: EmailPurchaseSuggestions
default: KohaAdminEmailAddress
choices:
EmailAddressForSuggestions: EmailAddressForSuggestions
BranchEmailAddress: email address of branch
KohaAdminEmailAddress: KohaAdminEmailAddress
- "If you choose EmailAddressForSuggestions you have to enter a valid email address: "
- pref: EmailAddressForSuggestions
class: email
-
- "Email address to be set as the replyto in emails: "
- pref: ReplytoDefault