Improve preview functionality.
This commit is contained in:
parent
af40a772a9
commit
6ea4a47c60
1 changed files with 42 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ sub processContentAsUser {
|
||||||
#}
|
#}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub www_previewEmail {
|
sub www_previewContent {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $form = $self->session->form;
|
my $form = $self->session->form;
|
||||||
|
|
||||||
|
|
@ -105,5 +105,46 @@ sub www_previewEmail {
|
||||||
return $self->processContentAsUser( $userId );
|
return $self->processContentAsUser( $userId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
sub www_previewEmail {
|
||||||
|
my $self = shift;
|
||||||
|
my $session = $self->session;
|
||||||
|
my $form = $session->form;
|
||||||
|
|
||||||
|
my %recipients =
|
||||||
|
map { $_->getId => $_->username }
|
||||||
|
map { WebGUI::User->new( $session, $_ ) }
|
||||||
|
@{ $self->getRecipients };
|
||||||
|
|
||||||
|
my $issueId = $form->get('issueId');
|
||||||
|
my $userId = $form->get('userId') || ( %recipients )[0];
|
||||||
|
|
||||||
|
my $userSelection =
|
||||||
|
WebGUI::Form::formHeader( $session )
|
||||||
|
. WebGUI::Form::hidden( $session, { name => 'func', value => 'previewEmail' } )
|
||||||
|
. WebGUI::Form::hidden( $session, { name => 'issueId', value => $issueId } )
|
||||||
|
. WebGUI::Form::selectBox( $session, {
|
||||||
|
name => 'userId',
|
||||||
|
options => \%recipients,
|
||||||
|
value => $userId,
|
||||||
|
} )
|
||||||
|
. WebGUI::Form::submit( $session, { value => 'Switch' } )
|
||||||
|
. WebGUI::Form::formFooter( $session );
|
||||||
|
|
||||||
|
my $url = $self->getUrl("func=previewContent;issueId=$issueId;userId=$userId");
|
||||||
|
|
||||||
|
return <<EOHTML
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
$userSelection
|
||||||
|
<iframe src="$url" id="previewFrame" style="width: 100%; height: 90%">
|
||||||
|
</iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOHTML
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue