'printing_type',
'layout_name',
'guidebox',
+ 'oblique_title',
'font',
'font_size',
'callnum_split',
printing_type => 'BAR',
layout_name => 'DEFAULT',
guidebox => 0,
+ oblique_title => 1,
font => 'TR',
font_size => 3,
callnum_split => 0,
'barcode_type',
'printing_type',
'guidebox',
+ 'oblique_title',
'font',
'font_size',
'callnum_split',
barcode_type => $params{'barcode_type'},
printing_type => $params{'printing_type'},
guidebox => $params{'guidebox'},
+ oblique_title => $params{'oblique_title'},
font => $params{'font'},
font_size => $params{'font_size'},
callnum_split => $params{'callnum_split'},
else {
$field->{'data'} = _get_barcode_data($field->{'code'},$item,$record);
}
- #FIXME: We should not force the title to oblique; this should be selectible in the layout configuration
- ($field->{'code'} eq 'title') ? (($font =~ /T/) ? ($font = 'TI') : ($font = ($font . 'O'))) : ($font = $font);
+ # Find apropriate font it oblique title selected, except main font is oblique
+ if ( ( $field->{'code'} eq 'title' ) and ( $self->{'oblique_title'} == 1 ) ) {
+ if ( $font =~ /^TB$/ ) {
+ $font .= 'I';
+ }
+ elsif ( $font =~ /^TR$/ ) {
+ $font = 'TI';
+ }
+ elsif ( $font !~ /^T/ and $font !~ /O$/ ) {
+ $font .= 'O';
+ }
+ }
my $field_data = $field->{'data'};
if ($field_data) {
$field_data =~ s/\n//g;
--- /dev/null
+ALTER TABLE creator_layouts ADD COLUMN oblique_title INT(1) NULL DEFAULT 1 AFTER guidebox;
+
+-- $DBversion = "3.21.00.XXX";
+-- if ( CheckVersion($DBversion) ) {
+-- $dbh->do(q|
+-- ALTER TABLE creator_layouts ADD COLUMN oblique_title INT(1) NULL DEFAULT 1 AFTER guidebox
+-- |);
+-- print "Upgrade to $DBversion done (Bug 12194: Add column oblique_title to layouts)\n";
+-- SetVersion($DBversion);
+-- }
$('#layout_string').hide();
}
}
+ function checkOblique() {
+ var font = document.getElementById("font");
+ var selectedfont = font.options[font.selectedIndex].value;
+ if ( selectedfont.match("I$") || selectedfont.match("O$") ) {
+ document.getElementById("oblique_title").disabled = true;
+ } else {
+ document.getElementById("oblique_title").disabled = false;
+ }
+ }
//]]>
</script>
</head>
</li>
<li>
<label for="font">Font: </label>
- <select name="font" id="font">
+ <select name="font" id="font" onchange="checkOblique()">
[% FOREACH font_type IN font_types %]
[% IF ( font_type.selected ) %]
<option value="[% font_type.type %]" selected="selected">[% font_type.name %]</option>
<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="font">Oblique title: </label>
+ [% IF ( oblique_title ) %]
+ <input type="checkbox" name="oblique_title" id="oblique_title" value="1" checked="checked" />
+ [% ELSE %]
+ <input type="checkbox" name="oblique_title" id="oblique_title" value="1" />
+ [% END %]
+ </li>
</ol>
</fieldset>
<fieldset class="action">
barcode_type => $layout->get_attr('barcode_type'),
printing_type => 'BIB',
guidebox => $layout->get_attr('guidebox'),
+ oblique_title => $layout->get_attr('oblique_title'),
font => $layout->get_attr('font'),
font_size => $layout->get_attr('font_size'),
callnum_split => $layout->get_attr('callnum_split'),
barcode_type => $layout->get_attr('barcode_type'),
printing_type => 'BAR',
guidebox => $layout->get_attr('guidebox'),
+ oblique_title => $layout->get_attr('oblique_title'),
font => $layout->get_attr('font'),
font_size => $layout->get_attr('font_size'),
callnum_split => $layout->get_attr('callnum_split'),
barcode_type => $layout->get_attr('barcode_type'),
printing_type => $layout->get_attr('printing_type'),
guidebox => $layout->get_attr('guidebox'),
+ oblique_title => $layout->get_attr('oblique_title'),
font => $layout->get_attr('font'),
font_size => $layout->get_attr('font_size'),
callnum_split => $layout->get_attr('callnum_split'),
printing_type => $cgi->param('printing_type') || 'BAR',
layout_name => $cgi->param('layout_name') || 'DEFAULT',
guidebox => ($cgi->param('guidebox') ? 1 : 0),
+ oblique_title => ($cgi->param('oblique_title') ? 1 : 0),
font => $cgi->param('font') || 'TR',
font_size => $cgi->param('font_size') || 3,
callnum_split => ($cgi->param('callnum_split') ? 1 : 0),
layout_id => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '',
layout_name => $layout->get_attr('layout_name'),
guidebox => $layout->get_attr('guidebox'),
+ oblique_title => $layout->get_attr('oblique_title'),
font_size => $layout->get_attr('font_size'),
callnum_split => $layout->get_attr('callnum_split'),
format_string => $layout->get_attr('format_string'),