From c1314fd57b2884f4d460d99e8225bd431da48f7b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 13 Nov 2023 12:13:04 +0000 Subject: [PATCH] Bug 35267: Add and Update Notice CSS system preferences This patch clarifies the system level notice css preferences. We rename NoticeCSS to EmailNoticeStylesheet We rename SlipCSS to PrintSlipStylesheet We add AllNoticeStylesheet We add AllNoticeCSS to contain inline CSS for all html notices We add EmailNoticeCSS to contain inline CSS for Email notices We add PrintNoticeCSS to contain inline CSS for Print notices We add PrintSlipCSS to contain inline CSS for Print slips Sponsored-by: Open Fifth Signed-off-by: Marion Durand Signed-off-by: Thomas Klausner Signed-off-by: Lucas Gass --- .../data/mysql/atomicupdate/bug_35267.pl | 42 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 7 ++++ 2 files changed, 49 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_35267.pl diff --git a/installer/data/mysql/atomicupdate/bug_35267.pl b/installer/data/mysql/atomicupdate/bug_35267.pl new file mode 100755 index 0000000000..bee58b7770 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35267.pl @@ -0,0 +1,42 @@ +use Modern::Perl; + +return { + bug_number => "35267", + description => "Enhance NoticeCSS preferences", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES + ('AllNoticeStylesheet', '', NULL, 'Enter the address for a stylesheet for all notices', 'free'), + ('AllNoticeCSS','',NULL,'CSS to include in each html notice regardless of messate transport type','free'), + ('EmailNoticeCSS','',NULL,'CSS to include in each html email notice','free'), + ('PrintNoticeCSS','',NULL,'CSS to include in each html print notice','free'), + ('PrintSlipCSS','',NULL,'CSS to include in each html print notice','free') + } + ); + say $out "Added new system preference 'AllNoticeStylesheet'"; + say $out "Added new system preference 'AllNoticeCSS'"; + say $out "Added new system preference 'EmailNoticeCSS'"; + say $out "Added new system preference 'PrintNoticeCSS'"; + say $out "Added new system preference 'PrintSlipCSS'"; + + $dbh->do( + q{ + UPDATE systempreferences SET variable='EmailNoticeStylesheet' WHERE variable='NoticeCSS' + } + ); + say $out "Rename system preference 'NoticeCSS' to 'EmailNoticeStylesheet'"; + + $dbh->do( + q{ + UPDATE systempreferences SET variable='PrintSlipStylesheet' WHERE variable='SlipCSS' + } + ); + say $out "Rename system preference 'SlipCSS' to 'PrintSlipStylesheet'"; + + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 38f7a9806b..8cc184b814 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -27,6 +27,7 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES ('AggressiveMatchOnISBN','0'), ('AggressiveMatchOnISSN','0'), ('AllFinesNeedOverride','1'), +('AllNoticeCSS',''), ('AllowAllMessageDeletion','0'), ('AllowCheckoutNotes', '0'), ('AllowFineOverride','0'), @@ -255,6 +256,8 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES ('EmailFieldSelection',''), ('emailLibrarianWhenHoldIsPlaced','0'), ('EmailOverduesNoEmail','1'), +('EmailNoticeCSS',''), +('EmailNoticeStylesheet',''), ('EmailPatronRegistrations', '0'), ('EmailPatronWhenHoldIsPlaced', '0'), ('EmailPurchaseSuggestions','0'), @@ -662,8 +665,12 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES ('PreserveSerialNotes','1'), ('PreventWithdrawingItemsStatus', ''), ('previousIssuesDefaultSortOrder','asc'), +('PrintNoticeCSS',''), ('PrintNoticesMaxLines','0'), ('PrivacyPolicyConsent',''), +('PrintNoticeStylesheet',''), +('PrintSlipCSS',''), +('PrintSlipStylesheet',''), ('PrivacyPolicyURL',''), ('ProcessingFeeNote', ''), ('ProtectSuperlibrarianPrivileges','1'),