Changeset 1525 for pykota/trunk/cgi-bin
- Timestamp:
- 06/06/04 23:07:55 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/cgi-bin/printquota.cgi
r1524 r1525 23 23 # 24 24 # $Log$ 25 # Revision 1.29 2004/06/06 21:07:55 jalet 26 # Improved CGI script to allow history on printers and hostnames. 27 # Better (?) colors in stylesheet. 28 # 25 29 # Revision 1.28 2004/06/05 22:42:41 jalet 26 30 # Improved web history reports … … 266 270 else : 267 271 datelimit = None 272 if self.form.has_key("hostname") : 273 hostname = self.form["hostname"].value 274 else : 275 hostname = None 268 276 self.report = ["<h2>History</h2>"] 269 history = self.storage.retrieveHistory(user, printer, datelimit )277 history = self.storage.retrieveHistory(user, printer, datelimit, hostname) 270 278 if not history : 271 279 self.report.append("<h3>Empty</h3>") … … 285 293 elif job.JobAction == "WARN" : 286 294 oddevenclass = "warn" 287 username = '<a href="%s?%s">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode({"history" : 1, "username" : job.UserName}), job.UserName) 288 self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % (h or " ") for h in (job.JobDate[:19], job.JobAction, username, job.PrinterName, job.JobHostName, job.JobId, job.JobSize, job.JobPrice, job.JobCopies, job.JobSizeBytes, job.PrinterPageCounter, job.JobTitle, job.JobFileName, job.JobOptions)]))) 295 username_url = '<a href="%s?%s">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode({"history" : 1, "username" : job.UserName}), job.UserName) 296 printername_url = '<a href="%s?%s">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode({"history" : 1, "printername" : job.PrinterName}), job.PrinterName) 297 if job.JobHostName : 298 hostname_url = '<a href="%s?%s">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode({"history" : 1, "hostname" : job.JobHostName}), job.JobHostName) 299 else : 300 hostname_url = None 301 self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % (h or " ") for h in (job.JobDate[:19], job.JobAction, username_url, printername_url, hostname_url, job.JobId, job.JobSize, job.JobPrice, job.JobCopies, job.JobSizeBytes, job.PrinterPageCounter, job.JobTitle, job.JobFileName, job.JobOptions)]))) 289 302 self.report.append('</table>') 290 303 dico = { "history" : 1, … … 295 308 if printer and printer.Exists : 296 309 dico.update({ "printername" : printer.Name }) 310 if hostname : 311 dico.update({ "hostname" : hostname }) 297 312 prevurl = "%s?%s" % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode(dico)) 298 313 self.report.append('<a href="%s">Previous page</a>' % prevurl)