Admin: Anlegen, Bearbeiten und Löschen von Mandanten implementiert
[kivitendo-erp.git] / templates / webpages / admin / edit_client.html
1 [%- USE HTML %]
2 [%- USE L %][%- USE LxERP -%]
3
4 [%- INCLUDE 'common/flash.html' %]
5
6 <h1>[% HTML.escape(title) %]</h1>
7
8 <p>[% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]</p>
9
10 <form method="post" action="controller.pl" id="form">
11  [% L.hidden_tag("client.id", SELF.client.id) %]
12  [% L.hidden_tag("action", "") %]
13
14  <h2>[%- LxERP.t8("Settings") %]</h2>
15
16  <table>
17   <tr>
18    <th align="right">[% LxERP.t8('Client name') %]</th>
19    <td>[% L.input_tag("client.name", SELF.client.name) %]</td>
20   </tr>
21
22   <tr>
23    <th align="right">[% LxERP.t8('Default client') %]</th>
24    <td>[% L.checkbox_tag("client.is_default", label=LxERP.t8('This is the client to be selected by default on the login screen.'), checked=SELF.client.is_default) %]</td>
25   </tr>
26
27   <tr>
28    <th align="right">[% LxERP.t8('Database name') %]</th>
29    <td>[% L.input_tag("client.dbname", SELF.client.dbname, 'data-dbsettings'=1) %]</td>
30   </tr>
31
32   <tr>
33    <th align="right">[% LxERP.t8('Database host and port') %]</th>
34    <td>
35     [% L.input_tag("client.dbhost", SELF.client.dbhost, 'data-dbsettings'=1) %]
36     [% L.input_tag("client.dbport", SELF.client.dbport, 'data-dbsettings'=1, size=6) %]
37    </td>
38   </tr>
39
40   <tr>
41    <th align="right">[% LxERP.t8('Database user and password') %]</th>
42    <td>
43     [% L.input_tag("client.dbuser",   SELF.client.dbuser, 'data-dbsettings'=1) %]
44     [% L.input_tag("client.dbpasswd", SELF.client.dbpasswd, 'data-dbsettings'=1) %]
45    </td>
46   </tr>
47  </table>
48
49  <div>
50   [% L.button_tag("test_database_connectivity()", LxERP.t8("Test database connectivity")) %]
51  </div>
52
53  <h2>[%- LxERP.t8("Access to clients") %]</h2>
54
55 [% IF SELF.all_users.size %]
56  <p>
57   [%- LxERP.t8("The following users will have access to this client") %]:
58  </p>
59
60  <div class="clearfix">
61   [% L.select_tag("client.users[]", SELF.all_users, id="client_users", title_key="login", default=SELF.client.users, default_key='id', multiple=1) %]
62   [% L.multiselect2side("client_users", labelsx => LxERP.t8("All users"), labeldx => LxERP.t8("Users that have access to this client")) %]
63  </div>
64
65 [%- ELSE %]
66  <p>
67   [% LxERP.t8("No users have been created yet.") %]
68  </p>
69 [%- END %]
70
71  <h2>[%- LxERP.t8("Group assignment") %]</h2>
72
73 [% IF SELF.all_groups.size %]
74  <p>
75   [%- LxERP.t8("The following groups are valid for this client") %]:
76  </p>
77
78  <div class="clearfix">
79   [% L.select_tag("client.groups[]", SELF.all_groups, id="client_groups", title_key="name", default=SELF.client.groups, default_key='id', multiple=1) %]
80   [% L.multiselect2side("client_groups", labelsx => LxERP.t8("All groups"), labeldx => LxERP.t8("Groups valid for this client")) %]
81  </div>
82
83 [%- ELSE %]
84  <p>
85   [% LxERP.t8("No groups have been created yet.") %]
86  </p>
87 [%- END %]
88
89 <hr size="3" noshade>
90
91 <p>
92  [% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
93
94  [% L.button_tag("submit_with_action('save_client')", LxERP.t8("Save")) %]
95  [% IF SELF.client.id %]
96   [% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
97   [% L.button_tag("submit_with_action('delete_client')", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
98  [%- END %]
99 </p>
100
101 </form>
102
103 <script type="text/javascript">
104  <!--
105   function submit_with_action(action) {
106     $("#action").val("Admin/" + action);
107     $("#form").submit();
108   }
109
110   function save_as_new() {
111     var new_client_name = prompt("[% LxERP.t8("Please enter the name for the new client.") %]", "");
112     if (!new_client_name)
113       return;
114
115     $("#client_name").val(new_client_name);
116     $("#client_id").val("");
117     submit_with_action("save_client");
118   }
119
120   function test_database_connectivity() {
121     open_jqm_window({
122       url:  'controller.pl?action=Admin/test_database_connectivity',
123       data: $("INPUT[data-dbsettings=1]").serialize(),
124       type: 'POST'
125     });
126     return true;
127   }
128    -->
129 </script>