Lieferwertbericht um Filter nach Warengruppen erweitert
[kivitendo-erp.git] / templates / webpages / admin / edit_group.html
1 [%- USE HTML %]
2 [%- USE L %][%- USE LxERP -%]
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("group.id", SELF.group.id) %]
10  [% L.hidden_tag("action", "") %]
11
12  <h2>[%- LxERP.t8("Settings") %]</h2>
13
14  <table>
15   <tr>
16    <th align="right">[% LxERP.t8('Name') %]</th>
17    <td>[% L.input_tag("group.name", SELF.group.name, class="initial_focus") %]</td>
18   </tr>
19
20   <tr>
21    <th align="right">[% LxERP.t8('Description') %]</th>
22    <td>[% L.input_tag("group.description", SELF.group.description) %]</td>
23   </tr>
24  </table>
25
26  <h2>[% LxERP.t8("Access rights") %]</h2>
27
28  [% SET granted_rights = SELF.group.rights_map %]
29
30  [%- FOREACH section = SELF.all_rights %]
31   [% SET section_number = loop.count %]
32   [% SET num_checked = 0 %]
33   [% FOREACH right = section.rights %][% SET name = right.name %][% IF granted_rights.$name %][% SET num_checked = num_checked + 1 %][% END %][% END %]
34   <h3>[% L.checkbox_tag('dummy' _ section_number, label=LxERP.t8('Section "#1"', section.description), checkall='.checkallgroup' _ section_number, checked=(num_checked == section.rights.size)) %]</h3>
35
36   <div class="clearfix">
37    [% FOREACH right = section.rights %]
38     [% SET name = right.name %]
39     [% L.checkbox_tag("group.rights_map." _ name, label=right.description, checked=granted_rights.$name, class="checkallgroup" _ section_number) %]
40     <br>
41    [%- END %]
42   </div>
43  [%- END %]
44
45  <h2>[%- LxERP.t8("Group membership") %]</h2>
46
47 [% IF SELF.all_users.size %]
48  <p>
49   [%- LxERP.t8("The following users are a member of this group") %]:
50  </p>
51
52  <div class="clearfix">
53   [% L.select_tag("group.users[]", SELF.all_users, id="group_users", title_key="login", default=SELF.group.users, default_value_key='id', multiple=1) %]
54   [% L.multiselect2side("group_users", labelsx => LxERP.t8("All users"), labeldx => LxERP.t8("Users that are a member in this group")) %]
55  </div>
56
57 [%- ELSE %]
58  <p>
59   [% LxERP.t8("No users have been created yet.") %]
60  </p>
61 [%- END %]
62
63  <h2>[%- LxERP.t8("Client assignment") %]</h2>
64
65 [% IF SELF.all_clients.size %]
66  <p>
67   [%- LxERP.t8("This group is valid for the following clients") %]:
68  </p>
69
70  <div class="clearfix">
71   [% L.select_tag("group.clients[]", SELF.all_clients, id="group_clients", title_key="name", default=SELF.group.clients, default_value_key='id', multiple=1) %]
72   [% L.multiselect2side("group_clients", labelsx => LxERP.t8("All clients"), labeldx => LxERP.t8("Clients this Group is valid for")) %]
73  </div>
74
75 [%- ELSE %]
76  <p>
77   [% LxERP.t8("No clients have been created yet.") %]
78  </p>
79 [%- END %]
80
81 <hr size="3" noshade>
82
83 <p>
84  [% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
85
86  [% L.button_tag("submit_with_action('save_group')", LxERP.t8("Save")) %]
87  [% IF SELF.group.id %]
88   [% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
89   [% L.button_tag("submit_with_action('delete_group')", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
90  [%- END %]
91 </p>
92
93 </form>
94
95 <script type="text/javascript">
96  <!--
97   function submit_with_action(action) {
98     $("#action").val("Admin/" + action);
99     $("#form").submit();
100   }
101
102   function save_as_new() {
103     var new_group_name = prompt("[% LxERP.t8("Please enter the name for the new group.") %]", "");
104     if (!new_group_name)
105       return;
106
107     $("#group_name").val(new_group_name);
108     $("#group_id").val("");
109     submit_with_action("save_group");
110   }
111    -->
112 </script>