Show job submission time on CUPS
authorJamie Cameron <jcameron@webmin.com>
Mon, 17 Nov 2008 19:14:00 +0000 (19:14 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 17 Nov 2008 19:14:00 +0000 (19:14 +0000)
lpadmin/CHANGELOG
lpadmin/cups-lib.pl

index fd22150..ddc789e 100644 (file)
@@ -13,3 +13,5 @@ Added checkboxes and a button for deleting multiple printers at once.
 Fixed a bug that stopped SMB printer usernames and passwords from being displayed when editing a printer under CUPS.
 ---- Changes since 1.380 ----
 Re-designed the print jobs page to allow several to be cancelled at once, using the standard Webmin table with checkboxes.
+---- Changes since 1.440 ----
+Show the date and time a job was submitted on systems using CUPS.
index 13602e1..7ac54f9 100644 (file)
@@ -138,10 +138,17 @@ while(<LPQ>) {
                while($f = readdir(DIR)) {
                        if ($f =~ /^d(\d+)\-(\d+)$/ && $1 == $job{'id'}) {
                                push(@pq, "$d/$f");
+                               local @st = stat("$d/$f");
+                               if (@st) {
+                                       $job{'time'} ||= $st[9];
+                                       }
                                }
                        }
                closedir(DIR);
                $job{'printfile'} = @pq ? \@pq : undef;
+               if ($job{'time'}) {
+                       $job{'when'} = &make_date($job{'time'});
+                       }
                push(@jobs, \%job);
                }
        }