From c98b03061b86e1b372d8f65e167db424fbc55697 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 2 Jul 2005 14:16:09 +0000 Subject: [PATCH] r273: Field changing system is now done for auto actions. --- editreport.php | 39 +++++++++++++++++++++++++++++++++++++++ templates/editreport.tpl | 4 ++++ 2 files changed, 43 insertions(+) diff --git a/editreport.php b/editreport.php index 7f65316..2da1a2c 100644 --- a/editreport.php +++ b/editreport.php @@ -72,6 +72,26 @@ if ($_POST['do'] == 'update') $hist[0] = (array)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[bugid]"); $hist2[0] = (array)$temp = $noinitialcustom = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill WHERE bugid = $bug[bugid]"); + // ------------------------------------------------------------------- + // start updates + + // auto action + $autoaction = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "autoaction WHERE actionid = " . intval($bugsys->in['autoaction'])); + if ($autoaction) + { + $autoaction['fields'] = unserialize($autoaction['fieldchanges']); + + foreach ($autoaction['fields']['builtin'] AS $field => $value) + { + $bugsys->in["$field"] = $value; + } + + foreach ($autoaction['fields']['custom'] AS $field => $value) + { + $bugsys->in["field$field"] = $value; + } + } + process_custom_fields($bug['bugid']); $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); @@ -259,6 +279,25 @@ if ($_REQUEST['do'] == 'edit') $dependencies = implode(' ', $depends); } + $actions = $db->query("SELECT * FROM " . TABLE_PREFIX . "autoaction ORDER BY name ASC"); + $select['autoactions'] = ''; + $show['autoactions'] = false; + while ($action = $db->fetch_array($actions)) + { + $label = $action['name']; + $value = $action['actionid']; + $selected = false; + eval('$select[autoaction] .= "' . $bugsys->template->fetch('selectoption') . '";'); + $show['autoactions'] = true; + } + if ($show['autoactions']) + { + $label = ''; + $value = 0; + $selected = true; + eval('$select[autoaction] = "' . $bugsys->template->fetch('selectoption') . '" . $select[autoaction];'); + } + eval('$template->flush("' . $template->fetch('editreport') . '");'); } diff --git a/templates/editreport.tpl b/templates/editreport.tpl index 667ca57..e2b472e 100644 --- a/templates/editreport.tpl +++ b/templates/editreport.tpl @@ -25,6 +25,10 @@
$pcv_select
+
Automatic Response Action: +
+
+
First Comment:
$customfields -- 2.22.5