@@ -488,7 +488,7 @@ |
||
| 488 | 488 | $remind_list |
| 489 | 489 | ); |
| 490 | 490 | |
| 491 | - // Destruction of the Question object |
|
| 491 | + // Destruction of the Question object |
|
| 492 | 492 | unset($objQuestionTmp); |
| 493 | 493 | if ($debug) { |
| 494 | 494 | error_log(" -- end question -- "); |
@@ -258,13 +258,13 @@ |
||
| 258 | 258 | ), 'first'); |
| 259 | 259 | |
| 260 | 260 | $coachName = api_get_person_name($userResult['firstname'], $userResult['lastname']); |
| 261 | - } |
|
| 261 | + } |
|
| 262 | 262 | |
| 263 | - $courses[] = array( |
|
| 264 | - 'id' => $courseId, |
|
| 265 | - 'name' => $course['title'], |
|
| 266 | - 'coachName' => $coachName, |
|
| 267 | - ); |
|
| 263 | + $courses[] = array( |
|
| 264 | + 'id' => $courseId, |
|
| 265 | + 'name' => $course['title'], |
|
| 266 | + 'coachName' => $coachName, |
|
| 267 | + ); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | echo json_encode($courses); |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | $thematic = new Thematic(); |
| 12 | 12 | |
| 13 | 13 | switch ($action) { |
| 14 | - case 'save_thematic_plan': |
|
| 15 | - /*$title_list = $_REQUEST['title']; |
|
| 14 | + case 'save_thematic_plan': |
|
| 15 | + /*$title_list = $_REQUEST['title']; |
|
| 16 | 16 | $description_list = $_REQUEST['desc']; |
| 17 | 17 | //$description_list = $_REQUEST['description']; |
| 18 | 18 | $description_type = $_REQUEST['description_type']; |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | $thematic_plan_data = $thematic->get_thematic_plan_data(); |
| 26 | 26 | $return = $thematic->get_thematic_plan_div($thematic_plan_data); |
| 27 | 27 | echo $return[$_REQUEST['thematic_id']];*/ |
| 28 | - break; |
|
| 29 | - case 'save_thematic_advance': |
|
| 30 | - if (!api_is_allowed_to_edit(null, true)) { |
|
| 31 | - echo ''; |
|
| 32 | - exit; |
|
| 33 | - } |
|
| 34 | - /* |
|
| 28 | + break; |
|
| 29 | + case 'save_thematic_advance': |
|
| 30 | + if (!api_is_allowed_to_edit(null, true)) { |
|
| 31 | + echo ''; |
|
| 32 | + exit; |
|
| 33 | + } |
|
| 34 | + /* |
|
| 35 | 35 | if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) { |
| 36 | 36 | if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) { |
| 37 | 37 | $start_date_error = true; |
@@ -79,80 +79,80 @@ discard block |
||
| 79 | 79 | $thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true); |
| 80 | 80 | $return = $thematic->get_thematic_advance_div($thematic_advance_data); |
| 81 | 81 | echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/ |
| 82 | - break; |
|
| 83 | - case 'get_datetime_by_attendance': |
|
| 84 | - $attendance_id = intval($_REQUEST['attendance_id']); |
|
| 85 | - $thematic_advance_id = intval($_REQUEST['thematic_advance_id']); |
|
| 82 | + break; |
|
| 83 | + case 'get_datetime_by_attendance': |
|
| 84 | + $attendance_id = intval($_REQUEST['attendance_id']); |
|
| 85 | + $thematic_advance_id = intval($_REQUEST['thematic_advance_id']); |
|
| 86 | 86 | |
| 87 | - $label = ''; |
|
| 88 | - $input_select = ''; |
|
| 89 | - if (!empty($attendance_id)) { |
|
| 90 | - $attendance = new Attendance(); |
|
| 91 | - $thematic = new Thematic(); |
|
| 92 | - $thematic_list = $thematic->get_thematic_list(); |
|
| 87 | + $label = ''; |
|
| 88 | + $input_select = ''; |
|
| 89 | + if (!empty($attendance_id)) { |
|
| 90 | + $attendance = new Attendance(); |
|
| 91 | + $thematic = new Thematic(); |
|
| 92 | + $thematic_list = $thematic->get_thematic_list(); |
|
| 93 | 93 | |
| 94 | - $my_list = $thematic_list_temp = array(); |
|
| 95 | - foreach ($thematic_list as $item) { |
|
| 96 | - $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']); |
|
| 97 | - $thematic_list_temp = array_merge($my_list, $thematic_list_temp); |
|
| 98 | - } |
|
| 99 | - $new_thematic_list = array(); |
|
| 94 | + $my_list = $thematic_list_temp = array(); |
|
| 95 | + foreach ($thematic_list as $item) { |
|
| 96 | + $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']); |
|
| 97 | + $thematic_list_temp = array_merge($my_list, $thematic_list_temp); |
|
| 98 | + } |
|
| 99 | + $new_thematic_list = array(); |
|
| 100 | 100 | |
| 101 | - foreach($thematic_list_temp as $item) { |
|
| 102 | - if (!empty($item['attendance_id']) ) { |
|
| 103 | - $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
|
| 104 | - } |
|
| 105 | - } |
|
| 101 | + foreach($thematic_list_temp as $item) { |
|
| 102 | + if (!empty($item['attendance_id']) ) { |
|
| 103 | + $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - $attendance_calendar = $attendance->get_attendance_calendar($attendance_id); |
|
| 107 | + $attendance_calendar = $attendance->get_attendance_calendar($attendance_id); |
|
| 108 | 108 | |
| 109 | - $label = get_lang('StartDate'); |
|
| 110 | - if (!empty($attendance_calendar)) { |
|
| 111 | - $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">'; |
|
| 112 | - foreach ($attendance_calendar as $calendar) { |
|
| 113 | - $selected = null; |
|
| 114 | - $insert = true; |
|
| 115 | - //checking if was already taken |
|
| 116 | - foreach ($new_thematic_list as $key => $thematic_item) { |
|
| 117 | - //if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) { |
|
| 118 | - if ($calendar['db_date_time'] == $thematic_item['start_date'] ) { |
|
| 119 | - $insert = false; |
|
| 120 | - if ($thematic_advance_id == $key) { |
|
| 121 | - $insert = true; |
|
| 122 | - $selected = 'selected'; |
|
| 123 | - } |
|
| 124 | - break; |
|
| 125 | - } |
|
| 126 | - } |
|
| 127 | - if ($insert == true) { |
|
| 128 | - $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>'; |
|
| 129 | - } |
|
| 130 | - } |
|
| 131 | - $input_select .= '</select>'; |
|
| 132 | - } else { |
|
| 133 | - $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>'; |
|
| 134 | - } |
|
| 135 | - } |
|
| 136 | - ?> |
|
| 109 | + $label = get_lang('StartDate'); |
|
| 110 | + if (!empty($attendance_calendar)) { |
|
| 111 | + $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">'; |
|
| 112 | + foreach ($attendance_calendar as $calendar) { |
|
| 113 | + $selected = null; |
|
| 114 | + $insert = true; |
|
| 115 | + //checking if was already taken |
|
| 116 | + foreach ($new_thematic_list as $key => $thematic_item) { |
|
| 117 | + //if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) { |
|
| 118 | + if ($calendar['db_date_time'] == $thematic_item['start_date'] ) { |
|
| 119 | + $insert = false; |
|
| 120 | + if ($thematic_advance_id == $key) { |
|
| 121 | + $insert = true; |
|
| 122 | + $selected = 'selected'; |
|
| 123 | + } |
|
| 124 | + break; |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + if ($insert == true) { |
|
| 128 | + $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>'; |
|
| 129 | + } |
|
| 130 | + } |
|
| 131 | + $input_select .= '</select>'; |
|
| 132 | + } else { |
|
| 133 | + $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>'; |
|
| 134 | + } |
|
| 135 | + } |
|
| 136 | + ?> |
|
| 137 | 137 | <div class="form-group"> |
| 138 | 138 | <label class="col-sm-2 control-label"><?php echo $label ?></label> |
| 139 | 139 | <div class="col-sm-10"><?php echo $input_select ?></div> |
| 140 | 140 | </div> |
| 141 | 141 | <?php |
| 142 | - break; |
|
| 143 | - case 'update_done_thematic_advance': |
|
| 144 | - $thematic_advance_id = intval($_GET['thematic_advance_id']); |
|
| 145 | - $total_average = 0; |
|
| 146 | - if (!empty($thematic_advance_id)) { |
|
| 147 | - $thematic = new Thematic(); |
|
| 148 | - $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id); |
|
| 149 | - //if ($affected_rows) { |
|
| 150 | - $total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id()); |
|
| 151 | - //} |
|
| 152 | - } |
|
| 153 | - echo $total_average; |
|
| 154 | - break; |
|
| 155 | - default: |
|
| 156 | - echo ''; |
|
| 142 | + break; |
|
| 143 | + case 'update_done_thematic_advance': |
|
| 144 | + $thematic_advance_id = intval($_GET['thematic_advance_id']); |
|
| 145 | + $total_average = 0; |
|
| 146 | + if (!empty($thematic_advance_id)) { |
|
| 147 | + $thematic = new Thematic(); |
|
| 148 | + $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id); |
|
| 149 | + //if ($affected_rows) { |
|
| 150 | + $total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id()); |
|
| 151 | + //} |
|
| 152 | + } |
|
| 153 | + echo $total_average; |
|
| 154 | + break; |
|
| 155 | + default: |
|
| 156 | + echo ''; |
|
| 157 | 157 | } |
| 158 | 158 | exit; |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | break; |
| 734 | - case 'get_user_skill_ranking': |
|
| 734 | + case 'get_user_skill_ranking': |
|
| 735 | 735 | $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank'); |
| 736 | 736 | $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition); |
| 737 | 737 | $result = msort($result, 'skills_acquired', 'asc'); |
@@ -1281,7 +1281,7 @@ discard block |
||
| 1281 | 1281 | |
| 1282 | 1282 | if (!empty($item['certif_min_score']) && !empty($item['document_id'])) { |
| 1283 | 1283 | $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL); |
| 1284 | - $item['has_certificates'] = '1'; |
|
| 1284 | + $item['has_certificates'] = '1'; |
|
| 1285 | 1285 | } else { |
| 1286 | 1286 | $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL); |
| 1287 | 1287 | $item['has_certificates'] = '0'; |
@@ -758,7 +758,7 @@ |
||
| 758 | 758 | // $gidReset = true; |
| 759 | 759 | } // end else |
| 760 | 760 | |
| 761 | - // Now check for anonymous user mode |
|
| 761 | + // Now check for anonymous user mode |
|
| 762 | 762 | if (isset($use_anonymous) && $use_anonymous) { |
| 763 | 763 | //if anonymous mode is set, then try to set the current user as anonymous |
| 764 | 764 | //if he doesn't have a login yet |
@@ -1229,13 +1229,13 @@ discard block |
||
| 1229 | 1229 | } |
| 1230 | 1230 | |
| 1231 | 1231 | /** |
| 1232 | - * Get the users by ID |
|
| 1233 | - * @param array $ids student ids |
|
| 1234 | - * @param string $active |
|
| 1235 | - * @param string $order |
|
| 1236 | - * @param string $limit |
|
| 1237 | - * @return array $result student information |
|
| 1238 | - */ |
|
| 1232 | + * Get the users by ID |
|
| 1233 | + * @param array $ids student ids |
|
| 1234 | + * @param string $active |
|
| 1235 | + * @param string $order |
|
| 1236 | + * @param string $limit |
|
| 1237 | + * @return array $result student information |
|
| 1238 | + */ |
|
| 1239 | 1239 | public static function get_user_list_by_ids($ids = array(), $active = null, $order = null, $limit = null) |
| 1240 | 1240 | { |
| 1241 | 1241 | if (empty($ids)) { |
@@ -3332,12 +3332,12 @@ discard block |
||
| 3332 | 3332 | if ($tag_id == 0) { |
| 3333 | 3333 | //the tag doesn't exist |
| 3334 | 3334 | $sql = "INSERT INTO $table_user_tag (tag, field_id,count) VALUES ('$tag','$field_id', count + 1)"; |
| 3335 | - Database::query($sql); |
|
| 3335 | + Database::query($sql); |
|
| 3336 | 3336 | $last_insert_id = Database::insert_id(); |
| 3337 | 3337 | } else { |
| 3338 | 3338 | //the tag exists we update it |
| 3339 | 3339 | $sql = "UPDATE $table_user_tag SET count = count + 1 WHERE id = $tag_id"; |
| 3340 | - Database::query($sql); |
|
| 3340 | + Database::query($sql); |
|
| 3341 | 3341 | $last_insert_id = $tag_id; |
| 3342 | 3342 | } |
| 3343 | 3343 | |
@@ -3532,9 +3532,9 @@ discard block |
||
| 3532 | 3532 | } |
| 3533 | 3533 | |
| 3534 | 3534 | /** |
| 3535 | - * Get extra filtrable user fields (only type select) |
|
| 3536 | - * @return array |
|
| 3537 | - */ |
|
| 3535 | + * Get extra filtrable user fields (only type select) |
|
| 3536 | + * @return array |
|
| 3537 | + */ |
|
| 3538 | 3538 | public static function get_extra_filtrable_fields() |
| 3539 | 3539 | { |
| 3540 | 3540 | $extraFieldList = UserManager::get_extra_fields(); |
@@ -3559,9 +3559,9 @@ discard block |
||
| 3559 | 3559 | } |
| 3560 | 3560 | |
| 3561 | 3561 | /** |
| 3562 | - * Get extra where clauses for finding users based on extra filtrable user fields (type select) |
|
| 3563 | - * @return string With AND clauses based on user's ID which have the values to search in extra user fields |
|
| 3564 | - */ |
|
| 3562 | + * Get extra where clauses for finding users based on extra filtrable user fields (type select) |
|
| 3563 | + * @return string With AND clauses based on user's ID which have the values to search in extra user fields |
|
| 3564 | + */ |
|
| 3565 | 3565 | public static function get_search_form_where_extra_fields() |
| 3566 | 3566 | { |
| 3567 | 3567 | $useExtraFields = false; |
@@ -3869,23 +3869,23 @@ discard block |
||
| 3869 | 3869 | } |
| 3870 | 3870 | |
| 3871 | 3871 | /** |
| 3872 | - * Get users followed by human resource manager |
|
| 3873 | - * @param int $userId |
|
| 3874 | - * @param int $userStatus Filter users by status (STUDENT, COURSEMANAGER, etc) |
|
| 3875 | - * @param bool $getOnlyUserId |
|
| 3876 | - * @param bool $getSql |
|
| 3877 | - * @param bool $getCount |
|
| 3878 | - * @param int $from |
|
| 3879 | - * @param int $numberItems |
|
| 3880 | - * @param int $column |
|
| 3881 | - * @param string $direction |
|
| 3882 | - * @param int $active |
|
| 3883 | - * @param string $lastConnectionDate |
|
| 3884 | - * @param int $status the function is called by who? COURSEMANAGER, DRH? |
|
| 3885 | - * @param string $keyword |
|
| 3872 | + * Get users followed by human resource manager |
|
| 3873 | + * @param int $userId |
|
| 3874 | + * @param int $userStatus Filter users by status (STUDENT, COURSEMANAGER, etc) |
|
| 3875 | + * @param bool $getOnlyUserId |
|
| 3876 | + * @param bool $getSql |
|
| 3877 | + * @param bool $getCount |
|
| 3878 | + * @param int $from |
|
| 3879 | + * @param int $numberItems |
|
| 3880 | + * @param int $column |
|
| 3881 | + * @param string $direction |
|
| 3882 | + * @param int $active |
|
| 3883 | + * @param string $lastConnectionDate |
|
| 3884 | + * @param int $status the function is called by who? COURSEMANAGER, DRH? |
|
| 3885 | + * @param string $keyword |
|
| 3886 | 3886 | * |
| 3887 | - * @return array user list |
|
| 3888 | - */ |
|
| 3887 | + * @return array user list |
|
| 3888 | + */ |
|
| 3889 | 3889 | public static function getUsersFollowedByUser( |
| 3890 | 3890 | $userId, |
| 3891 | 3891 | $userStatus = null, |
@@ -23,22 +23,22 @@ discard block |
||
| 23 | 23 | $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array(); |
| 24 | 24 | |
| 25 | 25 | if (count($array_to_search) > 0) { |
| 26 | - while (list($key) = each($array_to_search)) { |
|
| 27 | - $all_files[] = basename($array_to_search[$key]['path']); |
|
| 28 | - } |
|
| 26 | + while (list($key) = each($array_to_search)) { |
|
| 27 | + $all_files[] = basename($array_to_search[$key]['path']); |
|
| 28 | + } |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | //get all svg and png files |
| 32 | 32 | $accepted_extensions = array('.svg', '.png'); |
| 33 | 33 | |
| 34 | 34 | if (is_array($all_files) && count($all_files) > 0) { |
| 35 | - foreach ($all_files as & $file) { |
|
| 36 | - $slideshow_extension = strrchr($file, '.'); |
|
| 37 | - $slideshow_extension = strtolower($slideshow_extension); |
|
| 38 | - if (in_array($slideshow_extension, $accepted_extensions)) { |
|
| 39 | - $png_svg_files[] =$file; |
|
| 40 | - } |
|
| 41 | - } |
|
| 35 | + foreach ($all_files as & $file) { |
|
| 36 | + $slideshow_extension = strrchr($file, '.'); |
|
| 37 | + $slideshow_extension = strtolower($slideshow_extension); |
|
| 38 | + if (in_array($slideshow_extension, $accepted_extensions)) { |
|
| 39 | + $png_svg_files[] =$file; |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $disk_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images/gallery/'; |
@@ -57,24 +57,24 @@ discard block |
||
| 57 | 57 | <?php |
| 58 | 58 | echo '<h2>'.get_lang('Course').': '.$course_info['name'].'</h2>'; |
| 59 | 59 | if (!empty($png_svg_files)) { |
| 60 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
| 61 | - echo '<ul>'; |
|
| 62 | - foreach($png_svg_files as $filename) { |
|
| 63 | - $image=$disk_path.$filename; |
|
| 64 | - |
|
| 65 | - if (strpos($filename, "svg")){ |
|
| 66 | - $new_sizes['width'] = 60; |
|
| 67 | - $new_sizes['height'] = 60; |
|
| 68 | - } |
|
| 69 | - else { |
|
| 70 | - $new_sizes = api_resize_image($image, 60, 60); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
| 74 | - } |
|
| 75 | - echo '</ul>'; |
|
| 60 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
| 61 | + echo '<ul>'; |
|
| 62 | + foreach($png_svg_files as $filename) { |
|
| 63 | + $image=$disk_path.$filename; |
|
| 64 | + |
|
| 65 | + if (strpos($filename, "svg")){ |
|
| 66 | + $new_sizes['width'] = 60; |
|
| 67 | + $new_sizes['height'] = 60; |
|
| 68 | + } |
|
| 69 | + else { |
|
| 70 | + $new_sizes = api_resize_image($image, 60, 60); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
| 74 | + } |
|
| 75 | + echo '</ul>'; |
|
| 76 | 76 | } else { |
| 77 | - Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath')); |
|
| 77 | + Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath')); |
|
| 78 | 78 | } |
| 79 | 79 | ?> |
| 80 | 80 | </body> |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array(); |
| 35 | 35 | |
| 36 | 36 | if (count($array_to_search) > 0) { |
| 37 | - while (list($key) = each($array_to_search)) { |
|
| 38 | - $all_files[] = basename($array_to_search[$key]['path']); |
|
| 39 | - } |
|
| 37 | + while (list($key) = each($array_to_search)) { |
|
| 38 | + $all_files[] = basename($array_to_search[$key]['path']); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | //get all svg and png group files |
@@ -70,26 +70,26 @@ discard block |
||
| 70 | 70 | ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1 |
| 71 | 71 | ){ |
| 72 | 72 | |
| 73 | - if (!empty($png_svg_files)) { |
|
| 74 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
| 75 | - echo '<ul>'; |
|
| 76 | - foreach($png_svg_files as $filename) { |
|
| 77 | - $image = $group_disk_path.$filename; |
|
| 78 | - |
|
| 79 | - if (strpos($filename, "svg")){ |
|
| 80 | - $new_sizes['width'] = 60; |
|
| 81 | - $new_sizes['height'] = 60; |
|
| 82 | - } else { |
|
| 83 | - $new_sizes = api_resize_image($image, 60, 60); |
|
| 84 | - } |
|
| 73 | + if (!empty($png_svg_files)) { |
|
| 74 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
| 75 | + echo '<ul>'; |
|
| 76 | + foreach($png_svg_files as $filename) { |
|
| 77 | + $image = $group_disk_path.$filename; |
|
| 78 | + |
|
| 79 | + if (strpos($filename, "svg")){ |
|
| 80 | + $new_sizes['width'] = 60; |
|
| 81 | + $new_sizes['height'] = 60; |
|
| 82 | + } else { |
|
| 83 | + $new_sizes = api_resize_image($image, 60, 60); |
|
| 84 | + } |
|
| 85 | 85 | echo '<li style="display:inline; padding:8px;">'; |
| 86 | 86 | echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">'; |
| 87 | 87 | echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
| 88 | - } |
|
| 89 | - echo '</ul>'; |
|
| 90 | - } |
|
| 88 | + } |
|
| 89 | + echo '</ul>'; |
|
| 90 | + } |
|
| 91 | 91 | } else { |
| 92 | - echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup')); |
|
| 92 | + echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup')); |
|
| 93 | 93 | } |
| 94 | 94 | ?> |
| 95 | 95 | </body> |
@@ -1335,27 +1335,27 @@ |
||
| 1335 | 1335 | public static function get_groups_by_user_count($user_id = null, $relation_type = GROUP_USER_PERMISSION_READER, $with_image = false) |
| 1336 | 1336 | { |
| 1337 | 1337 | $table_group_rel_user = Database::get_main_table(TABLE_MAIN_USER_REL_GROUP); |
| 1338 | - $tbl_group = Database::get_main_table(TABLE_MAIN_GROUP); |
|
| 1339 | - $user_id = intval($user_id); |
|
| 1338 | + $tbl_group = Database::get_main_table(TABLE_MAIN_GROUP); |
|
| 1339 | + $user_id = intval($user_id); |
|
| 1340 | 1340 | |
| 1341 | - if ($relation_type == 0) { |
|
| 1342 | - $where_relation_condition = ''; |
|
| 1343 | - } else { |
|
| 1344 | - $relation_type = intval($relation_type); |
|
| 1345 | - $where_relation_condition = "AND gu.relation_type = $relation_type "; |
|
| 1346 | - } |
|
| 1341 | + if ($relation_type == 0) { |
|
| 1342 | + $where_relation_condition = ''; |
|
| 1343 | + } else { |
|
| 1344 | + $relation_type = intval($relation_type); |
|
| 1345 | + $where_relation_condition = "AND gu.relation_type = $relation_type "; |
|
| 1346 | + } |
|
| 1347 | 1347 | |
| 1348 | - $sql = "SELECT count(g.id) as count |
|
| 1348 | + $sql = "SELECT count(g.id) as count |
|
| 1349 | 1349 | FROM $tbl_group g |
| 1350 | 1350 | INNER JOIN $table_group_rel_user gu |
| 1351 | 1351 | ON gu.group_id = g.id WHERE gu.user_id = $user_id $where_relation_condition "; |
| 1352 | 1352 | |
| 1353 | - $result = Database::query($sql); |
|
| 1354 | - if (Database::num_rows($result) > 0) { |
|
| 1355 | - $row = Database::fetch_array($result, 'ASSOC'); |
|
| 1353 | + $result = Database::query($sql); |
|
| 1354 | + if (Database::num_rows($result) > 0) { |
|
| 1355 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
| 1356 | 1356 | return $row['count']; |
| 1357 | - } |
|
| 1358 | - return 0; |
|
| 1357 | + } |
|
| 1358 | + return 0; |
|
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | 1361 | /** |