[%- USE HTML %]
-[%- USE L %][%- USE LxERP -%]
+[%- USE L %][%- USE LxERP -%][%- USE JavaScript -%]
[%- INCLUDE 'common/flash.html' %]
-<h1>[% title %]</h1>
-
-<p>[% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]</p>
+<h1>[% HTML.escape(title) %]</h1>
<form method="post" action="controller.pl" id="form">
[% L.hidden_tag("user.id", SELF.user.id) %]
<table>
<tr>
<th align="right">[% LxERP.t8('Login Name') %]</th>
- <td>[% L.input_tag("user.login", SELF.user.login) %]</td>
+ <td>[% L.input_tag("user.login", SELF.user.login, class="initial_focus") %]</td>
</tr>
[%- IF AUTH.can_change_password %]
<td>[% L.select_tag("user.config_values.numberformat", SELF.all_numberformats, default=props.numberformat) %]</td>
</tr>
- <tr>
- <th align="right">[% LxERP.t8("Dropdown Limit") %]</th>
- <td>[% L.input_tag("user.config_values.vclimit", props.vclimit) %]</td>
- </tr>
-
<tr>
<th align="right">[% LxERP.t8("Language") %]</th>
<td>[% L.select_tag("user.config_values.countrycode", SELF.all_countrycodes, title_key="title", default=props.countrycode) %]</td>
</tr>
</table>
+ <h2>[%- LxERP.t8("CTI settings") %]</h2>
+
+ <table>
+ <tr>
+ <th align="right">[% LxERP.t8("Phone extension") %]</th>
+ <td>[% L.input_tag("user.config_values.phone_extension", props.phone_extension) %]</td>
+ </tr>
+
+ <tr>
+ <th align="right">[% LxERP.t8("Phone password") %]</th>
+ <td>[% L.input_tag("user.config_values.phone_password", props.phone_password) %]</td>
+ </tr>
+ </table>
+
<h2>[%- LxERP.t8("Access to clients") %]</h2>
[% IF SELF.all_clients.size %]
</p>
<div class="clearfix">
- [% L.select_tag("user.clients[]", SELF.all_clients, id="user_clients", title_key="name", default=SELF.user.clients, default_key='id', multiple=1) %]
+ [% L.select_tag("user.clients[]", SELF.all_clients, id="user_clients", title_key="name", default=SELF.user.clients, default_value_key='id', multiple=1) %]
[% L.multiselect2side("user_clients", labelsx => LxERP.t8("All clients"), labeldx => LxERP.t8("Clients this user has access to")) %]
</div>
</p>
<div class="clearfix">
- [% L.select_tag("user.groups[]", SELF.all_groups, id="user_groups", title_key="name", default=SELF.user.groups, default_key='id', multiple=1) %]
+ [% L.select_tag("user.groups[]", SELF.all_groups, id="user_groups", title_key="name", default=SELF.user.groups, default_value_key='id', multiple=1) %]
[% L.multiselect2side("user_groups", labelsx => LxERP.t8("All groups"), labeldx => LxERP.t8("Groups this user is a member in")) %]
</div>
[% L.button_tag("submit_with_action('save_user')", LxERP.t8("Save")) %]
[% IF SELF.user.id %]
[% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
- [% L.button_tag("submit_with_action('delete_user')", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
+ [% L.button_tag("submit_delete()", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
[%- END %]
</p>
$("#form").submit();
}
- function save_as_new() {
- var new_user_login = prompt("[% LxERP.t8("Please enter the login for the new user.") %]", "");
- if (!new_user_login)
- return;
+ function submit_delete() {
+[% SET used_for_task_server_in_clients = SELF.is_user_used_for_task_server(SELF.user) %]
+[% IF used_for_task_server_in_clients %]
+ alert('[% JavaScript.escape(LxERP.t8('The user cannot be deleted as it is used in the following clients: #1', used_for_task_server_in_clients)) %]');
+ return false;
+[% ELSE %]
+ submit_with_action('delete_user');
+[% END %]
+ }
- $("#user_login").val(new_user_login);
+ function save_as_new() {
$("#user_id").val("");
submit_with_action("save_user");
}