5 [% INCLUDE 'common/flash.html' %]
7 <h1>[% HTML.escape(title) %]</h1>
9 <form method="post" action="controller.pl" id="form">
10 [% L.hidden_tag("client.id", SELF.client.id) %]
11 [% L.hidden_tag("action", "") %]
15 <table class="tbl-horizontal">
16 <caption>[% LxERP.t8("Settings") %]</caption>
17 <colgroup><col class="wi-normal"><col class="wi-normal"></colgroup>
19 [% IF SELF.client.id %]
21 <th>[% LxERP.t8('Database ID') %]</th>
22 <td>[% HTML.escape(SELF.client.id) %]</td>
26 <th>[% LxERP.t8('Client name') %]</th>
27 <td>[% L.input_tag("client.name", SELF.client.name, class="initial_focus") %]</td>
30 <th>[% LxERP.t8('Default client') %]</th>
31 <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>
34 <th>[% LxERP.t8('Database name') %]</th>
35 <td>[% L.input_tag("client.dbname", SELF.client.dbname, class="contains_dbsettings") %]</td>
38 <th>[% LxERP.t8('Database host and port') %]</th>
39 <td> [% L.input_tag("client.dbhost", SELF.client.dbhost, class="contains_dbsettings") %] [% L.input_tag("client.dbport", SELF.client.dbport, class="contains_dbsettings", size=6) %] </td>
42 <th>[% LxERP.t8('Database user and password') %]</th>
43 <td>[% L.input_tag("client.dbuser", SELF.client.dbuser, class="contains_dbsettings") %] [% L.input_tag("client.dbpasswd", SELF.client.dbpasswd, class="contains_dbsettings", type="password") %] </td>
46 <th>[% LxERP.t8("Run task server for this client with the following user") %]</th>
47 <td>[% L.select_tag("client.task_server_user_id", SELF.all_users, with_empty=1, empty_title=LxERP.t8("Do not run the task server for this client"), title_key="login", default=SELF.client.task_server_user_id) %] </td>
54 <div class="buttons">[% L.button_tag("test_database_connectivity()", LxERP.t8("Test database connectivity")) %] </div>
61 <h3>[% LxERP.t8("Access to clients") %]</h3>
63 [% IF SELF.all_users.size %]
64 <p> [% LxERP.t8("The following users will have access to this client") %]: </p>
65 <div class="clearfix">
66 [% L.select_tag("client.users[]", SELF.all_users, id="client_users", title_key="login", default=SELF.client.users, default_value_key='id', multiple=1) %]
67 [% L.multiselect2side("client_users", labelsx => LxERP.t8("All users"), labeldx => LxERP.t8("Users that have access to this client")) %]
71 <p> [% LxERP.t8("No users have been created yet.") %] </p>
79 <h3>[% LxERP.t8("Group assignment") %]</h3>
81 [% IF SELF.all_groups.size %]
82 <p> [% LxERP.t8("The following groups are valid for this client") %]: </p>
83 <div class="clearfix">
84 [% L.select_tag("client.groups[]", SELF.all_groups, id="client_groups", title_key="name", default=SELF.client.groups, default_value_key='id', multiple=1) %]
85 [% L.multiselect2side("client_groups", labelsx => LxERP.t8("All groups"), labeldx => LxERP.t8("Groups valid for this client")) %]
89 <p> [% LxERP.t8("No groups have been created yet.") %] </p>
98 [% L.link(SELF.url_for(action="show"), LxERP.t8("Back"), class="button neutral") %]
99 [% L.button_tag("submit_with_action('save_client')", LxERP.t8("Save")) %]
100 [% IF SELF.client.id %]
101 [% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
102 [% L.button_tag("submit_with_action('delete_client')", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
108 <script type="text/javascript">
110 function submit_with_action(action) {
111 $("#action").val("Admin/" + action);
115 function save_as_new() {
116 var new_client_name = prompt("[% LxERP.t8("Please enter the name for the new client.") %]", "");
117 if (!new_client_name)
120 $("#client_name").val(new_client_name);
121 $("#client_id").val("");
122 submit_with_action("save_client");
125 function test_database_connectivity() {
127 url: 'controller.pl?action=Admin/test_database_connectivity',
128 data: $(".contains_dbsettings").serialize(),
130 id: 'test_db_connection_window',
131 dialog: { title: kivi.t8('Database Connection Test') }