Changeset 1277
- Timestamp:
- 01/12/04 16:12:50 (21 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/reporters/html.py
r1274 r1277 22 22 # 23 23 # $Log$ 24 # Revision 1.7 2004/01/12 15:12:50 jalet 25 # Small fix for history 26 # 24 27 # Revision 1.6 2004/01/12 14:35:01 jalet 25 28 # Printing history added to CGI script. … … 79 82 else : 80 83 oddevenclass = "warn" 81 if not self.tool.config.getDisableHistory() :84 if (not self.tool.config.getDisableHistory()) and (not self.isgroup) : 82 85 name = '<a href="%s?username=%s&printername=%s&history=1">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), name, printer.Name, name) 83 86 self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % h for h in (name, reached, pagecounter, soft, hard, balance, datelimit or " ", lifepagecounter, lifetimepaid)]))) -
pykota/trunk/pykota/storages/pgstorage.py
r1275 r1277 22 22 # 23 23 # $Log$ 24 # Revision 1.34 2004/01/12 15:12:50 jalet 25 # Small fix for history 26 # 24 27 # Revision 1.33 2004/01/12 14:44:47 jalet 25 28 # Missing space in SQL query … … 541 544 def retrieveHistory(self, user=None, printer=None, datelimit=None, limit=100) : 542 545 """Retrieves all print jobs for user on printer (or all) before date, limited to first 100 results.""" 543 query = "SELECT * FROM jobhistory"546 query = "SELECT jobhistory.*,username,printername FROM jobhistory,users,printers WHERE users.id=userid AND printers.id=printerid" 544 547 where = [] 545 548 if (user is not None) and user.Exists : … … 550 553 where.append("jobdate<=%s" % self.doQuote(datelimit)) 551 554 if where : 552 query += " WHERE%s" % " AND ".join(where)555 query += " AND %s" % " AND ".join(where) 553 556 query += " ORDER BY id DESC" 554 557 if limit : … … 570 573 job.JobOptions = fields.get("options") 571 574 job.JobDate = fields.get("jobdate") 572 job.User = self.getUser(fields.get("user id"))573 job.Printer = self.getPrinter(fields.get("printer id"))575 job.User = self.getUser(fields.get("username")) 576 job.Printer = self.getPrinter(fields.get("printername")) 574 577 job.Exists = 1 575 578 jobs.append(job)