xref: /plugin/bez/tpl/activity_report.php (revision eb2e6be9c74b2df263bd0a7ed247ee70c3d7cbd1)
1<h1 class="bez_report">
2<?php echo $tpl->getLang('activity_report') ?>
3</h1>
4
5<div class="bez_filter_form">
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['original_poster_sum'] ?></td>
38			<td><?php echo $involvement['coordinator_sum'] ?></td>
39			<td><?php echo $involvement['commentator_sum'] ?></td>
40			<td><?php echo $involvement['task_assignee_sum'] ?></td>
41            <?php $total = $involvement['original_poster_sum'] + $involvement['coordinator_sum'] + $involvement['commentator_sum'] + $involvement['task_assignee_sum'] ?>
42            <td><?php echo $total ?></td>
43		</tr>
44		<?php $reporter += $involvement['original_poster_sum'] ?>
45		<?php $coordinator += $involvement['coordinator_sum'] ?>
46        <?php $commentator += $involvement['commentator_sum'] ?>
47		<?php $executor += $involvement['task_assignee_sum'] ?>
48		<?php $total_total += $total ?>
49	<?php endforeach ?>
50	<tr>
51		<th><?php echo $tpl->getLang('report_total') ?></th>
52		<td><?php echo $reporter ?></td>
53		<td><?php echo $coordinator ?></td>
54        <td><?php echo $commentator ?></td>
55		<td><?php echo $executor ?></td>
56        <td><?php echo $total_total ?></td>
57	</tr>
58</table>
59<?php
60    if ($reporter !== 0) {
61        $kpi = $total_total/$reporter;
62    } else {
63        $kpi = 0;
64    }
65?>
66<p style="font-weight: bold">KPI = <?php echo sprintf("%.2f", $kpi) ?></p>
67
68
69<h2><?php echo $tpl->getLang('activity_in_tasks') ?></h2>
70<table class="bez_sumarise">
71	<tr>
72		<th><?php echo $tpl->getLang('user') ?></th>
73		<th><?php echo $tpl->getLang('reporter') ?></th>
74		<th><?php echo $tpl->getLang('commentator') ?></th>
75		<th><?php echo $tpl->getLang('executor') ?></th>
76		<th><?php echo $tpl->getLang('report_total') ?></th>
77	</tr>
78	<?php $reporter = 0 ?>
79	<?php $commentator = 0 ?>
80	<?php $executor = 0 ?>
81    <?php $total_total = 0 ?>
82	<?php foreach ($tpl->get('task_involvement') as $involvement): ?>
83		<tr>
84			<td>
85                <?php echo $tpl->user_name($involvement['user_id']) ?>
86			</td>
87			<td><?php echo $involvement['original_poster_sum'] ?></td>
88			<td><?php echo $involvement['commentator_sum'] ?></td>
89			<td><?php echo $involvement['assignee_sum'] ?></td>
90            <?php $total = $involvement['original_poster_sum'] + $involvement['commentator_sum'] + $involvement['assignee_sum'] ?>
91			<td><?php echo $total ?></td>
92			<?php $reporter += $involvement['original_poster_sum'] ?>
93			<?php $commentator += $involvement['commentator_sum'] ?>
94			<?php $executor += $involvement['assignee_sum'] ?>
95            <?php $total_total += $total ?>
96		</tr>
97	<?php endforeach ?>
98	<tr>
99		<th><?php echo $tpl->getLang('report_total') ?></th>
100		<td><?php echo $reporter ?></td>
101		<td><?php echo $commentator ?></td>
102		<td><?php echo $executor ?></td>
103		<td><?php echo $total_total ?></td>
104	</tr>
105</table>
106