Subversion Repositories PEEPS

Rev

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

Rev 25 Rev 31
Line 41... Line 41...
41
# Set any custom "where" DB filters here...
41
# Set any custom "where" DB filters here...
42
my @whereClause;
42
my @whereClause;
Line 43... Line 43...
43
 
43
 
44
my $newleaguebutton;
44
my $newleaguebutton;
-
 
45
if ($ORCUSER->{SYSADMIN}) {
45
if ($ORCUSER->{SYSADMIN}) {
46
  $COLUMNS{alcohol_liability_eligible} = ["AL Eligible",   64,    "select"];
46
  $COLUMNS{visible} = [qw(Visible   65    select)];
47
  $COLUMNS{visible} = [qw(Visible   65    select)];
47
  $newleaguebutton = 1;
48
  $newleaguebutton = 1;
48
} else {
49
} else {
49
  push @whereClause, "visible = 1";
50
  push @whereClause, "visible = 1";
Line 61... Line 62...
61
sub modify_visible {
62
sub modify_visible {
62
  my $thing = shift;
63
  my $thing = shift;
63
  return $thing->{visible} ? "True" : "False";
64
  return $thing->{visible} ? "True" : "False";
64
}
65
}
Line -... Line 66...
-
 
66
 
-
 
67
sub modify_alcohol_liability_eligible {
-
 
68
  my $thing = shift;
-
 
69
  return $thing->{alcohol_liability_eligible} ? "True" : "False";
-
 
70
}
65
 
71
 
66
# If we need to modify how a filter works, create a subroutine named "filter_$columnname"
72
# If we need to modify how a filter works, create a subroutine named "filter_$columnname"
Line 67... Line 73...
67
#    It will receive two fields, the field name and the current filter value (if any)
73
#    It will receive two fields, the field name and the current filter value (if any)
68
 
74
 
69
sub filter_visible {
75
sub filter_visible {
Line 70... Line 76...
70
  my $colName = shift;
76
  my $colName = shift;
71
  my $filter = shift;
77
  my $filter = shift;
-
 
78
  
-
 
79
  if (defined $filter)  {
-
 
80
    if ($filter eq "True") {
-
 
81
      return "$colName = 1";
-
 
82
    } elsif ($filter eq "False") {
-
 
83
      return "$colName = 0";
-
 
84
    }
-
 
85
  } else {    
-
 
86
    my $Options = $h->option ("", "True", "False");
-
 
87
    
-
 
88
    my $tmpfilter = getFilterValue ($colName);
-
 
89
    
-
 
90
    $Options =~ s/>($tmpfilter)/ selected>$1/;
-
 
91
    return "<SELECT name=filter-${colName} onChange='page.value = 1; submit();'>$Options</SELECT>";
-
 
92
  }
-
 
93
}
-
 
94
 
-
 
95
sub filter_alcohol_liability_eligible {
-
 
96
  my $colName = shift;
-
 
97
  my $filter = shift;
72
  
98
  
73
  if (defined $filter)  {
99
  if (defined $filter)  {
74
    if ($filter eq "True") {
100
    if ($filter eq "True") {
75
      return "$colName = 1";
101
      return "$colName = 1";
76
    } elsif ($filter eq "False") {
102
    } elsif ($filter eq "False") {