Subversion Repositories VORC

Rev

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

Rev 65 Rev 105
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 =~ /^R-/ ? "$colName = '$filter'" : $filter eq "pass" ? "isnull($colName) = 0" : "isnull($colName) = 1";
136
		return $filter !~ /pass/ ? "$colName like '\%$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 order by MVPid")};
140
    push @options, map { @{$_} } @{$dbh->selectall_arrayref ("select MVPid from RCid_ticket_link 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->select ({ name=>"filter-MVPid", onChange=>"page.value = 1; submit();" }, [@options]) : $h->select ({ name=>"filter-MVPid" }, [$h->option (), @options]);
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]);
147
  }
147
  }
Line 173... Line 173...
173
		$YEAR = param($_);
173
		$YEAR = param($_);
174
		next;
174
		next;
175
	}
175
	}
Line 176... Line 176...
176
 
176
 
-
 
177
	$FORM{$_} = param($_);				# Retrieve all of the FORM data submitted
Line 177... Line 178...
177
	$FORM{$_} = param($_);				# Retrieve all of the FORM data submitted
178
	#warn "$_: $FORM{$_}";
178
	
179
	
179
	if ((/^filter/) and ($FORM{$_} ne '')) {	# Build a set of filters to apply
180
	if ((/^filter/) and ($FORM{$_} ne '')) {	# Build a set of filters to apply
180
		my ($filter,$field) = split /-/, $_;		
181
		my ($filter,$field) = split /-/, $_;