2 [%- USE L %][%- USE LxERP -%]
4 [%- INCLUDE 'common/flash.html' %]
6 <h1>[% HTML.escape(title) %]</h1>
8 <p>[% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]</p>
10 <form method="post" action="controller.pl" id="form">
11 [% L.hidden_tag("client.id", SELF.client.id) %]
12 [% L.hidden_tag("action", "") %]
14 <h2>[%- LxERP.t8("Settings") %]</h2>
18 <th align="right">[% LxERP.t8('Client name') %]</th>
19 <td>[% L.input_tag("client.name", SELF.client.name) %]</td>
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>
28 <th align="right">[% LxERP.t8('Database name') %]</th>
29 <td>[% L.input_tag("client.dbname", SELF.client.dbname, 'data-dbsettings'=1) %]</td>
33 <th align="right">[% LxERP.t8('Database host and port') %]</th>
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) %]
41 <th align="right">[% LxERP.t8('Database user and password') %]</th>
43 [% L.input_tag("client.dbuser", SELF.client.dbuser, 'data-dbsettings'=1) %]
44 [% L.input_tag("client.dbpasswd", SELF.client.dbpasswd, 'data-dbsettings'=1) %]
50 [% L.button_tag("test_database_connectivity()", LxERP.t8("Test database connectivity")) %]
53 <h2>[%- LxERP.t8("Access to clients") %]</h2>
55 [% IF SELF.all_users.size %]
57 [%- LxERP.t8("The following users will have access to this client") %]:
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")) %]
67 [% LxERP.t8("No users have been created yet.") %]
71 <h2>[%- LxERP.t8("Group assignment") %]</h2>
73 [% IF SELF.all_groups.size %]
75 [%- LxERP.t8("The following groups are valid for this client") %]:
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")) %]
85 [% LxERP.t8("No groups have been created yet.") %]
92 [% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
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?")) %]
103 <script type="text/javascript">
105 function submit_with_action(action) {
106 $("#action").val("Admin/" + action);
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)
115 $("#client_name").val(new_client_name);
116 $("#client_id").val("");
117 submit_with_action("save_client");
120 function test_database_connectivity() {
122 url: 'controller.pl?action=Admin/test_database_connectivity',
123 data: $("INPUT[data-dbsettings=1]").serialize(),