--- db/prgsrc/updatedb.pl 2000/11/11 00:30:06 1.17 +++ db/prgsrc/updatedb.pl 2001/07/21 23:59:52 1.20 @@ -22,7 +22,7 @@ The database, user and password are hard Dmitry Rubinstein -=head1 $Id: updatedb.pl,v 1.17 2000/11/11 00:30:06 boris Exp $ +=head1 $Id: updatedb.pl,v 1.20 2001/07/21 23:59:52 boris Exp $ =cut @@ -70,8 +70,9 @@ sub getField { chomp $key; if ($key eq 'Дата') { $value =~ s/^(.*)-(.*)-(.*)$/$3-$2-$1/; - my($month) = $RevMonths{$2} || '000'; - $value =~ s/$2/$month/; + my($month) = $RevMonths{$2} || '01'; + $value =~ s/-(.*)-/-$month-/; + $value =~ s/-00*$/-01/; } $value = $dbh->quote($value); return ($key, $value); @@ -201,7 +202,7 @@ sub GetTours { sub CreateTour { my ($dbh,$title,$ParentId,$TourNum,$rh_defaults)=@_; my $sth = $dbh->prepare("INSERT INTO Tournaments - (Title, Type, ParentId, TourNum) + (Title, Type, ParentId, Number) VALUES ($title, 'Т', $ParentId, $TourNum)"); $sth->execute; my $TourId = $sth->{mysql_insertid}; @@ -292,7 +293,8 @@ MAIN: if ($key =~ /Вопрос/) { if (!$TourId) { $qnum = 0; - $TourId=CreateTour($dbh,'1',$TournamentId, + $TourNum++; + $TourId=CreateTour($dbh,'1',$TournamentId,$TourNum, \%TourDefaults); %QuestionDefaults=%QuestionGlobalDefaults; }