Ejemplo n.º 1
0
	public function parseStatus($dueDate) {

		if (empty($dueDate))	// there is no due date
			return false;
		if (!is_numeric($dueDate))
			$dueDate = strtotime($dueDate);	// make sure $date is a proper timestamp

		//$due = getDate($dueDate);
		//$dueDate = mktime(23,59,59,$due['mon'],$due['mday'],$due['year']); // if there is no time, give them until 11:59 PM to finish the action
		
		//$dueDate += 86399;	
	
		$timeLeft = $dueDate - time();	// calculate how long till due date
		if ($timeLeft < 0)
			return Yii::t('actions','Overdue {time}',array('{time}'=>ActionChild::formatDate($dueDate)));	// overdue by X hours/etc

		else
			return Yii::t('actions','Due {date}',array('{date}'=>ActionChild::formatDate($dueDate)));
	}
Ejemplo n.º 2
0
	</div>
	<div class="description">
		<?php
		$template="<a href=".$this->createUrl('search/search?term=%23\\2')."> #\\2</a>";
			$info=$data->actionDescription;
			$info=mb_ereg_replace('(^|\s)#(\w\w+)',$template,$info);
		if($data->type=='attachment' && $data->completedBy!='Email')
			echo MediaChild::attachmentActionText($data->actionDescription,true,true);
		else
			echo $this->convertLineBreaks($info,true);	// convert LF and CRLF to <br />
		?>
	</div>
	<div class="footer">
	<?php if(empty($data->type)) {
		if ($data->complete == 'Yes') {
			echo Yii::t('actions','Completed by {name}',array('{name}'=>UserChild::getUserLinks($data->completedBy)));
		} else {
			$userLink = UserChild::getUserLinks($data->assignedTo);
			$userLink = empty($userLink)? Yii::t('actions','Anyone') : $userLink;
			echo Yii::t('actions','Assigned to {name}',array('{name}'=>$userLink));
		}
	} else if ($data->type == 'note') {
		echo UserChild::getUserLinks($data->completedBy);
		echo ' '.ActionChild::formatDate($data->completeDate);
	} else if ($data->type == 'attachment' && $data->completedBy!='Email') {
		echo Yii::t('media','Uploaded by {name}',array('{name}'=>UserChild::getUserLinks($data->completedBy)));
	}
	?>
	</div>

</div>