Revision 4bb02c5f
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
bin/mozilla/admin.pl | ||
---|---|---|
134 | 134 |
call_sub($main::form->{"nextsub"}); |
135 | 135 |
} |
136 | 136 |
|
137 |
sub update_dataset { |
|
138 |
my $form = $main::form; |
|
139 |
my $locale = $main::locale; |
|
140 |
|
|
141 |
$form->{title} = "kivitendo " . $locale->text('Database Administration') . " / " . $locale->text('Update Dataset'); |
|
142 |
|
|
143 |
my @need_updates = User->dbneedsupdate($form); |
|
144 |
$form->{NEED_UPDATES} = \@need_updates; |
|
145 |
$form->{ALL_UPDATED} = !scalar @need_updates; |
|
146 |
|
|
147 |
$form->header(); |
|
148 |
print $form->parse_html_template("admin/update_dataset"); |
|
149 |
} |
|
150 |
|
|
151 |
sub dbupdate { |
|
152 |
my $form = $main::form; |
|
153 |
my $locale = $main::locale; |
|
154 |
|
|
155 |
$::request->{layout}->use_stylesheet("lx-office-erp.css"); |
|
156 |
$form->{title} = $locale->text("Dataset upgrade"); |
|
157 |
$form->header(); |
|
158 |
|
|
159 |
my $rowcount = $form->{rowcount} * 1; |
|
160 |
my @update_rows = grep { $form->{"update_$_"} } (1 .. $rowcount); |
|
161 |
$form->{NOTHING_TO_DO} = !scalar @update_rows; |
|
162 |
my $saved_form = save_form(); |
|
163 |
|
|
164 |
$| = 1; |
|
165 |
|
|
166 |
print $form->parse_html_template("admin/dbupgrade_all_header"); |
|
167 |
|
|
168 |
foreach my $i (@update_rows) { |
|
169 |
restore_form($saved_form); |
|
170 |
|
|
171 |
%::myconfig = (); |
|
172 |
map { $form->{$_} = $::myconfig{$_} = $form->{"${_}_${i}"} } qw(dbname dbhost dbport dbuser dbpasswd); |
|
173 |
|
|
174 |
print $form->parse_html_template("admin/dbupgrade_header"); |
|
175 |
|
|
176 |
User->dbupdate($form); |
|
177 |
User->dbupdate2(form => $form, updater => SL::DBUpgrade2->new(form => $form)->parse_dbupdate_controls, database => $form->{dbname}); |
|
178 |
|
|
179 |
print $form->parse_html_template("admin/dbupgrade_footer"); |
|
180 |
} |
|
181 |
|
|
182 |
print $form->parse_html_template("admin/dbupgrade_all_done"); |
|
183 |
} |
|
184 | 137 |
|
185 | 138 |
sub create_dataset { |
186 | 139 |
my $form = $main::form; |
Auch abrufbar als: Unified diff
Admin-Bereich: Funktionen zum Aktualisieren von Datenbanken aus Admin-Bereich entfernt