IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 15, 2008, 1:56:02 PM (18 years ago)
Author:
eugene
Message:

adding min/max restriction ranges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/scripts/generate

    r15969 r18143  
    267267        $value = $field[$i];
    268268        if ($value eq "*") { next; }
    269         print FILE "\$WHERE = check_restrict ('$value', \$WHERE);\n";
     269        if ($format[$i] eq "%s") {
     270            print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'string');\n";
     271        } else {
     272            print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'min');\n";
     273            print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'max');\n";
     274        }
    270275    }
    271276    print FILE "\$WHERE = check_ordering (\$WHERE);\n";
     
    278283        $value = $field[$i];
    279284        if ($value eq "*") { next; }
    280         print FILE "\$buttonLink = button_restrict ('$value', \$buttonLink);\n";
    281     }
     285        if ($format[$i] eq "%s") {
     286            print FILE "\$buttonLink = button_restrict_string ('$value', \$buttonLink);\n";
     287        } else {
     288            print FILE "\$buttonLink = button_restrict_min ('$value', \$buttonLink);\n";
     289            print FILE "\$buttonLink = button_restrict_max ('$value', \$buttonLink);\n";
     290        }
     291    }
     292}
     293
     294# there are two query rows: the first is populated for both strings
     295# and numbers, the second only for numbers
     296sub write_table_query {
     297    my ($i);
     298
     299    print FILE "echo \"<tr>\\n\";\n";
     300    for ($i = 0; $i < @field; $i++) {
     301        if ($show[$i] eq "none")  { next; }
     302        if ($field[$i] eq "*")  {
     303            # * fields create an empty cell
     304            print FILE "echo \"<td> &nbsp; </td>\\n\";\n";
     305        } else {
     306            if ($format[$i] eq "%s") {
     307                print FILE "write_query_row ('$field[$i]', $width[$i], 'string');\n";
     308            } else {
     309                print FILE "write_query_row ('$field[$i]', $width[$i], 'min');\n";
     310            }
     311        }
     312    }
     313    print FILE "echo \"</tr> <tr>\\n\";\n";
     314    for ($i = 0; $i < @field; $i++) {
     315        if ($show[$i] eq "none")  { next; }
     316        if (($field[$i] eq "*") || ($format[$i] eq "%s")) {
     317            # * fields create an empty cell
     318            print FILE "echo \"<td class=\\\"list\\\"> &nbsp; </td>\\n\";\n";
     319        } else {
     320            print FILE "write_query_row ('$field[$i]', $width[$i], 'max');\n";
     321        }
     322    }
     323    print FILE "echo \"</tr>\\n\";\n";
    282324}
    283325
     
    342384}
    343385
    344 sub write_table_query {
    345     my ($i);
    346     for ($i = 0; $i < @field; $i++) {
    347         if ($show[$i] eq "none")  { next; }
    348         if ($field[$i] eq "*")  {
    349             # * fields create an empty cell
    350             print FILE "echo \"<td> &nbsp; </td>\\n\";\n";
    351         } else {
    352             print FILE "write_query_row ('$field[$i]', $width[$i]);\n";
    353         }
    354     }
    355 }
    356 
    357386sub define_fields_string {
    358387    my (@array) = @_;
Note: See TracChangeset for help on using the changeset viewer.