xref: /plugin/bez/tpl/report.php (revision e51d1175f9b204a586eaa81684e7b8972c4f7bb5)
1<?php if (!$helper->token_viewer()): ?>
2	<div  class="bez_filter_form">
3	<form action="<?php echo $template['uri'] ?>?id=bez:report" method="POST">
4	<?php foreach ($template['hidden'] as $name => $val): ?>
5		<input type="hidden" name="<?php echo $name ?>" value="<?php echo $val ?>" />
6	<?php endforeach ?>
7	<fieldset>
8		<label><?php echo $bezlang['entity'] ?>:
9			<select name="entity">
10				<option <?php if ($value['entity'] == '-all') echo 'selected' ?>
11					value="-all">--- <?php echo $bezlang['all'] ?> ---</option>
12			<?php foreach ($template['entities'] as $entity): ?>
13				<option <?php if ($value['entity'] == $entity) echo 'selected' ?>
14					value="<?php echo $entity ?>"><?php echo $entity ?></option>
15			<?php endforeach ?>
16			</select>
17		</label>
18		<input type="submit" value="<?php echo $bezlang['filter'] ?>" />
19
20		<span>[<a href="
21			<?php echo $helper->mailto('',
22			$template['title'].($value['entity'] != '-all' ? ' ['.$value['entity'].']' : ''),
23			$template['uri']) ?>">
24<?php echo $bezlang['send_mail'] ?>
25		</a>]</span>
26	</fieldset>
27	</form>
28	</div>
29<?php endif ?>
30
31<h1 class="bez_report">
32<?php echo $template['title'] ?>
33<span><?php echo $bezlang['report_subhead'] ?></span>
34<?php if ($value['entity'] != '-all'): ?>
35<span><?php echo $bezlang['entity'] ?>: <strong><?php echo $value['entity'] ?></strong></span>
36<?php endif ?>
37</h1>
38
39<h2><?php echo $bezlang['report_issues'] ?></h2>
40<table class="bez_sumarise">
41	<tr>
42		<th><?php echo $bezlang['type'] ?></th>
43		<th><?php echo $bezlang['number'] ?></th>
44		<th><?php echo $bezlang['totalcost'] ?></th>
45	</tr>
46	<?php foreach ($template['report']['issues'] as $issue): ?>
47		<tr>
48			<td><?php echo $issue['type'] ?></td>
49			<td><?php echo $issue['number'] ?></td>
50			<td>
51				<?php if ($issue['totalcost'] == ''): ?>
52					<em><?php echo $bezlang['ns'] ?></em>
53				<?php else: ?>
54					<?php echo $issue['totalcost'] ?>
55				<?php endif ?>
56			</td>
57		</tr>
58	<?php endforeach ?>
59	<tr>
60		<th><?php echo $bezlang['report_total'] ?></th>
61		<td><?php echo $template['report']['issues_total'] ?></td>
62		<td><?php echo $template['report']['issues_totalcost'] ?></td>
63	</tr>
64</table>
65<h2><?php echo $bezlang['report_tasks'] ?></h2>
66<table class="bez_sumarise">
67	<tr>
68		<th><?php echo $bezlang['class'] ?></th>
69		<th><?php echo $bezlang['number'] ?></th>
70		<th><?php echo $bezlang['totalcost'] ?></th>
71	</tr>
72	<?php foreach ($template['report']['tasks'] as $task): ?>
73		<tr>
74			<td><?php echo $task['action'] ?></td>
75			<td><?php echo $task['number'] ?></td>
76			<td>
77				<?php if ($task['totalcost'] == ''): ?>
78					<em><?php echo $bezlang['ns'] ?></em>
79				<?php else: ?>
80					<?php echo $task['totalcost'] ?>
81				<?php endif ?>
82			</td>
83		</tr>
84	<?php endforeach ?>
85	<tr>
86		<th><?php echo $bezlang['report_total'] ?></th>
87		<td><?php echo $template['report']['tasks_total'] ?></td>
88		<td><?php echo $template['report']['tasks_totalcost'] ?></td>
89	</tr>
90</table>
91
92<h2><?php echo $bezlang['report_causes'] ?></h2>
93<table class="bez_sumarise">
94	<tr>
95		<th><?php echo $bezlang['root_cause'] ?></th>
96		<th><?php echo $bezlang['number'] ?></th>
97	</tr>
98	<?php foreach ($template['report']['causes'] as $cause): ?>
99		<tr>
100			<td><?php echo $cause['rootcause'] ?></td>
101			<td><?php echo $cause['number'] ?></td>
102		</tr>
103	<?php endforeach ?>
104	<tr>
105		<th><?php echo $bezlang['report_total'] ?></th>
106		<td><?php echo $template['report']['causes_total'] ?></td>
107	</tr>
108</table>
109
110<h2><?php echo $bezlang['report_priority'] ?></h2>
111<table class="bez bez_sumarise">
112	<tr>
113		<th><?php echo $bezlang['priority'] ?></th>
114		<th><?php echo $bezlang['number'] ?></th>
115		<th><?php echo $bezlang['average'] ?></th>
116	</tr>
117	<?php foreach ($template['report']['priorities'] as $priority): ?>
118		<tr class="pr<?php echo $priority['priority_nr'] ?>">
119			<td><?php echo $priority['priority'] ?></td>
120			<td><?php echo $priority['number'] ?></td>
121			<td><?php echo $priority['average'] ?></td>
122		</tr>
123	<?php endforeach ?>
124	<tr>
125		<th><?php echo $bezlang['report_total'] ?></th>
126		<td><?php echo $template['report']['priorities_total'] ?></td>
127		<td><?php echo $template['report']['priorities_average'] ?></td>
128	</tr>
129</table>
130