Changeset 909


Ignore:
Timestamp:
08/17/17 16:17:38 (7 years ago)
Author:
Kris Deugau
Message:

/trunk

Promote single-letter type searches to "class" searches
Add filtering on "available"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/search-rpc.cgi

    r908 r909  
    162162
    163163  if ($args{type}) {
     164    # assume alloctype class if we only get one letter
     165    $args{type} = "_$args{type}" if $args{type} =~ /^.$/;
    164166    my $notflag = '';
    165167    if ($args{type} =~ /^NOT:/) {
     
    235237  }
    236238
     239  # Filter on "available", because we can.
     240  if ($args{available} && $args{available} =~ /^[yn]$/) {
     241    push @fields, "s.available";
     242    push @matchtypes, '=';
     243    push @vals, $args{available};
     244  }
     245
    237246  my $cols = "s.cidr, s.custid, s.type, s.city, s.description, s.id, s.parent_id, s.available, s.vrf, a.dispname";
    238247  my $sql = qq(SELECT $cols FROM searchme s JOIN alloctypes a ON s.type = a.type);
Note: See TracChangeset for help on using the changeset viewer.