Revision 85724239
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Controller/Admin.pm | ||
---|---|---|
20 | 20 |
( |
21 | 21 |
'scalar --get_set_init' => [ qw(client user group printer db_cfg is_locked |
22 | 22 |
all_dateformats all_numberformats all_countrycodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers |
23 |
all_dbsources all_unused_dbsources all_accounting_methods all_inventory_systems all_profit_determinations all_charts) ],
|
|
23 |
all_dbsources all_used_dbsources all_accounting_methods all_inventory_systems all_profit_determinations all_charts) ], |
|
24 | 24 |
); |
25 | 25 |
|
26 | 26 |
__PACKAGE__->run_before(\&setup_layout); |
... | ... | |
462 | 462 |
sub init_all_numberformats { [ '1,000.00', '1000.00', '1.000,00', '1000,00' ] } |
463 | 463 |
sub init_all_stylesheets { [ qw(lx-office-erp.css Mobile.css kivitendo.css) ] } |
464 | 464 |
sub init_all_dbsources { [ sort User->dbsources($::form) ] } |
465 |
sub init_all_unused_dbsources { [ sort User->dbsources_unused($::form) ] }
|
|
465 |
sub init_all_used_dbsources { { map { (join(':', $_->dbhost || 'localhost', $_->dbport || 5432, $_->dbname) => $_->name) } @{ $_[0]->all_clients } } }
|
|
466 | 466 |
sub init_all_accounting_methods { [ { id => 'accrual', name => t8('Accrual accounting') }, { id => 'cash', name => t8('Cash accounting') } ] } |
467 | 467 |
sub init_all_inventory_systems { [ { id => 'perpetual', name => t8('Perpetual inventory') }, { id => 'periodic', name => t8('Periodic inventory') } ] } |
468 | 468 |
sub init_all_profit_determinations { [ { id => 'balance', name => t8('Balancing') }, { id => 'income', name => t8('Cash basis accounting') } ] } |
SL/User.pm | ||
---|---|---|
298 | 298 |
$main::lxdebug->leave_sub(); |
299 | 299 |
} |
300 | 300 |
|
301 |
sub dbsources_unused { |
|
302 |
$main::lxdebug->enter_sub(); |
|
303 |
|
|
304 |
my ($self, $form) = @_; |
|
305 |
|
|
306 |
my %dbexcl = map { $_->dbname => 1 } |
|
307 |
grep { ($_->dbhost eq $form->{dbhost}) && ($_->dbport eq $form->{dbport}) } |
|
308 |
@{ SL::DB::Manager::AuthClient->get_all }; |
|
309 |
|
|
310 |
$form->{only_acc_db} = 1; |
|
311 |
|
|
312 |
$dbexcl{$form->{dbdefault}} = 1; |
|
313 |
$dbexcl{$main::auth->{DB_config}->{db}} = 1; |
|
314 |
|
|
315 |
my @dbunused = grep { !$dbexcl{$_} } dbsources("", $form); |
|
316 |
|
|
317 |
$main::lxdebug->leave_sub(); |
|
318 |
|
|
319 |
return @dbunused; |
|
320 |
} |
|
321 |
|
|
322 | 301 |
sub calc_version { |
323 | 302 |
$main::lxdebug->enter_sub(2); |
324 | 303 |
|
js/locale/de.js | ||
---|---|---|
1 | 1 |
namespace("kivi").setupLocale({ |
2 |
"Are you sure?":"Sind Sie sicher?", |
|
2 | 3 |
"The description is missing.":"Die Beschreibung fehlt.", |
3 | 4 |
"The name is missing.":"Der Name fehlt.", |
4 | 5 |
"The name must only consist of letters, numbers and underscores and start with a letter.":"Der Name darf nur aus Buchstaben (keine Umlaute), Ziffern und Unterstrichen bestehen und muss mit einem Buchstaben beginnen.", |
5 |
"The option field is empty.":"Das Optionsfeld ist leer." |
|
6 |
"The option field is empty.":"Das Optionsfeld ist leer.", |
|
7 |
"The selected database is still configured for client \"#1\". If you delete the database that client will stop working until you re-configure it. Do you still want to delete the database?":"Die auswählte Datenbank ist noch für Mandant \"#1\" konfiguriert. Wenn Sie die Datenbank löschen, wird der Mandanten nicht mehr funktionieren, bis er anders konfiguriert wurde. Wollen Sie die Datenbank trotzdem löschen?" |
|
6 | 8 |
}); |
locale/de/all | ||
---|---|---|
2093 | 2093 |
'The selected bank account does not exist anymore.' => 'Das ausgewählte Bankkonto existiert nicht mehr.', |
2094 | 2094 |
'The selected bin does not exist.' => 'Der ausgewählte Lagerplatz existiert nicht.', |
2095 | 2095 |
'The selected currency' => 'Die ausgewählte Währung', |
2096 |
'The selected database is still configured for client "#1". If you delete the database that client will stop working until you re-configure it. Do you still want to delete the database?' => 'Die auswählte Datenbank ist noch für Mandant "#1" konfiguriert. Wenn Sie die Datenbank löschen, wird der Mandanten nicht mehr funktionieren, bis er anders konfiguriert wurde. Wollen Sie die Datenbank trotzdem löschen?', |
|
2096 | 2097 |
'The selected exports have been closed.' => 'Die ausgewählten Exporte wurden abgeschlossen.', |
2097 | 2098 |
'The selected warehouse does not exist.' => 'Das ausgewählte Lager existiert nicht.', |
2098 | 2099 |
'The selected warehouse is empty, or no stocked items where found that match the filter settings.' => 'Das ausgewählte Lager ist leer, oder in ihm wurden keine zu den Sucheinstellungen passenden eingelagerten Artikel gefunden.', |
templates/webpages/admin/delete_dataset.html | ||
---|---|---|
1 |
[%- USE HTML %][%- USE LxERP -%][%- USE L -%] |
|
1 |
[%- USE HTML %][%- USE LxERP -%][%- USE L -%][%- USE JavaScript -%]
|
|
2 | 2 |
|
3 | 3 |
[% INCLUDE 'common/flash.html' %] |
4 | 4 |
|
... | ... | |
11 | 11 |
[% LxERP.t8('If you want to delete such a dataset you have to edit the client(s) that are using the dataset in question and have them use another dataset.') %] |
12 | 12 |
</p> |
13 | 13 |
|
14 |
[% IF SELF.all_unused_dbsources.size %]
|
|
14 |
[% IF SELF.all_dbsources.size %] |
|
15 | 15 |
|
16 | 16 |
<form method="post" action="controller.pl"> |
17 | 17 |
<p> |
18 | 18 |
[% LxERP.t8('Please select the dataset you want to delete:') %] |
19 |
[% L.select_tag('db', SELF.all_unused_dbsources, class="initial_focus") %]
|
|
19 |
[% L.select_tag('db', SELF.all_dbsources, class="initial_focus") %] |
|
20 | 20 |
</p> |
21 | 21 |
|
22 | 22 |
[% L.hidden_tag("dbhost", FORM.dbhost) %] |
... | ... | |
27 | 27 |
[% L.hidden_tag("action", "Admin/do_delete_dataset") %] |
28 | 28 |
|
29 | 29 |
<div> |
30 |
[% L.submit_tag('dummy', LxERP.t8('Delete Dataset'), confirm=LxERP.t8('Are you sure?')) %]
|
|
30 |
[% L.submit_tag('dummy', LxERP.t8('Delete Dataset'), id='submit') %]
|
|
31 | 31 |
</div> |
32 | 32 |
|
33 | 33 |
</form> |
34 | 34 |
|
35 |
<script type="text/javascript"> |
|
36 |
<!-- |
|
37 |
|
|
38 |
var used_dbsources = {[% FOREACH client = SELF.all_clients %] |
|
39 |
"[% JavaScript.escape(client.dbhost || 'localhost') %]:[% JavaScript.escape(client.dbport || '5432') %]:[% JavaScript.escape(client.dbname || 'localhost') %]": "[% JavaScript.escape(client.name) %]"[% UNLESS loop.last %],[% END %][% END %] |
|
40 |
}; |
|
41 |
|
|
42 |
$(function() { |
|
43 |
$('#submit').click(function() { |
|
44 |
var client = used_dbsources[$('#dbhost').val() + ':' + $('#dbport').val() + ':' + $('#db').val()]; |
|
45 |
var question = !client ? kivi.t8('Are you sure?') : kivi.t8('The selected database is still configured for client "#1". If you delete the database that client will stop working until you re-configure it. Do you still want to delete the database?', [ client ]); |
|
46 |
|
|
47 |
return confirm(question); |
|
48 |
}); |
|
49 |
}); |
|
50 |
|
|
51 |
--> |
|
52 |
</script> |
|
53 |
|
|
35 | 54 |
[% END %] |
Auch abrufbar als: Unified diff
Datenbank löschen: auch benutzte auswählbar, dann aber mit Sonderwarnung
Fixt #2312.