Changeset 1525 for pykota/trunk
- Timestamp:
- 06/06/04 23:07:55 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 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) -
pykota/trunk/stylesheets/pykota.css
r1254 r1525 39 39 background-color: #AAAAAA; 40 40 } 41 42 a:link { 43 color : blue; 44 } 45 46 a:visited { 47 color : purple; 48 } 49 50 a:hover { 51 color : green; 52 } 53 54 a:active { 55 color : magenta; 56 }