diff --git a/public/main/admin/user_list.php b/public/main/admin/user_list.php index a67c3355a1..05c8e1047c 100644 --- a/public/main/admin/user_list.php +++ b/public/main/admin/user_list.php @@ -1105,6 +1105,7 @@ $status_options[COURSEMANAGER] = get_lang('Trainer'); $status_options[DRH] = get_lang('Human Resources Manager'); $status_options[SESSIONADMIN] = get_lang('Course sessionsAdmin'); $status_options[PLATFORM_ADMIN] = get_lang('Administrator'); +$status_options[STUDENT_BOSS] = get_lang('RoleStudentBoss'); $form->addSelect( 'keyword_status', diff --git a/public/main/auth/inscription.php b/public/main/auth/inscription.php index 6c578c76af..8aebf08630 100644 --- a/public/main/auth/inscription.php +++ b/public/main/auth/inscription.php @@ -32,10 +32,14 @@ if (false !== $allowedFieldsConfiguration) { $allowedFields['extra_fields'] = isset($allowedFieldsConfiguration['extra_fields']) ? $allowedFieldsConfiguration['extra_fields'] : []; } -$webserviceUrl = api_get_plugin_setting('logintcc', 'webservice_url'); -$hash = api_get_plugin_setting('logintcc', 'hash'); - -if (!empty($webserviceUrl)) { +$pluginTccDirectoryPath = api_get_path(SYS_PLUGIN_PATH) . 'logintcc'; +$isTccEnabled = (is_dir($pluginTccDirectoryPath) && 'true' === api_get_plugin_setting('logintcc', 'tool_enable')); +$webserviceUrl = ''; +$hash = ''; + +if ($isTccEnabled) { + $webserviceUrl = api_get_plugin_setting('logintcc', 'webservice_url'); + $hash = api_get_plugin_setting('logintcc', 'hash'); $htmlHeadXtra[] = '"; diff --git a/public/main/inc/lib/security.lib.php b/public/main/inc/lib/security.lib.php index 51297dbd3f..f0590ced22 100644 --- a/public/main/inc/lib/security.lib.php +++ b/public/main/inc/lib/security.lib.php @@ -548,7 +548,7 @@ class Security ]; $passwordRequirements = api_get_setting('security.password_requirements', true); - if (!empty($passwordRequirements)) { + if (is_array($passwordRequirements)) { $requirements = $passwordRequirements; } diff --git a/public/main/inc/lib/sessionmanager.lib.php b/public/main/inc/lib/sessionmanager.lib.php index ef5cb28b80..0a28e34b0a 100644 --- a/public/main/inc/lib/sessionmanager.lib.php +++ b/public/main/inc/lib/sessionmanager.lib.php @@ -743,7 +743,7 @@ class SessionManager $fieldDataToString = ''; if (!empty($fieldData)) { foreach ($fieldData as $data) { - $fieldDataArray[] = $data['value']; + $fieldDataArray[] = $data['field_value']; } $fieldDataToString = implode(', ', $fieldDataArray); } @@ -832,7 +832,7 @@ class SessionManager $fieldDataToString = ''; if (!empty($fieldData)) { foreach ($fieldData as $data) { - $fieldDataArray[] = $data['value']; + $fieldDataArray[] = $data['field_value']; } $fieldDataToString = implode(', ', $fieldDataArray); } @@ -9717,7 +9717,7 @@ class SessionManager 'url' => api_get_path(WEB_CODE_PATH).'session/session_list_simple.php?list_type=complete', ],*/ ]; - + $default = null; switch ($listType) { case 'all': $default = 1; diff --git a/public/main/inc/lib/usermanager.lib.php b/public/main/inc/lib/usermanager.lib.php index 302f6c7cf2..a64668685c 100644 --- a/public/main/inc/lib/usermanager.lib.php +++ b/public/main/inc/lib/usermanager.lib.php @@ -334,9 +334,9 @@ class UserManager $userFieldValue->saveFieldValues( $extra, true, - null, - null, - null, + false, + [], + [], true ); } else { diff --git a/public/main/search/load_search.php b/public/main/search/load_search.php index 48ed34bf40..eb1b748ced 100644 --- a/public/main/search/load_search.php +++ b/public/main/search/load_search.php @@ -508,6 +508,22 @@ $userForm->addButtonSave(get_lang('Save'), 'submit_partial[collapseEight]'); $userForm->addEndPanel(); $form->addButtonSave(get_lang('Save Diagnostic Changes'), 'save'); + +// Get list of session status +if (api_get_configuration_value('allow_session_status')) { + $statusList = SessionManager::getStatusList(); + $statusSelectList[0] = ' -- '.get_lang('All').' --'; + foreach ($statusList as $nro => $name) { + $statusSelectList[$nro] = $name; + } + $form->addSelect( + 'filter_status', + get_lang('SessionStatus'), + $statusSelectList, + ['id' => 'filter_status'] + ); +} + $form->addButtonSearch(get_lang('Search Sessions'), 'search'); $extraFieldsToFilter = $extraField->get_all(['variable = ?' => 'temps_de_travail']); @@ -579,17 +595,6 @@ if (!empty($filters)) { if ($count > 5) { if (isset($filters[$column['name']])) { $defaultValues['jqg'.$countExtraField] = $filters[$column['name']]; - /*switch ($column['name']) { - case 'extra_theme_it': - case 'extra_theme_de': - case 'extra_theme_es': - case 'extra_theme_fr': - break; - case 'extra_domaine': - break; - case '': - break; - }*/ $filterToSend['rules'][] = [ 'field' => $column['name'], 'op' => 'cn', @@ -656,6 +661,10 @@ if ($form->validate()) { } } } + + if (!empty($_REQUEST['filter_status'])) { + $filterToSend['filter_status'] = (int) $_REQUEST['filter_status']; + } } if ($save) { @@ -968,7 +977,7 @@ if (!empty($filterToSend)) { $filterToSend = json_encode($filterToSend); $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&load_extra_field='. - $extraFieldListToString.'&_force_search=true&rows=20&page=1&sidx=&sord=asc&filters2='.$filterToSend; + $extraFieldListToString.'&filters2='.$filterToSend; if (isset($params['search_using_2'])) { $url .= '&lang='.$lang; } @@ -1130,6 +1139,9 @@ if ($data) { } $numHours = $total - $sumHours; +if ($numHours < 0) { + $numHours = 0; +} $headers = [ get_lang('Total Available Hours') => $total, get_lang('Sum Hours Sessions Subscribed') => $sumHours, diff --git a/public/main/search/search.php b/public/main/search/search.php index 3e625512b8..a1bdfdbba3 100644 --- a/public/main/search/search.php +++ b/public/main/search/search.php @@ -44,7 +44,10 @@ if ($diagnosisComplete && isset($diagnosisComplete['value']) && 1 == $diagnosisC } } -$hide = true; +$hide = false; +$defaultValueStatus = ''; +/* +$hide = false; if (false !== $wantStage) { $hide = 'yes' === $wantStage['value']; } @@ -53,6 +56,7 @@ $defaultValueStatus = 'extraFiliere.hide()'; if (false === $hide) { $defaultValueStatus = ''; } +*/ $url = api_get_path(WEB_AJAX_PATH).'extra_field.ajax.php?a=order&user_id='.$userId; @@ -80,19 +84,31 @@ switch ($targetLanguage) { break; } -$htmlHeadXtra[] = ' +