xref: /plugin/bez/tpl/activity_report.php (revision b331b8925cd7271407de49196821e2fbf4786dba)
1<h1 class="bez_report">
2<?php echo $tpl->getLang('activity_report') ?>
3</h1>
4
5<div class="bez_filter_form" style="display:none">
6    <form action="<?php echo $tpl->url('activity_report') ?>" method="post">
7        <span class="datepair">
8            <label>od: <input name="from" value="<?php echo $tpl->value('from') ?>" class="date start" style="width: 90px"></label>
9            <label>do: <input name="to" value="<?php echo $tpl->value('to') ?>" class="date end" style="width: 90px"></label>
10        </span>
11        <button>Pokaż</button>
12    </form>
13
14</div>
15
16<h2><?php echo $tpl->getLang('activity_in_issues') ?></h2>
17
18<table class="bez_sumarise">
19	<tr>
20		<th><?php echo $tpl->getLang('user') ?></th>
21		<th><?php echo $tpl->getLang('reporter') ?></th>
22		<th><?php echo $tpl->getLang('coordinator') ?></th>
23		<th><?php echo $tpl->getLang('commentator') ?></th>
24		<th><?php echo $tpl->getLang('executor') ?></th>
25		<th><?php echo $tpl->getLang('report_total') ?></th>
26	</tr>
27	<?php $reporter = 0 ?>
28	<?php $total_total = 0 ?>
29	<?php $commentator = 0 ?>
30	<?php $coordinator = 0 ?>
31	<?php $executor = 0 ?>
32	<?php foreach ($tpl->get('thread_involvement') as $involvement): ?>
33		<tr>
34			<td>
35                <?php echo $tpl->user_name($involvement['user_id']) ?>
36			</td>
37			<td><?php echo $involvement['SUM(original_poster)'] ?></td>
38			<td><?php echo $involvement['SUM(coordinator)'] ?></td>
39			<td><?php echo $involvement['SUM(commentator)'] ?></td>
40			<td><?php echo $involvement['SUM(task_assignee)'] ?></td>
41			<td><?php echo $involvement['COUNT(*)'] ?></td>
42		</tr>
43		<?php $reporter += $involvement['SUM(original_poster)'] ?>
44		<?php $coordinator += $involvement['SUM(coordinator)'] ?>
45        <?php $commentator += $involvement['SUM(commentator)'] ?>
46		<?php $executor += $involvement['SUM(task_assignee)'] ?>
47		<?php $total_total += $involvement['COUNT(*)'] ?>
48	<?php endforeach ?>
49	<tr>
50		<th><?php echo $tpl->getLang('report_total') ?></th>
51		<td><?php echo $reporter ?></td>
52		<td><?php echo $coordinator ?></td>
53        <td><?php echo $commentator ?></td>
54		<td><?php echo $executor ?></td>
55        <td><?php echo $total_total ?></td>
56	</tr>
57</table>
58<?php
59    if ($reporter !== 0) {
60        $kpi = $total_total/$reporter;
61    } else {
62        $kpi = 0;
63    }
64?>
65<p style="font-weight: bold">KPI = <?php echo sprintf("%.2f", $kpi) ?></p>
66
67
68<h2><?php echo $tpl->getLang('activity_in_tasks') ?></h2>
69<table class="bez_sumarise">
70	<tr>
71		<th><?php echo $tpl->getLang('user') ?></th>
72		<th><?php echo $tpl->getLang('reporter') ?></th>
73		<th><?php echo $tpl->getLang('commentator') ?></th>
74		<th><?php echo $tpl->getLang('executor') ?></th>
75		<th><?php echo $tpl->getLang('report_total') ?></th>
76	</tr>
77	<?php $reporter = 0 ?>
78	<?php $commentator = 0 ?>
79	<?php $executor = 0 ?>
80    <?php $total_total = 0 ?>
81	<?php foreach ($tpl->get('task_involvement') as $involvement): ?>
82		<tr>
83			<td>
84                <?php echo $tpl->user_name($involvement['user_id']) ?>
85			</td>
86			<td><?php echo $involvement['SUM(original_poster)'] ?></td>
87			<td><?php echo $involvement['SUM(commentator)'] ?></td>
88			<td><?php echo $involvement['SUM(assignee)'] ?></td>
89			<td><?php echo $involvement['COUNT(*)'] ?></td>
90			<?php $reporter += $involvement['SUM(original_poster)'] ?>
91			<?php $commentator += $involvement['SUM(commentator)'] ?>
92			<?php $executor += $involvement['SUM(assignee)'] ?>
93            <?php $total_total += $involvement['COUNT(*)'] ?>
94		</tr>
95	<?php endforeach ?>
96	<tr>
97		<th><?php echo $tpl->getLang('report_total') ?></th>
98		<td><?php echo $reporter ?></td>
99		<td><?php echo $commentator ?></td>
100		<td><?php echo $executor ?></td>
101		<td><?php echo $total_total ?></td>
102	</tr>
103</table>
104