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";
}
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;
# 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;
$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",
$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",
$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",
$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",
# N eine NEIN-Stimme
# E eine Enthaltung
# S eine JA- oder NEIN-Stimme
+# H eine Enthaltung oder JA-Stimme
# I eine Enthaltung oder NEIN-Stimme
# . egal (Ja, nein oder Enthaltung)
# j eine oder mehrere der markierten Gruppen hat JA-Stimme
# n "" "" "" "" "" "" "" NEIN-Stimme
# e "" "" "" "" "" "" "" Enthaltung
# s "" "" "" "" "" "" "" Ja- oder Nein-Stimme
+# h "" "" "" "" "" "" "" Enthaltung oder Ja-Stimme
# i "" "" "" "" "" "" "" Enthaltung oder Nein-Stimme
#
# Alles klar? Jede Stimme wird mit den Symbolen verglichen, und wenn alle
#!/usr/bin/perl -w
###############################################################################
-# UseVoteGer 4.07 Wahldurchfuehrung
-# (c) 2001-2004 Marc Langer <uv@marclanger.de>
+# UseVoteGer 4.09 Wahldurchfuehrung
+# (c) 2001-2005 Marc Langer <uv@marclanger.de>
#
# This script package is free software; you can redistribute it and/or
# modify it under the terms of the GNU Public License as published by the
my $clean = 0;
my %opt_ctl = ();
-print "\n$usevote_version Wahldurchfuehrung - (c) 2001-2004 Marc Langer\n\n";
+print "\n$usevote_version Wahldurchfuehrung - (c) 2001-2005 Marc Langer\n\n";
# unknown parameters remain in @ARGV (for "help")
Getopt::Long::Configure(qw(pass_through bundling));
my $ext = time;
opendir (TMP, $config{tmpdir});
- my @tmpfiles = readdir (TMP);
+ my @tmpfiles = readdir (DIR);
closedir (TMP);
opendir (FERTIG, $config{archivedir});
my @fertigfiles = readdir (FERTIG);
my @header = split(/\n/, $entity->stringify_header);
my $head = $entity->head;
my $msgid = $head->get('Message-ID');
- chomp($msgid) if defined($msgid);
+ chomp($msgid) if ($msgid);
my @votes = (); # the votes
my @set; # interactively changed fields