issue: display ticket creation date
[minimedit.git] / issue / index.php
index 3d62ced075f98f34c04285e6d2c1bb83b828e8ad..6b1c3dc53b7fe5aad589b91afb27820be36864b8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 global $User, $Db;
 require_once 'database.inc.php';
 <?php
 global $User, $Db;
 require_once 'database.inc.php';
-$id = trim($Args, '/');
+@list ($id, $title) = explode('/', ltrim($Args, '/'));
 
 if ($id) {
        $Article->title = "Issue #$id";
 
 if ($id) {
        $Article->title = "Issue #$id";
@@ -14,11 +14,18 @@ if ($id) {
        $Article->title .= ': '.htmlspecialchars($row->subject);
        print "<h2>{$Article->title}</h2>\n";
        print $row->body;
        $Article->title .= ': '.htmlspecialchars($row->subject);
        print "<h2>{$Article->title}</h2>\n";
        print $row->body;
+       printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
+               'Geplaatst',
+               $row->author ? " door <strong>{$row->author}</strong>" : '',
+               showdate(preg_split('/\D/', $row->created))
+       );
        if ($row->closed) {
        if ($row->closed) {
-               printf('<p><strong>%s</strong> <small class=date>%s</small></p>'."\n",
-                       'Opgelost', showdate(preg_split('/\D/', $row->closed))
+               printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
+                       'Opgelost', '',
+                       showdate(preg_split('/\D/', $row->closed))
                );
        }
                );
        }
+       $Args = "/$id";  # minimal reference
        print placeholder_include('reply');
        return;
 }
        print placeholder_include('reply');
        return;
 }
@@ -38,16 +45,16 @@ if ($_POST) {
                $_POST = [];
 }
 
                $_POST = [];
 }
 
-$query = $Db->query('SELECT * FROM issues ORDER BY created DESC');
+$query = $Db->query('SELECT * FROM issues ORDER BY updated DESC');
 
 ob_start();
 print '<ul>';
 while ($row = $query->fetch()) {
        printf('<li><a href="%s">%s <small class="date">%s</small></a>',
 
 ob_start();
 print '<ul>';
 while ($row = $query->fetch()) {
        printf('<li><a href="%s">%s <small class="date">%s</small></a>',
-               "/$Page/{$row->id}",
+               "/$Page/{$row->id}/{$row->link}",
                sprintf($row->closed ? '<strike>%s</strike>' : '%s',
                        htmlspecialchars($row->subject)),
                sprintf($row->closed ? '<strike>%s</strike>' : '%s',
                        htmlspecialchars($row->subject)),
-               showdate(array_slice(preg_split('/\D/', $row->created), 0, 3))
+               showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3))
        );
        print "</li>\n";
 }
        );
        print "</li>\n";
 }