<? global $vis_language, $request_data;
   $post_count=count($post_details);
?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
    <div class="col-sm-5 col-xs-5">
        <h3 class="m-b-xs text-black"><i class="vh vh-release-management vh-green vh-lg"></i> <span><?php echo($releases_details['release_hash']); ?></span></h3>
        <ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
            <li><a class="link" href="#/home/quick_view/<?= $vis_language['TXTHOME'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<?= $vis_language['TXTHOME'];?>',{'vis_module':'home','vis_operation':'quick_view', 'vis_action':'#/home/quick_view/<?= $vis_language['TXTHOME'];?>'});"><?= $vis_language['TXTHOME'];?></a></li>
            <li><a class="link" href="#/releases/filter_releases/<? echo $vis_language['TXTRELEASES']; ?>/16"><?= $vis_language['TXTRELEASES']; ?></a></li>
            <li class="active"><?php echo($releases_details['release_hash']); ?></li>
        </ul>
    </div>
    <div class="clearfix col-sm-7 text-right text-left-xs m-t-lg">
        <div class="row">
			<div class="col-sm-12">
				<div class="pull-right">
					<div class="btn-group">
						<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="vh vh-action text-muted"></i> <b class="caret"></b></button>
						<ul class="dropdown-menu dropdown-menu-right text-left">
							<li><a href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=releases&vis_operation=get_release_properties&vis_static_area=vis_ticket_property_form&vis_release_id=<? echo $releases_details['release_id']; ?>&vis_staff_id=<? echo $releases_details['release_from']; ?>&vis_domain_id=<? echo $releases_details['domain_id']; ?>"><? echo $vis_language['TXTPROPERTIES']; ?></a></li>
							<li><a href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=releases&vis_operation=new_note&vis_static_area=vis_release_note_form&vis_release_id=<? echo $releases_details['release_id']; ?>&vis_staff_id=<? echo $releases_details['release_from']; ?>&vis_domain_id=<? echo $releases_details['domain_id']; ?>"><? echo $vis_language['TXTNOTEADD']; ?></a></li>
						</ul>                            
					</div>
				</div>
				</div>
			</div>
    </div>
    <div class="m-l-md clr">
    </div>
</section>
<div class="col-lg-12 b-t b-light" id="release_details_view">
	<div class="form-group m-l-n clear m-b-xs m-t-xs">
		<div class="padder h4 font-bold">
			<span id="vis_ticket_subject">
				<span><? echo $vis_language['TXTSUBJECT']; ?></span>
				<span class="text-lt h4 l-h font-bold">: <? if($releases_details['release_from']==0){?><i class="vh vh-information-round vh-blue" title="<?= $vis_language['TXTINTERNALTICKET']?>"></i><? } ?><? echo $releases_details['subject']; ?></span> 
			</span>
		</div>
	</div>
   
	<div>
		<ul class="navSeprator no-padder m-b-n">
			<li><label><? echo $vis_language['TXTCREATEDBY']?></label>
				<a href="#/setting/staff_details/<?php echo $staff_info[0]['user_name']?>/<?= $releases_details['release_from']?>" class="link m-l-xs" onmouseover="javascript:show_user_details(2,<?= $releases_details['release_from']?>,null,null,1);" id="user_<?= $releases_details['release_from'];?>" onmouseout="hide_user_details(this);"> <?= $staff_info[0]['first_name'].' '.$staff_info[0]['last_name']." < ".$staff_info[0]['email']." >"; ?></a>
			</li>
			<li><label><? echo $vis_language['TXTCREATIONDATE']; ?></label><span class="text-muted m-l-xs"><? echo format_datetime($releases_details['date_created']); ?></span></li>
			<li><label><? echo $vis_language['TXTMODIFICATIONDATE']; ?></label><span class="text-muted m-l-xs"><?php echo format_datetime($releases_details['date_modified']); ?></span></li>
		</ul>
	</div>
	<div id="vis_release_reply_<? echo $releases_details['release_id']; ?>" style="display:none"></div>
	<div id="vis_release_forward_<? echo $releases_details['release_id']; ?>" style="display:none"></div>
	<section class="panel panel-default m-t-xs">
		<header class="panel-heading text-right bg-light clearfix">
			<ul class="nav nav-tabs pull-left no-borders" id="tabs"> 
				<li id="release_details" class="active"><a href="#vis_details_list_<? echo $releases_details['release_id']; ?>" data-toggle="tab" onclick="$('#vis_details_list_<? echo $releases_details['release_id']; ?>').visExecution('load_operations',{'vis_module':'releases', 'vis_operation':'get_details', 'vis_action':'details', 'vis_release_id':'<? echo $releases_details['release_id']; ?>', 'vis_department_id':'<? echo $releases_details['department_id']; ?>', 'vis_readonly':1});set_active_tab('release_details');"><? echo $vis_language['TXTRELEASEDETAILS']; ?></a></li>
				
				<li id="audit_log"><a href="#vis_details_list_<? echo $releases_details['release_id']; ?>" data-toggle="tab" onclick="$('#vis_details_list_<? echo $releases_details['release_id']; ?>').visExecution('load_operations',{'vis_module':'releases', 'vis_operation':'get_details', 'vis_action':'audit_log', 'vis_release_id':'<? echo $releases_details['release_id']; ?>'});set_active_tab('audit_log');"><? echo $vis_language['TXTAUDITLOG']; ?></a></li>
				
				<li id="notes"<?if(count($note_details)==0) echo 'style="display:none;"'; else echo 'style="display:block;"';?>><a href="#vis_details_list_<? echo $releases_details['release_id']; ?>" data-toggle="tab" onclick="$('#vis_details_list_<? echo $releases_details['release_id']; ?>').visExecution('load_area',{'vis_module':'releases', 'vis_operation':'get_details', 'vis_action':'notes', 'vis_domain_id':<? echo $releases_details['domain_id']; ?>, 'vis_client_id':<? echo $releases_details['release_from']; ?>, 'vis_release_id':<? echo $releases_details['release_id']; ?>});set_active_tab('notes');"><? echo $vis_language['TXTNOTES']; ?></a></li>
                
			</ul>
		</header>
		<div class="panel-body">
			<div class="tab-content">
				<div class="tab-pane active" id="vis_details_list_<? echo $releases_details['release_id']; ?>">
					<script language="javascript">
						$('#vis_details_list_<? echo $releases_details['release_id']; ?>').visExecution('load_operations',{'vis_module':'releases', 'vis_operation':'get_details', 'vis_action':'details', 'vis_release_id':'<? echo $releases_details['release_id']; ?>', 'vis_department_id':'<? echo $releases_details['department_id']; ?>', 'vis_readonly':1});
					</script>
				</div>
			</div>
		</div>
	</section>
	<section id="vis_ticket_post_forms">
		<? include(VIS_PATH_TEMPLATE.'release_description.php'); ?>
	</section>
</div>
<script>
$(".selectpicker").selectpicker();
function set_active_tab(tab_id){
	var active = $("#tabs .active").attr("id");
	$("#"+active).removeClass("active");
	$("#"+tab_id).addClass("active").show();
	var parent_div = $("#vis_details_list_<?= $releases_details['release_id'];?>").parent().parent();
	if(parent_div.hasClass("p-l-none") && parent_div.hasClass("p-r-none"))
		parent_div.removeClass("p-l-none").removeClass("p-r-none");
	else if(parent_div.hasClass("no-padder"))
		parent_div.removeClass("no-padder");
		
	if($("#release_details_view #tabs #invoices.active").length
	|| $("#release_details_view #tabs #history.active").length
	|| $("#release_details_view #tabs #link.active").length) 
		parent_div.addClass("no-padder");
	else if($("#release_details_view #tabs #time_track.active").length || $("#release_details_view #tabs #history.active").length || $("#release_details_view #tabs #audit_log.active").length)
		parent_div.addClass("p-l-none").addClass("p-r-none");	
}
</script>
