]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Konfigurierbares E-Mail-Journal
authorMartin Helmling <martin.helmling@octosoft.eu>
Tue, 29 Sep 2015 10:46:38 +0000 (12:46 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 1 Oct 2015 07:42:52 +0000 (09:42 +0200)
In der Mandantenkonfig kann nun das Speichern von gesendeten E-Mails
entweder
- ganz abgeschaltet werden
- ohne Anhänge speichern
- mit Anhängen speichern (default)
konfiguriert werden.

Falls ganz abgeschaltet, erscheint im Journal dazu ein Hinweis

SL/Controller/EmailJournal.pm
SL/DB/MetaSetup/Default.pm
SL/Mailer.pm
locale/de/all
sql/Pg-upgrade2/defaults_enable_email_journal.sql [new file with mode: 0644]
templates/webpages/client_config/_features.html

index 7c40a0de7a6bb43b6d0b3f94ed497a054f85f392..69a155802e254aa082f8d39537978664682406e1 100644 (file)
@@ -27,6 +27,9 @@ __PACKAGE__->run_before('add_stylesheet');
 sub action_list {
   my ($self) = @_;
 
+  if ( $::instance_conf->get_email_journal == 0 ) {
+      flash('info',  $::locale->text('In client config the mail saving into the journal is actual disabled.'));
+  }
   $self->render('email_journal/list',
                 title   => $::locale->text('Email journal'),
                 ENTRIES => $self->models->get,
index 2f407eae8d8298c82a4f65dd3c2354277a6f1c1e..821ed98fea02788c23e2288c0d7d826c6aa96573 100644 (file)
@@ -46,6 +46,7 @@ __PACKAGE__->meta->columns(
   dunning_ar_amount_fee                     => { type => 'integer' },
   dunning_ar_amount_interest                => { type => 'integer' },
   duns                                      => { type => 'text' },
+  email_journal                             => { type => 'integer', default => 2 },
   expense_accno_id                          => { type => 'integer' },
   fxgain_accno_id                           => { type => 'integer' },
   fxloss_accno_id                           => { type => 'integer' },
index dc6002b42eb6a12b8df9238427c0607f6e7d4941..6536850581a0b611669c39c8e5e697a5b1a799c1 100644 (file)
@@ -236,12 +236,18 @@ sub _all_recipients {
 sub _store_in_journal {
   my ($self, $status, $extended_status) = @_;
 
+  my $journal_enable = $::instance_conf->get_email_journal;
+
+  return if $journal_enable == 0;
+
   $status          //= $self->{driver}->status if $self->{driver};
   $status          //= 'failed';
   $extended_status //= $self->{driver}->extended_status if $self->{driver};
   $extended_status //= 'unknown error';
 
-  my @attachments = grep { $_ } map {
+  my @attachments;
+
+  @attachments = grep { $_ } map {
     my $part = $self->_create_attachment_part($_);
     if ($part) {
       SL::DB::EmailJournalAttachment->new(
@@ -250,7 +256,7 @@ sub _store_in_journal {
         content   => $part->body,
       )
     }
-  } @{ $self->{attachments} || [] };
+  } @{ $self->{attachments} || [] } if $journal_enable > 1;
 
   my $headers = join "\r\n", (bundle_by { join(': ', @_) } 2, @{ $self->{headers} || [] });
 
index 9fedf0f557c1a8c8d5f623398850c7e3c255acec..3e2289a56e95ba227ed48b942273a0c5c765a16d 100755 (executable)
@@ -1365,6 +1365,7 @@ $self->{texts} = {
   'Import profiles'             => 'Import-Profil',
   'Import result'               => 'Import-Ergebnis',
   'Import summary'              => 'Import-Zusammenfassung',
+  'In client config the mail saving into the journal is actual disabled.' => 'Das Speichern von versendeten E-Mails ist derzeit in der Mandantenkonfigurierung abgeschaltet.',
   'In order to do that hit the button "Delete transaction".' => 'Drücken Sie dafür auf den Button "Buchung löschen".',
   'In order to migrate the old folder structure into the new structure you have to chose which client the old structure will be assigned to.' => 'Um die alte Ordnerstruktur in die neue Struktur zu migrieren, müssen Sie festlegen, welchem Mandanten die bisherige Struktur zugewiesen wird.',
   'In order to use kivitendo you have to create at least a client, a user and a group.' => 'Um kivitendo zu nutzen, müssen Sie mindestens einen Mandanten, einen Benutzer und eine Gruppe anlegen.',
@@ -1679,6 +1680,7 @@ $self->{texts} = {
   'No Company Address given'    => 'Keine Firmenadresse hinterlegt!',
   'No Company Name given'       => 'Kein Firmenname hinterlegt!',
   'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden',
+  'No Journal'                  => 'Kein Journal',
   'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Händler gefunden',
   'No acceptance statuses has been created yet.' => 'Es wurde noch kein Abnahmestatus angelegt.',
   'No action defined.'          => 'Keine Aktion definiert.',
@@ -2359,6 +2361,7 @@ $self->{texts} = {
   'Sellprice significant places' => 'Verkaufspreis: Nachkommastellen',
   'Semicolon'                   => 'Semikolon',
   'Sender'                      => 'AbsenderIn',
+  'Sent emails can be stored with or without attachments in database or general not stored' => 'gesendete E-Mails können mit oder ohne Anhänge in der Datenbank gespeichert werden',
   'Sent on'                     => 'Verschickt am',
   'Sep'                         => 'Sep',
   'Separator'                   => 'Trennzeichen',
@@ -3178,8 +3181,10 @@ $self->{texts} = {
   'What type of item is this?'  => 'Was ist dieser Artikel?',
   'When converting a requirement spec into a quotation or an oder each section gets converted into a line position in the new record. This is the article used by default for this conversion.' => 'Wenn ein Pflichtenheft in ein Angebot oder Auftrag umgewandelt wird, wird für jeden Abschnitt eine Position im neuen Beleg angelegt. Dies ist der Artikel, der standardmäßig bei dieser Umwandlung genutzt wird.',
   'Which is located at doc/kivitendo-Dokumentation.pdf. Click here: ' => 'Diese befindet sich unter doc/kivitendo-Dokumentation.pdf. Klicken Sie hier:',
+  'With Attachments'            => 'Journal mit Anhängen',
   'With Extension Of Time'      => 'mit Dauerfristverlängerung',
   'With the introduction of clients each client gets its own WebDAV folder.' => 'Mit der Einführung von Mandanten erhält jeder Mandant sein eigenes WebDAV-Verzeichnis.',
+  'Without Attachments'         => 'Journal ohne Anhänge',
   'Workflow Delivery Order'     => 'Workflow Lieferschein',
   'Workflow purchase_order'     => 'Workflow Lieferantenauftrag',
   'Workflow request_quotation'  => 'Workflow Preisanfrage',
diff --git a/sql/Pg-upgrade2/defaults_enable_email_journal.sql b/sql/Pg-upgrade2/defaults_enable_email_journal.sql
new file mode 100644 (file)
index 0000000..577057d
--- /dev/null
@@ -0,0 +1,5 @@
+-- @tag: defaults_enable_email_journal
+-- @description: Email Journal konfigurierbar machen 
+-- @depends: email_journal 
+
+ALTER TABLE defaults ADD COLUMN  email_journal integer DEFAULT 2;
index 14f6d10b1f3d0ac3284d6599b302ea4f2f3ae312..744f77cbef5c31783a4b8c8964dce24ae42f7d25 100644 (file)
    <td>[% 'Manually sent E-Mails will have their BCC field appended with this address. Will not trigger for employees without the right to send bcc, and will not apply to mails sent by automated jobs.' | $T8 %]</td>
   </tr>
 
+  <tr>
+   <td align="right">[% LxERP.t8('Email journal') %]</td>
+   <td>
+     [% L.select_tag('defaults.email_journal', [ [ 0, LxERP.t8('No Journal') ],[ 1, LxERP.t8('Without Attachments') ],[ 2, LxERP.t8('With Attachments') ]  ], default=SELF.defaults.email_journal) %]
+   </td>
+   <td>[% 'Sent emails can be stored with or without attachments in database or general not stored' | $T8 %]</td>
+  </tr>
+
   <tr><td class="listheading" colspan="4">[% LxERP.t8("Requirement Specs") %]</td></tr>
 
   <tr>