Project

General

Profile

Bug #1131

Document "new icon" on user_portal.php apears sooo often

Added by Carlos Brolo over 9 years ago. Updated about 9 years ago.

Status:
Rejected - Abandoned
Priority:
Normal
Category:
-
Target version:
Start date:
30/04/2010
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

The "new action was taken" icon... or "whats new icon".... on the user_portal.php for "documents" apears each time a user opens a folder so ALL THE TIME is showing something is new for all users, even teacher...
So everyone has that icon on their user_portal page.

A fix so only teacher actions are shown here?,
a way to dissable it?

History

#1

Updated by Yannick Warnier over 9 years ago

  • Target version set to 1.8.7 RC1
#2

Updated by Julio Montoya over 9 years ago

  • Target version changed from 1.8.7 RC1 to 1.8.7.1
#3

Updated by Yannick Warnier about 9 years ago

  • Status changed from New to Rejected - Abandoned
  • Assignee set to Yannick Warnier
  • Target version changed from 1.8.7.1 to 1.8.8 stable

Hi Carlos,

Although I admit sometimes this tool is confusing, it is now quite stable and, as far as I know, it works. The logic is the following (located in function show_notification() inside user_portal.php):

// $oldestTrackDate contains the oldest date where the user connected to a specific tool, so we know we don't know to look earlier when issuing the following query
// get the last edits of all tools of this course
$sql = "SELECT tet.*, tet.lastedit_date last_date, tet.tool tool, tet.ref ref,
tet.lastedit_type type, tet.to_group_id group_id,
ctt.image image, ctt.link link
FROM $tool_edit_table tet, $course_tool_table ctt
WHERE tet.lastedit_date > '$oldestTrackDate'
AND ctt.name = tet.tool
AND ctt.visibility = '1'
AND tet.lastedit_user_id != $user_id AND tet.id_session = '".$my_course['id_session']."'
ORDER BY tet.lastedit_date";
$res = Database::query($sql);
//get the group_id's with user membership
$group_ids = GroupManager :: get_group_ids($course_database, $user_id);
$group_ids[] = 0; //add group 'everyone'
//filter all selected items
while ($res && ($item_property = Database::fetch_array($res))) {
// First thing to check is if the user never entered the tool
// or if his last visit was earlier than the last modification
if ((!isset ($lastTrackInCourseDate[$item_property['tool']]) || $lastTrackInCourseDate[$item_property['tool']] < $item_property['lastedit_date'])
// drop the tool elements that are part of a group that the
// user is not part of
&& ((in_array($item_property['to_group_id'], $group_ids)
// drop the dropbox, notebook and chat tools because we don't care'
&& ($item_property['tool'] != TOOL_DROPBOX && $item_property['tool'] != TOOL_NOTEBOOK && $item_property['tool'] != TOOL_CHAT)))
// take only what's visible or invisible but where the user is a teacher or where the visibility is unset
&& ($item_property['visibility'] '1' || ($my_course['s'] '1' && $item_property['visibility'] '0') || !isset ($item_property['visibility']))) {

// also drop announcements and events that are not for the user or his group
if (($item_property['tool'] TOOL_ANNOUNCEMENT || $item_property['tool'] == TOOL_CALENDAR_EVENT) && (($item_property['to_user_id'] != $user_id ) && (!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'],$group_ids)) )) continue;
// If it's a survey, make sure the user's invited. Otherwise drop it.'
if ($item_property['tool'] == TOOL_SURVEY) {
$survey_info = survey_manager::get_survey($item_property['ref'],0,$my_course['k']);
$invited_users = SurveyUtil::get_invited_users($survey_info['code'],$course_database);
if (!in_array($user_id,$invited_users['course_users'])) continue;
}
$notifications[$item_property['tool']] = $item_property;
}
}

I'm not seeing anything of what you mentioned happening. Maybe there is something wrong with your data or the way the database checks user connexions? If you can send us more detail, please re-open the task

Also available in: Atom PDF