Revision a0da7f1d
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
sql/Pg-upgrade2/defaults_feature.pl | ||
---|---|---|
1 |
# @tag: defaults_feature |
|
2 |
# @description: Einstellen der Feature vom Config-File in die DB verlagern. |
|
3 |
# @depends: release_3_0_0 |
|
4 |
package SL::DBUpgrade2::defaults_feature; |
|
5 |
|
|
6 |
use utf8; |
|
7 |
|
|
8 |
use parent qw(SL::DBUpgrade2::Base); |
|
9 |
use strict; |
|
10 |
|
|
11 |
sub run { |
|
12 |
my ($self) = @_; |
|
13 |
|
|
14 |
# this query will fail if column already exist (new database) |
|
15 |
$self->db_query(qq|ALTER TABLE defaults ADD COLUMN webdav boolean DEFAULT false|); |
|
16 |
$self->db_query(qq|ALTER TABLE defaults ADD COLUMN webdav_documents boolean DEFAULT false|); |
|
17 |
$self->db_query(qq|ALTER TABLE defaults ADD COLUMN vertreter boolean DEFAULT false|); |
|
18 |
$self->db_query(qq|ALTER TABLE defaults ADD COLUMN parts_show_image boolean DEFAULT true|); |
|
19 |
$self->db_query(qq|ALTER TABLE defaults ADD COLUMN parts_listing_image boolean DEFAULT true|); |
|
20 |
$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;'|); |
|
21 |
|
|
22 |
# check current configuration and set default variables accordingly, so that |
|
23 |
# kivitendo's behaviour isn't changed by this update |
|
24 |
# if checks are not set in config set it to true |
|
25 |
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 ]); |
|
28 |
} |
|
29 |
|
|
30 |
my $update_column = "UPDATE defaults SET parts_image_css = ?"; |
|
31 |
$self->db_query($update_column, bind => [ $::lx_office_conf{features}->{parts_image_css} ]); |
|
32 |
|
|
33 |
return 1; |
|
34 |
} |
|
35 |
|
|
36 |
1; |
templates/webpages/client_config/_features.html | ||
---|---|---|
1 |
[%- USE LxERP -%][%- USE L -%] |
|
2 |
<div id="features"> |
|
3 |
<table> |
|
4 |
<tr> |
|
5 |
<td align="right">[% LxERP.t8('Webdav') %]</td> |
|
6 |
<td>[% L.yes_no_tag('defaults.webdav', SELF.defaults.webdav) %]</td> |
|
7 |
<td>[% LxERP.t8('Use Webdav Repository') %]</td> |
|
8 |
</tr> |
|
9 |
<tr> |
|
10 |
<td align="right">[% LxERP.t8('Webdav save documents') %]</td> |
|
11 |
<td>[% L.yes_no_tag('defaults.webdav_documents', SELF.defaults.webdav_documents) %]</td> |
|
12 |
<td>[% LxERP.t8('Save document in webdav repository') %]</td> |
|
13 |
</tr> |
|
14 |
<tr> |
|
15 |
<td align="right">[% LxERP.t8('Vertreter') %]</td> |
|
16 |
<td>[% L.yes_no_tag('defaults.vertreter', SELF.defaults.vertreter) %]</td> |
|
17 |
<td>[% LxERP.t8('Representative for Customer') %]</td> |
|
18 |
</tr> |
|
19 |
<tr> |
|
20 |
<td align="right">[% LxERP.t8('Pictures for parts') %]</td> |
|
21 |
<td>[% L.yes_no_tag('defaults.parts_show_image', SELF.defaults.parts_show_image) %]</td> |
|
22 |
<td>[% LxERP.t8('Show the picture in the part form') %]</td> |
|
23 |
</tr> |
|
24 |
<tr> |
|
25 |
<td align="right">[% LxERP.t8('Pictures for search parts') %]</td> |
|
26 |
<td>[% L.yes_no_tag('defaults.parts_listing_image', SELF.defaults.parts_listing_image) %]</td> |
|
27 |
<td>[% LxERP.t8('Show the pictures in the result for search parts') %]</td> |
|
28 |
</tr> |
|
29 |
<tr> |
|
30 |
<td align="right">[% LxERP.t8('CSS style for pictures') %]</td> |
|
31 |
<td> [% L.input_tag('defaults.parts_image_css', SELF.defaults.parts_image_css, style=style) %]</td> |
|
32 |
<td>[% LxERP.t8('Style the picture with the following CSS code') %]</td> |
|
33 |
</tr> |
|
34 |
</table> |
|
35 |
</div> |
Auch abrufbar als: Unified diff
"konfigurierbare Feature nach defaults migriert (trac 2300) und Dokumentenbelege (2301) in Webdav speichern"
SQL-Upgrade und Edit-Maske. Fehlen noch einige Teile.