]> wagnertech.de Git - mfinanz.git/commitdiff
Neues Feld Firmensignatur in Mandantenkonfiguration
authorG. Richardson <information@kivitendo-premium.de>
Mon, 27 Jan 2014 11:39:08 +0000 (12:39 +0100)
committerG. Richardson <information@kivitendo-premium.de>
Thu, 30 Jan 2014 09:44:39 +0000 (10:44 +0100)
Seit der Umstellung auf die Mandantenfähigkeit gab es für einen Benutzer
nur eine einheitliche E-Mail Signatur in allen Mandanten. Dadurch konnte
man keine firmenindividuellen Signaturen einsetzen. Ab jetzt kann man
eine benutzerdefinierte Signatur mit einer Mandantensignatur
kombinieren. Für die komplette Signatur wird dafür die Firmensignatur an
die Benutzersignatur angehängt.

Beim Bearbeiten der Benutzersignatur kann in einem readonly-Textfeld
überprüft werden, wie die zusammengesetzte Signatur aussieht.

Läßt man die Mandantensignatur leer ändert sich nichts am bisherigen
Signaturverhalten.

SL/DB/MetaSetup/Default.pm
SL/DN.pm
SL/Form.pm
bin/mozilla/am.pl
locale/de/all
sql/Pg-upgrade2/defaults_signature.sql [new file with mode: 0644]
templates/webpages/am/config.html
templates/webpages/client_config/_miscellaneous.html

index 8c0319cc31a50618f0350e2e989068f1f185919b..7756a119770b7f823665f2c07bddfba6407d309c 100644 (file)
@@ -75,6 +75,7 @@ __PACKAGE__->meta->columns(
   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' },
index 38174f912c82ae524def63b0139fbf544f8e5a34..976a238855d6684241e8f8d022206ca2a55f7fcf 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -379,9 +379,7 @@ sub send_email {
   $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;
 
index eb3565d44e7530e0031f511580312c55651bfbf4..730d079ab824c8683f696b7a1bab661f9c586693 100644 (file)
@@ -1105,15 +1105,16 @@ sub parse_template {
     $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} : $!");
@@ -1129,9 +1130,7 @@ sub parse_template {
                                    "name"     => $attachment_name }];
       }
 
-      $mail->{message}  =~ s/\r//g;
-      $mail->{message} .=  "\n-- \n$myconfig->{signature}";
-
+      $mail->{message} .= $full_signature;
     }
 
     my $err = $mail->send();
@@ -3484,6 +3483,21 @@ sub reformat_numbers {
   $::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;
index e12c1ea51b9b18e77913b2018c81d586943dfae0..e141696f80ab7f26c88f6da9572ef1b463436672 100644 (file)
@@ -1037,6 +1037,9 @@ sub config {
   $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();
index 7ead6bf954e8bfcf0e7458379e4319813f9a7e3f..da9dbc4111bea31411632014433a8cc9d24d0974 100755 (executable)
@@ -437,6 +437,7 @@ $self->{texts} = {
   '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',
@@ -865,6 +866,7 @@ $self->{texts} = {
   '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',
diff --git a/sql/Pg-upgrade2/defaults_signature.sql b/sql/Pg-upgrade2/defaults_signature.sql
new file mode 100644 (file)
index 0000000..503aa5a
--- /dev/null
@@ -0,0 +1,6 @@
+-- @tag: defaults_signature                                                                                                                                                 
+-- @description: Neues Feld in defaults für Firmensignatur                                                                                                                  
+-- @depends: clients                                                                                                                                                        
+-- @ignore: 0                                                                                                                                                               
+                                                                                                                                                                            
+ALTER TABLE defaults ADD COLUMN signature TEXT;
index c1d9f91e08fe4a98fd70597263dd033127aeb12d..db766e4fed3f67156df0eecdd30ede9f1ed446eb 100644 (file)
       <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>
index 46f9ee7aa2c5258ac65a0e8b4290640ac9ee2ec2..0b04012d24121addd67d201419c9253a98be2d01 100644 (file)
    <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>