Merge branch 'test' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / admin / edit_user.html
1 [%- USE HTML %]
2 [%- USE L %][%- USE LxERP -%][%- USE JavaScript -%]
3
4 [%- INCLUDE 'common/flash.html' %]
5
6 <h1>[% HTML.escape(title) %]</h1>
7
8 <form method="post" action="controller.pl" id="form">
9  [% L.hidden_tag("user.id", SELF.user.id) %]
10  [% L.hidden_tag("action", "") %]
11  [%- SET props=SELF.user.config_values %]
12
13  <h2>[%- LxERP.t8("Settings") %]</h2>
14
15  <table>
16   <tr valign="top">
17    <td>
18     <table>
19      <tr>
20       <th align="right">[% LxERP.t8('Login Name') %]</th>
21       <td>[% L.input_tag("user.login", SELF.user.login, class="initial_focus") %]</td>
22      </tr>
23
24      [%- IF AUTH.can_change_password %]
25      <tr>
26       <th align="right">[% LxERP.t8("New Password") %]</th>
27       <td>[% L.input_tag("new_password", "", type="password") %]</td>
28      </tr>
29      [%- END %]
30
31      <tr>
32       <th align="right">[% LxERP.t8("Name") %]</th>
33       <td>[% L.input_tag("user.config_values.name", props.name) %]</td>
34      </tr>
35
36      <tr>
37       <th align="right">[% LxERP.t8('E-mail') %]</th>
38       <td>[% L.input_tag("user.config_values.email", props.email) %]</td>
39      </tr>
40
41      <tr valign="top">
42       <th align="right">[% LxERP.t8('Signature') %]</th>
43       <td>[% L.textarea_tag("user.config_values.signature", props.signature, rows=3, cols=35, class="texteditor") %]</td>
44      </tr>
45
46      <tr>
47       <th align="right">[% LxERP.t8('Phone') %]</th>
48       <td>[% L.input_tag("user.config_values.tel", props.tel) %]</td>
49      </tr>
50
51      <tr>
52       <th align="right">[% LxERP.t8('Fax') %]</th>
53       <td>[% L.input_tag("user.config_values.fax", props.fax) %]</td>
54      </tr>
55     </table>
56    </td>
57
58    <td>
59     <table>
60      <tr>
61       <th align="right">[% LxERP.t8("Date Format") %]</th>
62       <td>[% L.select_tag("user.config_values.dateformat", SELF.all_dateformats, default=props.dateformat) %]</td>
63      </tr>
64
65      <tr>
66       <th align="right">[% LxERP.t8("Number Format") %]</th>
67       <td>[% L.select_tag("user.config_values.numberformat", SELF.all_numberformats, default=props.numberformat) %]</td>
68      </tr>
69
70      <tr>
71       <th align="right">[% LxERP.t8("Language") %]</th>
72       <td>[% L.select_tag("user.config_values.countrycode", SELF.all_countrycodes, title_key="title", default=props.countrycode) %]</td>
73      </tr>
74
75      <tr>
76       <th align="right">[% LxERP.t8("Stylesheet") %]</th>
77       <td>[% L.select_tag("user.config_values.stylesheet", SELF.all_stylesheets, default=props.stylesheet) %]</td>
78      </tr>
79
80      <tr>
81       <th align="right">[% LxERP.t8("Setup Menu") %]</th>
82       <td>[% L.select_tag("user.config_values.menustyle", SELF.all_menustyles, title_key="title", default=props.menustyle) %]</td>
83      </tr>
84
85      <tr>
86       <th align="right">[% LxERP.t8("Mandatory Departments") %]</th>
87       <td>
88        [% L.radio_button_tag('user.config_values.mandatory_departments', value='0', id='user.config_values.mandatory_departments_0', label=LxERP.t8('No'),  checked=!props.mandatory_departments) %]
89        [% 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) %]
90       </td>
91      </tr>
92     </table>
93    </td>
94   </tr>
95  </table>
96
97  <h2>[%- LxERP.t8("CTI settings") %]</h2>
98
99  <table>
100   <tr>
101    <th align="right">[% LxERP.t8("Phone extension") %]</th>
102    <td>[% L.input_tag("user.config_values.phone_extension", props.phone_extension) %]</td>
103   </tr>
104
105   <tr>
106    <th align="right">[% LxERP.t8("Phone password") %]</th>
107    <td>[% L.input_tag("user.config_values.phone_password", props.phone_password) %]</td>
108   </tr>
109  </table>
110
111  <h2>[%- LxERP.t8("Access to clients") %]</h2>
112
113 [% IF SELF.all_clients.size %]
114  <p>
115   [%- LxERP.t8("This user will have access to the following clients") %]:
116  </p>
117
118  <div class="clearfix">
119   [% L.select_tag("user.clients[]", SELF.all_clients, id="user_clients", title_key="name", default=SELF.user.clients, default_value_key='id', multiple=1) %]
120   [% L.multiselect2side("user_clients", labelsx => LxERP.t8("All clients"), labeldx => LxERP.t8("Clients this user has access to")) %]
121  </div>
122
123 [%- ELSE %]
124  <p>
125   [% LxERP.t8("No clients have been created yet.") %]
126  </p>
127 [%- END %]
128
129  <h2>[%- LxERP.t8("Group membership") %]</h2>
130
131 [% IF SELF.all_groups.size %]
132  <p>
133   [%- LxERP.t8("This user is a member in the following groups") %]:
134  </p>
135
136  <div class="clearfix">
137   [% L.select_tag("user.groups[]", SELF.all_groups, id="user_groups", title_key="name", default=SELF.user.groups, default_value_key='id', multiple=1) %]
138   [% L.multiselect2side("user_groups", labelsx => LxERP.t8("All groups"), labeldx => LxERP.t8("Groups this user is a member in")) %]
139  </div>
140
141 [%- ELSE %]
142  <p>
143   [% LxERP.t8("No groups have been created yet.") %]
144  </p>
145 [%- END %]
146
147 <hr size="3" noshade>
148
149 <p>
150  [% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
151
152  [% L.button_tag("submit_with_action('save_user')", LxERP.t8("Save")) %]
153  [% IF SELF.user.id %]
154   [% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
155   [% L.button_tag("submit_delete()", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
156  [%- END %]
157 </p>
158
159 </form>
160
161 <script type="text/javascript">
162  <!--
163   function submit_with_action(action) {
164     $("#action").val("Admin/" + action);
165     $("#form").submit();
166   }
167
168   function submit_delete() {
169 [% SET used_for_task_server_in_clients = SELF.is_user_used_for_task_server(SELF.user) %]
170 [% IF used_for_task_server_in_clients %]
171    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)) %]');
172    return false;
173 [% ELSE %]
174     submit_with_action('delete_user');
175 [% END %]
176   }
177
178   function save_as_new() {
179     $("#user_id").val("");
180     submit_with_action("save_user");
181   }
182    -->
183 </script>