Subversion Repositories VORC

Rev

Rev 78 | Rev 82 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 78 Rev 81
Line 692... Line 692...
692
  } else {
692
  } else {
693
   	$daily_count = signUpCount ('get', $user_id, $department);
693
   	$daily_count = signUpCount ('get', $user_id, $department);
694
   	if ($change eq "add" and $daily_count >= $MAXSHIFTS and !$leadership_change) {
694
   	if ($change eq "add" and $daily_count >= $MAXSHIFTS and !$leadership_change) {
695
   		return "<br>Denied! You may only sign up for $MAXSHIFTS $game_type shifts in one day!<br>\n";
695
   		return "<br>Denied! You may only sign up for $MAXSHIFTS $game_type shifts in one day!<br>\n";
696
   	}
696
   	}
697
#   	if ($change eq "add" and $game_based eq "game" and $department eq "OFF" and $game_type eq "full length") {
697
   	if ($change eq "add" and $game_based eq "game" and ($department eq "OFF" or $department eq "ANN") and $game_type eq "full length") {
-
 
698
    	my $dept_table = $department eq 'OFF' ? "v_shift_officiating" : "v_shift_announcer";
698
#    	my ($full_length_count) = $dbh->selectrow_array ("select count(*) from v_shift_officiating where RCid = ? and gtype = 'full length' and date > '2023-01-01'", undef, $user_id);
699
    	my ($full_length_count) = $dbh->selectrow_array ("select count(*) from $dept_table where RCid = ? and gtype = 'full length' and year(date) = year(now())", undef, $user_id);
-
 
700
  		my $full_length_max = getSetting("MAX_FULL_LENGTH_SIGNUP_".$department);
699
#  		if ($full_length_count >= 3) {
701
  		if ($full_length_count >= $full_length_max) {
700
#  			return "<br>Denied! You may only sign up to officiate 3 $game_type games (total)!<br>\n";
702
  		  my $errormsg = "<br>Denied! You may only sign up to ".($department eq 'OFF' ? "officiate" : "announce")." $full_length_max $game_type game(s) (total)!<br>\n";
-
 
703
  			return $errormsg;
701
#  		}  
704
  		}  
702
#    }
705
    }
703
  }
706
  }
Line 704... Line 707...
704
  
707
  
705
 	my @DBARGS;
708
 	my @DBARGS;
706
  if ($game_based eq "game" or $game_based eq "class") {
709
  if ($game_based eq "game" or $game_based eq "class") {