Esempio n. 1
0
         }
         $mlf->CommitTransaction();
     }
     Redirect::Page(URLBuilder::getURL(array('filter_folder_id' => $filter_folder_id), 'UserMessageList.php'));
     break;
 default:
     $mlf = new MessageListFactory();
     $folder_options = $mf->getOptions('folder');
     Debug::text('Filter Folder ID: ' . $filter_folder_id, __FILE__, __LINE__, __METHOD__, 9);
     if (!isset($filter_folder_id) or !in_array($filter_folder_id, array_keys($folder_options))) {
         Debug::text('Invalid Folder, using default ', __FILE__, __LINE__, __METHOD__, 9);
         $filter_folder_id = 10;
     }
     //Make sure folder and sort columns stays as we switch pages.
     URLBuilder::setURL(NULL, array('filter_folder_id' => $filter_folder_id, 'sort_column' => $sort_column, 'sort_order' => $sort_order));
     $mlf->getByUserIdAndFolder($current_user->getId(), $filter_folder_id, $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
     $object_name_options = $mlf->getOptions('object_name');
     $pager = new Pager($mlf);
     $require_ack = FALSE;
     foreach ($mlf as $message) {
         //Get user info
         $ulf = new UserListFactory();
         if ($message->isAck() == FALSE) {
             $require_ack = TRUE;
         }
         if ($message->getRequireAck() == TRUE) {
             $show_ack_column = TRUE;
         }
         $sent_to_full_name = NULL;
         if ($message->getColumn('sent_to_user_id') != FALSE) {
             $ulf->getById($message->getColumn('sent_to_user_id'));
Esempio n. 2
0
unset($elf, $e_obj);
$smarty->assign_by_ref('exceptions', $exceptions);
//Grab list of recent requests
$rlf = new RequestListFactory();
$rlf->getByUserIDAndCompanyId($current_user->getId(), $current_company->getId(), 5, 1);
if ($rlf->getRecordCount() > 0) {
    $status_options = $rlf->getOptions('status');
    $type_options = $rlf->getOptions('type');
    foreach ($rlf as $r_obj) {
        $requests[] = array('id' => $r_obj->getId(), 'user_date_id' => $r_obj->getUserDateID(), 'date_stamp' => TTDate::strtotime($r_obj->getColumn('date_stamp')), 'status_id' => $r_obj->getStatus(), 'status' => Misc::TruncateString($status_options[$r_obj->getStatus()], 15), 'type_id' => $r_obj->getType(), 'type' => $type_options[$r_obj->getType()], 'created_date' => $r_obj->getCreatedDate(), 'deleted' => $r_obj->getDeleted());
    }
}
$smarty->assign_by_ref('requests', $requests);
//Grab list of unread messages
$mlf = new MessageListFactory();
$mlf->getByUserIdAndFolder($current_user->getId(), 10, 5, 1);
if ($mlf->getRecordCount() > 0) {
    $object_name_options = $mlf->getOptions('object_name');
    $require_ack = FALSE;
    foreach ($mlf as $message) {
        //Get user info
        $ulf = new UserListFactory();
        if ($message->isAck() == FALSE) {
            $require_ack = TRUE;
        }
        if ($message->getRequireAck() == TRUE) {
            $show_ack_column = TRUE;
        }
        $messages[] = array('id' => $message->getId(), 'parent_id' => $message->getParent(), 'object_type_id' => $message->getObjectType(), 'object_type' => $object_name_options[$message->getObjectType()], 'object_id' => $message->getObject(), 'priority' => $message->getPriority(), 'status_id' => $message->getStatus(), 'require_ack' => $message->getRequireAck(), 'ack_date' => $message->getAckDate(), 'subject' => Misc::TruncateString($message->getSubject(), 20), 'body' => $message->getBody(), 'created_date' => $message->getCreatedDate(), 'created_by' => $message->getCreatedBy(), 'created_by_full_name' => $ulf->getById($message->getCreatedBy())->getIterator()->current()->getFullName(), 'updated_date' => $message->getUpdatedDate(), 'updated_by' => $message->getUpdatedBy(), 'deleted_date' => $message->getDeletedDate(), 'deleted_by' => $message->getDeletedBy());
    }
}