<? global $vis_language; 
	$status=array(1 => $vis_language['TXTINPROGRESS'],2 => $vis_language['TXTOVERDUE'],3 => $vis_language['TXTCOMPLETED'],4 => $vis_language['TXTCANCELED'],5 =>$vis_language['TXTNOTSTARTED']);
$class='';$attached_id='';?>
<div  class="wrapper-sm m-b-none m-t">
	<?php if($total_task>0){
			for($i=0;$i<$total_task;$i++){
			if($attached_task[$i]['enddate_diff']<=0){ 
				if($attached_task[$i]['task_status']!=3 && $attached_task[$i]['task_status']!=4){
					$attached_task[$i]['task_status'] = 2;
				}
			}
	?>
			<div class="row">
					<div class="col-sm-3 m-t-xs">
						<label><? echo $vis_language['TXTTITLE'];?></label>
						<span class="m-l-sm link vis-pointer" onclick="$('#vis_workpanel_div').visExecution('load_module','<?= $attached_task[$i]['task_title'].'/'.$attached_task[$i]['task_id']?>',{'vis_module':'home', 'vis_operation':'view_update_tasks', 'vis_form':'vis_task_form' ,'vis_task_id':'<? echo $attached_task[$i]['task_id'];?>'})"><? echo $attached_task[$i]['task_title'];?></span>
					</div>
					
					<div class="col-sm-3 m-t-xs">
					   <label><? echo $vis_language['TXTSTATUS']; ?></label>
					   <span class="m-l-sm"><? echo $status[$attached_task[$i]['task_status']];?></span>
					</div>
					
					<div class="col-sm-3 m-t-xs">
					   <label><? echo $vis_language['TXTCREATEDBY']; ?></label>
					   <span class="m-l-sm"><? echo $attached_task[$i]['name'];?></span>
					</div>
					<div class="col-sm-3 m-t-xs pull-right">
						<label><a class="text-muted link" href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=ticket&vis_operation=get_delete_ticket_task&vis_attach_type=12&vis_dept_id=<? echo $operation['vis_dept_id'];?>&vis_parent_id=<? echo $operation['vis_ticket_id'];?>&vis_child_id=<? echo $attached_task[$i]['task_id'];?>" title="<? echo $vis_language['TXTITILDETACH']; ?>"><?= $vis_language['TXTITILDETACH'];?></a></label>
					</div>	
				</div>
			<?php
				$attached_id .=$attached_task[$i]['task_id'].',';
			}
		}?>
		<div class="row">
			<div class="col-sm-12 m-t-xs">
				<?php if($total_task==0){ $class="m-l-sm";?><label><? echo  $vis_language['TXTNOTASKATTACHED'];?></label><?php }?>
				<span class="<?php echo $class;?>">
				<a class="link"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=ticket&vis_operation=attach_ticket_task&vis_ticket_id=<? echo $operation['vis_ticket_id'];?>&vis_dept_id=<? echo $operation['vis_dept_id'];?>&attached_id=<?php echo $attached_id;?>" title="<? echo $vis_language['TXTLINKTASK']; ?>"><?= $vis_language['TXTLINKTASK'];?></a><?PHP echo ' '.$vis_language['TXTOR'];?>
				<a class="link"  href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=home&vis_operation=new_task&vis_ticket_id=<? echo $operation['vis_ticket_id'];?>" title="<? echo $vis_language['TXTADDNWTASK']; ?>"><?= $vis_language['TXTADDNWTASK'];?></a>   </span>
			</div>	
		</div>
</div>
