call_sub($main::form->{"nextsub"});
}
-sub update_dataset {
- my $form = $main::form;
- my $locale = $main::locale;
-
- $form->{title} = "kivitendo " . $locale->text('Database Administration') . " / " . $locale->text('Update Dataset');
-
- my @need_updates = User->dbneedsupdate($form);
- $form->{NEED_UPDATES} = \@need_updates;
- $form->{ALL_UPDATED} = !scalar @need_updates;
-
- $form->header();
- print $form->parse_html_template("admin/update_dataset");
-}
-
-sub dbupdate {
- my $form = $main::form;
- my $locale = $main::locale;
-
- $::request->{layout}->use_stylesheet("lx-office-erp.css");
- $form->{title} = $locale->text("Dataset upgrade");
- $form->header();
-
- my $rowcount = $form->{rowcount} * 1;
- my @update_rows = grep { $form->{"update_$_"} } (1 .. $rowcount);
- $form->{NOTHING_TO_DO} = !scalar @update_rows;
- my $saved_form = save_form();
-
- $| = 1;
-
- print $form->parse_html_template("admin/dbupgrade_all_header");
-
- foreach my $i (@update_rows) {
- restore_form($saved_form);
-
- %::myconfig = ();
- map { $form->{$_} = $::myconfig{$_} = $form->{"${_}_${i}"} } qw(dbname dbhost dbport dbuser dbpasswd);
-
- print $form->parse_html_template("admin/dbupgrade_header");
-
- User->dbupdate($form);
- User->dbupdate2(form => $form, updater => SL::DBUpgrade2->new(form => $form)->parse_dbupdate_controls, database => $form->{dbname});
-
- print $form->parse_html_template("admin/dbupgrade_footer");
- }
-
- print $form->parse_html_template("admin/dbupgrade_all_done");
-}
sub create_dataset {
my $form = $main::form;
+++ /dev/null
-[%- USE T8 %]
-[% USE HTML%][%- USE LxERP -%][%- USE L -%]
-[% IF NOTHING_TO_DO %]
- <p>[% 'No datasets have been selected.' | $T8 %]</p>
-
- [% ELSE %]
-
- <hr>
-
- <p>[% 'All database upgrades have been applied.' | $T8 %]</p>
-[% END %]
-
-<p>[% L.link("controller.pl?action=Admin/show", LxERP.t8("Continue")) %]</p>
+++ /dev/null
-[%- USE T8 %]
-<p>[% '...done' | $T8 %]</p>
+++ /dev/null
-[%- USE T8 %]
-[% USE HTML %]<h1>[% 'Dataset upgrade' | $T8 %] ([% HTML.escape(dbname) %])</h1>
+++ /dev/null
-[%- USE T8 %]
-[%- USE HTML %]
- <h1>[% title %]</h1>
- <p><a href="admin.pl?action=pg_database_administration">[% 'Back' | $T8 %]</a></p>
- [% IF ALL_UPDATED %]
- [% 'All Datasets up to date!' | $T8 %]
-
- [% ELSE %]
-
- <form method="post" action="admin.pl">
-
- <p>[% 'The following Datasets need to be updated' | $T8 %]:</p>
-
- <table>
- <tr>
- <th class="listtop">[% 'Update?' | $T8 %]</th>
- <th class="listtop">[% 'Driver' | $T8 %]</th>
- <th class="listtop">[% 'Host' | $T8 %]</th>
- <th class="listtop">[% 'Port' | $T8 %]</th>
- <th class="listtop">[% 'User' | $T8 %]</th>
- </tr>
-
- [% FOREACH row = NEED_UPDATES %]
- <tr class="listrow[% loop.count % 2 %]">
- <td><input type="checkbox" name="update_[% loop.count %]" id="update_[% loop.count %]" value="1" checked></td>
- <td>
- <input type="hidden" name="dbname_[% loop.count %]" value="[% HTML.escape(row.dbname) %]">
- <label for="update_[% loop.count %]">[% HTML.escape(row.dbname) %]</label>
- </td>
- <td><input type="hidden" name="dbhost_[% loop.count %]" value="[% HTML.escape(row.dbhost) %]">[% HTML.escape(row.dbhost) %]</td>
- <td><input type="hidden" name="dbport_[% loop.count %]" value="[% HTML.escape(row.dbport) %]">[% HTML.escape(row.dbport) %]</td>
- <td><input type="hidden" name="dbuser_[% loop.count %]" value="[% HTML.escape(row.dbuser) %]">[% HTML.escape(row.dbuser) %]</td>
- </tr>
-
- [% END %]
- </table>
-
- <input type="hidden" name="rowcount" value="[% NEED_UPDATES.size %]">
-
- <input name="callback" type="hidden" value="controller.pl?action=Admin/show">
- <input type="hidden" name="nextsub" value="dbupdate">
-
- <hr size="3" noshade>
-
- <br>
-
- <input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]">
-
- </form>
-
- [% END %]