Skip to content

Commit

Permalink
Merge pull request #3917 from mbab/hmany
Browse files Browse the repository at this point in the history
small code update
  • Loading branch information
APMarcello3 authored Jul 2, 2024
2 parents 56832cd + 3124c16 commit b6b1959
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions web/cgi-bin/DivinumOfficium/RunTimeOptions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ sub unequivocal {
my @r = grep {/$value/} @values_array;

if (@r == 1) {
return $r[0];
return $r[0] =~ s/.*\///r;
} else {
@r = grep { $_ eq $value } @values_array;

if (@r == 1) {
return $r[0];
return $r[0] =~ s/.*\///r;
} else {
return;
}
Expand All @@ -45,7 +45,7 @@ use constant LEGACY_VERSION_NAMES => {
sub check_version {
my $v = shift;

LEGACY_VERSION_NAMES->{$v} || unequivocal($v, 'versions') =~ s/.*\///r;
LEGACY_VERSION_NAMES->{$v} || unequivocal($v, 'versions');
}

sub check_horas {
Expand All @@ -57,7 +57,7 @@ sub check_horas {
sub check_language {
my $l = shift;

unequivocal($l, 'languages') =~ s/.*\///r;
unequivocal($l, 'languages');
}

1;
2 changes: 1 addition & 1 deletion web/cgi-bin/horas/horas.pl
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ sub setlink {
} elsif ($expand =~ /skeleton/i) {
$name = setfont($largefont, substr($name, 0, 1)) . setfont($redfont, substr($name, 1));
} else {
$name = setfont($largefont, substr($name, 0, 1)) . substr($name, 1);
$name = setfont($largefont, uc(substr($name, 0, 1))) . substr($name, 1);
}
return "$t$name$after";
}
Expand Down
6 changes: 3 additions & 3 deletions web/cgi-bin/horas/officium.pl
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ package main;

if ($command =~ s/changeparameters//) { getsetupvalue($command); }

$version = check_version($version);
$lang1 = check_language($lang1);
$lang2 = check_language($lang2);
$version = check_version($version) || (error("Unknown version: $version") && 'Rubrics 1960 - 1960');
$lang1 = check_language($lang1) || (error("Unknown language: $lang1") && 'Latin');
$lang2 = check_language($lang2) || 'English';

our $plures = strictparam('plures');
my @horas = ();
Expand Down
2 changes: 1 addition & 1 deletion web/cgi-bin/horas/officium_html.pl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub headline {
# add warning for older Monastic versions temporarily
$output .=
"<H2><FONT COLOR=RED SIZE=+1>Please note that the database for this version ($vers) is still incomplete and under construction.</FONT></H2>\n"
if $vers =~ /1617|1930/;
if $vers =~ /1617|1930|1962/;

if ($variant eq 'P') {
$output .= par_c(<< "PrintTag");
Expand Down
8 changes: 4 additions & 4 deletions web/cgi-bin/horas/specials.pl
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ sub specials {
my %brevis = %{setupstring($lang, 'Psalterium/Prima Special.txt')};
my $name =
($dayname[0] =~ /(Quad5|Quad6)/i) ? 'Quad5'
: ($dayname[0] =~ /Quad/i && $dayname[0] !~ /Quadp/i) ? 'Quad'
: ($dayname[0] =~ /Quadp[3]/i && $dayofweek >= 3 && $version !~ /1960/) ? 'Feria'
: ($dayname[0] =~ /Quad(?!p)/i) ? 'Quad'
: ($dayname[0] =~ /Quadp[3]/i && $dayofweek >= 3 && $version !~ /196/) ? 'Feria'
: ($dayname[0] =~ /Adv/i) ? 'Adv'
: ($dayname[0] =~ /Pasc6/i || ($dayname[0] =~ /Pasc5/i && $dayofweek > 3)) ? 'Asc'
: ($dayname[0] =~ /Pasc[0-6]/i) ? 'Pasc'
: ($dayname[0] =~ /Pasc7/i) ? Pent
: 'Per Annum';

if ($version =~ /1960/) {
if ($version =~ /196/) {
my $d = ($dayname[0] =~ /Nat/i) ? $dayname[0] : "$dayname[0]-$dayofweek";
if ($d =~ /Nat/i) { $name = 'Nat'; }

Expand All @@ -362,7 +362,7 @@ sub specials {
setbuild('Psalterium/Prima Special', $name, 'Lectio brevis ord');

#look for [Lectio Prima]
if ($version !~ /(1955|1960)/) {
if ($version !~ /(1955|196)/) {
%w = (columnsel($lang)) ? %winner : %winner2;
my $b = '';

Expand Down

0 comments on commit b6b1959

Please sign in to comment.