Changeset 2220
- Timestamp:
- 04/28/05 09:20:20 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/cgi-bin/printquota.cgi
r2210 r2220 183 183 else : 184 184 hostname = None 185 if self.form.has_key("billingcode") : 186 billingcode = self.form["billingcode"].value 187 else : 188 billingcode = None 185 189 self.report = ["<h2>%s</h2>" % _("History")] 186 history = self.storage.retrieveHistory(user, printer, datelimit, hostname )190 history = self.storage.retrieveHistory(user, printer, datelimit, hostname, billingcode) 187 191 if not history : 188 192 self.report.append("<h3>%s</h3>" % _("Empty")) … … 213 217 else : 214 218 hostname_url = None 215 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, job.JobMD5Sum, job.JobBillingCode, job.JobPages)]))) 219 if job.JobBillingCode : 220 billingcode_url = '<a href="%s?%s">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), urllib.urlencode({"history" : 1, "billingcode" : job.JobBillingCode}), job.JobBillingCode) 221 else : 222 billingcode_url = None 223 self.report.append('<tr class="%s">%s</tr>' % \ 224 (oddevenclass, \ 225 "".join(["<td>%s</td>" % (h or " ") \ 226 for h in (job.JobDate[:19], \ 227 job.JobAction, \ 228 username_url, \ 229 printername_url, \ 230 hostname_url, \ 231 job.JobId, \ 232 job.JobSize, \ 233 job.JobPrice, \ 234 job.JobCopies, \ 235 job.JobSizeBytes, \ 236 job.PrinterPageCounter, \ 237 job.JobTitle, \ 238 job.JobFileName, \ 239 job.JobOptions, \ 240 job.JobMD5Sum, \ 241 billingcode_url, \ 242 job.JobPages)]))) 216 243 self.report.append('</table>') 217 244 dico = { "history" : 1, -
pykota/trunk/NEWS
r2219 r2220 24 24 - 1.22alpha8 : 25 25 26 - Clicking on the billing code in printquota.cgi's job history 27 now shows all jobs matching this billing code. 28 26 29 - Fixed the dump in CUPS' page_log format which didn't 27 30 dump the oldest entry. -
pykota/trunk/pykota/storages/sql.py
r2218 r2220 498 498 self.doModify("DELETE FROM printergroupsmembers WHERE groupid=%s AND printerid=%s" % (self.doQuote(pgroup.ident), self.doQuote(printer.ident))) 499 499 500 def retrieveHistory(self, user=None, printer=None, datelimit=None, hostname=None, limit=100) :500 def retrieveHistory(self, user=None, printer=None, datelimit=None, hostname=None, billingcode=None, limit=100) : 501 501 """Retrieves all print jobs for user on printer (or all) before date, limited to first 100 results.""" 502 502 query = "SELECT jobhistory.*,username,printername FROM jobhistory,users,printers WHERE users.id=userid AND printers.id=printerid" … … 508 508 if hostname is not None : 509 509 where.append("hostname=%s" % self.doQuote(hostname)) 510 if billingcode is not None : 511 where.append("billingcode=%s" % self.doQuote(self.userCharsetToDatabase(billingcode))) 510 512 if datelimit is not None : 511 513 where.append("jobdate<=%s" % self.doQuote(datelimit))