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 => {
|
||||
fieldType => 'dateTime',
|
||||
},
|
||||
active => {
|
||||
fieldType => 'yesNo',
|
||||
defaultValue => 0,
|
||||
state => {
|
||||
fieldType => 'text',
|
||||
defaultValue => 'idle',
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ sub www_sendBatchConfirm {
|
|||
$self->queueEmails( $userIds );
|
||||
$self->update( {
|
||||
sendDate => $scheduled,
|
||||
active => 1,
|
||||
state => 'scheduled',
|
||||
} );
|
||||
|
||||
return WebGUI::Mailing::Admin->new( $session )->www_view;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ sub www_createMailing {
|
|||
my $mailing = WebGUI::Mailing->create( $session, {
|
||||
assetId => $assetId,
|
||||
issueId => $issueId,
|
||||
active => 0,
|
||||
state => 'idle',
|
||||
} );
|
||||
|
||||
return $mailing->www_edit;
|
||||
|
|
@ -119,9 +119,11 @@ sub www_view {
|
|||
my @mailings;
|
||||
my $it = WebGUI::Mailing->getAllIterator( $session, { sequenceKeyValue => $issueId } );
|
||||
while ( my $mailing = $it->() ) {
|
||||
my $state = $mailing->get('state');
|
||||
push @mailings, {
|
||||
%{ $mailing->get },
|
||||
status => $mailing->getStatusLine,
|
||||
"is$state" => 1,
|
||||
sendTestUrl => $url->page('newsletter=mailing;func=sendTestEmails;id='.$mailing->getId ),
|
||||
sendUrl => $url->page('newsletter=mailing;func=sendBatch;id='.$mailing->getId ),
|
||||
editUrl => $url->page('newsletter=mailing;func=edit;id='.$mailing->getId ),
|
||||
|
|
|
|||
|
|
@ -82,25 +82,13 @@ sub getSendableEmails {
|
|||
{ 'WGMailing' => 'mailingId' },
|
||||
],
|
||||
constraints => [
|
||||
{ 'isTest=?' => [ 0 ] },
|
||||
{ 'status=?' => [ 'queued' ] },
|
||||
{ 'active=?' => [ 1 ] },
|
||||
{ 'sendDate <= ?' => [ time ] },
|
||||
{ 'isTest=?' => [ 0 ] },
|
||||
{ 'status=?' => [ 'queued' ] },
|
||||
{ 'state=?' => [ 'scheduled' ] },
|
||||
{ '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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue