From 8d1d572061afeb9ab491d9afc9ef143aba8faba0 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 19 Aug 2008 13:04:34 -0400 Subject: [PATCH] Updating userctrl.php --- templates/userctrl.tpl | 18 +++++++-------- userctrl.php | 52 +++++++++++++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/templates/userctrl.tpl b/templates/userctrl.tpl index e855310..3831244 100644 --- a/templates/userctrl.tpl +++ b/templates/userctrl.tpl @@ -29,7 +29,7 @@
<%-T("User Options")%>
- + <% if (bugdar::$options['authmethod'] == 'default'): %>
<%-T("Display Name")%> @@ -39,13 +39,13 @@
<%-T("Show Email Publicly")%> checked="checked"<% endif %> /> <%-T("Yes")%> - checked="checked"<% endif %> /> <%-T("No")%> + checked="checked"<% endif %> /> <%-T("No")%>
<%-T("Show Status Colors on Bug Listings")%> checked="checked"<% endif %> /> <%-T("Yes")%> - checked="checked"<% endif %> /> <%-T("No")%> + checked="checked"<% endif %> /> <%-T("No")%>
@@ -59,8 +59,8 @@
- {@"Observe Daylight Savings Time (DST)"} - checked="checked"<% endif %> /> {@"Yes, I'm currently observing DST"} + <%-T("Observe Daylight Savings Time (DST)")%> + checked="checked"<% endif %> /> <%-T("Yes, I'm currently observing DST")%>
@@ -103,7 +103,7 @@ - {@"'Duplicates' field is changed"} + <%-T("'Duplicates' field is changed")%> value="1" /> value="1" /> value="1" /> @@ -121,7 +121,7 @@ - <%-T("A new attachment is added")%> + <%-T("A new attachment is added")%> value="1" /> value="1" /> value="1" /> @@ -130,7 +130,7 @@ - <%-T("Any other field changes")%> + <%-T("Any other field changes")%> value="1" /> value="1" /> value="1" /> @@ -158,7 +158,7 @@ - + <% if (bugdar::$options['authmethod'] == 'default'): %>
diff --git a/userctrl.php b/userctrl.php index 6c05092..3981483 100644 --- a/userctrl.php +++ b/userctrl.php @@ -33,8 +33,6 @@ require_once('./global.php'); require_once('./includes/class_api_error.php'); require_once('./includes/api_user.php'); -APIError(array(new API_Error_Handler($message), 'user_cumulative')); - if (!bugdar::$userinfo['userid']) { $message->errorPermission(); @@ -42,7 +40,7 @@ if (!bugdar::$userinfo['userid']) $userapi = new UserAPI($bugsys); $userapi->set('userid', bugdar::$userinfo['userid']); -$userapi->set_condition(); +$userapi->setCondition(); $userinfo = bugdar::$userinfo; @@ -210,10 +208,15 @@ if ($_REQUEST['do'] == 'modify') $defaultsortkey = construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $userinfo['defaultsortkey']); $defaultsortas = construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $userinfo['defaultsortas']); - foreach ($datef->fetch_timezone_list() AS $value => $label) + foreach ($datef->fetch_timezone_list() as $value => $label) { - $selected = ($value == $userinfo['timezone']); - eval('$tzselect .= "' . $template->fetch('selectoption') . '";'); + $tpl = new BSTemplate('selectoption'); + $tpl->vars = array( + 'value' => $value, + 'label' => $label, + 'selected' => ($value == $userinfo['timezone']) + ); + $tzselect .= $tpl->evaluate()->getTemplate(); } $checked = array(); @@ -264,15 +267,27 @@ if ($_REQUEST['do'] == 'modify') { $columns["$column"] = bugdar::$options['columnoptions']["$column"]; } - eval('$columnOptions .= "' . $template->fetch('userctrl_column') . '";'); + $tpl = new BSTemplate('userctrl_column'); + $tpl->vars = array( + 'columns' => $columns, + 'column' => $column, + 'name' => $name + ); + $columnOptions .= $tpl->evaluate()->getTemplate(); } } else { $columns = $input->in['columnoptions']; - foreach (ListSorter::fetch_by_text(false) AS $column => $name) + foreach (ListSorter::fetch_by_text(false) as $column => $name) { - eval('$columnOptions .= "' . $template->fetch('userctrl_column') . '";'); + $tpl = new BSTemplate('userctrl_column'); + $tpl->vars = array( + 'columns' => $columns, + 'column' => $column, + 'name' => $name + ); + $columnOptions .= $tpl->evaluate()->getTemplate(); } } @@ -281,10 +296,25 @@ if ($_REQUEST['do'] == 'modify') $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . bugdar::$userinfo['userid']); foreach ($searchesFetch as $search) { - eval('$searches .= "' . $template->fetch('userctrl_search') . '";'); + $tpl = new BSTemplate('userctrl_search'); + $tpl->vars = array('search' => $search); + $searches .= $tpl->evaluate()->getTemplate(); } - eval('$template->flush("' . $template->fetch('userctrl') . '");'); + $tpl = new BSTemplate('userctrl'); + $tpl->vars = array( + 'checked' => $checked, + 'userinfo' => $userinfo, + 'searches' => $searches, + 'defaultsortkey' => $defaultsortkey, + 'hidestatusesnum' => $hidestatusesnum, + 'hidestatuses' => $hidestatuses, + 'defaultsortas' => $defaultsortas, + 'columnOptions' => $columnOptions, + 'langselect' => $langselect, + 'tzselect' => $tzselect + ); + $tpl->evaluate()->flush(); } /*=====================================================================*\ -- 2.43.5