The CGI can appear at a URL, provided that:
E.g. if
https://www.cs.uwaterloo.ca/cscf/internal/request_beta
invokes the CGI (by whatever means), then
https://www.cs.uwaterloo.ca/cscf/internal/request_beta/Queue
will invoke the "beta" version, with an action of "Queue", which will assume that
https://www.cs.uwaterloo.ca/cscf/internal/ST/beta/doc/
exists.
The actions to perform are determined either by the value of the CGI "display" variable, or by the action being appended to the CGI URL as described above. E.g.
is equivalent to
"display" overrides whatever action is appended (if any).
Not all actions are determined by "display", there are other variables that cause things to happen.
Possible actions are:
- Welcome
- displays selections suitable for client use, common to all organizations, followed by organization specific text.
- Login
- becoming obsolete.
- Logout
- becoming obsolete.
- DisplayRequest
- display a request, not for updating.
- DisplayARequest
- asks for the number of the request to display.
- UpdateRequest
- display a request to allow updating.
- UpdateARequest
- asks for the number of the request to display.
- Queue
- displays a selected subset of all records.
- WorkForMe
- like "Queue" above, with "search_sql" set to select items for which the invoker is a requestor, defaulting to open items, and "banner" defaulting appropriately, Used in pages describing how to see one's requests.
- OwnersQueue
- like "Queue" above, with "q_person" set to the userid and name of the invoker's queue to display, defaulting to open items. Both lead as owner or responsible are selected.
- CreateRequest
- create a request based upon CGI variables set if the form is submitted, else display the request creation form.
- SetReply
- compose a mail message, defaulting to the record requesters.
- WorkFlow
- displays a graph of records opening/closing over time.
- Activity
- a report of recent transactions. Looks unused.
- Statistics
- shows a cross product of two fields, defaulting to Sponsors vs Department. A debugging tool.
- DumpAuth
- shows information about current authentication. A debugging tool.
- DumpEnv
- shows environment provided to the CGI. A debugging tool.
- None
or a serial number to display.
displayFirst, if present, is an action to be performed before what's actually in "display". It's handy when performing a subaction that should return to the action that caused it, e.g. a "Login".
displayNext, if present, is an action to be done first in the 2nd "display" step of the CGI, unlike the above which takes effect in the 1st action step. That's currently (2011/09) to allow the "DisplayRequest" rather than "UpdateRequest" to be the "display" step after "CreateRequest", even when it would recommend otherwise, to facilitate printing!
An SQL "where clause" is used for both selecting records of interest, and transactions of interest. For the former, the "each_req" table is assumed, although an explicit reference to the "transactions" table will cause a join between the two tables. For transaction selection, the "transactions" table is assumed.
This "where clause" can also include a reference to functions that are evaluated in place before the where clause is used as SQL. Currently that's just
This is the queue display subset of the CGI interface. At very least, add new CGI variables here. These work if the "display" CGI variable is set to "Queue", or equivalently, "/Queue" is appended to the URL.
After records are selected, each is replaced by related records determined by the following parameters. The result is the union of the sets described by the parameters. The default is to perform no replacement. Replacements are used to show all or parts of a "project".
0 | => no display |
1 | => display just the ultimate parents of selected items, if there are any; an item can be it's own parent (many are) |
-1 | => display ultimate parent(s) and all children; this can include more than the descendants of selected items |
0 | => include no ancestors |
1 | => include all immediate ancestors of selected items |
-1 | => include all ancestors of selected items |
0 | => don't include the selected items |
1 | => include the selected items |
0 | => include no dependencies |
1 | => include the immediate children of the selected items |
-1 | => include all of children of the selected items |
An optional SQL where clause to constrain the selection of relatives specified by any of the q_display_*_depth parameters, as well as the relatives used to compute summed fields (e.g. "Last+").
It's typically used to apply similar constraints to relatives as were applied to the original record selections (e.g. only "open" records). It defaults to adding open requests, not in the "test queue", with one exception. When selecting related records when no relative selections have been specified (via q_*_depth), it defaults to no constraints. That's done to allow simple queries to work as expected, i.e. with no other constraints than the query, and summed fields to work as expected, i.e. to default to open dependencies.
These defaults, for the "status" and "queue_id" field, can be overridden by providing explicit alternatives. The most common of these is "status = status", which effectively removes the default for "status".
q_sort=date_created-year,date_acted-term
would sort by creation date, then date of last change.
and then would group records by term within each year.
The sort fields do not affect the order of records related by the q_display_*_depth parameters above. A family of records remains together, following the "head" of the family, with an empty title.
0 an ascending sort 1 a descending sort
It affects the sort order for all fields in q_sort.
- transaction_select
- A where clause that acts on the transactions table to select which transactions to display. It should result in a number or "" (i.e. TRUE or FALSE). It defaults to all transactions for a record display, and no transactions for a queue display. It's used for these actions:
- Queue
- DisplayRequest
- UpdateRequest
- transaction_describe
- The additional text to follow the "Transactions" heading to describe what the transaction_select parameter is selecting. It's used for the same set of actions.
- oldest_transaction: to include in the queue display
- The age (in seconds) of the oldest transaction to display, where age is measured via &date_last_worked(), or <0 if we want them all. This is deprecated in favour of the transaction_select parameter.
- newest_transaction: to include in the queue display.
- The age (in seconds) of the newest transaction to display, where age is measured via &date_last_worked(), or <0 if we want them all. This is deprecated in favour of the transaction_select parameter.
- actor_displayed: userid to restrict transaction display
- The userid to restrict transaction display to. An empty string is treated as undefined, i.e. doesn't restrict the display. This is deprecated in favour of the transaction_select parameter.
- transaction_difference_select
- A where clause to select the transactions used to compute a history field (trailing "-" fieldname syntax, e.g. time_worked-). It should result in a number or "" (i.e. TRUE or FALSE). It defaults to all transactions for a record display, and no transactions for a queue display.
- q_columns: names of the columns to display.
- A comma separated list of column names. Many columns have multiple names, that affect the detail used in the column values. There are so many, that for now, the reader is referred to the %display_queue_column_info in lib/rt/ui/web/rtuser2.pm in the source.
- q_exploded_sort: use an "exploded sort".
- If "1", multi-valued (sort) fields are converted to multiple records with single-valued fields.
There are parameters that generally modify the behaviour of multiple actions.
The default verbosity depends upon the context of the data being displayed. E.g. titles are usually more verbose than column data.
For example:<action>: <perm>
would reduce the permissions of a computing staff member to those typically used for a consultant or co-op student. See the schema description of the queue_acl table for details of possible values. Attempts to increase permissions are silently ignored.reply: 3, summary: 3, history: 3 manipulate: 0, admin: 0
The actions CreateRequest and UpdateRequest both use variables of the form
for providing defaults and/or new values for form fields that happen to directly correspond to (internal) fieldnames. E.g. settingReqNewField_fieldname
will cause the "owner" field to be displayed in the request creation form with a default of "Larry", or set to "Larry" when invoking the request update action. There are some form values that aren't identical to internal database values, which (therefore) don't use names of the above form.ReqNewField_owner=Larry
ReqNewField_owner=MyUserid