[%- USE HTML %]
-[%- USE L %][%- USE LxERP -%]
+[%- USE L %][%- USE LxERP -%][%- USE JavaScript -%]
[%- INCLUDE 'common/flash.html' %]
<form method="post" action="controller.pl" id="form">
[% L.hidden_tag("user.id", SELF.user.id) %]
[% L.hidden_tag("action", "") %]
+ [% L.hidden_tag("check_previously_used", "0") %]
+ [% L.hidden_tag("assign_documents", "0") %]
[%- SET props=SELF.user.config_values %]
<h2>[%- LxERP.t8("Settings") %]</h2>
<tr valign="top">
<th align="right">[% LxERP.t8('Signature') %]</th>
- <td>[% L.textarea_tag("user.config_values.signature", props.signature, rows=3, cols=35) %]</td>
+ <td>[% L.textarea_tag("user.config_values.signature", props.signature, rows=3, cols=35, class="texteditor") %]</td>
</tr>
<tr>
<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>
[% L.radio_button_tag('user.config_values.mandatory_departments', value='1', id='user.config_values.mandatory_departments_1', label=LxERP.t8('Yes'), checked= props.mandatory_departments) %]
</td>
</tr>
+
</table>
</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>
[% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
- [% L.button_tag("submit_with_action('save_user')", LxERP.t8("Save")) %]
+ [% L.button_tag("save_new()", 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 %]
+ }
+
+ function save() {
+ $("#action").val('Admin/save_user');
+ var data = $('#form').serializeArray();
+ $.post("controller.pl", data, kivi.eval_json_result);
+ }
- $("#user_login").val(new_user_login);
+ function save_new() {
+ $("#check_previously_used").val("1");
+ save();
+ }
+
+ function save_as_new() {
$("#user_id").val("");
- submit_with_action("save_user");
+ $("#check_previously_used").val("1");
+ save();
+ }
+
+ function show_loginname_previously_used_dialog() {
+ var buttons = {};
+ buttons[kivi.t8('Yes')] = function() {
+ $("#check_previously_used").val("0");
+ $("#assign_documents").val("1");
+ save();
+ };
+ buttons[kivi.t8('No')] = function() {
+ $("#check_previously_used").val("0");
+ save();
+ };
+ buttons[kivi.t8('Cancel')] = function() { $( this ).dialog('close'); };
+
+ kivi.popup_dialog({
+ id: 'loginname_previously_used_dialog',
+ html: kivi.t8('The login name you entered was previously used. Do you want to assign documents from the former user that had the same username to the new user?'),
+ dialog: {
+ title: kivi.t8('Login name was previously used'),
+ width: 400,
+ height: 250,
+ buttons: buttons
+ }
+ });
}
-->
</script>