Example #1
0
if ($this->row->comments() && $this->row->comments() instanceof \Hubzero\Base\ItemList) {
    ?>
			<ul id="td-comments">
			<?php 
    foreach ($this->row->comments() as $comment) {
        ?>
				<li>
					<p><?php 
        echo $comment->content('parsed');
        ?>
</p>
					<p class="todo-assigned"><?php 
        echo $comment->creator('name');
        ?>
 <span class="date"> &middot; <?php 
        echo \Components\Projects\Helpers\Html::timeAgo($comment->get('created')) . ' ' . Lang::txt('PLG_PROJECTS_TODO_AGO');
        ?>
 </span> <?php 
        if ($comment->get('created_by') == $this->uid) {
            ?>
<a href="<?php 
            echo Route::url($url . '&action=deletecomment') . '/?todoid=' . $this->row->get('id') . '&amp;cid=' . $comment->get('id');
            ?>
" id="delc-<?php 
            echo $comment->get('id');
            ?>
" class="confirm-it">[<?php 
            echo Lang::txt('PLG_PROJECTS_TODO_DELETE');
            ?>
]</a><?php 
        }
Example #2
0
 /**
  * Get sync status (AJAX call)
  *
  * @return  string
  */
 public function syncStatus()
 {
     $this->_rSync = new Sync($this->_connect);
     // Incoming
     $pid = Request::getInt('id', 0);
     $service = Request::getVar('service', 'google');
     $status = array('status' => '', 'msg' => time(), 'output' => '');
     // Read status file
     $rFile = $this->_rSync->readFile();
     // Report sync progress
     if ($rFile && $rFile != Lang::txt('PLG_PROJECTS_FILES_SYNC_COMPLETE')) {
         $status = array('status' => 'progress', 'msg' => $rFile, 'output' => '');
     } elseif ($service) {
         // Get time of last sync
         $this->model->reloadProject();
         $synced = $this->model->params->get($service . '_sync');
         $syncLock = $this->model->params->get($service . '_sync_lock', '');
         // Report last sync time
         $msg = $synced && $synced != 1 ? '<span class="faded">' . Lang::txt('PLG_PROJECTS_FILES_LAST_SYNC') . ' ' . \Components\Projects\Helpers\Html::timeAgo($synced, false) . ' ' . Lang::txt('COM_PROJECTS_AGO') . ' </span>' : '';
         $status = array('status' => 'complete', 'msg' => $msg);
         // Refresh view if sync happened recently
         $timecheck = date('c', time() - 1 * 1 * 60);
         if ($synced >= $timecheck) {
             $status['output'] = $this->_browse(2);
         }
         // Timed sync?
         $autoSync = $this->params->get('auto_sync', 0);
         if ($autoSync > 0) {
             if ($autoSync < 1) {
                 $hr = 60 * $autoSync;
                 $timecheck = date('c', time() - 1 * $hr * 60);
             } else {
                 $timecheck = date('c', time() - $autoSync * 60 * 60);
             }
             if ($synced <= $timecheck) {
                 $status['auto'] = 1;
             }
         }
     }
     return json_encode($status);
 }
Example #3
0
echo ucfirst(Lang::txt('PLG_PROJECTS_TEAM_RECENT_VISITS'));
?>
</a></h4>
	<ul>
	<?php 
foreach ($show as $owner) {
    // Do not show more than 5
    if ($i >= 5) {
        break;
    }
    // Get profile thumb image
    $profile = User::getInstance($owner->userid);
    $actor = User::getInstance(User::get('id'));
    $thumb = $profile->get('id') ? $profile->picture() : $actor->picture(true);
    $timecheck = date('Y-m-d H:i:s', time() - 15 * 60);
    $lastvisit = $owner->lastvisit && $owner->lastvisit != '0000-00-00 00:00:00' ? \Components\Projects\Helpers\Html::timeAgo($owner->lastvisit) . ' ' . Lang::txt('PLG_PROJECTS_TEAM_AGO') : Lang::txt('PLG_PROJECTS_TEAM_NEVER');
    $lastvisit = $owner->userid == User::get('id') || !empty($owner->online) && $owner->lastvisit > $timecheck ? '<span class="online">' . Lang::txt('PLG_PROJECTS_TEAM_ONLINE_NOW') . '</span>' : $lastvisit;
    $i++;
    ?>
		<li>
			<span class="pub-thumb"><img src="<?php 
    echo $thumb;
    ?>
" alt=""/></span>
			<span class="pub-details">
				<span class="block"><a href="/members/<?php 
    echo $owner->userid;
    ?>
"><?php 
    echo $owner->fullname;
    ?>
Example #4
0
 /**
  * Return a formatted timestamp
  *
  * @param      string $key Field to return
  * @param      string $as  What data to return
  * @return     string
  */
 protected function _date($key, $as = '')
 {
     if ($this->get($key) == $this->_db->getNullDate()) {
         return NULL;
     }
     switch (strtolower($as)) {
         case 'date':
             return Date::of($this->get($key))->toLocal(Lang::txt('DATE_FORMAT_HZ1'));
             break;
         case 'time':
             return Date::of($this->get($key))->toLocal(Lang::txt('TIME_FORMAT_HZ1'));
             break;
         case 'datetime':
             return $this->_date($key, 'date') . ' &#64; ' . $this->_date($key, 'time');
             break;
         case 'timeago':
             return \Components\Projects\Helpers\Html::timeAgo($this->get($key));
             break;
         default:
             return $this->get($key);
             break;
     }
 }
Example #5
0
					</tr>
					<tr>
						<th><?php 
echo Lang::txt('COM_PROJECTS_LAST_ACTIVITY');
?>
:</th>
						<td><?php 
if ($this->last_activity) {
    $activity = preg_replace('/said/', "posted an update", $this->last_activity->activity);
    $activity = preg_replace('/&#58;/', "", $activity);
    ?>
							<?php 
    echo $this->last_activity->recorded;
    ?>
 (<?php 
    echo \Components\Projects\Helpers\Html::timeAgo($this->last_activity->recorded) . ' ' . Lang::txt('COM_PROJECTS_AGO');
    ?>
) <br /> <span class="actor"><?php 
    echo $this->last_activity->name;
    ?>
</span> <?php 
    echo $activity;
    ?>
							<?php 
} else {
    echo Lang::txt('COM_PROJECTS_NA');
}
?>
						</td>
					</tr>
				</tbody>
Example #6
0
?>
" />
		<input type="hidden" name="uid" id="uid" value="<?php 
echo $this->uid;
?>
" />
		<input type="hidden" name="sharing" id="sharing" value="<?php 
echo $sharing;
?>
" />
		<?php 
if ($sharing && $this->model->access('content')) {
    foreach ($this->services as $service) {
        $lastsync = $this->rSync->get('status') == 'complete' ? date("c") : $this->model->params->get($service . '_sync', '');
        if ($lastsync) {
            $lastsync = '<span class="faded">' . Lang::txt('PLG_PROJECTS_FILES_LAST_SYNC') . ' ' . \Components\Projects\Helpers\Html::timeAgo($lastsync, false) . ' ' . Lang::txt('COM_PROJECTS_AGO') . ' </span>';
        }
        ?>
		<input type="hidden" name="service-<?php 
        echo $service;
        ?>
" id="service-<?php 
        echo $service;
        ?>
" value="<?php 
        echo !empty($this->connections) && isset($this->connections[$service]) ? 1 : 0;
        ?>
" />
		<input type="hidden" name="sync-lock-<?php 
        echo $service;
        ?>