Fix course group editing - refs BT#11564

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent fc15628be6
commit 42a028a26a
  1. 10
      main/group/group_creation.php
  2. 2
      main/group/settings.php

@ -39,11 +39,6 @@ if (isset($_POST['action'])) {
if (!empty($_POST['same_places'])) {
$group['places'] = $_POST['group_0_places'];
}
if (api_get_setting('allow_group_categories') == 'false') {
$group['category'] = 0;
} elseif (isset($_POST['same_category']) && $_POST['same_category']) {
$group['category'] = $_POST['group_0_category'];
}
GroupManager::create_group(
$group['name'],
@ -199,7 +194,10 @@ EOT;
$cat_options,
array('id' => 'category_'.$group_number)
);
}
} else {
$group_el[] = $form->createElement('hidden', 'group_'.$group_number.'_category', 0);
$defaults['group_'.$group_number.'_category'] = array_keys($cat_options)[0];
}
$group_el[] = $form->createElement(
'text',
'group_'.$group_number.'_places',

@ -48,6 +48,8 @@ if (api_get_setting('allow_group_categories') == 'true') {
$categoryList[$category['id']] = $category['title'];
}
$form->addElement('select', 'category_id', get_lang('Category'), $categoryList);
} else {
$form->addHidden('category_id', 0);
}
// Members per group

Loading…
Cancel
Save