A Web Interface for REQ
A Free Problem-Tracking Program Gets a New Look
By Bryant Durrell
The startup company I'm working for has been using a program called req as a ticketing system to track our innumerable tasks. Req is a freely available request-tracking system that enables those with problems or questions to send requests through email, and allows a responsible group to record, track, and manage these requests in various ways. Written by Remy Evard, req is very popular and has been proven stable and reliable at several large installations. Req is a command-line tool and is written almost completely in Perl, which means it's easy to modify as needed.
We wanted to access the tracking database over the Web so that anyone could find out where their tickets were in the queue, what progress had been made, and so on. So, I was tasked with creating a Web interface to req, called Webreq. This article presents the results. In the process, I'll show how to quickly write a set of CGI scripts that generate HTML output from plain text, and turn HTML form input into a command line. The techniques I used are not specific to req; they can be used any time you need a Web interface to a database that doesn't include Web-oriented tools. Also, although I'm using Perl, you can make use of the techniques presented here even if you're not a Perl programmer.
I should also note that the programs I'm sharing could have been written more quickly and in much less space using Lincoln Stein's excellent CGI.pm library. CGI.pm includes functions for reading form input, outputting HTML, and other common CGI-related tasks.