From a4768670ac96805086883d707b06300ee29fa6a5 Mon Sep 17 00:00:00 2001 From: Julian Prud'homme Date: Wed, 18 Apr 2007 16:34:47 +0200 Subject: [PATCH] [svn r12054] fix bug http://www.dokeos.com/forum/viewtopic.php?t=8907 --- main/dropbox/index.php | 454 +---------------------------------------- 1 file changed, 4 insertions(+), 450 deletions(-) diff --git a/main/dropbox/index.php b/main/dropbox/index.php index f8879abe29..4b37a71134 100644 --- a/main/dropbox/index.php +++ b/main/dropbox/index.php @@ -29,7 +29,7 @@ * @version 1.3 * * @author Jan Bols , main programmer, initial version - * @author René Haentjens , several contributions (see RH) + * @author Ren� Haentjens , several contributions (see RH) * @author Roan Embrechts, virtual course support * @author Patrick Cool , Ghent University (see history version 1.3) * @@ -395,7 +395,7 @@ if (!$_GET['view'] OR $_GET['view']=='received' OR $dropbox_cnf['sent_received_t $dropbox_category_data[]=''.get_lang('Edit').' '.get_lang('Delete').''; } - if (is_array($dropbox_category_data)) + if (is_array($dropbox_category_data) && count($dropbox_category_data)>0) { $dropbox_data_recieved[]=$dropbox_category_data; } @@ -540,7 +540,7 @@ if ($_GET['view']=='sent' OR $dropbox_cnf['sent_received_tabs']==false) $dropbox_category_data[]=''.get_lang('Edit').' '.get_lang('Delete').''; } - if (is_array($dropbox_category_data)) + if (is_array($dropbox_category_data) && count($dropbox_category_data)>0) { $dropbox_data_sent[]=$dropbox_category_data; } @@ -567,451 +567,5 @@ if ($_GET['view']=='sent' OR $dropbox_cnf['sent_received_tabs']==false) Display::display_footer(); -exit; - - - - - - - - - - - - - - - - - - - - - - - - - -if ( $_GET['mailing']) // RH: Mailing detail window passes parameter -{ - getUserOwningThisMailing($_GET['mailing'], $_user['user_id'], '304'); // RH or die - $dropbox_person = new Dropbox_Person( $_GET['mailing'], $is_courseAdmin, $is_courseTutor); - $mailingInUrl = "&mailing=" . urlencode( $_GET['mailing']); -} -else -{ - - $mailingInUrl = ""; -} -$dropbox_person->orderReceivedWork ($receivedOrder); -if( isset($_GET['dropbox_user_filter']) && $_GET['dropbox_user_filter'] != -1) -{ - $dropbox_person->filter_received_work('uploader_id',$_GET['dropbox_user_filter']); -} -$dropbox_person->orderSentWork ($sentOrder); - -if (isset($_POST["feedbackid"]) && isset($_POST["feedbacktext"])) // RH: Feedback -{ - $dropbox_person->updateFeedback ($_POST["feedbackid"], get_magic_quotes_gpc() ? - stripslashes($_POST["feedbacktext"]) : $_POST["feedbacktext"]); -} - - - - - - - - - -/* -============================================================================== - FORM UPLOAD FILE -============================================================================== -*/ -if ( $_GET['mailing']) // RH: Mailing detail: no form upload -{ - echo "

", htmlspecialchars( getUserNameFromId ( $_GET['mailing'])), "

"; - echo "".dropbox_lang("mailingBackToDropbox").'

'; -} -else -{ - -} // RH: Mailing: end of 'Mailing detail: no form upload' - -/* -============================================================================== - FILES LIST -============================================================================== -*/ - -echo "", - "", - "", - "", - "
"; - -/* ------------------------------------------------------------ - RECEIVED FILES LIST: TABLE HEADER ------------------------------------------------------------ -*/ -if ( !$_GET['mailing']) // RH: Mailing detail: no received files -{ - ?> - - - - - - receivedWork); // RH -$i = 0; - -// RH: Feedback: pencil for Give/Edit Feedback, UI rearranged, feedback added - -foreach ( $dropbox_person -> receivedWork as $w) -{ - if ( $w -> uploader_id == $_user['user_id']) // RH: justUpload - { - $numberDisplayed -= 1; continue; - } - ?> - - - - - - - - - - - -
- - - - - - -
-
"> - - "; } ?> - - - - -
-
- &deleteReceived=all&dropbox_unid=" - onClick="return confirmation('');"> - " alt="" /> - "; } ?> -
-
- &id=id)?>"> - - - - - - - - - -
- &id=id)?>"> - title?> (filesize)/1024)?> kB) - - &editFeedback=id)?>&dropbox_unid="> - " alt="" /> - &deleteReceived=id)?>&dropbox_unid=" - onClick='return confirmation("title, ENT_COMPAT)?>");'> - -
- author != '') //only show if filled in in DB - { - ?> author?>
- description != '') - { - ?> description?>
- uploaderName?> upload_date?> - upload_date != $w->last_upload_date) - { - ?>
- last_upload_date?> - -
- feedback)) - { - ?>
- feedback_date), ':
', - nl2br(htmlspecialchars($fbtext)); ?> -
- -
-
-
-
- - - - - - - - sentWork as $w) -{ - $langSentTo = dropbox_lang("sentTo", "noDLTT") . ' '; // RH: Mailing: not for unsent - - // RH: Mailing: clickable folder image for detail - - if ( $w->recipients[0]['id'] > dropbox_cnf("mailingIdBase")) - { - $ahref = "index.php?".api_get_cidreq()."&origin=$origin&mailing=" . urlencode($w->recipients[0]['id']); - $imgsrc = '../img/folder.gif'; - } - else - { - $ahref = "dropbox_download.php?".api_get_cidreq()."&origin=$origin&id=" . urlencode($w->id) . $mailingInUrl; - $imgsrc = '../img/travaux.gif'; - } -?> - - - - - - sentWork)==0) -{ - echo "", - "", - ""; -} - -echo "
- - - - - - -
-
"> - "; } ?> - - - -
-
- - - &deleteSent=all&dropbox_unid=" - onClick="return confirmation('');"> - - -
-
- - - - - - - - - - - -
- - title?> (filesize)/1024)?> kB) - - -recipients[0]['id'] == $_user['user_id']) -{ - $langSentTo = dropbox_lang("justUploadInList", "noDLTT") . ' '; // RH: justUpload -} -elseif ( $w->recipients[0]['id'] > dropbox_cnf("mailingIdBase")) -{ -?> - &mailingIndex=&dropbox_unid="> - " alt="" /> -filesize != 0) - { - $langSentTo = ''; // unsent: do not write 'Sent to' -?> - &mailingIndex=&mailingSend=yes&dropbox_unid=" - onClick='return confirmsend();'> - " alt="" /> - recipients as $r) if (($fb = $r["feedback"])) - if ($r["feedback_date"] > $lastfeedbackdate) - { - $lastfeedbackdate = $r["feedback_date"]; $lastfeedbackfrom = $r["name"]; - } - -if ($lastfeedbackdate) -{ -?> - - &showFeedback=id)?>&dropbox_unid="> - "/> - - &deleteSent=id)?>&dropbox_unid=" - onClick='return confirmation("title, ENT_COMPAT)?>");'> - -
- author != '') //only show if filled in in DB - { - ?> author?>
- description != '') - { - ?> description?>
- ', $langSentTo, ''; - foreach( $w -> recipients as $r){ echo $r["name"], ', '; } - echo '', dropbox_lang("sentOn"), ' ', $w -> upload_date, ''; - - if ($w -> upload_date != $w->last_upload_date) - { - ?>
- last_upload_date?> - -
-
 
-
-
",get_lang('TheListIsEmpty'), - "
", - - "
"; - -if ($origin != 'learnpath') -{ - //we are not in the learning path tool - Display::display_footer(); -} -?> +?> \ No newline at end of file