reply: identify textual journal columns
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 8 Nov 2019 01:22:31 +0000 (02:22 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 18 Nov 2019 17:13:39 +0000 (18:13 +0100)
widget/reply.php

index 9761cf2385546dec52f1ef19d610c175d56dbcd3..879b53d248317faa662e9ae66184260fa84188ce 100644 (file)
@@ -2,6 +2,10 @@
 global $User, $Db, $Issue;
 require_once 'database.inc.php';
 
+$journalcol = [
+       'assign' => 'Toegewezen aan',
+];
+
 if ($_POST) {
        try {
                $html = nl2br(htmlspecialchars($_POST['reply']));
@@ -18,7 +22,7 @@ if ($_POST) {
 
                if (isset($Issue)) {
                        $row = [];
-                       foreach (['assign'] as $col) {
+                       foreach (array_keys($journalcol) as $col) {
                                if (!isset($_POST[$col])) continue;
                                $row[$col] = $_POST[$col] ?: NULL;
                        }
@@ -75,7 +79,7 @@ if ($User) {
                        '<label for="%s">%s:</label> '
                        . '<input id="%1$s" name="%1$s" value="%s" />'."\n",
                        'assign',
-                       'Toegewezen aan',
+                       $journalcol['assign'],
                        htmlspecialchars($Issue->assign ?? '')
                );
                printf(