X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fqueue.pm;h=67d124d02207ffb60ca8f275f09ea552c19cba78;hb=ed3c8f7e9284bcfafd37c8c693084ab12f8f9f40;hp=1b52ac4fc93956c4f1f1cf3b90e4570f61d00858;hpb=32072dbf59a054529f5304574c0f56f9567d14d0;p=freeside.git diff --git a/FS/FS/queue.pm b/FS/FS/queue.pm index 1b52ac4fc..67d124d02 100644 --- a/FS/FS/queue.pm +++ b/FS/FS/queue.pm @@ -97,6 +97,10 @@ Optional link to customer (see L). Secure flag, 'Y' indicates that when using encryption, the job needs to be run on a machine with the private key. +=item usernum + +For access_user that created the job + =cut =back @@ -151,6 +155,8 @@ sub insert { $self->custnum( $args{'custnum'} ) if $args{'custnum'}; + $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum; + my $error = $self->SUPER::insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; @@ -235,6 +241,7 @@ sub check { || $self->ut_enum('status',['', qw( new locked failed done )]) || $self->ut_anything('statustext') || $self->ut_numbern('svcnum') + || $self->ut_foreign_keyn('usernum', 'access_user', 'usernum') ; return $error if $error; @@ -357,6 +364,21 @@ sub update_statustext { #''; } +# not needed in 4 +#=item access_user +# +#Returns FS::access_user object (if any) associated with this user. +# +#Returns nothing if not found. +# +#=cut +# +#sub access_user { +# my $self = shift; +# my $usernum = $self->usernum || return (); +# return qsearchs('access_user',{ 'usernum' => $usernum }) || (); +#} + =back =head1 SUBROUTINES