From 3019c28780ce7853c27c17a4865f8853d31209ff Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 17 Apr 2023 04:51:17 +0000 Subject: [PATCH] Bug 33478: [WIP] Allow formatting of notices --- .../bug_33478-add_letter_columns.pl | 138 ++++++++++++++++++ .../prog/en/modules/tools/letter.tt | 123 +++++++++++++++- 2 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_33478-add_letter_columns.pl diff --git a/installer/data/mysql/atomicupdate/bug_33478-add_letter_columns.pl b/installer/data/mysql/atomicupdate/bug_33478-add_letter_columns.pl new file mode 100644 index 00000000000..abe3d98b97a --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33478-add_letter_columns.pl @@ -0,0 +1,138 @@ +use Modern::Perl; + +return { + bug_number => "33478", + description => "Customise the format of notices when they are printed", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + if( !column_exists( 'letter', 'font' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `font` char(10) NOT NULL DEFAULT 'TR' AFTER `updated_on` + }); + + say $out "Added column 'letter.font'"; + } + + if( !column_exists( 'letter', 'font_size' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `font_size` int(4) NOT NULL DEFAULT 10 AFTER `font` + }); + + say $out "Added column 'letter.font_size'"; + } + + if( !column_exists( 'letter', 'text_justify' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `text_justify` char(1) NOT NULL DEFAULT 'L' AFTER `font_size` + }); + + say $out "Added column 'letter.text_justify'"; + } + + if( !column_exists( 'letter', 'units' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `units` char(20) NOT NULL DEFAULT 'INCH' AFTER `text_justify` + }); + + say $out "Added column 'letter.units'"; + } + + if( !column_exists( 'letter', 'notice_width' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `notice_width` float NOT NULL DEFAULT 8.5 AFTER `units` + }); + + say $out "Added column 'letter.notice_width'"; + } + + if( !column_exists( 'letter', 'notice_length' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `notice_length` float NOT NULL DEFAULT 11 AFTER `notice_width` + }); + + say $out "Added column 'letter.notice_length'"; + } + + if( !column_exists( 'letter', 'page_width' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `page_width` float NOT NULL DEFAULT 8.5 AFTER `notice_width` + }); + + say $out "Added column 'letter.page_width'"; + } + + if( !column_exists( 'letter', 'page_length' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `page_length` float NOT NULL DEFAULT 11 AFTER `page_width` + }); + + say $out "Added column 'letter.page_length'"; + } + + if( !column_exists( 'letter', 'top_text_margin' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `top_text_margin` float NOT NULL DEFAULT 0 AFTER `page_length` + }); + + say $out "Added column 'letter.top_text_margin'"; + } + + if( !column_exists( 'letter', 'left_text_margin' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `left_text_margin` float NOT NULL DEFAULT 0 AFTER `top_text_margin` + }); + + say $out "Added column 'letter.left_text_margin'"; + } + + if( !column_exists( 'letter', 'top_margin' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `top_margin` float NOT NULL DEFAULT 0.5 AFTER `left_text_margin` + }); + + say $out "Added column 'letter.top_margin'"; + } + + if( !column_exists( 'letter', 'left_margin' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `left_margin` float NOT NULL DEFAULT 0.5 AFTER `top_margin` + }); + + say $out "Added column 'letter.left_margin'"; + } + + if( !column_exists( 'letter', 'cols' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `cols` float NOT NULL DEFAULT 1 AFTER `left_margin` + }); + + say $out "Added column 'letter.cols'"; + } + + if( !column_exists( 'letter', 'rows' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `rows` float NOT NULL DEFAULT 1 AFTER `cols` + }); + + say $out "Added column 'letter.rows'"; + } + + if( !column_exists( 'letter', 'col_gap' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `col_gap` float NOT NULL DEFAULT 0 AFTER `rows` + }); + + say $out "Added column 'letter.col_gap'"; + } + + if( !column_exists( 'letter', 'row_gap' ) ) { + $dbh->do(q{ + ALTER TABLE letter ADD COLUMN `row_gap` float NOT NULL DEFAULT 0 AFTER `col_gap` + }); + + say $out "Added column 'letter.row_gap'"; + } + }, +}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index 910deebfef5..3801572458d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -1,4 +1,4 @@ -[% USE raw %] +m% USE raw %] [% USE Asset %] [% USE Koha %] [% USE KohaDates %] @@ -648,6 +648,127 @@ [% END # /FOR mtt %] + +
+ +
+
+
+ +
    +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + +
  6. +
  7. + + +
  8. +
  9. + + +
  10. +
  11. + + +
  12. +
  13. + + +
  14. +
  15. + + +
  16. +
  17. + + +
  18. +
  19. + + +
  20. +
  21. + + +
  22. +
  23. + + +
  24. +
  25. + + +
  26. +
  27. + + +
  28. +
  29. + + +
  30. +
  31. + + +
  32. +
+
+
+
+
[% END %] -- 2.30.2