-
Notifications
You must be signed in to change notification settings - Fork 2
/
comment.php
55 lines (39 loc) · 1.22 KB
/
comment.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
<?php
require 'inc.bootstrap.php';
do_logincheck();
$key = $_GET['key'];
$id = $_GET['id'];
$summary = $_GET['summary'];
if ( isset($_POST['comment']) ) {
$update = array('body' => $_POST['comment']);
$response = jira_put('issue/' . $key . '/comment/' . $id, $update, $error, $info);
if ( !$error ) {
return do_redirect('issue#comment-' . $id, array('key' => $key));
}
echo '<pre>';
print_r($update);
var_dump($error);
print_r($response);
print_r($info);
exit;
}
$_title = "Comment $key";
include 'tpl.header.php';
$comment = jira_get('issue/' . $key . '/comment/' . $id, null, $error, $info);
echo '<h1><a href="issue.php?key=' . $key . '">' . $key . '</a> ' . html($summary) . '</h1>';
echo '<h2>Comment # ' . $id . '</h2>';
?>
<form autocomplete="off" method="post">
<p><textarea name="comment" rows="8"><?= html($comment->body) ?></textarea><br><button type="button" data-preview="textarea[name=comment]">Preview</button></p>
<p>
<button>Save</button>
or
<a data-confirm="DELETE this COMMENT for ever and ever?" href="issue.php?key=<?= $key ?>&delete_comment=<?= $id ?>">delete</a>
</p>
</form>
<?php
// echo '<pre>';
// print_r($comment);
// var_dump($error);
// print_r($info);
include 'tpl.footer.php';