5 [% INCLUDE 'common/flash.html' %]
7 <h1>[% HTML.escape(title) %]</h1>
10 <form method="post" action="controller.pl" id="form">
11 [% L.hidden_tag("group.id", SELF.group.id) %]
12 [% L.hidden_tag("action", "") %]
16 <div class="col wi-wide">
17 <h2>[% LxERP.t8("Settings") %]</h2>
19 <table class="tbl-horizontal">
22 <th>[% LxERP.t8('Name') %]</th>
23 <td>[% L.input_tag("group.name", SELF.group.name, class="initial_focus") %]</td>
26 <th>[% LxERP.t8('Description') %]</th>
27 <td>[% L.input_tag("group.description", SELF.group.description) %]</td>
32 <h2>[% LxERP.t8("Access rights") %]</h2>
34 [% SET granted_rights = SELF.group.rights_map %]
36 [% FOREACH section = SELF.all_rights %]
37 [% SET section_number = loop.count %]
38 [% SET num_checked = 0 %]
39 [% FOREACH right = section.rights %]
40 [% SET name = right.name %]
41 [% IF granted_rights.$name %][% SET num_checked = num_checked + 1 %][% END %]
45 <h3 title="[% LxERP.t8('Select/Deselect all') %]">[% L.checkbox_tag('dummy' _ section_number, label=LxERP.t8('Section "#1"', section.description), checkall='.checkallgroup' _ section_number, checked=(num_checked == section.rights.size), title=LxERP.t8("Select/Deselect")) %]</h3>
46 [% FOREACH right = section.rights %]
47 [% SET name = right.name %]
48 <div>[% L.checkbox_tag("group.rights_map." _ name, label=right.description, checked=granted_rights.$name, class="checkallgroup" _ section_number) %]</div>
56 <h2>[% LxERP.t8("Group membership") %]</h2>
58 [% IF SELF.all_users.size %]
60 <p>[% LxERP.t8("The following users are a member of this group") %]:</p>
61 <!-- vormals:.clearfix -->
62 [% L.select_tag("group.users[]", SELF.all_users, id="group_users", title_key="login", default=SELF.group.users, default_value_key='id', multiple=1) %]
63 [% L.multiselect2side("group_users", labelsx => LxERP.t8("All users"), labeldx => LxERP.t8("Users that are a member in this group")) %]
66 <p>[% LxERP.t8("No users have been created yet.") %]</p>
70 <h2>[% LxERP.t8("Client assignment") %]</h2>
72 [% IF SELF.all_clients.size %]
74 <p>[% LxERP.t8("This group is valid for the following clients") %]:</p>
75 <!-- vormals:.clearfix -->
76 [% L.select_tag("group.clients[]", SELF.all_clients, id="group_clients", title_key="name", default=SELF.group.clients, default_value_key='id', multiple=1) %]
77 [% L.multiselect2side("group_clients", labelsx => LxERP.t8("All clients"), labeldx => LxERP.t8("Clients this Group is valid for")) %]
81 <p>[% LxERP.t8("No clients have been created yet.") %]</p>
86 [% L.link(SELF.url_for(action="show"), LxERP.t8("Back"), class="button neutral") %]
88 [% L.button_tag("submit_with_action('save_group')", LxERP.t8("Save")) %]
89 [% IF SELF.group.id %]
90 [% L.button_tag("save_as_new()", LxERP.t8("Save as new")) %]
91 [% L.button_tag("submit_with_action('delete_group')", LxERP.t8("Delete"), confirm=LxERP.t8("Are you sure?")) %]
97 </div><!-- /.wrapper -->
100 <script type="text/javascript">
102 function submit_with_action(action) {
103 $("#action").val("Admin/" + action);
107 function save_as_new() {
108 var new_group_name = prompt("[% LxERP.t8("Please enter the name for the new group.") %]", "");
112 $("#group_name").val(new_group_name);
113 $("#group_id").val("");
114 submit_with_action("save_group");