|
|
@ -304,9 +304,10 @@ if ($form->validate()) { |
|
|
|
$parentData = $skillModel->get($parentId); |
|
|
|
$parentData = $skillModel->get($parentId); |
|
|
|
|
|
|
|
|
|
|
|
$data = $extraFieldValue->get_values_by_handler_and_field_variable($parentId, 'children_auto_threshold'); |
|
|
|
$data = $extraFieldValue->get_values_by_handler_and_field_variable($parentId, 'children_auto_threshold'); |
|
|
|
if (!empty($data) && !empty($data['value'])) { |
|
|
|
$sendEmail = true; |
|
|
|
|
|
|
|
if ($sendEmail) { |
|
|
|
// Search X children |
|
|
|
// Search X children |
|
|
|
$requiredSkills = $data['value']; |
|
|
|
$requiredSkills = isset($data['value']) ? (int) $data['value'] : 0; |
|
|
|
$children = $skillRelSkill->getChildren($parentId); |
|
|
|
$children = $skillRelSkill->getChildren($parentId); |
|
|
|
$counter = 0; |
|
|
|
$counter = 0; |
|
|
|
foreach ($children as $child) { |
|
|
|
foreach ($children as $child) { |
|
|
@ -321,7 +322,7 @@ if ($form->validate()) { |
|
|
|
Display::addFlash(Display::return_message(get_lang('Message Sent'))); |
|
|
|
Display::addFlash(Display::return_message(get_lang('Message Sent'))); |
|
|
|
$url = api_get_path(WEB_CODE_PATH).'skills/assign.php?user='.$userId.'&id='.$parentId; |
|
|
|
$url = api_get_path(WEB_CODE_PATH).'skills/assign.php?user='.$userId.'&id='.$parentId; |
|
|
|
$link = Display::url($url, $url); |
|
|
|
$link = Display::url($url, $url); |
|
|
|
$subject = get_lang('A student has obtained the number of sub-skills needed to validate the mother skill.'); |
|
|
|
$subject = get_lang('A student has obtained the number of sub-skills needed to validate the mother skill'); |
|
|
|
$message = sprintf( |
|
|
|
$message = sprintf( |
|
|
|
get_lang('Learner %s has enough sub-skill to get skill %s . To assign this skill it is possible to go here : %s'), |
|
|
|
get_lang('Learner %s has enough sub-skill to get skill %s . To assign this skill it is possible to go here : %s'), |
|
|
|
UserManager::formatUserFullName($user), |
|
|
|
UserManager::formatUserFullName($user), |
|
|
@ -352,17 +353,6 @@ if ($form->validate()) { |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
Display::addFlash( |
|
|
|
|
|
|
|
Display::return_message( |
|
|
|
|
|
|
|
sprintf( |
|
|
|
|
|
|
|
get_lang('To assign a new skill to this user, click <a href="%s">here</a>'), |
|
|
|
|
|
|
|
api_get_self().'?'.http_build_query(['user' => $user->getId()]) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
'info', |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
header('Location: '.api_get_path(WEB_PATH)."badge/{$skillUser->getId()}"); |
|
|
|
header('Location: '.api_get_path(WEB_PATH)."badge/{$skillUser->getId()}"); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|