X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fqueue.pm;h=61cee0a8a5c1961bc11ad7b667996fc718cbaca6;hb=79721949b23e7052efdaacadcfb38e6a8f241416;hp=f42d998375181bb7c39a4c1b947ea11464a7788a;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git diff --git a/FS/FS/queue.pm b/FS/FS/queue.pm index f42d99837..61cee0a8a 100644 --- a/FS/FS/queue.pm +++ b/FS/FS/queue.pm @@ -48,17 +48,40 @@ FS::Record. The following fields are currently supported: =over 4 -=item jobnum - primary key +=item jobnum -=item job - fully-qualified subroutine name +Primary key -=item status - job status +=item job -=item statustext - freeform text status message +Fully-qualified subroutine name -=item _date - UNIX timestamp +=item status -=item svcnum - optional link to service (see L) +Job status (new, locked, or failed) + +=item statustext + +Freeform text status message + +=item _date + +UNIX timestamp + +=item svcnum + +Optional link to service (see L). + +=item custnum + +Optional link to customer (see L). + +=item secure + +Secure flag, 'Y' indicates that when using encryption, the job needs to be +run on a machine with the private key. + +=cut =back @@ -68,7 +91,7 @@ FS::Record. The following fields are currently supported: =item new HASHREF -Creates a new job. To add the example to the database, see L<"insert">. +Creates a new job. To add the job to the database, see L<"insert">. Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the I method. @@ -91,7 +114,7 @@ created (see L). #false laziness w/part_export.pm sub insert { - my $self = shift; + my( $self, @args ) = @_; local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; @@ -104,13 +127,16 @@ sub insert { local $FS::UID::AutoCommit = 0; my $dbh = dbh; + my %args = @args; + $self->custnum( $args{'custnum'} ) if $args{'custnum'}; + my $error = $self->SUPER::insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; } - foreach my $arg ( @_ ) { + foreach my $arg ( @args ) { my $queue_arg = new FS::queue_arg ( { 'jobnum' => $self->jobnum, 'arg' => $arg,