xref: /plugin/bez/tpl/start.php (revision c45b82bd7652392a33a65dbf693208bcdf28ad29)
1<div id="bez_version">
2	<div>
3		<?php echo $bezlang['bez'] ?>, <?php echo $bezlang['version'] ?>: <?php echo $template['version'] ?>
4	</div>
5</div>
6<div id="bez_info">
7	<?php if ($this->model->acl->get_level() >= BEZ_AUTH_USER): ?>
8		<a href="?id=<?php echo $this->id('issue_report') ?>" class="bez_start_button" id="bez_report_issue_button">
9			<?php echo $bezlang['report_issue'] ?>
10		</a>
11	<?php endif ?>
12	<a href="?id=<?php echo $this->id('issues:state:0:coordinator:'.$this->model->user_nick) ?>" class="bez_start_button" id="bez_info_issues">
13		<?php echo $bezlang['close_issues'] ?>:
14		<strong><?php echo $template['my_issues'] ?></strong>
15	</a>
16	<a href="?id=<?php echo $this->id('tasks:taskstate:0:executor:'.$this->model->user_nick) ?>" class="bez_start_button" id="bez_info_tasks">
17		<?php echo $bezlang['close_tasks'] ?>:
18		<strong><?php echo $template['my_tasks'] ?></strong>
19	</a>
20	<?php if ($this->model->acl->get_level() >= BEZ_AUTH_LEADER): ?>
21		<a href="?id=<?php echo $this->id('issues:state:-proposal') ?>" class="bez_start_button" id="bez_info_proposals">
22			<?php echo $bezlang['proposals'] ?>:
23			<strong><?php echo $template['proposals'] ?></strong>
24		</a>
25	<?php endif ?>
26</div>
27
28<dl id="bds_timeline">
29<?php $prev_date = '0000-00-00' ?>
30<?php foreach ($template['timeline'] as $elm): ?>
31    <?php if ($elm->date !== $prev_date): ?>
32        <h2>
33            <?php echo $elm->date ?>
34            <?php if ($elm->date === date('Y-m-d')): ?>
35                <?php echo ': '.$bezlang['today'] ?>
36            <?php elseif ($elm->date === date('Y-m-d', strtotime('yesterday'))): ?>
37                <?php echo ': '.$bezlang['yesterday'] ?>
38            <?php endif ?>
39        </h2>
40        <?php $prev_date = $elm->date ?>
41    <?php endif ?>
42    <?php
43        if ($elm->author === '-proposal') {
44           $author_full_name = '<i>' . $bezlang['none'] . '</i>';
45        } else {
46            $author_full_name = $this->model->users->get_user_full_name($elm->author);
47        }
48
49        if ($elm->class === 'issue_created') {
50            $href = $this->id('issue', 'id', $elm->issue);
51            $title = '<strong>#' . $elm->issue .  '</strong> ' .
52                    $bezlang['issue_added'] . ' ' .
53                    '"' . $elm->title . '"' .
54                    ' <span class="author">' . $bezlang['coordinator'] . ':' .
55                    ' <strong>' . $author_full_name . '</strong></span>';
56            $coord_string = $bezlang['coordinator'];
57        } else if($elm->class === 'task_opened') {
58            $href = $this->id('task', 'tid', $elm->id);
59
60            $issue = '';
61            if ($elm->issue !== '') {
62                $issue = '#' . $elm->issue. ' ';
63            }
64            $title = '<strong>'.$issue.'#z' . $elm->id .  '</strong> ' .
65                    $bezlang['task_added'] .
66                    ' <span class="author">' . $bezlang['executor'] . ':' .
67                    ' <strong>' . $author_full_name . '</strong></span>';
68            $coord_string = $bezlang['executor'];
69        } else if($elm->class === 'cause') {
70            $href = $this->id('issue', 'id', $elm->issue) . '#k'  . $elm->id;
71            $title = $bezlang['timeline_cause_added'] . ' ' .
72                    ' <span class="author">' . $bezlang['by'] .
73                    ' <strong>' . $author_full_name . '</strong></span>';
74            $coord_string = $bezlang['reporter'];
75        } else {
76            $href = $this->id('issue', 'id', $elm->issue) . '#k'  . $elm->id;
77            $title = $bezlang['timeline_comment_added'] . ' ' .
78                    ' <span class="author">' . $bezlang['by'] .
79                    ' <strong>' . $author_full_name . '</strong></span>';
80            $coord_string = $bezlang['reporter'];
81        }
82    ?>
83    <dt class="<?php echo $elm->class ?>">
84        <a href="?id=<?php echo $href ?>">
85           <span class="time"><?php echo $elm->time ?></span>
86           <?php echo $title ?>
87        </a>
88    </dt>
89    <dd>
90        <?php echo $elm->desc ?>
91    </dd>
92<?php endforeach ?>
93</dl>
94