From d6c136fc54107e9ffd17c163fd30c09cf8249b5c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 24 Sep 2013 18:41:38 +0200 Subject: [PATCH] Fixing view icon see BT#6418 --- main/work/view.php | 8 ++++++-- main/work/work.lib.php | 29 ++++++++++++++++++++++------- main/work/work_list.php | 6 ++---- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/main/work/view.php b/main/work/view.php index caa7727fc1..65f17dd56f 100644 --- a/main/work/view.php +++ b/main/work/view.php @@ -23,8 +23,12 @@ $course_info = api_get_course_info(); allowOnlySubscribedUser(api_get_user_id(), $work['parent_id'], $course_info['real_id']); if (user_is_author($id) || $course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) { - $url_dir = 'work.php?&id=' . $my_folder_data['id']; - $interbreadcrumb[] = array ('url' => $url_dir,'name' => $my_folder_data['title']); + if (api_is_allowed_to_edit(null, true)) { + $url_dir = 'work_list_all.php?id='.$my_folder_data['id']; + } else { + $url_dir = 'work_list.php?id='.$my_folder_data['id']; + } + $interbreadcrumb[] = array ('url' => $url_dir, 'name' => $my_folder_data['title']); $interbreadcrumb[] = array ('url' => '#','name' => $work['title']); if (($course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) || api_is_allowed_to_edit() || ($work['user_id'] == api_get_user_id() && $work['active'] == 1 && $work['accepted'] == 1)) { diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 8910873985..a0e45bd498 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -1635,6 +1635,16 @@ function get_count_work($work_id, $onlyMeUserId = null, $notMeUserId = null) return $users_with_work; } +/** + * @param int $start + * @param int $limit + * @param int $column + * @param string $direction + * @param int $work_id + * @param array $where_condition + * @param int $studentId + * @return array + */ function get_work_user_list($start, $limit, $column, $direction, $work_id, $where_condition, $studentId = null) { $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); @@ -1757,13 +1767,12 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher if (($can_read && $work['accepted'] == '1') || ($is_author && $work['accepted'] == '1') || $is_allowed_to_edit) { - //Firstname, lastname, username + // Firstname, lastname, username $work['firstname'] = Display::div($work['firstname'], array('class' => $class)); $work['lastname'] = Display::div($work['lastname'], array('class' => $class)); - //$work['username'] = Display::div($work['username'], array('class' => $class)); if (strlen($work['title']) > 30) { - $short_title = substr($work['title'],0,27).'...'; + $short_title = substr($work['title'], 0, 27).'...'; $work['title'] = Display::span($short_title, array('class' => $class, 'title' => $work['title'])); } else { $work['title'] = Display::div($work['title'], array('class' => $class)); @@ -1778,8 +1787,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher if ($work['contains_file']) { $link_to_download = ''.Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).' '; } else { - //api_get_cidreq() - //$link_to_download = ''.Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).' '; + //$link_to_download = ''.Display::return_icon('save_na.png', get_lang('Save'),array(), ICON_SIZE_SMALL).' '; } $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;')); @@ -1794,6 +1802,11 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher $url = api_get_path(WEB_CODE_PATH).'work/'; $action = ''; if ($is_allowed_to_edit) { + + $action .= ''. + Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).' '; + + if ($locked) { if ($qualification_exists) { $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL); @@ -1809,6 +1822,8 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher Display::return_icon('edit.png', get_lang('Comment'),array(), ICON_SIZE_SMALL).''; } } + + if ($work['contains_file']) { if ($locked) { $action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL); @@ -1821,6 +1836,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher } else { $action .= ''.Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).' '; } + if ($locked) { $action .= Display::return_icon('delete_na.png', get_lang('Delete'),'',ICON_SIZE_SMALL); } else { @@ -1828,8 +1844,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher } } elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) { if (api_is_allowed_to_session_edit(false, true)) { - //$action .= ''.Display::return_icon('edit.png', get_lang('Modify'),array(), ICON_SIZE_SMALL).''; - $action .= ''. + $action .= ''. Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).''; } else { $action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL); diff --git a/main/work/work_list.php b/main/work/work_list.php index 93c9558ec2..fe36d4195c 100644 --- a/main/work/work_list.php +++ b/main/work/work_list.php @@ -97,7 +97,6 @@ $check_qualification = intval($my_folder_data['qualification']); if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { $type = 'simple'; - //$columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); $column_model = array ( array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), @@ -113,7 +112,6 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) ); } else { $type = 'complex'; - //$columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')); $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')); $column_model = array ( array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), @@ -131,10 +129,10 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) $extra_params = array(); -//Autowidth +// Auto width $extra_params['autowidth'] = 'true'; -//height auto +// Height $extra_params['height'] = 'auto'; $extra_params['sortname'] = 'firstname';