servicenumber => { type => 'text' },
show_bestbefore => { type => 'boolean', default => 'false' },
show_weight => { type => 'boolean', default => 'false', not_null => 1 },
+ signature => { type => 'text' },
sonumber => { type => 'text' },
sqnumber => { type => 'text' },
taxnumber => { type => 'text' },
$mail->{subject} = $template->parse_block($ref->{email_subject});
$mail->{message} = $template->parse_block($ref->{email_body});
- if ($myconfig->{signature}) {
- $mail->{message} .= "\n-- \n$myconfig->{signature}";
- }
+ $mail->{message} .= $form->create_email_signature();
$mail->{message} =~ s/\r\n/\n/g;
$mail->{to} = $self->{EMAIL_RECIPIENT} ? $self->{EMAIL_RECIPIENT} : $self->{email};
$mail->{from} = qq|"$myconfig->{name}" <$myconfig->{email}>|;
$mail->{fileid} = time() . '.' . $$ . '.';
- $myconfig->{signature} =~ s/\r//g;
+ my $full_signature = $self->create_email_signature();
+ $full_signature =~ s/\r//g;
# if we send html or plain text inline
if (($self->{format} eq 'html') && ($self->{sendmode} eq 'inline')) {
$mail->{contenttype} = "text/html";
$mail->{message} =~ s/\r//g;
$mail->{message} =~ s/\n/<br>\n/g;
- $myconfig->{signature} =~ s/\n/<br>\n/g;
- $mail->{message} .= "<br>\n-- <br>\n$myconfig->{signature}\n<br>";
+ $full_signature =~ s/\n/<br>\n/g;
+ $mail->{message} .= $full_signature;
open(IN, "<", $self->{tmpfile})
or $self->error($self->cleanup . "$self->{tmpfile} : $!");
"name" => $attachment_name }];
}
- $mail->{message} =~ s/\r//g;
- $mail->{message} .= "\n-- \n$myconfig->{signature}";
-
+ $mail->{message} .= $full_signature;
}
my $err = $mail->send();
$::myconfig{numberformat} = $saved_numberformat;
}
+sub create_email_signature {
+
+ my $client_signature = $::instance_conf->get_signature;
+ my $user_signature = $::myconfig{signature};
+
+ my $signature = '';
+ if ( $client_signature or $user_signature ) {
+ $signature = "\n\n-- \n";
+ $signature .= $user_signature . "\n" if $user_signature;
+ $signature .= $client_signature . "\n" if $client_signature;
+ };
+ return $signature;
+
+};
+
sub layout {
my ($self) = @_;
$::lxdebug->enter_sub;
$form->{title} = $locale->text('Edit Preferences for #1', $form->{login});
$form->header();
+
+ $form->{full_signature} = $form->create_email_signature();
+
print $form->parse_html_template('am/config');
$main::lxdebug->leave_sub();
'Check' => 'Scheck',
'Check Details' => 'Bitte Angaben überprüfen',
'Check for duplicates' => 'Dublettencheck',
+ 'Check full signature' => 'Volle Signatur prüfen',
'Check on ap transaction' => 'Prüfen bei Kreditorenbuchung',
'Check on ar transaction' => 'Prüfen bei Debitorenbuchung',
'Check on gl transaction' => 'Prüfen bei Dialogbuchung',
'Edit the sales_quotation' => 'Bearbeiten des Angebots',
'Edit the stylesheet' => 'Stilvorlage bearbeiten',
'Edit units' => 'Einheiten bearbeiten',
+ 'Edit user signature' => 'Benutzersignatur bearbeiten',
'Editable' => 'Bearbeitbar',
'Either there are no open invoices, or you have already initiated bank transfers with the open amounts for those that are still open.' => 'Entweder gibt es keine offenen Rechnungen, oder es wurden bereits Überweisungen über die offenen Beträge aller offenen Rechnungen erstellt.',
'Element disabled' => 'Element deaktiviert',
--- /dev/null
+-- @tag: defaults_signature
+-- @description: Neues Feld in defaults für Firmensignatur
+-- @depends: clients
+-- @ignore: 0
+
+ALTER TABLE defaults ADD COLUMN signature TEXT;
<th align="right">[% 'E-mail' | $T8 %]</th>
<td><input name="email" size="30" value="[% HTML.escape(myconfig_email) %]"></td>
</tr>
-
+
<tr valign="top">
<th align="right">[% 'Signature' | $T8 %]</th>
- <td><textarea name="signature" rows="3" cols="50">[% HTML.escape(myconfig_signature) %]</textarea></td>
- </tr>
-
+ <td><textarea id="signature" name="signature" class="toggletextarea" rows="5" cols="50">[% HTML.escape(myconfig_signature) %] </textarea>
+ <span id="full_signature" class="toggletextarea"> <textarea readonly name="full_signature" rows="10" cols="50" >[% HTML.escape(full_signature) %]</textarea> </span>
+ <a href="#" class="togglelink">[% 'Check full signature' | $T8 %]</a>
+ <a href="#" id="edit_signature" class="togglelink">[% 'Edit user signature' | $T8 %]</a>
+ </td> </tr>
<tr>
<th align="right">[% 'Phone' | $T8 %]</th>
<td><input name="tel" size="14" value="[% HTML.escape(myconfig_tel) %]"></td>
<p><input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]"></p>
</form>
+
+ <script type="text/javascript">
+ <!--
+$(function() {
+ $("#full_signature").toggle();
+ $("#edit_signature").toggle();
+ $('.togglelink').click(function() {
+ $('.toggletextarea').toggle();
+ $('.togglelink').toggle();
+ return false;
+ });
+});
+ -->
+ </script>
<td valign="top">[% L.textarea_tag('defaults.address', SELF.defaults.address, style=style, rows=4) %]</td>
</tr>
+ <tr>
+ <td align="right" valign="top">[% LxERP.t8("Signature") %]</td>
+ <td valign="top">[% L.textarea_tag('defaults.signature', SELF.defaults.signature, style=style, rows=4) %]</td>
+ </tr>
+
<tr>
<td align="right">[% LxERP.t8("Tax number") %]</td>
<td>[% L.input_tag('defaults.taxnumber', SELF.defaults.taxnumber, style=style) %]</td>