Template confirm mutation screen.
This commit is contained in:
parent
b9aaf63ec2
commit
745addd5d1
5 changed files with 66 additions and 15 deletions
|
|
@ -87,6 +87,13 @@ sub definition {
|
||||||
namespace => 'Subscriber/NoMutationEmail',
|
namespace => 'Subscriber/NoMutationEmail',
|
||||||
tab => 'subscription',
|
tab => 'subscription',
|
||||||
},
|
},
|
||||||
|
confirmMutationTemplateId => {
|
||||||
|
fieldType => 'template',
|
||||||
|
defaultValue => 'WUk-wEhGiF8dcEogrJfrfg',
|
||||||
|
label => $i18n->get( 'confirm mutation template' ),
|
||||||
|
namespace => 'Subscriber/MutationConfirmation',
|
||||||
|
tab => 'subscription',
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
push( @{ $definition }, {
|
push( @{ $definition }, {
|
||||||
|
|
@ -527,21 +534,30 @@ sub www_confirmMutation {
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $var = {
|
||||||
|
message => $i18n->get( 'wrong code' ),
|
||||||
|
returnUrl => $self->getUrl,
|
||||||
|
isSuccess => 0,
|
||||||
|
"is$type" => 1,
|
||||||
|
};
|
||||||
if ( $userId ) {
|
if ( $userId ) {
|
||||||
$self->logConfirmation( $code );
|
$self->logConfirmation( $code );
|
||||||
|
|
||||||
if ( $type eq 'subscribe' ) {
|
if ( $type eq 'subscribe' ) {
|
||||||
$self->getSubscriptionGroup->addUsers( [ $userId ] );
|
$self->getSubscriptionGroup->addUsers( [ $userId ] );
|
||||||
return $self->processStyle( sprintf $i18n->get( 'subscription successful'), $self->getUrl );
|
|
||||||
|
$var->{ message } = sprintf $i18n->get( 'subscription successful'), $self->getUrl;
|
||||||
|
$var->{ isSuccess } = 1;
|
||||||
}
|
}
|
||||||
elsif ( $type eq 'unsubscribe' ) {
|
elsif ( $type eq 'unsubscribe' ) {
|
||||||
$self->getSubscriptionGroup->deleteUsers( [ $userId ] );
|
$self->getSubscriptionGroup->deleteUsers( [ $userId ] );
|
||||||
return $self->processStyle( sprintf $i18n->get( 'unsubscription successful' ), $self->getUrl );
|
|
||||||
|
$var->{ message } = sprintf $i18n->get( 'unsubscription successful' ), $self->getUrl;
|
||||||
|
$var->{ isSuccess } = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $self->processStyle( $i18n->get( 'wrong code' ) );
|
return $self->processTemplate( $var, $self->get('confirmMutationTemplateId') );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package WebGUI::i18n::Dutch::AssetAspect_Subscriber;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
our $I18N = {
|
our $I18N = {
|
||||||
'Subscription group' => {
|
'Subscription group' => {
|
||||||
message => 'Abonnee groep',
|
message => 'Abonnee groep',
|
||||||
},
|
},
|
||||||
'Enable subscription' => {
|
'Enable subscription' => {
|
||||||
|
|
@ -24,7 +24,7 @@ our $I18N = {
|
||||||
'confirmation email template' => {
|
'confirmation email template' => {
|
||||||
message => 'Verificatie email: sjabloon',
|
message => 'Verificatie email: sjabloon',
|
||||||
},
|
},
|
||||||
'no mutation subject' => {
|
'no mutation subject' => {
|
||||||
message => 'Geen wijziging email: onderwerp',
|
message => 'Geen wijziging email: onderwerp',
|
||||||
},
|
},
|
||||||
'no mutation template' => {
|
'no mutation template' => {
|
||||||
|
|
@ -52,16 +52,19 @@ our $I18N = {
|
||||||
'anonnymous not allowed' => {
|
'anonnymous not allowed' => {
|
||||||
message => 'Anonieme inschrijvingen zijn niet toegestaan. Log in om in- of uit te schrijven.',
|
message => 'Anonieme inschrijvingen zijn niet toegestaan. Log in om in- of uit te schrijven.',
|
||||||
},
|
},
|
||||||
|
|
||||||
'subscription successful' => {
|
'subscription successful' => {
|
||||||
message => 'Uw inschrijving is geslaagd. <a href="%s">Terug naar de site</a>',
|
message => 'Uw inschrijving is geslaagd.',
|
||||||
},
|
},
|
||||||
'unsubscription successful' => {
|
'unsubscription successful' => {
|
||||||
message => 'Uw uitschrijving is geslaagd. <a href="%s">Terug naar de site</a>',
|
message => 'Uw uitschrijving is geslaagd.',
|
||||||
},
|
},
|
||||||
'wrong code' => {
|
'wrong code' => {
|
||||||
message => 'De verificatiecode in de link is onbekend, al gebruikt of verlopen. Als u zich wilt in- of uitschrijven probeer dit dan opnieuw of neem contact op met de websitebeheerders.',
|
message => 'De verificatiecode in de link is onbekend, al gebruikt of verlopen. Als u zich wilt in- of uitschrijven probeer dit dan opnieuw of neem contact op met de websitebeheerders.',
|
||||||
},
|
},
|
||||||
|
'confirm mutation template' => {
|
||||||
|
message => 'Mutatie bevestigings template',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package WebGUI::i18n::English::AssetAspect_Subscriber;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
our $I18N = {
|
our $I18N = {
|
||||||
'Subscription group' => {
|
'Subscription group' => {
|
||||||
message => 'Subscription group',
|
message => 'Subscription group',
|
||||||
},
|
},
|
||||||
'Enable subscription' => {
|
'Enable subscription' => {
|
||||||
|
|
@ -24,7 +24,7 @@ our $I18N = {
|
||||||
'confirmation email template' => {
|
'confirmation email template' => {
|
||||||
message => 'Confirmation email template',
|
message => 'Confirmation email template',
|
||||||
},
|
},
|
||||||
'no mutation subject' => {
|
'no mutation subject' => {
|
||||||
message => 'No mutation email subject',
|
message => 'No mutation email subject',
|
||||||
},
|
},
|
||||||
'no mutation template' => {
|
'no mutation template' => {
|
||||||
|
|
@ -34,7 +34,6 @@ our $I18N = {
|
||||||
message => 'Subscription',
|
message => 'Subscription',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
'subscribe' => {
|
'subscribe' => {
|
||||||
message => 'Subscribe',
|
message => 'Subscribe',
|
||||||
},
|
},
|
||||||
|
|
@ -52,17 +51,20 @@ our $I18N = {
|
||||||
'anonnymous not allowed' => {
|
'anonnymous not allowed' => {
|
||||||
message => 'Anonymous subscription is not allowed. Please log in to (un)subscribe',
|
message => 'Anonymous subscription is not allowed. Please log in to (un)subscribe',
|
||||||
},
|
},
|
||||||
|
|
||||||
'subscription successful' => {
|
'subscription successful' => {
|
||||||
message => 'You are succesfully subscribed. <a href="%s">Back to site</a>',
|
message => 'You are succesfully subscribed.',
|
||||||
},
|
},
|
||||||
'unsubscription successful' => {
|
'unsubscription successful' => {
|
||||||
message => 'You are succesfully unsubscribed. <a href="%s">Back to site</a>',
|
message => 'You are succesfully unsubscribed.',
|
||||||
},
|
},
|
||||||
'wrong code' => {
|
'wrong code' => {
|
||||||
message => 'The verification code you supplied is either unknown, already used or expired. Please try again to (un)subscribe or contact the site administrators.',
|
message => 'The verification code you supplied is either unknown, already used or expired. Please try again to (un)subscribe or contact the site administrators.',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'confirm mutation template' => {
|
||||||
|
message => 'Mutation confirmation template',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,39 @@ renamespaceTemplates( $session );
|
||||||
addSpecialStateTable( $session );
|
addSpecialStateTable( $session );
|
||||||
addListNameColumn( $session );
|
addListNameColumn( $session );
|
||||||
addRegistrationSteps( $session );
|
addRegistrationSteps( $session );
|
||||||
|
addConfirmationTemplateColumn( $session );
|
||||||
|
|
||||||
finish($session);
|
finish($session);
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
sub addConfirmationTemplateColumn {
|
||||||
|
my $session = shift;
|
||||||
|
my $db = $session->db;
|
||||||
|
|
||||||
|
print "\tAdding column for mutation confirmation template...";
|
||||||
|
|
||||||
|
my $hasColumn = $db->quickScalar( 'show columns from assetAspectSubscriber where Field = ?', [
|
||||||
|
'confirmMutationTemplateId',
|
||||||
|
] );
|
||||||
|
|
||||||
|
unless ( $hasColumn ) {
|
||||||
|
$db->write(
|
||||||
|
'alter table assetAspectSubscriber add column confirmMutationTemplateId char(22) binary not null default ?',
|
||||||
|
[
|
||||||
|
'WUk-wEhGiF8dcEogrJfrfg',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$db->write(
|
||||||
|
'update assetAspectSubscriber set confirmMutationTemplateId=? where confirmMutationTemplateId is null',
|
||||||
|
[
|
||||||
|
'WUk-wEhGiF8dcEogrJfrfg',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
print "Done.\n";
|
||||||
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub addListNameColumn {
|
sub addListNameColumn {
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue