Apache-App-Mercury

 view release on metacpan or  search on metacpan

Mercury/Display.pm  view on Meta::CPAN

		 $q->table({-width => '100%', -cellpadding => 2,
			    -cellspacing => 0, -border => 0},
			   $q->Tr([$q->td({-bgcolor => '#ffffff'},
					  $self->{compose_msg}->display_compose),
				   $q->td({-bgcolor => '#cccccc'},
					  $self->display_compose_menu)
				  ]) ) ) .
	  ($self->can("display_compose_help")
	   ? ($q->td({-width => 2, -bgcolor => '#999999'}, ' ') .
	      $q->td({-valign => 'top', -bgcolor => '#cccccc'},
		     $self->display_compose_help))
	   : '')
	 ])) .
       $q->endform
      );
}

# this must be within a form
sub display_compose_menu {
    my ($self) = @_;
    my $q = $self->{q};

    return
      ($q->table({-width => '100%'},
		 $q->Tr($q->td($q->submit('preview', "Preview") .
			       $q->submit('return', "Store and return to '" .
					  ucfirst($self->{'current_box'})."'")
			      ) .
			$q->td({-align => 'right'},
			       $q->submit('reset', "Reset Message") .
			       $q->submit('cancel', "Cancel")
			      ))));
}

sub display_preview_with_header {
    my ($self) = @_;
    my $q = $self->{q};

    return
      ($q->h2("Message Preview") . $q->br .
       $self->display_preview_message .
       $self->{compose_msg}->display_preview
      );
}

sub display_preview_message {
    my ($self) = @_;
    my $q = $self->{q};

    my $message;

    if (ref $self->{compose_msg} eq "Apache::App::Mercury::Message" and
	$self->{compose_msg}->{'transcode'}) {
	my $is_memo = ($self->{compose_msg}->{'sender'} eq
		       $self->{compose_msg}->{'sent_to'});
	$message = ($q->p . $q->em("You are about to ".(!$is_memo ? "send a message in response to" : "commit a memo regarding")." a transaction (Reference number: ".$self->{compose_msg}->{'transcode'}.").  Anyone with permission to view this transaction wi...
    } else {
	$message = ($q->p . "Please review your message before sending.");
    }

    $message .= ($q->p . "Be sure to select the files you wish to attach.")
      if $self->{compose_msg}->{'num_to_attach'};

    $message .= ($q->p . "Your message is marked as <B>low</B>-security.  This means it may be forwarded over the internet via insecure e-mail.  If this message contains <B>any</B> patient-identifiable information, it is your responsibility to raise ...
      if $self->{compose_msg}->{'security'} eq 'low';

    return $message;
}

sub display_mail_settings {
    my ($self) = @_;
    my $q = $self->{q};

    my @custom_mboxes = $self->{user_manager}->mailboxes;
    my $labels = { map { $_ => ucfirst($_) } @custom_mboxes };
    $labels->{'inbox'} = "Inbox";

    my $trans_filter = $self->{user_manager}->mail_trans_filter;

    return
      ($q->div
       ({-align => 'center'},
	$q->h2("Messaging Settings for " . $self->{user_manager}->userprofile('user')) .
	$q->startform(-action => BASE_URI) .
	$q->table
	({-width => '80%'},
	 $q->Tr
	 ([$q->th({-colspan => 2, -align => 'left', -bgcolor => '#cccccc'},
		  "Add and remove customized mailboxes"),
	   $q->td({-align => 'right', -width => '50%'}, "Custom mailboxes: ") .
	   $q->td({-width => '50%'},
		  ($#custom_mboxes >= 0
		   ? $q->popup_menu(-name => 'custom_box',
				    -values => \@custom_mboxes,
				    -labels => $labels)
		   : $q->em('None'))),
	   $q->td({-valign => 'top', -width => '50%'},
		  ($#custom_mboxes < 14
		   ? ($q->submit('add_box', "Add box: ") .
		      $q->textfield(-name => 'new_box',
				    -size => 16, -maxlength => 16))
		   : $q->em("You have 15 custom mailboxes, which is the maximum currently allowed."))) .
	   $q->td({-align => 'right', -valign => 'top', -width => '50%'},
		  ($#custom_mboxes >= 0
		   ? ($q->submit('delete_box', "Delete selected box").$q->br .
		      $q->font({-size => '-1'}, " (" .
			       $q->checkbox(-name => 'delete_mail_in_box',
					    -value => 1,
					    -label => '') .
			       " Check to delete all mail in that box, otherwise mail will be transfered to your Inbox.)"))
		   : '&nbsp;')),

	   $q->th({-colspan => 2, -align => 'left', -bgcolor => '#cccccc'},
		  "Edit filters"),
	   $q->td({-width => '50%', -align => 'right'},
		  "Send transaction related messages to: ") .
	   $q->td({-width => '50%'},
		  $q->popup_menu(-name => 'trans_filter',
				 -values => [ 'inbox', @custom_mboxes ],
				 -override => 1,
				 -default => ($trans_filter
					      ? $trans_filter : 'inbox'),



( run in 0.591 second using v1.01-cache-2.11-cpan-e1769b4cff6 )