示例#1
0
 /**
  *  Return
  */
 public function modGetPendingTask($inFilter)
 {
     $tasks = '';
     $tmpl = new StreamTemplate();
     $model = StreamFactory::getModel('stream');
     $my = JXFactory::getUser();
     // Get todo list with due date
     $filter = array();
     $filter['type'] = 'todo';
     $filter['has_end_date'] = true;
     $filter['order_by_asc'] = 'end_date';
     $filter = array_merge($filter, $inFilter);
     $data = $model->getStream($filter);
     // calculate total task
     $hasWarnDue = false;
     $hasWarnToday = false;
     $hasWarnThisWeek = false;
     $hasWarnLater = false;
     $username = '';
     $showName = JRequest::getVar('option') == 'com_stream';
     $today = new JXDate();
     //echo count($data); exit;
     foreach ($data as $stream) {
         $dueDate = new JDate($stream->end_date);
         $raw = json_decode($stream->raw);
         $todoIndex = 0;
         $class = $my->authorise('stream.todo.done', $stream) ? '' : 'readonly';
         foreach ($raw->todo as $todo) {
             if (!empty($todo)) {
                 if (!$stream->getState($todoIndex)) {
                     // Put the due labels
                     if ($today->isOverdue($dueDate)) {
                         if (!$hasWarnDue) {
                             $tasks .= '<li class="todo-overdue"><span class="label label-important">' . JText::_('COM_PROFILE_LABEL_OVERDUE') . '</span></li>';
                             $hasWarnDue = true;
                         }
                     } elseif ($today->isToday($dueDate)) {
                         if (!$hasWarnToday) {
                             $tasks .= '<li class="todo-today"><span class="label label-success">' . JText::_('COM_PROFILE_LABEL_TODAY') . '</span></li>';
                             $hasWarnToday = true;
                         }
                     } elseif ($today->isThisWeek($dueDate)) {
                         if (!$hasWarnThisWeek) {
                             $tasks .= '<li class="todo-thisweek"><span class="label label-warning">' . JText::_('COM_PROFILE_LABEL_THIS_WEEK') . '</span></li>';
                             $hasWarnThisWeek = true;
                         }
                     } elseif (!$hasWarnLater) {
                         $tasks .= '<li class="todo-later"><span class="label">' . JText::_('COM_PROFILE_LABEL_LATER') . '</span></li>';
                         $hasWarnLater = true;
                     }
                     // end due labels
                     if ($showName) {
                         $username = '******' . StreamTemplate::escape(JXFactory::getUser($stream->user_id)->name) . '</span>';
                     }
                     $tasks .= '<li class="clearfix todo-item"><a class="done-todo-item ' . $class . '" data-message_id="' . $stream->id . '" data-todo_index="' . $todoIndex . '" href="javascript: void(0);"></a><span>' . StreamMessage::format($todo) . $username . '</span></li>';
                 }
                 $todoIndex++;
             }
         }
     }
     // Get todo with NO due date
     unset($filter);
     $filter = array();
     $filter['type'] = 'todo';
     $filter['!has_end_date'] = true;
     $filter['order_by_asc'] = 'id';
     $filter = array_merge($filter, $inFilter);
     $data = $model->getStream($filter);
     $hasWarnAnytime = false;
     foreach ($data as $stream) {
         $raw = json_decode($stream->raw);
         $todoIndex = 0;
         foreach ($raw->todo as $todo) {
             if (!empty($todo)) {
                 $class = $my->authorise('stream.todo.done', $stream) ? '' : 'readonly';
                 if (!$stream->getState($todoIndex)) {
                     if (!$hasWarnAnytime) {
                         $tasks .= '<li class="todo-anytime"><span class="label">' . JText::_('COM_PROFILE_LABEL_ANYTIME') . '</span></li>';
                         $hasWarnAnytime = true;
                     }
                     if ($showName) {
                         $username = '******' . StreamTemplate::escape(JXFactory::getUser($stream->user_id)->name) . '</span>';
                     }
                     $tasks .= '<li class="clearfix todo-item"><a class="done-todo-item ' . $class . '" data-message_id="' . $stream->id . '" data-todo_index="' . $todoIndex . '" href="javascript:void(0);"></a><span>' . StreamMessage::format($todo) . $username . '</span></li>';
                 }
                 $todoIndex++;
             }
         }
     }
     if (empty($tasks)) {
         $tasks = '<div class="alert-message block-message info"><p>' . JText::_('COM_STREAM_LABEL_NO_PENDING_TASK') . '</p></div>';
     }
     $tmpl->set('tasks', $tasks);
     return $tmpl->fetch('todo.module.pending');
 }
示例#2
0
				<div class="direct-content-to">
					<a href="<?php 
    echo $user->getURL();
    ?>
" class="actor-link"><?php 
    echo $this->escape($user->name);
    ?>
</a> <span style="font-size: 16px;">&nbsp;&#8250;&nbsp;</span>
					<?php 
    echo implode($members, ', ');
    ?>
				</div>
				<div class="direct-content-message">
					<div class="autoShorten">
						<?php 
    echo StreamMessage::format($stream->message);
    ?>
					</div>
					<div class="clear"></div>
					<div class="message-content">
					<?php 
    echo StreamMessage::getAttachmentHTML($stream);
    ?>
					</div>
				</div>
			</div>
			<div class="direct-date">
				<?php 
    echo JXDate::formatLapse($date);
    ?>
			</div>
示例#3
0
            $doneTodo++;
        }
        ?>
">
						<a href="javascript: void(0);" data-message_id="<?php 
        echo $task->id;
        ?>
" data-type="list" data-todo_index="<?php 
        echo $todoIndex;
        ?>
" class="done-todo-item <?php 
        echo $my->authorise('stream.todo.done', $task) ? '' : 'readonly';
        ?>
"></a>
						<span><?php 
        echo StreamMessage::format($todo);
        ?>
							<?php 
        if ($isDone) {
            ?>
&nbsp;<span class="small hint"><?php 
            echo $this->escape($doneBy->name);
            echo $doneOn;
            ?>
</span><?php 
        }
        ?>
						</span>
					</li>
					<?php 
        $todoIndex++;
示例#4
0
	</ol>

</div>

<div class="data-grid">
	
	<div class="content-title">
		<h3>Links</h3>
		<a href="<?php 
echo JRoute::_('index.php?option=com_stream&view=links&user_id=' . $this->user->id);
?>
">Show All (<?php 
echo $this->linkCount;
?>
)</a>		
	</div>
	
	<ol class="content-list">
		<?php 
foreach ($this->links as $link) {
    ?>
			<li><?php 
    echo StreamMessage::format($link->link);
    ?>
</li>
		<?php 
}
?>
	</ol>

</div>
示例#5
0
    ?>
 class="complete-todo" id="complete_<?php 
    echo $milestone->id;
    ?>
"  data-status="<?php 
    echo $milestone->status;
    ?>
"/>
				<?php 
}
?>
				<span><a href="<?php 
echo $milestone->getUri();
?>
"><?php 
echo StreamMessage::format($milestone->message);
?>
</a></span>
			</div>
			<?php 
if ($milestoneStatus != COMPLETED) {
    ?>
			
			<div class="progress progress-info progress-striped" milestone="<?php 
    echo $milestone->id;
    ?>
">
				<div class="bar" style="width: <?php 
    echo $milestone->getParam('progress', 0);
    ?>
%;"></div>
示例#6
0
	<thead>
		<tr>
			<th class="file-name"><?php 
echo JText::_('COM_STREAM_LABEL_LINKS');
?>
</th>
		</tr>
	</thead>
	
	<tbody>
	<?php 
foreach ($links as $no => $row) {
    $user = JXFactory::getUser($row->user_ids);
    ?>
		<tr>
			<td>
				<?php 
    echo $no + 1 . '. ' . StreamMessage::format($row->link);
    ?>
			</td>
		</tr>
	<?php 
}
?>
	</tbody>
</table>
<div class="pagination">
<?php 
echo $pagination->getPagesLinks();
?>
</div>
示例#7
0
}
?>
	<?php 
if ($comment->id > $lastCommentView) {
    $my->setParam('group_' . $comment->group_id . '_comment', $comment->id);
    $my->save();
}
?>
	<a href="<?php 
echo $user->getURL();
?>
"><?php 
echo $this->escape($user->name);
?>
</a> <?php 
echo StreamMessage::format($comment->comment);
?>
	<div class="comment-meta">
		<span><?php 
echo JXDate::formatLapse($commentDate);
?>
</span>
		<span style="<?php 
if ($commentLikeCount <= 0) {
    echo 'display: none;';
}
?>
">• <span class="comment-like"><?php 
echo $commentLikeCount;
?>
</span></span>