From 36a2dbe608f5160f6381e64f16f14ddb0cd3f30e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 21 Aug 2008 21:54:22 -0400 Subject: [PATCH] Update showhistory.php --- showhistory.php | 30 ++++++++++++++++++++---------- templates/history.tpl | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/showhistory.php b/showhistory.php index cc5129d..b1c479e 100644 --- a/showhistory.php +++ b/showhistory.php @@ -60,7 +60,7 @@ $customfields = $db->query(" LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE mask <> 0 - AND permission.usergroupid IN ({bugdar::$userinfo['usergroupid']}" . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") + AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid)" ); @@ -96,6 +96,7 @@ foreach ($logs AS $dateline => $logitems) { $show['group'] = true; + $history = ''; foreach ($logitems AS $log) { if ($log['field'] == '.' OR ($log['original'] == '' AND $log['changed'] == '')) @@ -140,28 +141,32 @@ foreach ($logs AS $dateline => $logitems) { if ($log['original']) { - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('userid', $log['original']); - $user->set_condition(); + $user->setCondition(); $user->fetch(); - $log['original'] = construct_user_display($user->objdata); + $log['original'] = construct_user_display($user->record); } if ($log['changed']) { - $user = new UserAPI($bugsys); + $user = new UserAPI(); $user->set('userid', $log['changed']); - $user->set_condition(); + $user->setCondition(); $user->fetch(); - $log['changed'] = construct_user_display($user->objdata); + $log['changed'] = construct_user_display($user->record); } } } BSFunctions::swap_css_classes('', 'altcolor'); - $bgcolor = BSFunctions::$cssClass; - eval('$history .= "' . $template->fetch('history_bit') . '";'); + $tpl = new BSTemplate('history_bit'); + $tpl->vars = array( + 'bgcolor' => BSFunctions::$cssClass, + 'log' => $log + ); + $history .= $tpl->evaluate()->getTemplate(); $show['group'] = false; } } @@ -172,7 +177,12 @@ if (sizeof($toKill) > 0) $db->query("DELETE FROM " . TABLE_PREFIX . "history WHERE historyid IN (" . implode(',', $toKill) . ")"); } -eval('$template->flush("' . $template->fetch('history') . '");'); +$tpl = new BSTemplate('history'); +$tpl->vars = array( + 'history' => $history, + 'bug' => $bug +); +$tpl->evaluate()->flush(); /*=====================================================================*\ || ################################################################### diff --git a/templates/history.tpl b/templates/history.tpl index a38d9c8..d7ab840 100644 --- a/templates/history.tpl +++ b/templates/history.tpl @@ -9,7 +9,7 @@ <%- $header %> -

{@"History for %1$s (bugid: %2$s)"}

+

<%- sprintf(T('History for %1$s (bugid: %2$s)'), $bug['summary'], $bug['bugid']) %>

-- 2.43.5