Subversion Repositories VORC

Rev

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

Rev 71 Rev 72
Line 810... Line 810...
810
  }
810
  }
Line 811... Line 811...
811
	
811
	
812
	my $limit = getSetting ("MAX_SHIFT_SIGNUP_PER_DAY_".$dept);
812
	my $limit = getSetting ("MAX_SHIFT_SIGNUP_PER_DAY_".$dept);
Line 813... Line 813...
813
	$limit = getSetting ("MAX_SHIFT_SIGNUP_PER_DAY") unless defined $limit;
813
	$limit = getSetting ("MAX_SHIFT_SIGNUP_PER_DAY") unless defined $limit;
Line 814... Line 814...
814
	
814
	
Line 815... Line 815...
815
	if ($t->{type} eq "lead" and $dept eq "OFF") { $limit = 99; }
815
	if (lc $t->{type} eq "lead" and $dept eq "OFF") { $limit = 99; }
Line 837... Line 837...
837
#			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->{RCid});
837
#			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->{RCid});
838
#			if ($full_length_count >= 3) {
838
#			if ($full_length_count >= 3) {
839
#				return 0;
839
#				return 0;
840
#			}
840
#			}
841
#		}
841
#		}
842
    if ($t->{signup} ne "selected" and $user->{$limitkey} < $limit) {
842
    if (lc $t->{signup} ne "selected" and $user->{$limitkey} < $limit) {
843
			return 1;
843
			return 1;
844
		} else {
844
		} else {
845
			return 0;
845
			return 0;
846
		}
846
		}
847
	} else {
847
	} else {
Line 852... Line 852...
852
			my ($class_count) = $dbh->selectrow_array ("select count(*) from v_class_signup where RCid = ? and year(date) = year(now())", undef, $user->{RCid});
852
			my ($class_count) = $dbh->selectrow_array ("select count(*) from v_class_signup where RCid = ? and year(date) = year(now())", undef, $user->{RCid});
853
			return 0 unless $class_count < $class_limit;
853
			return 0 unless $class_count < $class_limit;
854
    } else {
854
    } else {
855
	    if ($user->{department}->{$dept} < 1) { return 0; }
855
	    if ($user->{department}->{$dept} < 1) { return 0; }
856
	  }
856
	  }
857
	  if ($t->{type} eq "lead" and $user->{department}->{$dept} < 2) { return 0; }
857
	  if (lc $t->{type} eq "lead" and $user->{department}->{$dept} < 2) { return 0; }
858
	  if ($t->{type} eq "manager" and $user->{department}->{$dept} < 3) { return 0; }
858
	  if (lc $t->{type} eq "manager" and $user->{department}->{$dept} < 3) { return 0; }
859
    if ($t->{type} !~ /^selected/ and $user->{$limitkey} < $limit) {
859
    if (lc $t->{type} !~ /^selected/ and $user->{$limitkey} < $limit) {
860
			return 1;
860
			return 1;
861
		} else {
861
		} else {
862
			return 0;
862
			return 0;
863
		}
863
		}
864
	}
864
	}