]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/admin/edit_user.html
restart apache2 in postinst
[mfinanz.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  [% L.hidden_tag("check_previously_used", "0") %]
12  [% L.hidden_tag("assign_documents", "0") %]
13  [%- SET props=SELF.user.config_values %]
14
15  <h2>[%- LxERP.t8("Settings") %]</h2>
16
17  <table>
18   <tr valign="top">
19    <td>
20     <table>
21      <tr>
22       <th align="right">[% LxERP.t8('Login Name') %]</th>
23       <td>[% L.input_tag("user.login", SELF.user.login, class="initial_focus") %]</td>
24      </tr>
25
26      [%- IF AUTH.can_change_password %]
27      <tr>
28       <th align="right">[% LxERP.t8("New Password") %]</th>
29       <td>[% L.input_tag("new_password", "", type="password") %]</td>
30      </tr>
31      [%- END %]
32
33      <tr>
34       <th align="right">[% LxERP.t8("Name") %]</th>
35       <td>[% L.input_tag("user.config_values.name", props.name) %]</td>
36      </tr>
37
38      <tr>
39       <th align="right">[% LxERP.t8('E-mail') %]</th>
40       <td>[% L.input_tag("user.config_values.email", props.email) %]</td>
41      </tr>
42
43      <tr valign="top">
44       <th align="right">[% LxERP.t8('Signature') %]</th>
45       <td>[% L.textarea_tag("user.config_values.signature", props.signature, rows=3, cols=35, class="texteditor") %]</td>
46      </tr>
47
48      <tr>
49       <th align="right">[% LxERP.t8('Phone') %]</th>
50       <td>[% L.input_tag("user.config_values.tel", props.tel) %]</td>
51      </tr>
52
53      <tr>
54       <th align="right">[% LxERP.t8('Fax') %]</th>
55       <td>[% L.input_tag("user.config_values.fax", props.fax) %]</td>
56      </tr>
57     </table>
58    </td>
59
60    <td>
61     <table>
62      <tr>
63       <th align="right">[% LxERP.t8("Date Format") %]</th>
64       <td>[% L.select_tag("user.config_values.dateformat", SELF.all_dateformats, default=props.dateformat) %]</td>
65      </tr>
66
67      <tr>
68       <th align="right">[% LxERP.t8("Number Format") %]</th>
69       <td>[% L.select_tag("user.config_values.numberformat", SELF.all_numberformats, default=props.numberformat) %]</td>
70      </tr>
71
72      <tr>
73       <th align="right">[% LxERP.t8("Language") %]</th>
74       <td>[% L.select_tag("user.config_values.countrycode", SELF.all_countrycodes, title_key="title", default=props.countrycode) %]</td>
75      </tr>
76
77      <tr>
78       <th align="right">[% LxERP.t8("Stylesheet") %]</th>
79       <td>[% L.select_tag("user.config_values.stylesheet", SELF.all_stylesheets, default=props.stylesheet) %]</td>
80      </tr>
81
82      <tr>
83       <th align="right">[% LxERP.t8("Setup Menu") %]</th>
84       <td>[% L.select_tag("user.config_values.menustyle", SELF.all_menustyles, title_key="title", default=props.menustyle) %]</td>
85      </tr>
86
87      <tr>
88       <th align="right">[% LxERP.t8("Mandatory Departments") %]</th>
89       <td>
90        [% 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) %]
91        [% 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) %]
92       </td>
93      </tr>
94
95     </table>
96    </td>
97   </tr>
98  </table>
99
100  <h2>[%- LxERP.t8("CTI settings") %]</h2>
101
102  <table>
103   <tr>
104    <th align="right">[% LxERP.t8("Phone extension") %]</th>
105    <td>[% L.input_tag("user.config_values.phone_extension", props.phone_extension) %]</td>
106   </tr>
107
108   <tr>
109    <th align="right">[% LxERP.t8("Phone password") %]</th>
110    <td>[% L.input_tag("user.config_values.phone_password", props.phone_password) %]</td>
111   </tr>
112  </table>
113
114  <h2>[%- LxERP.t8("Access to clients") %]</h2>
115
116 [% IF SELF.all_clients.size %]
117  <p>
118   [%- LxERP.t8("This user will have access to the following clients") %]:
119  </p>
120
121  <div class="clearfix">
122   [% L.select_tag("user.clients[]", SELF.all_clients, id="user_clients", title_key="name", default=SELF.user.clients, default_value_key='id', multiple=1) %]
123   [% L.multiselect2side("user_clients", labelsx => LxERP.t8("All clients"), labeldx => LxERP.t8("Clients this user has access to")) %]
124  </div>
125
126 [%- ELSE %]
127  <p>
128   [% LxERP.t8("No clients have been created yet.") %]
129  </p>
130 [%- END %]
131
132  <h2>[%- LxERP.t8("Group membership") %]</h2>
133
134 [% IF SELF.all_groups.size %]
135  <p>
136   [%- LxERP.t8("This user is a member in the following groups") %]:
137  </p>
138
139  <div class="clearfix">
140   [% L.select_tag("user.groups[]", SELF.all_groups, id="user_groups", title_key="name", default=SELF.user.groups, default_value_key='id', multiple=1) %]
141   [% L.multiselect2side("user_groups", labelsx => LxERP.t8("All groups"), labeldx => LxERP.t8("Groups this user is a member in")) %]
142  </div>
143
144 [%- ELSE %]
145  <p>
146   [% LxERP.t8("No groups have been created yet.") %]
147  </p>
148 [%- END %]
149
150 <hr size="3" noshade>
151
152 <p>
153  [% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
154
155  [% L.button_tag("save_new()", LxERP.t8("Save")) %]
156  [% IF SELF.user.id %]
157   [% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
158   [% L.button_tag("submit_delete()", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
159  [%- END %]
160 </p>
161
162 </form>
163
164 <script type="text/javascript">
165  <!--
166   function submit_with_action(action) {
167     $("#action").val("Admin/" + action);
168     $("#form").submit();
169   }
170
171   function submit_delete() {
172 [% SET used_for_task_server_in_clients = SELF.is_user_used_for_task_server(SELF.user) %]
173 [% IF used_for_task_server_in_clients %]
174    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)) %]');
175    return false;
176 [% ELSE %]
177     submit_with_action('delete_user');
178 [% END %]
179   }
180
181   function save() {
182     $("#action").val('Admin/save_user');
183     var data = $('#form').serializeArray();
184     $.post("controller.pl", data, kivi.eval_json_result);
185   }
186
187   function save_new() {
188     $("#check_previously_used").val("1");
189     save();
190   }
191
192   function save_as_new() {
193     $("#user_id").val("");
194     $("#check_previously_used").val("1");
195     save();
196   }
197
198   function show_loginname_previously_used_dialog() {
199     var buttons = {};
200     buttons[kivi.t8('Yes')] = function() {
201       $("#check_previously_used").val("0");
202       $("#assign_documents").val("1");
203       save();
204     };
205     buttons[kivi.t8('No')] = function() {
206       $("#check_previously_used").val("0");
207       save();
208     };
209     buttons[kivi.t8('Cancel')] = function() { $( this ).dialog('close'); };
210
211     kivi.popup_dialog({
212       id: 'loginname_previously_used_dialog',
213       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?'),
214       dialog: {
215         title:  kivi.t8('Login name was previously used'),
216         width:  400,
217         height: 250,
218         buttons: buttons
219       }
220     });
221   }
222    -->
223 </script>