Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ce156ea1

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID ce156ea1e42781529561f43b46d3501648cdb34f
  • Vorgänger 28bd71eb
  • Nachfolger 0f0779ce

defaults_feature: Standardwerte richtig propagieren

Unterschiede anzeigen:

sql/Pg-upgrade2/defaults_feature.pl
21 21

  
22 22
  # check current configuration and set default variables accordingly, so that
23 23
  # kivitendo's behaviour isn't changed by this update
24
  # if checks are not set in config leave it to the default value
24
  my %old_defaults = ( parts_show_image => 1 );
25

  
25 26
  foreach my $check (qw(webdav vertreter parts_show_image parts_listing_image)) {
26
    my $check_set = $::lx_office_conf{features}->{$check} ? 1 : 0;
27
    $self->db_query("UPDATE defaults SET $check = ?", bind => [ $check_set ]) if $check_set;
27
    my $check_set = exists $::lx_office_conf{features}->{$check} ? $::lx_office_conf{features}->{$check} : $old_defaults{$check};
28
    $self->db_query("UPDATE defaults SET $check = ?", bind => [ $check_set ? 1 : 0 ]);
28 29
  }
29 30

  
30
  my $update_column = "UPDATE defaults SET parts_image_css = ?";
31
  $self->db_query($update_column, bind => [ $::lx_office_conf{features}->{parts_image_css} ]);
31
  if (exists $::lx_office_conf{features}->{parts_image_css}) {
32
    my $update_column = "UPDATE defaults SET parts_image_css = ?";
33
    $self->db_query($update_column, bind => [ $::lx_office_conf{features}->{parts_image_css} ]);
34
  }
32 35

  
33 36
  return 1;
34 37
}

Auch abrufbar als: Unified diff