/[gnatsweb]/gnatsweb/gnatsweb.pl
ViewVC logotype

Diff of /gnatsweb/gnatsweb.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.96 by gerald, Sat Aug 10 17:30:32 2002 UTC revision 1.97 by yngves, Tue Sep 17 13:20:42 2002 UTC
# Line 1837  sub query_page Line 1837  sub query_page
1837                         -values=>['Ignore Closed'],                         -values=>['Ignore Closed'],
1838                         -defaults=>['Ignore Closed']),                         -defaults=>['Ignore Closed']),
1839          "</td>\n</tr>\n",          "</td>\n</tr>\n",
1840            "<tr><td></td><td>",
1841            $q->checkbox_group(-name=>'originatedbyme',
1842                           -values=>['Originated by You'],
1843                           -defaults=>[]),
1844            "</td>\n</tr>\n",
1845          "<tr>\n<td>Synopsis Search:</td>\n<td>",          "<tr>\n<td>Synopsis Search:</td>\n<td>",
1846          $q->textfield(-name=>'synopsis',-size=>25),          $q->textfield(-name=>'synopsis',-size=>25),
1847          "</td>\n</tr>\n",          "</td>\n</tr>\n",
1848          "<tr>\n<td>Multi-line Text Search:</td>\n<td>",          "<tr>\n<td>Multi-line Text Search:</td>\n<td>",
1849          $q->textfield(-name=>'multitext',-size=>25),          $q->textfield(-name=>'multitext',-size=>25),
1850          "</td>\n</tr>\n",          "</td>\n</tr>\n",
         "<tr><td></td><td>",  
         $q->checkbox_group(-name=>'originatedbyme',  
                        -values=>['Originated by You'],  
                        -defaults=>[]),  
         "</td>\n</tr>\n",  
1851          "<tr valign=top>\n<td>Column Display:</td>\n<td>";          "<tr valign=top>\n<td>Column Display:</td>\n<td>";
1852    
1853    # 30/Mar/2001 yngves    # We operate internally with parameter names, not real-world
1854    # The 'number' field is always first in the @fieldnames array.    # fieldnames (see dtb's comment in field2param()).  This is for
1855    # If users were allowed to select it in this list, the PR number    # backward compatibility and should be dealt with properly at some
1856    # would appear twice in the Query Results table. We prevent this    # point by making Gnatsweb use the fieldnames set in dbconfig
1857    # by shifting 'number' out of the array.    # exclusively (XXX ??? !!! FIXME).  We want to use real fieldnames
1858    shift(@fieldnames);    # in the query page, so we construct a hash of (param , fieldname)
1859      # pairs to use in the scrolling_list. We also construct an array of
1860      # param names (@lcfields) which is fed to the scrolling_list in
1861      # order to keep the "natural" order of the fields. Merely using
1862      # keys() would cause fields to be listed in arbitrary order.
1863    my @lcfields;    my @lcfields;
1864      my %labels;
1865    foreach (@fieldnames)    foreach (@fieldnames)
1866    {    {
1867      if (fieldinfo($_, 'fieldtype') ne 'multitext')      if (fieldinfo($_, 'fieldtype') ne 'multitext')
1868      {      {
1869        push (@lcfields, field2param ($_));        my $param = field2param($_);
1870          $labels{$param} = $_;
1871          push (@lcfields, field2param($_));
1872      }      }
1873    }    }
1874    
1875    my(@columns) = split(' ', $global_prefs{'columns'} || '');    my(@columns) = split(' ', $global_prefs{'columns'} || '');
1876    @columns = @lcfields unless @columns;    @columns = keys(%labels) unless @columns;
1877    
1878      # The 'number' field is always first in the @lcfields array. If
1879      # users were allowed to select it in this list, the PR number would
1880      # appear twice in the Query Results table. We prevent this by
1881      # shifting 'number' out of the array.
1882      my(@sh_lcfields) = @lcfields;
1883      shift(@sh_lcfields);
1884    
1885    print $q->scrolling_list(-name=>'columns',    print $q->scrolling_list(-name=>'columns',
1886                             -values=>\@lcfields,                             -values=>\@sh_lcfields,
1887                               -labels=>\%labels,
1888                             -defaults=>\@columns,                             -defaults=>\@columns,
1889                             -multiple=>1,                             -multiple=>1,
1890                             -size=>5),                             -size=>5),
1891          "</td>\n</tr>\n",          "</td>\n</tr>\n";
1892    
1893      print "<tr valign=top>\n<td>Sort By:</td>\n<td>",
1894            $q->scrolling_list(-name=>'sortby',
1895                               -values=>\@fieldnames,
1896                               -multiple=>0,
1897                               -size=>1),
1898             "</td>\n</tr>\n",
1899          "<tr>\n<td></td>\n<td>",          "<tr>\n<td></td>\n<td>",
1900          $q->checkbox_group(-name=>'displaydate',          $q->checkbox_group(-name=>'displaydate',
1901                 -values=>['Display Current Date'],                 -values=>['Display Current Date'],
# Line 2015  sub advanced_query_page Line 2038  sub advanced_query_page
2038    print "</table>\n";    print "</table>\n";
2039    print "<div>&nbsp;</div>\n";    print "<div>&nbsp;</div>\n";
2040    
2041    ### Column selection    print "<table border=1 cellspacing=0 bgcolor=$cell_bg>\n",
2042    # 30/Mar/2001 yngves          "<caption>Display</caption>\n",
2043    # The 'number' field is always first in the @fieldnames array.          "<tr valign=top>\n<td>Display these columns:</td>\n<td>";
   # If users were allowed to select it in this list, the PR number  
   # would appear twice in the Query Results table. We prevent this  
   # by shifting 'number' out of the array.  
   shift(@fieldnames);  
2044    
2045      # We operate internally with parameter names, not real-world
2046      # fieldnames (see dtb's comment in field2param()).  This is for
2047      # backward compatibility and should be dealt with properly at some
2048      # point by making Gnatsweb use the fieldnames set in dbconfig
2049      # exclusively (XXX ??? !!! FIXME).  We want to use real fieldnames
2050      # in the query page, so we construct a hash of (param , fieldname)
2051      # pairs to use in the scrolling_list. We also construct an array of
2052      # param names (@lcfields) which is fed to the scrolling_list in
2053      # order to keep the "natural" order of the fields. Merely using
2054      # keys() would cause fields to be listed in arbitrary order.
2055    my @lcfields;    my @lcfields;
2056      my %labels;
2057    foreach (@fieldnames)    foreach (@fieldnames)
2058    {    {
2059      if (fieldinfo($_, 'fieldtype') ne 'multitext')      if (fieldinfo($_, 'fieldtype') ne 'multitext')
2060      {      {
2061        push (@lcfields, field2param ($_));        my $param = field2param($_);
2062          $labels{$param} = $_;
2063          push (@lcfields, field2param($_));
2064      }      }
2065    }    }
2066    my(@columns) = split(' ', $global_prefs{'columns'});  
2067    @columns = @lcfields unless @columns;    my(@columns) = split(' ', $global_prefs{'columns'} || '');
2068    print "<table border=1 cellspacing=0 bgcolor=$cell_bg>\n",    @columns = keys(%labels) unless @columns;
2069          "<caption>Display</caption>\n",  
2070          "<tr valign=top>\n<td>Display these columns:</td>\n<td>",    # The 'number' field is always first in the @lcfields array. If
2071          $q->scrolling_list(-name=>'columns',    # users were allowed to select it in this list, the PR number would
2072                             -values=>\@lcfields,    # appear twice in the Query Results table. We prevent this by
2073      # shifting 'number' out of the array.
2074      my(@sh_lcfields) = @lcfields;
2075      shift(@sh_lcfields);
2076    
2077      print $q->scrolling_list(-name=>'columns',
2078                               -values=>\@sh_lcfields,
2079                               -labels=>\%labels,
2080                             -defaults=>\@columns,                             -defaults=>\@columns,
2081                             -multiple=>1),                             -multiple=>1,
2082      "</td>\n</tr>\n<tr>\n<td colspan=2>",                             -size=>5),
2083            "</td>\n</tr>\n";
2084    
2085      print "<tr valign=top>\n<td>Sort By:</td>\n<td>",
2086            $q->scrolling_list(-name=>'sortby',
2087                               -values=>\@fieldnames,
2088                               -multiple=>0,
2089                               -size=>1),
2090             "</td>\n</tr>\n",
2091            "<tr>\n<td colspan=2>\n",
2092          $q->checkbox_group(-name=>'displaydate',          $q->checkbox_group(-name=>'displaydate',
2093                             -values=>['Display Current Date'],                 -values=>['Display Current Date'],
2094                             -defaults=>['Display Current Date']),                 -defaults=>['Display Current Date']),
2095            "</td>\n</tr>\n",
2096      "</td>\n</tr>\n</table>\n";      "</td>\n</tr>\n</table>\n";
2097    print "<div>&nbsp;</div>\n";    print "<div>&nbsp;</div>\n";
2098    ### Wrapup    ### Wrapup

Legend:
Removed from v.1.96  
changed lines
  Added in v.1.97

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26