Example #1
0
        // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48"
        $column_order[3] = 8;
        $column_order[5] = 7;
        // The content of the sortable table = the received files
        foreach ($dropbox_person->sentWork as $dropbox_file) {
            $dropbox_file_data = array();
            if ($view_dropbox_category_sent == $dropbox_file->category) {
                $dropbox_file_data[] = $dropbox_file->id;
                $link_open = '<a href="dropbox_download.php?' . api_get_cidreq() . '&id=' . $dropbox_file->id . '">';
                $dropbox_file_data[] = $link_open . build_document_icon_tag('file', $dropbox_file->title) . '</a>';
                $dropbox_file_data[] = '<a href="dropbox_download.php?' . api_get_cidreq() . '&id=' . $dropbox_file->id . '&amp;action=download">' . Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL) . '</a>' . $link_open . $dropbox_file->title . '</a><br />' . $dropbox_file->description;
                $file_size = $dropbox_file->filesize;
                $dropbox_file_data[] = Text::format_file_size($file_size);
                $receivers_celldata = null;
                foreach ($dropbox_file->recipients as $recipient) {
                    $receivers_celldata = display_user_link_work($recipient['user_id'], $recipient['name']) . ', ' . $receivers_celldata;
                }
                $receivers_celldata = trim(trim($receivers_celldata), ',');
                // Removing the trailing comma.
                $dropbox_file_data[] = $receivers_celldata;
                $last_upload_date = api_get_local_time($dropbox_file->last_upload_date);
                $dropbox_file_data[] = date_to_str_ago($last_upload_date) . '<br /><span class="dropbox_date">' . api_format_date($last_upload_date) . '</span>';
                //$dropbox_file_data[] = $dropbox_file->author;
                $receivers_celldata = '';
                $action_icons = check_number_feedback($dropbox_file->id, $number_feedback) . ' ' . get_lang('Feedback') . '
									<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&amp;view_sent_category=' . $viewSentCategory . '&amp;view=' . $view . '&amp;action=viewfeedback&amp;id=' . $dropbox_file->id . '&' . $sort_params . '">' . Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL) . '</a>
									<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&amp;view_sent_category=' . $viewSentCategory . '&amp;view=' . $view . '&amp;action=movesent&amp;move_id=' . $dropbox_file->id . '&' . $sort_params . '">' . Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL) . '</a>
									<a href="' . api_get_self() . '?' . api_get_cidreq() . '&view_received_category=' . $viewReceivedCategory . '&amp;view_sent_category=' . $viewSentCategory . '&amp;view=' . $view . '&amp;action=deletesentfile&amp;id=' . $dropbox_file->id . '&' . $sort_params . '" onclick="javascript: return confirmation(\'' . $dropbox_file->title . '\');">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
                // This is a hack to have an additional row in a sortable table
                if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
                    $action_icons .= "</td></tr>\n";
/**
* This function returns the html code to display the feedback messages on a given dropbox file
* @param $feedback_array an array that contains all the feedback messages about the given document.
* @return html code
* @todo add the form for adding new comment (if the other party has not deleted it yet).
*
* @author Patrick Cool <*****@*****.**>, Ghent University
* @version march 2006
*/
function format_feedback($feedback)
{
    $output = display_user_link_work($feedback['author_user_id']);
    $output .= '&nbsp;&nbsp;' . api_convert_and_format_date($feedback['feedback_date'], DATE_TIME_FORMAT_LONG) . '<br />';
    $output .= '<div style="padding-top:6px">' . nl2br($feedback['feedback']) . '</div><hr size="1" noshade/><br />';
    return $output;
}