Ok, I have committed the cgi() SQL function by Brian Theado. I have changed the 
ticket report list slightly. The end result is you can now create a search 
interface for your ticket database.

First, changes to the ticket report list:

  1. If your report name begins with an underscore (_) then it is
     considered unable to run directly, thus, it does not appear 
     as a link. Copy, Edit, etc... links still appear to those with
     that security level.

  2. If you do not have new ticket report security, then ticket
     reports begining with an underscore are not even displayed to you.

Now, how to create a search interface?

First, create a search query, a simple one may be:

  SELECT (field list)
  WHERE title LIKE cgi('title')

Second, get the report number id of your new query. You can do this by moving 
your mouse over the edit link. The URL will include something such as ?rn=20 
(my case).

Third, edit your Page Header and add something like this at the very bottom:

  <th1>
  if { $current_page eq "reportlist"} {
    html "<p style='padding-left: 20px;'>Search existing tickets:\n"
    html "<form style='padding-left: 20px;' method='GET' 
action='$baseurl/rptview'>\n"
    html "<input type='hidden' name='rn' value='20'/>\n"
    html "Title: <input type='text' name='title'/>\n"
    html "<input type='submit'/>\n"
    html "</form></p>\n"
  }
  </th1>

You then wind up with a nice search form. You can of course make your search 
form simple like this example or go all out adding as many fields as you would 
like to your form, just be sure to update your query as well!

Jeremy

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to