<? global $vis_language;

	if($operation['vis_solution_type']=='permanent'){
		$label = $vis_language['TXTPERMANANTSOLUTION'];
		$desc = '';$problems_details['rootcause'];
		$problem_attachments = $problems_details['rootcause_attachment'];
	}
	else if($operation['vis_solution_type']=='workaround'){
		$label = $vis_language['TXTWORKAROUNDSOLUTION'];
		$desc = '';$problems_details['impact_analysis'];
		$problem_attachments = $problems_details['impact_attachment'];
	}
	?>
		
<form class="form-horizontal" method="post" enctype="multipart/form-data" name="vis_problem_solution_edit" id="vis_problem_solution_edit_<? echo $problems_details['problem_id']; ?>">
	<div class="panel-heading b-b b-light">
		<div class="clear">
			<div class="row">
				<div class="m-l pull-left">
					<label class="pull-left"><? echo $label; ?></label>
				</div>
			</div>
		</div>
	</div>
	<div class="panel-collapse wrapper">
	<div class="form-group">
		<div class="col-sm-12">
			<input type="text" class="form-control input-sm" data-type="text" data-required="true" name="vis_title" id="vis_title" value="<?php echo htmlentities($selfhelp_data[0]['article_title'], ENT_COMPAT, 'UTF-8');?>" placeholder="<? echo $vis_language['TXTTITLE']; ?>">
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-12">
			<textarea name="vis_description" id="vis_description_<? echo $operation['vis_solution_type']; ?>" class="form-control"><? echo $desc; ?><?php echo $selfhelp_data[0]['content']?></textarea>
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-12 text-right">		    
			<input name="vis_problem_id" type="hidden" value="<? echo $problems_details['problem_id']; ?>" />
			<input name="vis_selfhelp_id" type="hidden" value="<? echo $selfhelp_data[0]['article_id']?>" />
			
			<span class="btn btn-default" onclick="$('#problem_analysis_<? echo $problems_details['problem_id']; ?>').visExecution('load_operations',{'vis_module':'problem', 'vis_operation':'get_details', 'vis_action':'solution', 'vis_problem_id':'<? echo $problems_details['problem_id']; ?>', 'vis_department_id':'<? echo $problems_details['department_id']; ?>', 'vis_readonly':1});"><? echo $vis_language['TXTDISCARD']; ?></span>
			
			<span class="btn btn-primary m-l-xs" onclick="$(this).visExecution('submit_form',{'vis_module':'problem', 'vis_operation':'update_problem_solution', 'vis_form':'vis_problem_solution_edit_<? echo $problems_details['problem_id']; ?>', 'vis_solution_type' : '<?php echo $operation['vis_solution_type'];?>', 'vis_domain':'<? echo $problems_details['domain_id']; ?>'})";><? echo $vis_language['TXTSAVE']; ?></span>
        </div>
    </div>
	</div>
</form>
<script type="text/javascript">
	<? if(!defined('VIS_HTML_EDITOR') || VIS_HTML_EDITOR==1) { ?>    
		$(function(){
			$('#vis_description_<? echo $operation['vis_solution_type']; ?>').redactor({
				buttonSource: true,
				minHeight: 100, // pixels
				maxHeight: 100,
				imageUpload: "index.php?vis_tmpst="+new Date().getTime()+"&vis_module=ticket&vis_operation=upload_file&vis_static_area=editor_image_upload",
                imageUploadParam: 'files',
				focus: true,
				plugins: ['source'],
                deniedTags: ['html', 'head', 'link', 'body', 'meta', 'script','applet']
			});
		});
	<? } ?>
</script>
