Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / admin / edit_user.html
index 3a8f129..1676be3 100644 (file)
@@ -1,5 +1,5 @@
 [%- USE HTML %]
-[%- USE L %][%- USE LxERP -%]
+[%- USE L %][%- USE LxERP -%][%- USE JavaScript -%]
 
 [%- INCLUDE 'common/flash.html' %]
 
@@ -40,7 +40,7 @@
 
      <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.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 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_as_new() {
     $("#user_id").val("");
     submit_with_action("save_user");