Index: /pykota/trunk/bin/cupspykota
===================================================================
--- /pykota/trunk/bin/cupspykota (revision 2054)
+++ /pykota/trunk/bin/cupspykota (revision 2057)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.86  2005/02/13 22:48:37  jalet
+# Added the md5sum to the history
+#
 # Revision 1.85  2005/02/13 22:02:28  jalet
 # Big database structure changes. Upgrade script is now included as well as
@@ -588,5 +591,8 @@
             
             # adds the current job to history    
-            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, jobsize, jobprice, self.preserveinputfile, self.title, self.copies, self.options, clienthost, self.jobSizeBytes)
+            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), \
+                                    action, jobsize, jobprice, self.preserveinputfile, \
+                                    self.title, self.copies, self.options, clienthost, \
+                                    self.jobSizeBytes, self.checksum)
             self.printMoreInfo(user, printer, _("Job added to history."))
             
Index: /pykota/trunk/bin/lprngpykota
===================================================================
--- /pykota/trunk/bin/lprngpykota (revision 2028)
+++ /pykota/trunk/bin/lprngpykota (revision 2057)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.14  2005/02/13 22:48:37  jalet
+# Added the md5sum to the history
+#
 # Revision 1.13  2005/01/17 08:44:23  jalet
 # Modified copyright years
@@ -177,5 +180,8 @@
             jobprice = userpquota.increasePagesUsage(jobsize)
             
-            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, jobsize, jobprice, self.preserveinputfile, self.title, self.copies, self.options, clienthost, self.jobSizeBytes)
+            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), \
+                                    action, jobsize, jobprice, self.preserveinputfile, \
+                                    self.title, self.copies, self.options, clienthost, \
+                                    self.jobSizeBytes, self.checksum)
             self.printMoreInfo(user, printer, _("Job added to history."))
             
@@ -193,5 +199,8 @@
             # here accounting was completed, either software, or hardware but over quota
         else :
-            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), action, filename=self.preserveinputfile, title=self.title, copies=self.copies, options=self.options, clienthost=clienthost, jobsizebytes=self.jobSizeBytes)
+            printer.addJobToHistory(self.jobid, user, self.accounter.getLastPageCounter(), \
+                                    action, filename=self.preserveinputfile, title=self.title, \
+                                    copies=self.copies, options=self.options, clienthost=clienthost, \
+                                    jobsizebytes=self.jobSizeBytes, self.checksum)
             self.logdebug("Job added to history during first pass : Job's size and price are still unknown.")
             
Index: /pykota/trunk/pykota/storages/sql.py
===================================================================
--- /pykota/trunk/pykota/storages/sql.py (revision 2054)
+++ /pykota/trunk/pykota/storages/sql.py (revision 2057)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.66  2005/02/13 22:48:38  jalet
+# Added the md5sum to the history
+#
 # Revision 1.65  2005/02/13 22:02:29  jalet
 # Big database structure changes. Upgrade script is now included as well as
@@ -565,5 +568,5 @@
         self.doModify("UPDATE jobhistory SET jobsize=%s, jobprice=%s WHERE id=%s" % (self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(lastjob.ident)))
         
-    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None) :
+    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None, jobmd5sum=None) :
         """Adds a job in a printer's history."""
         if self.privacy :    
@@ -575,10 +578,10 @@
         if (not self.disablehistory) or (not printer.LastJob.Exists) :
             if jobsize is not None :
-                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, hostname, jobsizebytes) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes)))
+                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, hostname, jobsizebytes, md5sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum)))
             else :    
-                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options, hostname, jobsizebytes) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes)))
+                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options, hostname, jobsizebytes, md5sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum)))
         else :        
             # here we explicitly want to reset jobsize to NULL if needed
-            self.doModify("UPDATE jobhistory SET userid=%s, jobid=%s, pagecounter=%s, action=%s, jobsize=%s, jobprice=%s, filename=%s, title=%s, copies=%s, options=%s, hostname=%s, jobsizebytes=%s, jobdate=now() WHERE id=%s" % (self.doQuote(user.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(printer.LastJob.ident)))
+            self.doModify("UPDATE jobhistory SET userid=%s, jobid=%s, pagecounter=%s, action=%s, jobsize=%s, jobprice=%s, filename=%s, title=%s, copies=%s, options=%s, hostname=%s, jobsizebytes=%s, md5sum=%s, jobdate=now() WHERE id=%s" % (self.doQuote(user.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum), self.doQuote(printer.LastJob.ident)))
             
     def writeUserPQuotaLimits(self, userpquota, softlimit, hardlimit) :
Index: /pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/ldapstorage.py (revision 2054)
+++ /pykota/trunk/pykota/storages/ldapstorage.py (revision 2057)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.101  2005/02/13 22:48:37  jalet
+# Added the md5sum to the history
+#
 # Revision 1.100  2005/02/13 22:02:29  jalet
 # Big database structure changes. Upgrade script is now included as well as
@@ -1234,5 +1237,5 @@
         self.doModify(lastjob.ident, fields)         
         
-    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None) :
+    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None, jobmd5sum=None) :
         """Adds a job in a printer's history."""
         if (not self.disablehistory) or (not printer.LastJob.Exists) :
@@ -1259,5 +1262,5 @@
                    "pykotaHostName" : str(clienthost), 
                    "pykotaJobSizeBytes" : str(jobsizebytes),
-                   # TODO : add the 3 missing fields
+                   "pykotaMD5Sum" : str(jobmd5sum),
                  }
         if (not self.disablehistory) or (not printer.LastJob.Exists) :
Index: /pykota/trunk/pykota/storage.py
===================================================================
--- /pykota/trunk/pykota/storage.py (revision 2054)
+++ /pykota/trunk/pykota/storage.py (revision 2057)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.69  2005/02/13 22:48:37  jalet
+# Added the md5sum to the history
+#
 # Revision 1.68  2005/02/13 22:02:29  jalet
 # Big database structure changes. Upgrade script is now included as well as
@@ -380,7 +383,7 @@
             raise AttributeError, name
             
-    def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None) :
+    def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None, clienthost=None, jobsizebytes=None, jobmd5sum=None) :
         """Adds a job to the printer's history."""
-        self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, clienthost, jobsizebytes)
+        self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options, clienthost, jobsizebytes, jobmd5sum)
         # TODO : update LastJob object ? Probably not needed.
         
