From 03c12b4dabfcaabc218f39ee13557edebc13931d Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 18 Jan 2015 18:13:16 -0800 Subject: email quotations, RT#22232, RT#20688 --- httemplate/misc/email-quotation.html | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 httemplate/misc/email-quotation.html (limited to 'httemplate/misc/email-quotation.html') diff --git a/httemplate/misc/email-quotation.html b/httemplate/misc/email-quotation.html new file mode 100644 index 000000000..b93b80bb7 --- /dev/null +++ b/httemplate/misc/email-quotation.html @@ -0,0 +1,71 @@ +<& /elements/header-popup.html, mt('Select recipients') &> + +<% include('/elements/error.html') %> + +
+ + +<% ntable("#cccccc", 2) %> + +% my $emails = 0; + +% if ( my $cust_main = $quotation->cust_main ) { +% foreach my $email ( $cust_main->invoicing_list_emailonly ) { +% $emails++; + <& .emailrow, $email &> +% } +% } + +% my @contact = $quotation->custnum ? $quotation->cust_main->cust_contact +% : $quotation->prospect_main->contact; +% foreach my $contact ( @contact ) { +% foreach my $contact_email ( $contact->contact_email ) { +% $emails++; + <& .emailrow, $contact_email->emailaddress, $contact->firstlast &> +% } +% } + +<%def .emailrow> +% my( $email, $name ) = @_; +% if ( $name ) { +% $name = "$name <$email>"; +% } else { +% $name = $email; +% } + + + <% $name |h %> + + + + + +
+ +
+% if ( $emails ) { + + +% } else { + <% mt('Add a contact email address first') |h %> +% } +
+ +
+ +<& /elements/footer-popup.html &> +<%init> + +#die "access denied" +# unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation'); #separate rights to generate vs send/email? + +$cgi->param('quotationnum') =~ /^(\d+)$/ or die "Illegal quotationnum"; +my $quotationnum = $1; + +#XXX agent-virt +my $quotation = qsearchs('quotation', { 'quotationnum'=>$quotationnum }) + or die "Unknown quotationnum"; + + -- cgit v1.2.1