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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
<?php
/*
* SCROTT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to UNLICENSE
*/
namespace issue_v;
require_once "model/issue.php";
require_once "class/issue.class.php";
?>
<?php function userPanel(?\user $u, string $style, string $role, string $ts) : void { ?>
<div class="<?=$style?>">
<?php if (!$u) { ?>
<p class="text-center">
<span class="glyphicon glyphicon-ban-circle"></span>
<?=$role?>
</p>
<?php } else { ?>
<table>
<tbody>
<tr>
<td><?=\datalsts\objHeadCircle($u, 30)?> </td>
<td>
<?=$u->getDisplayName()?>
<small>
<?=$role?>
<br />
<?=$ts?>
</small>
</td>
</tr>
</tbody>
</table>
<?php } ?>
</div>
<?php } ?>
<?php function issue(\issue $i) : void { ?>
<?php $m = $i->getOPMesg(); ?>
<?php $s = $i->getParent(); ?>
<div id="issueModal-<?=$i->guid?>" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">
<span class="glyphicon glyphicon-inbox"></span> <?=$i->name?>
<small>
<?php if ($s->objtype == "stage") { ?>
<span class="glyphicon glyphicon-tasks"></span> <?=$s->name?>
<?php } ?>
#<?=$i->numb?> <?=$i->guid?>
</small>
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-8">
<p><?=$m->renderMesg()?></p>
<hr />
<?php foreach ($i->getMesgs_ordByDatetime() as $rm) { ?>
<div class="panel panel-default">
<div class="panel-body">
<?php if ($rm->objtype == "mesg") { ?>
<div class="row">
<div class="col-xs-1">
<?=\datalsts\objHeadCircle($rm->getAuthor(), 40)?>
</div>
<div class="col-xs-11">
<strong><?=$rm->getAuthor()->getDisplayName()?></strong>
<small><?=$rm->created?></small>
<br />
<?=$rm->renderMesg()?>
<?php if ($rm->getAttachment()) { ?>
<br />
<br />
<a href="<?=$rm->getAttachment()?>" class="btn btn-info">
<span class="glyphicon glyphicon-save"></span>
<?=$rm->attachment?>
</a>
<?php } ?>
</div>
</div>
<?php } else { ?>
<?=\datalsts\objHeadCircle($rm->getAuthor(), 25)?>
<?=$rm->renderMesg()?>
<small><?=$rm->created?></small>
<?php } ?>
</div>
</div>
<?php } ?>
<?php if ($i->isOpen()) { ?>
<form method="post" action="<?=ap()?>" enctype="multipart/form-data">
<?=\formctrl\formname( "iss-mesg-add" )?>
<?=\formctrl\hidden( "issue", $i->guid )?>
<?=\formctrl\textarea( "New message", "mesg", 5 )?>
<div class="btn-group pull-right">
<button type="submit" name="input[postMesg]" class="btn btn-primary" title="Post message">
<span class="glyphicon glyphicon-envelope"></span>
</button>
<button type="submit" name="input[closeIssue]" class="btn btn-default" title="Close issue">
<span class="glyphicon glyphicon-ok"></span>
</button>
<button type="submit" name="input[advIssue]" class="btn btn-default" title="Advance issue">
<span class="glyphicon glyphicon-chevron-up"></span>
</button>
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#assignCollapse-<?=$i->guid?>" title="Assign issue">
<span class="glyphicon glyphicon-share-alt"></span>
</button>
</div>
<div class="collapse" id="assignCollapse-<?=$i->guid?>">
<div class="form-group">
<label>Select assignee</label>
<select name="input[assignee]" class="form-control selectpicker">
<?php foreach ($i->getParent()->getParent()->getOwner()->getContainedUsers() as $memb) { ?>
<option data-icon="glyphicon-user" value="<?=$memb->guid?>">
<?=$memb->getDisplayName()?>
</option>
<?php } ?>
<?php foreach ($i->getParent()->getParent()->getMembers() as $memb) { ?>
<option data-icon="glyphicon-user" value="<?=$memb->guid?>">
<?=$memb->getDisplayName()?>
</option>
<?php } ?>
</select>
</div>
<button type="submit" name="input[assIssue]" class="btn btn-default">
<span class="glyphicon glyphicon-share-alt"></span> Post and assign issue
</button>
</div>
<?=\formctrl\file( "Attachment", "attachment" )?>
</form>
<?php } ?>
</div>
<div class="col-md-4">
<?php $closer = $i->getCloser(); ?>
<?php $assigns = $i->getAssignees(); ?>
<?php $owner = $i->getOwner(); ?>
<?php $author = $m->getAuthor(); ?>
<?php $members = $i->getMembers(); ?>
<?php if ($closer) { ?>
<?=userPanel($closer, "alert alert-success", "closed", $i->closed)?>
<?php } ?>
<?php if (count($assigns) == 0) { ?>
<?=userPanel(NULL, "alert alert-danger", "unassigned", "")?>
<?php } ?>
<?php foreach ($assigns as $assign) { ?>
<?php if ($assign->signedoff != "") { ?>
<?=userPanel($assign->assignee, "alert alert-success", "signed off", $assign->signedoff)?>
<?php } else { ?>
<?=userPanel($assign->assignee, "alert alert-warning", "assigned", $assign->assigned)?>
<?php } ?>
<?php } ?>
<?=userPanel($owner, "alert alert-info", "opened", $i->created)?>
<?php if ($author->guid != $owner->guid) { ?>
<?=userPanel($author, "alert alert-info", "authored", $m->created)?>
<?php } ?>
<?php if (count($members) != 0) { ?>
<hr />
<?php } ?>
<?php foreach ($members as $m) { ?>
<?=userPanel($m, "well", "cc'd", "")?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
|