1106 |
1106 |
}
|
1107 |
1107 |
|
1108 |
1108 |
sub e_mail {
|
1109 |
|
$main::lxdebug->enter_sub();
|
1110 |
|
|
1111 |
|
$main::auth->assert('general_ledger');
|
1112 |
|
|
1113 |
|
my $form = $main::form;
|
1114 |
|
my %myconfig = %main::myconfig;
|
1115 |
|
my $locale = $main::locale;
|
|
1109 |
$::lxdebug->enter_sub;
|
|
1110 |
$::auth->assert('general_ledger');
|
1116 |
1111 |
|
1117 |
1112 |
# get name and email addresses
|
1118 |
1113 |
my $selected = 0;
|
1119 |
|
for my $i (1 .. $form->{rowcount}) {
|
1120 |
|
if ($form->{"statement_$i"}) {
|
1121 |
|
$form->{"$form->{ct}_id"} = $form->{"$form->{ct}_id_$i"};
|
1122 |
|
RP->get_customer(\%myconfig, \%$form);
|
1123 |
|
$selected = 1;
|
1124 |
|
last;
|
1125 |
|
}
|
1126 |
|
}
|
1127 |
|
|
1128 |
|
$form->error($locale->text('Nothing selected!')) unless $selected;
|
1129 |
|
|
1130 |
|
my $bcc = '';
|
1131 |
|
if ($myconfig{role} eq 'admin') {
|
1132 |
|
$bcc = qq|
|
1133 |
|
<th align=right nowrap=true>| . $locale->text('Bcc') . qq|</th>
|
1134 |
|
<td><input name=bcc size=30 value="$form->{bcc}"></td>
|
1135 |
|
|;
|
|
1114 |
for my $i (1 .. $::form->{rowcount}) {
|
|
1115 |
next unless $::form->{"statement_$i"};
|
|
1116 |
$::form->{"$::form->{ct}_id"} = $::form->{"$::form->{ct}_id_$i"};
|
|
1117 |
RP->get_customer(\%::myconfig, $::form);
|
|
1118 |
$selected = 1;
|
|
1119 |
last;
|
1136 |
1120 |
}
|
1137 |
1121 |
|
1138 |
|
my $title = $locale->text('E-mail Statement to') . " $form->{$form->{ct}}";
|
|
1122 |
$::form->error($::locale->text('Nothing selected!')) unless $selected;
|
1139 |
1123 |
|
1140 |
|
$form->{media} = "email";
|
1141 |
|
|
1142 |
|
$form->header;
|
1143 |
|
|
1144 |
|
print qq|
|
1145 |
|
<body>
|
1146 |
|
|
1147 |
|
<form method=post action=$form->{script}>
|
1148 |
|
|
1149 |
|
<table width=100%>
|
1150 |
|
<tr class=listtop>
|
1151 |
|
<th>$title</th>
|
1152 |
|
</tr>
|
1153 |
|
<tr height="5"></tr>
|
1154 |
|
<tr>
|
1155 |
|
<td>
|
1156 |
|
<table width=100%>
|
1157 |
|
<tr>
|
1158 |
|
<th align=right nowrap>| . $locale->text('E-mail') . qq|</th>
|
1159 |
|
<td><input name=email size=30 value="$form->{email}"></td>
|
1160 |
|
<th align=right nowrap>| . $locale->text('Cc') . qq|</th>
|
1161 |
|
<td><input name=cc size=30 value="$form->{cc}"></td>
|
1162 |
|
</tr>
|
1163 |
|
<tr>
|
1164 |
|
<th align=right nowrap>| . $locale->text('Subject') . qq|</th>
|
1165 |
|
<td><input name=subject size=30 value="$form->{subject}"></td>
|
1166 |
|
$bcc
|
1167 |
|
</tr>
|
1168 |
|
</table>
|
1169 |
|
</td>
|
1170 |
|
</tr>
|
1171 |
|
<tr>
|
1172 |
|
<td>
|
1173 |
|
<table width=100%>
|
1174 |
|
<tr>
|
1175 |
|
<th align=left nowrap>| . $locale->text('Message') . qq|</th>
|
1176 |
|
</tr>
|
1177 |
|
<tr>
|
1178 |
|
<td><textarea name=message rows=15 cols=60 wrap=soft>$form->{message}</textarea></td>
|
1179 |
|
</tr>
|
1180 |
|
</table>
|
1181 |
|
</td>
|
1182 |
|
</tr>
|
1183 |
|
<tr>
|
1184 |
|
<td>
|
1185 |
|
|;
|
1186 |
|
|
1187 |
|
&print_options;
|
1188 |
|
|
1189 |
|
map { delete $form->{$_} }
|
1190 |
|
qw(action email cc bcc subject message type sendmode format header);
|
|
1124 |
$::form->{media} = "email";
|
1191 |
1125 |
|
1192 |
1126 |
# save all other variables
|
1193 |
|
foreach my $key (keys %$form) {
|
1194 |
|
next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
|
1195 |
|
$form->{$key} =~ s/\"/"/g;
|
1196 |
|
print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
|
|
1127 |
my @hidden_values;
|
|
1128 |
for my $key (keys %$::form) {
|
|
1129 |
next if any { $key eq $_ } qw(login password action email cc bcc subject message type sendmode format header);
|
|
1130 |
next unless '' eq ref $::form->{$key};
|
|
1131 |
push @hidden_values, $key;
|
1197 |
1132 |
}
|
1198 |
1133 |
|
1199 |
|
print qq|
|
1200 |
|
</td>
|
1201 |
|
</tr>
|
1202 |
|
<tr>
|
1203 |
|
<td><hr size=3 noshade></td>
|
1204 |
|
</tr>
|
1205 |
|
</table>
|
1206 |
|
|
1207 |
|
<input type=hidden name=nextsub value=send_email>
|
1208 |
|
|
1209 |
|
<br>
|
1210 |
|
<input name=action class=submit type=submit value="|
|
1211 |
|
. $locale->text('Continue') . qq|">
|
1212 |
|
</form>
|
1213 |
|
|
1214 |
|
</body>
|
1215 |
|
</html>
|
1216 |
|
|;
|
|
1134 |
$::form->header;
|
|
1135 |
print $::form->parse_html_template('rp/e_mail', {
|
|
1136 |
show_bcc => $::auth->assert('email_bcc', 'may fail'),
|
|
1137 |
print_options => print_options(inline => 1),
|
|
1138 |
hidden_values => \@hidden_values,
|
|
1139 |
});
|
1217 |
1140 |
|
1218 |
|
$main::lxdebug->leave_sub();
|
|
1141 |
$::lxdebug->leave_sub;
|
1219 |
1142 |
}
|
1220 |
1143 |
|
1221 |
1144 |
sub send_email {
|
rp.pl::e_mail auf template umgestellt.
Ausserdem bcc check von role = 'admin' auf Rechtecheck umgestellt.