From a65d4188b216a762af97b04c56f33701b0b24742 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sat, 13 Nov 2010 16:50:30 -0500 Subject: [PATCH] Updating Version Number to 3.02.01.001 bug 5127: database update to add the suggestion notification templates Being especially careful to not scribble over any ones that the library might have already defined. Signed-off-by: Galen Charlton Signed-off-by: Chris Nighswonger --- installer/data/mysql/updatedatabase.pl | 34 ++++++++++++++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 5d40b31771..574d3ae4c3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3848,6 +3848,40 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.02.01.001'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $count = $dbh->selectrow_array('SELECT COUNT(*) FROM letter WHERE module = ? AND code = ?', {}, 'suggestions', 'ACCEPTED'); + $dbh->do(q/ +INSERT INTO `letter` +(module, code, name, title, content) +VALUES +('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>') +/) unless $count > 0; + $count = $dbh->selectrow_array('SELECT COUNT(*) FROM letter WHERE module = ? AND code = ?', {}, 'suggestions', 'AVAILABLE'); + $dbh->do(q/ +INSERT INTO `letter` +(module, code, name, title, content) +VALUES +('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>') +/) unless $count > 0; + $count = $dbh->selectrow_array('SELECT COUNT(*) FROM letter WHERE module = ? AND code = ?', {}, 'suggestions', 'ORDERED'); + $dbh->do(q/ +INSERT INTO `letter` +(module, code, name, title, content) +VALUES +('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <>\n\nThank you,\n\n<>') +/) unless $count > 0; + $count = $dbh->selectrow_array('SELECT COUNT(*) FROM letter WHERE module = ? AND code = ?', {}, 'suggestions', 'REJECTED'); + $dbh->do(q/ +INSERT INTO `letter` +(module, code, name, title, content) +VALUES +('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <> <>,\n\nYou have suggested that the library acquire <> by <>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <>\n\nIf you have any questions, please email us at <>.\n\nThank you,\n\n<>') +/) unless $count > 0; + print "Upgrade to $DBversion done (bug 5127: add default templates for suggestion status change notifications)\n"; + SetVersion ($DBversion); +}; + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index 906de0c3e6..f5d0afca9f 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.02.01.000'; + our $VERSION = '3.02.01.001'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5