X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fqueue.pm;h=1f2abe3ae4ef3e2b640ca04ce8c1fd0634f64731;hb=9f64bfef652922b7b546a12290805710acbeed08;hp=61cee0a8a5c1961bc11ad7b667996fc718cbaca6;hpb=9bf05e6da4c33578efb15313533f2060d18bdeb4;p=freeside.git diff --git a/FS/FS/queue.pm b/FS/FS/queue.pm index 61cee0a8a..1f2abe3ae 100644 --- a/FS/FS/queue.pm +++ b/FS/FS/queue.pm @@ -3,6 +3,8 @@ package FS::queue; use strict; use vars qw( @ISA @EXPORT_OK $DEBUG $conf $jobnums); use Exporter; +use MIME::Base64; +use Storable qw( nfreeze thaw ); use FS::UID qw(myconnect); use FS::Conf; use FS::Record qw( qsearch qsearchs dbh ); @@ -127,7 +129,12 @@ sub insert { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - my %args = @args; + my %args = (); + { + no warnings "misc"; + %args = @args; + } + $self->custnum( $args{'custnum'} ) if $args{'custnum'}; my $error = $self->SUPER::insert; @@ -137,9 +144,11 @@ sub insert { } foreach my $arg ( @args ) { + my $freeze = ref($arg) ? 'Y' : ''; my $queue_arg = new FS::queue_arg ( { 'jobnum' => $self->jobnum, - 'arg' => $arg, + 'frozen' => $freeze, + 'arg' => $freeze ? encode_base64(nfreeze($arg)) : $arg,# always freeze? } ); $error = $queue_arg->insert; if ( $error ) { @@ -249,11 +258,12 @@ Returns a list of the arguments associated with this job. sub args { my $self = shift; - map $_->arg, qsearch( 'queue_arg', - { 'jobnum' => $self->jobnum }, - '', - 'ORDER BY argnum' - ); + map { $_->frozen ? thaw(decode_base64($_->arg)) : $_->arg } + qsearch( 'queue_arg', + { 'jobnum' => $self->jobnum }, + '', + 'ORDER BY argnum' + ); } =item cust_svc