<commit_before><?php 
	$config_app = require path('public') . 'config.app.php';  
	if(!isset($config_app['PriorityColors'])) { $config_app['PriorityColors'] = array("black","Orchid","Cyan","Lime","orange","red"); }
	$url =\URL::home();
	if (!Project\User::MbrProj(\Auth::user()->id, Project::current()->id)) {
		echo '<script>document.location.href="'.URL::to().'";</script>';
	}
	$following = \DB::table('following')->where('project','=',0)->where('issue_id','=',Project\Issue::current()->id)->where('user_id','=',\Auth::user()->id)->count();
	if ($following == 0) {
		$follower["attached"] = 0;
		$follower["tags"] = 0;
		$follower["comment"] = 0;
	} else {
		$following =\DB::query("SELECT 1 as 'comment', attached, tags FROM following WHERE project_id = ".Project::current()->id." AND project = 0 AND issue_id = ".Project\Issue::current()->id." AND user_id = ".\Auth::user()->id);
		$follower["attached"] = $following[0]->attached ?? 0;
		$follower["tags"] = $following[0]->tags ?? 0;
		$follower["comment"] = $following[0]->comment ?? 0;
	}
?>
<h3>
	<?php if (Auth::user()->role_id != 1) { ?>
	<a href="<?php echo Project::current()->to('issue/new'); ?>" class="newissue"><?php echo __('tinyissue.new_issue'); ?></a>
   <?php } ?> 

	<span style="color: <?php echo $config_app['PriorityColors'][$issue->status]; ?>; font-size: 200%;">&#9899;
	<?php if(Auth::user()->permission('issue-modify') && $issue->status > 0 ): ?>
	<a href="<?php echo $issue->to('edit'); ?>" class="edit-issue" style="font-size: 80%; font-weight: bold;"><?php echo $issue->title; ?></a>
	<?php else: ?>
	<a href="<?php echo $issue->to(); ?>" style="font-size: 80%; font-weight: bold;"><?php echo $issue->title; ?></a>
	<?php endif; ?>
	</span>	

	<span><?php echo __('tinyissue.on_project'); ?> <a href="<?php echo $project->to(); ?>"><?php echo $project->name; ?></a></span>
</h3>
<div class="pad">

	<div style="background-color: #ededed; width: 20%; float: right; ">
		<?php if (isset($follower)) { ?>
		<div style="width:25%; float:left;">
			<span style="font-weight: bold; font-size: 125%;"><?php echo __('tinyissue.following'); ?></span>
			<br />
			&nbsp;&nbsp;&nbsp;
			<img src="<?php echo \URL::home();?>app/assets/images/layout/icon-comments_<?php echo $follower["comment"]; ?>.png" id="img_following" />
		</div>
		<div style="width:75%; float:right;">
			<input id="input_following_comments" type="checkbox" value="1" <?php echo ($follower["comment"]) ? 'checked' : ''; ?> onclick="Following('comments', this.checked);" />
			<?php echo __('tinyissue.following_email_comment_tit'); ?>
			<br />
			<input id="input_following_attached" type="checkbox" value="1" <?php echo ($follower["attached"]) ? 'checked' : ''; ?> onclick="Following('attached', this.checked);" />
			<?php echo __('tinyissue.following_email_attached_tit'); ?>
			&nbsp;&nbsp;&nbsp;
			<input id="input_following_tags" type="checkbox" value="1" <?php echo ($follower["tags"]) ? 'checked' : ''; ?> onclick="Following('tags', this.checked);" />
			<?php echo __('tinyissue.following_email_tags_tit'); ?>
		</div>
		<?php } ?>
	</div>
	<div id="issue-tags">
	<?php
			//Percentage of work done
			////Calculations
			$SizeXtot = 500;
			$SizeX = $SizeXtot / 100;
			echo __('tinyissue.issue_percent').' : ';
			$EtatTodo = Todo::load_todo($issue->id);
			////Here we show the progress bar
		if (Auth::user()->role_id != 1) {
			if (is_object($EtatTodo)) {
				echo '<div class="Percent">';
				echo '<div style="background-color: green; position: absolute; top: 0; left: 0; width: '.($EtatTodo->weight).'%; height: 100%; text-align: center; line-height:20px;" />'.$EtatTodo->weight.'%</div>';
				echo '<div style="background-color: gray; position: absolute;  top: 0; left: '.$EtatTodo->weight.'%; width: '.(100-$EtatTodo->weight).'%; height: 100%; text-align: center; line-height:20px;" />'.(100-$EtatTodo->weight).'%</div>';
				echo '</div>';
			}
	
			//Time's going fast!
			//Timing bar, according to the time planified (field projects_issues - duration) for this issue
			////Calculations
			$config_app = require path('public') . 'config.app.php';
			$Deb = strtotime($issue->created_at);
			$Dur = (time() - $Deb) / 86400;
			if (@$issue->duration === 0 || @is_null($issue->duration)) { $issue->duration = 30; }
			$DurRelat = round(($Dur / $issue->duration) * 100);
			$Dur = round($Dur);
			$DurColoF = ($DurRelat < 65) ? 'white' : (( $DurRelat > $config_app['Percent'][3]) ? 'white' : 'black') ;
			$DurColor = ($DurRelat < 65) ? 'green' : (( $DurRelat > $config_app['Percent'][3]) ? 'red' : 'yellow') ;
			if ($DurRelat >= 50 && @$EtatTodo->weight <= 50 ) { $DurColor = 'yellow'; }
			if ($DurRelat >= 75 && @$EtatTodo->weight <= 50 ) { $DurColor = 'red'; }
			$TxtColor = ($DurColor == 'green') ? 'white' : 'black' ;
			////Here we show to progress bar
			echo __('tinyissue.countdown').' ('.__('tinyissue.day').'s) : ';
			echo '<div class="Percent">';
			echo '<div style="color: '.$DurColoF.'; background-color: '.$DurColor.'; position: absolute; top: 0; left: 0; width: '.(($DurRelat <= 100) ? $DurRelat : 100).'%; height: 100%; text-align: center; line-height:20px;" />'.((($DurRelat  >= 100)) ? $Dur.' / '.@$issue->duration : $Dur).'</div>';
			if ($DurRelat < 100) {  echo '<div style="background-color: gray; position: absolute;  top: 0; left: '.$DurRelat.'%; width: '.(100-$DurRelat).'%; height: 100%; text-align: center; line-height:20px;" />'.$issue->duration.'</div>'; }
			echo '</div>';
	
	
			echo '<br clear="all" />';
		}

		$IssueTags = array();
		if(!empty($issue->tags)) {
			foreach($issue->tags()->order_by('tag', 'ASC')->get() as $tag) {
			echo '<label class="label" style="'.($tag->bgcolor ? 'background-color: '.$tag->bgcolor . ';' : '').($tag->ftcolor ? 'color: '.$tag->ftcolor . ';' : ''). '>' . $tag->tag . '"></label>&nbsp;';
			$IssueTags[] = $tag->tag;
			}  //endforeach
		} //endif
	?>
	</div>
	<?php Todo::add_todo($issue->id, 2, 0); ?>

	<ul id="ul_IssueDiscussion" class="issue-discussion">
		<li>
			<div class="insides">
				<div class="topbar">
					<strong><?php echo $issue->user->firstname . ' ' . $issue->user->lastname; ?> </strong>
					<?php echo __('tinyissue.opened_this_issue'); ?>  <?php echo date(Config::get('application.my_bugs_app.date_format'), strtotime($issue->created_at)); ?>
				</div>

				<div class="issue">
					<?php echo Project\Issue\Comment::format($issue->body); ?>
				</div>

				<ul class="attachments">
					<?php foreach($issue->attachments()->get() as $attachment): ?><commit_msg>Un guillemet oublié corrige tout lorsque remis<commit_after><?php 
	$config_app = require path('public') . 'config.app.php';  
	if(!isset($config_app['PriorityColors'])) { $config_app['PriorityColors'] = array("black","Orchid","Cyan","Lime","orange","red"); }
	$url =\URL::home();
	if (!Project\User::MbrProj(\Auth::user()->id, Project::current()->id)) {
		echo '<script>document.location.href="'.URL::to().'";</script>';
	}
	$following = \DB::table('following')->where('project','=',0)->where('issue_id','=',Project\Issue::current()->id)->where('user_id','=',\Auth::user()->id)->count();
	if ($following == 0) {
		$follower["attached"] = 0;
		$follower["tags"] = 0;
		$follower["comment"] = 0;
	} else {
		$following =\DB::query("SELECT 1 as 'comment', attached, tags FROM following WHERE project_id = ".Project::current()->id." AND project = 0 AND issue_id = ".Project\Issue::current()->id." AND user_id = ".\Auth::user()->id);
		$follower["attached"] = $following[0]->attached ?? 0;
		$follower["tags"] = $following[0]->tags ?? 0;
		$follower["comment"] = $following[0]->comment ?? 0;
	}
?>
<h3>
	<?php if (Auth::user()->role_id != 1) { ?>
	<a href="<?php echo Project::current()->to('issue/new'); ?>" class="newissue"><?php echo __('tinyissue.new_issue'); ?></a>
   <?php } ?> 

	<span style="color: <?php echo $config_app['PriorityColors'][$issue->status]; ?>; font-size: 200%;">&#9899;
	<?php if(Auth::user()->permission('issue-modify') && $issue->status > 0 ): ?>
	<a href="<?php echo $issue->to('edit'); ?>" class="edit-issue" style="font-size: 80%; font-weight: bold;"><?php echo $issue->title; ?></a>
	<?php else: ?>
	<a href="<?php echo $issue->to(); ?>" style="font-size: 80%; font-weight: bold;"><?php echo $issue->title; ?></a>
	<?php endif; ?>
	</span>	

	<span><?php echo __('tinyissue.on_project'); ?> <a href="<?php echo $project->to(); ?>"><?php echo $project->name; ?></a></span>
</h3>
<div class="pad">

	<div style="background-color: #ededed; width: 20%; float: right; ">
		<?php if (isset($follower)) { ?>
		<div style="width:25%; float:left;">
			<span style="font-weight: bold; font-size: 125%;"><?php echo __('tinyissue.following'); ?></span>
			<br />
			&nbsp;&nbsp;&nbsp;
			<img src="<?php echo \URL::home();?>app/assets/images/layout/icon-comments_<?php echo $follower["comment"]; ?>.png" id="img_following" />
		</div>
		<div style="width:75%; float:right;">
			<input id="input_following_comments" type="checkbox" value="1" <?php echo ($follower["comment"]) ? 'checked' : ''; ?> onclick="Following('comments', this.checked);" />
			<?php echo __('tinyissue.following_email_comment_tit'); ?>
			<br />
			<input id="input_following_attached" type="checkbox" value="1" <?php echo ($follower["attached"]) ? 'checked' : ''; ?> onclick="Following('attached', this.checked);" />
			<?php echo __('tinyissue.following_email_attached_tit'); ?>
			&nbsp;&nbsp;&nbsp;
			<input id="input_following_tags" type="checkbox" value="1" <?php echo ($follower["tags"]) ? 'checked' : ''; ?> onclick="Following('tags', this.checked);" />
			<?php echo __('tinyissue.following_email_tags_tit'); ?>
		</div>
		<?php } ?>
	</div>
	<div id="issue-tags">
	<?php
			//Percentage of work done
			////Calculations
			$SizeXtot = 500;
			$SizeX = $SizeXtot / 100;
			echo __('tinyissue.issue_percent').' : ';
			$EtatTodo = Todo::load_todo($issue->id);
			////Here we show the progress bar
		if (Auth::user()->role_id != 1) {
			if (is_object($EtatTodo)) {
				echo '<div class="Percent">';
				echo '<div style="background-color: green; position: absolute; top: 0; left: 0; width: '.($EtatTodo->weight).'%; height: 100%; text-align: center; line-height:20px;" />'.$EtatTodo->weight.'%</div>';
				echo '<div style="background-color: gray; position: absolute;  top: 0; left: '.$EtatTodo->weight.'%; width: '.(100-$EtatTodo->weight).'%; height: 100%; text-align: center; line-height:20px;" />'.(100-$EtatTodo->weight).'%</div>';
				echo '</div>';
			}
	
			//Time's going fast!
			//Timing bar, according to the time planified (field projects_issues - duration) for this issue
			////Calculations
			$config_app = require path('public') . 'config.app.php';
			$Deb = strtotime($issue->created_at);
			$Dur = (time() - $Deb) / 86400;
			if (@$issue->duration === 0 || @is_null($issue->duration)) { $issue->duration = 30; }
			$DurRelat = round(($Dur / $issue->duration) * 100);
			$Dur = round($Dur);
			$DurColoF = ($DurRelat < 65) ? 'white' : (( $DurRelat > $config_app['Percent'][3]) ? 'white' : 'black') ;
			$DurColor = ($DurRelat < 65) ? 'green' : (( $DurRelat > $config_app['Percent'][3]) ? 'red' : 'yellow') ;
			if ($DurRelat >= 50 && @$EtatTodo->weight <= 50 ) { $DurColor = 'yellow'; }
			if ($DurRelat >= 75 && @$EtatTodo->weight <= 50 ) { $DurColor = 'red'; }
			$TxtColor = ($DurColor == 'green') ? 'white' : 'black' ;
			////Here we show to progress bar
			echo __('tinyissue.countdown').' ('.__('tinyissue.day').'s) : ';
			echo '<div class="Percent">';
			echo '<div style="color: '.$DurColoF.'; background-color: '.$DurColor.'; position: absolute; top: 0; left: 0; width: '.(($DurRelat <= 100) ? $DurRelat : 100).'%; height: 100%; text-align: center; line-height:20px;" />'.((($DurRelat  >= 100)) ? $Dur.' / '.@$issue->duration : $Dur).'</div>';
			if ($DurRelat < 100) {  echo '<div style="background-color: gray; position: absolute;  top: 0; left: '.$DurRelat.'%; width: '.(100-$DurRelat).'%; height: 100%; text-align: center; line-height:20px;" />'.$issue->duration.'</div>'; }
			echo '</div>';
	
	
			echo '<br clear="all" />';
		}

		$IssueTags = array();
		if(!empty($issue->tags)) {
			foreach($issue->tags()->order_by('tag', 'ASC')->get() as $tag) {
			echo '<label class="label" style="'.($tag->bgcolor ? 'background-color: '.$tag->bgcolor . ';' : '').($tag->ftcolor ? 'color: '.$tag->ftcolor . ';' : ''). '">' . $tag->tag . '"></label>&nbsp;';
			$IssueTags[] = $tag->tag;
			}  //endforeach
		} //endif
	?>
	</div>
	<?php Todo::add_todo($issue->id, 2, 0); ?>

	<ul id="ul_IssueDiscussion" class="issue-discussion">
		<li>
			<div class="insides">
				<div class="topbar">
					<strong><?php echo $issue->user->firstname . ' ' . $issue->user->lastname; ?> </strong>
					<?php echo __('tinyissue.opened_this_issue'); ?>  <?php echo date(Config::get('application.my_bugs_app.date_format'), strtotime($issue->created_at)); ?>
				</div>

				<div class="issue">
					<?php echo Project\Issue\Comment::format($issue->body); ?>
				</div>

				<ul class="attachments">
					<?php foreach($issue->attachments()->get() as $attachment): ?>
{'fraction_non_alphanumeric': 0.2563769665495647, 'fraction_numerical': 0.01848174736520544, 'mean_word_length': 4.532319391634981, 'pattern_counts': {'":': 0, '<': 199, '<?xml version=': 0, '>': 321, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7382222', 'n_tokens_mistral': 5229, 'n_tokens_neox': 4586, 'n_words': 948}