git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
issue: ordered overview including closed tickets
[minimedit.git]
/
issue
/
index.php
diff --git
a/issue/index.php
b/issue/index.php
index 0c18142f06e71c709e997e76514212ebeb1c3c8e..35a1116b153b72cd26de0973b8e64842ecc5dad3 100644
(file)
--- a/
issue/index.php
+++ b/
issue/index.php
@@
-14,7
+14,6
@@
if ($id and ctype_digit($id)) {
$replies = $Page->widget('reply'); # handle updates
$Page->title .= ': '.htmlspecialchars($Issue->subject);
$replies = $Page->widget('reply'); # handle updates
$Page->title .= ': '.htmlspecialchars($Issue->subject);
- $Page->teaser = $Issue->body;
$Page->body = $replies; # find image
if ($Page->api) return;
$Page->body = $replies; # find image
if ($Page->api) return;
@@
-36,7
+35,6
@@
if ($id and ctype_digit($id)) {
print "</dl></aside>\n\n";
print '<div>';
print "</dl></aside>\n\n";
print '<div>';
- print $Issue->body;
print $replies;
print "</div>\n";
return;
print $replies;
print "</div>\n";
return;
@@
-51,23
+49,33
@@
if ($_POST and isset($_POST['subject'])) {
$query = $Db->set('issues', [
'page' => $Page->handler,
'subject' => $_POST['subject'],
$query = $Db->set('issues', [
'page' => $Page->handler,
'subject' => $_POST['subject'],
- '
body' => messagehtml($_POST['body']
),
+ '
link' => preg_replace('/\b(?:de|het|een)\s+|\W+/', '-', strtolower($_POST['subject'])
),
'author' => $User->login,
]);
if (!$query->rowCount()) {
throw new Exception('Issue niet opgeslagen.');
}
'author' => $User->login,
]);
if (!$query->rowCount()) {
throw new Exception('Issue niet opgeslagen.');
}
+ $row = $query->fetch();
+ if (!$row->id) {
+ throw new Exception('Issue niet goed opgeslagen.');
+ }
+ try {
+ createcomment($_POST, $row);
+ }
+ catch (Exception $e) {
+ throw new Exception("Issueinhoud niet opgeslagen: {$e->getMessage()}.");
+ }
$_POST = [];
}
$subsql = "SELECT count(*) FROM comments WHERE page=i.page||'/'||i.id";
$_POST = [];
}
$subsql = "SELECT count(*) FROM comments WHERE page=i.page||'/'||i.id";
-$cols = "*, ($subsql AND message IS NOT NULL) AS replycount";
+$cols = "*, ($subsql AND message IS NOT NULL)
- 1
AS replycount";
$cols .= ", ($subsql AND message ~ '<img') AS imagecount";
$sql = "SELECT $cols FROM issues i WHERE page = ?";
if (isset($_GET['open'])) {
$sql .= ' AND closed IS NULL';
}
$cols .= ", ($subsql AND message ~ '<img') AS imagecount";
$sql = "SELECT $cols FROM issues i WHERE page = ?";
if (isset($_GET['open'])) {
$sql .= ' AND closed IS NULL';
}
-$sql .= ' ORDER BY
closed IS NOT NULL,
updated DESC';
+$sql .= ' ORDER BY updated DESC';
$query = $Db->query($sql, [$Page->handler]);
if ($id == 'feed') {
$query = $Db->query($sql, [$Page->handler]);
if ($id == 'feed') {