From 1444f088639aa378b1e2718e274336974cf7eed6 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 16 Jan 2018 20:24:33 +0100 Subject: [PATCH 1/6] Update user_id to id in user profile edition --- main/auth/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/auth/profile.php b/main/auth/profile.php index 20222d7cde..04a0d98339 100755 --- a/main/auth/profile.php +++ b/main/auth/profile.php @@ -685,7 +685,7 @@ if ($form->validate()) { $sql .= ", official_code = '".Database::escape_string($user_data['official_code'])."'"; } - $sql .= " WHERE user_id = '".api_get_user_id()."'"; + $sql .= " WHERE id = '".api_get_user_id()."'"; Database::query($sql); if ($passwordWasChecked == false) { From 984291c44913939311b37ce885d32f0213d8f65a Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 16 Jan 2018 21:26:54 +0100 Subject: [PATCH 2/6] Fix issue updating all users from survey profile form - refs #2331 --- main/survey/fillsurvey.php | 1 + 1 file changed, 1 insertion(+) diff --git a/main/survey/fillsurvey.php b/main/survey/fillsurvey.php index 6b0c143f3d..540a03a44d 100755 --- a/main/survey/fillsurvey.php +++ b/main/survey/fillsurvey.php @@ -560,6 +560,7 @@ if ($survey_data['form_fields'] && } // Remove trailing , from the query we have so far $sql = rtrim($sql, ','); + $sql .= " WHERE id = $user_id"; if ($update) { Database::query($sql); From 067b3f5ab4e2d7601b208eef674dc1b571482c4c Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 16 Jan 2018 21:37:41 +0100 Subject: [PATCH 3/6] Add clean_all SVG icon (clean_all.svg was actually clean.svg) --- main/img/icons/svg/clean.svg | 538 +++++++++++++++++++++++++++++++ main/img/icons/svg/clean_all.svg | 426 +++++++++++++++++++++++- 2 files changed, 955 insertions(+), 9 deletions(-) create mode 100644 main/img/icons/svg/clean.svg diff --git a/main/img/icons/svg/clean.svg b/main/img/icons/svg/clean.svg new file mode 100644 index 0000000000..59839b4b6a --- /dev/null +++ b/main/img/icons/svg/clean.svg @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/img/icons/svg/clean_all.svg b/main/img/icons/svg/clean_all.svg index 59839b4b6a..43fbf2b377 100644 --- a/main/img/icons/svg/clean_all.svg +++ b/main/img/icons/svg/clean_all.svg @@ -15,8 +15,8 @@ viewBox="0 0 128 128" id="svg2" version="1.1" - inkscape:version="0.91 r" - sodipodi:docname="clean_all.svg"> + inkscape:version="0.92.2 (5c3e80d, 2017-08-06)" + sodipodi:docname="clean_all2.svg"> + + + + + + + + + + + + + + + + + + + + @@ -534,5 +734,213 @@ id="path2267" style="opacity:0.31730766;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b0c841ba52f7f9d77428bb426f49c60f2501530e Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 16 Jan 2018 21:38:13 +0100 Subject: [PATCH 4/6] Minor - Convert stats.png icon use to statistics.png in survey --- main/survey/surveyUtil.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/survey/surveyUtil.class.php b/main/survey/surveyUtil.class.php index b4a98766a9..fcb1459892 100755 --- a/main/survey/surveyUtil.class.php +++ b/main/survey/surveyUtil.class.php @@ -2800,7 +2800,7 @@ class SurveyUtil $hideReportingButton = api_get_configuration_value('hide_survey_reporting_button'); $reportingLink = Display::url( - Display::return_icon('stats.png', get_lang('Reporting'), [], ICON_SIZE_SMALL), + Display::return_icon('statistics.png', get_lang('Reporting'), [], ICON_SIZE_SMALL), api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id ); From 48b85ad6dc01bc61cca608c7a1430b9a0111c560 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 16 Jan 2018 22:05:05 +0100 Subject: [PATCH 5/6] Fix issue with URL params' "&" filtering - refs #2331 --- main/survey/fillsurvey.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/main/survey/fillsurvey.php b/main/survey/fillsurvey.php index fde9d1d3da..a82ac5635a 100755 --- a/main/survey/fillsurvey.php +++ b/main/survey/fillsurvey.php @@ -369,7 +369,8 @@ if ($user_id == 0) { $user_data = api_get_user_info($user_id); if ($survey_data['form_fields'] != '' && - $survey_data['anonymous'] == 0 && is_array($user_data) + $survey_data['anonymous'] == 0 && + is_array($user_data) ) { $form_fields = explode('@', $survey_data['form_fields']); $list = []; @@ -383,8 +384,13 @@ if ($survey_data['form_fields'] != '' && } } - $url = api_get_self().'?cidReq='.$courseInfo['code'].'&id_session='.$sessionId.'&'. - str_replace('&show_form=1', '&show_form=1', Security::remove_XSS($_SERVER['QUERY_STRING'])); + $url = api_get_self(). + '?cidReq='.$courseInfo['code']. + '&id_session='.$sessionId; + $listQueryParams = preg_split('/&/', $_SERVER['QUERY_STRING']); + foreach ($listQueryParams as $param) { + $url .= '&'.Security::remove_XSS($param); + } // We use the same form as in auth/profile.php $form = new FormValidator('profile', 'post', $url); @@ -1185,10 +1191,14 @@ $g_ic = isset($_GET['invitationcode']) ? Security::remove_XSS($_GET['invitationc $g_cr = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : ''; $p_l = isset($_POST['language']) ? Security::remove_XSS($_POST['language']) : ''; -$add_parameters = isset($_GET['user_id']) ? 'user_id='.intval($_GET['user_id']).'&' : ''; +$add_parameters = isset($_GET['user_id']) ? '&user_id='.intval($_GET['user_id']) : ''; -$url = api_get_self().'?cidReq='.$courseInfo['code'].'&id_session='.$sessionId. - '&'.$add_parameters.'course='.$g_c.'&invitationcode='.$g_ic.'&show='.$show; +$url = api_get_self().'?cidReq='.$courseInfo['code']. + '&id_session='.$sessionId. + $add_parameters. + '&course='.$g_c. + '&invitationcode='.$g_ic. + '&show='.$show; $form = new FormValidator( 'question', 'post', From 433dffc068856bde928ada2bbec7eccdcf6dd311 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 16 Jan 2018 22:21:17 +0100 Subject: [PATCH 6/6] Minor - Update PHPDoc --- main/admin/course_list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/admin/course_list.php b/main/admin/course_list.php index 80d557bcc3..6473aac691 100755 --- a/main/admin/course_list.php +++ b/main/admin/course_list.php @@ -17,6 +17,8 @@ $sessionId = isset($_GET['session_id']) ? $_GET['session_id'] : null; /** * Get the number of courses which will be displayed + * @return int The number of matching courses + * @throws Exception */ function get_number_of_courses() { @@ -80,6 +82,7 @@ function get_number_of_courses() * @param string $direction * * @return array + * @throws Exception */ function get_course_data($from, $number_of_items, $column, $direction) { @@ -205,6 +208,7 @@ function get_course_data($from, $number_of_items, $column, $direction) * @param int $column * @param string $direction * @return array + * @throws Exception */ function get_course_data_by_session($from, $number_of_items, $column, $direction) {