issue: assignment text field for admins
[minimedit.git] / widget / reply.php
index 4c7a3045d80ae11c7bf7bd6375214330e09b7ef1..1071976e42ddf87632359237aab3c67d3b4fc586 100644 (file)
@@ -19,6 +19,10 @@ if ($_POST) {
 
                if (isset($Issue)) {
                        $row = ['updated' => ['now()']];
+                       foreach (['assign'] as $col) {
+                               if (!isset($_POST[$col])) continue;
+                               $row[$col] = $_POST[$col] ?: NULL;
+                       }
                        $Db->set('issues', $row, ['id = ?', $Issue->id]);
                }
                $_POST['reply'] = NULL;
@@ -45,6 +49,17 @@ while ($row = $query->fetch()) {
 if ($User) {
        print '<li>';
        print '<form method="post" action="">';
+       if (isset($Issue) and $User->admin("edit $Page")) {
+               print '<p>';
+               printf(
+                       '<label for="%s">%s:</label> '
+                       . '<input id="%1$s" name="%1$s" value="%s" />'."\n",
+                       'assign',
+                       'Toegewezen aan',
+                       htmlspecialchars($Issue->assign ?? '')
+               );
+               print "</p>\n";
+       }
        printf('<textarea id="%s" name="%1$s" cols=60 rows=3 placeholder="%s">%s</textarea>'."\n",
                'reply',
                "Bericht van {$User->login}",