Changeset 1277

Show
Ignore:
Timestamp:
01/12/04 16:12:50 (21 years ago)
Author:
jalet
Message:

Small fix for history

Location:
pykota/trunk/pykota
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/reporters/html.py

    r1274 r1277  
    2222# 
    2323# $Log$ 
     24# Revision 1.7  2004/01/12 15:12:50  jalet 
     25# Small fix for history 
     26# 
    2427# Revision 1.6  2004/01/12 14:35:01  jalet 
    2528# Printing history added to CGI script. 
     
    7982                    else :     
    8083                        oddevenclass = "warn" 
    81                 if not self.tool.config.getDisableHistory() : 
     84                if (not self.tool.config.getDisableHistory()) and (not self.isgroup) : 
    8285                    name = '<a href="%s?username=%s&printername=%s&history=1">%s</a>' % (os.environ.get("SCRIPT_NAME", ""), name, printer.Name, name) 
    8386                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 "&nbsp;", lifepagecounter, lifetimepaid)]))) 
  • pykota/trunk/pykota/storages/pgstorage.py

    r1275 r1277  
    2222# 
    2323# $Log$ 
     24# Revision 1.34  2004/01/12 15:12:50  jalet 
     25# Small fix for history 
     26# 
    2427# Revision 1.33  2004/01/12 14:44:47  jalet 
    2528# Missing space in SQL query 
     
    541544    def retrieveHistory(self, user=None, printer=None, datelimit=None, limit=100) :     
    542545        """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" 
    544547        where = [] 
    545548        if (user is not None) and user.Exists : 
     
    550553            where.append("jobdate<=%s" % self.doQuote(datelimit)) 
    551554        if where :     
    552             query += " WHERE %s" % " AND ".join(where) 
     555            query += " AND %s" % " AND ".join(where) 
    553556        query += " ORDER BY id DESC" 
    554557        if limit : 
     
    570573                job.JobOptions = fields.get("options") 
    571574                job.JobDate = fields.get("jobdate") 
    572                 job.User = self.getUser(fields.get("userid")) 
    573                 job.Printer = self.getPrinter(fields.get("printerid")) 
     575                job.User = self.getUser(fields.get("username")) 
     576                job.Printer = self.getPrinter(fields.get("printername")) 
    574577                job.Exists = 1 
    575578                jobs.append(job)