<?php
/**
 * goal_read_view.php - View read goal.
 *
 * @author $Author: samarth
 * @version $Id: goal_read_view.php
 * @copyright Copyright (c) 2010, Tiller Software Co., Ltd.
*/

$url_pdf_type = base_url() . 'pdf/pdfgen/index/' . 'pdf_render_'.'url_goal-goal-loadpdf-'.$goalid.'-PHPSESSIONID/goal';
$jscript_pdf_type="onClick=\"return openBrowserWindow('$url_pdf_type')\"";

if ( !isset($current_page) ) {
	$current_page = 1;
}
$url_edit = base_url()."goal/goal/edit_goal2/{$goalid}/{$current_page}";
$url_up_title = base_url()."goal/goal/{$url_mode}/".$goalid;
//$url_up_title = base_url().'goal/goal/update_goal/'.$goalid;
$url_refresh = base_url().'goal/goal/edit_goal/'.$goalid;
$massage = lang('goal_create_massage_save_complete');

$url_team_member = base_url().'goal/team/select/'.$goalid.'/'.$action;//.$mode_edit.'/'.$goalid.'/'.$type;
if (isset($unitpage))
		echo $unitpage;
if (isset($stagenum) && $stagenum != FALSE) {
	echo $unitbody;
	return ;
}
?>
<span style="vertical-align: middle; margin-left:20px;">
	<?php if ($goal_turn_on != FALSE && $action != CMS_ACTION_EDIT){?>
		<input name="editmodebutton" type="button" value="<?php echo lang('goal_turn_editing_on');?>" <?php osa_btn();?>
			onClick="ajaxGetpage('page_content','<?php echo $url_edit;?>',false);return false;" />
	<?php }else{?>
		<input disabled="disabled" style="color:grey"  name="editmodebutton" type="button" value="<?php echo lang('goal_turn_editing_on');?>" <?php osa_btn();?>/>
	<?php }?>
</span>

<?php if ( isset($show_create_survey) && $show_create_survey ) { ?>
	<span style="vertical-align: middle; margin-left:20px;">
		<input name="surveybutton" type="button" value="<?php echo lang('goal_create_survey');?>" <?php osa_btn();?>
			onClick="ajaxGetpage('page_content','<?php echo site_url(). "survey/util/adds/$goalid";?>',false);return false;" />
	</span>
<?php } ?>

<?php if ( isset($show_list_survey) && $show_list_survey ) { ?>
	<span style="vertical-align: middle; margin-left:20px;">
		<input name="surveybutton" type="button" value="<?php echo lang('goal_list_surveys');?>" <?php osa_btn();?>
			onClick="ajaxGetpage('page_content','<?php echo site_url(). "survey/util/lists/$goalid";?>',false);return false;" />
	</span>
<?php } ?>

<?php if ($hidden_pdf !=FALSE){?>
	 <span style="vertical-align: middle; margin-left:20px;">
		<input type="button" value="<?php echo lang('goal_button_pdf'); ?>" name="pdf" <?php osa_btn()?>
		<?php echo $jscript_pdf_type;?>  />
	</span>
<?php }else{?>
	 <span style="vertical-align: middle; margin-left:20px;">
		<input disabled="disabled" style="color:grey" type="button" value="<?php echo lang('goal_button_pdf'); ?>" name="pdf" <?php osa_btn()?>/>
	</span>
<?php }?>

<?php //if ( $visible_title ) { //show title ?>
	<div class="goal_title"><?php echo $title;?></div>
	<div class="goal_team_members" style="padding-bottom: 5px;"><?php echo lang('goal_create_create_title');?>
	<span> <?php echo $title2; ?></span>
	<?php if ( isset($creator_name) ) {?>
		<div><?php echo lang('goal_creator_name') . $creator_name?></div>
	<?php } ?>
	</div>
<?php if (isset($hide_members) && isset($hide_entrypoint) && $hide_members === FALSE && $hide_entrypoint === FALSE ){?>
	<div class="goal_team_members"><?php echo lang('goal_create_team_members');?>
		<?php if ($goal_editor != FALSE ) { ?>
					<input name="editorbutton" type="button" style="margin-left:15px"
						value="<?php echo lang('goal_create_link_meber'); ?>"
	       			onclick="JavaScript:newDhtmlWindow('<?php echo $url_team_member;?>',
	       		  	  '<?php echo lang('goal_create_link_meber');?>','600','450','team_member');"
	       		  	  <?php osa_btn();?>></input>
		<?php }
		else { ?>
				<input disabled="disabled" style="color:grey" type="button" value="<?php echo lang('goal_create_link_meber'); ?>"
	       		  	  <?php osa_btn();?>></input>
	   <?php } ?>
   </div>
	<div class="goal_members" ><?php @osa_echo($editornames);?></div>

	<div class="goal_entry_point"><?php echo $entry_title;?>
		<span class="goal_type"><?php echo $selectitem_name; ?></span>
	</div>
<?php } ?>
<div style="margin-right:20px">
	<div style="border: 1px solid black;" class="goal_border" >
		<?php echo $unitbody;?><br />
	</div>
	<div class="goal_space" >&nbsp;</div>
</div>
