/**
  * 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;
 }
Ejemplo n.º 2
0
         $dropbox_person->deleteReceivedWork($_GET['deleteReceived']);
     } else {
         die(get_lang('GeneralError') . ' (code 409)');
     }
 } elseif (isset($_GET['deleteSent'])) {
     if ($_GET['deleteSent'] == 'all') {
         $dropbox_person->deleteAllSentWork();
     } elseif (is_numeric($_GET['deleteSent'])) {
         $dropbox_person->deleteSentWork($_GET['deleteSent']);
     } else {
         die(get_lang('GeneralError') . ' (code 410)');
     }
 } elseif (isset($_GET['showFeedback'])) {
     $w = new Dropbox_SentWork($id = $_GET['showFeedback']);
     if ($w->uploader_id != $_user['user_id']) {
         getUserOwningThisMailing($w->uploader_id, $_user['user_id'], '411');
     }
     foreach ($w->recipients as $r) {
         if ($fb = $r['feedback']) {
             $fbarray[$r['feedback_date'] . $r['name']] = $r['name'] . ' ' . get_lang('SentOn', '') . ' ' . $r['feedback_date'] . ":\n" . $fb;
         }
     }
     if ($fbarray) {
         krsort($fbarray);
         echo '<textarea class="dropbox_feedbacks">', htmlspecialchars(implode("\n\n", $fbarray), ENT_QUOTES, api_get_system_encoding()), '</textarea>', "\n";
     } else {
         echo '<textarea class="dropbox_feedbacks">&nbsp;</textarea>', "\n";
     }
     $tellUser = get_lang('ShowFeedback');
 } else {
     // if ( isset( $_GET['editFeedback'])) {