From 491d4069a03ab44a575dbe94c20233b15132e621 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 10 Apr 2015 08:46:55 -0500 Subject: [PATCH 1/2] Allow acces to skill wheel for HRD - refs BT#9720 --- main/admin/skills_wheel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/admin/skills_wheel.php b/main/admin/skills_wheel.php index ed04685f7b..25e1a3ccde 100755 --- a/main/admin/skills_wheel.php +++ b/main/admin/skills_wheel.php @@ -10,7 +10,7 @@ require_once '../inc/global.inc.php'; $this_section = SECTION_PLATFORM_ADMIN; -api_protect_admin_script(); +api_protect_admin_script(false, true); if (api_get_setting('allow_skills_tool') != 'true') { api_not_allowed(); From 0407b402829289ee3215804a1993688e64eca3dd Mon Sep 17 00:00:00 2001 From: Nicolas Ducoulombier Date: Wed, 15 Apr 2015 17:16:15 -0500 Subject: [PATCH 2/2] Fixing admin view's session extra field -ref bt9718 --- plugin/advanced_subscription/src/admin_view.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugin/advanced_subscription/src/admin_view.php b/plugin/advanced_subscription/src/admin_view.php index e7a6a0a186..d25849132d 100644 --- a/plugin/advanced_subscription/src/admin_view.php +++ b/plugin/advanced_subscription/src/admin_view.php @@ -27,21 +27,20 @@ if (!empty($sessionId)) { $sessionList[$sessionId]['selected'] = 'selected="selected"'; $studentList['session']['id'] = $sessionId; // Assign variables - $fieldsArray = array('description', 'target', 'mode', 'publication_end_date', 'recommended_number_of_participants'); + $fieldsArray = array('description', 'target', 'mode', 'publication_end_date', 'recommended_number_of_participants', 'vacancies'); $sessionArray = api_get_session_info($sessionId); $extraSession = new ExtraFieldValue('session'); $extraField = new ExtraField('session'); // Get session fields $fieldList = $extraField->get_all(array( - 'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray + 'field_variable IN ( ?, ?, ?, ?, ?, ?)' => $fieldsArray )); // Index session fields foreach ($fieldList as $field) { $fields[$field['id']] = $field['field_variable']; } - - $mergedArray = array_merge(array($sessionId), array_keys($fields)); - $sessionFieldValueList = $extraSession->get_all(array('session_id = ? field_id IN ( ?, ?, ?, ?, ?, ?, ? )' => $mergedArray)); + $params = array(' session_id = ? ' => $sessionId); + $sessionFieldValueList = $extraSession->get_all(array('where' => $params)); foreach ($sessionFieldValueList as $sessionFieldValue) { // Check if session field value is set in session field list if (isset($fields[$sessionFieldValue['field_id']])) { @@ -73,7 +72,7 @@ if (!empty($sessionId)) { $student['firstname'] . ', ' . $student['lastname'] : $student['lastname'] . ', ' . $student['firstname']; } - $tpl->assign('session', $studentList['session']); + $tpl->assign('session', $sessionArray); $tpl->assign('students', $studentList['students']); }