From 60c226fc651108b8fb57b5db9abf91de7df249e0 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 --- .../data/mysql/atomicupdate/bug_35267.pl | 36 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 10 ++++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 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 100644 index 00000000000..031665c43e3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35267.pl @@ -0,0 +1,36 @@ +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 8f5377e85a5..c8c144ccba9 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -26,6 +26,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AggressiveMatchOnISBN','0', NULL,'If enabled, attempt to match aggressively by trying all variations of the ISBNs in the imported record as a phrase in the ISBN fields of already cataloged records when matching on ISBN with the record import tool','YesNo'), ('AggressiveMatchOnISSN','0', NULL,'If enabled, attempt to match aggressively by trying all variations of the ISSNs in the imported record as a phrase in the ISSN fields of already cataloged records when matching on ISSN with the record import tool','YesNo'), ('AllFinesNeedOverride','1','0','If on, staff will be asked to override every fine, even if it is below noissuescharge.','YesNo'), +('AllNoticeCSS','',NULL,'CSS to include in each html notice regardless of messate transport type','free'), +('AllNoticeStylesheet', '', NULL, 'Enter the address for a stylesheet for all notices', 'free'), ('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'), ('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'), ('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'), @@ -237,6 +239,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('EmailFieldPrimary','','|email|emailpro|B_email|cardnumber|MULTI','Defines the default email address field where patron email notices are sent.','Choice'), ('EmailFieldSelection','','email|emailpro|B_email','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple'), ('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'), +('EmailNoticeCSS','',NULL,'CSS to include in each html email notice','free'), +('EmailNoticeStylesheet','',NULL,'Enter the address for a stylesheet to include in each html email notice','free'), ('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'), ('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'), ('EmailPatronWhenHoldIsPlaced', '0', NULL, 'Email patron when a hold has been placed for them', 'YesNo'), @@ -425,7 +429,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('NotesToHide','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'), ('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'), ('NoticeBcc','','','Email address to bcc outgoing notices sent by email','free'), -('NoticeCSS','',NULL,'Notices CSS url.','free'), ('NoticesLog','0',NULL,'If enabled, log changes to notice templates','YesNo'), ('NoticesManagement','0',NULL,'Enable the interface to view and print generated notices','YesNo'), ('NotifyBorrowerDeparture','30',NULL,'Define number of days before expiry where circulation is warned about patron account expiry','Integer'), @@ -624,7 +627,11 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('PreservationNotForLoanWaitingListIn', '', '', 'Not for loan to apply to items added to the preservation waiting list', 'TextArea'), ('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'), ('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'), +('PrintNoticeCSS','',NULL,'CSS to include in each html print notice','free'), +('PrintNoticeStylesheet','',NULL,'Enter the address for a stylesheet to include in each html print notice','free'), ('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'), +('PrintSlipCSS','',NULL,'CSS to include in each html print slip','free'), +('PrintSlipStylesheet','',NULL,'Enter the address for a stylesheet to include in each html print slip','free'), ('PrivacyPolicyConsent','','Enforced|Permissive|Disabled','Data privacy policy consent in the OPAC', 'Choice'), ('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free'), ('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'), @@ -729,7 +736,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SIP2AddOpacMessagesToScreenMessage','1','','If enabled, patron OPAC messages will be included in the SIP2 screen message','YesNo'), ('SIP2SortBinMapping','',NULL,'Use the following mappings to determine the sort_bin of a returned item. The mapping should be on the form \"branchcode:item field:item field value:sort bin number\", with one mapping per line.','free'), ('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer'), -('SlipCSS','',NULL,'Slips CSS url.','free'), ('SMSSendAdditionalOptions', '', '', 'Additional SMS::Send parameters used to send SMS messages', 'free'), ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'), ('SMSSendMaxChar', '', NULL, 'Add a limit for the number of characters in SMS messages', 'Integer'), -- 2.46.2