Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a11f9923

Von Jan Büren vor 9 Monaten hinzugefügt

  • ID a11f99230fa27581f6e1d5240f0fa1ff41a58d74
  • Vorgänger 9ad6dd6e
  • Nachfolger 99fbec76

BJ->ImportRecordEmails keine Konfig aus der kivitendo.conf

Unterschiede anzeigen:

SL/BackgroundJob/ImportRecordEmails.pm
12 12
use SL::Presenter::Tag qw(link_tag);
13 13
use SL::Locale::String qw(t8);
14 14

  
15
use Params::Validate qw(:all);
16 15
use List::MoreUtils qw(any);
16
use Params::Validate qw(:all);
17
use Try::Tiny;
17 18

  
18 19
sub sync_record_email_folder {
19 20
  my ($self, $config) = @_;
20 21

  
21 22
  my %imap_config;
22
  foreach my $key (qw(enabled hostname port ssl username password base_folder)) {
23
  foreach my $key (qw(enabled hostname port ssl username password)) {
23 24
    if (defined $config->{$key}) {
24 25
      $imap_config{$key} = $config->{$key};
25 26
    }
......
114 115
  my ($self, $job_obj) = @_;
115 116
  $self->{job_obj} = $job_obj;
116 117

  
117
  my $data = $job_obj->data_as_hash;
118
  my $data;
118 119

  
119
  my $record_type = $data->{record_type};
120
  my $loaded_config = $::lx_office_conf{"record_emails_imap/record_type/$record_type"}
121
    || $::lx_office_conf{record_emails_imap}
122
    || {};
120
  try {
121
    $data = $job_obj->data_as_hash;
122
  } catch { die t8("Invalid YAML Configuration for this job. Reason: malformed YAML Data: #1. Please consult: Program -> Documentation -> HTML -> Configuration of Background-Jobs.", $_ ); };
123 123

  
124
  # overwrite with background job data
125
  $loaded_config->{$_} = $data->{$_} for keys %{$data};
126
  my @config_params = %{$loaded_config};
124
  my @config_params = %{$data};
127 125

  
128 126
  my %config = validate_with(
129 127
    params => \@config_params,
......
167 165
      username    => { type => SCALAR,  },
168 166
      password    => { type => SCALAR,  },
169 167
      base_folder => { type => SCALAR,  optional => 1},
168

  
170 169
    },
171
    called => "data filed in Background Job or kivitendo.conf in [record_emails_imap] with type $record_type",
170
    called => "YAML Configuration for this Background Job invalid. Please consult: Program -> Documentation -> HTML -> Configuration of Background-Jobs.",
172 171
  );
173 172

  
174 173
  my @results;
locale/de/all
2097 2097
  'Introduction of clients'     => 'Einführung von Mandanten',
2098 2098
  'Inv. Duedate'                => 'Rg. Fälligkeit',
2099 2099
  'Invalid'                     => 'Ungültig',
2100
  'Invalid YAML Configuration for this job. Reason: malformed YAML Data: #1. Please consult: Program -> Documentation -> HTML -> Configuration of Background-Jobs.' => 'Ungültige YAML-Konfiguration für diesen Job. Grund: #1. Bitte nutze die Dokumentation unter: Programm -> Dokumentation -> HTML -> Konfiguration der Hintergrund-Jobs -> ImportRecordEmails',
2100 2101
  'Invalid assembly'            => 'Ungültiges Erzeugnis',
2101 2102
  'Invalid bin'                 => 'Ungültiger Lagerplatz',
2102 2103
  'Invalid charge number: #1'   => 'Ungültige Chargennummer: #1',

Auch abrufbar als: Unified diff