| Line 131... |
Line 131... |
| 131 |
sub filter_MVPid {
|
131 |
sub filter_MVPid {
|
| 132 |
my $colName = shift;
|
132 |
my $colName = shift;
|
| 133 |
my $filter = shift // "";
|
133 |
my $filter = shift // "";
|
| Line 134... |
Line 134... |
| 134 |
|
134 |
|
| 135 |
if ($filter) {
|
135 |
if ($filter) {
|
| 136 |
return $filter !~ /pass/ ? "$colName like '\%$filter\%'" : $filter eq "pass" ? "isnull($colName) = 0" : "isnull($colName) = 1";
|
136 |
return $filter =~ /^R-/ ? "$colName = '$filter'" : $filter eq "pass" ? "isnull($colName) = 0" : "isnull($colName) = 1";
|
| 137 |
} else {
|
137 |
} else {
|
| 138 |
my @options = ("", "pass", "no pass");
|
138 |
my @options = ("", "pass", "no pass");
|
| 139 |
my $dbh = getRCDBH;
|
139 |
my $dbh = getRCDBH;
|
| Line 140... |
Line 140... |
| 140 |
push @options, map { @{$_} } @{$dbh->selectall_arrayref ("select MVPid from RCid_ticket_link where year = year(now()) order by MVPid")};
|
140 |
push @options, map { @{$_} } @{$dbh->selectall_arrayref ("select MVPid from RCid_ticket_link where year = year(now()) order by MVPid")};
|
| 141 |
|
141 |
|
| 142 |
@options = map { $FORM{"filter-MVPid"} eq $_ ?
|
142 |
@options = map { $FORM{"filter-MVPid"} eq $_ ?
|
| Line 143... |
Line 143... |
| 143 |
( $h->option ({ selected=>[] }, $_) ) :
|
143 |
( $h->option ({ selected=>[] }, $_) ) :
|
| 144 |
( $h->option ( $_) ) } @options;
|
144 |
( $h->option ( $_) ) } @options;
|
| 145 |
|
145 |
|
| Line 146... |
Line 146... |
| 146 |
return $FORM{autoload} ? $h->input ({ name => "filter-MVPid", value=>$FORM{"filter-MVPid"}, list => "filter-MVPid", onChange=>"page.value = 1; submit();" }).$h->datalist ({ id => "filter-MVPid" }, [@options]) : $h->input ({ name => "filter-MVPid", value=>$FORM{"filter-MVPid"}, list => "filter-MVPid" }).$h->datalist ({ id => "filter-MVPid" }, [@options]);
|
146 |
return $FORM{autoload} ? $h->select ({ name=>"filter-MVPid", onChange=>"page.value = 1; submit();" }, [@options]) : $h->select ({ name=>"filter-MVPid" }, [$h->option (), @options]);
|
| 147 |
}
|
147 |
}
|