From 27c258cb7e26aaa3af385290bf2744850d85f27a Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Tue, 20 Jan 2015 20:04:51 +0200 Subject: [PATCH] Bug 5501 - Improve the 'do not notify' option Introducing the message_transport_type 'none' and enabling it for all messages. Enabling print-option for "HOLD Fulfilled". Print option can be added for other messages as well, but HOLD seems to make the most sense. --- .../mysql/en/mandatory/message_transport_types.sql | 1 + .../sample_notices_message_transports.sql | 16 ++++- installer/data/mysql/updatedatabase.pl | 22 +++++++ .../prog/en/includes/messaging-preference-form.inc | 69 +++++++++++++++++++- 4 files changed, 102 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/en/mandatory/message_transport_types.sql b/installer/data/mysql/en/mandatory/message_transport_types.sql index ed3c4ad..0c1c602 100644 --- a/installer/data/mysql/en/mandatory/message_transport_types.sql +++ b/installer/data/mysql/en/mandatory/message_transport_types.sql @@ -4,4 +4,5 @@ values ('email'), ('print'), ('sms'), +('none'), ('phone'); diff --git a/installer/data/mysql/en/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/en/mandatory/sample_notices_message_transports.sql index ae68378..56328a4 100644 --- a/installer/data/mysql/en/mandatory/sample_notices_message_transports.sql +++ b/installer/data/mysql/en/mandatory/sample_notices_message_transports.sql @@ -3,15 +3,25 @@ insert into `message_transports` values (1, 'email', 0, 'circulation', 'DUE'), (1, 'email', 1, 'circulation', 'DUEDGST'), -(2, 'email', 0, 'circulation', 'PREDUE'), -(2, 'email', 1, 'circulation', 'PREDUEDGST'), -(4, 'email', 0, 'reserves', 'HOLD'), (1, 'sms', 0, 'circulation', 'DUE'), (1, 'sms', 1, 'circulation', 'DUEDGST'), +(1, 'none', 0, 'circulation', 'DUE'), +(1, 'none', 1, 'circulation', 'DUEDGST'), +(1, 'print', 0, 'circulation', 'DUE'), +(1, 'print', 1, 'circulation', 'DUEDGST'), +(2, 'email', 0, 'circulation', 'PREDUE'), +(2, 'email', 1, 'circulation', 'PREDUEDGST'), (2, 'sms', 0, 'circulation', 'PREDUE'), (2, 'sms', 1, 'circulation', 'PREDUEDGST'), +(2, 'none', 0, 'circulation', 'PREDUE'), +(2, 'none', 1, 'circulation', 'PREDUEDGST'), +(4, 'email', 0, 'reserves', 'HOLD'), (4, 'sms', 0, 'reserves', 'HOLD'), +(4, 'none', 0, 'reserves', 'HOLD'), +(4, 'print', 0, 'reserves', 'HOLD'), (5, 'email', 0, 'circulation', 'CHECKIN'), (5, 'sms', 0, 'circulation', 'CHECKIN'), +(5, 'none', 0, 'circulation', 'CHECKIN'), (6, 'email', 0, 'circulation', 'CHECKOUT'), (6, 'sms', 0, 'circulation', 'CHECKOUT'); +(6, 'none', 0, 'circulation', 'CHECKOUT'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4653c02..e4ee09b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6773,6 +6773,28 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.19.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ INSERT INTO message_transport_types VALUES ('none'); }); + $dbh->do(q{ + INSERT INTO `message_transports` + (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) + VALUES + (1, 'none', 0, 'circulation', 'DUE'), + (1, 'none', 1, 'circulation', 'DUEDGST'), + (1, 'print', 0, 'circulation', 'DUE'), + (1, 'print', 1, 'circulation', 'DUEDGST'), + (2, 'none', 0, 'circulation', 'PREDUE'), + (2, 'none', 1, 'circulation', 'PREDUEDGST'), + (4, 'none', 0, 'reserves', 'HOLD'), + (4, 'print', 0, 'reserves', 'HOLD'), + (5, 'none', 0, 'circulation', 'CHECKIN'), + (6, 'none', 0, 'circulation', 'CHECKOUT'); + }); + print "Upgrade to $DBversion done (Bug 5501 - Improve the 'do not notify' option)\n"; + SetVersion ($DBversion); +} + $DBversion = "3.11.00.203"; if ( CheckVersion($DBversion) ) { $dbh->do(q{ALTER TABLE suggestions CHANGE COLUMN title title VARCHAR(255) DEFAULT NULL;}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 3b7bb50..142691d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -7,6 +7,7 @@ newid = Number(rowid.replace("none","")) $("#sms"+newid).removeAttr("checked"); $("#email"+newid).removeAttr("checked"); + $("#print"+newid).removeAttr("checked"); $("#phone"+newid).removeAttr("checked"); $("#digest"+newid).removeAttr("checked"); $("#rss"+newid).removeAttr("checked"); @@ -23,9 +24,10 @@ Days in advance [% IF ( SMSSendDriver ) %]SMS[% END %] [% IF ( TalkingTechItivaPhone ) %]Phone[% END %] + Print EmailDigests only? - [% UNLESS ( messaging_form_inactive ) %]Do not notify[% END %] + Do not notify [% FOREACH messaging_preference IN messaging_preferences %] @@ -110,6 +112,38 @@ [% END %] [% END %] + [% IF ( messaging_preference.transport_print ) %] + + [% IF ( messaging_form_inactive ) %] + [% IF ( messaging_preference.transports_print ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( messaging_preference.transports_print ) %] + + [% ELSE %] + + [% END %] + [% END %] + + [% ELSE %] + - + [% END %] + [% IF ( messaging_preference.transport_email ) %] [% IF ( messaging_form_inactive ) %] @@ -192,9 +226,38 @@ - [% END %] --> - [% UNLESS ( messaging_form_inactive ) %] - + [% IF ( messaging_preference.transport_none ) %] + + [% IF ( messaging_form_inactive ) %] + [% IF ( messaging_preference.transports_none ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( messaging_preference.transports_none ) %] + + [% ELSE %] + + [% END %] + [% END %] + + [% ELSE %] + - [% END %] + [% END %] -- 1.7.9.5