]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/admin/delete_dataset.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / admin / delete_dataset.html
1 [% USE HTML %]
2 [% USE LxERP %]
3 [% USE L %]
4 [% USE JavaScript %]
5
6 [% INCLUDE 'common/flash.html' %]
7
8 <h1>[% HTML.escape(title) %]</h1>
9
10 <p>
11   [% LxERP.t8('You can only delete datasets that are not in use.') %]
12   [% 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.') %]
13 </p>
14
15 [% IF SELF.all_dbsources.size %]
16
17 <form method="post" action="controller.pl">
18 <p>
19   [% LxERP.t8('Please select the dataset you want to delete:') %]
20   [% L.select_tag('db', SELF.all_dbsources, class="initial_focus") %]
21 </p>
22
23 [% L.hidden_tag("dbhost", FORM.dbhost) %]
24 [% L.hidden_tag("dbport", FORM.dbport) %]
25 [% L.hidden_tag("dbuser", FORM.dbuser) %]
26 [% L.hidden_tag("dbpasswd", FORM.dbpasswd) %]
27 [% L.hidden_tag("dbdefault", FORM.dbdefault) %]
28 [% L.hidden_tag("action", "Admin/do_delete_dataset") %]
29
30 <div class="buttons">[% L.submit_tag('dummy', LxERP.t8('Delete Dataset'), id='submit') %]</div>
31
32 </form>
33
34 <script type="text/javascript"><!--
35
36 var used_dbsources = {[% FOREACH client = SELF.all_clients %]
37   "[% JavaScript.escape(client.dbhost || 'localhost') %]:[% JavaScript.escape(client.dbport || '5432') %]:[% JavaScript.escape(client.dbname || 'localhost') %]": "[% JavaScript.escape(client.name) %]"[% UNLESS loop.last %],[% END %][% END %]
38 };
39
40 $(function() {
41   $('#submit').click(function() {
42     var client   = used_dbsources[$('#dbhost').val() + ':' + $('#dbport').val() + ':' + $('#db').val()];
43     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 ]);
44
45     return confirm(question);
46   });
47 });
48
49 --></script>
50
51 [% END %]