Subversion Repositories VORC

Rev

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

Rev 81 Rev 82
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" or $department eq "ANN") 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" and !$leadership_change) {
698
    	my $dept_table = $department eq 'OFF' ? "v_shift_officiating" : "v_shift_announcer";
698
    	my $dept_table = $department eq 'OFF' ? "v_shift_officiating" : "v_shift_announcer";
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);
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);
700
  		my $full_length_max = getSetting("MAX_FULL_LENGTH_SIGNUP_".$department);
701
  		if ($full_length_count >= $full_length_max) {
701
  		if ($full_length_count >= $full_length_max) {
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";
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";