Replacing active flag with status field.
This commit is contained in:
parent
4a9cbfd91c
commit
e7dd066630
4 changed files with 11 additions and 21 deletions
|
|
@ -33,9 +33,9 @@ sub crud_definition {
|
||||||
sendDate => {
|
sendDate => {
|
||||||
fieldType => 'dateTime',
|
fieldType => 'dateTime',
|
||||||
},
|
},
|
||||||
active => {
|
state => {
|
||||||
fieldType => 'yesNo',
|
fieldType => 'text',
|
||||||
defaultValue => 0,
|
defaultValue => 'idle',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -285,7 +285,7 @@ sub www_sendBatchConfirm {
|
||||||
$self->queueEmails( $userIds );
|
$self->queueEmails( $userIds );
|
||||||
$self->update( {
|
$self->update( {
|
||||||
sendDate => $scheduled,
|
sendDate => $scheduled,
|
||||||
active => 1,
|
state => 'scheduled',
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return WebGUI::Mailing::Admin->new( $session )->www_view;
|
return WebGUI::Mailing::Admin->new( $session )->www_view;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ sub www_createMailing {
|
||||||
my $mailing = WebGUI::Mailing->create( $session, {
|
my $mailing = WebGUI::Mailing->create( $session, {
|
||||||
assetId => $assetId,
|
assetId => $assetId,
|
||||||
issueId => $issueId,
|
issueId => $issueId,
|
||||||
active => 0,
|
state => 'idle',
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return $mailing->www_edit;
|
return $mailing->www_edit;
|
||||||
|
|
@ -119,9 +119,11 @@ sub www_view {
|
||||||
my @mailings;
|
my @mailings;
|
||||||
my $it = WebGUI::Mailing->getAllIterator( $session, { sequenceKeyValue => $issueId } );
|
my $it = WebGUI::Mailing->getAllIterator( $session, { sequenceKeyValue => $issueId } );
|
||||||
while ( my $mailing = $it->() ) {
|
while ( my $mailing = $it->() ) {
|
||||||
|
my $state = $mailing->get('state');
|
||||||
push @mailings, {
|
push @mailings, {
|
||||||
%{ $mailing->get },
|
%{ $mailing->get },
|
||||||
status => $mailing->getStatusLine,
|
status => $mailing->getStatusLine,
|
||||||
|
"is$state" => 1,
|
||||||
sendTestUrl => $url->page('newsletter=mailing;func=sendTestEmails;id='.$mailing->getId ),
|
sendTestUrl => $url->page('newsletter=mailing;func=sendTestEmails;id='.$mailing->getId ),
|
||||||
sendUrl => $url->page('newsletter=mailing;func=sendBatch;id='.$mailing->getId ),
|
sendUrl => $url->page('newsletter=mailing;func=sendBatch;id='.$mailing->getId ),
|
||||||
editUrl => $url->page('newsletter=mailing;func=edit;id='.$mailing->getId ),
|
editUrl => $url->page('newsletter=mailing;func=edit;id='.$mailing->getId ),
|
||||||
|
|
|
||||||
|
|
@ -84,23 +84,11 @@ sub getSendableEmails {
|
||||||
constraints => [
|
constraints => [
|
||||||
{ 'isTest=?' => [ 0 ] },
|
{ 'isTest=?' => [ 0 ] },
|
||||||
{ 'status=?' => [ 'queued' ] },
|
{ 'status=?' => [ 'queued' ] },
|
||||||
{ 'active=?' => [ 1 ] },
|
{ 'state=?' => [ 'scheduled' ] },
|
||||||
{ 'sendDate <= ?' => [ time ] },
|
{ 'sendDate <= ?' => [ time ] },
|
||||||
],
|
],
|
||||||
} );
|
} );
|
||||||
|
|
||||||
my @sql = $class->getAllSql( $session, {
|
|
||||||
joinUsing => [
|
|
||||||
{ 'WGMailing' => 'mailingId' },
|
|
||||||
],
|
|
||||||
constraints => [
|
|
||||||
{ 'isTest=?' => [ 0 ] },
|
|
||||||
{ 'status=?' => [ 'queued' ] },
|
|
||||||
{ 'active=?' => [ 1 ] },
|
|
||||||
{ 'sendDate <= ?' => [ time ] },
|
|
||||||
],
|
|
||||||
} );
|
|
||||||
$session->log->warn( "--->" . shift( @sql ) . join "\n\n", @{ shift @sql } );
|
|
||||||
return $it;
|
return $it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue