123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662 |
- <?php
- require_once 'dropbox_init.inc.php';
- if ($_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] == '') {
- $last_access = get_last_tool_access(TOOL_DROPBOX, $_course['code'], $_user['user_id']);
- $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access;
- } else {
- $last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX];
- }
- event_access_tool(TOOL_DROPBOX);
- $dropbox_unid = md5(uniqid(rand(), true));
- Display::display_introduction_section(TOOL_DROPBOX);
- $sort_params = array();
- if (isset($_GET['dropbox_column'])) {
- $sort_params[] = 'dropbox_column='.$_GET['dropbox_column'];
- }
- if (isset($_GET['dropbox_page_nr'])) {
- $sort_params[] = 'page_nr='.intval($_GET['page_nr']);
- }
- if (isset($_GET['dropbox_per_page'])) {
- $sort_params[] = 'dropbox_per_page='.intval($_GET['dropbox_per_page']);
- }
- if (isset($_GET['dropbox_direction'])) {
- $sort_params[] = 'dropbox_direction='.$_GET['dropbox_direction'];
- }
- $sort_params = Security::remove_XSS(implode('&', $sort_params));
- $action = isset($_GET['action']) ? $_GET['action'] : null;
- if ($action == 'add') {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- display_add_form();
- }
- if (isset($_POST['submitWork'])) {
- $check = Security::check_token();
- if ($check) {
- $message = store_add_dropbox();
- if (!empty($message)) {
- Display :: display_confirmation_message($message);
- }
- }
- }
- if ($action == 'addreceivedcategory' or $action == 'addsentcategory') {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- display_addcategory_form($_POST['category_name'],'',$_GET['action']);
- }
- if ($action == 'editcategory' and isset($_GET['id'])) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- if (!$_POST) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- display_addcategory_form('', $_GET['id'], 'editcategory');
- }
- }
- if (isset($_POST['StoreCategory'])) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- $return_information = store_addcategory();
- if ($return_information['type'] == 'confirmation') {
- Display :: display_confirmation_message($return_information['message']);
- }
- if ($return_information['type'] == 'error') {
- Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete').'<br />'.$return_information['message']);
- display_addcategory_form($_POST['category_name'], $_POST['edit_id'], $_POST['action']);
- }
- }
- if (($action == 'movesent' OR $action == 'movereceived') AND isset($_GET['move_id'])) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- display_move_form(str_replace('move', '', $action), $_GET['move_id'], get_dropbox_categories(str_replace('move', '', $action)), $sort_params);
- }
- if (isset($_POST['do_move'])) {
- Display :: display_confirmation_message(store_move($_POST['id'], $_POST['move_target'], $_POST['part']));
- }
- if (($action == 'deletereceivedfile' OR $action == 'deletesentfile') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- $dropboxfile = new Dropbox_Person($_user['user_id'], $is_courseAdmin, $is_courseTutor);
- if ($action == 'deletereceivedfile') {
- $dropboxfile->deleteReceivedWork($_GET['id']);
- $message = get_lang('ReceivedFileDeleted');
- }
- if ($action == 'deletesentfile') {
- $dropboxfile->deleteSentWork($_GET['id']);
- $message = get_lang('SentFileDeleted');
- }
- Display :: display_confirmation_message($message);
- }
- if (($action == 'deletereceivedcategory' OR $action == 'deletesentcategory') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- $message = delete_category($action, $_GET['id']);
- Display :: display_confirmation_message($message);
- }
- if (!isset($_POST['feedback']) && (strstr($_POST['action'], 'move_received') OR
- $_POST['action'] == 'delete_received' OR $_POST['action'] == 'download_received' OR
- $_POST['action'] == 'delete_sent' OR $_POST['action'] == 'download_sent')) {
- $display_message = handle_multiple_actions();
- Display :: display_normal_message($display_message);
- }
- if (isset($_POST['feedback'])) {
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- api_not_allowed();
- }
- $check = Security::check_token();
- if ($check) {
- $display_message = store_feedback();
- Display :: display_normal_message($display_message);
- Security::check_token();
- }
- }
- if (isset($_GET['error']) AND !empty($_GET['error'])) {
- Display :: display_normal_message(get_lang($_GET['error']));
- }
- if ($action != 'add') {
-
- $dropbox_categories = get_dropbox_categories();
-
- foreach ($dropbox_categories as $category) {
- if ($category['received'] == '1') {
- $dropbox_received_category[] = $category;
- }
- if ($category['sent'] == '1') {
- $dropbox_sent_category[] = $category;
- }
- }
-
- if ($_GET['view'] == 'received' OR !$dropbox_cnf['sent_received_tabs']) {
-
-
- if (isset($_GET['view_received_category']) AND $_GET['view_received_category'] != '') {
- $view_dropbox_category_received = Security::remove_XSS($_GET['view_received_category']);
- } else {
- $view_dropbox_category_received = 0;
- }
-
- if (api_get_session_id() == 0) {
- echo '<div class="actions">';
- if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) {
- echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
- echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
- $movelist[0] = 'Root';
- } else {
- echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.Security::remove_XSS($_GET['view']).'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
- }
- echo '</div>';
- } else {
- if (api_is_allowed_to_session_edit(false, true)) {
- echo '<div class="actions">';
- if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) {
- echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
- echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
- $movelist[0] = 'Root';
- } else {
- echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.Security::remove_XSS($_GET['view']).'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
- }
- echo '</div>';
- }
- }
- }
- if (!$_GET['view'] OR $_GET['view'] == 'sent' OR !$dropbox_cnf['sent_received_tabs']) {
-
-
- if (isset($_GET['view_sent_category']) AND $_GET['view_sent_category'] != '') {
- $view_dropbox_category_sent = $_GET['view_sent_category'];
- } else {
- $view_dropbox_category_sent = 0;
- }
-
- if (api_get_session_id() == 0) {
- echo '<div class="actions">';
- if ($view_dropbox_category_sent != 0) {
- echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category=0&view='.Security::remove_XSS($_GET['view']).'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
- echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
- } else {
- echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".Security::remove_XSS($_GET['view'])."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
- }
- if (empty($_GET['view_sent_category'])) {
- echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".Security::remove_XSS($_GET['view'])."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
- }
- echo '</div>';
- } else {
- if (api_is_allowed_to_session_edit(false, true)) {
- echo '<div class="actions">';
- if ($view_dropbox_category_sent != 0) {
- echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
- echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category=0&view='.Security::remove_XSS($_GET['view']).'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
- } else {
- echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".Security::remove_XSS($_GET['view'])."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
- }
- if (empty($_GET['view_sent_category'])) {
- echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".Security::remove_XSS($_GET['view'])."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
- }
- echo '</div>';
- }
- }
- }
-
- if ($dropbox_cnf['sent_received_tabs']) {
- ?>
- <ul class="nav nav-tabs">
- <li <?php if (!$_GET['view'] OR $_GET['view'] == 'sent') { echo 'class="active"'; } ?> >
- <a href="index.php?<?php echo api_get_cidreq(); ?>&view=sent" ><?php echo get_lang('SentFiles'); ?></a></li>
- <li <?php if ($_GET['view'] == 'received') { echo 'class="active"'; } ?> >
- <a href="index.php?<?php echo api_get_cidreq(); ?>&view=received" ><?php echo get_lang('ReceivedFiles'); ?></a></li>
- </ul>
- <?php
- }
-
- if ($_GET['view'] == 'received' OR !$dropbox_cnf['sent_received_tabs']) {
-
-
- if (isset($_GET['view_received_category']) AND $_GET['view_received_category'] != '') {
- $view_dropbox_category_received = $_GET['view_received_category'];
- } else {
- $view_dropbox_category_received = 0;
- }
-
- $dropbox_person = new Dropbox_Person($_user['user_id'], $is_courseAdmin, $is_courseTutor);
-
- $number_feedback = get_total_number_feedback();
-
- $sorting_options = array();
- $paging_options = array();
-
- $column_header = array();
- $column_header[] = array('', false, '');
- $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"');
- $column_header[] = array(get_lang('ReceivedTitle'), true, '');
- $column_header[] = array(get_lang('Size'), true, '');
- $column_header[] = array(get_lang('Authors'), true, '');
- $column_header[] = array(get_lang('LastResent'), true);
- if (api_get_session_id() == 0) {
- $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
- } elseif (api_is_allowed_to_session_edit(false,true)) {
- $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
- }
- $column_header[] = array('RealDate', true);
- $column_header[] = array('RealSize', true);
-
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- if (api_get_session_id() == 0) {
- $column_show[] = 1;
- } elseif (api_is_allowed_to_session_edit(false, true)) {
- $column_show[] = 1;
- }
- $column_show[] = 0;
-
-
-
- $column_order[3] = 8;
- $column_order[5] = 7;
-
- foreach ($dropbox_person -> receivedWork as $dropbox_file) {
- $dropbox_file_data = array();
- if ($view_dropbox_category_received == $dropbox_file->category) {
- $dropbox_file_data[] = $dropbox_file->id;
- if (!is_array($_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])) {
- $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX] = array();
- }
-
- $new_icon = '';
- if ($dropbox_file->last_upload_date > $last_access AND !in_array($dropbox_file->id, $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])) {
- $new_icon = ' '.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL);
- }
- $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.'&action=download">'.Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description;
- $file_size = $dropbox_file->filesize;
- $dropbox_file_data[] = format_file_size($file_size);
- $dropbox_file_data[] = $dropbox_file->author;
-
- $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>';
- $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
- <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=viewfeedback&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='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=movereceived&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='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=deletereceivedfile&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>';
-
-
-
- if ($action == 'viewfeedback' AND isset($_GET['id']) and is_numeric($_GET['id']) AND $dropbox_file->id == $_GET['id']) {
- $action_icons .= "</td></tr>";
- $action_icons .= '<tr><td colspan="2"><a href="index.php?"'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category'])."&view_sent_category=".Security::remove_XSS($_GET['view_sent_category'])."&view=".Security::remove_XSS($_GET['view']).'&'.$sort_params."\">".get_lang('CloseFeedback')."</a></td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>";
- }
- if (api_get_session_id() == 0) {
- $dropbox_file_data[] = $action_icons;
- } elseif (api_is_allowed_to_session_edit(false, true)) {
- $dropbox_file_data[] = $action_icons;
- }
- $action_icons = '';
- $dropbox_file_data[] = $last_upload_date;
- $dropbox_file_data[] = $file_size;
- $dropbox_data_recieved[] = $dropbox_file_data;
- }
- }
-
- if ($view_dropbox_category_received == 0) {
- foreach ($dropbox_categories as $category) {
- $dropbox_category_data = array();
- if ($category['received'] == '1') {
- $movelist[$category['cat_id']] = $category['cat_name'];
- $dropbox_category_data[] = $category['cat_id'];
-
- $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'">';
- $dropbox_category_data[] = $link_open.build_document_icon_tag('folder', $category['cat_name']).'</a>';
- $dropbox_category_data[] = '<a href="dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>';
- $dropbox_category_data[] = '';
- $dropbox_category_data[] = '';
- $dropbox_category_data[] = '';
- $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
- <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
- }
- if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
- $dropbox_data_recieved[] = $dropbox_category_data;
- }
- }
- }
-
- $additional_get_parameters = array('view' => $_GET['view'], 'view_received_category' => $_GET['view_received_category'], 'view_sent_category' => $_GET['view_sent_category']);
- $selectlist = array('delete_received' => get_lang('Delete'), 'download_received' => get_lang('Download'));
- if (is_array($movelist)) {
- foreach ($movelist as $catid => $catname){
- $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname);
- }
- }
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- $selectlist = array();
- }
- Display::display_sortable_config_table('dropbox', $column_header, $dropbox_data_recieved, $sorting_options, $paging_options, $additional_get_parameters, $column_show, $column_order, $selectlist);
- }
-
- if (!$_GET['view'] OR $_GET['view'] == 'sent' OR !$dropbox_cnf['sent_received_tabs']) {
-
-
- if (isset($_GET['view_sent_category']) AND $_GET['view_sent_category'] != '') {
- $view_dropbox_category_sent = $_GET['view_sent_category'];
- } else {
- $view_dropbox_category_sent = 0;
- }
-
- $dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);
-
- $number_feedback = get_total_number_feedback();
-
- $sorting_options = array();
- $paging_options = array();
-
- $column_header = array();
- $column_header[] = array('', false, '');
- $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"');
- $column_header[] = array(get_lang('SentTitle'), true, '');
- $column_header[] = array(get_lang('Size'), true, '');
- $column_header[] = array(get_lang('SentTo'), true, '');
- $column_header[] = array(get_lang('LastResent'), true, '');
- if (api_get_session_id() == 0) {
- $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
- } elseif (api_is_allowed_to_session_edit(false, true)) {
- $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
- }
- $column_header[] = array('RealDate', true);
- $column_header[] = array('RealSize', true);
- $column_show = array();
- $column_order = array();
-
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- $column_show[] = 1;
- if (api_get_session_id() == 0) {
- $column_show[] = 1;
- } elseif (api_is_allowed_to_session_edit(false, true)) {
- $column_show[] = 1;
- }
- $column_show[] = 0;
-
-
-
- $column_order[3] = 8;
- $column_order[5] = 7;
-
- 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.'&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[] = format_file_size($file_size);
- 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), ',');
- $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>';
-
- $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='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=viewfeedback&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='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=movesent&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='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=deletesentfile&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>';
-
- if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
- $action_icons .= "</td></tr>\n";
- $action_icons .= "<tr><td colspan=\"2\">";
- $action_icons .= "<a href=\"index.php?".api_get_cidreq()."&view_received_category=".Security::remove_XSS($_GET['view_received_category'])."&view_sent_category=".Security::remove_XSS($_GET['view_sent_category'])."&view=".Security::remove_XSS($_GET['view']).'&'.$sort_params."\">".get_lang('CloseFeedback')."</a>";
- $action_icons .= "</td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>";
- }
- $dropbox_file_data[] = $action_icons;
- $dropbox_file_data[] = $last_upload_date;
- $dropbox_file_data[] = $file_size;
- $action_icons = '';
- $dropbox_data_sent[] = $dropbox_file_data;
- }
- }
-
- if ($view_dropbox_category_sent == 0) {
- foreach ($dropbox_categories as $category) {
- $dropbox_category_data = array();
- if ($category['sent'] == '1') {
- $dropbox_category_data[] = $category['cat_id'];
- $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.$category['cat_id'].'&view='.Security::remove_XSS($_GET['view']).'">';
- $dropbox_category_data[] = $link_open.build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>';
- $dropbox_category_data[] = '<a href="dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>';
-
- $dropbox_category_data[] = '';
-
- $dropbox_category_data[] = '';
- $dropbox_category_data[] = '';
- $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=editcategory&id='.$category['cat_id'].'">'.
- Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
- <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&view='.Security::remove_XSS($_GET['view']).'&action=deletesentcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.
- Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
- }
- if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
- $dropbox_data_sent[] = $dropbox_category_data;
- }
- }
- }
-
- $additional_get_parameters = array('view' => Security::remove_XSS($_GET['view']), 'view_received_category' => Security::remove_XSS($_GET['view_received_category']), 'view_sent_category' => Security::remove_XSS($_GET['view_sent_category']));
- $selectlist = array('delete_received' => get_lang('Delete'), 'download_received' => get_lang('Download'));
- if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
- $selectlist = array('download_received' => get_lang('Download'));
- }
- Display::display_sortable_config_table('dropbox', $column_header, $dropbox_data_sent, $sorting_options, $paging_options, $additional_get_parameters, $column_show, $column_order, $selectlist);
- }
- }
- Display::display_footer();
|