/**
  * Filter the received work
  * @param string $type
  * @param string $value
  */
 function filter_received_work($type, $value)
 {
     $dropbox_cnf = getDropboxConf();
     $new_received_work = array();
     foreach ($this->receivedWork as $work) {
         switch ($type) {
             case 'uploader_id':
                 if ($work->uploader_id == $value || $work->uploader_id > $dropbox_cnf['mailingIdBase'] && getUserOwningThisMailing($work->uploader_id) == $value) {
                     $new_received_work[] = $work;
                 }
                 break;
             default:
                 $new_received_work[] = $work;
         }
     }
     $this->receivedWork = $new_received_work;
 }
/**
* @desc This function retrieves the number of feedback messages on every document. This function might become obsolete when
*       the feedback becomes user individual.
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version march 2006
*/
function get_total_number_feedback($file_id = '')
{
    $dropbox_cnf = getDropboxConf();
    $course_id = api_get_course_int_id();
    $sql = "SELECT COUNT(feedback_id) AS total, file_id FROM " . $dropbox_cnf['tbl_feedback'] . "\n            WHERE c_id = {$course_id} GROUP BY file_id";
    $result = Database::query($sql);
    $return = array();
    while ($row = Database::fetch_array($result)) {
        $return[$row['file_id']] = $row['total'];
    }
    return $return;
}