--- /dev/null
+# @tag: defaults_feature
+# @description: Einstellen der Feature vom Config-File in die DB verlagern.
+# @depends: release_3_0_0
+package SL::DBUpgrade2::defaults_feature;
+
+use utf8;
+
+use parent qw(SL::DBUpgrade2::Base);
+use strict;
+
+sub run {
+ my ($self) = @_;
+
+ # this query will fail if column already exist (new database)
+ $self->db_query(qq|ALTER TABLE defaults ADD COLUMN webdav boolean DEFAULT false|);
+ $self->db_query(qq|ALTER TABLE defaults ADD COLUMN webdav_documents boolean DEFAULT false|);
+ $self->db_query(qq|ALTER TABLE defaults ADD COLUMN vertreter boolean DEFAULT false|);
+ $self->db_query(qq|ALTER TABLE defaults ADD COLUMN parts_show_image boolean DEFAULT true|);
+ $self->db_query(qq|ALTER TABLE defaults ADD COLUMN parts_listing_image boolean DEFAULT true|);
+ $self->db_query(qq|ALTER TABLE defaults ADD COLUMN parts_image_css text DEFAULT 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;'|);
+
+ # check current configuration and set default variables accordingly, so that
+ # kivitendo's behaviour isn't changed by this update
+ # if checks are not set in config set it to true
+ foreach my $check (qw(webdav vertreter parts_show_image parts_listing_image)) {
+ my $check_set = $::lx_office_conf{features}->{$check} ? 1 : 0;
+ $self->db_query("UPDATE defaults SET $check = ?", bind => [ $check_set ]);
+ }
+
+ my $update_column = "UPDATE defaults SET parts_image_css = ?";
+ $self->db_query($update_column, bind => [ $::lx_office_conf{features}->{parts_image_css} ]);
+
+ return 1;
+}
+
+1;
--- /dev/null
+[%- USE LxERP -%][%- USE L -%]
+<div id="features">
+ <table>
+ <tr>
+ <td align="right">[% LxERP.t8('Webdav') %]</td>
+ <td>[% L.yes_no_tag('defaults.webdav', SELF.defaults.webdav) %]</td>
+ <td>[% LxERP.t8('Use Webdav Repository') %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% LxERP.t8('Webdav save documents') %]</td>
+ <td>[% L.yes_no_tag('defaults.webdav_documents', SELF.defaults.webdav_documents) %]</td>
+ <td>[% LxERP.t8('Save document in webdav repository') %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% LxERP.t8('Vertreter') %]</td>
+ <td>[% L.yes_no_tag('defaults.vertreter', SELF.defaults.vertreter) %]</td>
+ <td>[% LxERP.t8('Representative for Customer') %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% LxERP.t8('Pictures for parts') %]</td>
+ <td>[% L.yes_no_tag('defaults.parts_show_image', SELF.defaults.parts_show_image) %]</td>
+ <td>[% LxERP.t8('Show the picture in the part form') %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% LxERP.t8('Pictures for search parts') %]</td>
+ <td>[% L.yes_no_tag('defaults.parts_listing_image', SELF.defaults.parts_listing_image) %]</td>
+ <td>[% LxERP.t8('Show the pictures in the result for search parts') %]</td>
+ </tr>
+ <tr>
+ <td align="right">[% LxERP.t8('CSS style for pictures') %]</td>
+ <td> [% L.input_tag('defaults.parts_image_css', SELF.defaults.parts_image_css, style=style) %]</td>
+ <td>[% LxERP.t8('Style the picture with the following CSS code') %]</td>
+ </tr>
+ </table>
+</div>