From upstream: missing fixes.
* UVrules.pm, usevote.rul: add H, h. * messages.cfg: add COUNT_ERR_GROUPCOUNT. * uvvote.pl: TMP/DIR, $msgid. Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
parent
ef29545875
commit
b00b7d6de5
4 changed files with 33 additions and 16 deletions
36
UVrules.pm
36
UVrules.pm
|
|
@ -149,10 +149,10 @@ sub read_rulefile {
|
|||
die $errortext . ": $_\n\n" if ($errortext);
|
||||
|
||||
# check for correct characters in conditions
|
||||
if ($if !~ /^[JjNnEeSsIi\.]+$/) {
|
||||
if ($if !~ /^[JjNnEeSsHhIi\.]+$/) {
|
||||
die UVmessage::get ("RULES_INVCHARS", (NUM=>$num+1, TYPE=>"if")) . ": $if\n\n";
|
||||
|
||||
} elsif ($then !~ /^[JjNnEeSsIi\.]+$/) {
|
||||
} elsif ($then !~ /^[JjNnEeSsHhIi\.]+$/) {
|
||||
die UVmessage::get ("RULES_INVCHARS",
|
||||
(NUM=>$num+1, TYPE=>"if")) . ": $then\n\n";
|
||||
}
|
||||
|
|
@ -194,8 +194,9 @@ sub read_rulefile {
|
|||
sub make_regex_pos {
|
||||
my $pat = $_[0];
|
||||
|
||||
$pat =~ s/[jens]/./g;
|
||||
$pat =~ s/[hijens]/./g;
|
||||
$pat =~ s/S/[JN]/g;
|
||||
$pat =~ s/H/[EJ]/g;
|
||||
$pat =~ s/I/[EN]/g;
|
||||
|
||||
return $pat;
|
||||
|
|
@ -216,22 +217,19 @@ sub make_regex_neg {
|
|||
|
||||
# upper case characters are replaced with dots
|
||||
# (are covered by make_regex_pos)
|
||||
$pat =~ s/[JENS]/./g;
|
||||
$pat =~ s/[HIJENS]/./g;
|
||||
|
||||
# reverse lower case characters
|
||||
$pat =~ s/j/[NE]/g;
|
||||
$pat =~ s/n/[JE]/g;
|
||||
$pat =~ s/e/[JN]/g;
|
||||
$pat =~ s/s/E/g;
|
||||
$pat =~ s/h/N/g;
|
||||
$pat =~ s/i/J/g;
|
||||
|
||||
# to be translated:
|
||||
# Falls keine Kleinbuchstaben vorkamen (es sind nur Punkte uebrig):
|
||||
# Wenn keine optionalen Forderungen vorhanden sind, wuerde der Regex
|
||||
# immer matchen und somit die Stimme immer als nicht passend erkannt
|
||||
# werden. Deswegen wird versucht auf den leeren String zu ueberpruefen,
|
||||
# was durch die Negation dazu fuehrt, dass die Stimme als passend
|
||||
# gewertet wird.
|
||||
# If the string contained only upper case characters they are now all
|
||||
# replaced with dots and the RegEx would match everything, i.e. declare
|
||||
# every vote as invalid. In this case an empty pattern is returned.
|
||||
$pat =~ s/^\.+$//;
|
||||
|
||||
return $pat;
|
||||
|
|
@ -305,6 +303,10 @@ sub rule_print {
|
|||
$fill = " $and ";
|
||||
$text1 = UVmessage::get ("RULES_IFCLAUSE",
|
||||
(VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'H') {
|
||||
$fill = " $and ";
|
||||
$text1 = UVmessage::get ("RULES_IFCLAUSE",
|
||||
(VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'I') {
|
||||
$fill = " $and ";
|
||||
$text1 = UVmessage::get ("RULES_IFCLAUSE",
|
||||
|
|
@ -322,6 +324,10 @@ sub rule_print {
|
|||
$fill = " $or ";
|
||||
$text1 = UVmessage::get ("RULES_IFCLAUSE",
|
||||
(VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'h') {
|
||||
$fill = " $or ";
|
||||
$text1 = UVmessage::get ("RULES_IFCLAUSE",
|
||||
(VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'i') {
|
||||
$fill = " $or ";
|
||||
$text1 = UVmessage::get ("RULES_IFCLAUSE",
|
||||
|
|
@ -357,6 +363,10 @@ sub rule_print {
|
|||
$fill = " $and ";
|
||||
$text1 = UVmessage::get ("RULES_THENCLAUSE",
|
||||
(VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'H') {
|
||||
$fill = " $and ";
|
||||
$text1 = UVmessage::get ("RULES_THENCLAUSE",
|
||||
(VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'I') {
|
||||
$fill = " $and ";
|
||||
$text1 = UVmessage::get ("RULES_THENCLAUSE",
|
||||
|
|
@ -374,6 +384,10 @@ sub rule_print {
|
|||
$fill = " $or ";
|
||||
$text1 = UVmessage::get ("RULES_THENCLAUSE",
|
||||
(VOTE=>"$yes $or $no", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'h') {
|
||||
$fill = " $or ";
|
||||
$text1 = UVmessage::get ("RULES_THENCLAUSE",
|
||||
(VOTE=>"$abst $or $yes", GROUP=>$groups[$i]));
|
||||
} elsif ($rule[$i] eq 'i') {
|
||||
$fill = " $or ";
|
||||
$text1 = UVmessage::get ("RULES_THENCLAUSE",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue