-
Notifications
You must be signed in to change notification settings - Fork 19
/
reports.php
133 lines (128 loc) · 5.4 KB
/
reports.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
use \OCP\Util;
Util::addScript('timemanager', 'timemanager');
style('timemanager', 'timemanager');
$urlGenerator = \OC::$server->getURLGenerator();
$l = Util::getL10N('timemanager');
?>
<?php print_unescaped($this->inc("partials/navigation")); ?>
<div id="app-content">
<div class="container">
<main class="reports">
<section class="section reports-section">
<h2><?php p($l->t("Reports")); ?></h2>
<h3 class="tm_label filters-form-title"><?php p($l->t("Filter by")); ?></h3>
<span data-svelte="Filters.svelte"></span>
<span data-svelte="Timerange.svelte"></span>
<span data-store="<?php p($_["store"]); ?>"></span>
<a href=""
class="timemanager-pjax-link hidden-visually hidden-filter-link"><?php p($l->t("Apply filters")); ?></a>
</section>
<?php if ($_["times_grouped_by_client"] &&
is_array($_["times_grouped_by_client"]) &&
count($_["times_grouped_by_client"]) > 0
) { ?>
<section class="section statistics" data-svelte="Statistics.svelte"></section>
<?php } ?>
<section class="section">
<?php if (
$_["times_grouped_by_client"] &&
is_array($_["times_grouped_by_client"]) &&
count($_["times_grouped_by_client"]) > 0
) {
foreach ($_["times_grouped_by_client"] as $times_for_client) { ?>
<div class="tm_item-row with-link">
<a class="timemanager-pjax-link" href="<?php echo $urlGenerator->linkToRoute(
"timemanager.page.projects"
); ?>?client=<?php echo $times_for_client->client->getUuid(); ?>">
<div>
<span class="tm_label"><?php p($l->t("Client")); ?></span>
<h3><?php p($times_for_client->client->getName()); ?></h3>
</div>
<div>
<span class="tm_label"><?php p($l->t("Duration")); ?></span>
<?php p($times_for_client->totalHours); ?> <?php p($l->t("hrs.")); ?>
· <?php p($times_for_client->percentageHours); ?> %
</div>
</a>
<details>
<?php if(count($times_for_client->entries) > 0) {
foreach($times_for_client->entries as $entry) { $time = $entry->time; ?>
<div class="tm_item-row" data-remove-on-delete="<?php p($time->getUuid()); ?>">
<h3>
<?php
$paymentStatus = 'unpaid';
$paymentAction = 'paid';
if ($time->getPaymentStatus() !== null && strtolower($time->getPaymentStatus()) === 'paid') {
$paymentStatus = 'paid';
$paymentAction = 'unpaid';
}
?>
<span data-svelte="Checkmark.svelte" data-uuid="<?php p($time->getUuid()); ?>"
data-action="<?php p($urlGenerator->linkToRoute('timemanager.page.times')); ?>"
data-initialState="<?php p($paymentStatus); ?>">
</span>
<?php p($time->getDurationInHours()); ?> <?php p($l->t('hrs.')); ?>
<form
action="<?php p($urlGenerator->linkToRoute('timemanager.page.times')); ?>/<?php p($paymentAction); ?>"
method="post" style="display: inline" data-svelte-hide="Checkmark.svelte">
<input type="hidden" name="uuid" value="<?php p($time->getUuid()); ?>" />
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']); ?>" />
<button type="submit"
class="icon-checkmark tm_icon-checkmark tm_icon-checkmark-<?php p($paymentStatus); ?>"></button>
</form>
</h3>
<div class="tm_item-excerpt">
<div class="tm_item-note">
<?php p($time->getNote()); ?>
</div>
<div class="tm_item-date">
<?php p($entry->project->getName()); ?> · <?php p($entry->task->getName()); ?> · <span data-datetime="<?php p($time->getStartFormatted("c")); ?>"><?php p($time->getStartLocalized()); ?></span>
<?php if (isset($time->author_display_name) && !$time->current_user_is_author) { ?>
·
<span class="author">
<ul class="existing-sharees compact">
<li>
<img
src="<?php echo $urlGenerator->getAbsoluteURL('avatar/' . $time->getUserId() . '/16'); ?>"
srcset="<?php echo $urlGenerator->getAbsoluteURL('avatar/' . $time->getUserId() . '/16'); ?> 1x,
<?php echo $urlGenerator->getAbsoluteURL('avatar/' . $time->getUserId() . '/32'); ?> 2x,
<?php echo $urlGenerator->getAbsoluteURL('avatar/' . $time->getUserId() . '/64'); ?> 4x"
alt=""
/>
<?php p($time->author_display_name); ?>
</li>
</ul>
</span>
<?php } ?>
</div>
</div>
</div>
<?php } } ?>
</details>
</div>
<?php } ?>
<div class="tm_summary">
<p>
<span class="tm_label"><?php p($l->t("Report total")); ?></span>
<?php p($_["hoursTotal"]); ?> <?php p($l->t("hrs.")); ?>
</p>
<p>
<span class="tm_label"><?php p($l->t("Number of entries")); ?></span>
<?php p($_["numEntries"]); ?> <?php p($_["numEntries"] === 1 ? $l->t("entry") : $l->t("entries")); ?>
</p>
</div>
<span data-svelte="PrintButton.svelte"></span>
<a href="<?php p($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] . '&' : '?'); ?>format=csv" download class="button secondary export-button">
<?php p($l->t("Export report to CSV")); ?>
</a>
<?php
} else {
?>
<p><?php p($l->t("Nothing found. If you have any filters set, try adjusting them.")); ?></p>
<?php
} ?>
</section>
</main>
</div>
</div>