Bugzilla – Attachment 149743 Details for
Bug 33478
Customise the format of notices when they are printed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33478: [WIP] Allow formatting of notices
Bug-33478-WIP-Allow-formatting-of-notices.patch (text/plain), 13.64 KB, created by
Aleisha Amohia
on 2023-04-17 04:51:48 UTC
(
hide
)
Description:
Bug 33478: [WIP] Allow formatting of notices
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-04-17 04:51:48 UTC
Size:
13.64 KB
patch
obsolete
>From 3019c28780ce7853c27c17a4865f8853d31209ff Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >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 @@ > </div> <!-- /.panel-collapse --> > </div> <!-- /.panel.panel-default --> > [% END # /FOR mtt %] >+ >+ <div class="panel panel-default"> >+ <div class="panel-heading" role="tab" id="format_[% lang | html %]Heading"> >+ <h3 class="panel-title"> >+ <a role="button" class="collapsed" data-toggle="collapse" data-parent="#group_[% lang | html %]" href="#format_[% lang | html %]" aria-expanded="false" aria-controls="format_[% lang | html %]"> >+ <span>Print format</span> >+ </a> >+ </h3> >+ </div> <!-- /.panel-heading --> >+ <div id="format_[% lang | html %]" class="panel-collapse collapse" role="tabpanel" aria-labelledby="format_[% lang | html %]Heading"> >+ <div class="panel-body"> >+ <fieldset class="rows"> >+ <input type="hidden" name="lang" value="[% lang | html %]" /> >+ <ol> >+ <li> >+ <label for="text_justify">Text justification: </label> >+ <select name="text_justify" id="text_justify"> >+ [% FOREACH text_justification_type IN text_justification_types %] >+ [% IF ( text_justification_type.selected ) %] >+ <option value="[% text_justification_type.type | html %]" selected="selected">[% PROCESS translate_justification_types type=text_justification_type.type %]</option> >+ [% ELSE %] >+ <option value="[% text_justification_type.type | html %]">[% PROCESS translate_justification_types type=text_justification_type.type %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="font">Font: </label> >+ <select name="font" id="font"> >+ [% FOREACH font_type IN font_types %] >+ [% IF ( font_type.selected ) %] >+ <option value="[% font_type.type | html %]" selected="selected">[% font_type.name | html %]</option> >+ [% ELSE %] >+ <option value="[% font_type.type | html %]">[% font_type.name | html %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="font_size">Font size: </label> >+ <input type="text" name="font_size" id="font_size" size="2" value="[% font_size | html %]" /> >+ </li> >+ <li> >+ <label for="units">Units:</label> >+ <select id="units" name="units"> >+ [% FOREACH unit IN units %] >+ [% IF ( unit.selected ) %] >+ <option value="[% unit.type | html %]" selected="selected"> >+ [% ELSE %] >+ <option value="[% unit.type | html %]"> >+ [% END %] >+ >+ [% SWITCH unit.type %] >+ [% CASE 'POINT' %] >+ <span>PostScript points</span> >+ [% CASE 'AGATE' %] >+ <span>Agates</span> >+ [% CASE 'INCH' %] >+ <span>US Inches</span> >+ [% CASE 'MM' %] >+ <span>SI Millimeters</span> >+ [% CASE 'CM' %] >+ <span>SI Centimeters</span> >+ [% END %] >+ </option> >+ [% END %] >+ </select> >+ </li> >+ <li> >+ <label for="page_height">Page height:</label> >+ <input type="text" size="4" name="page_height" id="page_height" value="[% page_height | html %]" /> >+ </li> >+ <li> >+ <label for="page_width">Page width:</label> >+ <input type="text" size="4" name="page_width" id="page_width" value="[% page_width | html %]" /> >+ </li> >+ <li> >+ <label for="label_width">Label width:</label> >+ <input type="text" size="4" name="label_width" id="label_width" value="[% label_width | html %]" /> >+ </li> >+ <li> >+ <label for="label_height">Label height:</label> >+ <input type="text" size="4" name="label_height" id="label_height" value="[% label_height | html %]" /> >+ </li> >+ <li> >+ <label for="top_margin">Top page margin:</label> >+ <input type="text" size="4" name="top_margin" id="top_margin" value="[% top_margin | html %]" /> >+ </li> >+ <li> >+ <label for="left_margin">Left page margin:</label> >+ <input type="text" size="4" name="left_margin" id="left_margin" value="[% left_margin | html %]" /> >+ </li> >+ <li> >+ <label for="top_text_margin">Top text margin:</label> >+ <input type="text" size="4" name="top_text_margin" id="top_text_margin" value="[% top_text_margin | html %]" /> >+ </li> >+ <li> >+ <label for="left_text_margin">Left text margin:</label> >+ <input type="text" size="4" name="left_text_margin" id="left_text_margin" value="[% left_text_margin | html %]" /> >+ </li> >+ <li> >+ <label for="cols">Number of columns:</label> >+ <input type="text" size="4" name="cols" id="cols" value="[% cols | html %]" /> >+ </li> >+ <li> >+ <label for="rows">Number of rows:</label> >+ <input type="text" size="4" name="rows" id="rows" value="[% rows | html %]" /> >+ </li> >+ <li> >+ <label for="col_gap">Gap between columns:</label> >+ <input type="text" size="4" name="col_gap" id="col_gap" value="[% col_gap | html %]" /> >+ </li> >+ <li> >+ <label for="row_gap">Gap between rows:</label> >+ <input type="text" size="4" name="row_gap" id="row_gap" value="[% row_gap | html %]" /> >+ </li> >+ </ol> >+ </fieldset> <!-- /.rows.mtt --> >+ </div> <!-- /.panel-body --> >+ </div> <!-- /.panel-collapse --> >+ </div> <!-- /.panel.panel-default --> > </div> <!-- /.panel-group#lang_lang --> > [% END %] > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33478
:
149743
|
149785
|
149786
|
149787
|
149914
|
149915
|
149916
|
149917
|
149918
|
149999
|
150000
|
150001
|
150002
|
150003
|
150004
|
150005
|
150006
|
150007
|
150008
|
150009
|
150010
|
150011
|
150012
|
150265
|
150266
|
150267
|
150268
|
150269
|
150270
|
150271
|
150272
|
150273
|
150274
|
150275
|
150276
|
150277
|
150324
|
150325
|
150326
|
150327
|
150328
|
150329
|
150330
|
150331
|
150332
|
150333
|
150334
|
150335
|
150336
|
150337
|
150338
|
150339
|
150340
|
150341
|
150342
|
150343
|
150344
|
150345
|
151548
|
151580
|
151581
|
151582
|
151583
|
151584
|
151585
|
151586
|
151587
|
151588
|
151589
|
151590
|
151591
|
151592
|
151593
|
156469
|
157368
|
157369
|
157370
|
157371
|
157372
|
157373
|
157374
|
157375
|
157376
|
157377
|
157378
|
157379
|
157380
|
157381
|
157382
|
157387
|
158835
|
158836
|
158837
|
158838
|
158839
|
158840
|
158841
|
158842
|
158843
|
158844
|
158845
|
158846
|
158847
|
158848
|
158849
|
158856
|
162556
|
162557
|
162558
|
162559
|
162560
|
162561
|
162562
|
162563
|
162564
|
162565
|
162566
|
162567
|
162568
|
162569
|
163903
|
163904
|
163905
|
163906
|
163907
|
163908
|
163909
|
163910
|
163911
|
163912
|
163913
|
163914
|
163915
|
163916
|
163924
|
163925
|
163926
|
163927
|
163928
|
163929
|
163930
|
163931
|
163932
|
163933
|
163934
|
163935
|
163936
|
163937
|
163938
|
164719
|
164720
|
164721
|
164722
|
164723
|
164724
|
164725
|
164726
|
164727
|
164728
|
164729
|
164730
|
164731
|
164732
|
164733
|
164741
|
164742
|
164743
|
164744
|
164745
|
164746
|
164747
|
164748
|
164749
|
164750
|
164751
|
164752
|
164753
|
164754
|
164755