2 [%- USE L %][%- USE LxERP -%]
 
   4 [%- INCLUDE 'common/flash.html' %]
 
   6 <h1>[% HTML.escape(title) %]</h1>
 
   8 <form method="post" action="controller.pl" id="form">
 
   9  [% L.hidden_tag("group.id", SELF.group.id) %]
 
  10  [% L.hidden_tag("action", "") %]
 
  12  <h2>[%- LxERP.t8("Settings") %]</h2>
 
  16    <th align="right">[% LxERP.t8('Name') %]</th>
 
  17    <td>[% L.input_tag("group.name", SELF.group.name, class="initial_focus") %]</td>
 
  21    <th align="right">[% LxERP.t8('Description') %]</th>
 
  22    <td>[% L.input_tag("group.description", SELF.group.description) %]</td>
 
  26  <h2>[% LxERP.t8("Access rights") %]</h2>
 
  28  [% SET granted_rights = SELF.group.rights_map %]
 
  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>
 
  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) %]
 
  45  <h2>[%- LxERP.t8("Group membership") %]</h2>
 
  47 [% IF SELF.all_users.size %]
 
  49   [%- LxERP.t8("The following users are a member of this group") %]:
 
  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")) %]
 
  59   [% LxERP.t8("No users have been created yet.") %]
 
  63  <h2>[%- LxERP.t8("Group assignment") %]</h2>
 
  65 [% IF SELF.all_clients.size %]
 
  67   [%- LxERP.t8("This group is valid for the following clients") %]:
 
  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")) %]
 
  77   [% LxERP.t8("No clients have been created yet.") %]
 
  84  [% L.link(SELF.url_for(action="show"), LxERP.t8("Back")) %]
 
  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?")) %]
 
  95 <script type="text/javascript">
 
  97   function submit_with_action(action) {
 
  98     $("#action").val("Admin/" + action);
 
 102   function save_as_new() {
 
 103     var new_group_name = prompt("[% LxERP.t8("Please enter the name for the new group.") %]", "");
 
 107     $("#group_name").val(new_group_name);
 
 108     $("#group_id").val("");
 
 109     submit_with_action("save_group");