diff options
author | Matthew Somerville <matthew@dracos.co.uk> | 2010-02-15 23:29:45 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@dracos.co.uk> | 2010-02-15 23:29:45 +0000 |
commit | 875dbf3fbc4799bf84c6e5a0fc8b33ae87fdb240 (patch) | |
tree | b3267df0d25cc53c2cc934dea4090f07f1da47f2 /web-admin | |
parent | d3651be691d54bcade7ec2a5b8d626baa18b9eb5 (diff) |
If marking an update as hidden, unfix problem report if it did so.
Diffstat (limited to 'web-admin')
-rwxr-xr-x | web-admin/index.cgi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/web-admin/index.cgi b/web-admin/index.cgi index fe49341c3..002452e29 100755 --- a/web-admin/index.cgi +++ b/web-admin/index.cgi @@ -684,6 +684,14 @@ sub admin_edit_update { } $query .= ' where id=?'; dbh()->do($query, {}, $q->param('state'), $q->param('name'), $q->param('email'), $q->param('text'), $id); + $status_message = '<p><em>Updated!</em></p>'; + + # If we're hiding an update, see if it marked as fixed and unfix if so + if ($q->param('state') eq 'hidden' && $row{mark_fixed}) { + dbh()->do("update problem set state='confirmed' where state='fixed' and id=?", {}, $row{problem_id}); + $status_message .= '<p><em>Problem marked as open.</em></p>'; + } + if ($q->param('state') ne $row{state}) { admin_log_edit($q, $id, 'update', 'state_change'); } @@ -692,7 +700,6 @@ sub admin_edit_update { } dbh()->commit(); map { $row{$_} = $q->param($_) } qw(state name email text); - $status_message = '<p><em>Updated!</em></p>'; } my %row_h = map { $_ => $row{$_} ? ent($row{$_}) : '' } keys %row; my $title = "Editing update $id"; |